apps 0.0.1-beta.4 → 0.0.1-beta.5

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 (67) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
  3. package/js/{chunk-PYUYJRSK.js → chunk-3XKZDQLM.js} +2 -2
  4. package/js/chunk-4M277YTM.js +136 -0
  5. package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
  6. package/js/{chunk-EQB7JMAL.js → chunk-67EVWIGJ.js} +8 -8
  7. package/js/{chunk-DHUDODG5.js → chunk-C3VAOK5B.js} +11 -9
  8. package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
  9. package/js/{chunk-D47C7KG5.js → chunk-CYYBFC2K.js} +2 -2
  10. package/js/{chunk-3M2MEDNL.js → chunk-DQAZTA4I.js} +145 -20
  11. package/js/{chunk-WFSQXYUT.js → chunk-FWQC6I3C.js} +2 -2
  12. package/js/{chunk-ZJWDMTE3.js → chunk-G7T27IWB.js} +3 -3
  13. package/js/{chunk-G7ZIRKMK.js → chunk-IJX4CYZO.js} +3 -3
  14. package/js/{chunk-FDNTX5QJ.js → chunk-IPI4MFSN.js} +2 -2
  15. package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
  16. package/js/{chunk-NQ3OMCA5.js → chunk-KUMBKVJD.js} +2 -2
  17. package/js/{chunk-6VRYO2BG.js → chunk-LUVSFETN.js} +235 -58
  18. package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
  19. package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
  20. package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
  21. package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
  22. package/js/{chunk-ZCAMUXSG.js → chunk-RJDDBDSN.js} +3 -3
  23. package/js/{chunk-W7D7WVSY.js → chunk-SB3V4YVR.js} +2 -2
  24. package/js/{chunk-Z5NMEGJN.js → chunk-TDNYXSIX.js} +1 -1
  25. package/js/{chunk-2VPJHFOU.js → chunk-UDDE5KOR.js} +6 -6
  26. package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
  27. package/js/{chunk-T2LAZCAD.js → chunk-VFZKSM3T.js} +1 -1
  28. package/js/{chunk-SWPD52J7.js → chunk-W4DMKWAB.js} +1 -1
  29. package/js/{chunk-5MQZEB6Y.js → chunk-XHO2ZX6W.js} +4 -4
  30. package/js/{chunk-LGIYBDWA.js → chunk-YEPYT6SD.js} +1 -1
  31. package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
  32. package/js/client.js +10 -10
  33. package/js/contracts.js +32 -9
  34. package/js/effect.js +21 -20
  35. package/js/graphql.js +23 -22
  36. package/js/host.js +21 -20
  37. package/js/index.js +14 -14
  38. package/js/mcp/effect.js +23 -22
  39. package/js/mcp/stdio.js +23 -22
  40. package/js/mcp.js +25 -24
  41. package/js/openapi.js +23 -123
  42. package/js/react.js +3 -3
  43. package/js/skills/effect.js +3 -3
  44. package/js/skills.js +12 -12
  45. package/js/storage/facet.js +4 -4
  46. package/js/ui/auth/contracts.js +2 -2
  47. package/js/ui/auth.js +5 -5
  48. package/js/ui/contracts.js +4 -4
  49. package/js/ui/serving.js +8 -8
  50. package/package.json +1 -1
  51. package/runtime.json +1 -1
  52. package/types/app-data/src/contracts/database.d.ts +33 -6
  53. package/types/app-data/src/implementation/schema.d.ts +2 -17
  54. package/types/apps/src/contracts/failure.d.ts +25 -0
  55. package/types/apps/src/contracts/host.d.ts +11 -6
  56. package/types/apps/src/contracts/openapi.d.ts +1 -1
  57. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  58. package/types/apps/src/contracts/protocols/1.d.ts +15 -1
  59. package/types/apps/src/contracts/protocols/2.d.ts +2 -2
  60. package/types/apps/src/contracts/protocols/3.d.ts +676 -0
  61. package/types/apps/src/contracts/storage.d.ts +3 -3
  62. package/types/apps/src/contracts/workflows.d.ts +34 -3
  63. package/types/apps/src/implementation/elicitation.d.ts +1 -1
  64. package/types/apps/src/implementation/failure-detail.d.ts +25 -0
  65. package/types/apps/src/implementation/storage.d.ts +5 -3
  66. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  67. package/types/apps/src/implementation/workflow-context.d.ts +11 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Schema_exports
