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
@@ -3,14 +3,14 @@ import {
3
3
  CacheEntry,
4
4
  CacheError,
5
5
  cacheLimits
6
- } from "./chunk-LGIYBDWA.js";
6
+ } from "./chunk-YEPYT6SD.js";
7
7
  import {
8
8
  Clock_exports,
9
9
  Duration_exports,
10
10
  Effect_exports,
11
11
  Exit_exports,
12
12
  Schema_exports
13
- } from "./chunk-FW5HBOIK.js";
13
+ } from "./chunk-CDL5PM2Q.js";
14
14
 
15
15
  // ../app-cache/src/index.ts
16
16
  var canonical = (value) => {
@@ -1,26 +1,28 @@
1
1
  import {
2
+ DatabaseFieldReserved,
3
+ DatabaseLimitExceeded,
2
4
  DatabaseSchema
3
- } from "./chunk-BMOIAIVR.js";
5
+ } from "./chunk-N7YDVXYJ.js";
4
6
  import {
5
7
  CacheCommand,
6
8
  CacheReply
7
- } from "./chunk-LGIYBDWA.js";
9
+ } from "./chunk-YEPYT6SD.js";
8
10
  import {
9
11
  AppSkills,
10
12
  SkillLoadFailed
11
- } from "./chunk-YEJOQEII.js";
13
+ } from "./chunk-JU7VHODU.js";
12
14
  import {
13
15
  OpenapiResponseError
14
- } from "./chunk-SWPD52J7.js";
16
+ } from "./chunk-W4DMKWAB.js";
15
17
  import {
16
18
  ProviderError
17
- } from "./chunk-W7D7WVSY.js";
19
+ } from "./chunk-SB3V4YVR.js";
18
20
  import {
19
21
  AccountId,
20
22
  HttpUrl,
21
23
  JsonObject as JsonObject2,
22
24
  JsonValue
23
- } from "./chunk-SATWJKN6.js";
25
+ } from "./chunk-27F7W2LG.js";
24
26
  import {
25
27
  Any,
26
28
  ArraySchema,
@@ -74,7 +76,7 @@ import {
74
76
  transformOptional,
75
77
  withConstructorDefault,
76
78
  withDefault
77
- } from "./chunk-FW5HBOIK.js";
79
+ } from "./chunk-CDL5PM2Q.js";
78
80
 
79
81
  // src/contracts/tools.ts
80
82
  var ToolAnnotations = Schema_exports.Struct({
@@ -150,6 +152,19 @@ var ProcessConfig = Schema_exports.Struct({
150
152
  )
151
153
  });
152
154
 
155
+ // src/contracts/failure.ts
156
+ var maxFailureMessageLength = 2048;
157
+ var FailureSource = Schema_exports.Literals(["app", "storage", "service"]);
158
+ var FailureName = Schema_exports.String.check(Schema_exports.isMaxLength(128));
159
+ var FailureCode = Schema_exports.String.check(Schema_exports.isMaxLength(128));
160
+ var FailureMessage = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength));
161
+ var FailureDetail = {
162
+ source: Schema_exports.optionalKey(FailureSource),
163
+ errorName: Schema_exports.optionalKey(FailureName),
164
+ code: Schema_exports.optionalKey(FailureCode),
165
+ message: Schema_exports.optionalKey(FailureMessage)
166
+ };
167
+
153
168
  // src/contracts/workflows.ts
154
169
  var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
155
170
  var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
@@ -191,7 +206,14 @@ var WorkflowStepOptions = Schema_exports.Struct({
191
206
  ),
192
207
  timeout: Schema_exports.optionalKey(WorkflowDuration)
193
208
  });
