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
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  skillFromFiles
3
- } from "./chunk-FFTALB6S.js";
3
+ } from "./chunk-4U2VUDET.js";
4
4
  import {
5
5
  joinPath,
6
6
  mergeMeta
7
- } from "./chunk-VBVOPW4U.js";
7
+ } from "./chunk-BKJDZYK7.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-XEXUHXC3.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-556EWA6P.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,
package/js/contracts.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  ManualWebhookDescriptor,
52
52
  ManualWebhookSetup,
53
53
  McpClientLimits,
54
- McpError,
54
+ McpError2 as McpError,
55
55
  NonRetryableError,
56
56
  OAuthClientAuth,
57
57
  OAuthSecretClientAuth,
@@ -66,6 +66,7 @@ import {
66
66
  RouterMeta,
67
67
  ScheduleTiming,
68
68
  SkillCatalogResponse,
69
+ SkillLoadFailed,
69
70
  SkillSources,
70
71
  ToolResultObservation,
71
72
  TrustedToolApproval,
@@ -107,11 +108,12 @@ import {
107
108
  protocol6,
108
109
  protocol7,
109
110
  protocol8,
111
+ protocol9,
110
112
  selectTools,
111
113
  skillCatalog,
112
114
  skillsCommand,
113
115
  workflowDurationMillis
114
- } from "./chunk-5KNA2Z5I.js";
116
+ } from "./chunk-XEXUHXC3.js";
115
117
  import {
116
118
  DatabaseFieldReserved,
117
119
  DatabaseLimitExceeded
@@ -147,11 +149,10 @@ import {
147
149
  SkillDefinitionInvalid,
148
150
  SkillFile,
149
151
  SkillFilePath,
150
- SkillLoadFailed,
151
152
  SkillServiceName,
152
153
  skillFormatLimits,
153
154
  skillLoadLimits
154
- } from "./chunk-I7CNZ4CM.js";
155
+ } from "./chunk-556EWA6P.js";
155
156
  import {
156
157
  AppStorageError,
157
158
  AppStorageUnavailable,
@@ -312,6 +313,7 @@ export {
312
313
  protocol6,
313
314
  protocol7,
314
315
  protocol8,
316
+ protocol9,
315
317
  selectTools,
316
318
  skillCatalog,
317
319
  skillFormatLimits,
package/js/effect.js CHANGED
@@ -3,22 +3,22 @@ import {
3
3
  ApprovalDecision,
4
4
  createAppHandler,
5
5
  prepareElicitation
6
- } from "./chunk-UWOIEJ56.js";
6
+ } from "./chunk-UBAKWXAJ.js";
7
7
  import "./chunk-JU7F4PRK.js";
8
- import "./chunk-YYK6GEMC.js";
8
+ import "./chunk-ZQWDOHEO.js";
9
9
  import "./chunk-SRB2WDU7.js";
10
- import "./chunk-FFTALB6S.js";
11
- import "./chunk-KBXQOJYW.js";
10
+ import "./chunk-4U2VUDET.js";
11
+ import "./chunk-CZLCA2O4.js";
12
12
  import "./chunk-IU7CCCUC.js";
13
- import "./chunk-VBVOPW4U.js";
13
+ import "./chunk-BKJDZYK7.js";
14
14
  import "./chunk-ENJCQWVF.js";
15
15
  import "./chunk-NHUHTWAF.js";
16
16
  import {
17
17
  ToolAnnotations
18
- } from "./chunk-5KNA2Z5I.js";
18
+ } from "./chunk-XEXUHXC3.js";
19
19
  import "./chunk-73AV3JVU.js";
20
20
  import "./chunk-BI6R577B.js";
21
- import "./chunk-I7CNZ4CM.js";
21
+ import "./chunk-556EWA6P.js";
22
22
  import "./chunk-KZFV3WCJ.js";
23
23
  import "./chunk-TADLIUEU.js";
24
24
  import {
package/js/graphql.js CHANGED
@@ -4,36 +4,36 @@ import {
4
4
  } from "./chunk-YW333DH3.js";
5
5
  import {
6
6
  protocolOperations
7
- } from "./chunk-5CQMUXW7.js";
7
+ } from "./chunk-WMVTBHGK.js";
8
8
  import "./chunk-BCSNKUAC.js";
9
- import "./chunk-UWOIEJ56.js";
9
+ import "./chunk-UBAKWXAJ.js";
10
10
  import {
11
11
  cacheKey
12
12
  } from "./chunk-JU7F4PRK.js";
