apps 0.0.1-beta.1 → 0.0.1-beta.3

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 (58) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/browser-XIPJGLH2.js +65 -0
  3. package/js/{chunk-6YBRWRK3.js → chunk-5MQZEB6Y.js} +16 -4
  4. package/js/chunk-D47C7KG5.js +172 -0
  5. package/js/{chunk-ZTFQHGEB.js → chunk-FDNTX5QJ.js} +1 -3
  6. package/js/{chunk-OHRT55C4.js → chunk-G7ZIRKMK.js} +0 -3
  7. package/js/{chunk-G7IE6BKC.js → chunk-HDTGZWP2.js} +2 -2
  8. package/js/{chunk-KOXMLKTM.js → chunk-J7O55ZV7.js} +20 -148
  9. package/js/{chunk-RBAC33PQ.js → chunk-JN55AYQH.js} +3 -57
  10. package/js/chunk-LGIYBDWA.js +85 -0
  11. package/js/{chunk-IHQ4ML7K.js → chunk-MYYEW3RA.js} +130 -86
  12. package/js/chunk-NQ3OMCA5.js +39 -0
  13. package/js/{chunk-PZ36XMXW.js → chunk-PYUYJRSK.js} +1 -1
  14. package/js/{chunk-X7SFGU4Q.js → chunk-RN2MXB4R.js} +4 -4
  15. package/js/{chunk-4LPG6RCH.js → chunk-T2LAZCAD.js} +4 -24
  16. package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
  17. package/js/{chunk-2HHMABB6.js → chunk-WFSQXYUT.js} +46 -10
  18. package/js/{chunk-6IIO4NPI.js → chunk-Z5NMEGJN.js} +1 -1
  19. package/js/client.js +2 -2
  20. package/js/contracts.js +8 -1
  21. package/js/effect.js +8 -7
  22. package/js/es-APDZKREY.js +40968 -0
  23. package/js/graphql.js +10 -9
  24. package/js/host.js +12 -11
  25. package/js/index.js +7 -5
  26. package/js/mcp/effect.js +10 -9
  27. package/js/mcp/stdio.js +10 -9
  28. package/js/mcp.js +12 -11
  29. package/js/openapi.js +776 -41590
  30. package/js/skills/effect.js +1 -2
  31. package/js/skills.js +47 -10
  32. package/js/ui/auth/contracts.js +7 -8
  33. package/js/ui/auth.js +13 -11
  34. package/js/ui/contracts.js +1 -1
  35. package/js/ui/serving.js +3 -2
  36. package/package.json +1 -1
  37. package/runtime.json +1 -1
  38. package/types/app-cache/src/contracts/cache.d.ts +42 -2
  39. package/types/app-cache/src/index.d.ts +59 -1
  40. package/types/apps/src/contracts/cache.d.ts +4 -1
  41. package/types/apps/src/contracts/host.d.ts +8 -672
  42. package/types/apps/src/contracts/openapi.d.ts +6 -0
  43. package/types/apps/src/contracts/protocol-version.d.ts +6 -0
  44. package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
  45. package/types/apps/src/contracts/skills.d.ts +17 -8
  46. package/types/apps/src/contracts/ui-auth.d.ts +6 -14
  47. package/types/apps/src/implementation/cache.d.ts +3 -1
  48. package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
  49. package/types/apps/src/implementation/openapi-document.d.ts +0 -2
  50. package/types/apps/src/implementation/openapi-names.d.ts +18 -0
  51. package/types/apps/src/implementation/openapi-request.d.ts +0 -1
  52. package/types/apps/src/implementation/openapi-source.d.ts +5 -1
  53. package/types/apps/src/implementation/schema.d.ts +0 -5
  54. package/types/apps/src/implementation/swagger-client.d.ts +28 -0
  55. package/types/apps/src/implementation/ui-auth.d.ts +11 -5
  56. package/types/apps/src/skills.d.ts +6 -3
  57. package/types/apps/src/ui-auth.d.ts +2 -2
  58. package/js/chunk-TE4KO4HI.js +0 -47
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  folderSkillsEffect,
3
3
  skillFromFiles
4
- } from "../chunk-ZTFQHGEB.js";
5
- import "../chunk-NCYXZN2G.js";
4
+ } from "../chunk-FDNTX5QJ.js";
6
5
  import "../chunk-YEJOQEII.js";
7
6
  import "../chunk-FW5HBOIK.js";
8
7
  import "../chunk-CZ7CSFO4.js";
package/js/skills.js CHANGED
@@ -1,13 +1,18 @@
1
+ import {
2
+ catalogCache
3
+ } from "./chunk-5MQZEB6Y.js";
4
+ import "./chunk-D47C7KG5.js";
1
5
  import {
2
6
  folderSkillsEffect,
3
7
  skillFromFiles
4
- } from "./chunk-ZTFQHGEB.js";
5
- import "./chunk-NCYXZN2G.js";
8
+ } from "./chunk-FDNTX5QJ.js";
6
9
  import {
7
10
  httpProviderError
8
11
  } from "./chunk-ZJWDMTE3.js";
