apps 0.0.1-beta.0 → 0.0.1-beta.1

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 (106) hide show
  1. package/README.md +97 -4
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-BPEFS4YF.js → chunk-2HHMABB6.js} +70 -14
  4. package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
  5. package/js/{chunk-LOKGDT6B.js → chunk-6IIO4NPI.js} +5 -4
  6. package/js/chunk-6YBRWRK3.js +160 -0
  7. package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
  8. package/js/chunk-CZ7CSFO4.js +39 -0
  9. package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
  10. package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
  11. package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
  12. package/js/{chunk-WIDTG42X.js → chunk-G7IE6BKC.js} +79 -26
  13. package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
  14. package/js/{chunk-HP7E42X6.js → chunk-IHQ4ML7K.js} +693 -219
  15. package/js/{chunk-Q2FD5IBM.js → chunk-KOXMLKTM.js} +430 -41
  16. package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
  17. package/js/chunk-NCYXZN2G.js +6274 -0
  18. package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
  19. package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
  20. package/js/{chunk-C24KEZXR.js → chunk-PZ36XMXW.js} +36 -2
  21. package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
  22. package/js/{chunk-X3YBZCJW.js → chunk-RBAC33PQ.js} +59 -38
  23. package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
  24. package/js/chunk-SWPD52J7.js +35 -0
  25. package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
  26. package/js/chunk-W7D7WVSY.js +18 -0
  27. package/js/{chunk-KWTCHVLT.js → chunk-X7SFGU4Q.js} +47 -51
  28. package/js/chunk-YEJOQEII.js +104 -0
  29. package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
  30. package/js/chunk-ZJWDMTE3.js +63 -0
  31. package/js/chunk-ZTFQHGEB.js +80 -0
  32. package/js/client.js +11 -11
  33. package/js/contracts.js +81 -25
  34. package/js/effect.js +20 -15
  35. package/js/graphql.js +223 -121
  36. package/js/host.js +75 -19
  37. package/js/index.js +191 -51
  38. package/js/mcp/effect.js +24 -17
  39. package/js/mcp/stdio.js +22 -17
  40. package/js/mcp.js +109 -24
  41. package/js/openapi.js +43897 -143
  42. package/js/operations/approval.js +1 -1
  43. package/js/react.js +4 -4
  44. package/js/skills/effect.js +12 -0
  45. package/js/skills.js +857 -0
  46. package/js/storage/facet.js +7 -7
  47. package/js/ui/auth/contracts.js +6 -6
  48. package/js/ui/auth.js +8 -8
  49. package/js/ui/contracts.js +5 -5
  50. package/js/ui/serving.js +12 -12
  51. package/package.json +9 -1
  52. package/runtime.json +1 -1
  53. package/types/app-cache/src/contracts/cache.d.ts +79 -0
  54. package/types/app-cache/src/index.d.ts +35 -0
  55. package/types/apps/src/contracts/api-response-error.d.ts +43 -0
  56. package/types/apps/src/contracts/app.d.ts +11 -0
  57. package/types/apps/src/contracts/cache.d.ts +41 -0
  58. package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
  59. package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
  60. package/types/apps/src/contracts/graphql.d.ts +18 -1
  61. package/types/apps/src/contracts/host.d.ts +200 -7
  62. package/types/apps/src/contracts/mcp.d.ts +3 -1
  63. package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
  64. package/types/apps/src/contracts/openapi-document.d.ts +53 -0
  65. package/types/apps/src/contracts/openapi.d.ts +150 -30
  66. package/types/apps/src/contracts/provider-error.d.ts +15 -0
  67. package/types/apps/src/contracts/provider.d.ts +18 -1
  68. package/types/apps/src/contracts/skills.d.ts +113 -0
  69. package/types/apps/src/contracts/swagger-client.d.ts +29 -0
  70. package/types/apps/src/graphql.d.ts +6 -6
  71. package/types/apps/src/host.d.ts +1 -0
  72. package/types/apps/src/implementation/account-operations.d.ts +122 -3
  73. package/types/apps/src/implementation/app.d.ts +1 -1
  74. package/types/apps/src/implementation/cache-session.d.ts +7 -0
  75. package/types/apps/src/implementation/cache.d.ts +6 -0
  76. package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
  77. package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
  78. package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
  79. package/types/apps/src/implementation/elicitation.d.ts +12 -12
  80. package/types/apps/src/implementation/git.d.ts +25 -0
  81. package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
  82. package/types/apps/src/implementation/graphql.d.ts +81 -3
  83. package/types/apps/src/implementation/inflate.d.ts +16 -0
  84. package/types/apps/src/implementation/input-problems.d.ts +3 -0
  85. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  86. package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
  87. package/types/apps/src/implementation/mcp-client.d.ts +9 -8
  88. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  89. package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
  90. package/types/apps/src/implementation/mcp.d.ts +39 -2
  91. package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
  92. package/types/apps/src/implementation/openapi-document.d.ts +53 -0
  93. package/types/apps/src/implementation/openapi-request.d.ts +11 -4
  94. package/types/apps/src/implementation/openapi-source.d.ts +36 -0
  95. package/types/apps/src/implementation/openapi.d.ts +39 -3
  96. package/types/apps/src/implementation/provider-error.d.ts +10 -0
  97. package/types/apps/src/implementation/schema.d.ts +11 -5
  98. package/types/apps/src/implementation/skill-files.d.ts +10 -0
  99. package/types/apps/src/implementation/skills.d.ts +43 -0
  100. package/types/apps/src/index.d.ts +7 -0
  101. package/types/apps/src/mcp.d.ts +5 -5
  102. package/types/apps/src/openapi.d.ts +3 -1
  103. package/types/apps/src/skills.d.ts +72 -0
  104. package/types/telemetry/src/config.d.ts +2 -0
  105. package/js/chunk-22WRQZT7.js +0 -389
  106. package/js/chunk-MLKGABMK.js +0 -9