13
- import "./chunk-YYK6GEMC.js";
13
+ import "./chunk-ZQWDOHEO.js";
14
14
  import {
15
15
  failOnNetworkRefusal
16
16
  } from "./chunk-SRB2WDU7.js";
17
- import "./chunk-FFTALB6S.js";
18
- import "./chunk-KBXQOJYW.js";
17
+ import "./chunk-4U2VUDET.js";
18
+ import "./chunk-CZLCA2O4.js";
19
19
  import "./chunk-IU7CCCUC.js";
20
20
  import {
21
21
  nativeOperation,
22
22
  routerDeclaration
23
- } from "./chunk-VBVOPW4U.js";
23
+ } from "./chunk-BKJDZYK7.js";
24
24
  import {
25
25
  accountProviderError,
26
26
  graphqlProviderError,
27
27
  httpProviderError
28
28
  } from "./chunk-ENJCQWVF.js";
29
29
  import "./chunk-NHUHTWAF.js";
30
- import "./chunk-5KNA2Z5I.js";
30
+ import "./chunk-XEXUHXC3.js";
31
31
  import "./chunk-73AV3JVU.js";
32
32
  import {
33
33
  NetworkRefused,
34
34
  ProviderError
35
35
  } from "./chunk-BI6R577B.js";
36
- import "./chunk-I7CNZ4CM.js";
36
+ import "./chunk-556EWA6P.js";
37
37
  import "./chunk-KZFV3WCJ.js";
38
38
  import {
39
39
  FetchHttpClient_exports
package/js/host.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createAppHandler
3
- } from "./chunk-UWOIEJ56.js";
3
+ } from "./chunk-UBAKWXAJ.js";
4
4
  import "./chunk-JU7F4PRK.js";
5
- import "./chunk-YYK6GEMC.js";
5
+ import "./chunk-ZQWDOHEO.js";
6
6
  import "./chunk-SRB2WDU7.js";
7
- import "./chunk-FFTALB6S.js";
8
- import "./chunk-KBXQOJYW.js";
7
+ import "./chunk-4U2VUDET.js";
8
+ import "./chunk-CZLCA2O4.js";
9
9
  import "./chunk-IU7CCCUC.js";
10
- import "./chunk-VBVOPW4U.js";
10
+ import "./chunk-BKJDZYK7.js";
11
11
  import "./chunk-ENJCQWVF.js";
12
12
  import "./chunk-NHUHTWAF.js";
13
13
  import {
@@ -23,14 +23,14 @@ import {
23
23
  WorkflowRun,
24
24
  WorkflowRunId,
25
25
  WorkflowRunPage
26
- } from "./chunk-5KNA2Z5I.js";
26
+ } from "./chunk-XEXUHXC3.js";
27
27
  import "./chunk-73AV3JVU.js";
28
28
  import {
29
29
  CacheCommand,
30
30
  CacheError,
31
31
  CacheReply
32
32
  } from "./chunk-BI6R577B.js";
33
- import "./chunk-I7CNZ4CM.js";
33
+ import "./chunk-556EWA6P.js";
34
34
  import {
35
35
  collectTelemetry,
36
36
  withRemoteSpan
package/js/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  defineDatabase,
6
6
  table,
7
7
  workflow
8
- } from "./chunk-KBXQOJYW.js";
8
+ } from "./chunk-CZLCA2O4.js";
9
9
  import "./chunk-IU7CCCUC.js";
10
10
  import {
11
11
  dynamicRouter,
@@ -20,7 +20,7 @@ import {
20
20
  toolAnnotations,
21
21
  withApproval,
22
22
  withApprovals
23
- } from "./chunk-VBVOPW4U.js";
23
+ } from "./chunk-BKJDZYK7.js";
24
24
  import {
25
25
  accountProviderError
26
26
  } from "./chunk-ENJCQWVF.js";
@@ -39,7 +39,7 @@ import {
39
39
  ScheduleTiming,
40
40
  SecretsMethod,
41
41
  WorkflowFailure
42
- } from "./chunk-5KNA2Z5I.js";
42
+ } from "./chunk-XEXUHXC3.js";
43
43
  import "./chunk-73AV3JVU.js";
