apps 0.0.1-beta.1 → 0.0.1-beta.100
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/README.md +112 -72
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/chunk-2CURR5Y7.js +264 -0
- package/js/chunk-2LSGC7XY.js +42 -0
- package/js/{chunk-YEJOQEII.js → chunk-4PIQKACY.js} +65 -10
- package/js/chunk-4UPC36ZL.js +5185 -0
- package/js/{chunk-4LPG6RCH.js → chunk-4X2UI4R2.js} +7 -27
- package/js/chunk-5C6RAGAS.js +335 -0
- package/js/chunk-62NVUKED.js +39 -0
- package/js/chunk-74H25C4X.js +95 -0
- package/js/chunk-7HG422GB.js +90 -0
- package/js/chunk-7STIP5CS.js +171 -0
- package/js/{chunk-QKHR7BMF.js → chunk-ACQXVKVQ.js} +87 -51
- package/js/{chunk-OHRT55C4.js → chunk-DILSCQPJ.js} +226 -265
- package/js/chunk-ILYCJ3HV.js +449 -0
- package/js/chunk-K6TSCYAO.js +712 -0
- package/js/{chunk-EVJUVWN2.js → chunk-KLSEU35Y.js} +463 -218
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/chunk-OWN3DP2W.js +88 -0
- package/js/{chunk-ZTFQHGEB.js → chunk-PBGPES67.js} +3 -5
- package/js/chunk-QI66R4FP.js +786 -0
- package/js/chunk-RN4YB4JT.js +1922 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-URKOTNDA.js} +795 -177
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-2HHMABB6.js → chunk-VAI3EVCS.js} +700 -78
- package/js/chunk-VCYWAA4N.js +49 -0
- package/js/{chunk-HDJH3RPR.js → chunk-YDW7DX3A.js} +4 -4
- package/js/chunk-YWVISRZD.js +268 -0
- package/js/{chunk-FW5HBOIK.js → chunk-ZKDXML77.js} +19272 -18299
- package/js/client.js +148 -100
- package/js/contracts.js +208 -24
- package/js/effect.js +18 -19
- package/js/es-DIULA3ZF.js +39371 -0
- package/js/graphql.js +62 -58
- package/js/host.js +83 -60
- package/js/index.js +381 -263
- package/js/mcp/effect.js +21 -21
- package/js/mcp.js +117 -74
- package/js/openapi.js +4613 -42691
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -4
- package/js/skills.js +233 -70
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +9 -8
- package/js/ui/serving.js +8609 -227
- package/package.json +3 -8
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +60 -2
- package/types/app-cache/src/index.d.ts +92 -2
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +63 -17
- package/types/apps/src/contracts/cache.d.ts +24 -1
- package/types/apps/src/contracts/context.d.ts +60 -17
- package/types/apps/src/contracts/elicitation.d.ts +23 -7
- package/types/apps/src/contracts/events.d.ts +94 -0
- package/types/apps/src/contracts/failure.d.ts +54 -0
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +1325 -534
- package/types/apps/src/contracts/icons.d.ts +28 -0
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +97 -20
- package/types/apps/src/contracts/network.d.ts +120 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
- package/types/apps/src/contracts/openapi-document.d.ts +1 -1
- package/types/apps/src/contracts/openapi.d.ts +51 -9
- package/types/apps/src/contracts/operations.d.ts +14 -12
- package/types/apps/src/contracts/placement.d.ts +102 -0
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +2241 -0
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
- package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
- package/types/apps/src/contracts/protocols/2.d.ts +711 -0
- package/types/apps/src/contracts/protocols/3.d.ts +776 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1306 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
- package/types/apps/src/contracts/protocols/current.d.ts +6857 -0
- package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +140 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/schedules.d.ts +7 -1
- package/types/apps/src/contracts/schema.d.ts +21 -0
- package/types/apps/src/contracts/shared-catalog.d.ts +11 -0
- package/types/apps/src/contracts/skills.d.ts +60 -14
- package/types/apps/src/contracts/sql.d.ts +63 -0
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/ui.d.ts +70 -30
- package/types/apps/src/contracts/webhooks.d.ts +24 -7
- package/types/apps/src/contracts/workflows.d.ts +89 -36
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/account-router.d.ts +13 -0
- package/types/apps/src/implementation/app.d.ts +44 -16
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/cache.d.ts +32 -3
- package/types/apps/src/implementation/catalog-cache.d.ts +43 -5
- package/types/apps/src/implementation/elicitation.d.ts +18 -15
- package/types/apps/src/implementation/events.d.ts +64 -0
- package/types/apps/src/implementation/failure-detail.d.ts +48 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/input-problems.d.ts +6 -2
- package/types/apps/src/implementation/invocation-timing.d.ts +18 -0
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- package/types/apps/src/implementation/mcp-client.d.ts +49 -25
- package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
- package/types/apps/src/implementation/mcp.d.ts +52 -25
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +30 -8
- package/types/apps/src/implementation/openapi-document.d.ts +46 -21
- package/types/apps/src/implementation/openapi-names.d.ts +23 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -3
- package/types/apps/src/implementation/openapi-source.d.ts +30 -8
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +84 -10
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/placement.d.ts +60 -0
- package/types/apps/src/implementation/protocol-operations.d.ts +6 -4
- package/types/apps/src/implementation/provider-error.d.ts +28 -1
- package/types/apps/src/implementation/provider.d.ts +26 -6
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +227 -0
- package/types/apps/src/implementation/router.d.ts +78 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schedules.d.ts +39 -8
- package/types/apps/src/implementation/schema.d.ts +111 -15
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +71 -0
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +12 -6
- package/types/apps/src/implementation/ui-client.d.ts +3 -3
- package/types/apps/src/implementation/ui-document.d.ts +5 -0
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +31 -12
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +7 -0
- package/types/apps/src/implementation/webhooks.d.ts +15 -6
- package/types/apps/src/implementation/workflow-context.d.ts +17 -5
- package/types/apps/src/implementation/workflows.d.ts +11 -4
- package/types/apps/src/index.d.ts +71 -21
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +11 -6
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +13 -8
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/apps/src/ui-serving.d.ts +1 -1
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +7 -4
- package/types/telemetry/src/browser.d.ts +8 -3
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/index.d.ts +2 -1
- package/types/telemetry/src/layer.d.ts +10 -4
- package/types/telemetry/src/measurements.d.ts +1 -1
- package/types/telemetry/src/ownership.d.ts +60 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +16 -6
- package/types/telemetry/src/span-attributes.d.ts +17 -1
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +55 -0
- package/types/utils/src/connection-failure.d.ts +33 -0
- package/types/utils/src/legacy-keys.d.ts +20 -0
- package/types/utils/src/recorded-message.d.ts +18 -0
- package/types/utils/src/schema-definitions.d.ts +13 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-6IIO4NPI.js +0 -29
- package/js/chunk-6YBRWRK3.js +0 -160
- package/js/chunk-BMOIAIVR.js +0 -138
- package/js/chunk-FZJOYIZO.js +0 -19
- package/js/chunk-G7IE6BKC.js +0 -224
- package/js/chunk-IHQ4ML7K.js +0 -2193
- package/js/chunk-KOXMLKTM.js +0 -1288
- package/js/chunk-M6ZRRIBI.js +0 -877
- package/js/chunk-PLCMJREA.js +0 -590
- package/js/chunk-PZ36XMXW.js +0 -93
- package/js/chunk-RBAC33PQ.js +0 -267
- package/js/chunk-SATWJKN6.js +0 -34
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- package/js/chunk-X7SFGU4Q.js +0 -280
- package/js/chunk-ZJWDMTE3.js +0 -63
- package/js/mcp/stdio.js +0 -128
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -33
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
- package/types/apps/src/implementation/mcp-stdio.d.ts +0 -4
- package/types/apps/src/implementation/storage.d.ts +0 -13
- package/types/apps/src/mcp-stdio.d.ts +0 -8
package/js/react.js
CHANGED
|
@@ -2,11 +2,10 @@ import {
|
|
|
2
2
|
AsyncResult_exports,
|
|
3
3
|
AtomRegistry_exports,
|
|
4
4
|
queryCommitted
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-M6ZRRIBI.js";
|
|
5
|
+
} from "./chunk-KLSEU35Y.js";
|
|
7
6
|
import {
|
|
8
7
|
Option_exports
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZKDXML77.js";
|
|
10
9
|
import "./chunk-CZ7CSFO4.js";
|
|
11
10
|
|
|
12
11
|
// src/react.ts
|
package/js/skills/effect.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
folderSkillsEffect,
|
|
3
3
|
skillFromFiles
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-PBGPES67.js";
|
|
5
|
+
import "../chunk-4PIQKACY.js";
|
|
6
|
+
import "../chunk-OWN3DP2W.js";
|
|
7
|
+
import "../chunk-DILSCQPJ.js";
|
|
8
|
+
import "../chunk-ACQXVKVQ.js";
|
|
9
|
+
import "../chunk-ZKDXML77.js";
|
|
8
10
|
import "../chunk-CZ7CSFO4.js";
|
|
9
11
|
export {
|
|
10
12
|
folderSkillsEffect,
|
package/js/skills.js
CHANGED
|
@@ -1,38 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catalogCache,
|
|
3
|
+
catalogScope
|
|
4
|
+
} from "./chunk-YWVISRZD.js";
|
|
5
|
+
import "./chunk-5C6RAGAS.js";
|
|
6
|
+
import {
|
|
7
|
+
failOnNetworkRefusal
|
|
8
|
+
} from "./chunk-VCYWAA4N.js";
|
|
1
9
|
import {
|
|
2
10
|
folderSkillsEffect,
|
|
3
11
|
skillFromFiles
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-NCYXZN2G.js";
|
|
12
|
+
} from "./chunk-PBGPES67.js";
|
|
6
13
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
accountProviderError,
|
|
15
|
+
fromPromise,
|
|
16
|
+
httpProviderError,
|
|
17
|
+
method,
|
|
18
|
+
toPromise
|
|
19
|
+
} from "./chunk-7STIP5CS.js";
|
|
20
|
+
import {
|
|
21
|
+
NetworkRefused,
|
|
22
|
+
ProviderError,
|
|
23
|
+
networkRefusalStatus
|
|
24
|
+
} from "./chunk-4UPC36ZL.js";
|
|
9
25
|
import {
|
|
10
26
|
AppSkillMetadata,
|
|
27
|
+
AppSkillSource,
|
|
11
28
|
AppSkills,
|
|
12
29
|
SkillDefinitionInvalid,
|
|
13
30
|
SkillFilePath,
|
|
14
31
|
SkillLoadFailed,
|
|
15
32
|
SkillServiceName,
|
|
16
33
|
skillLoadLimits
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import
|
|
34
|
+
} from "./chunk-4PIQKACY.js";
|
|
35
|
+
import {
|
|
36
|
+
wrap
|
|
37
|
+
} from "./chunk-VAI3EVCS.js";
|
|
38
|
+
import "./chunk-URKOTNDA.js";
|
|
19
39
|
import {
|
|
20
40
|
FetchHttpClient_exports
|
|
21
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-YDW7DX3A.js";
|
|
42
|
+
import "./chunk-OWN3DP2W.js";
|
|
43
|
+
import "./chunk-7HG422GB.js";
|
|
44
|
+
import "./chunk-DILSCQPJ.js";
|
|
22
45
|
import {
|
|
23
46
|
HttpBody_exports,
|
|
24
47
|
HttpClient_exports
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import {
|
|
27
|
-
wrap
|
|
28
|
-
} from "./chunk-2HHMABB6.js";
|
|
29
|
-
import "./chunk-SATWJKN6.js";
|
|
48
|
+
} from "./chunk-ACQXVKVQ.js";
|
|
30
49
|
import {
|
|
50
|
+
Base64_exports,
|
|
31
51
|
Effect_exports,
|
|
52
|
+
Hex_exports,
|
|
32
53
|
Ref_exports,
|
|
33
54
|
Schema_exports,
|
|
34
55
|
Stream_exports
|
|
35
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-ZKDXML77.js";
|
|
36
57
|
import "./chunk-CZ7CSFO4.js";
|
|
37
58
|
|
|
38
59
|
// src/implementation/inflate.ts
|
|
@@ -588,13 +609,15 @@ var describe = (service, { reason, status }) => {
|
|
|
588
609
|
};
|
|
589
610
|
var withService = (service) => (effect) => service === void 0 || !Schema_exports.is(SkillServiceName)(service) ? effect : effect.pipe(
|
|
590
611
|
Effect_exports.mapError(
|
|
591
|
-
(error) => !error.message ? new SkillLoadFailed({
|
|
612
|
+
(error) => Schema_exports.is(SkillLoadFailed)(error) && !error.message ? new SkillLoadFailed({
|
|
592
613
|
reason: error.reason,
|
|
593
614
|
message: describe(service, error),
|
|
594
|
-
...error.status === void 0 ? {} : { status: error.status }
|
|
615
|
+
...error.status === void 0 ? {} : { status: error.status },
|
|
616
|
+
...error.missing === void 0 ? {} : { missing: error.missing }
|
|
595
617
|
}) : error
|
|
596
618
|
)
|
|
597
619
|
);
|
|
620
|
+
var loaderFailure = (error, otherwise) => Schema_exports.is(SkillLoadFailed)(error) || Schema_exports.is(NetworkRefused)(error) ? error : otherwise();
|
|
598
621
|
var parse = (schema, input) => Schema_exports.decodeUnknownEffect(schema)(input).pipe(Effect_exports.mapError(() => failed("document")));
|
|
599
622
|
var resourcePath = (path) => {
|
|
600
623
|
if (!Schema_exports.is(SkillFilePath)(path)) return false;
|
|
@@ -610,23 +633,31 @@ var resourcePath = (path) => {
|
|
|
610
633
|
var pathUrl = (base, path) => new URL(path.split("/").map(encodeURIComponent).join("/"), base).href;
|
|
611
634
|
var reader = (transport) => Effect_exports.gen(function* () {
|
|
612
635
|
const budget = yield* Ref_exports.make(0);
|
|
613
|
-
const fetchBytes = (url,
|
|
636
|
+
const fetchBytes = (url, request = {}) => Effect_exports.gen(function* () {
|
|
614
637
|
const parsed = yield* Effect_exports.try({
|
|
615
638
|
try: () => new URL(url),
|
|
616
639
|
catch: () => failed("source")
|
|
617
640
|
});
|
|
618
641
|
if (!["https:", "http:"].includes(parsed.protocol) || parsed.username || parsed.password || parsed.hash)
|
|
619
642
|
return yield* failed("source");
|
|
643
|
+
const refusal = request.refused ?? ((refused) => refused);
|
|
620
644
|
const client = HttpClient_exports.withScope(yield* HttpClient_exports.HttpClient);
|
|
621
645
|
const headers = {
|
|
622
646
|
"User-Agent": "executor-skills",
|
|
623
647
|
Accept: "application/json, text/plain",
|
|
624
|
-
"Cache-Control": "no-cache"
|
|
648
|
+
"Cache-Control": "no-cache",
|
|
649
|
+
...request.headers
|
|
625
650
|
};
|
|
626
|
-
const response = yield* (
|
|
627
|
-
headers
|
|
628
|
-
body: HttpBody_exports.uint8Array(
|
|
629
|
-
})).pipe(
|
|
651
|
+
const response = yield* (request.body === void 0 ? client.get(parsed, { headers }) : client.post(parsed, {
|
|
652
|
+
headers,
|
|
653
|
+
body: HttpBody_exports.uint8Array(request.body, request.headers?.["Content-Type"])
|
|
654
|
+
})).pipe(
|
|
655
|
+
// `ctx.fetch` rejects with a network refusal; any other failed request got no answer.
|
|
656
|
+
Effect_exports.mapError(
|
|
657
|
+
(error) => Schema_exports.is(NetworkRefused)(error.cause) ? refusal(error.cause) : failed("request")
|
|
658
|
+
)
|
|
659
|
+
);
|
|
660
|
+
yield* failOnNetworkRefusal(response).pipe(Effect_exports.mapError(refusal));
|
|
630
661
|
if (response.status < 200 || response.status >= 300)
|
|
631
662
|
return yield* rejected(response.status, response.headers);
|
|
632
663
|
const chunks = [];
|
|
@@ -656,7 +687,7 @@ var reader = (transport) => Effect_exports.gen(function* () {
|
|
|
656
687
|
Effect_exports.provideService(FetchHttpClient_exports.RequestInit, { redirect: "manual" }),
|
|
657
688
|
Effect_exports.provideService(FetchHttpClient_exports.Fetch, transport.fetch ?? globalThis.fetch)
|
|
658
689
|
);
|
|
659
|
-
const read = (url) => fetchBytes(url).pipe(
|
|
690
|
+
const read = (url, request = {}) => fetchBytes(url, request).pipe(
|
|
660
691
|
Effect_exports.flatMap(
|
|
661
692
|
(result) => Effect_exports.try({
|
|
662
693
|
try: () => new TextDecoder("utf-8", { fatal: true }).decode(result),
|
|
@@ -671,39 +702,68 @@ var unreadable = () => new SkillLoadFailed({
|
|
|
671
702
|
reason: "request",
|
|
672
703
|
message: "GitHub returned a git response Executor could not read."
|
|
673
704
|
});
|
|
674
|
-
var git = (run) =>
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
705
|
+
var git = (run) => (
|
|
706
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- this module's git parsing
|
|
707
|
+
Effect_exports.tryPromise({
|
|
708
|
+
try: async () => run(),
|
|
709
|
+
catch: (error) => error instanceof InflateLimitExceeded ? failed("limit") : unreadable()
|
|
710
|
+
})
|
|
711
|
+
);
|
|
712
|
+
var githubHosts = ["github.com", "raw.githubusercontent.com"];
|
|
713
|
+
var githubRequests = (remote, repo, token) => {
|
|
714
|
+
const refused = (host) => (refusal) => refusal.refusal.reason === "credential_host" ? new SkillLoadFailed({
|
|
715
|
+
reason: "source",
|
|
716
|
+
status: networkRefusalStatus,
|
|
717
|
+
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.`
|
|
718
|
+
}) : refusal;
|
|
719
|
+
const upload = (body) => remote.fetchBytes(`https://${githubHosts[0]}/${repo}.git/git-upload-pack`, {
|
|
720
|
+
body,
|
|
721
|
+
headers: {
|
|
722
|
+
...gitRequestHeaders,
|
|
723
|
+
...token === void 0 ? {} : { Authorization: `Basic ${Base64_exports.encode(`x-access-token:${token}`)}` }
|
|
724
|
+
},
|
|
725
|
+
refused: refused(githubHosts[0])
|
|
726
|
+
});
|
|
727
|
+
const file = (commit, path) => remote.read(pathUrl(`https://${githubHosts[1]}/${repo}/${commit}/`, path), {
|
|
728
|
+
...token === void 0 ? {} : { headers: { Authorization: `token ${token}` } },
|
|
729
|
+
refused: refused(githubHosts[1])
|
|
730
|
+
});
|
|
731
|
+
return { repo, authenticated: token !== void 0, upload, file };
|
|
732
|
+
};
|
|
733
|
+
var resolveCommit = (github, ref) => Effect_exports.gen(function* () {
|
|
734
|
+
const { repo } = github;
|
|
679
735
|
if (ref !== void 0 && /^[a-f0-9]{40}$/.test(ref)) return ref;
|
|
680
736
|
const names = refCandidates(ref);
|
|
681
|
-
const response = yield*
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
737
|
+
const response = yield* github.upload(lsRefsRequest(names)).pipe(
|
|
738
|
+
Effect_exports.mapError((error) => {
|
|
739
|
+
if (!Schema_exports.is(SkillLoadFailed)(error) || error.reason !== "request") return error;
|
|
740
|
+
if (!github.authenticated && (error.status === 404 || error.status === 401))
|
|
741
|
+
return new SkillLoadFailed({
|
|
742
|
+
reason: "source",
|
|
743
|
+
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.`,
|
|
744
|
+
status: error.status,
|
|
745
|
+
missing: "repository"
|
|
746
|
+
});
|
|
747
|
+
if (github.authenticated && error.status === 404)
|
|
748
|
+
return new SkillLoadFailed({
|
|
749
|
+
reason: "request",
|
|
750
|
+
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.`,
|
|
751
|
+
status: error.status
|
|
752
|
+
});
|
|
753
|
+
return error;
|
|
754
|
+
})
|
|
693
755
|
);
|
|
694
756
|
const refs = yield* git(() => parseLsRefs(response));
|
|
695
757
|
const commit = names.map((name) => refs.get(name)).find((sha) => sha !== void 0);
|
|
696
758
|
if (commit === void 0)
|
|
697
759
|
return yield* new SkillLoadFailed({
|
|
698
760
|
reason: "source",
|
|
699
|
-
message: `GitHub repository ${repo}
|
|
761
|
+
message: `The refs read from GitHub repository ${repo} include no branch or tag named ${ref}.`,
|
|
762
|
+
missing: "ref"
|
|
700
763
|
});
|
|
701
764
|
return commit;
|
|
702
765
|
});
|
|
703
|
-
var listFiles = (
|
|
704
|
-
body: treeFetchRequest(commit),
|
|
705
|
-
headers: gitRequestHeaders
|
|
706
|
-
}).pipe(
|
|
766
|
+
var listFiles = (github, commit, path) => github.upload(treeFetchRequest(commit)).pipe(
|
|
707
767
|
Effect_exports.flatMap(
|
|
708
768
|
(response) => git(
|
|
709
769
|
() => parseTreeFetch(response, commit, path, { objectBytes: skillLoadLimits.fileBytes })
|
|
@@ -716,8 +776,8 @@ var SkillDirectories = Schema_exports.Array(
|
|
|
716
776
|
files: Schema_exports.Array(Schema_exports.Struct({ path: Schema_exports.String, mode: Schema_exports.String }))
|
|
717
777
|
})
|
|
718
778
|
);
|
|
719
|
-
var skillDirectories = (
|
|
720
|
-
const files = yield* listFiles(
|
|
779
|
+
var skillDirectories = (github, commit, path) => Effect_exports.gen(function* () {
|
|
780
|
+
const files = yield* listFiles(github, commit, path);
|
|
721
781
|
const documents = files.filter(
|
|
722
782
|
(file) => file.path === "SKILL.md" || file.path.endsWith("/SKILL.md")
|
|
723
783
|
);
|
|
@@ -729,30 +789,122 @@ var skillDirectories = (remote, repo, commit, path) => Effect_exports.gen(functi
|
|
|
729
789
|
return yield* failed("limit");
|
|
730
790
|
return directories;
|
|
731
791
|
});
|
|
732
|
-
var cachedSkillDirectories = (cache,
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
792
|
+
var cachedSkillDirectories = (cache, transport, options, commit) => fromPromise(
|
|
793
|
+
method(cache, "get"),
|
|
794
|
+
"cache"
|
|
795
|
+
)({
|
|
796
|
+
key: ["apps/githubSkills/directories", 1, options.repo, commit, options.path ?? null],
|
|
797
|
+
schema: wrap(SkillDirectories, false),
|
|
798
|
+
freshFor: "7 days",
|
|
799
|
+
// Executor's own loader: the app's cache runs it natively, so only its requests are upstream.
|
|
800
|
+
load: toPromise(
|
|
801
|
+
(context) => (
|
|
802
|
+
// Keep the author's fetch and this read's token, as every other request in it does.
|
|
803
|
+
reader({ fetch: transport.fetch, signal: context.signal }).pipe(
|
|
804
|
+
Effect_exports.flatMap(
|
|
805
|
+
(remote) => skillDirectories(
|
|
806
|
+
githubRequests(remote, options.repo, options.token),
|
|
807
|
+
commit,
|
|
808
|
+
options.path
|
|
809
|
+
)
|
|
810
|
+
)
|
|
811
|
+
)
|
|
812
|
+
),
|
|
813
|
+
// A cache may call the loader as a Promise; its own signal cancels that load.
|
|
814
|
+
(context) => context.signal
|
|
815
|
+
)
|
|
816
|
+
}).pipe(
|
|
817
|
+
Effect_exports.mapError(
|
|
818
|
+
(error) => loaderFailure(
|
|
819
|
+
error,
|
|
820
|
+
() => new SkillLoadFailed({
|
|
821
|
+
reason: "request",
|
|
822
|
+
message: "Executor could not read or update the app cache for skills."
|
|
823
|
+
})
|
|
742
824
|
)
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
825
|
+
)
|
|
826
|
+
);
|
|
827
|
+
var digest = (value) => (
|
|
828
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- Web Crypto
|
|
829
|
+
Effect_exports.promise(
|
|
830
|
+
() => crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(value)))
|
|
831
|
+
).pipe(Effect_exports.map((bytes) => Hex_exports.encode(new Uint8Array(bytes))))
|
|
832
|
+
);
|
|
833
|
+
var checked = (request) => request.pipe(
|
|
834
|
+
Effect_exports.timeoutOrElse({
|
|
835
|
+
duration: skillLoadLimits.checkMillis,
|
|
836
|
+
orElse: () => Effect_exports.fail(failed("request"))
|
|
747
837
|
})
|
|
748
|
-
|
|
838
|
+
);
|
|
839
|
+
var cachedCatalog = (options, prefix, publication) => options.cache === void 0 ? publication(options, void 0).pipe(Effect_exports.flatMap((source) => source.load)) : catalogCache({
|
|
840
|
+
cache: options.cache,
|
|
841
|
+
...options.freshFor === void 0 ? {} : { freshFor: options.freshFor },
|
|
842
|
+
...options.staleFor === void 0 ? {} : { staleFor: options.staleFor },
|
|
843
|
+
stale: "revalidate",
|
|
844
|
+
prefix,
|
|
845
|
+
schema: AppSkillSource,
|
|
846
|
+
summary: { schema: AppSkillMetadata, of: ({ files: _files, ...metadata }) => metadata },
|
|
847
|
+
load: (context, kept) => Effect_exports.gen(function* () {
|
|
848
|
+
const source = yield* context === void 0 ? publication(options, options.cache) : publication({ fetch: options.fetch, signal: context.signal }, context.cache);
|
|
849
|
+
if (source.id === void 0) return { tools: yield* source.load };
|
|
850
|
+
const previous = kept === void 0 ? void 0 : yield* kept;
|
|
851
|
+
const tools = previous?.header?.["publication"] === source.id ? yield* previous.tools : yield* source.load;
|
|
852
|
+
return { tools, header: { publication: source.id } };
|
|
853
|
+
})
|
|
854
|
+
}).pipe(
|
|
855
|
+
Effect_exports.flatMap((catalog) => catalog.list()),
|
|
856
|
+
Effect_exports.mapError(
|
|
857
|
+
(error) => loaderFailure(
|
|
858
|
+
error,
|
|
859
|
+
() => new SkillLoadFailed({
|
|
860
|
+
reason: "request",
|
|
861
|
+
message: "Executor could not read or update the app cache for skills."
|
|
862
|
+
})
|
|
863
|
+
)
|
|
864
|
+
)
|
|
865
|
+
);
|
|
866
|
+
var GitHubToken = Schema_exports.String.check(Schema_exports.isPattern(/^[\x21-\x7e]+$/u));
|
|
867
|
+
var scopeMessages = {
|
|
868
|
+
"missing-account": "A GitHub token needs its account. Pass account: ctx.user.accounts.<slot> or ctx.app.accounts.<slot> with it.",
|
|
869
|
+
"unselected-account": "The GitHub account is not one of this app's selected accounts."
|
|
870
|
+
};
|
|
871
|
+
var githubCache = (options) => options.account !== void 0 && !Schema_exports.is(GitHubToken)(options.token) ? Effect_exports.fail(
|
|
872
|
+
new SkillLoadFailed({
|
|
873
|
+
reason: "source",
|
|
874
|
+
message: "The GitHub account was passed without a valid token."
|
|
875
|
+
})
|
|
876
|
+
) : catalogScope(
|
|
877
|
+
options,
|
|
878
|
+
options.token,
|
|
879
|
+
(problem) => new SkillLoadFailed({ reason: "source", message: scopeMessages[problem] })
|
|
880
|
+
);
|
|
881
|
+
var attributed = (account) => (error) => account !== void 0 && Schema_exports.is(SkillLoadFailed)(error) && error.reason === "request" && (error.status === 401 || error.status === 403) ? accountProviderError(
|
|
882
|
+
new ProviderError({
|
|
883
|
+
reason: error.status === 401 ? "unauthorized" : "rejected",
|
|
884
|
+
status: error.status
|
|
885
|
+
}),
|
|
886
|
+
account.id
|
|
887
|
+
) : error;
|
|
749
888
|
var githubSkillsEffect = (options) => Effect_exports.gen(function* () {
|
|
750
889
|
if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(options.repo) || options.path !== void 0 && !resourcePath(options.path))
|
|
751
890
|
return yield* failed("source");
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
891
|
+
const cache = yield* githubCache(options);
|
|
892
|
+
return yield* cachedCatalog(
|
|
893
|
+
cache === void 0 ? options : { ...options, cache },
|
|
894
|
+
["apps/githubSkills/catalog", 1, options.repo, options.ref ?? null, options.path ?? null],
|
|
895
|
+
(transport, cache2) => githubPublication(options, transport, cache2)
|
|
896
|
+
);
|
|
897
|
+
}).pipe(withService("GitHub"), Effect_exports.mapError(attributed(options.account)));
|
|
898
|
+
var githubPublication = (options, transport, cache) => Effect_exports.gen(function* () {
|
|
899
|
+
const github = githubRequests(yield* reader(transport), options.repo, options.token);
|
|
900
|
+
const commit = yield* checked(resolveCommit(github, options.ref));
|
|
901
|
+
return {
|
|
902
|
+
id: commit,
|
|
903
|
+
load: githubCatalog(options, github, commit, transport, cache)
|
|
904
|
+
};
|
|
905
|
+
});
|
|
906
|
+
var githubCatalog = (options, github, commit, transport, cache) => Effect_exports.gen(function* () {
|
|
907
|
+
const resources = yield* cache === void 0 ? skillDirectories(github, commit, options.path) : cachedSkillDirectories(cache, transport, options, commit);
|
|
756
908
|
const skills = yield* Effect_exports.forEach(
|
|
757
909
|
resources,
|
|
758
910
|
({ directory, files }) => Effect_exports.gen(function* () {
|
|
@@ -762,7 +914,7 @@ var githubSkillsEffect = (options) => Effect_exports.gen(function* () {
|
|
|
762
914
|
const path = file.path.slice(directory.length);
|
|
763
915
|
if (!resourcePath(file.path) || !resourcePath(path) || file.mode === "120000")
|
|
764
916
|
return yield* failed("source");
|
|
765
|
-
return { path, content: yield*
|
|
917
|
+
return { path, content: yield* github.file(commit, file.path) };
|
|
766
918
|
}),
|
|
767
919
|
{ concurrency: skillLoadLimits.concurrency }
|
|
768
920
|
);
|
|
@@ -775,7 +927,7 @@ var githubSkillsEffect = (options) => Effect_exports.gen(function* () {
|
|
|
775
927
|
{ concurrency: 1 }
|
|
776
928
|
);
|
|
777
929
|
return yield* parse(AppSkills, skills);
|
|
778
|
-
})
|
|
930
|
+
});
|
|
779
931
|
var Index = Schema_exports.Struct({
|
|
780
932
|
skills: Schema_exports.Array(
|
|
781
933
|
Schema_exports.Struct({
|
|
@@ -793,9 +945,20 @@ var wellKnownSkillsEffect = (options) => Effect_exports.gen(function* () {
|
|
|
793
945
|
if (url.pathname === "/") url.pathname = "/.well-known/agent-skills/index.json";
|
|
794
946
|
else if (!url.pathname.endsWith("index.json"))
|
|
795
947
|
url.pathname = `${url.pathname.replace(/\/$/, "")}/index.json`;
|
|
796
|
-
|
|
797
|
-
|
|
948
|
+
return yield* cachedCatalog(
|
|
949
|
+
options,
|
|
950
|
+
["apps/wellKnownSkills/catalog", 1, url.href],
|
|
951
|
+
(transport) => wellKnownPublication(url, transport)
|
|
952
|
+
);
|
|
953
|
+
}).pipe(withService(URL.canParse(options.url) ? new URL(options.url).hostname : void 0));
|
|
954
|
+
var wellKnownPublication = (url, transport) => Effect_exports.gen(function* () {
|
|
955
|
+
const remote = yield* reader(transport);
|
|
956
|
+
const first = yield* checked(remote.read(url.href));
|
|
798
957
|
const index = yield* parse(Schema_exports.fromJsonString(Index), first);
|
|
958
|
+
const id = index.skills.every((skill) => skill.version !== void 0) ? yield* digest(index.skills.map(({ name, version, files }) => [name, version, files])) : void 0;
|
|
959
|
+
return { id, load: wellKnownCatalog(url, remote, first, index) };
|
|
960
|
+
});
|
|
961
|
+
var wellKnownCatalog = (url, remote, first, index) => Effect_exports.gen(function* () {
|
|
799
962
|
if (index.skills.reduce((count, skill) => count + skill.files.length, 0) > skillLoadLimits.files)
|
|
800
963
|
return yield* failed("limit");
|
|
801
964
|
const skills = yield* Effect_exports.forEach(
|
|
@@ -818,7 +981,7 @@ var wellKnownSkillsEffect = (options) => Effect_exports.gen(function* () {
|
|
|
818
981
|
);
|
|
819
982
|
if ((yield* remote.read(url.href)) !== first) return yield* failed("changed");
|
|
820
983
|
return yield* parse(AppSkills, skills);
|
|
821
|
-
})
|
|
984
|
+
});
|
|
822
985
|
|
|
823
986
|
// src/skills.ts
|
|
824
987
|
var githubSkills = (options) => Effect_exports.runPromise(
|