apps 0.0.1-beta.95 → 0.0.1-beta.99

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.
@@ -50,7 +50,7 @@ export { DeclaredRequirements, HostRequest } from "./protocols/current.js";
50
50
  * classes from `apps/mcp` and `apps/skills`.
51
51
  */
52
52
  export { McpError, SkillLoadFailed } from "./protocols/current.js";
53
- export { DeclaredAuthMethod, DeclaredProvider, DeclaredAccountSlot, DeclaredAccountSlots, ResolvedAccount, ResolvedAccounts, ResolvedAccountSlots, TrustedToolApproval, InvocationDeadline, HostedTool, HostedToolSummary, HostRouterError, HostedRouter, HostedCatalog, HostedCatalogSummary, SkillSources, SkillCatalogResponse, HostRequestInvalid, HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostOperationNotFound, HostOperationFailed, HostToolNotFound, HostKindMismatch, InputProblem, maxInputProblems, HostInputInvalid, HostToolBlocked, HostToolApprovalRequired, HostToolPolicyFailed, HostOutputInvalid, HostError, HostResponse, HostInvocation, } from "./protocols/current.js";
53
+ export { DeclaredAuthMethod, DeclaredProvider, DeclaredAccountSlot, DeclaredAccountSlots, ResolvedAccount, ResolvedAccounts, ResolvedAccountSlots, TrustedToolApproval, InvocationDeadline, HostedTool, HostedToolSummary, HostRouterError, HostedRouter, HostedCatalog, HostedCatalogSummary, HostedSharedCatalog, HostedSharedTool, SharedSchemaKey, SkillSources, SkillCatalogResponse, HostRequestInvalid, HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostOperationNotFound, HostOperationFailed, HostToolNotFound, HostKindMismatch, InputProblem, maxInputProblems, HostInputInvalid, HostToolBlocked, HostToolApprovalRequired, HostToolPolicyFailed, HostOutputInvalid, HostError, HostResponse, HostInvocation, } from "./protocols/current.js";
54
54
  /** Raw host inputs; the host boundary parses and redacts these immediately. */
55
55
  export type ResolvedAccountsInput = typeof ResolvedAccounts.Encoded;
56
56
  /**
@@ -1479,10 +1479,16 @@ export interface SkillCatalog {
1479
1479
  }
1480
1480
  export declare const skillCatalog: (response: typeof SkillCatalogResponse.Type) => SkillCatalog;
1481
1481
  /**
1482
- * Inspection commands. Send detail or tools only to builds that declare toolIndex,
1483
- * and scheduled only to builds that declare scheduledTools.
1482
+ * Inspection commands. Send detail or tools only to builds that declare toolIndex, scheduled
1483
+ * only to builds that declare scheduledTools, and definitions only to builds that declare
1484
+ * sharedDefinitions: they answer it with a `HostedSharedCatalog`.
1484
1485
  */
