apps 0.0.1-beta.0 → 0.0.1-beta.2

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 (114) hide show
  1. package/README.md +97 -4
  2. package/framework-reference.json +1 -1
  3. package/js/browser-XIPJGLH2.js +65 -0
  4. package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
  5. package/js/chunk-5MQZEB6Y.js +172 -0
  6. package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
  7. package/js/chunk-CZ7CSFO4.js +39 -0
  8. package/js/chunk-D47C7KG5.js +172 -0
  9. package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
  10. package/js/chunk-FDNTX5QJ.js +78 -0
  11. package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
  12. package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
  13. package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
  14. package/js/{chunk-WIDTG42X.js → chunk-HDTGZWP2.js} +79 -26
  15. package/js/{chunk-Q2FD5IBM.js → chunk-J7O55ZV7.js} +298 -37
  16. package/js/{chunk-X3YBZCJW.js → chunk-JN55AYQH.js} +8 -41
  17. package/js/chunk-LGIYBDWA.js +85 -0
  18. package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
  19. package/js/{chunk-HP7E42X6.js → chunk-MYYEW3RA.js} +767 -249
  20. package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
  21. package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
  22. package/js/{chunk-C24KEZXR.js → chunk-PYUYJRSK.js} +36 -2
  23. package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
  24. package/js/{chunk-KWTCHVLT.js → chunk-RN2MXB4R.js} +47 -51
  25. package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
  26. package/js/chunk-SWPD52J7.js +35 -0
  27. package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
  28. package/js/chunk-UVL56Z6E.js +6641 -0
  29. package/js/chunk-W7D7WVSY.js +18 -0
  30. package/js/{chunk-BPEFS4YF.js → chunk-WFSQXYUT.js} +109 -17
  31. package/js/chunk-YEJOQEII.js +104 -0
  32. package/js/{chunk-LOKGDT6B.js → chunk-Z5NMEGJN.js} +5 -4
  33. package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
  34. package/js/chunk-ZJWDMTE3.js +63 -0
  35. package/js/client.js +11 -11
  36. package/js/contracts.js +88 -25
  37. package/js/effect.js +21 -15
  38. package/js/es-APDZKREY.js +40968 -0
  39. package/js/graphql.js +224 -121
  40. package/js/host.js +76 -19
  41. package/js/index.js +193 -51
  42. package/js/mcp/effect.js +25 -17
  43. package/js/mcp/stdio.js +23 -17
  44. package/js/mcp.js +110 -24
  45. package/js/openapi.js +3045 -105
  46. package/js/operations/approval.js +1 -1
  47. package/js/react.js +4 -4
  48. package/js/skills/effect.js +11 -0
  49. package/js/skills.js +894 -0
  50. package/js/storage/facet.js +7 -7
  51. package/js/ui/auth/contracts.js +6 -6
  52. package/js/ui/auth.js +8 -8
  53. package/js/ui/contracts.js +5 -5
  54. package/js/ui/serving.js +12 -12
  55. package/package.json +9 -1
  56. package/runtime.json +1 -1
  57. package/types/app-cache/src/contracts/cache.d.ts +119 -0
  58. package/types/app-cache/src/index.d.ts +93 -0
  59. package/types/apps/src/contracts/api-response-error.d.ts +43 -0
  60. package/types/apps/src/contracts/app.d.ts +11 -0
  61. package/types/apps/src/contracts/cache.d.ts +44 -0
  62. package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
  63. package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
  64. package/types/apps/src/contracts/graphql.d.ts +18 -1
  65. package/types/apps/src/contracts/host.d.ts +54 -525
  66. package/types/apps/src/contracts/mcp.d.ts +3 -1
  67. package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
  68. package/types/apps/src/contracts/openapi-document.d.ts +53 -0
  69. package/types/apps/src/contracts/openapi.d.ts +156 -30
  70. package/types/apps/src/contracts/protocol-version.d.ts +6 -0
  71. package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
  72. package/types/apps/src/contracts/provider-error.d.ts +15 -0
  73. package/types/apps/src/contracts/provider.d.ts +18 -1
  74. package/types/apps/src/contracts/skills.d.ts +122 -0
  75. package/types/apps/src/contracts/swagger-client.d.ts +29 -0
  76. package/types/apps/src/graphql.d.ts +6 -6
  77. package/types/apps/src/host.d.ts +1 -0
  78. package/types/apps/src/implementation/account-operations.d.ts +122 -3
  79. package/types/apps/src/implementation/app.d.ts +1 -1
  80. package/types/apps/src/implementation/cache-session.d.ts +7 -0
  81. package/types/apps/src/implementation/cache.d.ts +8 -0
  82. package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
  83. package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
  84. package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
  85. package/types/apps/src/implementation/elicitation.d.ts +12 -12
  86. package/types/apps/src/implementation/git.d.ts +25 -0
  87. package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
  88. package/types/apps/src/implementation/graphql.d.ts +81 -3
  89. package/types/apps/src/implementation/inflate.d.ts +16 -0
  90. package/types/apps/src/implementation/input-problems.d.ts +3 -0
  91. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  92. package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
  93. package/types/apps/src/implementation/mcp-client.d.ts +9 -8
  94. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  95. package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
  96. package/types/apps/src/implementation/mcp.d.ts +39 -2
  97. package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
  98. package/types/apps/src/implementation/openapi-document.d.ts +51 -0
  99. package/types/apps/src/implementation/openapi-names.d.ts +18 -0
  100. package/types/apps/src/implementation/openapi-request.d.ts +10 -4
  101. package/types/apps/src/implementation/openapi-source.d.ts +40 -0
  102. package/types/apps/src/implementation/openapi.d.ts +39 -3
  103. package/types/apps/src/implementation/provider-error.d.ts +10 -0
  104. package/types/apps/src/implementation/schema.d.ts +6 -5
  105. package/types/apps/src/implementation/skill-files.d.ts +10 -0
  106. package/types/apps/src/implementation/skills.d.ts +43 -0
  107. package/types/apps/src/implementation/swagger-client.d.ts +28 -0
  108. package/types/apps/src/index.d.ts +7 -0
  109. package/types/apps/src/mcp.d.ts +5 -5
  110. package/types/apps/src/openapi.d.ts +3 -1
  111. package/types/apps/src/skills.d.ts +75 -0
  112. package/types/telemetry/src/config.d.ts +2 -0
  113. package/js/chunk-22WRQZT7.js +0 -389
  114. package/js/chunk-MLKGABMK.js +0 -9