3
- } from "./chunk-FW5HBOIK.js";
3
+ } from "./chunk-CDL5PM2Q.js";
4
4
 
5
5
  // src/contracts/schema.ts
6
6
  var JsonValue = Schema_exports.Json;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  decoderOf
3
- } from "./chunk-WFSQXYUT.js";
3
+ } from "./chunk-FWQC6I3C.js";
4
4
  import {
5
5
  Effect_exports
6
- } from "./chunk-FW5HBOIK.js";
6
+ } from "./chunk-CDL5PM2Q.js";
7
7
 
8
8
  // src/implementation/authoring.ts
9
9
  var NativeCallback = /* @__PURE__ */ Symbol("apps.NativeCallback");
@@ -0,0 +1,136 @@
1
+ import {
2
+ ApiErrorResponse
3
+ } from "./chunk-W4DMKWAB.js";
4
+ import {
5
+ AccountId,
6
+ HttpUrl,
7
+ JsonObject
8
+ } from "./chunk-27F7W2LG.js";
9
+ import {
10
+ Schema_exports
11
+ } from "./chunk-CDL5PM2Q.js";
12
+
13
+ // src/contracts/openapi.ts
14
+ var OpenapiErrorResponse = Schema_exports.Struct({
15
+ code: ApiErrorResponse.fields.code,
16
+ status: ApiErrorResponse.fields.status,
17
+ message: Schema_exports.Union([
18
+ Schema_exports.Struct({ source: Schema_exports.Literal("body") }),
19
+ Schema_exports.Struct({ source: Schema_exports.Literal("schema"), value: ApiErrorResponse.fields.message })
20
+ ]),
21
+ schema: JsonObject
22
+ });
23
+ var OpenapiParameter = Schema_exports.Struct({
24
+ name: Schema_exports.String,
25
+ in: Schema_exports.Literals(["path", "query", "header", "cookie"]),
26
+ required: Schema_exports.optionalKey(Schema_exports.Boolean),
27
+ schema: Schema_exports.optionalKey(JsonObject),
28
+ style: Schema_exports.optionalKey(Schema_exports.String),
29
+ explode: Schema_exports.optionalKey(Schema_exports.Boolean),
30
+ allowReserved: Schema_exports.optionalKey(Schema_exports.Boolean),
31
+ allowEmptyValue: Schema_exports.optionalKey(Schema_exports.Boolean),
32
+ content: Schema_exports.optionalKey(JsonObject)
33
+ });
34
+ var OpenapiRequestBody = Schema_exports.Struct({
35
+ required: Schema_exports.optionalKey(Schema_exports.Boolean),
36
+ content: Schema_exports.Record(
37
+ Schema_exports.String,
38
+ Schema_exports.Struct({
39
+ schema: Schema_exports.optionalKey(JsonObject),
40
+ encoding: Schema_exports.optionalKey(JsonObject)
41
+ })
42
+ )
43
+ });
44
+ var OpenapiOperation = Schema_exports.Struct({
45
+ /** The tool name after `queries.` or `mutations.`, grouped as `<group>.<leaf>`. */
46
+ name: Schema_exports.NonEmptyString,
47
+ /** The document's operationId, when it declares one. `kinds` overrides are keyed by it. */
48
+ operationId: Schema_exports.optionalKey(Schema_exports.String),
49
+ description: Schema_exports.String,
50
+ method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
51
+ path: Schema_exports.String,
52
+ baseUrl: HttpUrl,
53
+ openapi: Schema_exports.String,
54
+ securitySchemes: Schema_exports.Record(Schema_exports.String, JsonObject),
55
+ /** The resolved OpenAPI Operation Object; Executor schemas remain separate. */
56
+ request: Schema_exports.Struct({
57
+ parameters: Schema_exports.Array(OpenapiParameter),
58
+ requestBody: Schema_exports.optionalKey(OpenapiRequestBody),
59
+ security: Schema_exports.Array(Schema_exports.Record(Schema_exports.String, Schema_exports.Array(Schema_exports.String))),
60
+ responses: Schema_exports.Record(Schema_exports.String, JsonObject)
61
+ }),
62
+ /** Streams remain in the metadata but cannot run through a single-result tool call. */
63
+ streaming: Schema_exports.optionalKey(Schema_exports.Literal(true)),
64
+ input: JsonObject,
65
+ outputSchema: Schema_exports.optionalKey(JsonObject),
66
+ errorResponses: Schema_exports.optionalKey(Schema_exports.Array(OpenapiErrorResponse))
67
+ });
68
+ var CredentialBinding = Schema_exports.Struct({
69
+ scheme: Schema_exports.String,
70
+ field: Schema_exports.String,
71
+ part: Schema_exports.Literals(["value", "username", "password"]),
72
+ prefix: Schema_exports.String
73
+ });
74
+ var OpenapiAccount = Schema_exports.Struct({
75
+ id: Schema_exports.optional(AccountId),
76
+ method: Schema_exports.String,
77
+ fields: Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown)
78
+ });
79
+ var OpenapiParameterDefaults = Schema_exports.Struct({
80
+ path: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
81
+ query: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
82
+ headers: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String))
83
+ });
84
+ var OpenapiToolsOptions = Schema_exports.Struct({
85
+ operations: Schema_exports.Array(OpenapiOperation),
86
+ /**
87
+ * Component schemas stored once per app and referenced as `#/$defs/<name>`. Operations
88
+ * generated before shared definitions carry their own `$defs` and omit this.
89
+ */
90
+ definitions: Schema_exports.optional(Schema_exports.Record(Schema_exports.String, JsonObject)),
91
+ methods: Schema_exports.Record(Schema_exports.String, Schema_exports.Array(CredentialBinding)),
92
+ oauth: Schema_exports.Array(Schema_exports.String),
93
+ account: Schema_exports.optional(OpenapiAccount),
94
+ parameterDefaults: Schema_exports.optional(OpenapiParameterDefaults),
95
+ signal: Schema_exports.optional(Schema_exports.instanceOf(AbortSignal)),
96
+ fetch: Schema_exports.optional(
97
+ Schema_exports.declare((value) => typeof value === "function")
98
+ )
99
+ });
100
+ var OpenapiError = class extends Schema_exports.TaggedError()("OpenapiError", {
101
+ reason: Schema_exports.Literals(["invalid_definition", "invalid_input", "request"]),
102
+ status: Schema_exports.optional(Schema_exports.Number)
103
+ }) {
104
+ };
105
+ var defaultOpenapiResponseLimits = {
106
+ maxBodyBytes: 16777216,
107
+ readTimeoutMs: 3e4
108
+ };
109
+ var isOpenapiTextMedia = (type) => /^(?:text\/|application\/(?:[\w.-]+\+)?(?:json|xml)|application\/(?:javascript|x-ndjson|x-www-form-urlencoded))/i.test(
110
+ type
111
+ );
112
+ var isOpenapiFileSchema = (shape) => shape.contentMediaType !== void 0 && shape.contentEncoding === void 0 || shape.type === "string" && shape.format === "binary";
113
+ var openapiBinaryResultSchema = {
114
+ type: "object",
115
+ properties: {
116
+ base64: { type: "string", contentEncoding: "base64" },
117
+ contentType: { type: "string" }
118
+ },
119
+ required: ["base64", "contentType"],
120
+ additionalProperties: false
121
+ };
122
+ var openapiMediaKind = (type) => type.includes("json") && !type.includes("ndjson") ? "json" : type === "application/x-www-form-urlencoded" ? "form" : type === "multipart/form-data" ? "multipart" : isOpenapiTextMedia(type) ? "text" : "binary";
123
+
124
+ export {
125
+ OpenapiErrorResponse,
126
+ OpenapiParameter,
127
+ OpenapiRequestBody,
128
+ OpenapiOperation,
129
+ OpenapiToolsOptions,
130
+ OpenapiError,
131
+ defaultOpenapiResponseLimits,
132
+ isOpenapiTextMedia,
133
+ isOpenapiFileSchema,
134
+ openapiBinaryResultSchema,
135
+ openapiMediaKind
136
+ };
@@ -4,7 +4,7 @@ import {
4
4
  fromWeb,
5
5
  layerMergedContext,
6
6
  make2 as make
7
- } from "./chunk-QKHR7BMF.js";
7
+ } from "./chunk-UK573G7W.js";
8
8
  import {
9
9
  Reference,
10
10
  Service,
@@ -17,7 +17,7 @@ import {
17
17
  succeed4 as succeed,
18
18
  toReadableStreamEffect,
19
19
  tryPromise
20
- } from "./chunk-FW5HBOIK.js";
20
+ } from "./chunk-CDL5PM2Q.js";
21
21
  import {
22
22
  __export
23
23
  } from "./chunk-CZ7CSFO4.js";
