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
package/js/skills.js CHANGED
@@ -5,11 +5,11 @@ import {
5
5
  import "./chunk-JU7F4PRK.js";
6
6
  import {
7
7
  failOnNetworkRefusal
8
- } from "./chunk-SRB2WDU7.js";
8
+ } from "./chunk-D45FU4TZ.js";
9
9
  import {
10
10
  folderSkillsEffect,
11
11
  skillFromFiles
12
- } from "./chunk-FFTALB6S.js";
12
+ } from "./chunk-BWUHMKHQ.js";
13
13
  import {
14
14
  accountProviderError,
15
15
  httpProviderError
@@ -29,14 +29,15 @@ import {
29
29
  SkillLoadFailed,
30
30
  SkillServiceName,
31
31
  skillLoadLimits
32
- } from "./chunk-I7CNZ4CM.js";
33
- import "./chunk-KZFV3WCJ.js";
32
+ } from "./chunk-KEZ4YZSP.js";
33
+ import "./chunk-24EIFQYZ.js";
34
34
  import {
35
35
  FetchHttpClient_exports
36
36
  } from "./chunk-TADLIUEU.js";
37
37
  import {
38
38
  wrap
39
39
  } from "./chunk-POOIHRPF.js";
40
+ import "./chunk-2FWXCU5I.js";
40
41
  import "./chunk-BI45HZWM.js";
41
42
  import "./chunk-PHO7HXTC.js";
42
43
  import "./chunk-V5DWGYRK.js";
@@ -606,18 +607,15 @@ var describe = (service, { reason, status }) => {
606
607
  };
607
608
  var withService = (service) => (effect) => service === void 0 || !Schema_exports.is(SkillServiceName)(service) ? effect : effect.pipe(
608
609
  Effect_exports.mapError(
609
- (error) => !error.message ? new SkillLoadFailed({
610
+ (error) => Schema_exports.is(SkillLoadFailed)(error) && !error.message ? new SkillLoadFailed({
610
611
  reason: error.reason,
611
612
  message: describe(service, error),
612
- ...error.status === void 0 ? {} : { status: error.status }
613
+ ...error.status === void 0 ? {} : { status: error.status },
614
+ ...error.missing === void 0 ? {} : { missing: error.missing }
613
615
  }) : error
614
616
  )
615
617
  );
616
- var refusedRequest = (refused) => new SkillLoadFailed({
617
- reason: "source",
618
- status: networkRefusalStatus,
619
- message: refused.message.slice(0, 500)
620
- });
618
+ var loaderFailure = (error, otherwise) => Schema_exports.is(SkillLoadFailed)(error) || Schema_exports.is(NetworkRefused)(error) ? error : otherwise();
621
619
  var parse = (schema, input) => Schema_exports.decodeUnknownEffect(schema)(input).pipe(Effect_exports.mapError(() => failed("document")));
622
620
  var resourcePath = (path) => {
623
621
  if (!Schema_exports.is(SkillFilePath)(path)) return false;
@@ -640,7 +638,7 @@ var reader = (transport) => Effect_exports.gen(function* () {
640
638
  });
641
639
  if (!["https:", "http:"].includes(parsed.protocol) || parsed.username || parsed.password || parsed.hash)
642
640
  return yield* failed("source");
643
- const refused = request.refused ?? refusedRequest;
641
+ const refusal = request.refused ?? ((refused) => refused);
644
642
  const client = HttpClient_exports.withScope(yield* HttpClient_exports.HttpClient);
645
643
  const headers = {
646
644
  "User-Agent": "executor-skills",
@@ -652,12 +650,12 @@ var reader = (transport) => Effect_exports.gen(function* () {
652
650
  headers,
653
651
  body: HttpBody_exports.uint8Array(request.body, request.headers?.["Content-Type"])
654
652
  })).pipe(
655
- // `ctx.fetch` rejects a request Executor's app network refused.
653
+ // `ctx.fetch` rejects with a network refusal; any other failed request got no answer.
656
654
  Effect_exports.mapError(
657
- (error) => Schema_exports.is(NetworkRefused)(error.cause) ? refused(error.cause) : failed("request")
655
+ (error) => Schema_exports.is(NetworkRefused)(error.cause) ? refusal(error.cause) : failed("request")
658
656
  )
659
657
  );
660
- yield* failOnNetworkRefusal(response).pipe(Effect_exports.mapError(refused));
658
+ yield* failOnNetworkRefusal(response).pipe(Effect_exports.mapError(refusal));
661
659
  if (response.status < 200 || response.status >= 300)
662
660
  return yield* rejected(response.status, response.headers);
663
661
  const chunks = [];
@@ -711,8 +709,8 @@ var githubRequests = (remote, repo, token) => {
711
709
  const refused = (host) => (refusal) => refusal.refusal.reason === "credential_host" ? new SkillLoadFailed({
712
710
  reason: "source",
713
711
  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);
712
+ 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.`
713
+ }) : refusal;
716
714
  const upload = (body) => remote.fetchBytes(`https://${githubHosts[0]}/${repo}.git/git-upload-pack`, {
717
715
  body,
718
716
  headers: {
@@ -733,12 +731,21 @@ var resolveCommit = (github, ref) => Effect_exports.gen(function* () {
733
731
  const names = refCandidates(ref);
734
732
  const response = yield* github.upload(lsRefsRequest(names)).pipe(
735
733
  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;
734
+ if (!Schema_exports.is(SkillLoadFailed)(error) || error.reason !== "request") return error;
735
+ if (!github.authenticated && (error.status === 404 || error.status === 401))
736
+ return new SkillLoadFailed({
737
+ reason: "source",
738
+ 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.`,
739
+ status: error.status,
740
+ missing: "repository"
741
+ });
742
+ if (github.authenticated && error.status === 404)
743
+ return new SkillLoadFailed({
744
+ reason: "request",
745
+ 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.`,
746
+ status: error.status
747
+ });
748
+ return error;
742
749
  })
743
750
  );
744
751
  const refs = yield* git(() => parseLsRefs(response));
@@ -746,7 +753,8 @@ var resolveCommit = (github, ref) => Effect_exports.gen(function* () {
746
753
  if (commit === void 0)
747
754
  return yield* new SkillLoadFailed({
748
755
  reason: "source",
749
- message: `GitHub repository ${repo} has no branch or tag named ${ref}.`
756
+ message: `The refs read from GitHub repository ${repo} include no branch or tag named ${ref}.`,
757
+ missing: "ref"
750
758
  });
751
759
  return commit;
752
760
  });
@@ -795,10 +803,13 @@ var cachedSkillDirectories = (cache, transport, options, commit) => Effect_expor
795
803
  { signal: context.signal }
796
804
  )
797
805
  }),
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
- })
806
+ catch: (error) => loaderFailure(
807
+ error,
808
+ () => new SkillLoadFailed({
809
+ reason: "request",
810
+ message: "Executor could not read or update the app cache for skills."
811
+ })
812
+ )
802
813
  });
