apps 0.0.1-beta.35 → 0.0.1-beta.36

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 (45) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-FFTALB6S.js → chunk-4U2VUDET.js} +1 -1
  3. package/js/{chunk-I7CNZ4CM.js → chunk-556EWA6P.js} +2 -1
  4. package/js/{chunk-IA3VSGR4.js → chunk-A2NN45C7.js} +3 -3
  5. package/js/{chunk-VBVOPW4U.js → chunk-BKJDZYK7.js} +1 -1
  6. package/js/{chunk-KBXQOJYW.js → chunk-CZLCA2O4.js} +2 -2
  7. package/js/{chunk-UWOIEJ56.js → chunk-UBAKWXAJ.js} +8 -17
  8. package/js/{chunk-LUROQKFP.js → chunk-WAGGHNWH.js} +16 -8
  9. package/js/{chunk-5CQMUXW7.js → chunk-WMVTBHGK.js} +2 -2
  10. package/js/{chunk-5KNA2Z5I.js → chunk-XEXUHXC3.js} +284 -164
  11. package/js/{chunk-YYK6GEMC.js → chunk-ZQWDOHEO.js} +24 -17
  12. package/js/contracts.js +6 -4
  13. package/js/effect.js +7 -7
  14. package/js/graphql.js +8 -8
  15. package/js/host.js +7 -7
  16. package/js/index.js +4 -4
  17. package/js/mcp/effect.js +9 -9
  18. package/js/mcp/stdio.js +9 -9
  19. package/js/mcp.js +10 -10
  20. package/js/openapi.js +6 -6
  21. package/js/skills/effect.js +2 -2
  22. package/js/skills.js +44 -31
  23. package/package.json +1 -1
  24. package/runtime.json +1 -1
  25. package/types/apps/src/contracts/host.d.ts +10 -6
  26. package/types/apps/src/contracts/mcp.d.ts +6 -1
  27. package/types/apps/src/contracts/openapi.d.ts +1 -1
  28. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  29. package/types/apps/src/contracts/protocols/1.d.ts +8 -1
  30. package/types/apps/src/contracts/protocols/2.d.ts +1 -1
  31. package/types/apps/src/contracts/protocols/3.d.ts +1 -2
  32. package/types/apps/src/contracts/protocols/4.d.ts +1 -2
  33. package/types/apps/src/contracts/protocols/5.d.ts +3 -3
  34. package/types/apps/src/contracts/protocols/6.d.ts +3 -3
  35. package/types/apps/src/contracts/protocols/7.d.ts +3 -3
  36. package/types/apps/src/contracts/protocols/8.d.ts +13 -2
  37. package/types/apps/src/contracts/protocols/9.d.ts +1106 -0
  38. package/types/apps/src/contracts/skills.d.ts +5 -0
  39. package/types/apps/src/implementation/failure-detail.d.ts +4 -3
  40. package/types/apps/src/implementation/mcp-client.d.ts +1 -1
  41. package/types/apps/src/implementation/mcp.d.ts +1 -1
  42. package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
  43. package/types/apps/src/implementation/router-catalog.d.ts +2 -3
  44. package/types/apps/src/implementation/skills.d.ts +8 -8
  45. package/types/apps/src/skills.d.ts +2 -1
@@ -5,7 +5,7 @@ import {
5
5
  SkillDefinitionInvalid,
6
6
  SkillFile,
7
7
  SkillFilePath
8
- } from "./chunk-I7CNZ4CM.js";
8
+ } from "./chunk-556EWA6P.js";
9
9
  import {
10
10
  Effect_exports,
11
11
  Schema_exports
@@ -117,7 +117,8 @@ var SkillLoadFailed = class extends Schema_exports.TaggedError()("SkillLoadFaile
117
117
  ]),
118
118
  // Error instances read an omitted message as "", so an empty message means none was given.
119
119
  message: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isMaxLength(500))),
120
- status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 })))
120
+ status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
121
+ missing: Schema_exports.optional(Schema_exports.Literals(["repository", "ref"]))
121
122
  }) {
122
123
  };
123
124
  var skillLoadLimits = {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  prepareElicitation
3
- } from "./chunk-UWOIEJ56.js";
3
+ } from "./chunk-UBAKWXAJ.js";
4
4
  import {
5
5
  fromPromise
6
- } from "./chunk-VBVOPW4U.js";
6
+ } from "./chunk-BKJDZYK7.js";
7
7
  import {
8
8
  bodyUpstreamError
9
9
  } from "./chunk-ENJCQWVF.js";
