apps 0.0.1-beta.35 → 0.0.1-beta.37

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/framework-reference.json +1 -1
  2. package/js/{chunk-KZFV3WCJ.js → chunk-24EIFQYZ.js} +377 -50
  3. package/js/chunk-2FWXCU5I.js +16 -0
  4. package/js/{chunk-YYK6GEMC.js → chunk-3LRFKLUX.js} +24 -17
  5. package/js/{chunk-VBVOPW4U.js → chunk-7KEKFBV7.js} +1 -1
  6. package/js/{chunk-FFTALB6S.js → chunk-BWUHMKHQ.js} +1 -1
  7. package/js/{chunk-KBXQOJYW.js → chunk-CAOHGMNW.js} +2 -2
  8. package/js/{chunk-SRB2WDU7.js → chunk-D45FU4TZ.js} +1 -1
  9. package/js/{chunk-UWOIEJ56.js → chunk-GHDZEEPO.js} +26 -31
  10. package/js/{chunk-I7CNZ4CM.js → chunk-KEZ4YZSP.js} +18 -4
  11. package/js/{chunk-5KNA2Z5I.js → chunk-LQBR7AI7.js} +294 -164
  12. package/js/{chunk-LUROQKFP.js → chunk-QQKHJ72Y.js} +18 -10
  13. package/js/{chunk-IA3VSGR4.js → chunk-U74JVKTQ.js} +3 -3
  14. package/js/{chunk-5CQMUXW7.js → chunk-UCOMVHGW.js} +2 -2
  15. package/js/client.js +2 -1
  16. package/js/contracts.js +7 -4
  17. package/js/effect.js +10 -9
  18. package/js/graphql.js +11 -10
  19. package/js/host.js +10 -9
  20. package/js/index.js +5 -4
  21. package/js/mcp/effect.js +12 -11
  22. package/js/mcp/stdio.js +12 -11
  23. package/js/mcp.js +13 -12
  24. package/js/openapi.js +9 -8
  25. package/js/skills/effect.js +3 -2
  26. package/js/skills.js +47 -33
  27. package/js/ui/serving.js +2 -1
  28. package/package.json +1 -1
  29. package/runtime.json +1 -1
  30. package/types/apps/src/contracts/host.d.ts +10 -6
  31. package/types/apps/src/contracts/mcp.d.ts +6 -1
  32. package/types/apps/src/contracts/openapi.d.ts +1 -1
  33. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  34. package/types/apps/src/contracts/protocols/1.d.ts +8 -1
  35. package/types/apps/src/contracts/protocols/2.d.ts +1 -1
  36. package/types/apps/src/contracts/protocols/3.d.ts +1 -2
  37. package/types/apps/src/contracts/protocols/4.d.ts +1 -2
  38. package/types/apps/src/contracts/protocols/5.d.ts +3 -3
  39. package/types/apps/src/contracts/protocols/6.d.ts +3 -3
  40. package/types/apps/src/contracts/protocols/7.d.ts +3 -3
  41. package/types/apps/src/contracts/protocols/8.d.ts +13 -2
  42. package/types/apps/src/contracts/protocols/9.d.ts +1106 -0
  43. package/types/apps/src/contracts/skills.d.ts +5 -0
  44. package/types/apps/src/contracts/workflows.d.ts +6 -0
  45. package/types/apps/src/implementation/failure-detail.d.ts +4 -3
  46. package/types/apps/src/implementation/mcp-client.d.ts +1 -1
  47. package/types/apps/src/implementation/mcp.d.ts +1 -1
  48. package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
  49. package/types/apps/src/implementation/router-catalog.d.ts +2 -3
  50. package/types/apps/src/implementation/skills.d.ts +8 -8
  51. package/types/apps/src/skills.d.ts +2 -1
  52. package/types/telemetry/src/app-records.d.ts +42 -0
  53. package/types/telemetry/src/recorded-failure.d.ts +20 -0
  54. package/types/utils/src/api-error.d.ts +5 -0
  55. package/types/utils/src/recorded-message.d.ts +15 -0