@@ -0,0 +1,11 @@
1
+ /** Shared OpenAPI compilation diagnostics. */
2
+ import { Schema } from "effect";
3
+ export declare const OpenapiCompileErrorCode: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
4
+ declare const OpenapiCompileError_base: Schema.Class<OpenapiCompileError, Schema.TaggedStruct<"OpenapiCompileError", {
5
+ readonly code: Schema.Literals<readonly ["server_protocol", "server_url", "external_reference", "circular_reference", "schema_keyword", "schema_reference", "missing_component", "openapi_version", "auth_helper", "auth_missing", "operation_path", "duplicate_operation", "server_missing", "multiple_hosts", "parameter_encoding", "parameter_style", "request_body", "combined_oauth", "auth_method", "input_schema", "no_operations", "no_supported_operations", "invalid_document", "source_generation", "authoring_reference"]>;
6
+ readonly reason: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ /** A safe generation failure, translated into product HTTP errors at the boundary. */
9
+ export declare class OpenapiCompileError extends OpenapiCompileError_base {
10
+ }
11
+ export {};
@@ -0,0 +1,53 @@
1
+ /** OpenAPI boundary parsing. Unsupported transport/auth features fail before deployment. */
2
+ import { Schema } from "effect";
3
+ /** Parsed OpenAPI 3 source; individual operation references are resolved separately. */
4
+ export declare const Specification: Schema.Struct<{
5
+ readonly openapi: Schema.String;
6
+ readonly servers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
7
+ readonly url: Schema.String;
8
+ readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
9
+ }>>>;
10
+ readonly paths: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
11
+ readonly components: Schema.optionalKey<Schema.Struct<{
12
+ readonly schemas: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
13
+ readonly securitySchemes: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
14
+ }>>;
15
+ readonly security: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>>;
16
+ }>;
17
+ export type Specification = typeof Specification.Type;
18
+ export { OpenapiParameter as Parameter, OpenapiRequestBody as RequestBody } from "./openapi.js";
19
+ /** Operation transport details. We never interpolate upstream executable code. */
20
+ export declare const Operation: Schema.Struct<{
21
+ readonly operationId: Schema.optionalKey<Schema.String>;
22
+ readonly responses: Schema.optionalKey<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
23
+ readonly summary: Schema.optionalKey<Schema.String>;
24
+ readonly description: Schema.optionalKey<Schema.String>;
25
+ readonly parameters: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
26
+ readonly requestBody: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
27
+ readonly security: Schema.optionalKey<Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>>;
28
+ readonly servers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
29
+ readonly url: Schema.String;
30
+ readonly variables: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
31
+ }>>>;
32
+ }>;
33
+ export type Operation = typeof Operation.Type;
34
+ import type { CredentialBinding } from "./openapi.js";
35
+ export type { OpenapiOperation as GeneratedOperation, CredentialBinding } from "./openapi.js";
36
+ /** A secrets method can satisfy an AND-set of OpenAPI security schemes. */
37
+ export interface GeneratedSecrets {
38
+ readonly name: string;
39
+ readonly label: string;
40
+ readonly bindings: readonly CredentialBinding[];
41
+ }
42
+ /** Import hints after product catalog overrides have been applied. */
43
+ export interface OpenApiImport {
44
+ readonly name: string;
45
+ readonly connectUrl?: string | undefined;
46
+ /** Prefer protected-resource discovery when the API supports dynamic OAuth client registration. */
47
+ readonly oauthDiscoveryUrl?: string | undefined;
48
+ readonly auth?: {
49
+ readonly kind: string;
50
+ readonly header?: string | undefined;
51
+ } | undefined;
52
+ readonly scopes?: readonly string[] | undefined;
53
+ }
@@ -1,89 +1,201 @@
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<{
43
+ /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
14
44
  readonly name: Schema.NonEmptyString;
45
+ /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
46
+ readonly operationId: Schema.optionalKey<Schema.String>;
15
47
  readonly description: Schema.String;
16
48
  readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
17
49
  readonly path: Schema.String;
18
50
  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"]>;
51
+ readonly openapi: Schema.String;
52
+ readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
53
+ /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
54
+ readonly request: Schema.Struct<{
55
+ readonly parameters: Schema.$Array<Schema.Struct<{
56
+ readonly name: Schema.String;
57
+ readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
58
+ readonly required: Schema.optionalKey<Schema.Boolean>;
59
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
60
+ readonly style: Schema.optionalKey<Schema.String>;
61
+ readonly explode: Schema.optionalKey<Schema.Boolean>;
62
+ readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
63
+ readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
64
+ readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
65
+ }>>;
66
+ readonly requestBody: Schema.optionalKey<Schema.Struct<{
67
+ readonly required: Schema.optionalKey<Schema.Boolean>;
68
+ readonly content: Schema.$Record<Schema.String, Schema.Struct<{
69
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
70
+ readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
71
+ }>>;
72
+ }>>;
73
+ readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
74
+ readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
75
+ }>;
26
76
  /** Streams remain in the metadata but cannot run through a single-result tool call. */
27
77
  readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
28
- readonly security: Schema.$Array<Schema.$Array<Schema.String>>;
29
78
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
30
79
  readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
80
+ readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
81
+ readonly code: Schema.NonEmptyString;
82
+ readonly status: Schema.Int;
83
+ readonly message: Schema.Union<readonly [Schema.Struct<{
84
+ readonly source: Schema.Literal<"body">;
85
+ }>, Schema.Struct<{
86
+ readonly source: Schema.Literal<"schema">;
87
+ readonly value: Schema.NonEmptyString;
88
+ }>]>;
89
+ readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
90
+ }>>>;
31
91
  }>;