44
44
  import {
45
45
  CacheError,
@@ -47,7 +47,7 @@ import {
47
47
  NetworkRefused,
48
48
  ProviderError
49
49
  } from "./chunk-BI6R577B.js";
50
- import "./chunk-I7CNZ4CM.js";
50
+ import "./chunk-556EWA6P.js";
51
51
  import {
52
52
  array,
53
53
  boolean,
package/js/mcp/effect.js CHANGED
@@ -2,23 +2,23 @@ import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect,
4
4
  mcpToolsEffect
5
- } from "../chunk-LUROQKFP.js";
6
- import "../chunk-IA3VSGR4.js";
5
+ } from "../chunk-WAGGHNWH.js";
6
+ import "../chunk-A2NN45C7.js";
7
7
  import "../chunk-BCSNKUAC.js";
8
- import "../chunk-UWOIEJ56.js";
8
+ import "../chunk-UBAKWXAJ.js";
9
9
  import "../chunk-JU7F4PRK.js";
10
- import "../chunk-YYK6GEMC.js";
10
+ import "../chunk-ZQWDOHEO.js";
11
11
  import "../chunk-SRB2WDU7.js";
12
- import "../chunk-FFTALB6S.js";
13
- import "../chunk-KBXQOJYW.js";
12
+ import "../chunk-4U2VUDET.js";
13
+ import "../chunk-CZLCA2O4.js";
14
14
  import "../chunk-IU7CCCUC.js";
15
- import "../chunk-VBVOPW4U.js";
15
+ import "../chunk-BKJDZYK7.js";
16
16
  import "../chunk-ENJCQWVF.js";
17
17
  import "../chunk-NHUHTWAF.js";
18
- import "../chunk-5KNA2Z5I.js";
18
+ import "../chunk-XEXUHXC3.js";
19
19
  import "../chunk-73AV3JVU.js";
20
20
  import "../chunk-BI6R577B.js";
21
- import "../chunk-I7CNZ4CM.js";
21
+ import "../chunk-556EWA6P.js";
22
22
  import "../chunk-KZFV3WCJ.js";
23
23
  import "../chunk-TADLIUEU.js";
24
24
  import "../chunk-POOIHRPF.js";
package/js/mcp/stdio.js CHANGED
@@ -3,28 +3,28 @@ 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
  protocolRouter
9
- } from "../chunk-5CQMUXW7.js";
9
+ } from "../chunk-WMVTBHGK.js";
10
10
  import "../chunk-BCSNKUAC.js";
11
- import "../chunk-UWOIEJ56.js";
11
+ import "../chunk-UBAKWXAJ.js";
12
12
  import "../chunk-JU7F4PRK.js";
13
- import "../chunk-YYK6GEMC.js";
13
+ import "../chunk-ZQWDOHEO.js";
14
14
  import "../chunk-SRB2WDU7.js";
15
- import "../chunk-FFTALB6S.js";
16
- import "../chunk-KBXQOJYW.js";
15
+ import "../chunk-4U2VUDET.js";
16
+ import "../chunk-CZLCA2O4.js";
17
17
  import "../chunk-IU7CCCUC.js";
18
- import "../chunk-VBVOPW4U.js";
18
+ import "../chunk-BKJDZYK7.js";
19
19
  import "../chunk-ENJCQWVF.js";
20
20
  import "../chunk-NHUHTWAF.js";
21
21
  import {
22
22
  McpError,
23
23
  ProcessConfig
24
- } from "../chunk-5KNA2Z5I.js";
24
+ } from "../chunk-XEXUHXC3.js";
25
25
  import "../chunk-73AV3JVU.js";
26
26
  import "../chunk-BI6R577B.js";
27
- import "../chunk-I7CNZ4CM.js";
27
+ import "../chunk-556EWA6P.js";
28
28
  import "../chunk-KZFV3WCJ.js";
29
29
  import "../chunk-TADLIUEU.js";
30
30
  import "../chunk-POOIHRPF.js";
package/js/mcp.js CHANGED
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  mcpClientEffect,
3
3
  mcpHealthEffect
4
- } from "./chunk-LUROQKFP.js";
4
+ } from "./chunk-WAGGHNWH.js";
5
5
  import {
6
6
  catalogCache,
7
7
  catalogScope
8
8
  } from "./chunk-YW333DH3.js";
9
9
  import {
10
10
  adaptMcpTool
11
- } from "./chunk-IA3VSGR4.js";
11
+ } from "./chunk-A2NN45C7.js";
12
12
  import {
13
13
  protocolOperations
14
- } from "./chunk-5CQMUXW7.js";
14
+ } from "./chunk-WMVTBHGK.js";
15
15
  import "./chunk-BCSNKUAC.js";
