apps 0.0.1-beta.89 → 0.0.1-beta.90

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 (55) hide show
  1. package/README.md +27 -10
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-H6NFR354.js → chunk-36UFTECB.js} +6 -8
  4. package/js/{chunk-I46RIOKQ.js → chunk-5MDA7MKL.js} +14 -13
  5. package/js/{chunk-NQW2E44U.js → chunk-6XQLA5NC.js} +579 -81
  6. package/js/{chunk-6FUJH3T4.js → chunk-7PHHWYV4.js} +6 -5
  7. package/js/{chunk-7Z3NUCTP.js → chunk-DADXWWRZ.js} +24 -6
  8. package/js/{chunk-BZFFXNWA.js → chunk-I5C7FD5Z.js} +1 -1
  9. package/js/{chunk-EKZLPXHK.js → chunk-KUCCHNVY.js} +3 -3
  10. package/js/{chunk-ZK7JDZJS.js → chunk-PYQLOLOC.js} +2 -2
  11. package/js/{chunk-ELSILABS.js → chunk-WMD4NHXZ.js} +113 -73
  12. package/js/{chunk-JJH3MBAM.js → chunk-YNJ5CZMJ.js} +3 -2
  13. package/js/{chunk-5ZVAYXLT.js → chunk-YRGL4QEF.js} +1 -1
  14. package/js/{chunk-GLXEYET6.js → chunk-YWFUWTUJ.js} +12 -7
  15. package/js/client.js +1 -1
  16. package/js/contracts.js +37 -25
  17. package/js/effect.js +8 -9
  18. package/js/graphql.js +10 -11
  19. package/js/host.js +11 -13
  20. package/js/index.js +29 -31
  21. package/js/mcp/effect.js +9 -10
  22. package/js/mcp.js +11 -12
  23. package/js/openapi.js +9 -11
  24. package/js/skills.js +6 -6
  25. package/js/ui/contracts.js +1 -1
  26. package/js/ui/serving.js +5 -6
  27. package/package.json +1 -1
  28. package/runtime.json +1 -1
  29. package/types/apps/src/contracts/app.d.ts +51 -8
  30. package/types/apps/src/contracts/cache.d.ts +1 -1
  31. package/types/apps/src/contracts/context.d.ts +37 -8
  32. package/types/apps/src/contracts/events.d.ts +2 -1
  33. package/types/apps/src/contracts/host.d.ts +800 -4
  34. package/types/apps/src/contracts/operations.d.ts +6 -3
  35. package/types/apps/src/contracts/protocol-version.d.ts +1 -1
  36. package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
  37. package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
  38. package/types/apps/src/contracts/protocols/current.d.ts +4445 -1633
  39. package/types/apps/src/contracts/schedules.d.ts +7 -1
  40. package/types/apps/src/contracts/ui.d.ts +11 -15
  41. package/types/apps/src/contracts/webhooks.d.ts +24 -7
  42. package/types/apps/src/contracts/workflows.d.ts +13 -17
  43. package/types/apps/src/implementation/app.d.ts +41 -14
  44. package/types/apps/src/implementation/cache.d.ts +1 -1
  45. package/types/apps/src/implementation/events.d.ts +6 -1
  46. package/types/apps/src/implementation/failure-detail.d.ts +3 -2
  47. package/types/apps/src/implementation/operations.d.ts +40 -5
  48. package/types/apps/src/implementation/router-catalog.d.ts +4 -0
  49. package/types/apps/src/implementation/schedules.d.ts +39 -8
  50. package/types/apps/src/implementation/ui-serving.d.ts +2 -2
  51. package/types/apps/src/implementation/webhooks.d.ts +15 -6
  52. package/types/apps/src/implementation/workflow-context.d.ts +6 -2
  53. package/types/apps/src/implementation/workflows.d.ts +10 -3
  54. package/types/apps/src/index.d.ts +15 -9
  55. package/js/chunk-F2G534HD.js +0 -285