@@ -1,14 +1,43 @@
1
- /** Normalized OpenAPI metadata retained with app source; no compiler or protocol client is required. */
1
+ import type { ProviderError } from "./provider-error.js";
2
+ /** Credential-free OpenAPI request declarations and validation schemas retained with app source. */
2
3
  import { Schema, type Effect } from "effect";
3
4
  import { JsonObject } from "./schema.js";
4
- /** One parameter's HTTP placement and serialization. */
5
- export declare const RequestParameter: Schema.Struct<{
5
+ import { type OpenapiResponseError } from "./api-response-error.js";
6
+ /** Tagged error shapes retain an explicit source for their public message. */
7
+ export declare const OpenapiErrorResponse: Schema.Struct<{
8
+ readonly code: Schema.NonEmptyString;
9
+ readonly status: Schema.Int;
10
+ readonly message: Schema.Union<readonly [Schema.Struct<{
11
+ readonly source: Schema.Literal<"body">;
12
+ }>, Schema.Struct<{
13
+ readonly source: Schema.Literal<"schema">;
14
+ readonly value: Schema.NonEmptyString;
15
+ }>]>;
16
+ readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
17
+ }>;
18
+ /** A retained declaration used to validate an HTTP failure before exposing its code. */
19
+ export type OpenapiErrorResponse = typeof OpenapiErrorResponse.Type;
20
+ /** Resolved OpenAPI parameter shared by import validation and request construction. */
21
+ export declare const OpenapiParameter: Schema.Struct<{
6
22
  readonly name: Schema.String;
7
- readonly in: Schema.Literals<readonly ["path", "query", "header"]>;
8
- readonly style: Schema.String;
9
- readonly explode: Schema.Boolean;
23
+ readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
24
+ readonly required: Schema.optionalKey<Schema.Boolean>;
25
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
26
+ readonly style: Schema.optionalKey<Schema.String>;
27
+ readonly explode: Schema.optionalKey<Schema.Boolean>;
28
+ readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
29
+ readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
30
+ readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
31
+ }>;
32
+ export type OpenapiParameter = typeof OpenapiParameter.Type;
33
+ /** Preserve media schemas and Encoding Objects for Swagger request construction. */
34
+ export declare const OpenapiRequestBody: Schema.Struct<{
35
+ readonly required: Schema.optionalKey<Schema.Boolean>;
36
+ readonly content: Schema.$Record<Schema.String, Schema.Struct<{
37
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
38
+ readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
39
+ }>>;
10
40
  }>;
11
- export type RequestParameter = typeof RequestParameter.Type;
12
41
  /** Credential-free operation data emitted by the OpenAPI importer. */
13
42
  export declare const OpenapiOperation: Schema.Struct<{
14
43
  readonly name: Schema.NonEmptyString;
@@ -16,35 +45,73 @@ export declare const OpenapiOperation: Schema.Struct<{
16
45
  readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
17
46
  readonly path: Schema.String;
18
47
  readonly baseUrl: Schema.String;
19
- readonly parameters: Schema.$Array<Schema.Struct<{
20
- readonly name: Schema.String;
21
- readonly in: Schema.Literals<readonly ["path", "query", "header"]>;
22
- readonly style: Schema.String;
23
- readonly explode: Schema.Boolean;
24
- }>>;
25
- readonly body: Schema.Literals<readonly ["json", "base64", "none"]>;
48
+ readonly openapi: Schema.String;
49
+ readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
50
+ /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
51
+ readonly request: Schema.Struct<{
52
+ readonly parameters: Schema.$Array<Schema.Struct<{
53
+ readonly name: Schema.String;
54
+ readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
55
+ readonly required: Schema.optionalKey<Schema.Boolean>;
56
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
57
+ readonly style: Schema.optionalKey<Schema.String>;
58
+ readonly explode: Schema.optionalKey<Schema.Boolean>;
59
+ readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
60
+ readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
61
+ readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
62
+ }>>;
63
+ readonly requestBody: Schema.optionalKey<Schema.Struct<{
64
+ readonly required: Schema.optionalKey<Schema.Boolean>;
65
+ readonly content: Schema.$Record<Schema.String, Schema.Struct<{
66
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
67
+ readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
68
+ }>>;
69
+ }>>;
70
+ readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
71
+ readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
72
+ }>;
26
73
  /** Streams remain in the metadata but cannot run through a single-result tool call. */
27
74
  readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
28
- readonly security: Schema.$Array<Schema.$Array<Schema.String>>;
29
75
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
30
76
  readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
77
+ readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
78
+ readonly code: Schema.NonEmptyString;
79
+ readonly status: Schema.Int;
80
+ readonly message: Schema.Union<readonly [Schema.Struct<{
81
+ readonly source: Schema.Literal<"body">;
82
+ }>, Schema.Struct<{
83
+ readonly source: Schema.Literal<"schema">;
84
+ readonly value: Schema.NonEmptyString;
85
+ }>]>;
86
+ readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
87
+ }>>>;
31
88
  }>;
32
89
  export type OpenapiOperation = typeof OpenapiOperation.Type;
33
- /** One field's placement, potentially combined with other fields in an authentication method. */
90
+ /** Map a selected account field to one Swagger credential value. */
34
91
  export declare const CredentialBinding: Schema.Struct<{
35
92
  readonly scheme: Schema.String;
36
93
  readonly field: Schema.String;
37
- readonly in: Schema.Literals<readonly ["header", "query"]>;
38
- readonly name: Schema.String;
94
+ readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
39
95
  readonly prefix: Schema.String;
40
96
  }>;
41
97
  export type CredentialBinding = typeof CredentialBinding.Type;
42
98
  /** Selected credentials stay in the server runtime, separate from operation metadata. */
43
99
  export declare const OpenapiAccount: Schema.Struct<{
100
+ readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
44
101
  readonly method: Schema.String;
45
102
  readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
46
103
  }>;
47
104
  export type OpenapiAccount = typeof OpenapiAccount.Type;
105
+ /**
106
+ * Parameter values bound by the selected account, grouped as in tool input. Callers may omit
107
+ * these parameters; an explicit value still takes precedence and the API still authorizes it.
108
+ */
109
+ export declare const OpenapiParameterDefaults: Schema.Struct<{
110
+ readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
111
+ readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
112
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
113
+ }>;
114
+ export type OpenapiParameterDefaults = typeof OpenapiParameterDefaults.Type;
48
115
  /** Parsed options for one account's evaluation. */
49
116
  export declare const OpenapiToolsOptions: Schema.Struct<{
50
117
  readonly operations: Schema.$Array<Schema.Struct<{
@@ -53,37 +120,76 @@ export declare const OpenapiToolsOptions: Schema.Struct<{
53
120
  readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
54
121
  readonly path: Schema.String;
55
122
  readonly baseUrl: Schema.String;
56
- readonly parameters: Schema.$Array<Schema.Struct<{
57
- readonly name: Schema.String;
58
- readonly in: Schema.Literals<readonly ["path", "query", "header"]>;
59
- readonly style: Schema.String;
60
- readonly explode: Schema.Boolean;
61
- }>>;
62
- readonly body: Schema.Literals<readonly ["json", "base64", "none"]>;
123
+ readonly openapi: Schema.String;
124
+ readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
125
+ /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
126
+ readonly request: Schema.Struct<{
127
+ readonly parameters: Schema.$Array<Schema.Struct<{
128
+ readonly name: Schema.String;
129
+ readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
130
+ readonly required: Schema.optionalKey<Schema.Boolean>;
131
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
132
+ readonly style: Schema.optionalKey<Schema.String>;
133
+ readonly explode: Schema.optionalKey<Schema.Boolean>;
134
+ readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
135
+ readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
136
+ readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
137
+ }>>;
138
+ readonly requestBody: Schema.optionalKey<Schema.Struct<{
139
+ readonly required: Schema.optionalKey<Schema.Boolean>;
140
+ readonly content: Schema.$Record<Schema.String, Schema.Struct<{
141
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
142
+ readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
143
+ }>>;
144
+ }>>;
145
+ readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
146
+ readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
147
+ }>;
63
148
  /** Streams remain in the metadata but cannot run through a single-result tool call. */
64
149
  readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
65
- readonly security: Schema.$Array<Schema.$Array<Schema.String>>;
66
150
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
67
151
  readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
152
+ readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
153
+ readonly code: Schema.NonEmptyString;
154
+ readonly status: Schema.Int;
155
+ readonly message: Schema.Union<readonly [Schema.Struct<{
156
+ readonly source: Schema.Literal<"body">;
157
+ }>, Schema.Struct<{
158
+ readonly source: Schema.Literal<"schema">;
159
+ readonly value: Schema.NonEmptyString;
160
+ }>]>;
161
+ readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
162
+ }>>>;
68
163
  }>>;
164
+ /**
165
+ * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations
166
+ * generated before shared definitions carry their own `$defs` and omit this.
167
+ */
168
+ readonly definitions: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
69
169
  readonly methods: Schema.$Record<Schema.String, Schema.$Array<Schema.Struct<{
70
170
  readonly scheme: Schema.String;
71
171
  readonly field: Schema.String;
72
- readonly in: Schema.Literals<readonly ["header", "query"]>;
73
- readonly name: Schema.String;
172
+ readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
74
173
  readonly prefix: Schema.String;
75
174
  }>>>;
76
175
  readonly oauth: Schema.$Array<Schema.String>;
77
176
  readonly account: Schema.optional<Schema.Struct<{
177
+ readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
78
178
  readonly method: Schema.String;
79
179
  readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
80
180
  }>>;
181
+ readonly parameterDefaults: Schema.optional<Schema.Struct<{
182
+ readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
183
+ readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
184
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
185
+ }>>;
81
186
  readonly signal: Schema.optional<Schema.instanceOf<AbortSignal, AbortSignal>>;
82
187
  readonly fetch: Schema.optional<Schema.declare<typeof fetch, typeof fetch>>;
83
188
  }>;
84
189
  /** JSON imports are decoded at the helper boundary, without assertions in app source. */
85
- export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations"> & {
190
+ export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations" | "definitions"> & {
86
191
  readonly operations: unknown;
192
+ readonly definitions?: unknown;
87
193
  };