16
- import "./chunk-UWOIEJ56.js";
16
+ import "./chunk-UBAKWXAJ.js";
17
17
  import {
18
18
  cacheKey
19
19
  } from "./chunk-JU7F4PRK.js";
20
20
  import {
21
21
  operationDescription
22
- } from "./chunk-YYK6GEMC.js";
22
+ } from "./chunk-ZQWDOHEO.js";
23
23
  import "./chunk-SRB2WDU7.js";
24
- import "./chunk-FFTALB6S.js";
25
- import "./chunk-KBXQOJYW.js";
24
+ import "./chunk-4U2VUDET.js";
25
+ import "./chunk-CZLCA2O4.js";
26
26
  import "./chunk-IU7CCCUC.js";
27
27
  import {
28
28
  nativeOperation,
29
29
  routerDeclaration
30
- } from "./chunk-VBVOPW4U.js";
30
+ } from "./chunk-BKJDZYK7.js";
31
31
  import "./chunk-ENJCQWVF.js";
32
32
  import "./chunk-NHUHTWAF.js";
33
33
  import {
@@ -36,10 +36,10 @@ import {
36
36
  McpServerHeader,
37
37
  McpToolMetadata,
38
38
  McpToolsOptions
39
- } from "./chunk-5KNA2Z5I.js";
39
+ } from "./chunk-XEXUHXC3.js";
40
40
  import "./chunk-73AV3JVU.js";
41
41
  import "./chunk-BI6R577B.js";
42
- import "./chunk-I7CNZ4CM.js";
42
+ import "./chunk-556EWA6P.js";
43
43
  import "./chunk-KZFV3WCJ.js";
44
44
  import "./chunk-TADLIUEU.js";
45
45
  import "./chunk-POOIHRPF.js";
package/js/openapi.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  protocolOperations,
10
10
  protocolRouter
11
- } from "./chunk-5CQMUXW7.js";
11
+ } from "./chunk-WMVTBHGK.js";
12
12
  import {
13
13
  OpenapiCompileError,
14
14
  OpenapiCompileErrorCode,
@@ -27,17 +27,17 @@ import {
27
27
  isOpenapiTextMedia,
28
28
  openapiBinaryResultSchema,
29
29
  openapiMediaKind
30
- } from "./chunk-YYK6GEMC.js";
30
+ } from "./chunk-ZQWDOHEO.js";
31
31
  import {
32
32
  failOnNetworkRefusal
33
33
  } from "./chunk-SRB2WDU7.js";
34
- import "./chunk-FFTALB6S.js";
34
+ import "./chunk-4U2VUDET.js";
35
35
  import {
36
36
  fromPromise,
37
37
  nativeOperation,
38
38
  routerDeclaration,
39
39
  toPromise
40
- } from "./chunk-VBVOPW4U.js";
40
+ } from "./chunk-BKJDZYK7.js";
41
41
  import {
42
42
  accountProviderError,
43
43
  httpProviderError
@@ -49,14 +49,14 @@ import {
49
49
  OpenapiResponseError,
50
50
  RouterMeta,
51
51
  defaultOpenapiErrorLimits
52
- } from "./chunk-5KNA2Z5I.js";
52
+ } from "./chunk-XEXUHXC3.js";
53
53
  import "./chunk-73AV3JVU.js";
54
54
  import {
55
55
  NetworkRefused,
56
56
  ProviderError,
57
57
  cacheLimits
58
58
  } from "./chunk-BI6R577B.js";
59
- import "./chunk-I7CNZ4CM.js";
59
+ import "./chunk-556EWA6P.js";
60
60
  import "./chunk-KZFV3WCJ.js";
61
61
  import {
62
62
  FetchHttpClient_exports
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  folderSkillsEffect,
3
3
  skillFromFiles
4
- } from "../chunk-FFTALB6S.js";
5
- import "../chunk-I7CNZ4CM.js";
4
+ } from "../chunk-4U2VUDET.js";
5
+ import "../chunk-556EWA6P.js";
6
6
  import "../chunk-PHO7HXTC.js";
7
7
  import "../chunk-V5DWGYRK.js";
8
8
  import "../chunk-KOOJUMLR.js";
package/js/skills.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  folderSkillsEffect,
11
11
  skillFromFiles