@@ -1,12 +1,3 @@
1
- import {
2
- CacheCommand,
3
- CacheReply,
4
- FailureDetail,
5
- FailureMessage,
6
- FailureName,
7
- ProviderError,
8
- UpstreamError
9
- } from "./chunk-F2G534HD.js";
10
1
  import {
11
2
  AppSkillName,
12
3
  AppSkills
@@ -77,6 +68,52 @@ import {
77
68
  withDefault
78
69
  } from "./chunk-IFJU5SYQ.js";
79
70
 
71
+ // src/contracts/failure.ts
72
+ var maxFailureMessageLength = 2048;
73
+ var FailureSource = Schema_exports.Literals(["app", "storage", "service"]);
74
+ var FailureName = Schema_exports.String.check(Schema_exports.isMaxLength(128));
75
+ var FailureCode = Schema_exports.String.check(Schema_exports.isMaxLength(128));
76
+ var FailureMessage = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength));
77
+ var maxFailureFields = 8;
78
+ var maxFailureFieldLength = 256;
79
+ var FailureFieldName = Schema_exports.String.check(
80
+ Schema_exports.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/)
81
+ );
82
+ var FailureFieldValue = Schema_exports.Union([
83
+ Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureFieldLength)),
84
+ Schema_exports.Finite,
85
+ Schema_exports.Boolean
86
+ ]);
87
+ var FailureFields = Schema_exports.Record(FailureFieldName, FailureFieldValue).check(
88
+ Schema_exports.isMaxProperties(maxFailureFields)
89
+ );
90
+ var FailureDetail = {
91
+ source: Schema_exports.optionalKey(FailureSource),
92
+ errorName: Schema_exports.optionalKey(FailureName),
93
+ code: Schema_exports.optionalKey(FailureCode),
94
+ message: Schema_exports.optionalKey(FailureMessage),
95
+ fields: Schema_exports.optionalKey(FailureFields)
96
+ };
97
+ var maxUpstreamMessageLength = 1024;
98
+ var UpstreamError = Schema_exports.Struct({
99
+ code: Schema_exports.Union([
100
+ Schema_exports.Int,
101
+ Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(128))
102
+ ]),
103
+ message: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(maxUpstreamMessageLength)))
104
+ });
105
+ var FailurePhase = Schema_exports.Literals(["connect", "discover", "call"]);
106
+
107
+ // src/contracts/provider-error.ts
108
+ var ProviderError = class extends Schema_exports.TaggedError()("ProviderError", {
109
+ reason: Schema_exports.Literals(["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]),
110
+ status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
111
+ accountId: Schema_exports.optional(AccountId),
112
+ phase: Schema_exports.optional(FailurePhase),
113
+ upstream: Schema_exports.optional(UpstreamError)
114
+ }) {
115
+ };
116
+
80
117
  // src/contracts/api-response-error.ts
81
118
  var maxApiErrorInstructionsLength = 4096;
82
119
  var ApiErrorRecovery = Schema_exports.Struct({
@@ -104,6 +141,111 @@ var defaultOpenapiErrorLimits = OpenapiErrorLimits.make({
104
141
  readTimeoutMs: 2e3
105
142
  });
106
143
 
144
+ // src/contracts/network.ts
145
+ var NetworkRefusal = Schema_exports.Union([
146
+ Schema_exports.Struct({ reason: Schema_exports.Literal("private_address") }),
147
+ Schema_exports.Struct({
148
+ reason: Schema_exports.Literal("credential_host"),
149
+ /** The provider of the credential handle the request carried. */
150
+ provider: Schema_exports.String,
151
+ /** The hosts that provider's credentials may reach; empty when it declares none. */
152
+ allowedHosts: Schema_exports.Array(Schema_exports.String)
153
+ }),
154
+ Schema_exports.Struct({ reason: Schema_exports.Literal("credential_app") }),
155
+ Schema_exports.Struct({
156
+ reason: Schema_exports.Literal("credential_expired"),
157
+ /** The provider of the expired credential handle. */
158
+ provider: Schema_exports.String
159
+ }),
160
+ Schema_exports.Struct({
161
+ reason: Schema_exports.Literal("credential_placement"),
162
+ /** The provider of the misplaced credential handle. */
163
+ provider: Schema_exports.String,
164
+ /** Where the handle was found, such as `body` or `header x-note`. */
165
+ location: Schema_exports.String
166
+ }),
167
+ Schema_exports.Struct({
168
+ reason: Schema_exports.Literal("credential_transport"),
169
+ /** The provider of the credential handle the request carried. */
170
+ provider: Schema_exports.String
171
+ }),
172
+ Schema_exports.Struct({
173
+ reason: Schema_exports.Literal("credential_method"),
174
+ /** The refused HTTP method. */
175
+ method: Schema_exports.String
176
+ })
177
+ ]);
178
+ var NetworkRefused = class extends Schema_exports.TaggedError()("NetworkRefused", {
179
+ /** The refused destination, with its port when the URL names one. */
180
+ host: Schema_exports.String,
181
+ refusal: NetworkRefusal
182
+ }) {
183
+ get message() {
184
+ const refusal = this.refusal;
185
+ switch (refusal.reason) {
186
+ case "private_address":
187
+ return `Executor refused a request to ${this.host}: apps on this instance can reach only public addresses, and ${this.host} is a private, loopback or internal address. The request was not sent.`;
188
+ case "credential_host":
189
+ return refusal.allowedHosts.length === 0 ? `Executor refused this request: ${refusal.provider} credentials cannot be sent to ${this.host}: the provider declares no hosts.` : `Executor refused this request: ${refusal.provider} credentials cannot be sent to ${this.host}. The provider allows: ${refusal.allowedHosts.join(", ")}.`;
190
+ case "credential_app":
191
+ return "Executor refused this request: it carries a credential handle that is not valid for this app. Use the account fields this invocation received.";
192
+ case "credential_expired":
193
+ return `Executor refused this request: it carries an expired ${refusal.provider} credential handle. Use the account fields this invocation received.`;
194
+ case "credential_placement":
195
+ return `Executor refused this request: it carries a ${refusal.provider} credential handle in the ${refusal.location}, where the provider does not place it. Send credentials only as the provider's request declares, for example with the account's headers() and url().`;
196
+ case "credential_transport":
197
+ return `Executor refused this request: ${refusal.provider} credentials are sent only over HTTPS, and ${this.host} was requested over plain HTTP.`;
198
+ case "credential_method":
199
+ return `Executor refused this request: credential handles are never sent with ${refusal.method}, which asks the service to echo the request back.`;
200
+ }
201
+ }
202
+ };
203
+ var networkRefusalStatus = 421;
204
+ var networkRefusalHeader = "x-executor-refused";
205
+ var NetworkRefusedHeader = Schema_exports.StringFromUriComponent.pipe(
206
+ Schema_exports.decodeTo(Schema_exports.fromJsonString(NetworkRefused))
207
+ );
208
+ var encodeRefusal = Schema_exports.encodeSync(NetworkRefused);
209
+ var encodeRefusalHeader = Schema_exports.encodeSync(NetworkRefusedHeader);
210
+ var networkRefusalResponse = (refused) => new Response(JSON.stringify({ ...encodeRefusal(refused), message: refused.message }), {
211
+ status: networkRefusalStatus,
212
+ statusText: "Refused by Executor",
213
+ headers: {
214
+ "content-type": "application/json; charset=utf-8",
215
+ [networkRefusalHeader]: encodeRefusalHeader(refused)
216
+ }
217
+ });
218
+ var RestrictedFetchOption = Schema_exports.Literals(["redirect", "cache", "integrity"]);
219
+ var supportedFetchOptions = {
220
+ redirect: ["follow", "manual"],
221
+ cache: ["no-store", "no-cache"],
222
+ integrity: [""]
223
+ };
224
+ var FetchOptionUnsupported = class extends Schema_exports.TaggedError()(
225
+ "FetchOptionUnsupported",
226
+ {
227
+ option: RestrictedFetchOption,
228
+ value: Schema_exports.String,
229
+ supported: Schema_exports.Array(Schema_exports.String)
230
+ }
231
+ ) {
232
+ get message() {
233
+ const supported = this.supported.map((value) => JSON.stringify(value)).join(" or ");
234
+ return `fetch option ${this.option}: ${JSON.stringify(this.value)} is not supported by Executor's app runtime. Use ${supported}, or omit ${this.option}.${this.advice}`;
235
+ }
236
+ /** What to do instead, when the standard value has an equivalent the runtime supports. */
237
+ get advice() {
238
+ switch (this.option) {
239
+ case "redirect":
240
+ return this.value === "error" ? ` To reject redirects, send redirect: "manual" and treat a 3xx response as the error.` : "";
241
+ case "cache":
242
+ return "";
243
+ case "integrity":
244
+ return " To check a digest, read the body and hash it with crypto.subtle.digest.";
245
+ }
246
+ }
247
+ };
248
+
107
249
  // src/contracts/workflows.ts
108
250
  var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
109
251
  var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
@@ -191,7 +333,6 @@ var HostedWorkflow = Schema_exports.Struct({
191
333
  outputSchema: Schema_exports.optionalKey(JsonObject2)
192
334
  });
193
335
  var runFields = {
194
- profile: Schema_exports.optionalKey(Schema_exports.NonEmptyString),
195
336
  id: WorkflowRunId,
196
337
  app: Schema_exports.NonEmptyString,
197
338
  deployment: Schema_exports.NonEmptyString,
@@ -2344,7 +2485,7 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
2344
2485
  };
2345
2486
 
2346
2487
  // src/contracts/protocol-version.ts
2347
- var frameworkProtocol = 12;
2488
+ var frameworkProtocol = 13;
2348
2489
 
2349
2490
  // src/contracts/protocols/oauth.ts
2350
2491
  var HttpUrl2 = Schema_exports.String.check(
@@ -2497,7 +2638,7 @@ var CacheEntry = Schema_exports.Struct({
2497
2638
  freshUntil: Time,
2498
2639
  staleUntil: Time
2499
2640
  });
2500
- var CacheCommand2 = Schema_exports.Union([
2641
+ var CacheCommand = Schema_exports.Union([
2501
2642
  Schema_exports.Struct({ operation: Schema_exports.Literal("read"), keys: Schema_exports.Array(Key) }),
2502
2643
  Schema_exports.Struct({
2503
2644
  operation: Schema_exports.Literal("acquire"),
@@ -2527,7 +2668,7 @@ var CacheCommand2 = Schema_exports.Union([
2527
2668
  }),
2528
2669
  Schema_exports.Struct({ operation: Schema_exports.Literal("invalidate"), key: Key })
2529
2670
  ]);
2530
- var CacheReply2 = Schema_exports.Union([
2671
+ var CacheReply = Schema_exports.Union([
2531
2672
  Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: Schema_exports.Json }),
2532
2673
  Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: CacheError })
2533
2674
  ]);
@@ -3099,8 +3240,8 @@ var protocol1 = {
3099
3240
  workflowStep: WorkflowRpcCommand2,
3100
3241
  workflowStepReply: WorkflowRpcResult2,
3101
3242
  workflowControl: WorkflowControlCommand2,
3102
- cacheCommand: CacheCommand2,
3103
- cacheReply: CacheReply2
3243
+ cacheCommand: CacheCommand,
3244
+ cacheReply: CacheReply
3104
3245
  }
3105
3246
  };
3106
3247
 
@@ -3117,11 +3258,11 @@ var protocol2 = {
3117
3258
  };
3118
3259
 
3119
3260
  // src/contracts/protocols/3.ts
3120
- var maxFailureMessageLength = 2048;
3121
- var FailureSource = Schema_exports.Literals(["app", "storage", "service"]);
3261
+ var maxFailureMessageLength2 = 2048;
3262
+ var FailureSource2 = Schema_exports.Literals(["app", "storage", "service"]);
3122
3263
  var FailureName2 = Schema_exports.String.check(Schema_exports.isMaxLength(128));
3123
- var FailureCode = Schema_exports.String.check(Schema_exports.isMaxLength(128));
3124
- var FailureMessage2 = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength));
3264
+ var FailureCode2 = Schema_exports.String.check(Schema_exports.isMaxLength(128));
3265
+ var FailureMessage2 = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength2));
3125
3266
  var WorkflowFailureDetail2 = {
3126
3267
  step: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(200))),
3127
3268
  errorName: Schema_exports.optionalKey(FailureName2),
@@ -3178,9 +3319,9 @@ var DatabaseFieldReserved2 = class extends Schema_exports.TaggedError()(
3178
3319
  ) {
3179
3320
  };
3180
3321
  var FailureDetail2 = {
3181
- source: Schema_exports.optionalKey(FailureSource),
3322
+ source: Schema_exports.optionalKey(FailureSource2),
3182
3323
  errorName: Schema_exports.optionalKey(FailureName2),
3183
- code: Schema_exports.optionalKey(FailureCode),
3324
+ code: Schema_exports.optionalKey(FailureCode2),
3184
3325
  message: Schema_exports.optionalKey(FailureMessage2)
3185
3326
  };
3186
3327
  var HostDeclarationInvalid2 = class extends Schema_exports.TaggedError()(
@@ -3243,8 +3384,8 @@ var protocol3 = {
3243
3384
  workflowStep: WorkflowRpcCommand2,
3244
3385
  workflowStepReply: WorkflowRpcResult3,
3245
3386
  workflowControl: WorkflowControlCommand2,
3246
- cacheCommand: CacheCommand2,
3247
- cacheReply: CacheReply2
3387
+ cacheCommand: CacheCommand,
3388
+ cacheReply: CacheReply
3248
3389
  }
3249
3390
  };
3250
3391
 
@@ -3638,40 +3779,40 @@ var protocol7 = {
3638
3779
  };
3639
3780
 
3640
3781
  // src/contracts/protocols/8.ts
3641
- var maxFailureFields = 8;
3642
- var maxFailureFieldLength = 256;
3643
- var FailureFieldName = Schema_exports.String.check(
3782
+ var maxFailureFields2 = 8;
3783
+ var maxFailureFieldLength2 = 256;
3784
+ var FailureFieldName2 = Schema_exports.String.check(
3644
3785
  Schema_exports.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/)
3645
3786
  );
3646
- var FailureFieldValue = Schema_exports.Union([
3647
- Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureFieldLength)),
3787
+ var FailureFieldValue2 = Schema_exports.Union([
3788
+ Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureFieldLength2)),
3648
3789
  Schema_exports.Finite,
3649
3790
  Schema_exports.Boolean
3650
3791
  ]);