@@ -2,36 +2,36 @@ import {
2
2
  adaptMcpTools,
3
3
  mcpClient,
4
4
  mcpJsonSchemaValidator
5
- } from "./chunk-2VPJHFOU.js";
5
+ } from "./chunk-UDDE5KOR.js";
6
6
  import {
7
7
  accountProviderError,
8
8
  httpProviderError
9
- } from "./chunk-ZJWDMTE3.js";
9
+ } from "./chunk-G7T27IWB.js";
10
10
  import {
11
11
  McpError,
12
12
  McpToolsOptions,
13
13
  defaultMcpClientLimits
14
- } from "./chunk-3M2MEDNL.js";
14
+ } from "./chunk-DQAZTA4I.js";
15
15
  import {
16
16
  ProviderError
17
- } from "./chunk-W7D7WVSY.js";
17
+ } from "./chunk-SB3V4YVR.js";
18
18
  import {
19
19
  captureTelemetry
20
- } from "./chunk-ZCAMUXSG.js";
20
+ } from "./chunk-RJDDBDSN.js";
21
21
  import {
22
22
  FetchHttpClient_exports
23
- } from "./chunk-HDJH3RPR.js";
23
+ } from "./chunk-57RKNWL2.js";
24
24
  import {
25
25
  HttpClientRequest_exports,
26
26
  HttpClient_exports
27
- } from "./chunk-QKHR7BMF.js";
27
+ } from "./chunk-UK573G7W.js";
28
28
  import {
29
29
  Deferred_exports,
30
30
  Effect_exports,
31
31
  Redacted_exports,
32
32
  Schema_exports,
33
33
  Stream_exports
34
- } from "./chunk-FW5HBOIK.js";
34
+ } from "./chunk-CDL5PM2Q.js";
35
35
 
