apps 0.0.1-beta.21 → 0.0.1-beta.22
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-VXWY44LE.js → chunk-2KZ7GG43.js} +3 -3
- package/js/{chunk-CHAK4P5C.js → chunk-3HH4OZR3.js} +5 -5
- package/js/{chunk-4QQ62BVS.js → chunk-66JAEDTE.js} +5 -2
- package/js/{chunk-XNCYIB4D.js → chunk-A5BSZKFF.js} +3 -3
- package/js/{chunk-OZ4UK3CD.js → chunk-AK54RD3A.js} +1 -1
- package/js/{chunk-BLI53LPN.js → chunk-B3T7CZOH.js} +64 -17
- package/js/{chunk-RAAPJMVZ.js → chunk-JWNSH5CA.js} +4 -3
- package/js/{chunk-CMRKLZZY.js → chunk-K2QATKIF.js} +2 -2
- package/js/{chunk-NMKHTJOQ.js → chunk-S47NFEWF.js} +2 -2
- package/js/{chunk-625MBYU4.js → chunk-WFEUCUFF.js} +4 -3
- package/js/client.js +1 -1
- package/js/contracts.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 +17 -11
- package/js/mcp/effect.js +8 -8
- package/js/mcp/stdio.js +8 -8
- package/js/mcp.js +38 -25
- package/js/openapi.js +5 -5
- package/js/skills.js +2 -2
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/mcp.d.ts +18 -7
- package/types/apps/src/contracts/operations.d.ts +5 -1
- package/types/apps/src/implementation/mcp-call.d.ts +3 -3
- package/types/apps/src/implementation/mcp-client.d.ts +3 -3
- package/types/apps/src/implementation/mcp.d.ts +3 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
- package/types/apps/src/implementation/schema.d.ts +8 -0
|
@@ -38,15 +38,21 @@ export interface McpConnection {
|
|
|
38
38
|
readonly timeoutMs: number;
|
|
39
39
|
}
|
|
40
40
|
export { ToolAnnotations as McpToolAnnotations } from "./tools.js";
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Native MCP result semantics, and the value every MCP tool call returns. A tool's output
|
|
43
|
+
* schema is built from this declaration. Protocol/transport failures use the Effect error channel.
|
|
44
|
+
*/
|
|
42
45
|
export declare const McpToolResult: Schema.Struct<{
|
|
43
46
|
readonly content: Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
44
|
-
readonly structuredContent: Schema.
|
|
45
|
-
readonly isError: Schema.
|
|
46
|
-
readonly _meta: Schema.
|
|
47
|
+
readonly structuredContent: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
48
|
+
readonly isError: Schema.optionalKey<Schema.Boolean>;
|
|
49
|
+
readonly _meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
47
50
|
}>;
|
|
48
51
|
export type McpToolResult = typeof McpToolResult.Type;
|
|
49
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Remote metadata. Input/output schemas remain upstream JSON Schema documents; the upstream
|
|
54
|
+
* output schema describes only a result's `structuredContent`.
|
|
55
|
+
*/
|
|
50
56
|
export declare const McpToolMetadata: Schema.Struct<{
|
|
51
57
|
readonly name: Schema.String;
|
|
52
58
|
readonly title: Schema.optional<Schema.String>;
|
|
@@ -83,10 +89,15 @@ export type McpServerHeader = typeof McpServerHeader.Type;
|
|
|
83
89
|
export interface McpToolContext {
|
|
84
90
|
readonly elicit?: Elicit;
|
|
85
91
|
}
|
|
86
|
-
/**
|
|
87
|
-
|
|
92
|
+
/**
|
|
93
|
+
* A tool bound to one evaluation's account; do not reuse it with another account. `output`
|
|
94
|
+
* decodes and describes the `McpToolResult` that `run` returns, with the upstream output schema
|
|
95
|
+
* under `structuredContent`.
|
|
96
|
+
*/
|
|
97
|
+
export interface McpTool extends Omit<McpToolMetadata, "outputSchema"> {
|
|
88
98
|
readonly description: string;
|
|
89
99
|
readonly input: Schema.Decoder<JsonValue>;
|
|
100
|
+
readonly output: Schema.Decoder<JsonValue>;
|
|
90
101
|
readonly readOnly?: boolean;
|
|
91
102
|
readonly run: (context: McpToolContext, input: JsonValue) => Effect.Effect<McpToolResult, McpError | ProviderError | ElicitationFailed>;
|
|
92
103
|
}
|
|
@@ -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>;
|
|
@@ -12,9 +12,9 @@ export declare const mcpCall: (client: Client, name: string, input: JsonObject,
|
|
|
12
12
|
}[];
|
|
13
13
|
readonly _meta?: {
|
|
14
14
|
readonly [x: string]: Schema.Json;
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
readonly structuredContent?: {
|
|
17
17
|
readonly [x: string]: Schema.Json;
|
|
18
|
-
}
|
|
19
|
-
readonly isError?: boolean
|
|
18
|
+
};
|
|
19
|
+
readonly isError?: boolean;
|
|
20
20
|
}, ProviderError | ElicitationFailed | McpError, never>;
|
|
@@ -56,11 +56,11 @@ export declare function mcpClient(withClient: WithMcpClient, timeoutMs: number,
|
|
|
56
56
|
}[];
|
|
57
57
|
readonly _meta?: {
|
|
58
58
|
readonly [x: string]: Schema.Json;
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
60
|
readonly structuredContent?: {
|
|
61
61
|
readonly [x: string]: Schema.Json;
|
|
62
|
-
}
|
|
63
|
-
readonly isError?: boolean
|
|
62
|
+
};
|
|
63
|
+
readonly isError?: boolean;
|
|
64
64
|
}, ProviderError | import("../index.js").ElicitationFailed | McpError, never>;
|
|
65
65
|
};
|
|
66
66
|
/** Transport-independent operations consumed by the app tool adapter. */
|
|
@@ -46,11 +46,11 @@ export declare const mcpClientEffect: (input: McpToolsOptions, changed?: Effect.
|
|
|
46
46
|
}[];
|
|
47
47
|
readonly _meta?: {
|
|
48
48
|
readonly [x: string]: Schema.Json;
|
|
49
|
-
}
|
|
49
|
+
};
|
|
50
50
|
readonly structuredContent?: {
|
|
51
51
|
readonly [x: string]: Schema.Json;
|
|
52
|
-
}
|
|
53
|
-
readonly isError?: boolean
|
|
52
|
+
};
|
|
53
|
+
readonly isError?: boolean;
|
|
54
54
|
}, ProviderError | import("../index.js").ElicitationFailed | McpError, never>;
|
|
55
55
|
}, McpError, never>;
|
|
56
56
|
/** Discover and compile all tools for connection probes and low-level consumers. */
|
|
@@ -13,6 +13,9 @@ interface ProtocolOperation {
|
|
|
13
13
|
readonly annotations?: ToolAnnotations | undefined;
|
|
14
14
|
readonly _meta?: JsonObject | undefined;
|
|
15
15
|
readonly input: Schema.Decoder<JsonValue>;
|
|
16
|
+
/** Checks and describes every returned value. */
|
|
17
|
+
readonly output?: Schema.Decoder<JsonValue> | undefined;
|
|
18
|
+
/** Describes the returned value without checking it; ignored when `output` is declared. */
|
|
16
19
|
readonly outputSchema?: JsonObject | undefined;
|
|
17
20
|
readonly run: (context: OperationContext, input: JsonValue) => Effect.Effect<unknown, unknown>;
|
|
18
21
|
}
|
|
@@ -120,6 +120,14 @@ export declare const compileJsonSchemaDecoder: (document: JsonObject) => Effect.
|
|
|
120
120
|
};
|
|
121
121
|
}, ValidationError, never>;
|
|
122
122
|
export declare const lazyJsonSchemaDecoder: (document: () => JsonObject) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, never, never>;
|
|
123
|
+
/**
|
|
124
|
+
* A lazy decoder and the compilation it decodes with. Running `compile` first lets a caller
|
|
125
|
+
* reject an unsupported schema before a side effect whose result the decoder will check.
|
|
126
|
+
*/
|
|
127
|
+
export declare const preparedJsonSchemaDecoder: (document: JsonObject) => {
|
|
128
|
+
decoder: EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>;
|
|
129
|
+
compile: Effect.Effect<EffectSchema.Decoder<EffectSchema.Json, never>, ValidationError, never>;
|
|
130
|
+
};
|
|
123
131
|
/** Preserve the JSON document; compile its validator only when a value is first decoded. */
|
|
124
132
|
export declare const jsonSchemaDecoder: (input: unknown) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, ValidationError, never>;
|
|
125
133
|
/** Import JSON metadata now; unsupported schemas and invalid values fail when parsed. */
|