@@ -18,7 +18,7 @@ import {
18
18
  defaultElicitationLimits,
19
19
  defaultMcpClientLimits,
20
20
  mcpSdkTimerCeilingMs
21
- } from "./chunk-5KNA2Z5I.js";
21
+ } from "./chunk-XEXUHXC3.js";
22
22
  import {
23
23
  jsonSchemaDecoder,
24
24
  nestJsonSchema,
@@ -3,7 +3,7 @@ import {
3
3
  RouterKey,
4
4
  RouterMeta,
5
5
  reservedRouterKeys
6
- } from "./chunk-5KNA2Z5I.js";
6
+ } from "./chunk-XEXUHXC3.js";
7
7
  import {
8
8
  decoderOf,
9
9
  schemaArgument
@@ -6,10 +6,10 @@ import {
6
6
  fromPromise,
7
7
  nativeOperation,
8
8
  nativeRouter
9
- } from "./chunk-VBVOPW4U.js";
9
+ } from "./chunk-BKJDZYK7.js";
10
10
  import {
11
11
  ScheduleTiming
12
- } from "./chunk-5KNA2Z5I.js";
12
+ } from "./chunk-XEXUHXC3.js";
13
13
  import {
14
14
  DatabaseSchema
15
15
  } from "./chunk-73AV3JVU.js";
@@ -8,22 +8,23 @@ import {
8
8
  failureDetail,
9
9
  leavingProviderError,
10
10
  parseMcpError,
11
+ parseSkillLoadFailed,
11
12
  readCatalog,
12
13
  routerSkills
13
- } from "./chunk-YYK6GEMC.js";
14
+ } from "./chunk-ZQWDOHEO.js";
14
15
  import {
15
16
  appInvocationFetch
16
17
  } from "./chunk-SRB2WDU7.js";
17
18
  import {
18
19
  folderSkillsEffect
19
- } from "./chunk-FFTALB6S.js";
20
+ } from "./chunk-4U2VUDET.js";
20
21
  import {
21
22
  ResponseStatusError,
22
23
  authorDatabase,
23
24
  isApp,
24
25
  toEffectApp,
25
26
  unavailableStorage
26
- } from "./chunk-KBXQOJYW.js";
27
+ } from "./chunk-CZLCA2O4.js";
27
28
  import {
28
29
  parseDatabaseSchema
29
30
  } from "./chunk-IU7CCCUC.js";
@@ -33,7 +34,7 @@ import {
33
34
  locate,
34
35
  nativeOperation,
35
36
  toPromise
36
- } from "./chunk-VBVOPW4U.js";
37
+ } from "./chunk-BKJDZYK7.js";
37
38
  import {
38
39
  accountProviderError,
39
40
  httpProviderError,
@@ -85,15 +86,14 @@ import {
85
86
  defaultWebhookTransportLimits,
86
87
  maxInputProblems,
87
88
  workflowDurationMillis
88
- } from "./chunk-5KNA2Z5I.js";
89
+ } from "./chunk-XEXUHXC3.js";
89
90
  import {
90
91
  CacheError
91
92
  } from "./chunk-BI6R577B.js";
92
93
  import {
93
94
  AppSkills,
94
- SkillFile,
95
- SkillLoadFailed
96
- } from "./chunk-I7CNZ4CM.js";
95
+ SkillFile
96
+ } from "./chunk-556EWA6P.js";
97
97
  import {
98
98
  captureTelemetry
99
99
  } from "./chunk-KZFV3WCJ.js";
@@ -1287,15 +1287,6 @@ function checkAccount(slots, declared, requirement, context, signal, deadline) {
1287
1287
  );
1288
1288
  });
1289
1289
  }