32
92
  export type OpenapiOperation = typeof OpenapiOperation.Type;
33
- /** One field's placement, potentially combined with other fields in an authentication method. */
93
+ /** Map a selected account field to one Swagger credential value. */
34
94
  export declare const CredentialBinding: Schema.Struct<{
35
95
  readonly scheme: Schema.String;
36
96
  readonly field: Schema.String;
37
- readonly in: Schema.Literals<readonly ["header", "query"]>;
38
- readonly name: Schema.String;
97
+ readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
39
98
  readonly prefix: Schema.String;
40
99
  }>;
41
100
  export type CredentialBinding = typeof CredentialBinding.Type;
42
101
  /** Selected credentials stay in the server runtime, separate from operation metadata. */
43
102
  export declare const OpenapiAccount: Schema.Struct<{
103
+ readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
44
104
  readonly method: Schema.String;
45
105
  readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
46
106
  }>;
47
107
  export type OpenapiAccount = typeof OpenapiAccount.Type;
108
+ /**
109
+ * Parameter values bound by the selected account, grouped as in tool input. Callers may omit
110
+ * these parameters; an explicit value still takes precedence and the API still authorizes it.
111
+ */
112
+ export declare const OpenapiParameterDefaults: Schema.Struct<{
113
+ readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
114
+ readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
115
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
116
+ }>;
117
+ export type OpenapiParameterDefaults = typeof OpenapiParameterDefaults.Type;
48
118
  /** Parsed options for one account's evaluation. */
