apps 0.0.1-beta.124 → 0.0.1-beta.126

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.
Files changed (37) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-RR44Z4RU.js → chunk-2AI3RZXP.js} +5 -5
  3. package/js/{chunk-5IWCEMLY.js → chunk-55QLA7T7.js} +4 -4
  4. package/js/{chunk-DA6RXOMJ.js → chunk-5LGG5YSE.js} +10 -3
  5. package/js/{chunk-AUZGGAPP.js → chunk-7ASLJHSD.js} +4 -4
  6. package/js/{chunk-KY4KYPUZ.js → chunk-7TDDMSZI.js} +4 -4
  7. package/js/{chunk-573E3S2U.js → chunk-7ZYZWLXS.js} +80 -0
  8. package/js/{chunk-C23S3WPT.js → chunk-GWAA3COO.js} +1 -1
  9. package/js/{chunk-3OADIFKV.js → chunk-LOHZM4RK.js} +3 -3
  10. package/js/{chunk-OLUDW4HL.js → chunk-MVAS3VFK.js} +4 -4
  11. package/js/{chunk-UPICNVJO.js → chunk-TTMRK64V.js} +2 -2
  12. package/js/{chunk-CL3K7BJD.js → chunk-V3HWVVFZ.js} +1 -1
  13. package/js/{chunk-GU25DFBC.js → chunk-VEQDEM6J.js} +37 -14
  14. package/js/client.js +66 -9
  15. package/js/contracts.js +7 -1
  16. package/js/effect.js +9 -9
  17. package/js/graphql.js +11 -11
  18. package/js/host.js +9 -9
  19. package/js/index.js +12 -9
  20. package/js/mcp/effect.js +10 -10
  21. package/js/mcp.js +12 -12
  22. package/js/openapi.js +7 -7
  23. package/js/skills.js +6 -6
  24. package/package.json +1 -1
  25. package/runtime.json +1 -1
  26. package/types/apps/src/contracts/help-text.d.ts +31 -0
  27. package/types/apps/src/contracts/host.d.ts +36 -0
  28. package/types/apps/src/contracts/protocols/current.d.ts +244 -0
  29. package/types/apps/src/contracts/provider.d.ts +4 -0
  30. package/types/apps/src/implementation/elicitation.d.ts +4 -4
  31. package/types/apps/src/implementation/help-text.d.ts +5 -0
  32. package/types/apps/src/implementation/mcp-client.d.ts +2 -2
  33. package/types/apps/src/implementation/mcp.d.ts +2 -2
  34. package/types/apps/src/implementation/provider.d.ts +2 -1
  35. package/types/apps/src/implementation/router-catalog.d.ts +4 -4
  36. package/types/apps/src/implementation/schema.d.ts +17 -6
  37. package/types/apps/src/index.d.ts +20 -5