3651
- var FailureFields = Schema_exports.Record(FailureFieldName, FailureFieldValue).check(
3652
- Schema_exports.isMaxProperties(maxFailureFields)
3792
+ var FailureFields2 = Schema_exports.Record(FailureFieldName2, FailureFieldValue2).check(
3793
+ Schema_exports.isMaxProperties(maxFailureFields2)
3653
3794
  );
3654
3795
  var FailureDetail3 = {
3655
- source: Schema_exports.optionalKey(FailureSource),
3796
+ source: Schema_exports.optionalKey(FailureSource2),
3656
3797
  errorName: Schema_exports.optionalKey(FailureName2),
3657
- code: Schema_exports.optionalKey(FailureCode),
3798
+ code: Schema_exports.optionalKey(FailureCode2),
3658
3799
  message: Schema_exports.optionalKey(FailureMessage2),
3659
- fields: Schema_exports.optionalKey(FailureFields)
3800
+ fields: Schema_exports.optionalKey(FailureFields2)
3660
3801
  };
3661
- var maxUpstreamMessageLength = 1024;
3802
+ var maxUpstreamMessageLength2 = 1024;
3662
3803
  var UpstreamError2 = Schema_exports.Struct({
3663
3804
  code: Schema_exports.Union([
3664
3805
  Schema_exports.Int,
3665
3806
  Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(128))
3666
3807
  ]),
3667
- message: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(maxUpstreamMessageLength)))
3808
+ message: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(maxUpstreamMessageLength2)))
3668
3809
  });
