apps 0.0.1-beta.32 → 0.0.1-beta.34
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-W7F23NQ2.js → chunk-5OM6HBNU.js} +11 -9
- package/js/{chunk-N72RKJ5E.js → chunk-DSUKW6KJ.js} +1 -92
- package/js/{chunk-5DLG2FVN.js → chunk-DXGWKNTQ.js} +91 -0
- package/js/chunk-EPUWF4ZG.js +49 -0
- package/js/{chunk-4OKYLVU4.js → chunk-IU6OK5G2.js} +1 -1
- package/js/{chunk-GG566OOE.js → chunk-MYH3QZ4L.js} +6 -6
- package/js/{chunk-NPGRURDG.js → chunk-O3OAFU7Q.js} +20 -3
- package/js/{chunk-RULZPNGP.js → chunk-O4QOPXQT.js} +8 -47
- package/js/{chunk-WG5DFZFT.js → chunk-PUBNIORL.js} +2 -2
- package/js/{chunk-AYM2FUI5.js → chunk-Q7Q5JTRW.js} +1 -1
- package/js/{chunk-3FJYVAE4.js → chunk-QKVZGWGZ.js} +5 -5
- package/js/{chunk-5XJR4XGW.js → chunk-QUEPZ67T.js} +6 -5
- package/js/{chunk-FULRJSWU.js → chunk-QZD2RZ4S.js} +6 -5
- package/js/{chunk-BGALSHLT.js → chunk-UKMIHP2G.js} +9 -6
- package/js/client.js +1 -1
- package/js/contracts.js +9 -9
- package/js/effect.js +10 -9
- package/js/graphql.js +14 -14
- package/js/host.js +10 -9
- package/js/index.js +8 -8
- package/js/mcp/effect.js +12 -11
- package/js/mcp/stdio.js +12 -11
- package/js/mcp.js +15 -14
- package/js/openapi.js +11 -9
- package/js/skills.js +110 -42
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/cache.d.ts +14 -0
- package/types/apps/src/contracts/skills.d.ts +16 -4
- package/types/apps/src/implementation/catalog-cache.d.ts +14 -17
- package/types/apps/src/implementation/schema.d.ts +5 -0
- package/types/apps/src/implementation/skills.d.ts +13 -19
- package/types/apps/src/skills.d.ts +4 -3
|
@@ -37,6 +37,20 @@ export interface AppCache {
|
|
|
37
37
|
readonly id: string;
|
|
38
38
|
}) => AppCache;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A credential a remote read sends, and the account it belongs to. A public source takes neither.
|
|
42
|
+
* A credential comes only with its account, so the read is cached in that account's scope.
|
|
43
|
+
*/
|
|
44
|
+
export type AccountCredential<Credential extends object> = ({
|
|
45
|
+
readonly account?: undefined;
|
|
46
|
+
} & {
|
|
47
|
+
readonly [Field in keyof Credential]?: undefined;
|
|
48
|
+
}) | ({
|
|
49
|
+
/** The selected account, as `accounts.<slot>` provides it. */
|
|
50
|
+
readonly account: {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
};
|
|
53
|
+
} & Credential);
|
|
40
54
|
/** Trusted storage and background ownership; never accepted from request JSON. */
|
|
41
55
|
export interface HostCache {
|
|
42
56
|
readonly transport: CacheTransport;
|
|
@@ -115,14 +115,26 @@ export interface SkillCacheOptions {
|
|
|
115
115
|
readonly staleFor?: import("effect").Duration.Input;
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
118
|
+
* Whose access reads the repository. A public repository needs neither field. A private one takes
|
|
119
|
+
* a GitHub account and its token, sent on every request of this read. The token comes only with
|
|
120
|
+
* its account, so the catalog is cached in that account's scope and failures name the account.
|
|
120
121
|
*/
|
|
121
|
-
export
|
|
122
|
+
export type GitHubSkillsAccount = import("./cache.js").AccountCredential<{
|
|
123
|
+
/**
|
|
124
|
+
* The account's token or its handle, such as `account.fields.token`. Its provider declares
|
|
125
|
+
* hosts `github.com` and `raw.githubusercontent.com`, so app code never holds the value.
|
|
126
|
+
*/
|
|
127
|
+
readonly token: string;
|
|
128
|
+
}>;
|
|
129
|
+
/**
|
|
130
|
+
* A GitHub repository and an optional immutable commit, tag or branch. With a cache, a branch or
|
|
131
|
+
* tag is resolved again when the catalog refreshes, and each commit's file list is kept.
|
|
132
|
+
*/
|
|
133
|
+
export type GitHubSkillsOptions = SkillTransport & SkillCacheOptions & GitHubSkillsAccount & {
|
|
122
134
|
readonly repo: string;
|
|
123
135
|
readonly path?: string;
|
|
124
136
|
readonly ref?: string;
|
|
125
|
-
}
|
|
137
|
+
};
|
|
126
138
|
/** A published directory index, including its listed skill documents and text references. */
|
|
127
139
|
export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {
|
|
128
140
|
readonly url: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Duration, Effect, Schema } from "effect";
|
|
2
|
-
import type { AppCache, CacheLoadContext } from "../contracts/cache.js";
|
|
2
|
+
import type { AccountCredential, AppCache, CacheLoadContext } from "../contracts/cache.js";
|
|
3
3
|
import { JsonObject, type JsonValue } from "../contracts/schema.js";
|
|
4
4
|
export interface CatalogCacheOptions {
|
|
5
5
|
/** The app's cache. An account's catalog is kept in that account's scope. */
|
|
@@ -11,27 +11,24 @@ export interface CatalogCacheOptions {
|
|
|
11
11
|
/** Await a fresh revision at an explicit logical connection or refresh boundary. */
|
|
12
12
|
readonly revalidate?: boolean;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
* come only with the account they belong to, so an authenticated catalog always has its account.
|
|
17
|
-
*/
|
|
18
|
-
export type CatalogAccount = {
|
|
19
|
-
readonly account?: undefined;
|
|
20
|
-
readonly headers?: undefined;
|
|
21
|
-
} | {
|
|
22
|
-
/** The selected account, as `accounts.<slot>` provides it. */
|
|
23
|
-
readonly account: {
|
|
24
|
-
readonly id: string;
|
|
25
|
-
};
|
|
14
|
+
/** Whose catalog a remote router reads, and the headers, such as credentials, it sends. */
|
|
15
|
+
export type CatalogAccount = AccountCredential<{
|
|
26
16
|
/** Headers for this account's requests, such as its credentials. */
|
|
27
17
|
readonly headers?: Readonly<Record<string, string>>;
|
|
28
|
-
}
|
|
18
|
+
}>;
|
|
19
|
+
/** Why a read cannot use its account's scope. */
|
|
20
|
+
export type CatalogScopeProblem = "missing-account" | "unselected-account";
|
|
29
21
|
/**
|
|
30
22
|
* The cache an account's catalog lives in: the account's own scope, which token renewals keep.
|
|
31
|
-
*
|
|
32
|
-
* given,
|
|
23
|
+
* `credential` is what the read sends, such as headers or a token; it never enters a key. A
|
|
24
|
+
* credential without an account, or an account the app was not given, fails with `invalid`.
|
|
33
25
|
*/
|
|
34
|
-
export declare const catalogScope: <E>(options:
|
|
26
|
+
export declare const catalogScope: <E>(options: {
|
|
27
|
+
readonly cache?: AppCache | undefined;
|
|
28
|
+
readonly account?: {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
}, credential: unknown, invalid: (problem: CatalogScopeProblem) => E) => Effect.Effect<AppCache | undefined, E>;
|
|
35
32
|
/** One load: the tools, and optionally a record describing the whole catalog. */
|
|
36
33
|
export interface CatalogLoad<A> {
|
|
37
34
|
readonly tools: readonly A[];
|
|
@@ -38,6 +38,11 @@ export interface ObjectSchema<F extends Fields> extends Schema<ObjectValue<F>> {
|
|
|
38
38
|
export declare const decoderOf: <T>(schema: Schema<T, boolean>) => EffectSchema.Decoder<T>;
|
|
39
39
|
/** Recognize schemas made by this author facade when adapting a definition. */
|
|
40
40
|
export declare const isSchema: (value: unknown) => value is Schema<unknown, boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Source that skipped type checking can pass any value where a schema belongs, such as `string`
|
|
43
|
+
* for `string()`. Name the argument and the mistake before a native constructor reads it.
|
|
44
|
+
*/
|
|
45
|
+
export declare const schemaArgument: <S extends Schema<unknown, boolean>>(value: S, role: string) => S;
|
|
41
46
|
/** Decode within an Effect program. Invalid input is omitted from the failure. */
|
|
42
47
|
export declare const parse: <T>(decoder: EffectSchema.Decoder<T>, input: unknown) => Effect.Effect<T, ValidationError>;
|
|
43
48
|
/** Present a native decoder through the synchronous author API. */
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
/** Remote skill readers return complete portable bundles, never installed host files. */
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import {
|
|
3
|
+
import { NetworkRefused } from "../contracts/network.js";
|
|
4
|
+
import { ProviderError } from "../contracts/provider-error.js";
|
|
5
|
+
import { AppSkills, SkillLoadFailed, type GitHubSkillsOptions, type WellKnownSkillsOptions, type SkillTransport } from "../contracts/skills.js";
|
|
4
6
|
/** Give every failure without a message one that names the service. */
|
|
5
7
|
export declare const withService: (service: string | undefined) => <A, R>(effect: Effect.Effect<A, SkillLoadFailed, R>) => Effect.Effect<A, SkillLoadFailed, R>;
|
|
8
|
+
interface ReadRequest {
|
|
9
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
10
|
+
/** Describe a refusal by Executor's app network; defaults to the refusal's own message. */
|
|
11
|
+
readonly refused?: (refused: NetworkRefused) => SkillLoadFailed;
|
|
12
|
+
}
|
|
6
13
|
/** One loader invocation owns its byte budget and all of its network requests. */
|
|
7
14
|
export declare const reader: (transport: SkillTransport) => Effect.Effect<{
|
|
8
|
-
fetchBytes: (url: string,
|
|
9
|
-
readonly body
|
|
10
|
-
readonly headers: Record<string, string>;
|
|
15
|
+
fetchBytes: (url: string, request?: ReadRequest & {
|
|
16
|
+
readonly body?: Uint8Array;
|
|
11
17
|
}) => Effect.Effect<Uint8Array<ArrayBuffer>, SkillLoadFailed, never>;
|
|
12
|
-
read: (url: string) => Effect.Effect<string, SkillLoadFailed, never>;
|
|
18
|
+
read: (url: string, request?: ReadRequest) => Effect.Effect<string, SkillLoadFailed, never>;
|
|
13
19
|
json: (url: string) => Effect.Effect<unknown, SkillLoadFailed, never>;
|
|
14
20
|
}, never, never>;
|
|
15
|
-
export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<
|
|
16
|
-
readonly description: string;
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly files: readonly {
|
|
19
|
-
readonly path: string;
|
|
20
|
-
readonly content: string;
|
|
21
|
-
}[];
|
|
22
|
-
readonly license?: string;
|
|
23
|
-
readonly compatibility?: string;
|
|
24
|
-
readonly metadata?: {
|
|
25
|
-
readonly [x: string]: string;
|
|
26
|
-
};
|
|
27
|
-
readonly "allowed-tools"?: string;
|
|
28
|
-
}[], SkillLoadFailed, never>;
|
|
21
|
+
export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<typeof AppSkills.Type, SkillLoadFailed | ProviderError>;
|
|
29
22
|
/** Fetch all indexed files and reject a publication whose index changes during the read. */
|
|
30
23
|
export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) => Effect.Effect<readonly {
|
|
31
24
|
readonly description: string;
|
|
@@ -41,3 +34,4 @@ export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) =>
|
|
|
41
34
|
};
|
|
42
35
|
readonly "allowed-tools"?: string;
|
|
43
36
|
}[], SkillLoadFailed, never>;
|
|
37
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type FolderSkillsOptions, type GitHubSkillsOptions, type SkillReaderOptions, type WellKnownSkillsOptions, type SkillFile } from "./contracts/skills.js";
|
|
2
|
-
export { SkillLoadFailed, SkillDefinitionInvalid, SkillServiceName, type SkillReaderOptions, type FolderSkillsOptions, type AppSkillSource as Skill, type SkillFile, type GitHubSkillsOptions, type SkillCacheOptions, type WellKnownSkillsOptions, } from "./contracts/skills.js";
|
|
2
|
+
export { SkillLoadFailed, SkillDefinitionInvalid, SkillServiceName, type SkillReaderOptions, type FolderSkillsOptions, type AppSkillSource as Skill, type SkillFile, type GitHubSkillsAccount, type GitHubSkillsOptions, type SkillCacheOptions, type WellKnownSkillsOptions, } from "./contracts/skills.js";
|
|
3
3
|
/**
|
|
4
|
-
* Fetch a
|
|
5
|
-
* the catalog; without it, mutable refs resolve
|
|
4
|
+
* Fetch a GitHub skill collection from one resolved commit. A private repository takes `account`
|
|
5
|
+
* and its `token`. Pass `cache: ctx.cache` to reuse the catalog; without it, mutable refs resolve
|
|
6
|
+
* again on each call.
|
|
6
7
|
*/
|
|
7
8
|
export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<readonly {
|
|
8
9
|
readonly description: string;
|