apps 0.0.1-beta.87 → 0.0.1-beta.88

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.
@@ -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,6 +20,7 @@ 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
26
  export { OAuthAuthorizationParams, OAuthClientAuth, OAuthSecretClientAuth, OAuthTokenRequestFormat, OAuthTokenResponse, } from "./provider.js";
@@ -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<{
@@ -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>;
@@ -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. */