1485
- export declare const inspectCommand: (tools?: readonly string[], scheduled?: true) => {
1486
+ export declare const inspectCommand: (options: {
1487
+ readonly tools?: readonly string[] | undefined;
1488
+ readonly scheduled?: true | undefined;
1489
+ readonly definitions?: "shared" | undefined;
1490
+ }) => {
1491
+ definitions?: "shared";
1486
1492
  scheduled?: true;
1487
1493
  tools?: string[];
1488
1494
  operation: "inspect";
@@ -1491,6 +1497,7 @@ export declare const indexCommand: {
1491
1497
  readonly operation: "inspect";
1492
1498
  readonly detail: "summary";
1493
1499
  };
1500
+ export { restoreSharedCatalog } from "./shared-catalog.js";
1494
1501
  /** Keep only the requested tools from an inspection that may have described every tool. */
1495
1502
  export declare const selectTools: (tools?: readonly string[]) => <A extends {
1496
1503
  readonly tools: readonly {
@@ -839,6 +839,11 @@ export declare const DeclaredRequirements: Schema.Struct<{
839
839
  readonly skillSources: Schema.optionalKey<Schema.Literal<true>>;
840
840
  /** Accepts scheduled inspection. Earlier builds reject it as an excess field. */
841
841
  readonly scheduledTools: Schema.optionalKey<Schema.Literal<true>>;
842
+ /**
843
+ * Accepts inspect definitions and answers it with a shared catalog. Earlier builds reject it
844
+ * as an excess field.
845
+ */
846
+ readonly sharedDefinitions: Schema.optionalKey<Schema.Literal<true>>;
842
847
  }>>;
843
848
  /**
844
849
  * The document database an app of protocol 9 or earlier declared. Apps of this protocol declare
@@ -2907,6 +2912,110 @@ export declare const HostedCatalogSummary: Schema.Struct<{
2907
2912
  }>>;
2908
2913
  }>;
2909
2914
  export type HostedCatalogSummary = typeof HostedCatalogSummary.Type;
2915
+ /** A tool schema whose `$defs` a shared catalog sends once, beside its tools. */
2916
+ export declare const SharedSchemaKey: Schema.Literals<readonly ["inputSchema", "outputSchema"]>;
2917
+ export type SharedSchemaKey = typeof SharedSchemaKey.Type;
2918
+ /**
2919
+ * A tool of a shared catalog. The `$defs` of each schema `shared` names is the position of its
2920
+ * entries in the catalog's `defs`; the tool's other fields are as `HostedTool`'s.
2921
+ */
2922
+ export declare const HostedSharedTool: Schema.Struct<{
2923
+ readonly shared: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inputSchema", "outputSchema"]>>>;
2924
+ readonly schedules: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2925
+ readonly name: Schema.NonEmptyString;
2926
+ readonly scope: Schema.optionalKey<Schema.Literal<"app">>;
2927
+ readonly timing: Schema.Union<readonly [Schema.Struct<{
2928
+ readonly kind: Schema.Literal<"interval">;
2929
+ readonly milliseconds: Schema.Int;
2930
+ }>, Schema.Struct<{
2931
+ readonly kind: Schema.Literal<"cron">;
2932
+ readonly calendar: Schema.Struct<{
2933
+ readonly expression: Schema.NonEmptyString;
2934
+ readonly timezone: Schema.NonEmptyString;
2935
+ }>;
2936
+ }>]>;
2937
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
2938
+ }>>>;
2939
+ readonly name: Schema.NonEmptyString;
2940
+ readonly router: Schema.optionalKey<Schema.NonEmptyString>;
2941
+ readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
2942
+ readonly description: Schema.String;
2943
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
2944
+ readonly readOnly: Schema.optionalKey<Schema.Boolean>;
2945
+ readonly title: Schema.optionalKey<Schema.String>;
2946
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
2947
+ readonly annotations: Schema.optionalKey<Schema.Struct<{
2948
+ readonly title: Schema.optionalKey<Schema.String>;
2949
+ readonly readOnlyHint: Schema.optionalKey<Schema.Boolean>;
2950
+ readonly destructiveHint: Schema.optionalKey<Schema.Boolean>;
2951
+ readonly idempotentHint: Schema.optionalKey<Schema.Boolean>;
2952
+ readonly openWorldHint: Schema.optionalKey<Schema.Boolean>;
2953
+ }>>;
2954
+ readonly _meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
2955
+ }>;
2956
+ export type HostedSharedTool = typeof HostedSharedTool.Type;
2957
+ /**
2958
+ * A catalog that sends each `$defs` its tools' schemas hold once, and each definition in them
2959
+ * once. Routers such as the OpenAPI importer give every tool the definitions its schemas reach,
2960
+ * which for a densely connected document is most of the document again for each tool, under the
2961
+ * same few hundred `$defs`. Putting each tool's `$defs` back gives the `HostedCatalog` the bundle
2962
+ * evaluated. Only builds that declare the sharedDefinitions capability send it, and only when
2963
+ * the inspection asks.
2964
+ */
2965
+ export declare const HostedSharedCatalog: Schema.Struct<{
2966
+ readonly tools: Schema.$Array<Schema.Struct<{
2967
+ readonly shared: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inputSchema", "outputSchema"]>>>;
2968
+ readonly schedules: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2969
+ readonly name: Schema.NonEmptyString;
2970
+ readonly scope: Schema.optionalKey<Schema.Literal<"app">>;
2971
+ readonly timing: Schema.Union<readonly [Schema.Struct<{
2972
+ readonly kind: Schema.Literal<"interval">;
2973
+ readonly milliseconds: Schema.Int;
2974
+ }>, Schema.Struct<{
2975
+ readonly kind: Schema.Literal<"cron">;
2976
+ readonly calendar: Schema.Struct<{
2977
+ readonly expression: Schema.NonEmptyString;
2978
+ readonly timezone: Schema.NonEmptyString;
2979
+ }>;
2980
+ }>]>;
2981
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
2982
+ }>>>;
2983
+ readonly name: Schema.NonEmptyString;
2984
+ readonly router: Schema.optionalKey<Schema.NonEmptyString>;
2985
+ readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
2986
+ readonly description: Schema.String;
2987
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
2988
+ readonly readOnly: Schema.optionalKey<Schema.Boolean>;
2989
+ readonly title: Schema.optionalKey<Schema.String>;
2990
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
2991
+ readonly annotations: Schema.optionalKey<Schema.Struct<{
2992
+ readonly title: Schema.optionalKey<Schema.String>;
2993
+ readonly readOnlyHint: Schema.optionalKey<Schema.Boolean>;
2994
+ readonly destructiveHint: Schema.optionalKey<Schema.Boolean>;
2995
+ readonly idempotentHint: Schema.optionalKey<Schema.Boolean>;
2996
+ readonly openWorldHint: Schema.optionalKey<Schema.Boolean>;
2997
+ }>>;
2998
+ readonly _meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
2999
+ }>>;
3000
+ readonly routers: Schema.$Array<Schema.Struct<{
3001
+ readonly path: Schema.String;
3002
+ readonly title: Schema.optionalKey<Schema.String>;
3003
+ readonly description: Schema.optionalKey<Schema.String>;
3004
+ readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3005
+ readonly src: Schema.NonEmptyString;
3006
+ readonly mimeType: Schema.optionalKey<Schema.String>;
3007
+ readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
3008
+ readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
3009
+ }>>>;
3010
+ readonly tags: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
3011
+ readonly skill: Schema.optionalKey<Schema.NonEmptyString>;
3012
+ readonly error: Schema.optionalKey<Schema.Union<readonly [typeof ProviderError, typeof McpError, typeof SkillLoadFailed, typeof HostDeclarationInvalid, typeof HostEvaluationFailed]>>;
3013
+ }>>;
3014
+ readonly definitions: Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
3015
+ /** Each distinct `$defs`, its entries naming positions in `definitions`. */
3016
+ readonly defs: Schema.$Array<Schema.$Record<Schema.String, Schema.Int>>;
3017
+ }>;
3018
+ export type HostedSharedCatalog = typeof HostedSharedCatalog.Type;
2910
3019
  /**
2911
3020
  * A skill catalog and whether any of it came from `dynamicSkills`. Without a live loader the
2912
3021
  * catalog is determined by the build and its evaluation inputs; with one it reflects a publisher.
@@ -3055,6 +3164,11 @@ export declare const HostRequest: Schema.Union<readonly [Schema.Union<readonly [
3055
3164
  * Only builds that declare the scheduledTools capability accept this.
3056
3165
  */
3057
3166
  readonly scheduled: Schema.optionalKey<Schema.Literal<true>>;
3167
+ /**
3168
+ * Answer with a HostedSharedCatalog, each shared `$defs` entry sent once. Only builds that
3169
+ * declare the sharedDefinitions capability accept this.
3170
+ */
3171
+ readonly definitions: Schema.optionalKey<Schema.Literal<"shared">>;
3058
3172
  }>, Schema.Struct<{
3059
3173
  readonly operation: Schema.Literal<"skills">;
3060
3174
  /** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
@@ -3261,6 +3375,11 @@ export declare const HostInvocation: Schema.Struct<{
3261
3375
  * Only builds that declare the scheduledTools capability accept this.
3262
3376
  */
3263
3377
  readonly scheduled: Schema.optionalKey<Schema.Literal<true>>;
3378
+ /**
3379
+ * Answer with a HostedSharedCatalog, each shared `$defs` entry sent once. Only builds that
3380
+ * declare the sharedDefinitions capability accept this.
3381
+ */
3382
+ readonly definitions: Schema.optionalKey<Schema.Literal<"shared">>;
3264
3383
  }>, Schema.Struct<{
3265
3384
  readonly operation: Schema.Literal<"skills">;
3266
3385
  /** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
@@ -4113,6 +4232,7 @@ export declare const messageDirections: {
4113
4232
  readonly requirements: "bundle";
4114
4233
  readonly catalog: "bundle";
4115
4234
  readonly catalogSummary: "bundle";
4235
+ readonly sharedCatalog: "bundle";
4116
4236
  readonly tools: "bundle";
4117
4237
  readonly toolSummaries: "bundle";
4118
4238
  readonly skills: "bundle";
@@ -4204,6 +4324,11 @@ export declare const current: {
4204
4324
  * Only builds that declare the scheduledTools capability accept this.
4205
4325
  */
4206
4326
  readonly scheduled: Schema.optionalKey<Schema.Literal<true>>;
4327
+ /**
4328
+ * Answer with a HostedSharedCatalog, each shared `$defs` entry sent once. Only builds that
4329
+ * declare the sharedDefinitions capability accept this.
4330
+ */
4331
+ readonly definitions: Schema.optionalKey<Schema.Literal<"shared">>;
4207
4332
  }>, Schema.Struct<{
4208
4333
  readonly operation: Schema.Literal<"skills">;
4209
4334
  /** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
@@ -5112,6 +5237,11 @@ export declare const current: {
5112
5237
  * Only builds that declare the scheduledTools capability accept this.
5113
5238
  */
5114
5239
  readonly scheduled: Schema.optionalKey<Schema.Literal<true>>;
5240
+ /**
5241
+ * Answer with a HostedSharedCatalog, each shared `$defs` entry sent once. Only builds that
5242
+ * declare the sharedDefinitions capability accept this.
5243
+ */
5244
+ readonly definitions: Schema.optionalKey<Schema.Literal<"shared">>;
5115
5245
  }>, Schema.Struct<{
5116
5246
  readonly operation: Schema.Literal<"skills">;
5117
5247
  /** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
@@ -5166,6 +5296,11 @@ export declare const current: {
5166
5296
  readonly skillSources: Schema.optionalKey<Schema.Literal<true>>;
5167
5297
  /** Accepts scheduled inspection. Earlier builds reject it as an excess field. */
5168
5298
  readonly scheduledTools: Schema.optionalKey<Schema.Literal<true>>;
5299
+ /**
5300
+ * Accepts inspect definitions and answers it with a shared catalog. Earlier builds reject it
5301
+ * as an excess field.
5302
+ */
5303
+ readonly sharedDefinitions: Schema.optionalKey<Schema.Literal<true>>;
5169
5304
  }>>;