1290
- var parseSkillLoadFailed = (error) => Schema_exports.decodeUnknownOption(SkillLoadFailed)(error).pipe(
1291
- Option_exports.map(
1292
- ({ reason, message, status }) => new SkillLoadFailed({
1293
- reason,
1294
- ...message ? { message } : {},
1295
- ...status === void 0 ? {} : { status }
1296
- })
1297
- )
1298
- );
1299
1290
  var errorStatus = Match_exports.type().pipe(
1300
1291
  Match_exports.tagsExhaustive({
1301
1292
  ProviderError: () => 502,
@@ -3,7 +3,7 @@ import {
3
3
  answeredError,
4
4
  mcpClient,
5
5
  mcpJsonSchemaValidator
6
- } from "./chunk-IA3VSGR4.js";
6
+ } from "./chunk-A2NN45C7.js";
7
7
  import {
8
8
  failOnNetworkRefusal
9
9
  } from "./chunk-SRB2WDU7.js";
@@ -20,7 +20,7 @@ import {
20
20
  McpToolsOptions,
21
21
  defaultMcpClientLimits,
22
22
  mcpHealthReserveMs
23
- } from "./chunk-5KNA2Z5I.js";
23
+ } from "./chunk-XEXUHXC3.js";
24
24
  import {
25
25
  NetworkRefused,
26
26
  ProviderError
@@ -138,7 +138,11 @@ var transportFetch = (connection, telemetry, rejected, answered) => (url, init)
138
138
  yield* Deferred_exports.fail(rejected, refused);
139
139
  return yield* refused;
140
140
  }
141
- yield* Ref_exports.set(answered, { status: response.status, upstream });
141
+ const session = new Headers(init?.headers).has("mcp-session-id");
142
+ yield* Ref_exports.update(
143
+ answered,
144
+ (responses) => new Map(responses).set(response.status, { upstream, session })
145
+ );
142
146
  return new Response(body, { status: response.status, headers: response.headers });
143
147
  }).pipe(
144
148
  Effect_exports.provide(FetchHttpClient_exports.layer),
@@ -157,26 +161,30 @@ var transportFetch = (connection, telemetry, rejected, answered) => (url, init)
157
161
  ),
158
162
  init?.signal ? { signal: init.signal } : {}
159
163
  );
160
- var explain = (error, phase, response) => {
164
+ var explain = (error, phase, responses) => {
161
165
  if (Schema_exports.is(ProviderError)(error)) return providerErrorDetail(error, { phase });
162
- if (!Schema_exports.is(McpError)(error) || error.upstream !== void 0 || error.status === void 0 || response?.status !== error.status || response.upstream === void 0)
166
+ if (!Schema_exports.is(McpError)(error) || error.status === void 0) return error;
167
+ const response = responses.get(error.status);
168
+ if (response === void 0 || (error.upstream !== void 0 || response.upstream === void 0) && !response.session)
163
169
  return error;
170
+ const upstream = error.upstream ?? response.upstream;
164
171
  return new McpError({
165
172
  phase: error.phase,
166
173
  reason: error.reason,
167
174
  status: error.status,
168
- upstream: response.upstream
175
+ ...upstream === void 0 ? {} : { upstream },
176
+ ...response.session ? { session: true } : {}
169
177
  });
170
178
  };
171
179
  var explained = (phase, answered) => (error) => Ref_exports.get(answered).pipe(
172
- Effect_exports.flatMap((response) => Effect_exports.fail(explain(error, phase, response)))
180
+ Effect_exports.flatMap((responses) => Effect_exports.fail(explain(error, phase, responses)))
173
181
  );
174
182
  function withClient(connection, mode, use, changed) {
175
183
  const attempt = (kind) => Effect_exports.scoped(
176
184
  Effect_exports.gen(function* () {
177
185
  const telemetry = yield* captureTelemetry;
178
186
  const rejected = yield* Deferred_exports.make();
179
- const answered = yield* Ref_exports.make(void 0);
187
+ const answered = yield* Ref_exports.make(/* @__PURE__ */ new Map());
180
188
  const pending = /* @__PURE__ */ new Set();
181
189
  const { client, transport } = yield* Effect_exports.acquireRelease(
182
190
  Effect_exports.sync(() => {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  fixedRouter
3
- } from "./chunk-YYK6GEMC.js";
3
+ } from "./chunk-ZQWDOHEO.js";
4
4
  import {
5
5
  nativeOperation,
6
6
  operationDeclaration,
7
7
  routerDeclaration
8
- } from "./chunk-VBVOPW4U.js";
8
+ } from "./chunk-BKJDZYK7.js";
9
9
 
10
10
  // src/implementation/protocol-operations.ts
11
11
  var protocolOperations = (operations, kinds = {}) => {