12
- } from "./chunk-FFTALB6S.js";
12
+ } from "./chunk-4U2VUDET.js";
13
13
  import {
14
14
  accountProviderError,
15
15
  httpProviderError
@@ -29,7 +29,7 @@ import {
29
29
  SkillLoadFailed,
30
30
  SkillServiceName,
31
31
  skillLoadLimits
32
- } from "./chunk-I7CNZ4CM.js";
32
+ } from "./chunk-556EWA6P.js";
33
33
  import "./chunk-KZFV3WCJ.js";
34
34
  import {
35
35
  FetchHttpClient_exports
@@ -606,18 +606,15 @@ var describe = (service, { reason, status }) => {
606
606
  };
607
607
  var withService = (service) => (effect) => service === void 0 || !Schema_exports.is(SkillServiceName)(service) ? effect : effect.pipe(
608
608
  Effect_exports.mapError(
609
- (error) => !error.message ? new SkillLoadFailed({
609
+ (error) => Schema_exports.is(SkillLoadFailed)(error) && !error.message ? new SkillLoadFailed({
610
610
  reason: error.reason,
611
611
  message: describe(service, error),
612
- ...error.status === void 0 ? {} : { status: error.status }
612
+ ...error.status === void 0 ? {} : { status: error.status },
613
+ ...error.missing === void 0 ? {} : { missing: error.missing }
613
614
  }) : error
614
615
  )
615
616
  );
616
- var refusedRequest = (refused) => new SkillLoadFailed({
617
- reason: "source",
618
- status: networkRefusalStatus,
619
- message: refused.message.slice(0, 500)
620
- });
617
+ var loaderFailure = (error, otherwise) => Schema_exports.is(SkillLoadFailed)(error) || Schema_exports.is(NetworkRefused)(error) ? error : otherwise();
621
618
  var parse = (schema, input) => Schema_exports.decodeUnknownEffect(schema)(input).pipe(Effect_exports.mapError(() => failed("document")));
622
619
  var resourcePath = (path) => {
623
620
  if (!Schema_exports.is(SkillFilePath)(path)) return false;
@@ -640,7 +637,7 @@ var reader = (transport) => Effect_exports.gen(function* () {
640
637
  });
641
638
  if (!["https:", "http:"].includes(parsed.protocol) || parsed.username || parsed.password || parsed.hash)
642
639
  return yield* failed("source");
643
- const refused = request.refused ?? refusedRequest;
640
+ const refusal = request.refused ?? ((refused) => refused);
644
641
  const client = HttpClient_exports.withScope(yield* HttpClient_exports.HttpClient);
645
642
  const headers = {
646
643
  "User-Agent": "executor-skills",
@@ -652,12 +649,12 @@ var reader = (transport) => Effect_exports.gen(function* () {
652
649
  headers,
653
650
  body: HttpBody_exports.uint8Array(request.body, request.headers?.["Content-Type"])
654
651
  })).pipe(
655
- // `ctx.fetch` rejects a request Executor's app network refused.
652
+ // `ctx.fetch` rejects with a network refusal; any other failed request got no answer.
656
653
  Effect_exports.mapError(
657
- (error) => Schema_exports.is(NetworkRefused)(error.cause) ? refused(error.cause) : failed("request")
654
+ (error) => Schema_exports.is(NetworkRefused)(error.cause) ? refusal(error.cause) : failed("request")
658
655
  )
659
656
  );
660
- yield* failOnNetworkRefusal(response).pipe(Effect_exports.mapError(refused));
657
+ yield* failOnNetworkRefusal(response).pipe(Effect_exports.mapError(refusal));
661
658
  if (response.status < 200 || response.status >= 300)
662
659
  return yield* rejected(response.status, response.headers);
663
660
  const chunks = [];
@@ -711,8 +708,8 @@ var githubRequests = (remote, repo, token) => {
711
708
  const refused = (host) => (refusal) => refusal.refusal.reason === "credential_host" ? new SkillLoadFailed({
712
709
  reason: "source",
713
710
  status: networkRefusalStatus,
714
- message: `Executor did not send the GitHub token to ${host}. The account's provider must declare hosts ${githubHosts.join(" and ")}; reconnect an account connected with other hosts.`
715
- }) : refusedRequest(refusal);
711
+ message: `A request with the GitHub token to ${host} was refused because the account's provider does not declare that host. The provider must declare hosts ${githubHosts.join(" and ")}; reconnect an account connected with other hosts.`
712
+ }) : refusal;
716
713
  const upload = (body) => remote.fetchBytes(`https://${githubHosts[0]}/${repo}.git/git-upload-pack`, {
717
714
  body,
718
715
  headers: {
@@ -733,12 +730,21 @@ var resolveCommit = (github, ref) => Effect_exports.gen(function* () {
733
730
  const names = refCandidates(ref);
734
731
  const response = yield* github.upload(lsRefsRequest(names)).pipe(
735
732
  Effect_exports.mapError((error) => {
736
- const hidden = error.reason === "request" && (error.status === 404 || error.status === 401 && !github.authenticated);
737
- return hidden ? new SkillLoadFailed({
738
- reason: "source",
739
- message: github.authenticated ? `GitHub has no repository named ${repo} that the account's token can read.` : `GitHub has no public repository named ${repo}. To read a private repository, pass a GitHub account and its token.`,
740
- status: error.status
741
- }) : error;
733
+ if (!Schema_exports.is(SkillLoadFailed)(error) || error.reason !== "request") return error;
734
+ if (!github.authenticated && (error.status === 404 || error.status === 401))
735
+ return new SkillLoadFailed({
736
+ reason: "source",
737
+ message: `Reading GitHub repository ${repo} without credentials returned HTTP ${error.status}: it may not exist, or it may be private. To read a private repository, pass a GitHub account and its token.`,
738
+ status: error.status,
739
+ missing: "repository"
740
+ });
741
+ if (github.authenticated && error.status === 404)
742
+ return new SkillLoadFailed({
743
+ reason: "request",
744
+ message: `GitHub repository ${repo} is not available with the account's token (HTTP 404). Check the repository name and that the token can read it.`,
745
+ status: error.status
746
+ });
747
+ return error;
742
748
  })
743
749
  );
744
750
  const refs = yield* git(() => parseLsRefs(response));
@@ -746,7 +752,8 @@ var resolveCommit = (github, ref) => Effect_exports.gen(function* () {
746
752
  if (commit === void 0)
747
753
  return yield* new SkillLoadFailed({
748
754
  reason: "source",
749
- message: `GitHub repository ${repo} has no branch or tag named ${ref}.`
755
+ message: `The refs read from GitHub repository ${repo} include no branch or tag named ${ref}.`,
756
+ missing: "ref"
750
757
  });
751
758
  return commit;
752
759
  });
@@ -795,10 +802,13 @@ var cachedSkillDirectories = (cache, transport, options, commit) => Effect_expor
795
802
  { signal: context.signal }
796
803
  )
797
804
  }),
798
- catch: (error) => Schema_exports.is(SkillLoadFailed)(error) ? error : new SkillLoadFailed({
799
- reason: "request",
800
- message: "Executor could not read or update the app cache for skills."
801
- })
805
+ catch: (error) => loaderFailure(
806
+ error,
807
+ () => new SkillLoadFailed({
808
+ reason: "request",
809
+ message: "Executor could not read or update the app cache for skills."
810
+ })
811
+ )
802
812
  });
803
813
  var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(options, void 0) : catalogCache({
804
814
  cache: options.cache,
@@ -811,10 +821,13 @@ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(o
811
821
  }).pipe(
812
822
  Effect_exports.flatMap((catalog) => catalog.list()),
813
823
  Effect_exports.mapError(
814
- (error) => Schema_exports.is(SkillLoadFailed)(error) ? error : new SkillLoadFailed({
815
- reason: "request",
816
- message: "Executor could not read or update the app cache for skills."
817
- })
824
+ (error) => loaderFailure(
825
+ error,
826
+ () => new SkillLoadFailed({
827
+ reason: "request",
828
+ message: "Executor could not read or update the app cache for skills."
829
+ })
830
+ )
818
831
  )
819
832
  );
820
833
  var GitHubToken = Schema_exports.String.check(Schema_exports.isPattern(/^[\x21-\x7e]+$/));
@@ -832,7 +845,7 @@ var githubCache = (options) => options.account !== void 0 && !Schema_exports.is(
832
845
  options.token,
833
846
  (problem) => new SkillLoadFailed({ reason: "source", message: scopeMessages[problem] })
834
847
  );
835
- var attributed = (account) => (error) => account !== void 0 && error.reason === "request" && (error.status === 401 || error.status === 403) ? accountProviderError(
848
+ var attributed = (account) => (error) => account !== void 0 && Schema_exports.is(SkillLoadFailed)(error) && error.reason === "request" && (error.status === 401 || error.status === 403) ? accountProviderError(
836
849
  new ProviderError({
837
850
  reason: error.status === 401 ? "unauthorized" : "rejected",
838
851
  status: error.status
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.35",
3
+ "version": "0.0.1-beta.36",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,