apps 0.0.1-beta.87 → 0.0.1-beta.89
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-I6Q7ZPKJ.js → chunk-5ZVAYXLT.js} +1 -1
- package/js/{chunk-XBHWCCNB.js → chunk-6FUJH3T4.js} +4 -4
- package/js/{chunk-OEZI25CT.js → chunk-7Z3NUCTP.js} +10 -5
- package/js/{chunk-W6XCQAXP.js → chunk-BZFFXNWA.js} +2 -2
- package/js/{chunk-H2CJWXA3.js → chunk-DDHBUKXX.js} +16 -0
- package/js/{chunk-FVYCYTYL.js → chunk-EKZLPXHK.js} +5 -5
- package/js/{chunk-EZUX2YJS.js → chunk-ELSILABS.js} +13 -12
- package/js/{chunk-Q4IZAUIF.js → chunk-F2G534HD.js} +1 -1
- package/js/{chunk-JF6FO6YA.js → chunk-GLXEYET6.js} +3 -3
- package/js/{chunk-A3HPRNJC.js → chunk-GQ33QSNB.js} +29 -1
- package/js/{chunk-7R73XVF3.js → chunk-H6NFR354.js} +7 -7
- package/js/{chunk-2P7BTRWZ.js → chunk-I46RIOKQ.js} +6 -6
- package/js/{chunk-CDXQDN7W.js → chunk-JJH3MBAM.js} +1 -1
- package/js/{chunk-WUPLD4VN.js → chunk-NQW2E44U.js} +41 -3
- package/js/{chunk-7NTL2NOR.js → chunk-ZK7JDZJS.js} +2 -2
- package/js/client.js +3 -3
- package/js/contracts.js +11 -3
- package/js/effect.js +11 -11
- package/js/graphql.js +13 -13
- package/js/host.js +11 -11
- package/js/index.js +18 -8
- package/js/mcp/effect.js +12 -12
- package/js/mcp.js +14 -14
- package/js/openapi.js +9 -9
- package/js/skills.js +7 -7
- package/js/ui/contracts.js +2 -2
- package/js/ui/serving.js +2 -2
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +2 -0
- package/types/apps/src/contracts/context.d.ts +6 -0
- package/types/apps/src/contracts/host.d.ts +2 -1
- package/types/apps/src/contracts/icons.d.ts +28 -0
- package/types/apps/src/contracts/protocols/current.d.ts +14 -0
- package/types/apps/src/contracts/schema.d.ts +21 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/provider.d.ts +2 -2
- package/types/apps/src/implementation/router-catalog.d.ts +3 -3
- package/types/apps/src/implementation/schema.d.ts +8 -1
- package/types/apps/src/index.d.ts +2 -1
|
@@ -59,6 +59,8 @@ export interface App<Slots extends AccountSlots, Def extends AppDefinition<never
|
|
|
59
59
|
readonly accounts: Slots;
|
|
60
60
|
/** Declared beside the accounts, so a host lists them without evaluating the app. */
|
|
61
61
|
readonly events?: Readonly<Record<string, import("./events.js").AppEvent>>;
|
|
62
|
+
/** Declared beside the accounts and checked when the module loads. */
|
|
63
|
+
readonly icons?: import("./icons.js").AppIcons;
|
|
62
64
|
readonly evaluate: (context: BoundContext<Slots>) => Effect.Effect<Def, unknown>;
|
|
63
65
|
}
|
|
64
66
|
declare const NotImplemented_base: Schema.Class<NotImplemented, Schema.TaggedStruct<"NotImplemented", {
|
|
@@ -3,11 +3,17 @@ import type { WorkflowControls } from "./workflows.js";
|
|
|
3
3
|
import type { AccountSlots, BoundContext } from "./app.js";
|
|
4
4
|
import type { Sql, SqlReader } from "./sql.js";
|
|
5
5
|
import type { AnyEventDeclaration, EventEmitter } from "../implementation/events.js";
|
|
6
|
+
import type { AppIcon } from "./icons.js";
|
|
6
7
|
/** Requirements are pure values; selected accounts and SQL access belong to invocations. */
|
|
7
8
|
export interface AppRequirements {
|
|
8
9
|
readonly accounts: AccountSlots;
|
|
9
10
|
/** Events this app emits, by name, such as `issue.opened`. */
|
|
10
11
|
readonly events?: Readonly<Record<string, AnyEventDeclaration>>;
|
|
12
|
+
/**
|
|
13
|
+
* Images a dashboard shows for the app, such as its logo in light and dark variants. Each `src`
|
|
14
|
+
* is base64 `data:image/...` or an `https:` URL; at most 8 icons and 32 KiB in total.
|
|
15
|
+
*/
|
|
16
|
+
readonly icons?: ReadonlyArray<AppIcon>;
|
|
11
17
|
}
|
|
12
18
|
/** The emitter for an app's declared events. */
|
|
13
19
|
type EventsContext<Requirements extends AppRequirements> = {
|
|
@@ -20,9 +20,10 @@ export { ElicitationLimits, defaultElicitationLimits, FormElicitation, Elicitati
|
|
|
20
20
|
export { McpClientLimits, defaultMcpClientLimits } from "./mcp.js";
|
|
21
21
|
export * from "./webhook-protocol.js";
|
|
22
22
|
export * from "./events.js";
|
|
23
|
+
export { AppIcon, AppIcons, appIconLimits } from "./icons.js";
|
|
23
24
|
export * from "./placement.js";
|
|
24
25
|
export { AccountId, HttpUrl } from "./schema.js";
|
|
25
|
-
export { OAuthAuthorizationParams, OAuthClientAuth, OAuthSecretClientAuth, OAuthTokenRequestFormat, OAuthTokenResponse, } from "./provider.js";
|
|
26
|
+
export { OAuthAuthorizationParams, OAuthClientAuth, OAuthSecretClientAuth, OAuthTokenRequestFormat, OAuthTokenResponse, reservedAuthorizationParams, type ReservedAuthorizationParam, } from "./provider.js";
|
|
26
27
|
/**
|
|
27
28
|
* The host protocol this framework speaks and its wire schemas, from `protocols/current.ts`. The
|
|
28
29
|
* released protocol modules are frozen records that host adapters read.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** The icons an app declares beside its accounts, so a host shows them without evaluating it. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** At most this many icons, together at most this many characters of JSON (32 KiB). */
|
|
4
|
+
export declare const appIconLimits: {
|
|
5
|
+
readonly icons: 8;
|
|
6
|
+
readonly characters: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* One image an app shows for itself, the same shape as a router's icon. `theme` names the color
|
|
10
|
+
* scheme it is drawn for; an icon without one suits both.
|
|
11
|
+
*/
|
|
12
|
+
export declare const AppIcon: Schema.Struct<{
|
|
13
|
+
readonly src: Schema.String;
|
|
14
|
+
readonly mimeType: Schema.optionalKey<Schema.String>;
|
|
15
|
+
readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
16
|
+
readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
|
|
17
|
+
}>;
|
|
18
|
+
export type AppIcon = typeof AppIcon.Type;
|
|
19
|
+
/** An app's icons, bounded in number and total size. */
|
|
20
|
+
export declare const AppIcons: Schema.$Array<Schema.Struct<{
|
|
21
|
+
readonly src: Schema.String;
|
|
22
|
+
readonly mimeType: Schema.optionalKey<Schema.String>;
|
|
23
|
+
readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
24
|
+
readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
|
|
25
|
+
}>>;
|
|
26
|
+
export type AppIcons = typeof AppIcons.Type;
|
|
27
|
+
/** Why declared icons are refused, in the author's terms, or undefined when they are valid. */
|
|
28
|
+
export declare const appIconsProblem: (icons: unknown) => string | undefined;
|
|
@@ -663,6 +663,13 @@ export declare const DeclaredRequirements: Schema.Struct<{
|
|
|
663
663
|
readonly filters: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
664
664
|
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
665
665
|
}>>>;
|
|
666
|
+
/** The icons the app declares, so a host shows them without evaluating the app. */
|
|
667
|
+
readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
668
|
+
readonly src: Schema.String;
|
|
669
|
+
readonly mimeType: Schema.optionalKey<Schema.String>;
|
|
670
|
+
readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
671
|
+
readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
|
|
672
|
+
}>>>;
|
|
666
673
|
}>;
|
|
667
674
|
/** Parsed declared account requirements. */
|
|
668
675
|
export type DeclaredRequirements = typeof DeclaredRequirements.Type;
|
|
@@ -3175,6 +3182,13 @@ export declare const current: {
|
|
|
3175
3182
|
readonly filters: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
3176
3183
|
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
3177
3184
|
}>>>;
|
|
3185
|
+
/** The icons the app declares, so a host shows them without evaluating the app. */
|
|
3186
|
+
readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
3187
|
+
readonly src: Schema.String;
|
|
3188
|
+
readonly mimeType: Schema.optionalKey<Schema.String>;
|
|
3189
|
+
readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
3190
|
+
readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
|
|
3191
|
+
}>>>;
|
|
3178
3192
|
}>;
|
|
3179
3193
|
readonly catalog: Schema.Struct<{
|
|
3180
3194
|
readonly tools: Schema.$Array<Schema.Struct<{
|
|
@@ -12,6 +12,27 @@ export declare const AccountId: Schema.brand<Schema.String, "acc">;
|
|
|
12
12
|
export type AccountId = typeof AccountId.Type;
|
|
13
13
|
/** Absolute HTTP(S) URL; local HTTP hosts are supported. */
|
|
14
14
|
export declare const HttpUrl: Schema.String;
|
|
15
|
+
/** One problem with a declaration: where in it, and what is wrong there. */
|
|
16
|
+
export declare const DeclarationIssue: Schema.Struct<{
|
|
17
|
+
readonly path: Schema.$Array<Schema.String>;
|
|
18
|
+
readonly message: Schema.String;
|
|
19
|
+
}>;
|
|
20
|
+
export type DeclarationIssue = typeof DeclarationIssue.Type;
|
|
21
|
+
declare const DeclarationInvalid_base: Schema.Class<DeclarationInvalid, Schema.TaggedStruct<"DeclarationInvalid", {
|
|
22
|
+
readonly declaration: Schema.String;
|
|
23
|
+
readonly issues: Schema.$Array<Schema.Struct<{
|
|
24
|
+
readonly path: Schema.$Array<Schema.String>;
|
|
25
|
+
readonly message: Schema.String;
|
|
26
|
+
}>>;
|
|
27
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28
|
+
/**
|
|
29
|
+
* An author's declaration, such as the options of `oauth2()`, did not match its schema. Unlike
|
|
30
|
+
* {@link ValidationError} it names each failing path and problem, because the value is the
|
|
31
|
+
* author's own source. Messages never include supplied values.
|
|
32
|
+
*/
|
|
33
|
+
export declare class DeclarationInvalid extends DeclarationInvalid_base {
|
|
34
|
+
get message(): string;
|
|
35
|
+
}
|
|
15
36
|
declare const ValidationError_base: Schema.Class<ValidationError, Schema.TaggedStruct<"ValidationError", {}>, import("effect/Cause").YieldableError>;
|
|
16
37
|
/** Invalid input. Never includes supplied values, credentials or response bodies. */
|
|
17
38
|
export declare class ValidationError extends ValidationError_base {
|
|
@@ -25,12 +25,13 @@ export declare const compileOpenApiDocument: (entry: OpenApiImport, inputDocumen
|
|
|
25
25
|
readonly fallbackSecurity?: GeneratedOperation["request"]["security"];
|
|
26
26
|
}) => Effect.Effect<{
|
|
27
27
|
operations: {
|
|
28
|
+
readonly path: string;
|
|
28
29
|
readonly method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "QUERY";
|
|
29
30
|
readonly description: string;
|
|
30
31
|
readonly name: string;
|
|
31
32
|
readonly request: {
|
|
32
33
|
readonly parameters: readonly {
|
|
33
|
-
readonly in: "
|
|
34
|
+
readonly in: "path" | "header" | "query" | "querystring" | "cookie";
|
|
34
35
|
readonly name: string;
|
|
35
36
|
readonly required?: boolean;
|
|
36
37
|
readonly schema?: {
|
|
@@ -66,7 +67,6 @@ export declare const compileOpenApiDocument: (entry: OpenApiImport, inputDocumen
|
|
|
66
67
|
readonly required?: boolean;
|
|
67
68
|
};
|
|
68
69
|
};
|
|
69
|
-
readonly path: string;
|
|
70
70
|
readonly input: {
|
|
71
71
|
readonly [x: string]: Schema.Json;
|
|
72
72
|
};
|
|
@@ -3,7 +3,7 @@ import { Effect, Schema } from "effect";
|
|
|
3
3
|
import { type PromiseMethod } from "./authoring.js";
|
|
4
4
|
import { type AccountCheck, type AuthMethods, type FieldExposure, OAuth2Config, OAuth2Method, Provider, SecretsMethod } from "../contracts/provider.js";
|
|
5
5
|
import type { Placement } from "../contracts/placement.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { DeclarationInvalid } from "../contracts/schema.js";
|
|
7
7
|
/** Declare a secrets method with an Effect decoder. */
|
|
8
8
|
export declare const secrets: <Fields extends Schema.Decoder<unknown>>(options: {
|
|
9
9
|
readonly label: string;
|
|
@@ -12,7 +12,7 @@ export declare const secrets: <Fields extends Schema.Decoder<unknown>>(options:
|
|
|
12
12
|
readonly request?: readonly Placement[];
|
|
13
13
|
}) => SecretsMethod<Fields>;
|
|
14
14
|
/** Validate OAuth endpoints while declaring their app-visible response projection. */
|
|
15
|
-
export declare const oauth2: <Response extends Schema.Decoder<unknown>>(config: OAuth2Config, response: Response, exposure?: Readonly<Record<string, FieldExposure>>, request?: readonly Placement[]) => Effect.Effect<OAuth2Method<Response>,
|
|
15
|
+
export declare const oauth2: <Response extends Schema.Decoder<unknown>>(config: OAuth2Config, response: Response, exposure?: Readonly<Record<string, FieldExposure>>, request?: readonly Placement[]) => Effect.Effect<OAuth2Method<Response>, DeclarationInvalid>;
|
|
16
16
|
/** Author options: the account check is an ordinary async function. */
|
|
17
17
|
export interface ProviderOptions<Auth extends AuthMethods> {
|
|
18
18
|
readonly name: string;
|
|
@@ -190,15 +190,15 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
|
|
|
190
190
|
readonly description?: string;
|
|
191
191
|
readonly error?: import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed;
|
|
192
192
|
readonly title?: string;
|
|
193
|
-
readonly tags?: {
|
|
194
|
-
readonly [x: string]: string;
|
|
195
|
-
};
|
|
196
193
|
readonly icons?: readonly {
|
|
197
194
|
readonly src: string;
|
|
198
195
|
readonly mimeType?: string;
|
|
199
196
|
readonly sizes?: readonly string[];
|
|
200
197
|
readonly theme?: "light" | "dark";
|
|
201
198
|
}[];
|
|
199
|
+
readonly tags?: {
|
|
200
|
+
readonly [x: string]: string;
|
|
201
|
+
};
|
|
202
202
|
readonly skill?: string;
|
|
203
203
|
}[];
|
|
204
204
|
}, import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Author schema facade. Internals use the native decoder retained by each value. */
|
|
2
2
|
import { Effect, Schema as EffectSchema } from "effect";
|
|
3
|
-
import { JsonObject, ValidationError } from "../contracts/schema.js";
|
|
3
|
+
import { DeclarationInvalid, JsonObject, ValidationError } from "../contracts/schema.js";
|
|
4
4
|
import type { FieldExposure } from "../contracts/provider.js";
|
|
5
5
|
declare const Decoder: unique symbol;
|
|
6
6
|
/** An author-facing value schema. Effect is never required in author code. */
|
|
@@ -42,6 +42,13 @@ export declare const isSchema: (value: unknown) => value is Schema<unknown, bool
|
|
|
42
42
|
export declare const schemaArgument: <S extends Schema<unknown, boolean>>(value: S, role: string) => S;
|
|
43
43
|
/** Decode within an Effect program. Invalid input is omitted from the failure. */
|
|
44
44
|
export declare const parse: <T>(decoder: EffectSchema.Decoder<T>, input: unknown) => Effect.Effect<T, ValidationError>;
|
|
45
|
+
/**
|
|
46
|
+
* Decode an author's declaration, naming every failing path. A declaration with several forms,
|
|
47
|
+
* such as `oauth2()`'s discovered, declared and client credentials endpoints, is explained by the
|
|
48
|
+
* form its author chose (`intended`), so the problems are that form's, including the options it
|
|
49
|
+
* lacks, rather than every other form's objections. Messages never include the supplied values.
|
|
50
|
+
*/
|
|
51
|
+
export declare const parseDeclaration: <T>(decoder: EffectSchema.Decoder<T>, input: unknown, declaration: string, intended?: (input: unknown) => EffectSchema.Decoder<unknown>) => Effect.Effect<T, DeclarationInvalid>;
|
|
45
52
|
/** Present a native decoder through the synchronous author API. */
|
|
46
53
|
export declare function wrap<T, Optional extends boolean>(decoder: EffectSchema.Decoder<T>, optionalValue: Optional): Schema<T, Optional>;
|
|
47
54
|
/** A string, optionally with a minimum length. No coercion. */
|
|
@@ -17,7 +17,7 @@ import type { Placement } from "./contracts/placement.js";
|
|
|
17
17
|
import type { AppContext as NativeAppContext, QueryContext as NativeQueryContext } from "./contracts/context.js";
|
|
18
18
|
import { query as operationQuery, type OperationOptions } from "./implementation/operations.js";
|
|
19
19
|
import { type Fields, type Infer, type ObjectSchema, type Schema, type SecretFields, type SecretObject } from "./implementation/schema.js";
|
|
20
|
-
export { type JsonObject, type JsonValue, ValidationError } from "./contracts/schema.js";
|
|
20
|
+
export { DeclarationInvalid, type DeclarationIssue, type JsonObject, type JsonValue, ValidationError, } from "./contracts/schema.js";
|
|
21
21
|
export { type Fields, type Infer, type ObjectSchema, type ObjectValue, type Schema, array, boolean, json, jsonSchema, literal, number, object, record, string, plain, raw, type SecretString, } from "./implementation/schema.js";
|
|
22
22
|
export { type AccountCheckContext, type AccountCheckResult, type AccountInfo, type AccountOf, type AuthMethod, type AuthMethodData, type AuthMethods, type ManyAccounts, type Provider, type ReservedAuthorizationParam, } from "./contracts/provider.js";
|
|
23
23
|
export { defineProvider, type ProviderOptions } from "./implementation/provider.js";
|
|
@@ -27,6 +27,7 @@ export type { AccountRequest } from "./contracts/provider.js";
|
|
|
27
27
|
export { accountRouter } from "./implementation/account-router.js";
|
|
28
28
|
export { router, dynamicRouter, withApprovals, renameTools, type OperationChild, type OperationDeclaration, type RouterDeclaration, type RouterChild, type RouterOptions, } from "./implementation/router.js";
|
|
29
29
|
export type { RouterIcon } from "./contracts/router.js";
|
|
30
|
+
export type { AppIcon } from "./contracts/icons.js";
|
|
30
31
|
export { dynamicSkills } from "./implementation/dynamic-skills.js";
|
|
31
32
|
export type { HostedTool as OperationDescription } from "./contracts/host.js";
|
|
32
33
|
/** Account fields as app code receives them from a method declared with this schema. */
|