88
194
  declare const OpenapiError_base: Schema.Class<OpenapiError, Schema.TaggedStruct<"OpenapiError", {
89
195
  readonly reason: Schema.Literals<readonly ["invalid_definition", "invalid_input", "request"]>;
@@ -98,8 +204,22 @@ export interface OpenapiTool {
98
204
  readonly readOnly: boolean;
99
205
  readonly outputSchema?: JsonObject;
100
206
  readonly input: Schema.Decoder<Schema.Json>;
101
- readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError>;
207
+ readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError | OpenapiResponseError | ProviderError>;
102
208
  }
103
209
  /** Executable operations keyed by their generated names. */
104
210
  export type OpenapiTools = Readonly<Record<string, OpenapiTool>>;
211
+ /** Tool calls buffer one bounded result; live event streams require an authored subscription. */
212
+ export declare const defaultOpenapiResponseLimits: {
213
+ readonly maxBodyBytes: 16777216;
214
+ readonly readTimeoutMs: 30000;
215
+ };
216
+ /** Media returned as text rather than a base64 file. NDJSON remains an unparsed text result. */
217
+ export declare const isOpenapiTextMedia: (type: string) => boolean;
218
+ /** A form field that carries raw file bytes: OpenAPI 3.1 `contentMediaType` without an
219
+ * encoding, or the `format: binary` string that 3.1 documents still commonly use. */
220
+ export declare const isOpenapiFileSchema: (shape: Readonly<Record<string, unknown>>) => boolean;
221
+ /** JSON-safe binary result, independent of the host's file storage. */
222
+ export declare const openapiBinaryResultSchema: JsonObject;
223
+ /** Classify request media for JSON-safe tool arguments; Swagger owns wire serialization. */
224
+ export declare const openapiMediaKind: (type: string) => "form" | "text" | "binary" | "json" | "multipart";
105
225
  export {};
@@ -0,0 +1,15 @@
1
+ import { Schema } from "effect";
2
+ declare const ProviderError_base: Schema.Class<ProviderError, Schema.TaggedStruct<"ProviderError", {
3
+ readonly reason: Schema.Literals<readonly ["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]>;
4
+ readonly status: Schema.optional<Schema.Int>;
5
+ readonly accountId: Schema.optional<Schema.brand<Schema.String, "acc">>;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ /**
8
+ * A recognized service failure. App authors can throw this ordinary Error from
9
+ * async code. Supply only a known reason and the account used for that request.
10
+ * Never include response bodies, messages, URLs or credentials. A bare 403 is
11
+ * `rejected`; `forbidden` requires explicit evidence of insufficient permission.
12
+ */
13
+ export declare class ProviderError extends ProviderError_base {
14
+ }
15
+ export {};
@@ -15,21 +15,36 @@ export declare const OAuthClientAuth: Schema.Literals<readonly ["none", "client_
15
15
  export type OAuthClientAuth = typeof OAuthClientAuth.Type;
16
16
  /** Machine clients always authenticate; public clients cannot use the client-credentials grant. */
17
17
  export declare const OAuthSecretClientAuth: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
18
- /** OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain host-owned. */
18
+ /**
19
+ * Extra authorization request parameters, such as `access_type: "offline"`. RFC 6749 §3.1
20
+ * lets services define their own; the protocol and security parameters stay host-owned.
21
+ */
22
+ export declare const OAuthAuthorizationParams: Schema.$Record<Schema.String, Schema.String>;
23
+ /**
24
+ * OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain
25
+ * host-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the
26
+ * server's `revocation_endpoint` metadata instead.
27
+ */
19
28
  export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
20
29
  readonly discover: Schema.String;
21
30
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
22
31
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
32
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
23
33
  readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
24
34
  readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
35
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
25
36
  readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
26
37
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
27
38
  }>, Schema.Struct<{
28
39
  readonly authorizationUrl: Schema.String;
29
40
  readonly tokenUrl: Schema.String;
41
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
30
42
  readonly scopes: Schema.$Array<Schema.String>;
43
+ /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
44
+ readonly issuer: Schema.optionalKey<Schema.String>;
31
45
  readonly discover: Schema.optionalKey<Schema.Never>;
32
46
  readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
47
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
33
48
  readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
34
49
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
35
50
  }>, Schema.Struct<{
@@ -37,12 +52,14 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
37
52
  readonly discover: Schema.String;
38
53
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
39
54
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
55
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
40
56
  readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
41
57
  readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
42
58
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
43
59
  }>, Schema.Struct<{
44
60
  readonly grant: Schema.Literal<"client_credentials">;
45
61
  readonly tokenUrl: Schema.String;
62
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
46
63
  readonly scopes: Schema.$Array<Schema.String>;
47
64
  readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
48
65
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
@@ -0,0 +1,113 @@
1
+ /** Portable Agent Skills returned by an app factory or loaded from published files. */
2
+ import { Schema } from "effect";
3
+ /** Canonical resource path within one skill. */
4
+ export declare const SkillFilePath: Schema.NonEmptyString;
5
+ /** UTF-8 text resource. Reading a resource never executes it. */
6
+ export declare const SkillFile: Schema.Struct<{
7
+ readonly path: Schema.NonEmptyString;
8
+ readonly content: Schema.String;
9
+ }>;
10
+ export type SkillFile = typeof SkillFile.Type;
11
+ /** Agent Skills format constraints, not Executor execution or storage budgets. */
12
+ export declare const skillFormatLimits: {
13
+ readonly nameCharacters: 64;
14
+ readonly descriptionCharacters: 1024;
15
+ readonly compatibilityCharacters: 500;
16
+ };
17
+ /** A lowercase alphanumeric skill directory name with single separating hyphens. */
18
+ export declare const AppSkillName: Schema.NonEmptyString;
19
+ /** Frontmatter is metadata only. In particular, allowed-tools never grants execution authority. */
20
+ export declare const AppSkillMetadata: Schema.Struct<{
21
+ readonly name: Schema.NonEmptyString;
22
+ readonly description: Schema.String;
23
+ readonly license: Schema.optionalKey<Schema.String>;
24
+ readonly compatibility: Schema.optionalKey<Schema.String>;
25
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
26
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
27
+ }>;
28
+ export type AppSkillMetadata = typeof AppSkillMetadata.Type;
29
+ /** Files use paths relative to this skill directory; reading one never executes its contents. */
30
+ export declare const AppSkillSource: Schema.Struct<{
31
+ readonly files: Schema.$Array<Schema.Struct<{
32
+ readonly path: Schema.NonEmptyString;
33
+ readonly content: Schema.String;
34
+ }>>;
35
+ readonly name: Schema.NonEmptyString;
36
+ readonly description: Schema.String;
37
+ readonly license: Schema.optionalKey<Schema.String>;
38
+ readonly compatibility: Schema.optionalKey<Schema.String>;
39
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
40
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
41
+ }>;
42
+ export type AppSkillSource = typeof AppSkillSource.Type;
43
+ declare const SkillDefinitionInvalid_base: Schema.Class<SkillDefinitionInvalid, Schema.TaggedStruct<"SkillDefinitionInvalid", {
44
+ readonly file: Schema.NonEmptyString;
45
+ readonly reason: Schema.Literals<readonly ["files", "directory", "missing-document", "frontmatter", "metadata", "name-mismatch"]>;
46
+ }>, import("effect/Cause").YieldableError>;
47
+ /** Invalid selected skill files fail the load. Errors identify the file without disclosing its contents. */
48
+ export declare class SkillDefinitionInvalid extends SkillDefinitionInvalid_base {
49
+ }
50
+ /** One evaluated catalog cannot contain ambiguous names. */
51
+ export declare const AppSkills: Schema.$Array<Schema.Struct<{
52
+ readonly files: Schema.$Array<Schema.Struct<{
53
+ readonly path: Schema.NonEmptyString;
54
+ readonly content: Schema.String;
55
+ }>>;
56
+ readonly name: Schema.NonEmptyString;
57
+ readonly description: Schema.String;
58
+ readonly license: Schema.optionalKey<Schema.String>;
59
+ readonly compatibility: Schema.optionalKey<Schema.String>;
60
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
61
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
62
+ }>>;
63
+ /** Short display name for a skill source, such as "GitLab" or an index host name. */
64
+ export declare const SkillServiceName: Schema.String;
65
+ declare const SkillLoadFailed_base: Schema.Class<SkillLoadFailed, Schema.TaggedStruct<"SkillLoadFailed", {
66
+ readonly reason: Schema.Literals<readonly ["source", "request", "rate_limited", "document", "limit", "changed", "encoding"]>;
67
+ readonly message: Schema.optional<Schema.String>;
68
+ readonly status: Schema.optional<Schema.Int>;
69
+ }>, import("effect/Cause").YieldableError>;
70
+ /**
71
+ * A skill loader failure shown to people. `message` is the explanation they read; write it for
72
+ * them and never include URLs, tokens or response bodies. `reason` selects the title and whether
73
+ * a retry can help. Custom loaders throw this error to get the same presentation as built-ins.
74
+ */
75
+ export declare class SkillLoadFailed extends SkillLoadFailed_base {
76
+ }
77
+ /** Bounds shared by skill loaders across all app hosts. */
78
+ export declare const skillLoadLimits: {
79
+ readonly files: 1000;
80
+ readonly fileBytes: 2000000;
81
+ readonly totalBytes: 20000000;
82
+ readonly concurrency: 8;
83
+ };
84
+ /** Invocation-owned transport and cancellation, supplied by the app context. */
85
+ export interface SkillTransport {
86
+ readonly fetch?: typeof globalThis.fetch | undefined;
87
+ readonly signal?: AbortSignal | undefined;
88
+ }
89
+ /** A custom loader's transport and the service name shown when a request fails. */
90
+ export interface SkillReaderOptions extends SkillTransport {
91
+ readonly service: string;
92
+ }
93
+ /** A public GitHub repository and an optional immutable commit, tag or branch. */
94
+ export interface GitHubSkillsOptions extends SkillTransport {
95
+ readonly repo: string;
96
+ readonly path?: string;
97
+ readonly ref?: string;
98
+ /**
99
+ * Pass `ctx.cache` to keep each commit's skill file list. Content at a commit never changes,
100
+ * so later reads of the same commit skip the tree fetch. The ref is still resolved each read.
101
+ */
102
+ readonly cache?: import("./cache.js").AppCache;
103
+ }
104
+ /** A published directory index, including its listed skill documents and text references. */
105
+ export interface WellKnownSkillsOptions extends SkillTransport {
106
+ readonly url: string;
107
+ }
108
+ /** A folder in the deployed package; omitted path selects skills/. No host filesystem access. */
109
+ export interface FolderSkillsOptions {
110
+ readonly files: readonly SkillFile[];
111
+ readonly path?: string;
112
+ }
113
+ export {};
@@ -0,0 +1,29 @@
1
+ /** Narrow declarations for the untyped public swagger-client APIs used by our adapters.
2
+ * Returned data remains unknown and is decoded before it enters Executor.
3
+ */
4
+ declare module "swagger-client" {
5
+ const SwaggerClient: {
6
+ buildRequest(options: {
7
+ spec: unknown;
8
+ operationId?: string;
9
+ pathName?: string;
10
+ method?: string;
11
+ parameters?: Readonly<Record<string, unknown>>;
12
+ requestBody?: unknown;
13
+ requestContentType?: string;
14
+ securities?: {
15
+ authorized: Readonly<Record<string, unknown>>;
16
+ };
17
+ }): unknown;
18
+ resolve(options: {
19
+ spec: unknown;
20
+ skipNormalization: boolean;
21
+ useCircularStructures: boolean;
22
+ requestInterceptor: () => never;
23
+ }): Promise<{
24
+ spec: unknown;
25
+ errors: readonly unknown[];
26
+ }>;
27
+ };
28
+ export default SwaggerClient;
29
+ }
@@ -1,10 +1,10 @@
1
1
  /** GraphQL helpers. Requires the optional graphql peer. */
2
- import { type OperationKinds } from "./implementation/protocol-operations.js";
3
- import type { GraphqlToolsOptions } from "./contracts/graphql.js";
2
+ import type { OperationKinds } from "./implementation/protocol-operations.js";
3
+ import { type GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
4
4
  export { GraphqlError, type GraphqlToolsOptions } from "./contracts/graphql.js";
5
- /** Discover operations for the selected account. Kinds override uncertain upstream read-only hints. */
6
- export declare const graphqlOperations: (options: GraphqlToolsOptions, kinds?: OperationKinds) => Promise<{
7
- queries: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "query", import("./index.js").OperationContext>>;
8
- mutations: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "mutation", import("./index.js").OperationContext>>;
5
+ export type { GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
6
+ /** Lazy tools with optional persistent metadata caching for the selected account. */
7
+ export declare const graphqlOperations: (options: GraphqlCatalogOptions, kinds?: OperationKinds) => Promise<{
8
+ dynamicTools: import("./contracts/dynamic-tools.js").DynamicTools;
9
9
  }>;
10
10
  export type { OperationKinds } from "./implementation/protocol-operations.js";
@@ -1,6 +1,7 @@
1
1
  import { type HostContext, type ResolvedAccountsInput } from "./contracts/host.js";
2
2
  import { type ElicitationHandler } from "./contracts/elicitation.js";
3
3
  export type { HostContext, ResolvedAccountsInput } from "./contracts/host.js";
4
+ export { isolatedCacheSession } from "./implementation/cache-session.js";
4
5
  /** Parse trusted account bindings and an optional exact-call approval. Throws safe boundary errors on invalid input. */
5
6
  export declare const hostContext: (accounts: ResolvedAccountsInput, approval?: unknown) => HostContext;
6
7
  /** Portable Promise handler. Invoke only after the host has authorized and resolved accounts. */
@@ -1,9 +1,13 @@
1
- import type { OperationContext } from "../contracts/operations.js";
1
+ /** Combine account-bound protocol operations without changing their upstream inputs. */
2
+ import { Effect, Schema } from "effect";
3
+ import type { DynamicTools } from "../contracts/dynamic-tools.js";
4
+ import type { AppOperation, OperationContext } from "../contracts/operations.js";
2
5
  import { type JsonValue } from "../contracts/schema.js";
3
6
  import { type Operation } from "./operations.js";
4
7
  type Operations = {
5
- readonly queries: Readonly<Record<string, Operation<JsonValue, unknown, "query", OperationContext>>>;
6
- readonly mutations: Readonly<Record<string, Operation<JsonValue, unknown, "mutation", OperationContext>>>;
8
+ readonly queries?: Readonly<Record<string, Operation<JsonValue, unknown, "query", OperationContext>>>;
9
+ readonly dynamicTools?: DynamicTools;
10
+ readonly mutations?: Readonly<Record<string, Operation<JsonValue, unknown, "mutation", OperationContext>>>;
7
11
  };
8
12
  /**
9
13
  * Discover each selected account's protocol operations and combine matching names.
@@ -28,5 +32,120 @@ export declare const accountOperations: <Account extends {
28
32
  readonly input: unknown;
29
33
  }, unknown, "mutation", import("../index.js").AppContext>;
30
34
  };
35
+ } | {
36
+ dynamicTools: {
37
+ list: () => Effect.Effect<{
38
+ readonly name: string;
39
+ readonly description: string;
40
+ readonly inputSchema: {
41
+ readonly [x: string]: Schema.Json;
42
+ };
43
+ readonly _meta?: {
44
+ readonly [x: string]: Schema.Json;
45
+ };
46
+ readonly title?: string;
47
+ readonly outputSchema?: {
48
+ readonly [x: string]: Schema.Json;
49
+ };
50
+ readonly annotations?: {
51
+ readonly title?: string;
52
+ readonly readOnlyHint?: boolean;
53
+ readonly destructiveHint?: boolean;
54
+ readonly idempotentHint?: boolean;
55
+ readonly openWorldHint?: boolean;
56
+ };
57
+ readonly schedules?: readonly {
58
+ readonly name: string;
59
+ readonly timing: {
60
+ readonly kind: "interval";
61
+ readonly milliseconds: number;
62
+ } | {
63
+ readonly kind: "cron";
64
+ readonly calendar: {
65
+ readonly expression: string;
66
+ readonly timezone: string;
67
+ };
68
+ };
69
+ readonly input: Schema.Json;
70
+ }[];
71
+ readonly readOnly?: boolean;
72
+ }[], unknown, never>;
73
+ summaries: () => Effect.Effect<{
74
+ readonly name: string;
75
+ readonly description: string;
76
+ readonly title?: string;
77
+ readonly annotations?: {
78
+ readonly title?: string;
79
+ readonly readOnlyHint?: boolean;
80
+ readonly destructiveHint?: boolean;
81
+ readonly idempotentHint?: boolean;
82
+ readonly openWorldHint?: boolean;
83
+ };
84
+ readonly schedules?: readonly {
85
+ readonly name: string;
86
+ readonly timing: {
87
+ readonly kind: "interval";
88
+ readonly milliseconds: number;
89
+ } | {
90
+ readonly kind: "cron";
91
+ readonly calendar: {
92
+ readonly expression: string;
93
+ readonly timezone: string;
94
+ };
95
+ };
96
+ readonly input: Schema.Json;
97
+ }[];
98
+ readonly readOnly?: boolean;
99
+ }[], unknown, never>;
100
+ describe: (name: string) => Effect.Effect<{
101
+ readonly name: string;
102
+ readonly description: string;
103
+ readonly inputSchema: {
104
+ readonly [x: string]: Schema.Json;
105
+ };
106
+ readonly _meta?: {
107
+ readonly [x: string]: Schema.Json;
108
+ };
109
+ readonly title?: string;
110
+ readonly outputSchema?: {
111
+ readonly [x: string]: Schema.Json;
112
+ };
113
+ readonly annotations?: {
114
+ readonly title?: string;
115
+ readonly readOnlyHint?: boolean;
116
+ readonly destructiveHint?: boolean;
117
+ readonly idempotentHint?: boolean;
118
+ readonly openWorldHint?: boolean;
119
+ };
120
+ readonly schedules?: readonly {
121
+ readonly name: string;
122
+ readonly timing: {
123
+ readonly kind: "interval";
124
+ readonly milliseconds: number;
125
+ } | {
126
+ readonly kind: "cron";
127
+ readonly calendar: {
128
+ readonly expression: string;
129
+ readonly timezone: string;
130
+ };
131
+ };
132
+ readonly input: Schema.Json;
133
+ }[];
134
+ readonly readOnly?: boolean;
135
+ } | undefined, unknown, never>;
136
+ resolve: (name: string) => Effect.Effect<AppOperation<unknown, unknown> | undefined, unknown, never>;
137
+ };
138
+ queries: {
139
+ [k: string]: Operation<{
140
+ readonly accountId: string;
141
+ readonly input: unknown;
142
+ }, unknown, "query", import("../index.js").AppContext>;
143
+ };
144
+ mutations: {
145
+ [k: string]: Operation<{
146
+ readonly accountId: string;
147
+ readonly input: unknown;
148
+ }, unknown, "mutation", import("../index.js").AppContext>;
149
+ };
31
150
  }>;
32
151
  export {};
@@ -22,7 +22,7 @@ export type AppDefinition<Requirements extends AppRequirements> = {
22
22
  };
23
23
  /** Adapt operation and webhook catalogs without evaluating their handlers. */
24
24
  export type EffectDefinition<Def> = {
25
- readonly [Key in keyof Def]: Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "queries" | "mutations" ? Readonly<Record<string, import("../contracts/operations.js").AppOperation>> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Def[Key];
25
+ readonly [Key in keyof Def]: Key extends "dynamicTools" ? NonNullable<NativeDefinition<unknown>["dynamicTools"]> : Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "queries" | "mutations" ? Readonly<Record<string, import("../contracts/operations.js").AppOperation>> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Key extends "skills" ? NonNullable<NativeDefinition<unknown>["skills"]> : Key extends "dynamicSkills" ? NonNullable<NativeDefinition<unknown>["dynamicSkills"]> : Def[Key];
26
26
  };
27
27
  declare const InternalApp: unique symbol;
28
28
  /** Recognize a declaration from this framework instance before host adaptation. */