49
119
  export declare const OpenapiToolsOptions: Schema.Struct<{
50
120
  readonly operations: Schema.$Array<Schema.Struct<{
121
+ /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
51
122
  readonly name: Schema.NonEmptyString;
123
+ /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
124
+ readonly operationId: Schema.optionalKey<Schema.String>;
52
125
  readonly description: Schema.String;
53
126
  readonly method: Schema.Literals<readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]>;
54
127
  readonly path: Schema.String;
55
128
  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"]>;
129
+ readonly openapi: Schema.String;
130
+ readonly securitySchemes: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
131
+ /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
132
+ readonly request: Schema.Struct<{
133
+ readonly parameters: Schema.$Array<Schema.Struct<{
134
+ readonly name: Schema.String;
135
+ readonly in: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
136
+ readonly required: Schema.optionalKey<Schema.Boolean>;
137
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
138
+ readonly style: Schema.optionalKey<Schema.String>;
139
+ readonly explode: Schema.optionalKey<Schema.Boolean>;
140
+ readonly allowReserved: Schema.optionalKey<Schema.Boolean>;
141
+ readonly allowEmptyValue: Schema.optionalKey<Schema.Boolean>;
142
+ readonly content: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
143
+ }>>;
144
+ readonly requestBody: Schema.optionalKey<Schema.Struct<{
145
+ readonly required: Schema.optionalKey<Schema.Boolean>;
146
+ readonly content: Schema.$Record<Schema.String, Schema.Struct<{
147
+ readonly schema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
148
+ readonly encoding: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
149
+ }>>;
150
+ }>>;
151
+ readonly security: Schema.$Array<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
152
+ readonly responses: Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
153
+ }>;
63
154
  /** Streams remain in the metadata but cannot run through a single-result tool call. */
64
155
  readonly streaming: Schema.optionalKey<Schema.Literal<true>>;
65
- readonly security: Schema.$Array<Schema.$Array<Schema.String>>;
66
156
  readonly input: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
67
157
  readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
158
+ readonly errorResponses: Schema.optionalKey<Schema.$Array<Schema.Struct<{
159
+ readonly code: Schema.NonEmptyString;
160
+ readonly status: Schema.Int;
161
+ readonly message: Schema.Union<readonly [Schema.Struct<{
162
+ readonly source: Schema.Literal<"body">;
163
+ }>, Schema.Struct<{
164
+ readonly source: Schema.Literal<"schema">;
165
+ readonly value: Schema.NonEmptyString;
166
+ }>]>;
167
+ readonly schema: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
168
+ }>>>;
68
169
  }>>;