209
+ var WorkflowFailureDetail = {
210
+ step: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(200))),
211
+ errorName: Schema_exports.optionalKey(FailureName),
212
+ message: Schema_exports.optionalKey(FailureMessage)
213
+ };
214
+ var WorkflowRunFailure = Schema_exports.Struct(WorkflowFailureDetail);
194
215
  var WorkflowFailure = class extends Schema_exports.TaggedError()("WorkflowFailure", {
216
+ ...WorkflowFailureDetail,
195
217
  reason: Schema_exports.Literals([
196
218
  "unavailable",
197
219
  "not_found",
@@ -239,7 +261,9 @@ var WorkflowRun = Schema_exports.Union([
239
261
  Schema_exports.Struct({
240
262
  ...runFields,
241
263
  status: Schema_exports.Literal("errored"),
242
- error: WorkflowFailure.fields.reason
264
+ error: WorkflowFailure.fields.reason,
265
+ /** The failing step and the app's own error, when the run recorded them. */
266
+ failure: Schema_exports.optionalKey(WorkflowRunFailure)
243
267
  }),
244
268
  Schema_exports.Struct({ ...runFields, status: Schema_exports.Literal("terminated") })
245
269
  ]);
@@ -1819,7 +1843,7 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
1819
1843
  };
1820
1844
 
1821
1845
  // src/contracts/protocol-version.ts
1822
- var frameworkProtocol = 2;
1846
+ var frameworkProtocol = 3;
1823
1847
 
1824
1848
  // src/contracts/schedules.ts
1825
1849
  var minimumIntervalMilliseconds = 6e4;
@@ -1857,6 +1881,27 @@ var OperationSchedule = Schema_exports.Struct({
1857
1881
  });
1858
1882
 
1859
1883
  // src/contracts/protocols/1.ts
1884
+ var WorkflowFailure2 = class extends Schema_exports.TaggedError()("WorkflowFailure", {
1885
+ reason: Schema_exports.Literals([
1886
+ "unavailable",
1887
+ "not_found",
1888
+ "input",
1889
+ "output",
1890
+ "operation",
1891
+ "approval",
1892
+ "credentials",
1893
+ "terminated",
1894
+ "execution",
1895
+ "conflict",
1896
+ "engine"
1897
+ ]),
1898
+ retryable: Schema_exports.Boolean
1899
+ }) {
1900
+ };
1901
+ var WorkflowRpcResult2 = Schema_exports.Union([
1902
+ Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: JsonValue }),
1903
+ Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: WorkflowFailure2 })
1904
+ ]);
1860
1905
  var DeclaredAuthMethod = Schema_exports.Union([
1861
1906
  Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject2 }),