@@ -14,6 +14,8 @@ declare const SecretsMethod_base: new <A extends Record<string, any> = {}>(args:
14
14
  /** A named secrets method; its schema retains the provider's own field names. */
15
15
  export declare class SecretsMethod<Fields extends Schema.Decoder<unknown>> extends SecretsMethod_base<{
16
16
  readonly label: string;
17
+ /** Markdown the connect form shows above the fields: ordered setup, prerequisites, warnings. */
18
+ readonly guide?: string;
17
19
  readonly fields: Fields;
18
20
  /** Fields marked with `plain()` or `raw()`. */
19
21
  readonly exposure?: Readonly<Record<string, FieldExposure>>;
@@ -124,6 +126,8 @@ declare const OAuth2Method_base: new <A extends Record<string, any> = {}>(args:
124
126
  /** OAuth declaration with an explicit schema for app-visible account fields. */
125
127
  export declare class OAuth2Method<Response extends Schema.Decoder<unknown>> extends OAuth2Method_base<{
126
128
  readonly config: OAuth2Config;
129
+ /** Markdown the connect form shows where a user enters an OAuth client for this service. */
130
+ readonly clientGuide?: string;
127
131
  readonly response: Response;
128
132
  /** Response fields marked with `plain()` or `raw()`. */
129
133
  readonly exposure?: Readonly<Record<string, FieldExposure>>;
@@ -39,9 +39,9 @@ export declare const prepareElicitation: (input: unknown) => Effect.Effect<{
39
39
  };
40
40
  readonly description?: string;
41
41
  readonly default?: readonly string[];
42
+ readonly title?: string;
42
43
  readonly minItems?: number;
43
44
  readonly maxItems?: number;
44
- readonly title?: string;
45
45
  } | {
46
46
  readonly type: "array";
47
47
  readonly items: {
@@ -52,24 +52,24 @@ export declare const prepareElicitation: (input: unknown) => Effect.Effect<{
52
52
  };
53
53
  readonly description?: string;
54
54
  readonly default?: readonly string[];
55
+ readonly title?: string;
55
56
  readonly minItems?: number;
56
57
  readonly maxItems?: number;
57
- readonly title?: string;
58
58
  } | {
59
59
  readonly type: "string";
60
60
  readonly description?: string;
61
61
  readonly default?: string;
62
+ readonly title?: string;
62
63
  readonly format?: "email" | "uri" | "date" | "date-time";
63
64
  readonly minLength?: number;
64
65
  readonly maxLength?: number;
65
- readonly title?: string;
66
66
  } | {
67
67
  readonly type: "number" | "integer";
68
68
  readonly description?: string;
69
69
  readonly default?: number;
70
+ readonly title?: string;
70
71
  readonly minimum?: number;
71
72
  readonly maximum?: number;
72
- readonly title?: string;
73
73
  } | {
74
74
  readonly type: "boolean";
75
75
  readonly description?: string;
@@ -0,0 +1,5 @@
1
+ import type { JsonObject } from "../contracts/schema.js";
2
+ /** Remove the indentation every non-blank line shares, trailing spaces, and blank outer lines. */
3
+ export declare const dedent: (text: string) => string;
4
+ /** A fields or response JSON Schema with every `title` and `description` in it dedented. */
5
+ export declare const dedentFieldHelp: (document: JsonObject) => JsonObject;
@@ -27,10 +27,10 @@ export declare function mcpClient(withClient: WithMcpClient, timeoutMs: number,
27
27
  readonly [x: string]: Schema.Json;
28
28
  };
29
29
  readonly description?: string | undefined;
30
+ readonly title?: string | undefined;
30
31
  readonly _meta?: {
31
32
  readonly [x: string]: Schema.Json;
32
33
  } | undefined;
33
- readonly title?: string | undefined;
34
34
  readonly annotations?: {
35
35
  readonly title?: string;
36
36
  readonly readOnlyHint?: boolean;
@@ -46,8 +46,8 @@ export declare function mcpClient(withClient: WithMcpClient, timeoutMs: number,
46
46
  readonly description?: string;
47
47
  readonly version?: string;
48
48
  readonly name?: string;
49
- readonly instructions?: string;
50
49
  readonly title?: string;
50
+ readonly instructions?: string;
51
51
  readonly icons?: readonly {
52
52
  readonly src: string;
53
53
  readonly mimeType?: string;
@@ -11,10 +11,10 @@ export declare const mcpClientEffect: (input: McpToolsOptions, changed?: Effect.
11
11
  readonly [x: string]: Schema.Json;
12
12
  };
13
13
  readonly description?: string | undefined;
14
+ readonly title?: string | undefined;
14
15
  readonly _meta?: {
15
16
  readonly [x: string]: Schema.Json;
16
17
  } | undefined;
17
- readonly title?: string | undefined;
18
18
  readonly annotations?: {
19
19
  readonly title?: string;
20
20
  readonly readOnlyHint?: boolean;
@@ -30,8 +30,8 @@ export declare const mcpClientEffect: (input: McpToolsOptions, changed?: Effect.
30
30
  readonly description?: string;
31
31
  readonly version?: string;
32
32
  readonly name?: string;
33
- readonly instructions?: string;
34
33
  readonly title?: string;
34
+ readonly instructions?: string;
35
35
  readonly icons?: readonly {
36
36
  readonly src: string;
37
37
  readonly mimeType?: string;
@@ -7,12 +7,13 @@ 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;
10
+ readonly guide?: string;
10
11
  readonly fields: Fields;
11
12
  readonly exposure?: Readonly<Record<string, FieldExposure>>;
12
13
  readonly request?: readonly Placement[];
13
14
  }) => SecretsMethod<Fields>;
14
15
  /** 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>, DeclarationInvalid>;
16
+ export declare const oauth2: <Response extends Schema.Decoder<unknown>>(config: OAuth2Config, response: Response, exposure?: Readonly<Record<string, FieldExposure>>, request?: readonly Placement[], clientGuide?: string) => Effect.Effect<OAuth2Method<Response>, DeclarationInvalid>;
16
17
  /** Author options: the account check is an ordinary async function. */
17
18
  export interface ProviderOptions<Auth extends AuthMethods> {
18
19
  readonly name: string;
@@ -29,8 +29,8 @@ export declare const routerSkillName: (path: string) => string;
29
29
  export declare const operationSummary: (name: string, router: string, operation: AppOperation, schedules?: readonly OperationSchedule[]) => Effect.Effect<{
30
30
  readonly description: string;
31
31
  readonly name: string;
32
- readonly router?: string;
33
32
  readonly title?: string;
33
+ readonly router?: string;
34
34
  readonly annotations?: {
35
35
  readonly title?: string;
36
36
  readonly readOnlyHint?: boolean;
@@ -53,8 +53,8 @@ export declare const operationSummary: (name: string, router: string, operation:
53
53
  readonly input: Schema.Json;
54
54
  readonly scope?: "app";
55
55
  }[];
56
- readonly readOnly?: boolean;
57
56
  readonly tags?: readonly string[];
57
+ readonly readOnly?: boolean;
58
58
  readonly kindConfirmed?: boolean;
59
59
  }, HostDeclarationInvalid, never>;
60
60
  /** A declared operation's full description, including rendered schemas. */
@@ -64,11 +64,11 @@ export declare const operationDescription: (name: string, router: string, operat
64
64
  readonly inputSchema: {
65
65
  readonly [x: string]: Schema.Json;
66
66
  };
67
+ readonly title?: string;
67
68
  readonly _meta?: {
68
69
  readonly [x: string]: Schema.Json;
69
70
  };
70
71
  readonly router?: string;
71
- readonly title?: string;
72
72
  readonly annotations?: {
73
73
  readonly title?: string;
74
74
  readonly readOnlyHint?: boolean;
@@ -94,8 +94,8 @@ export declare const operationDescription: (name: string, router: string, operat
94
94
  readonly input: Schema.Json;
95
95
  readonly scope?: "app";
96
96
  }[];
97
- readonly readOnly?: boolean;
98
97
  readonly tags?: readonly string[];
98
+ readonly readOnly?: boolean;
99
99
  readonly kindConfirmed?: boolean;
100
100
  }, HostDeclarationInvalid, never>;
101
101
  /**
@@ -51,14 +51,25 @@ export declare const parse: <T>(decoder: EffectSchema.Decoder<T>, input: unknown
51
51
  export declare const parseDeclaration: <T>(decoder: EffectSchema.Decoder<T>, input: unknown, declaration: string, intended?: (input: unknown) => EffectSchema.Decoder<unknown>) => Effect.Effect<T, DeclarationInvalid>;
52
52
  /** Present a native decoder through the synchronous author API. */
53
53
  export declare function wrap<T, Optional extends boolean>(decoder: EffectSchema.Decoder<T>, optionalValue: Optional): Schema<T, Optional>;
54
- /** A string, optionally with a minimum length. No coercion. */
55
- export declare function string(options?: {
54
+ /**
55
+ * A value's name and explanation in its JSON Schema, such as a tool input or an account field. In
56
+ * an account field, `title` replaces the field's name as its connect form label, and `description`
57
+ * says where to find the value: Markdown of at most 1,000 characters whose links are absolute
58
+ * https URLs, with no HTML or images. Indentation common to its lines is removed, so a template
59
+ * literal can be indented. Neither changes the provider.
60
+ */
61
+ export interface FieldHelp {
62
+ readonly title?: string;
63
+ readonly description?: string;
64
+ }
65
+ /** A string, optionally with a minimum length, title and description. No coercion. */
66
+ export declare function string(options?: FieldHelp & {
56
67
  readonly minLength?: number;
57
68
  }): Schema<string>;
58
- /** A finite JSON number. No coercion. */
59
- export declare const number: () => Schema<number>;
60
- /** A boolean. No coercion. */
61
- export declare const boolean: () => Schema<boolean>;
69
+ /** A finite JSON number, optionally with a title and description. No coercion. */
70
+ export declare const number: (options?: FieldHelp) => Schema<number>;
71
+ /** A boolean, optionally with a title and description. No coercion. */
72
+ export declare const boolean: (options?: FieldHelp) => Schema<boolean>;
62
73
  /** Any JSON value. Values still cross the native JSON decoder. */
63
74
  export declare const json: () => Schema<EffectSchema.Json>;
64
75
  /** Named values with a common schema. */
@@ -19,7 +19,7 @@ import type { QueryContext as NativeQueryContext } from "./contracts/context.js"
19
19
  import { query as operationQuery, type AnyContext, type OperationOptions } from "./implementation/operations.js";
20
20
  import { type Fields, type Infer, type ObjectSchema, type Schema, type SecretFields, type SecretObject } from "./implementation/schema.js";
21
21
  export { DeclarationInvalid, type DeclarationIssue, type JsonObject, type JsonValue, ValidationError, } from "./contracts/schema.js";
22
- 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
+ export { type FieldHelp, 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";
23
23
  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";
24
24
  export { defineProvider, type ProviderOptions } from "./implementation/provider.js";
25
25
  export { base64, basic, bearer, header, t, type FieldRef, type FieldRefs, type PlacementInput, type PlacementValue, type RequestPlacements, } from "./implementation/placement.js";
@@ -54,14 +54,29 @@ type WithoutReservedParams<Config> = Config extends unknown ? "authorizationPara
54
54
  };
55
55
  } : Config : never;
56
56
  /**
57
- * Declare a secrets method without requiring an Effect schema from the author. `request` says
58
- * where its secret fields may be sent, such as `({ token }) => bearer(token)`; it runs once, here.
57
+ * Declare a secrets method without requiring an Effect schema from the author. Give each field a
58
+ * `description` saying where to find its value; add a `guide` only for ordered setup,
59
+ * prerequisites or warnings. Both are Markdown whose links are absolute https URLs, with no HTML
60
+ * or images, and indentation common to their lines is removed, so a template literal can be
61
+ * indented. `request` says where its secret fields may be sent, such as
62
+ * `({ token }) => bearer(token)`; it runs once, here.
59
63
  */
60
64
  export declare const secrets: <const F extends Fields>(options: {
61
65
  readonly label: string;
66
+ /** Markdown the connect form shows above the fields, at most 4,000 characters. */
67
+ readonly guide?: string;
62
68
  readonly fields: ObjectSchema<F>;
63
69
  readonly request?: RequestPlacements<keyof F & string>;
64
70
  }) => SecretsMethod<ObjectSchema<F>>;
71
+ /**
72
+ * Markdown the connect form shows where a user enters an OAuth client: where to create one at this
73
+ * service and what to choose there, at most 4,000 characters. Executor's own steps and the
74
+ * redirect URL to copy come before it. Links are absolute https URLs, with no HTML or images, and
75
+ * indentation common to its lines is removed.
76
+ */
77
+ type ClientGuide = {
78
+ readonly clientGuide?: string;
79
+ };
65
80
  /**
66
81
  * Declare OAuth discovery/endpoints and an optional app-visible response projection.
67
82
  * `authorizationParams` adds service-defined sign-in parameters; a declared `authorizationUrl`
@@ -69,10 +84,10 @@ export declare const secrets: <const F extends Fields>(options: {
69
84
  * `request` says where the projected secret fields may be sent, such as
70
85
  * `({ access_token }) => bearer(access_token)`; it runs once, here.
71
86
  */
72
- export declare function oauth2(options: OAuth2Config & {
87
+ export declare function oauth2(options: OAuth2Config & ClientGuide & {
73
88
  readonly request?: RequestPlacements<"access_token">;
74
89
  }): OAuth2Method<typeof OAuth2AccessToken>;
75
- export declare function oauth2<Response extends Schema<unknown, boolean>>(options: OAuth2Config & {
90
+ export declare function oauth2<Response extends Schema<unknown, boolean>>(options: OAuth2Config & ClientGuide & {
76
91
  readonly response: Response;
77
92
  readonly request?: RequestPlacements<FieldNameOf<Response>>;
78
93
  }): OAuth2Method<Response>;