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.
- package/framework-reference.json +1 -1
- package/js/{chunk-KZFV3WCJ.js → chunk-24EIFQYZ.js} +377 -50
- package/js/chunk-2FWXCU5I.js +16 -0
- package/js/{chunk-YYK6GEMC.js → chunk-3LRFKLUX.js} +24 -17
- package/js/{chunk-VBVOPW4U.js → chunk-7KEKFBV7.js} +1 -1
- package/js/{chunk-FFTALB6S.js → chunk-BWUHMKHQ.js} +1 -1
- package/js/{chunk-KBXQOJYW.js → chunk-CAOHGMNW.js} +2 -2
- package/js/{chunk-SRB2WDU7.js → chunk-D45FU4TZ.js} +1 -1
- package/js/{chunk-UWOIEJ56.js → chunk-GHDZEEPO.js} +26 -31
- package/js/{chunk-I7CNZ4CM.js → chunk-KEZ4YZSP.js} +18 -4
- package/js/{chunk-5KNA2Z5I.js → chunk-LQBR7AI7.js} +294 -164
- package/js/{chunk-LUROQKFP.js → chunk-QQKHJ72Y.js} +18 -10
- package/js/{chunk-IA3VSGR4.js → chunk-U74JVKTQ.js} +3 -3
- package/js/{chunk-5CQMUXW7.js → chunk-UCOMVHGW.js} +2 -2
- package/js/client.js +2 -1
- package/js/contracts.js +7 -4
- package/js/effect.js +10 -9
- package/js/graphql.js +11 -10
- package/js/host.js +10 -9
- package/js/index.js +5 -4
- package/js/mcp/effect.js +12 -11
- package/js/mcp/stdio.js +12 -11
- package/js/mcp.js +13 -12
- package/js/openapi.js +9 -8
- package/js/skills/effect.js +3 -2
- package/js/skills.js +47 -33
- package/js/ui/serving.js +2 -1
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/host.d.ts +10 -6
- package/types/apps/src/contracts/mcp.d.ts +6 -1
- package/types/apps/src/contracts/openapi.d.ts +1 -1
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +8 -1
- package/types/apps/src/contracts/protocols/2.d.ts +1 -1
- package/types/apps/src/contracts/protocols/3.d.ts +1 -2
- package/types/apps/src/contracts/protocols/4.d.ts +1 -2
- package/types/apps/src/contracts/protocols/5.d.ts +3 -3
- package/types/apps/src/contracts/protocols/6.d.ts +3 -3
- package/types/apps/src/contracts/protocols/7.d.ts +3 -3
- package/types/apps/src/contracts/protocols/8.d.ts +13 -2
- package/types/apps/src/contracts/protocols/9.d.ts +1106 -0
- package/types/apps/src/contracts/skills.d.ts +5 -0
- package/types/apps/src/contracts/workflows.d.ts +6 -0
- package/types/apps/src/implementation/failure-detail.d.ts +4 -3
- package/types/apps/src/implementation/mcp-client.d.ts +1 -1
- package/types/apps/src/implementation/mcp.d.ts +1 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +2 -3
- package/types/apps/src/implementation/skills.d.ts +8 -8
- package/types/apps/src/skills.d.ts +2 -1
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/recorded-failure.d.ts +20 -0
- package/types/utils/src/api-error.d.ts +5 -0
- 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-
|
|
8
|
+
} from "./chunk-D45FU4TZ.js";
|
|
9
9
|
import {
|
|
10
10
|
folderSkillsEffect,
|
|
11
11
|
skillFromFiles
|
|
12
|
-
} from "./chunk-
|
|
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-
|
|
33
|
-
import "./chunk-
|
|
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
|
|
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
|
|
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
|
|
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) ?
|
|
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(
|
|
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: `
|
|
715
|
-
}) :
|
|
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
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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}
|
|
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) =>
|
|
799
|
-
|
|
800
|
-
|
|
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) =>
|
|
815
|
-
|
|
816
|
-
|
|
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-
|
|
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";
|