5170
5305
  /**
5171
5306
  * The document database an app of protocol 9 or earlier declared. Apps of this protocol declare
@@ -5696,6 +5831,59 @@ export declare const current: {
5696
5831
  readonly error: Schema.optionalKey<Schema.Union<readonly [typeof ProviderError, typeof McpError, typeof SkillLoadFailed, typeof HostDeclarationInvalid, typeof HostEvaluationFailed]>>;
5697
5832
  }>>;
5698
5833
  }>;
5834
+ readonly sharedCatalog: Schema.Struct<{
5835
+ readonly tools: Schema.$Array<Schema.Struct<{
5836
+ readonly shared: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["inputSchema", "outputSchema"]>>>;
5837
+ readonly schedules: Schema.optionalKey<Schema.$Array<Schema.Struct<{
5838
+ readonly name: Schema.NonEmptyString;
5839
+ readonly scope: Schema.optionalKey<Schema.Literal<"app">>;
5840
+ readonly timing: Schema.Union<readonly [Schema.Struct<{
5841
+ readonly kind: Schema.Literal<"interval">;
5842
+ readonly milliseconds: Schema.Int;
5843
+ }>, Schema.Struct<{
5844
+ readonly kind: Schema.Literal<"cron">;
5845
+ readonly calendar: Schema.Struct<{
5846
+ readonly expression: Schema.NonEmptyString;
5847
+ readonly timezone: Schema.NonEmptyString;
5848
+ }>;
5849
+ }>]>;
5850
+ readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
5851
+ }>>>;
5852
+ readonly name: Schema.NonEmptyString;
5853
+ readonly router: Schema.optionalKey<Schema.NonEmptyString>;
5854
+ readonly tags: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
5855
+ readonly description: Schema.String;
5856
+ readonly inputSchema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
5857
+ readonly readOnly: Schema.optionalKey<Schema.Boolean>;
5858
+ readonly title: Schema.optionalKey<Schema.String>;
5859
+ readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
5860
+ readonly annotations: Schema.optionalKey<Schema.Struct<{
5861
+ readonly title: Schema.optionalKey<Schema.String>;
5862
+ readonly readOnlyHint: Schema.optionalKey<Schema.Boolean>;
5863
+ readonly destructiveHint: Schema.optionalKey<Schema.Boolean>;
5864
+ readonly idempotentHint: Schema.optionalKey<Schema.Boolean>;
5865
+ readonly openWorldHint: Schema.optionalKey<Schema.Boolean>;
5866
+ }>>;
5867
+ readonly _meta: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
5868
+ }>>;
5869
+ readonly routers: Schema.$Array<Schema.Struct<{
5870
+ readonly path: Schema.String;
5871
+ readonly title: Schema.optionalKey<Schema.String>;
5872
+ readonly description: Schema.optionalKey<Schema.String>;
5873
+ readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
5874
+ readonly src: Schema.NonEmptyString;
5875
+ readonly mimeType: Schema.optionalKey<Schema.String>;
5876
+ readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
5877
+ readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
5878
+ }>>>;
5879
+ readonly tags: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
5880
+ readonly skill: Schema.optionalKey<Schema.NonEmptyString>;
5881
+ readonly error: Schema.optionalKey<Schema.Union<readonly [typeof ProviderError, typeof McpError, typeof SkillLoadFailed, typeof HostDeclarationInvalid, typeof HostEvaluationFailed]>>;
5882
+ }>>;
5883
+ readonly definitions: Schema.$Array<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
5884
+ /** Each distinct `$defs`, its entries naming positions in `definitions`. */
5885
+ readonly defs: Schema.$Array<Schema.$Record<Schema.String, Schema.Int>>;
5886
+ }>;
5699
5887
  readonly skills: Schema.Union<readonly [Schema.Struct<{
5700
5888
  readonly skills: Schema.$Array<Schema.Struct<{
5701
5889
  readonly files: Schema.$Array<Schema.Struct<{
@@ -0,0 +1,11 @@
1
+ import type { HostedCatalog, HostedRouter, HostedSharedCatalog, HostedTool } from "./protocols/current.js";
2
+ /** A catalog with each definition and each distinct `$defs` its tools' schemas hold sent once. */
3
+ export declare const shareCatalog: (catalog: {
4
+ readonly tools: ReadonlyArray<HostedTool>;
5
+ readonly routers: ReadonlyArray<HostedRouter>;
6
+ }) => HostedSharedCatalog;
7
+ /**
8
+ * The catalog a shared catalog was made from; undefined when it names a definition or `$defs`
9
+ * it does not send.
10
+ */
11
+ export declare const restoreSharedCatalog: (catalog: HostedSharedCatalog) => HostedCatalog | undefined;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Helpers for the `$defs` of JSON Schema documents, shared by the encodings that send or keep each
3
+ * definition once: an app's shared catalog and a kept tool listing's text.
4
+ */
5
+ import type { Schema } from "effect";
6
+ /** Add an own entry. Assignment would set the prototype for an entry named `__proto__`. */
7
+ export declare const putEntry: <A>(target: Record<string, A>, name: string, value: A) => void;
8
+ type JsonEntries = {
9
+ readonly [key: string]: Schema.Json;
10
+ };
11
+ /** A JSON Schema document's `$defs`, when it is an object of entries. */
12
+ export declare const schemaDefinitions: (schema: JsonEntries | undefined) => JsonEntries | undefined;
13
+ export {};