170
+ /**
171
+ * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations
172
+ * generated before shared definitions carry their own `$defs` and omit this.
173
+ */
174
+ readonly definitions: Schema.optional<Schema.$Record<Schema.String, Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>;
69
175
  readonly methods: Schema.$Record<Schema.String, Schema.$Array<Schema.Struct<{
70
176
  readonly scheme: Schema.String;
71
177
  readonly field: Schema.String;
72
- readonly in: Schema.Literals<readonly ["header", "query"]>;
73
- readonly name: Schema.String;
178
+ readonly part: Schema.Literals<readonly ["value", "username", "password"]>;
74
179
  readonly prefix: Schema.String;
75
180
  }>>>;
76
181
  readonly oauth: Schema.$Array<Schema.String>;
77
182
  readonly account: Schema.optional<Schema.Struct<{
183
+ readonly id: Schema.optional<Schema.brand<Schema.String, "acc">>;
78
184
  readonly method: Schema.String;
79
185
  readonly fields: Schema.$Record<Schema.String, Schema.Unknown>;
80
186
  }>>;
187
+ readonly parameterDefaults: Schema.optional<Schema.Struct<{
188
+ readonly path: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
189
+ readonly query: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
190
+ readonly headers: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
191
+ }>>;
81
192
  readonly signal: Schema.optional<Schema.instanceOf<AbortSignal, AbortSignal>>;
82
193
  readonly fetch: Schema.optional<Schema.declare<typeof fetch, typeof fetch>>;
83
194
  }>;
84
195
  /** JSON imports are decoded at the helper boundary, without assertions in app source. */
85
- export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations"> & {
196
+ export type OpenapiToolsOptions = Omit<typeof OpenapiToolsOptions.Type, "operations" | "definitions"> & {
86
197
  readonly operations: unknown;
198
+ readonly definitions?: unknown;
87
199
  };
88
200
  declare const OpenapiError_base: Schema.Class<OpenapiError, Schema.TaggedStruct<"OpenapiError", {
89
201
  readonly reason: Schema.Literals<readonly ["invalid_definition", "invalid_input", "request"]>;
@@ -98,8 +210,22 @@ export interface OpenapiTool {
98
210
  readonly readOnly: boolean;
99
211
  readonly outputSchema?: JsonObject;
100
212
  readonly input: Schema.Decoder<Schema.Json>;
101
- readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError>;
213
+ readonly run: (context: unknown, input: Schema.Json) => Effect.Effect<unknown, OpenapiError | OpenapiResponseError | ProviderError>;
102
214
  }
103
215
  /** Executable operations keyed by their generated names. */
104
216
  export type OpenapiTools = Readonly<Record<string, OpenapiTool>>;
217
+ /** Tool calls buffer one bounded result; live event streams require an authored subscription. */
218
+ export declare const defaultOpenapiResponseLimits: {
219
+ readonly maxBodyBytes: 16777216;
220
+ readonly readTimeoutMs: 30000;
221
+ };
222
+ /** Media returned as text rather than a base64 file. NDJSON remains an unparsed text result. */
223
+ export declare const isOpenapiTextMedia: (type: string) => boolean;
224
+ /** A form field that carries raw file bytes: OpenAPI 3.1 `contentMediaType` without an
225
+ * encoding, or the `format: binary` string that 3.1 documents still commonly use. */
226
+ export declare const isOpenapiFileSchema: (shape: Readonly<Record<string, unknown>>) => boolean;
227
+ /** JSON-safe binary result, independent of the host's file storage. */
228
+ export declare const openapiBinaryResultSchema: JsonObject;
229
+ /** Classify request media for JSON-safe tool arguments; Swagger owns wire serialization. */
230
+ export declare const openapiMediaKind: (type: string) => "form" | "text" | "binary" | "json" | "multipart";
105
231
  export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The host protocol this framework speaks. It is written into `runtime.json` and every host
3
+ * snapshot. Released protocols are frozen: see `protocols/1.ts` and notes/apps-publishing.md.
4
+ * This file has no imports so the package build script can read it directly.
5
+ */
6
+ export declare const frameworkProtocol = 1;