@@ -0,0 +1,16 @@
1
+ import {
2
+ Predicate_exports
3
+ } from "./chunk-IJQ5LE74.js";
4
+
5
+ // ../utils/src/recorded-message.ts
6
+ var RecordedMessage = /* @__PURE__ */ Symbol.for("@executor-js/utils/RecordedMessage");
7
+ var recordedMessage = (error) => {
8
+ if (!Predicate_exports.hasProperty(error, RecordedMessage)) return void 0;
9
+ const message = error[RecordedMessage];
10
+ return typeof message === "string" ? message : void 0;
11
+ };
12
+
13
+ export {
14
+ RecordedMessage,
15
+ recordedMessage
16
+ };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  skillFromFiles
3
- } from "./chunk-FFTALB6S.js";
3
+ } from "./chunk-BWUHMKHQ.js";
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-VBVOPW4U.js";
7
+ } from "./chunk-7KEKFBV7.js";
8
8
  import {
9
9
  isShortenedUpstream,
10
10
  parseProviderError,
@@ -18,8 +18,10 @@ import {
18
18
  HostedTool,
19
19
  HostedToolSummary,
20
20
  McpCredentialsUnverified,
21
- McpError
22
- } from "./chunk-5KNA2Z5I.js";
21
+ McpError,
22
+ McpError2,
23
+ SkillLoadFailed as SkillLoadFailed2
24
+ } from "./chunk-LQBR7AI7.js";
23
25
  import {
24
26
  AppDatabaseError
25
27
  } from "./chunk-73AV3JVU.js";
@@ -37,7 +39,7 @@ import {
37
39
  import {
38
40
  SkillLoadFailed,
39
41
  skillFormatLimits
40
- } from "./chunk-I7CNZ4CM.js";
42
+ } from "./chunk-KEZ4YZSP.js";
41
43
  import {
42
44
  jsonSchemaDocument
43
45
  } from "./chunk-POOIHRPF.js";
@@ -363,16 +365,27 @@ var leavingProviderError = (error, secrets, phase) => providerError({
363
365
  upstream: redactUpstream(error.upstream, secrets)
364
366
  });