803
814
  var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(options, void 0) : catalogCache({
804
815
  cache: options.cache,
@@ -811,10 +822,13 @@ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(o
811
822
  }).pipe(
812
823
  Effect_exports.flatMap((catalog) => catalog.list()),
813
824
  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
- })
825
+ (error) => loaderFailure(
826
+ error,
827
+ () => new SkillLoadFailed({
828
+ reason: "request",
829
+ message: "Executor could not read or update the app cache for skills."
830
+ })
831
+ )
818
832
  )
819
833
  );
820
834
  var GitHubToken = Schema_exports.String.check(Schema_exports.isPattern(/^[\x21-\x7e]+$/));
@@ -832,7 +846,7 @@ var githubCache = (options) => options.account !== void 0 && !Schema_exports.is(
832
846
  options.token,
833
847
  (problem) => new SkillLoadFailed({ reason: "source", message: scopeMessages[problem] })
834
848
  );
835
- var attributed = (account) => (error) => account !== void 0 && error.reason === "request" && (error.status === 401 || error.status === 403) ? accountProviderError(
849
+ var attributed = (account) => (error) => account !== void 0 && Schema_exports.is(SkillLoadFailed)(error) && error.reason === "request" && (error.status === 401 || error.status === 403) ? accountProviderError(
836
850
  new ProviderError({
837
851
  reason: error.status === 401 ? "unauthorized" : "rejected",
838
852
  status: error.status
package/js/ui/serving.js CHANGED
@@ -7,8 +7,9 @@ import {
7
7
  } from "../chunk-WDBUOIWV.js";
8
8
  import {
9
9
  CurrentTelemetryConfig
10
- } from "../chunk-KZFV3WCJ.js";
10
+ } from "../chunk-24EIFQYZ.js";
11
11
  import "../chunk-TADLIUEU.js";
12
+ import "../chunk-2FWXCU5I.js";
12
13
  import "../chunk-BI45HZWM.js";
13
14
  import "../chunk-PHO7HXTC.js";
14
15
  import "../chunk-V5DWGYRK.js";
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.37",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,