36
36
  // src/implementation/mcp.ts
37
37
  import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
@@ -1,29 +1,31 @@
1
1
  import {
2
- parseDatabaseSchema,
3
2
  promiseTable
4
- } from "./chunk-PLCMJREA.js";
3
+ } from "./chunk-ZQINWV4W.js";
5
4
  import {
6
5
  fromPromise,
7
6
  nativeOperation
8
- } from "./chunk-PYUYJRSK.js";
7
+ } from "./chunk-3XKZDQLM.js";
9
8
  import {
10
9
  ScheduleTiming
11
- } from "./chunk-3M2MEDNL.js";
10
+ } from "./chunk-DQAZTA4I.js";
11
+ import {
12
+ DatabaseSchema
13
+ } from "./chunk-N7YDVXYJ.js";
12
14
  import {
13
15
  decoderOf,
14
16
  isSchema,
15
17
  storageFieldOf
16
- } from "./chunk-WFSQXYUT.js";
18
+ } from "./chunk-FWQC6I3C.js";
17
19
  import {
18
20
  AppStorageUnavailable
19
- } from "./chunk-FZJOYIZO.js";
21
+ } from "./chunk-PZB6T6KU.js";
20
22
  import {
21
23
  JsonValue
22
- } from "./chunk-SATWJKN6.js";
24
+ } from "./chunk-27F7W2LG.js";
23
25
  import {
24
26
  Effect_exports,
25
27
  Schema_exports
26
- } from "./chunk-FW5HBOIK.js";
28
+ } from "./chunk-CDL5PM2Q.js";
27
29
 
28
30
  // src/implementation/workflows.ts
29
31
  var NativeWorkflow = /* @__PURE__ */ Symbol("apps.Workflow");
@@ -152,7 +154,7 @@ var serialize = (tables) => {
152
154
  }
153
155
  ])
154
156
  );
155
- return Effect_exports.runSync(parseDatabaseSchema(definitions));
157
+ return Schema_exports.decodeUnknownSync(DatabaseSchema)(definitions);
156
158
  };
157
159
  var authorDatabase = (tables, session, signal, writable) => {
158
160
  return Object.fromEntries(