apps 0.0.1-beta.1 → 0.0.1-beta.2
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.
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-6YBRWRK3.js → chunk-5MQZEB6Y.js} +16 -4
- package/js/chunk-D47C7KG5.js +172 -0
- package/js/{chunk-ZTFQHGEB.js → chunk-FDNTX5QJ.js} +1 -3
- package/js/{chunk-G7IE6BKC.js → chunk-HDTGZWP2.js} +2 -2
- package/js/{chunk-KOXMLKTM.js → chunk-J7O55ZV7.js} +20 -148
- package/js/{chunk-RBAC33PQ.js → chunk-JN55AYQH.js} +3 -57
- package/js/chunk-LGIYBDWA.js +85 -0
- package/js/{chunk-IHQ4ML7K.js → chunk-MYYEW3RA.js} +130 -86
- package/js/{chunk-PZ36XMXW.js → chunk-PYUYJRSK.js} +1 -1
- package/js/{chunk-X7SFGU4Q.js → chunk-RN2MXB4R.js} +4 -4
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-2HHMABB6.js → chunk-WFSQXYUT.js} +46 -10
- package/js/{chunk-6IIO4NPI.js → chunk-Z5NMEGJN.js} +1 -1
- package/js/client.js +1 -1
- package/js/contracts.js +8 -1
- package/js/effect.js +8 -7
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +10 -9
- package/js/host.js +12 -11
- package/js/index.js +7 -5
- package/js/mcp/effect.js +10 -9
- package/js/mcp/stdio.js +10 -9
- package/js/mcp.js +12 -11
- package/js/openapi.js +776 -41590
- package/js/skills/effect.js +1 -2
- package/js/skills.js +47 -10
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +42 -2
- package/types/app-cache/src/index.d.ts +59 -1
- package/types/apps/src/contracts/cache.d.ts +4 -1
- package/types/apps/src/contracts/host.d.ts +8 -672
- package/types/apps/src/contracts/openapi.d.ts +6 -0
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
- package/types/apps/src/contracts/skills.d.ts +17 -8
- package/types/apps/src/implementation/cache.d.ts +3 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
- package/types/apps/src/implementation/openapi-document.d.ts +0 -2
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +0 -1
- package/types/apps/src/implementation/openapi-source.d.ts +5 -1
- package/types/apps/src/implementation/schema.d.ts +0 -5
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/skills.d.ts +6 -3
package/js/skills/effect.js
CHANGED
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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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*
|
|
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
|
-
})
|
|
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
|
-
|
|
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
|
-
})
|
|
858
|
+
});
|
|
822
859
|
|
|
823
860
|
// src/skills.ts
|
|
824
861
|
var githubSkills = (options) => Effect_exports.runPromise(
|