3669
- var FailurePhase = Schema_exports.Literals(["connect", "discover", "call"]);
3810
+ var FailurePhase2 = Schema_exports.Literals(["connect", "discover", "call"]);
3670
3811
  var ProviderError3 = class extends Schema_exports.TaggedError()("ProviderError", {
3671
3812
  reason: Schema_exports.Literals(["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]),
3672
3813
  status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
3673
3814
  accountId: Schema_exports.optional(AccountId2),
3674
- phase: Schema_exports.optional(FailurePhase),
3815
+ phase: Schema_exports.optional(FailurePhase2),
3675
3816
  upstream: Schema_exports.optional(UpstreamError2)
3676
3817
  }) {
3677
3818
  };
@@ -3878,6 +4019,308 @@ var protocol10 = {
3878
4019
  }
3879
4020
  };
3880
4021
 
4022
+ // src/contracts/protocols/11.ts
4023
+ var EventName2 = Schema_exports.String.check(
4024
+ Schema_exports.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u),
4025
+ Schema_exports.isMaxLength(64)
4026
+ );
4027
+ var EventFilterValue2 = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
4028
+ var DeclaredEvent2 = Schema_exports.Struct({
4029
+ description: Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(1e3)),
4030
+ filters: JsonObject3,
4031
+ payload: JsonObject3
4032
+ });
4033
+ var DeclaredEvents2 = Schema_exports.Record(EventName2, DeclaredEvent2);
4034
+ var EmittedEvent2 = Schema_exports.Struct({
4035
+ name: EventName2,
4036
+ id: Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(200)),
4037
+ occurredAt: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
4038
+ data: JsonValue2,
4039
+ filters: Schema_exports.Record(Schema_exports.String, EventFilterValue2),
4040
+ account: Schema_exports.NullOr(AccountId2)
4041
+ });
4042
+ var EmittedEvents2 = Schema_exports.Array(EmittedEvent2).check(Schema_exports.isMaxLength(100));
4043
+ var DeclaredRequirements6 = Schema_exports.Struct({
4044
+ ...DeclaredRequirements5.fields,
4045
+ events: Schema_exports.optionalKey(DeclaredEvents2)
4046
+ });
4047
+ var HostResponse6 = Schema_exports.Union([
4048
+ Schema_exports.Struct({
4049
+ ok: Schema_exports.Literal(true),
4050
+ value: JsonValue2,
4051
+ toolError: Schema_exports.optionalKey(Schema_exports.Literal(true)),
4052
+ events: Schema_exports.optionalKey(EmittedEvents2)
4053
+ }),
4054
+ Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError5 })
4055
+ ]);
4056
+ var CacheError2 = class extends Schema_exports.TaggedError()("CacheError", {
4057
+ reason: Schema_exports.Literals(["unavailable", "storage", "invalid", "capacity", "timeout"]),
4058
+ limit: Schema_exports.optionalKey(
4059
+ Schema_exports.Literals([
4060
+ "keyBytes",
4061
+ "entryBytes",
4062
+ "batchBytes",
4063
+ "batchEntries",
4064
+ "totalBytes",
4065
+ "totalEntries"
4066
+ ])
4067
+ )
4068
+ }) {
4069
+ };
4070
+ var CacheReply2 = Schema_exports.Union([
4071
+ Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: Schema_exports.Json }),
4072
+ Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: CacheError2 })
4073
+ ]);
4074
+ var protocol11 = {
4075
+ version: 11,
4076
+ schemas: {
4077
+ ...protocol10.schemas,
4078
+ requirements: DeclaredRequirements6,
4079
+ response: HostResponse6,
4080
+ cacheReply: CacheReply2
4081
+ }
4082
+ };
4083
+
4084
+ // src/contracts/protocols/12.ts
4085
+ var PlacementField2 = Schema_exports.Struct({ field: Schema_exports.NonEmptyString });
4086
+ var PlacementText2 = Schema_exports.Union([Schema_exports.String, PlacementField2]);
4087
+ var PlacementBase642 = Schema_exports.Struct({
4088
+ base64: Schema_exports.Array(PlacementText2).check(Schema_exports.isMinLength(1))
4089
+ });
4090
+ var PlacementPart2 = Schema_exports.Union([Schema_exports.String, PlacementField2, PlacementBase642]);
4091
+ var template2 = Schema_exports.Array(PlacementPart2).check(Schema_exports.isMinLength(1));
4092
+ var PlacementHeaderName2 = Schema_exports.String.check(
4093
+ Schema_exports.isPattern(/^[!#$%&'*+.^_`|~0-9a-z-]+$/u)
4094
+ );
4095
+ var Placement2 = Schema_exports.Union([
4096
+ Schema_exports.Struct({ in: Schema_exports.Literal("header"), name: PlacementHeaderName2, value: template2 }),
4097
+ Schema_exports.Struct({ in: Schema_exports.Literal("query"), name: Schema_exports.NonEmptyString, value: template2 })
4098
+ ]);
4099
+ var Placements2 = Schema_exports.Array(Placement2);
4100
+ var exposure2 = {
4101
+ plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
4102
+ raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
4103
+ request: Schema_exports.optionalKey(Placements2)
4104
+ };
4105
+ var DeclaredAuthMethod4 = Schema_exports.Union([
4106
+ Schema_exports.Struct({
4107
+ type: Schema_exports.Literal("secrets"),
4108
+ label: Schema_exports.String,
4109
+ fields: JsonObject3,
4110
+ ...exposure2
4111
+ }),
4112
+ Schema_exports.Struct({
4113
+ type: Schema_exports.Literal("oauth2"),
4114
+ ...OAuth2Config3.members[0].fields,
4115
+ response: JsonObject3,
4116
+ ...exposure2
4117
+ }),
4118
+ Schema_exports.Struct({
4119
+ type: Schema_exports.Literal("oauth2"),
4120
+ ...OAuth2Config3.members[1].fields,
4121
+ response: JsonObject3,
4122
+ ...exposure2
4123
+ }),
4124
+ Schema_exports.Struct({
4125
+ type: Schema_exports.Literal("oauth2"),
4126
+ ...OAuth2Config3.members[2].fields,
4127
+ response: JsonObject3,
4128
+ ...exposure2
4129
+ }),
4130
+ Schema_exports.Struct({
4131
+ type: Schema_exports.Literal("oauth2"),
4132
+ ...OAuth2Config3.members[3].fields,
4133
+ response: JsonObject3,
4134
+ ...exposure2
4135
+ })
4136
+ ]);
4137
+ var DeclaredProvider4 = Schema_exports.Struct({
4138
+ name: Schema_exports.NonEmptyString,
4139
+ auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod4),
4140
+ hosts: Schema_exports.optionalKey(Schema_exports.Array(CredentialHost))
4141
+ });
4142
+ var iconCharacters = 32 * 1024;
4143
+ var AppIcon2 = Schema_exports.Struct({
4144
+ ...RouterIcon2.fields,
4145
+ src: Schema_exports.String.check(
4146
+ Schema_exports.isPattern(
4147
+ /^(?:data:image\/(?:svg\+xml|png|webp|jpeg);base64,[A-Za-z0-9+/]*={0,2}|https:\/\/\S+)$/u
4148
+ ),
4149
+ Schema_exports.isMaxLength(iconCharacters)
4150
+ )
4151
+ });
4152
+ var AppIcons2 = Schema_exports.Array(AppIcon2).check(
4153
+ Schema_exports.isMaxLength(8),
4154
+ Schema_exports.makeFilter((icons) => JSON.stringify(icons).length <= iconCharacters, {
4155
+ message: `An app's icons total at most ${iconCharacters} characters`
4156
+ })
4157
+ );
4158
+ var DeclaredRequirements7 = Schema_exports.Struct({
4159
+ ...DeclaredRequirements6.fields,
4160
+ accounts: Schema_exports.Record(
4161
+ Schema_exports.NonEmptyString,
4162
+ Schema_exports.Struct({
4163
+ definition: DeclaredProvider4,
4164
+ cardinality: Schema_exports.Literals(["one", "many"]),
4165
+ health: Schema_exports.optionalKey(Schema_exports.Literal(true))
4166
+ })
4167
+ ),
4168
+ icons: Schema_exports.optionalKey(AppIcons2)
4169
+ });
4170
+ var ResolvedAccount4 = Schema_exports.Struct({
4171
+ ...ResolvedAccount3.fields,
4172
+ provider: DeclaredProvider4
4173
+ });
4174
+ var ResolvedAccounts4 = Schema_exports.Record(
4175
+ Schema_exports.NonEmptyString,
4176
+ Schema_exports.Union([ResolvedAccount4, Schema_exports.Array(ResolvedAccount4)])
4177
+ );
4178
+ var HostInvocation7 = Schema_exports.Struct({
4179
+ ...HostInvocation6.fields,
4180
+ accounts: ResolvedAccounts4
4181
+ });
4182
+ var Key2 = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/));
4183
+ var Time2 = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
4184
+ var CacheEntry2 = Schema_exports.Struct({
4185
+ value: Schema_exports.Json,
4186
+ version: Schema_exports.String,
4187
+ freshUntil: Time2,
4188
+ staleUntil: Time2
4189
+ });
4190
+ var CacheCommand2 = Schema_exports.Union([
4191
+ Schema_exports.Struct({ operation: Schema_exports.Literal("read"), keys: Schema_exports.Array(Key2) }),
4192
+ Schema_exports.Struct({
4193
+ operation: Schema_exports.Literal("acquire"),
4194
+ key: Key2,
4195
+ refresh: Schema_exports.Boolean,
4196
+ version: Schema_exports.optionalKey(Schema_exports.NullOr(Schema_exports.String)),
4197
+ reads: Schema_exports.optionalKey(Schema_exports.Array(Key2))
4198
+ }),
4199
+ Schema_exports.Struct({
4200
+ operation: Schema_exports.Literal("claim"),
4201
+ key: Key2,
4202
+ version: Schema_exports.NullOr(Schema_exports.String)
4203
+ }),
4204
+ Schema_exports.Struct({
4205
+ operation: Schema_exports.Literal("publish"),
4206
+ key: Key2,
4207
+ lease: Schema_exports.String,
4208
+ entry: CacheEntry2
4209
+ }),
4210
+ Schema_exports.Struct({ operation: Schema_exports.Literal("release"), key: Key2, lease: Schema_exports.String }),
4211
+ Schema_exports.Struct({ operation: Schema_exports.Literal("renew"), key: Key2, lease: Schema_exports.String }),
4212
+ Schema_exports.Struct({
4213
+ operation: Schema_exports.Literal("write"),
4214
+ entries: Schema_exports.Array(Schema_exports.Struct({ key: Key2, entry: CacheEntry2 }))
4215
+ }),
4216
+ Schema_exports.Struct({ operation: Schema_exports.Literal("invalidate"), key: Key2 })
4217
+ ]);
4218
+ var protocol12 = {
4219
+ version: 12,
4220
+ schemas: {
4221
+ ...protocol11.schemas,
4222
+ requirements: DeclaredRequirements7,
4223
+ accounts: ResolvedAccounts4,
4224
+ invocation: HostInvocation7,
4225
+ cacheCommand: CacheCommand2
4226
+ }
4227
+ };
4228
+
4229
+ // ../app-cache/src/contracts/cache.ts
4230
+ var CacheError3 = class extends Schema_exports.TaggedError()("CacheError", {
4231
+ reason: Schema_exports.Literals(["unavailable", "storage", "invalid", "capacity", "timeout"]),
4232
+ /** Which of `cacheLimits` the request exceeded, when one did. */
4233
+ limit: Schema_exports.optionalKey(
4234
+ Schema_exports.Literals([
4235
+ "keyBytes",
4236
+ "entryBytes",
4237
+ "batchBytes",
4238
+ "batchEntries",
4239
+ "totalBytes",
4240
+ "totalEntries"
4241
+ ])
4242
+ )
4243
+ }) {
4244
+ };
4245
+ var cacheLimits = {
4246
+ keyBytes: 8192,
4247
+ entryBytes: 2e6,
4248
+ batchBytes: 8e6,
4249
+ batchEntries: 128,
4250
+ totalBytes: 128e6,
4251
+ totalEntries: 1e5,
4252
+ retentionMs: 7 * 24 * 60 * 60 * 1e3,
4253
+ loadTimeoutMs: 9e4,
4254
+ /**
4255
+ * A loader's lease lapses this long after its host last renewed it. Hosts renew every
4256
+ * `renewMs` while the invocation that claimed it runs, so a stalled or lost holder frees the
4257
+ * key well inside an MCP execute budget.
4258
+ */
4259
+ leaseMs: 15e3,
4260
+ renewMs: 5e3,
4261
+ /** The longest a caller waits on another loader before loading for itself without publishing. */
4262
+ waitMs: 1e4,
4263
+ /** Bound for one command to a host store; a lost reply fails instead of holding its caller. */
4264
+ commandTimeoutMs: 1e4
4265
+ };
4266
+ var Key3 = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/));
4267
+ var Time3 = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
4268
+ var CacheEntry3 = Schema_exports.Struct({
4269
+ value: Schema_exports.Json,
4270
+ version: Schema_exports.String,
4271
+ freshUntil: Time3,
4272
+ staleUntil: Time3
4273
+ });
4274
+ var CacheAcquired = Schema_exports.Struct({
4275
+ entry: Schema_exports.NullOr(CacheEntry3),
4276
+ lease: Schema_exports.NullOr(Schema_exports.String),
4277
+ /**
4278
+ * The entries of the command's `reads`, in order, read in the same transaction as `entry`.
4279
+ * Absent when the store did not read them: a store that predates them, or reads past the
4280
+ * batch byte bound. The caller then reads them with a separate `read`.
4281
+ */
4282
+ reads: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NullOr(CacheEntry3)))
4283
+ });
4284
+ var CacheCommand3 = Schema_exports.Union([
4285
+ Schema_exports.Struct({ operation: Schema_exports.Literal("read"), keys: Schema_exports.Array(Key3) }),
4286
+ Schema_exports.Struct({
4287
+ operation: Schema_exports.Literal("acquire"),
4288
+ key: Key3,
4289
+ /** Claim even a fresh entry, as an explicit refresh does. */
4290
+ refresh: Schema_exports.Boolean,
4291
+ /** Claim only while the entry still has this version. Absent accepts the current one. */
4292
+ version: Schema_exports.optionalKey(Schema_exports.NullOr(Schema_exports.String)),
4293
+ /**
4294
+ * Other keys to read in the same transaction, as `read` would, so a caller that needs them
4295
+ * beside the entry makes one round trip. Reading them claims and changes nothing.
4296
+ */
4297
+ reads: Schema_exports.optionalKey(Schema_exports.Array(Key3))
4298
+ }),
4299
+ Schema_exports.Struct({
4300
+ operation: Schema_exports.Literal("claim"),
4301
+ key: Key3,
4302
+ version: Schema_exports.NullOr(Schema_exports.String)
4303
+ }),
4304
+ Schema_exports.Struct({
4305
+ operation: Schema_exports.Literal("publish"),
4306
+ key: Key3,
4307
+ lease: Schema_exports.String,
4308
+ entry: CacheEntry3
4309
+ }),
4310
+ Schema_exports.Struct({ operation: Schema_exports.Literal("release"), key: Key3, lease: Schema_exports.String }),
4311
+ /** Extend a lease its holder still owns. Replies false once the lease lapsed or was replaced. */
4312
+ Schema_exports.Struct({ operation: Schema_exports.Literal("renew"), key: Key3, lease: Schema_exports.String }),
4313
+ Schema_exports.Struct({
4314
+ operation: Schema_exports.Literal("write"),
4315
+ entries: Schema_exports.Array(Schema_exports.Struct({ key: Key3, entry: CacheEntry3 }))
4316
+ }),
4317
+ Schema_exports.Struct({ operation: Schema_exports.Literal("invalidate"), key: Key3 })
4318
+ ]);
4319
+ var CacheReply3 = Schema_exports.Union([
4320
+ Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: Schema_exports.Json }),
4321
+ Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: CacheError3 })
4322
+ ]);
4323
+
3881
4324
  // src/contracts/schedules.ts