365
367
  var parseMcpError = (error, secrets) => Schema_exports.decodeUnknownOption(McpError)(error).pipe(
366
- Option_exports.map(({ phase, reason, status, upstream }) => {
368
+ Option_exports.map(({ phase, reason, status, upstream, session }) => {
367
369
  const stated = redactUpstream(upstream, secrets);
368
- return new McpError({
370
+ return new McpError2({
369
371
  phase,
370
372
  reason,
371
373
  ...status === void 0 ? {} : { status },
372
- ...stated === void 0 ? {} : { upstream: stated }
374
+ ...stated === void 0 ? {} : { upstream: stated },
375
+ ...session === void 0 ? {} : { session }
373
376
  });
374
377
  })
375
378
  );
379
+ var parseSkillLoadFailed = (error) => Schema_exports.decodeUnknownOption(SkillLoadFailed)(error).pipe(
380
+ Option_exports.map(
381
+ ({ reason, message, status, missing }) => new SkillLoadFailed2({
382
+ reason,
383
+ ...message ? { message } : {},
384
+ ...status === void 0 ? {} : { status },
385
+ ...missing === void 0 ? {} : { missing }
386
+ })
387
+ )
388
+ );
376
389
  var errorName = (error) => (error.name.length > 0 ? error.name : "Error").slice(0, 128);
377
390
  var ownCode = (error, secrets) => Predicate_exports.hasProperty(error, "code") && Schema_exports.is(FailureCode)(error.code) && error.code !== "" ? boundText(error.code, secrets, 128) : void 0;
378
391
  var reservedFields = /* @__PURE__ */ new Set(["name", "message", "stack", "cause", "_tag"]);
@@ -504,15 +517,8 @@ var failureDetail = (error, secrets) => {
504
517
  var safeFailure = (error, secrets) => {
505
518
  const provider = parseProviderError(error);
506
519
  if (Option_exports.isSome(provider)) return leavingProviderError(provider.value, secrets, "discover");
507
- const skills = Schema_exports.decodeUnknownOption(SkillLoadFailed)(error);
508
- if (Option_exports.isSome(skills)) {
509
- const { reason, message, status } = skills.value;
510
- return new SkillLoadFailed({
511
- reason,
512
- ...message ? { message } : {},
513
- ...status === void 0 ? {} : { status }
514
- });
515
- }
520
+ const skills = parseSkillLoadFailed(error);
521
+ if (Option_exports.isSome(skills)) return skills.value;
516
522
  const mcp = parseMcpError(error, secrets);
517
523
  if (Option_exports.isSome(mcp)) return mcp.value;
518
524
  if (Schema_exports.is(HostDeclarationInvalid)(error)) return error;
@@ -753,6 +759,7 @@ export {
753
759
  boundFailureMessage,
754
760
  leavingProviderError,
755
761
  parseMcpError,
762
+ parseSkillLoadFailed,
756
763
  describeFailure,
757
764
  failureDetail,
758
765
  operationDescription,
@@ -3,7 +3,7 @@ import {
3
3
  RouterKey,
4
4
  RouterMeta,
5
5
  reservedRouterKeys
6
- } from "./chunk-5KNA2Z5I.js";
6
+ } from "./chunk-LQBR7AI7.js";
7
7
  import {
8
8
  decoderOf,
9
9
  schemaArgument
@@ -5,7 +5,7 @@ import {
5
5
  SkillDefinitionInvalid,
6
6
  SkillFile,
7
7
  SkillFilePath
8
- } from "./chunk-I7CNZ4CM.js";
8
+ } from "./chunk-KEZ4YZSP.js";
9
9
  import {
10
10
  Effect_exports,
11
11
  Schema_exports
@@ -6,10 +6,10 @@ import {
6
6
  fromPromise,
7
7
  nativeOperation,
8
8
  nativeRouter
9
- } from "./chunk-VBVOPW4U.js";
9
+ } from "./chunk-7KEKFBV7.js";
10
10
  import {
11
11
  ScheduleTiming
12
- } from "./chunk-5KNA2Z5I.js";
12
+ } from "./chunk-LQBR7AI7.js";
13
13
  import {
14
14
  DatabaseSchema
15
15
  } from "./chunk-73AV3JVU.js";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-BI6R577B.js";
9
9
  import {
10
10
  invocationFetch
11
- } from "./chunk-KZFV3WCJ.js";
11
+ } from "./chunk-24EIFQYZ.js";
12
12
  import {
13
13
  Effect_exports,
14
14
  Schema_exports
@@ -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-3LRFKLUX.js";
14
15
  import {
15
16
  appInvocationFetch
16
- } from "./chunk-SRB2WDU7.js";
17
+ } from "./chunk-D45FU4TZ.js";
17
18
  import {
18
19
  folderSkillsEffect
19
- } from "./chunk-FFTALB6S.js";
20
+ } from "./chunk-BWUHMKHQ.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-CAOHGMNW.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-7KEKFBV7.js";
37
38
  import {
38
39
  accountProviderError,
39
40
  httpProviderError,
@@ -85,18 +86,17 @@ import {
85
86
  defaultWebhookTransportLimits,
86
87
  maxInputProblems,
87
88
  workflowDurationMillis
88
- } from "./chunk-5KNA2Z5I.js";
89
+ } from "./chunk-LQBR7AI7.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-KEZ4YZSP.js";
97
97
  import {
98
98
  captureTelemetry
99
- } from "./chunk-KZFV3WCJ.js";
99
+ } from "./chunk-24EIFQYZ.js";
100
100
  import {
101
101
  allowedValues,
102
102
  decoderOf,
@@ -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,
@@ -1341,7 +1332,8 @@ var createAppHandler = (app) => (request, context) => Effect_exports.gen(functio
1341
1332
  toolError = true;
1342
1333
  }
1343
1334
  }),
1344
- // Name what failed on the span; the bounded message stays in the reply only.
1335
+ // Name what failed on the span; the bounded message stays in the reply only. The host
1336
+ // records an app's own error names and codes as `unrecognized` (telemetry `app-records`).
1345
1337
  Effect_exports.tapError(
1346
1338
  (error) => (error._tag === "HostEvaluationFailed" || error._tag === "HostOperationFailed" || error._tag === "HostDeclarationInvalid") && error.errorName !== void 0 ? Effect_exports.annotateCurrentSpan({
1347
1339
  "error.type": error.errorName,
@@ -1367,18 +1359,21 @@ var createAppHandler = (app) => (request, context) => Effect_exports.gen(functio
1367
1359
  )
1368
1360
  ),
1369
1361
  Effect_exports.catchCause(
1370
- (cause) => Cause_exports.hasInterrupts(cause) ? Effect_exports.interrupt : Effect_exports.logError(cause).pipe(
1371
- Effect_exports.andThen(
1372
- Schema_exports.encodeEffect(HostError)(
1373
- declarationInvalid(
1374
- "The app failed while it was loaded",
1375
- Cause_exports.squash(cause),
1376
- accountSecrets(context.accounts)
1362
+ (cause) => Cause_exports.hasInterrupts(cause) ? Effect_exports.interrupt : (
1363
+ // The cause can carry any text the app threw; its caller receives that, not the log.
1364
+ Effect_exports.logError("The app's request failed unexpectedly").pipe(
1365
+ Effect_exports.andThen(
1366
+ Schema_exports.encodeEffect(HostError)(
1367
+ declarationInvalid(
1368
+ "The app failed while it was loaded",
1369
+ Cause_exports.squash(cause),
1370
+ accountSecrets(context.accounts)
1371
+ )
1377
1372
  )
1378
- )
1379
- ),
1380
- Effect_exports.map((error) => Response.json({ ok: false, error }, { status: 500 })),
1381
- Effect_exports.orDie
1373
+ ),
1374
+ Effect_exports.map((error) => Response.json({ ok: false, error }, { status: 500 })),
1375
+ Effect_exports.orDie
1376
+ )
1382
1377
  )
1383
1378
  )
1384
1379
  );
@@ -1,3 +1,6 @@
1
+ import {
2
+ RecordedMessage
3
+ } from "./chunk-2FWXCU5I.js";
1
4
  import {
2
5
  SchemaGetter_exports,
3
6
  Schema_exports
@@ -20,9 +23,19 @@ function withFields(definition) {
20
23
  ),
21
24
  { httpApiStatus: definition.status, ...documentation }
22
25
  );
23
- Object.defineProperty(DefinedError.prototype, "message", {
24
- get() {
25
- return typeof message === "string" ? message : message(this);
26
+ const recorded = definition.recorded;
27
+ Object.defineProperties(DefinedError.prototype, {
28
+ message: {
29
+ get() {
30
+ return typeof message === "string" ? message : message(this);
31
+ }
32
+ },
33
+ ...recorded === void 0 ? {} : {
34
+ [RecordedMessage]: {
35
+ get() {
36
+ return recorded(this);
37
+ }
38
+ }
26
39
  }
27
40
  });
28
41
  return DefinedError;
@@ -117,7 +130,8 @@ var SkillLoadFailed = class extends Schema_exports.TaggedError()("SkillLoadFaile
117
130
  ]),
118
131
  // Error instances read an omitted message as "", so an empty message means none was given.
119
132
  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 })))
133
+ status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
134
+ missing: Schema_exports.optional(Schema_exports.Literals(["repository", "ref"]))
121
135
  }) {
122
136
  };
123
137
  var skillLoadLimits = {