1862
1907
  Schema_exports.Struct({
@@ -2041,7 +2086,7 @@ var HostError = Schema_exports.Union([
2041
2086
  ProviderError,
2042
2087
  McpError,
2043
2088
  SkillLoadFailed,
2044
- WorkflowFailure,
2089
+ WorkflowFailure2,
2045
2090
  HostRequestInvalid,
2046
2091
  HostAccountsInvalid,
2047
2092
  HostDeclarationInvalid,
@@ -2085,7 +2130,7 @@ var protocol1 = {
2085
2130
  elicitationRequest: FormElicitation,
2086
2131
  elicitationReply: ElicitationReply,
2087
2132
  workflowStep: WorkflowRpcCommand,
2088
- workflowStepReply: WorkflowRpcResult,
2133
+ workflowStepReply: WorkflowRpcResult2,
2089
2134
  workflowControl: WorkflowControlCommand,
2090
2135
  cacheCommand: CacheCommand,
2091
2136
  cacheReply: CacheReply
@@ -2104,6 +2149,72 @@ var protocol2 = {
2104
2149
  schemas: { ...protocol1.schemas, skills: SkillCatalogResponse2 }
2105
2150
  };
2106
2151
 
2152
+ // src/contracts/protocols/3.ts
2153
+ var HostDeclarationInvalid2 = class extends Schema_exports.TaggedError()(
2154
+ "HostDeclarationInvalid",
2155
+ FailureDetail
2156
+ ) {
2157
+ };
2158
+ var HostEvaluationFailed2 = class extends Schema_exports.TaggedError()(
2159
+ "HostEvaluationFailed",
2160
+ FailureDetail
2161
+ ) {
2162
+ };
2163
+ var HostOperationFailed2 = class extends Schema_exports.TaggedError()(
2164
+ "HostOperationFailed",
2165
+ FailureDetail
2166
+ ) {
2167
+ };
2168
+ var HostError2 = Schema_exports.Union([
2169
+ OpenapiResponseError,
2170
+ ProviderError,
2171
+ McpError,
2172
+ SkillLoadFailed,
2173
+ WorkflowFailure,
2174
+ HostRequestInvalid,
2175
+ HostAccountsInvalid,
2176
+ HostDeclarationInvalid2,
2177
+ HostEvaluationFailed2,
2178
+ HostOperationNotFound,
2179
+ HostOperationFailed2,
2180
+ DatabaseLimitExceeded,
2181
+ DatabaseFieldReserved,
2182
+ HostToolNotFound,
2183
+ HostInputInvalid,
2184
+ HostOutputInvalid,
2185
+ HostToolBlocked,
2186
+ HostToolApprovalRequired,
2187
+ HostToolPolicyFailed,
2188
+ ElicitationFailed
2189
+ ]);
2190
+ var HostResponse2 = Schema_exports.Union([
2191
+ Schema_exports.Struct({
2192
+ ok: Schema_exports.Literal(true),
2193
+ value: JsonValue,
2194
+ toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
2195
+ }),
2196
+ Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError2 })
2197
+ ]);
2198
+ var protocol3 = {
2199
+ version: 3,
2200
+ schemas: {
2201
+ invocation: HostInvocation,
2202
+ request: HostRequest,
2203
+ response: HostResponse2,
2204
+ requirements: DeclaredRequirements,
2205
+ tools: Schema_exports.Array(HostedTool),
2206
+ toolSummaries: Schema_exports.Array(HostedToolSummary),
2207
+ skills: SkillCatalogResponse2,
2208
+ elicitationRequest: FormElicitation,
2209
+ elicitationReply: ElicitationReply,
2210
+ workflowStep: WorkflowRpcCommand,
2211
+ workflowStepReply: WorkflowRpcResult,
2212
+ workflowControl: WorkflowControlCommand,
2213
+ cacheCommand: CacheCommand,
2214
+ cacheReply: CacheReply
2215
+ }
2216
+ };
2217
+
2107
2218
  // src/contracts/operations.ts
2108
2219
  var OperationToolPrefixes = { query: "queries.", mutate: "mutations." };
2109
2220
 
@@ -2117,15 +2228,19 @@ var inspectCommand = (tools, scheduled) => ({
2117
2228
  });
2118
2229
  var indexCommand = { operation: "inspect", detail: "summary" };
2119
2230
  var selectTools = (tools) => (all) => tools === void 0 ? all : all.filter((tool) => tools.includes(tool.name));
2120
- var HostRequirementsError = Schema_exports.Union([HostRequestInvalid, HostDeclarationInvalid]);
2231
+ var HostRequirementsError = Schema_exports.Union([
2232
+ HostRequestInvalid,
2233
+ HostDeclarationInvalid2,
2234
+ DatabaseFieldReserved
2235
+ ]);
2121
2236
  var HostInspectError = Schema_exports.Union([
2122
2237
  ProviderError,
2123
2238
  McpError,
2124
2239
  SkillLoadFailed,
2125
2240
  HostRequestInvalid,
2126
- HostDeclarationInvalid,
2241
+ HostDeclarationInvalid2,
2127
2242
  HostAccountsInvalid,
2128
- HostEvaluationFailed
2243
+ HostEvaluationFailed2
2129
2244
  ]);
2130
2245
  var HostCallError = Schema_exports.Union([
2131
2246
  OpenapiResponseError,
@@ -2133,7 +2248,8 @@ var HostCallError = Schema_exports.Union([
2133
2248
  HostInspectError,
2134
2249
  HostToolNotFound,
2135
2250
  HostOperationNotFound,
2136
- HostOperationFailed,
2251
+ HostOperationFailed2,
2252
+ DatabaseLimitExceeded,
2137
2253
  HostInputInvalid,
2138
2254
  HostOutputInvalid,
2139
2255
  HostToolBlocked,
@@ -2166,11 +2282,19 @@ export {
2166
2282
  McpToolMetadata,
2167
2283
  McpError,
2168
2284
  ProcessConfig,
2285
+ maxFailureMessageLength,
2286
+ FailureSource,
2287
+ FailureName,
2288
+ FailureCode,
2289
+ FailureMessage,
2290
+ FailureDetail,
2169
2291
  WorkflowRunId,
2170
2292
  WorkflowName,
2171
2293
  workflowDurationMillis,
2172
2294
  WorkflowDuration,
2173
2295
  WorkflowStepOptions,
2296
+ WorkflowFailureDetail,
2297
+ WorkflowRunFailure,
2174
2298
  WorkflowFailure,
2175
2299
  NonRetryableError,
2176
2300
  WorkflowValue,
@@ -2217,10 +2341,7 @@ export {
2217
2341
  HostRequest,
2218
2342
  HostRequestInvalid,
2219
2343
  HostAccountsInvalid,
2220
- HostDeclarationInvalid,
2221
- HostEvaluationFailed,
2222
2344
  HostOperationNotFound,
2223
- HostOperationFailed,
2224
2345
  HostToolNotFound,
2225
2346
  InputProblem,
2226
2347
  maxInputProblems,
@@ -2229,13 +2350,17 @@ export {
2229
2350
  HostToolApprovalRequired,
2230
2351
  HostToolPolicyFailed,
2231
2352
  HostOutputInvalid,
2232
- HostError,
2233
- HostResponse,
2234
2353
  HostInvocation,
2235
2354
  protocol1,
2236
2355
  SkillSources2 as SkillSources,
2237
2356
  SkillCatalogResponse2 as SkillCatalogResponse,
2238
2357
  protocol2,
2358
+ HostDeclarationInvalid2 as HostDeclarationInvalid,
2359
+ HostEvaluationFailed2 as HostEvaluationFailed,
2360
+ HostOperationFailed2 as HostOperationFailed,
2361
+ HostError2 as HostError,
2362
+ HostResponse2 as HostResponse,
2363
+ protocol3,
2239
2364
  OperationToolPrefixes,
2240
2365
  skillsCommand,
2241
2366
  skillCatalog,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ValidationError
3
- } from "./chunk-SATWJKN6.js";
3
+ } from "./chunk-27F7W2LG.js";
4
4
  import {
5
5
  Cause_exports,
6
6
  Effect_exports,
@@ -9,7 +9,7 @@ import {
9
9
  SchemaIssue_exports,
10
10
  SchemaParser_exports,
11
11
  Schema_exports
12
- } from "./chunk-FW5HBOIK.js";
12
+ } from "./chunk-CDL5PM2Q.js";
13
13
 
14
14
  // ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
15
15
  function deepCompareStrict(a, b) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ProviderError
3
- } from "./chunk-W7D7WVSY.js";
3
+ } from "./chunk-SB3V4YVR.js";
4
4
  import {
5
5
  AccountId
6
- } from "./chunk-SATWJKN6.js";
6
+ } from "./chunk-27F7W2LG.js";
7
7
  import {
8
8
  Option_exports,
9
9
  Schema_exports
10
- } from "./chunk-FW5HBOIK.js";
10
+ } from "./chunk-CDL5PM2Q.js";
11
11
 
12
12
  // src/implementation/provider-error.ts
13
13
  function parseProviderError(error) {
@@ -19,10 +19,10 @@ import {
19
19
  text,
20
20
  uint8Array,
21
21
  urlParams
22
- } from "./chunk-QKHR7BMF.js";
22
+ } from "./chunk-UK573G7W.js";
23
23
  import {
24
24
  JsonValue
25
- } from "./chunk-SATWJKN6.js";
25
+ } from "./chunk-27F7W2LG.js";
26
26
  import {
27
27
  Cause,
28
28
  Defect,
@@ -118,7 +118,7 @@ import {
118
118
  transformEffect,
119
119
  transformPull,
120
120
  void_2 as void_
121
- } from "./chunk-FW5HBOIK.js";
121
+ } from "./chunk-CDL5PM2Q.js";
122
122
  import {
123
123
  __export
124
124
  } from "./chunk-CZ7CSFO4.js";
@@ -5,11 +5,11 @@ import {
5
5
  SkillDefinitionInvalid,
6
6
  SkillFile,
7
7
  SkillFilePath
8
- } from "./chunk-YEJOQEII.js";
8
+ } from "./chunk-JU7VHODU.js";
9
9
  import {
10
10
  Effect_exports,
11
11
  Schema_exports
12
- } from "./chunk-FW5HBOIK.js";
12
+ } from "./chunk-CDL5PM2Q.js";
13
13
 
14
14
  // src/implementation/skill-files.ts
15
15
  var skillFromFiles = (input, source = {}) => Effect_exports.gen(function* () {
@@ -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/skills.ts
6
6
  var SkillFilePath = Schema_exports.NonEmptyString.check(
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  appSignInCallbackPath
3
- } from "./chunk-T2LAZCAD.js";
3
+ } from "./chunk-VFZKSM3T.js";
4
4
  import {
5
5
  HttpServerResponse_exports
6
- } from "./chunk-QKHR7BMF.js";
6
+ } from "./chunk-UK573G7W.js";
7
7
 
8
8
  // src/implementation/ui-auth.ts
9
9
  var appPrivateHeaders = {