12
+ import "./chunk-LGIYBDWA.js";
9
13
  import {
10
14
  AppSkillMetadata,
15
+ AppSkillSource,
11
16
  AppSkills,
12
17
  SkillDefinitionInvalid,
13
18
  SkillFilePath,
@@ -25,7 +30,7 @@ import {
25
30
  } from "./chunk-QKHR7BMF.js";
26
31
  import {
27
32
  wrap
28
- } from "./chunk-2HHMABB6.js";
33
+ } from "./chunk-WFSQXYUT.js";
29
34
  import "./chunk-SATWJKN6.js";
30
35
  import {
31
36
  Effect_exports,
@@ -729,13 +734,14 @@ var skillDirectories = (remote, repo, commit, path) => Effect_exports.gen(functi
729
734
  return yield* failed("limit");
730
735
  return directories;
731
736
  });
732
- var cachedSkillDirectories = (cache, repo, commit, path) => Effect_exports.tryPromise({
737
+ var cachedSkillDirectories = (cache, transport, repo, commit, path) => Effect_exports.tryPromise({
733
738
  try: () => cache.get({
734
739
  key: ["apps/githubSkills/directories", 1, repo, commit, path ?? null],
735
740
  schema: wrap(SkillDirectories, false),
736
741
  freshFor: "7 days",
737
742
  load: (context) => Effect_exports.runPromise(
738
- reader(context).pipe(
743
+ // Keep the author's fetch, as every other read in this load does.
744
+ reader({ fetch: transport.fetch, signal: context.signal }).pipe(
739
745
  Effect_exports.flatMap((remote) => skillDirectories(remote, repo, commit, path))
740
746
  ),
741
747
  { signal: context.signal }
@@ -746,12 +752,36 @@ var cachedSkillDirectories = (cache, repo, commit, path) => Effect_exports.tryPr
746
752
  message: "Executor could not read or update the app cache for skills."
747
753
  })
748
754
  });
755
+ var cachedCatalog = (options, prefix, load) => options.cache === void 0 ? load(options, void 0) : catalogCache({
756
+ cache: options.cache,
757
+ ...options.freshFor === void 0 ? {} : { freshFor: options.freshFor },
758
+ ...options.staleFor === void 0 ? {} : { staleFor: options.staleFor },
759
+ prefix,
760
+ schema: AppSkillSource,
761
+ summary: { schema: AppSkillMetadata, of: ({ files: _files, ...metadata }) => metadata },
762
+ load: (context) => context === void 0 ? load(options, options.cache) : load({ fetch: options.fetch, signal: context.signal }, context.cache)
763
+ }).pipe(
764
+ Effect_exports.flatMap((catalog) => catalog.list()),
765
+ Effect_exports.mapError(
766
+ (error) => Schema_exports.is(SkillLoadFailed)(error) ? error : new SkillLoadFailed({
767
+ reason: "request",
768
+ message: "Executor could not read or update the app cache for skills."
769
+ })
770
+ )
771
+ );
749
772
  var githubSkillsEffect = (options) => Effect_exports.gen(function* () {
750
773
  if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(options.repo) || options.path !== void 0 && !resourcePath(options.path))
751
774
  return yield* failed("source");
752
- const remote = yield* reader(options);
775
+ return yield* cachedCatalog(
776
+ options,
777
+ ["apps/githubSkills/catalog", 1, options.repo, options.ref ?? null, options.path ?? null],
778
+ (transport, cache) => githubCatalog(options, transport, cache)
779
+ );
780
+ }).pipe(withService("GitHub"));
781
+ var githubCatalog = (options, transport, cache) => Effect_exports.gen(function* () {
782
+ const remote = yield* reader(transport);
753
783
  const commit = yield* resolveCommit(remote, options.repo, options.ref);
754
- const resources = yield* options.cache === void 0 ? skillDirectories(remote, options.repo, commit, options.path) : cachedSkillDirectories(options.cache, options.repo, commit, options.path);
784
+ const resources = yield* cache === void 0 ? skillDirectories(remote, options.repo, commit, options.path) : cachedSkillDirectories(cache, transport, options.repo, commit, options.path);
755
785
  const base = `https://raw.githubusercontent.com/${options.repo}/${commit}/`;
756
786
  const skills = yield* Effect_exports.forEach(
757
787
  resources,
@@ -775,7 +805,7 @@ var githubSkillsEffect = (options) => Effect_exports.gen(function* () {
775
805
  { concurrency: 1 }
776
806
  );
777
807
  return yield* parse(AppSkills, skills);
778
- }).pipe(withService("GitHub"));
808
+ });
779
809
  var Index = Schema_exports.Struct({
780
810
  skills: Schema_exports.Array(
781
811
  Schema_exports.Struct({
@@ -793,7 +823,14 @@ var wellKnownSkillsEffect = (options) => Effect_exports.gen(function* () {
793
823
  if (url.pathname === "/") url.pathname = "/.well-known/agent-skills/index.json";
794
824
  else if (!url.pathname.endsWith("index.json"))
795
825
  url.pathname = `${url.pathname.replace(/\/$/, "")}/index.json`;
796
- const remote = yield* reader(options);
826
+ return yield* cachedCatalog(
827
+ options,
828
+ ["apps/wellKnownSkills/catalog", 1, url.href],
829
+ (transport) => wellKnownCatalog(url, transport)
830
+ );
831
+ }).pipe(withService(URL.canParse(options.url) ? new URL(options.url).hostname : void 0));
832
+ var wellKnownCatalog = (url, transport) => Effect_exports.gen(function* () {
833
+ const remote = yield* reader(transport);
797
834
  const first = yield* remote.read(url.href);
798
835
  const index = yield* parse(Schema_exports.fromJsonString(Index), first);
799
836
  if (index.skills.reduce((count, skill) => count + skill.files.length, 0) > skillLoadLimits.files)
@@ -818,7 +855,7 @@ var wellKnownSkillsEffect = (options) => Effect_exports.gen(function* () {
818
855
  );
819
856
  if ((yield* remote.read(url.href)) !== first) return yield* failed("changed");
820
857
  return yield* parse(AppSkills, skills);
821
- }).pipe(withService(URL.canParse(options.url) ? new URL(options.url).hostname : void 0));
858
+ });
822
859
 
823
860
  // src/skills.ts
824
861
  var githubSkills = (options) => Effect_exports.runPromise(
@@ -1,19 +1,18 @@
1
1
  import {
2
2
  AppReturnPath,
3
- AppSignInApi,
4
3
  AppSignInCallback,
5
4
  AppSignInCode,
6
- AppSignInId
7
- } from "../../chunk-4LPG6RCH.js";
8
- import "../../chunk-OHRT55C4.js";
9
- import "../../chunk-QKHR7BMF.js";
10
- import "../../chunk-SATWJKN6.js";
5
+ AppSignInFailure,
6
+ AppSignInId,
7
+ appSignInCallbackPath
8
+ } from "../../chunk-T2LAZCAD.js";
11
9
  import "../../chunk-FW5HBOIK.js";
12
10
  import "../../chunk-CZ7CSFO4.js";
13
11
  export {
14
12
  AppReturnPath,
15
- AppSignInApi,
16
13
  AppSignInCallback,
17
14
  AppSignInCode,
18
- AppSignInId
15
+ AppSignInFailure,
16
+ AppSignInId,
17
+ appSignInCallbackPath
19
18
  };
package/js/ui/auth.js CHANGED
@@ -1,28 +1,30 @@
1
1
  import {
2
2
  appPrivateHeaders,
3
- appSignInPage,
4
- appSignInScript
5
- } from "../chunk-TE4KO4HI.js";
3
+ appRedirect,
4
+ appSignInCallback,
5
+ appSignInFailed
6
+ } from "../chunk-NQ3OMCA5.js";
6
7
  import {
7
8
  AppReturnPath,
8
- AppSignInApi,
9
9
  AppSignInCallback,
10
10
  AppSignInCode,
11
- AppSignInId
12
- } from "../chunk-4LPG6RCH.js";
13
- import "../chunk-OHRT55C4.js";
11
+ AppSignInFailure,
12
+ AppSignInId,
13
+ appSignInCallbackPath
14
+ } from "../chunk-T2LAZCAD.js";
14
15
  import "../chunk-HDJH3RPR.js";
15
16
  import "../chunk-QKHR7BMF.js";
16
- import "../chunk-SATWJKN6.js";
17
17
  import "../chunk-FW5HBOIK.js";
18
18
  import "../chunk-CZ7CSFO4.js";
19
19
  export {
20
20
  AppReturnPath,
21
- AppSignInApi,
22
21
  AppSignInCallback,
23
22
  AppSignInCode,
23
+ AppSignInFailure,
24
24
  AppSignInId,
25
25
  appPrivateHeaders,
26
- appSignInPage,
27
- appSignInScript
26
+ appRedirect,
27
+ appSignInCallback,
28
+ appSignInCallbackPath,
29
+ appSignInFailed
28
30
  };
@@ -7,7 +7,7 @@ import {
7
7
  UiOperation,
8
8
  UiSnapshot,
9
9
  UiUnauthorized
10
- } from "../chunk-OHRT55C4.js";
10
+ } from "../chunk-G7ZIRKMK.js";
11
11
  import "../chunk-QKHR7BMF.js";
12
12
  import "../chunk-SATWJKN6.js";
13
13
  import "../chunk-FW5HBOIK.js";
package/js/ui/serving.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  appPrivateHeaders
3
- } from "../chunk-TE4KO4HI.js";
3
+ } from "../chunk-NQ3OMCA5.js";
4
+ import "../chunk-T2LAZCAD.js";
4
5
  import {
5
6
  UiForbidden
6
- } from "../chunk-OHRT55C4.js";
7
+ } from "../chunk-G7ZIRKMK.js";
7
8
  import {
8
9
  CurrentTelemetryConfig
9
10
  } from "../chunk-ZCAMUXSG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apps",
3
- "version": "0.0.1-beta.1",
3
+ "version": "0.0.1-beta.3",
4
4
  "description": "TypeScript apps with typed tools, accounts, storage, and UI.",
5
5
  "type": "module",
6
6
  "sideEffects": false,