3882
4325
  var minimumIntervalMilliseconds2 = 6e4;
3883
4326
  var count2 = Schema_exports.Int.check(Schema_exports.isGreaterThan(0));
@@ -3909,6 +4352,7 @@ var ScheduleTiming2 = Schema_exports.Union([
3909
4352
  ]);
3910
4353
  var OperationSchedule2 = Schema_exports.Struct({
3911
4354
  name: Schema_exports.NonEmptyString,
4355
+ scope: Schema_exports.optionalKey(Schema_exports.Literal("app")),
3912
4356
  timing: ScheduleTiming2,
3913
4357
  input: JsonValue
3914
4358
  });
@@ -3955,7 +4399,7 @@ var CredentialHost2 = Schema_exports.String.check(
3955
4399
  /^(\*\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[0-9]{1,5})?$/
3956
4400
  )
3957
4401
  );
3958
- var exposure2 = {
4402
+ var exposure3 = {
3959
4403
  /** Not secret: app code reads the real value and forms show it. */
3960
4404
  plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
3961
4405
  /** Secret, but app code reads the real value, for signing and similar uses. */
@@ -3968,44 +4412,54 @@ var exposure2 = {
3968
4412
  */
3969
4413
  request: Schema_exports.optionalKey(Placements)
3970
4414
  };
3971
- var DeclaredAuthMethod4 = Schema_exports.Union([
4415
+ var DeclaredAuthMethod5 = Schema_exports.Union([
3972
4416
  Schema_exports.Struct({
3973
4417
  type: Schema_exports.Literal("secrets"),
3974
4418
  label: Schema_exports.String,
3975
4419
  fields: JsonObject2,
3976
- ...exposure2
4420
+ ...exposure3
3977
4421
  }),
3978
4422
  Schema_exports.Struct({
3979
4423
  type: Schema_exports.Literal("oauth2"),
3980
4424
  ...OAuth2Config.members[0].fields,
3981
4425
  response: JsonObject2,
3982
- ...exposure2
4426
+ ...exposure3
3983
4427
  }),
3984
4428
  Schema_exports.Struct({
3985
4429
  type: Schema_exports.Literal("oauth2"),
3986
4430
  ...OAuth2Config.members[1].fields,
3987
4431
  response: JsonObject2,
3988
- ...exposure2
4432
+ ...exposure3
3989
4433
  }),
3990
4434
  Schema_exports.Struct({
3991
4435
  type: Schema_exports.Literal("oauth2"),
3992
4436
  ...OAuth2Config.members[2].fields,
3993
4437
  response: JsonObject2,
3994
- ...exposure2
4438
+ ...exposure3
3995
4439
  }),
3996
4440
  Schema_exports.Struct({
3997
4441
  type: Schema_exports.Literal("oauth2"),
3998
4442
  ...OAuth2Config.members[3].fields,
3999
4443
  response: JsonObject2,
4000
- ...exposure2
4444
+ ...exposure3
4001
4445
  })
4002
4446
  ]);
4003
- var DeclaredProvider4 = Schema_exports.Struct({
4447
+ var DeclaredProvider5 = Schema_exports.Struct({
4004
4448
  name: Schema_exports.NonEmptyString,
4005
- auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod4),
4449
+ auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod5),
4006
4450
  hosts: Schema_exports.optionalKey(Schema_exports.Array(CredentialHost2))
4007
4451
  });
4008
- var DeclaredRequirements6 = Schema_exports.Struct({
4452
+ var DeclaredAccountSlot = Schema_exports.Struct({
4453
+ definition: DeclaredProvider5,
4454
+ cardinality: Schema_exports.Literals(["one", "many"]),
4455
+ /**
4456
+ * The slot's provider defines an account check. Kept beside the definition, not in it, so
4457
+ * adding or editing a check never changes the provider's identity.
4458
+ */
4459
+ health: Schema_exports.optionalKey(Schema_exports.Literal(true))
4460
+ });
4461
+ var DeclaredAccountSlots = Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAccountSlot);
4462
+ var DeclaredRequirements8 = Schema_exports.Struct({
4009
4463
  /** Protocol support of this retained framework build, not an author-declared requirement. */
4010
4464
  capabilities: Schema_exports.optionalKey(
4011
4465
  Schema_exports.Struct({
@@ -4023,18 +4477,13 @@ var DeclaredRequirements6 = Schema_exports.Struct({
4023
4477
  * `sql` instead; the field remains so requirements read from older retained builds keep their meaning.
4024
4478
  */
4025
4479
  database: Schema_exports.optionalKey(DatabaseSchema),
4026
- accounts: Schema_exports.Record(
4027
- Schema_exports.NonEmptyString,
4028
- Schema_exports.Struct({
4029
- definition: DeclaredProvider4,
4030
- cardinality: Schema_exports.Literals(["one", "many"]),
4031
- /**
4032
- * The slot's provider defines an account check. Kept beside the definition, not in it, so
4033
- * adding or editing a check never changes the provider's identity.
4034
- */
4035
- health: Schema_exports.optionalKey(Schema_exports.Literal(true))
4036
- })
4037
- ),
4480
+ /**
4481
+ * Requirements by scope. `app` requirements are filled by the accounts the app's managers link for everyone,
4482
+ * for every caller and for background work; `user` requirements by each caller's linked
4483
+ * accounts. A name is used in one scope only. Bundles of protocol 12 and earlier declare user
4484
+ * requirements only.
4485
+ */
4486
+ accounts: Schema_exports.Struct({ app: DeclaredAccountSlots, user: DeclaredAccountSlots }),
4038
4487
  /** The build has SQL files in `migrations/` and owns a raw SQLite database. */
4039
4488
  sql: Schema_exports.optionalKey(Schema_exports.Literal(true)),
4040
4489
  /** The events the app declares, so a host lists them without evaluating the app. */
@@ -4042,9 +4491,9 @@ var DeclaredRequirements6 = Schema_exports.Struct({
4042
4491
  /** The icons the app declares, so a host shows them without evaluating the app. */
4043
4492
  icons: Schema_exports.optionalKey(AppIcons)
4044
4493
  });
4045
- var ResolvedAccount4 = Schema_exports.Struct({
4494
+ var ResolvedAccount5 = Schema_exports.Struct({
4046
4495
  id: AccountId,
4047
- provider: DeclaredProvider4,
4496
+ provider: DeclaredProvider5,
4048
4497
  method: Schema_exports.NonEmptyString,
4049
4498
  /**
4050
4499
  * Changes when the account is reconnected or its credentials replaced, not on renewal. Hosts
@@ -4053,10 +4502,14 @@ var ResolvedAccount4 = Schema_exports.Struct({
4053
4502
  generation: Schema_exports.optionalKey(Schema_exports.Int),
4054
4503
  fields: JsonObject2
4055
4504
  });
4056
- var ResolvedAccounts4 = Schema_exports.Record(
4505
+ var ResolvedAccountSlots = Schema_exports.Record(
4057
4506
  Schema_exports.NonEmptyString,
4058
- Schema_exports.Union([ResolvedAccount4, Schema_exports.Array(ResolvedAccount4)])
4507
+ Schema_exports.Union([ResolvedAccount5, Schema_exports.Array(ResolvedAccount5)])
4059
4508
  );
4509
+ var ResolvedAccounts5 = Schema_exports.Struct({
4510
+ app: ResolvedAccountSlots,
4511
+ user: Schema_exports.optionalKey(ResolvedAccountSlots)
4512
+ });
4060
4513
  var TrustedToolApproval2 = Schema_exports.Struct({ tool: Schema_exports.NonEmptyString, input: JsonValue });
4061
4514
  var InvocationDeadline2 = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
4062
4515
  var HostedTool3 = Schema_exports.Struct({
@@ -4247,7 +4700,7 @@ var HostError6 = Schema_exports.Union([
4247
4700
  ElicitationFailed,
4248
4701
  HostKindMismatch2
4249
4702
  ]);
4250
- var HostResponse6 = Schema_exports.Union([
4703
+ var HostResponse7 = Schema_exports.Union([
4251
4704
  Schema_exports.Struct({
4252
4705
  ok: Schema_exports.Literal(true),
4253
4706
  value: JsonValue,
@@ -4257,9 +4710,9 @@ var HostResponse6 = Schema_exports.Union([
4257
4710
  }),
4258
4711
  Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError6 })
4259
4712
  ]);
4260
- var HostInvocation7 = Schema_exports.Struct({
4713
+ var HostInvocation8 = Schema_exports.Struct({
4261
4714
  command: HostRequest5,
4262
- accounts: ResolvedAccounts4,
4715
+ accounts: ResolvedAccounts5,
4263
4716
  approval: Schema_exports.optionalKey(TrustedToolApproval2),
4264
4717
  replay: Schema_exports.optionalKey(WorkflowReplay),
4265
4718
  deadline: Schema_exports.optionalKey(InvocationDeadline2),
@@ -4268,10 +4721,10 @@ var HostInvocation7 = Schema_exports.Struct({
4268
4721
  var current = {
4269
4722
  version: frameworkProtocol,
4270
4723
  schemas: {
4271
- invocation: HostInvocation7,
4724
+ invocation: HostInvocation8,
4272
4725
  request: HostRequest5,
4273
- response: HostResponse6,
4274
- requirements: DeclaredRequirements6,
4726
+ response: HostResponse7,
4727
+ requirements: DeclaredRequirements8,
4275
4728
  catalog: HostedCatalog4,
4276
4729
  catalogSummary: HostedCatalogSummary4,
4277
4730
  skills: SkillCatalogResponse3,
@@ -4280,23 +4733,31 @@ var current = {
4280
4733
  workflowStep: WorkflowRpcCommand,
4281
4734
  workflowStepReply: WorkflowRpcResult,
4282
4735
  workflowControl: WorkflowControlCommand,
4283
- cacheCommand: CacheCommand,
4284
- cacheReply: CacheReply,
4736
+ cacheCommand: CacheCommand3,
4737
+ cacheReply: CacheReply3,
4285
4738
  accountCheck: AccountCheckResult,
4286
- accounts: ResolvedAccounts4,
4739
+ accounts: ResolvedAccounts5,
4287
4740
  migrate: MigrateResult2
4288
4741
  }
4289
4742
  };
4290
4743
 
4291
4744
  // src/contracts/host.ts
4292
4745
  var HostAccount = Schema_exports.Struct({
4293
- ...ResolvedAccount4.fields,
4746
+ ...ResolvedAccount5.fields,
4294
4747
  managed: Schema_exports.optionalKey(Schema_exports.Literal(true))
4295
4748
  });
4296
- var HostAccounts = Schema_exports.Record(
4749
+ var HostAccountSlots = Schema_exports.Record(
4297
4750
  Schema_exports.NonEmptyString,
4298
4751
  Schema_exports.Union([HostAccount, Schema_exports.Array(HostAccount)])
4299
4752
  );
4753
+ var HostAccounts = Schema_exports.Struct({
4754
+ app: HostAccountSlots,
4755
+ user: Schema_exports.optionalKey(HostAccountSlots)
4756
+ });
4757
+ var scopedSlots = (accounts) => [
4758
+ ...Object.entries(accounts.app),
4759
+ ...Object.entries(accounts.user ?? {})
4760
+ ];
4300
4761
  var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
4301
4762
  var skillCatalog = (response) => Schema_exports.is(SkillSources3)(response) ? response : { skills: response };
4302
4763
  var inspectCommand = (tools, scheduled) => ({
@@ -4372,6 +4833,36 @@ var InvocationTimingSink = Context_exports.Reference(
4372
4833
  );
4373
4834
 
4374
4835
  export {
4836
+ maxFailureMessageLength,
4837
+ FailureSource,
4838
+ FailureName,
4839
+ FailureCode,
4840
+ FailureMessage,
4841
+ maxFailureFields,
4842
+ maxFailureFieldLength,
4843
+ FailureFieldName,
4844
+ FailureFieldValue,
4845
+ FailureFields,
4846
+ FailureDetail,
4847
+ maxUpstreamMessageLength,
4848
+ UpstreamError,
4849
+ FailurePhase,
4850
+ ProviderError,
4851
+ NetworkRefusal,
4852
+ NetworkRefused,
4853
+ networkRefusalStatus,
4854
+ networkRefusalHeader,
4855
+ NetworkRefusedHeader,
4856
+ networkRefusalResponse,
4857
+ RestrictedFetchOption,
4858
+ supportedFetchOptions,
4859
+ FetchOptionUnsupported,
4860
+ CacheError3 as CacheError,
4861
+ cacheLimits,
4862
+ CacheEntry3 as CacheEntry,
4863
+ CacheAcquired,
4864
+ CacheCommand3 as CacheCommand,
4865
+ CacheReply3 as CacheReply,
4375
4866
  SecretsMethod,
4376
4867
  OAuthClientAuth,
4377
4868
  OAuthSecretClientAuth,
@@ -4485,6 +4976,8 @@ export {
4485
4976
  protocol8,
4486
4977
  protocol9,
4487
4978
  protocol10,
4979
+ protocol11,
4980
+ protocol12,
4488
4981
  minimumIntervalMilliseconds2 as minimumIntervalMilliseconds,
4489
4982
  Interval,
4490
4983
  CalendarSchedule2 as CalendarSchedule,
@@ -4493,11 +4986,14 @@ export {
4493
4986
  McpError6 as McpError2,
4494
4987
  SkillLoadFailed3 as SkillLoadFailed,
4495
4988
  CredentialHost2 as CredentialHost,
4496
- DeclaredAuthMethod4 as DeclaredAuthMethod,
4497
- DeclaredProvider4 as DeclaredProvider,
4498
- DeclaredRequirements6 as DeclaredRequirements,
4499
- ResolvedAccount4 as ResolvedAccount,
4500
- ResolvedAccounts4 as ResolvedAccounts,
4989
+ DeclaredAuthMethod5 as DeclaredAuthMethod,
4990
+ DeclaredProvider5 as DeclaredProvider,
4991
+ DeclaredAccountSlot,
4992
+ DeclaredAccountSlots,
4993
+ DeclaredRequirements8 as DeclaredRequirements,
4994
+ ResolvedAccount5 as ResolvedAccount,
4995
+ ResolvedAccountSlots,
4996
+ ResolvedAccounts5 as ResolvedAccounts,
4501
4997
  TrustedToolApproval2 as TrustedToolApproval,
4502
4998
  InvocationDeadline2 as InvocationDeadline,
4503
4999
  HostedTool3 as HostedTool,
@@ -4528,11 +5024,13 @@ export {
4528
5024
  HostToolPolicyFailed2 as HostToolPolicyFailed,
4529
5025
  HostOutputInvalid2 as HostOutputInvalid,
4530
5026
  HostError6 as HostError,
4531
- HostResponse6 as HostResponse,
4532
- HostInvocation7 as HostInvocation,
5027
+ HostResponse7 as HostResponse,
5028
+ HostInvocation8 as HostInvocation,
4533
5029
  current,
4534
5030
  HostAccount,
5031
+ HostAccountSlots,
4535
5032
  HostAccounts,
5033
+ scopedSlots,
4536
5034
  skillsCommand,
4537
5035
  skillCatalog,
4538
5036
  inspectCommand,