apps 0.0.1-beta.0 → 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/README.md +97 -4
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-SBKHUC5L.js → chunk-4LPG6RCH.js} +2 -2
- package/js/chunk-5MQZEB6Y.js +172 -0
- package/js/{chunk-7JXHF5IF.js → chunk-BMOIAIVR.js} +1 -1
- package/js/chunk-CZ7CSFO4.js +39 -0
- package/js/chunk-D47C7KG5.js +172 -0
- package/js/{chunk-YDR4CPJA.js → chunk-EVJUVWN2.js} +8 -8
- package/js/chunk-FDNTX5QJ.js +78 -0
- package/js/{chunk-2OTCEKL2.js → chunk-FW5HBOIK.js} +2352 -1493
- package/js/{chunk-EP6AEUZO.js → chunk-FZJOYIZO.js} +1 -1
- package/js/{chunk-VFUZI3NY.js → chunk-HDJH3RPR.js} +4 -4
- package/js/{chunk-WIDTG42X.js → chunk-HDTGZWP2.js} +79 -26
- package/js/{chunk-Q2FD5IBM.js → chunk-J7O55ZV7.js} +298 -37
- package/js/{chunk-X3YBZCJW.js → chunk-JN55AYQH.js} +8 -41
- package/js/chunk-LGIYBDWA.js +85 -0
- package/js/{chunk-D6BKYP2L.js → chunk-M6ZRRIBI.js} +4 -4
- package/js/{chunk-HP7E42X6.js → chunk-MYYEW3RA.js} +767 -249
- package/js/{chunk-3ANFZFCV.js → chunk-OHRT55C4.js} +15 -15
- package/js/{chunk-R6JMJSVT.js → chunk-PLCMJREA.js} +2 -2
- package/js/{chunk-C24KEZXR.js → chunk-PYUYJRSK.js} +36 -2
- package/js/{chunk-W7Q5EOTS.js → chunk-QKHR7BMF.js} +32 -32
- package/js/{chunk-KWTCHVLT.js → chunk-RN2MXB4R.js} +47 -51
- package/js/{chunk-36DNRFZQ.js → chunk-SATWJKN6.js} +1 -1
- package/js/chunk-SWPD52J7.js +35 -0
- package/js/{chunk-BKVL7XAJ.js → chunk-TE4KO4HI.js} +1 -1
- package/js/chunk-UVL56Z6E.js +6641 -0
- package/js/chunk-W7D7WVSY.js +18 -0
- package/js/{chunk-BPEFS4YF.js → chunk-WFSQXYUT.js} +109 -17
- package/js/chunk-YEJOQEII.js +104 -0
- package/js/{chunk-LOKGDT6B.js → chunk-Z5NMEGJN.js} +5 -4
- package/js/{chunk-OWD2YICM.js → chunk-ZCAMUXSG.js} +116 -87
- package/js/chunk-ZJWDMTE3.js +63 -0
- package/js/client.js +11 -11
- package/js/contracts.js +88 -25
- package/js/effect.js +21 -15
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +224 -121
- package/js/host.js +76 -19
- package/js/index.js +193 -51
- package/js/mcp/effect.js +25 -17
- package/js/mcp/stdio.js +23 -17
- package/js/mcp.js +110 -24
- package/js/openapi.js +3045 -105
- package/js/operations/approval.js +1 -1
- package/js/react.js +4 -4
- package/js/skills/effect.js +11 -0
- package/js/skills.js +894 -0
- package/js/storage/facet.js +7 -7
- package/js/ui/auth/contracts.js +6 -6
- package/js/ui/auth.js +8 -8
- package/js/ui/contracts.js +5 -5
- package/js/ui/serving.js +12 -12
- package/package.json +9 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +119 -0
- package/types/app-cache/src/index.d.ts +93 -0
- package/types/apps/src/contracts/api-response-error.d.ts +43 -0
- package/types/apps/src/contracts/app.d.ts +11 -0
- package/types/apps/src/contracts/cache.d.ts +44 -0
- package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
- package/types/apps/src/contracts/dynamic-tools.d.ts +13 -0
- package/types/apps/src/contracts/graphql.d.ts +18 -1
- package/types/apps/src/contracts/host.d.ts +54 -525
- package/types/apps/src/contracts/mcp.d.ts +3 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
- package/types/apps/src/contracts/openapi-document.d.ts +53 -0
- package/types/apps/src/contracts/openapi.d.ts +156 -30
- 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/provider-error.d.ts +15 -0
- package/types/apps/src/contracts/provider.d.ts +18 -1
- package/types/apps/src/contracts/skills.d.ts +122 -0
- package/types/apps/src/contracts/swagger-client.d.ts +29 -0
- package/types/apps/src/graphql.d.ts +6 -6
- package/types/apps/src/host.d.ts +1 -0
- package/types/apps/src/implementation/account-operations.d.ts +122 -3
- package/types/apps/src/implementation/app.d.ts +1 -1
- package/types/apps/src/implementation/cache-session.d.ts +7 -0
- package/types/apps/src/implementation/cache.d.ts +8 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +29 -0
- package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
- package/types/apps/src/implementation/dynamic-tools.d.ts +8 -0
- package/types/apps/src/implementation/elicitation.d.ts +12 -12
- package/types/apps/src/implementation/git.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +10 -0
- package/types/apps/src/implementation/graphql.d.ts +81 -3
- package/types/apps/src/implementation/inflate.d.ts +16 -0
- package/types/apps/src/implementation/input-problems.d.ts +3 -0
- package/types/apps/src/implementation/mcp-call.d.ts +3 -2
- package/types/apps/src/implementation/mcp-catalog.d.ts +12 -0
- package/types/apps/src/implementation/mcp-client.d.ts +9 -8
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
- package/types/apps/src/implementation/mcp.d.ts +39 -2
- package/types/apps/src/implementation/openapi-compile.d.ts +119 -0
- package/types/apps/src/implementation/openapi-document.d.ts +51 -0
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -4
- package/types/apps/src/implementation/openapi-source.d.ts +40 -0
- package/types/apps/src/implementation/openapi.d.ts +39 -3
- package/types/apps/src/implementation/provider-error.d.ts +10 -0
- package/types/apps/src/implementation/schema.d.ts +6 -5
- package/types/apps/src/implementation/skill-files.d.ts +10 -0
- package/types/apps/src/implementation/skills.d.ts +43 -0
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/index.d.ts +7 -0
- package/types/apps/src/mcp.d.ts +5 -5
- package/types/apps/src/openapi.d.ts +3 -1
- package/types/apps/src/skills.d.ts +75 -0
- package/types/telemetry/src/config.d.ts +2 -0
- package/js/chunk-22WRQZT7.js +0 -389
- package/js/chunk-MLKGABMK.js +0 -9
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const ProviderError_base: Schema.Class<ProviderError, Schema.TaggedStruct<"ProviderError", {
|
|
3
|
+
readonly reason: Schema.Literals<readonly ["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]>;
|
|
4
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
5
|
+
readonly accountId: Schema.optional<Schema.brand<Schema.String, "acc">>;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
/**
|
|
8
|
+
* A recognized service failure. App authors can throw this ordinary Error from
|
|
9
|
+
* async code. Supply only a known reason and the account used for that request.
|
|
10
|
+
* Never include response bodies, messages, URLs or credentials. A bare 403 is
|
|
11
|
+
* `rejected`; `forbidden` requires explicit evidence of insufficient permission.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ProviderError extends ProviderError_base {
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -15,21 +15,36 @@ export declare const OAuthClientAuth: Schema.Literals<readonly ["none", "client_
|
|
|
15
15
|
export type OAuthClientAuth = typeof OAuthClientAuth.Type;
|
|
16
16
|
/** Machine clients always authenticate; public clients cannot use the client-credentials grant. */
|
|
17
17
|
export declare const OAuthSecretClientAuth: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Extra authorization request parameters, such as `access_type: "offline"`. RFC 6749 §3.1
|
|
20
|
+
* lets services define their own; the protocol and security parameters stay host-owned.
|
|
21
|
+
*/
|
|
22
|
+
export declare const OAuthAuthorizationParams: Schema.$Record<Schema.String, Schema.String>;
|
|
23
|
+
/**
|
|
24
|
+
* OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain
|
|
25
|
+
* host-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the
|
|
26
|
+
* server's `revocation_endpoint` metadata instead.
|
|
27
|
+
*/
|
|
19
28
|
export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
|
|
20
29
|
readonly discover: Schema.String;
|
|
21
30
|
readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
|
|
22
31
|
readonly tokenUrl: Schema.optionalKey<Schema.Never>;
|
|
32
|
+
readonly revocationUrl: Schema.optionalKey<Schema.Never>;
|
|
23
33
|
readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
24
34
|
readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
|
|
35
|
+
readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
25
36
|
readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
|
|
26
37
|
readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
27
38
|
}>, Schema.Struct<{
|
|
28
39
|
readonly authorizationUrl: Schema.String;
|
|
29
40
|
readonly tokenUrl: Schema.String;
|
|
41
|
+
readonly revocationUrl: Schema.optionalKey<Schema.String>;
|
|
30
42
|
readonly scopes: Schema.$Array<Schema.String>;
|
|
43
|
+
/** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
|
|
44
|
+
readonly issuer: Schema.optionalKey<Schema.String>;
|
|
31
45
|
readonly discover: Schema.optionalKey<Schema.Never>;
|
|
32
46
|
readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
|
|
47
|
+
readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
33
48
|
readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
|
|
34
49
|
readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
35
50
|
}>, Schema.Struct<{
|
|
@@ -37,12 +52,14 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
|
|
|
37
52
|
readonly discover: Schema.String;
|
|
38
53
|
readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
|
|
39
54
|
readonly tokenUrl: Schema.optionalKey<Schema.Never>;
|
|
55
|
+
readonly revocationUrl: Schema.optionalKey<Schema.Never>;
|
|
40
56
|
readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
41
57
|
readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
|
|
42
58
|
readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
43
59
|
}>, Schema.Struct<{
|
|
44
60
|
readonly grant: Schema.Literal<"client_credentials">;
|
|
45
61
|
readonly tokenUrl: Schema.String;
|
|
62
|
+
readonly revocationUrl: Schema.optionalKey<Schema.String>;
|
|
46
63
|
readonly scopes: Schema.$Array<Schema.String>;
|
|
47
64
|
readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
|
|
48
65
|
readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** Portable Agent Skills returned by an app factory or loaded from published files. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** Canonical resource path within one skill. */
|
|
4
|
+
export declare const SkillFilePath: Schema.NonEmptyString;
|
|
5
|
+
/** UTF-8 text resource. Reading a resource never executes it. */
|
|
6
|
+
export declare const SkillFile: Schema.Struct<{
|
|
7
|
+
readonly path: Schema.NonEmptyString;
|
|
8
|
+
readonly content: Schema.String;
|
|
9
|
+
}>;
|
|
10
|
+
export type SkillFile = typeof SkillFile.Type;
|
|
11
|
+
/** Agent Skills format constraints, not Executor execution or storage budgets. */
|
|
12
|
+
export declare const skillFormatLimits: {
|
|
13
|
+
readonly nameCharacters: 64;
|
|
14
|
+
readonly descriptionCharacters: 1024;
|
|
15
|
+
readonly compatibilityCharacters: 500;
|
|
16
|
+
};
|
|
17
|
+
/** A lowercase alphanumeric skill directory name with single separating hyphens. */
|
|
18
|
+
export declare const AppSkillName: Schema.NonEmptyString;
|
|
19
|
+
/** Frontmatter is metadata only. In particular, allowed-tools never grants execution authority. */
|
|
20
|
+
export declare const AppSkillMetadata: Schema.Struct<{
|
|
21
|
+
readonly name: Schema.NonEmptyString;
|
|
22
|
+
readonly description: Schema.String;
|
|
23
|
+
readonly license: Schema.optionalKey<Schema.String>;
|
|
24
|
+
readonly compatibility: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
26
|
+
readonly "allowed-tools": Schema.optionalKey<Schema.String>;
|
|
27
|
+
}>;
|
|
28
|
+
export type AppSkillMetadata = typeof AppSkillMetadata.Type;
|
|
29
|
+
/** Files use paths relative to this skill directory; reading one never executes its contents. */
|
|
30
|
+
export declare const AppSkillSource: Schema.Struct<{
|
|
31
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
32
|
+
readonly path: Schema.NonEmptyString;
|
|
33
|
+
readonly content: Schema.String;
|
|
34
|
+
}>>;
|
|
35
|
+
readonly name: Schema.NonEmptyString;
|
|
36
|
+
readonly description: Schema.String;
|
|
37
|
+
readonly license: Schema.optionalKey<Schema.String>;
|
|
38
|
+
readonly compatibility: Schema.optionalKey<Schema.String>;
|
|
39
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
40
|
+
readonly "allowed-tools": Schema.optionalKey<Schema.String>;
|
|
41
|
+
}>;
|
|
42
|
+
export type AppSkillSource = typeof AppSkillSource.Type;
|
|
43
|
+
declare const SkillDefinitionInvalid_base: Schema.Class<SkillDefinitionInvalid, Schema.TaggedStruct<"SkillDefinitionInvalid", {
|
|
44
|
+
readonly file: Schema.NonEmptyString;
|
|
45
|
+
readonly reason: Schema.Literals<readonly ["files", "directory", "missing-document", "frontmatter", "metadata", "name-mismatch"]>;
|
|
46
|
+
}>, import("effect/Cause").YieldableError>;
|
|
47
|
+
/** Invalid selected skill files fail the load. Errors identify the file without disclosing its contents. */
|
|
48
|
+
export declare class SkillDefinitionInvalid extends SkillDefinitionInvalid_base {
|
|
49
|
+
}
|
|
50
|
+
/** One evaluated catalog cannot contain ambiguous names. */
|
|
51
|
+
export declare const AppSkills: Schema.$Array<Schema.Struct<{
|
|
52
|
+
readonly files: Schema.$Array<Schema.Struct<{
|
|
53
|
+
readonly path: Schema.NonEmptyString;
|
|
54
|
+
readonly content: Schema.String;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly name: Schema.NonEmptyString;
|
|
57
|
+
readonly description: Schema.String;
|
|
58
|
+
readonly license: Schema.optionalKey<Schema.String>;
|
|
59
|
+
readonly compatibility: Schema.optionalKey<Schema.String>;
|
|
60
|
+
readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
61
|
+
readonly "allowed-tools": Schema.optionalKey<Schema.String>;
|
|
62
|
+
}>>;
|
|
63
|
+
/** Short display name for a skill source, such as "GitLab" or an index host name. */
|
|
64
|
+
export declare const SkillServiceName: Schema.String;
|
|
65
|
+
declare const SkillLoadFailed_base: Schema.Class<SkillLoadFailed, Schema.TaggedStruct<"SkillLoadFailed", {
|
|
66
|
+
readonly reason: Schema.Literals<readonly ["source", "request", "rate_limited", "document", "limit", "changed", "encoding"]>;
|
|
67
|
+
readonly message: Schema.optional<Schema.String>;
|
|
68
|
+
readonly status: Schema.optional<Schema.Int>;
|
|
69
|
+
}>, import("effect/Cause").YieldableError>;
|
|
70
|
+
/**
|
|
71
|
+
* A skill loader failure shown to people. `message` is the explanation they read; write it for
|
|
72
|
+
* them and never include URLs, tokens or response bodies. `reason` selects the title and whether
|
|
73
|
+
* a retry can help. Custom loaders throw this error to get the same presentation as built-ins.
|
|
74
|
+
*/
|
|
75
|
+
export declare class SkillLoadFailed extends SkillLoadFailed_base {
|
|
76
|
+
}
|
|
77
|
+
/** Bounds shared by skill loaders across all app hosts. */
|
|
78
|
+
export declare const skillLoadLimits: {
|
|
79
|
+
readonly files: 1000;
|
|
80
|
+
readonly fileBytes: 2000000;
|
|
81
|
+
readonly totalBytes: 20000000;
|
|
82
|
+
readonly concurrency: 8;
|
|
83
|
+
};
|
|
84
|
+
/** Invocation-owned transport and cancellation, supplied by the app context. */
|
|
85
|
+
export interface SkillTransport {
|
|
86
|
+
readonly fetch?: typeof globalThis.fetch | undefined;
|
|
87
|
+
readonly signal?: AbortSignal | undefined;
|
|
88
|
+
}
|
|
89
|
+
/** A custom loader's transport and the service name shown when a request fails. */
|
|
90
|
+
export interface SkillReaderOptions extends SkillTransport {
|
|
91
|
+
readonly service: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Catalog reuse shared by remote skill loaders, with the same policy as MCP tool catalogs. Pass
|
|
95
|
+
* `ctx.cache` to keep the loaded catalog; without it every read fetches the source again.
|
|
96
|
+
*/
|
|
97
|
+
export interface SkillCacheOptions {
|
|
98
|
+
readonly cache?: import("./cache.js").AppCache;
|
|
99
|
+
/** Reuse the catalog for this duration. Defaults to five minutes. */
|
|
100
|
+
readonly freshFor?: import("effect").Duration.Input;
|
|
101
|
+
/** Serve the retained catalog while refreshing. Defaults to one day. */
|
|
102
|
+
readonly staleFor?: import("effect").Duration.Input;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A public GitHub repository and an optional immutable commit, tag or branch. With a cache, a
|
|
106
|
+
* branch or tag is resolved again when the catalog refreshes, and each commit's file list is kept.
|
|
107
|
+
*/
|
|
108
|
+
export interface GitHubSkillsOptions extends SkillTransport, SkillCacheOptions {
|
|
109
|
+
readonly repo: string;
|
|
110
|
+
readonly path?: string;
|
|
111
|
+
readonly ref?: string;
|
|
112
|
+
}
|
|
113
|
+
/** A published directory index, including its listed skill documents and text references. */
|
|
114
|
+
export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {
|
|
115
|
+
readonly url: string;
|
|
116
|
+
}
|
|
117
|
+
/** A folder in the deployed package; omitted path selects skills/. No host filesystem access. */
|
|
118
|
+
export interface FolderSkillsOptions {
|
|
119
|
+
readonly files: readonly SkillFile[];
|
|
120
|
+
readonly path?: string;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Narrow declarations for the untyped public swagger-client APIs used by our adapters.
|
|
2
|
+
* Returned data remains unknown and is decoded before it enters Executor.
|
|
3
|
+
*/
|
|
4
|
+
declare module "swagger-client" {
|
|
5
|
+
const SwaggerClient: {
|
|
6
|
+
buildRequest(options: {
|
|
7
|
+
spec: unknown;
|
|
8
|
+
operationId?: string;
|
|
9
|
+
pathName?: string;
|
|
10
|
+
method?: string;
|
|
11
|
+
parameters?: Readonly<Record<string, unknown>>;
|
|
12
|
+
requestBody?: unknown;
|
|
13
|
+
requestContentType?: string;
|
|
14
|
+
securities?: {
|
|
15
|
+
authorized: Readonly<Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
}): unknown;
|
|
18
|
+
resolve(options: {
|
|
19
|
+
spec: unknown;
|
|
20
|
+
skipNormalization: boolean;
|
|
21
|
+
useCircularStructures: boolean;
|
|
22
|
+
requestInterceptor: () => never;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
spec: unknown;
|
|
25
|
+
errors: readonly unknown[];
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
28
|
+
export default SwaggerClient;
|
|
29
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** GraphQL helpers. Requires the optional graphql peer. */
|
|
2
|
-
import {
|
|
3
|
-
import type
|
|
2
|
+
import type { OperationKinds } from "./implementation/protocol-operations.js";
|
|
3
|
+
import { type GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
|
|
4
4
|
export { GraphqlError, type GraphqlToolsOptions } from "./contracts/graphql.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export type { GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
|
|
6
|
+
/** Lazy tools with optional persistent metadata caching for the selected account. */
|
|
7
|
+
export declare const graphqlOperations: (options: GraphqlCatalogOptions, kinds?: OperationKinds) => Promise<{
|
|
8
|
+
dynamicTools: import("./contracts/dynamic-tools.js").DynamicTools;
|
|
9
9
|
}>;
|
|
10
10
|
export type { OperationKinds } from "./implementation/protocol-operations.js";
|
package/types/apps/src/host.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type HostContext, type ResolvedAccountsInput } from "./contracts/host.js";
|
|
2
2
|
import { type ElicitationHandler } from "./contracts/elicitation.js";
|
|
3
3
|
export type { HostContext, ResolvedAccountsInput } from "./contracts/host.js";
|
|
4
|
+
export { isolatedCacheSession } from "./implementation/cache-session.js";
|
|
4
5
|
/** Parse trusted account bindings and an optional exact-call approval. Throws safe boundary errors on invalid input. */
|
|
5
6
|
export declare const hostContext: (accounts: ResolvedAccountsInput, approval?: unknown) => HostContext;
|
|
6
7
|
/** Portable Promise handler. Invoke only after the host has authorized and resolved accounts. */
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/** Combine account-bound protocol operations without changing their upstream inputs. */
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
import type { DynamicTools } from "../contracts/dynamic-tools.js";
|
|
4
|
+
import type { AppOperation, OperationContext } from "../contracts/operations.js";
|
|
2
5
|
import { type JsonValue } from "../contracts/schema.js";
|
|
3
6
|
import { type Operation } from "./operations.js";
|
|
4
7
|
type Operations = {
|
|
5
|
-
readonly queries
|
|
6
|
-
readonly
|
|
8
|
+
readonly queries?: Readonly<Record<string, Operation<JsonValue, unknown, "query", OperationContext>>>;
|
|
9
|
+
readonly dynamicTools?: DynamicTools;
|
|
10
|
+
readonly mutations?: Readonly<Record<string, Operation<JsonValue, unknown, "mutation", OperationContext>>>;
|
|
7
11
|
};
|
|
8
12
|
/**
|
|
9
13
|
* Discover each selected account's protocol operations and combine matching names.
|
|
@@ -28,5 +32,120 @@ export declare const accountOperations: <Account extends {
|
|
|
28
32
|
readonly input: unknown;
|
|
29
33
|
}, unknown, "mutation", import("../index.js").AppContext>;
|
|
30
34
|
};
|
|
35
|
+
} | {
|
|
36
|
+
dynamicTools: {
|
|
37
|
+
list: () => Effect.Effect<{
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly description: string;
|
|
40
|
+
readonly inputSchema: {
|
|
41
|
+
readonly [x: string]: Schema.Json;
|
|
42
|
+
};
|
|
43
|
+
readonly _meta?: {
|
|
44
|
+
readonly [x: string]: Schema.Json;
|
|
45
|
+
};
|
|
46
|
+
readonly title?: string;
|
|
47
|
+
readonly outputSchema?: {
|
|
48
|
+
readonly [x: string]: Schema.Json;
|
|
49
|
+
};
|
|
50
|
+
readonly annotations?: {
|
|
51
|
+
readonly title?: string;
|
|
52
|
+
readonly readOnlyHint?: boolean;
|
|
53
|
+
readonly destructiveHint?: boolean;
|
|
54
|
+
readonly idempotentHint?: boolean;
|
|
55
|
+
readonly openWorldHint?: boolean;
|
|
56
|
+
};
|
|
57
|
+
readonly schedules?: readonly {
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly timing: {
|
|
60
|
+
readonly kind: "interval";
|
|
61
|
+
readonly milliseconds: number;
|
|
62
|
+
} | {
|
|
63
|
+
readonly kind: "cron";
|
|
64
|
+
readonly calendar: {
|
|
65
|
+
readonly expression: string;
|
|
66
|
+
readonly timezone: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
readonly input: Schema.Json;
|
|
70
|
+
}[];
|
|
71
|
+
readonly readOnly?: boolean;
|
|
72
|
+
}[], unknown, never>;
|
|
73
|
+
summaries: () => Effect.Effect<{
|
|
74
|
+
readonly name: string;
|
|
75
|
+
readonly description: string;
|
|
76
|
+
readonly title?: string;
|
|
77
|
+
readonly annotations?: {
|
|
78
|
+
readonly title?: string;
|
|
79
|
+
readonly readOnlyHint?: boolean;
|
|
80
|
+
readonly destructiveHint?: boolean;
|
|
81
|
+
readonly idempotentHint?: boolean;
|
|
82
|
+
readonly openWorldHint?: boolean;
|
|
83
|
+
};
|
|
84
|
+
readonly schedules?: readonly {
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly timing: {
|
|
87
|
+
readonly kind: "interval";
|
|
88
|
+
readonly milliseconds: number;
|
|
89
|
+
} | {
|
|
90
|
+
readonly kind: "cron";
|
|
91
|
+
readonly calendar: {
|
|
92
|
+
readonly expression: string;
|
|
93
|
+
readonly timezone: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
readonly input: Schema.Json;
|
|
97
|
+
}[];
|
|
98
|
+
readonly readOnly?: boolean;
|
|
99
|
+
}[], unknown, never>;
|
|
100
|
+
describe: (name: string) => Effect.Effect<{
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly description: string;
|
|
103
|
+
readonly inputSchema: {
|
|
104
|
+
readonly [x: string]: Schema.Json;
|
|
105
|
+
};
|
|
106
|
+
readonly _meta?: {
|
|
107
|
+
readonly [x: string]: Schema.Json;
|
|
108
|
+
};
|
|
109
|
+
readonly title?: string;
|
|
110
|
+
readonly outputSchema?: {
|
|
111
|
+
readonly [x: string]: Schema.Json;
|
|
112
|
+
};
|
|
113
|
+
readonly annotations?: {
|
|
114
|
+
readonly title?: string;
|
|
115
|
+
readonly readOnlyHint?: boolean;
|
|
116
|
+
readonly destructiveHint?: boolean;
|
|
117
|
+
readonly idempotentHint?: boolean;
|
|
118
|
+
readonly openWorldHint?: boolean;
|
|
119
|
+
};
|
|
120
|
+
readonly schedules?: readonly {
|
|
121
|
+
readonly name: string;
|
|
122
|
+
readonly timing: {
|
|
123
|
+
readonly kind: "interval";
|
|
124
|
+
readonly milliseconds: number;
|
|
125
|
+
} | {
|
|
126
|
+
readonly kind: "cron";
|
|
127
|
+
readonly calendar: {
|
|
128
|
+
readonly expression: string;
|
|
129
|
+
readonly timezone: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly input: Schema.Json;
|
|
133
|
+
}[];
|
|
134
|
+
readonly readOnly?: boolean;
|
|
135
|
+
} | undefined, unknown, never>;
|
|
136
|
+
resolve: (name: string) => Effect.Effect<AppOperation<unknown, unknown> | undefined, unknown, never>;
|
|
137
|
+
};
|
|
138
|
+
queries: {
|
|
139
|
+
[k: string]: Operation<{
|
|
140
|
+
readonly accountId: string;
|
|
141
|
+
readonly input: unknown;
|
|
142
|
+
}, unknown, "query", import("../index.js").AppContext>;
|
|
143
|
+
};
|
|
144
|
+
mutations: {
|
|
145
|
+
[k: string]: Operation<{
|
|
146
|
+
readonly accountId: string;
|
|
147
|
+
readonly input: unknown;
|
|
148
|
+
}, unknown, "mutation", import("../index.js").AppContext>;
|
|
149
|
+
};
|
|
31
150
|
}>;
|
|
32
151
|
export {};
|
|
@@ -22,7 +22,7 @@ export type AppDefinition<Requirements extends AppRequirements> = {
|
|
|
22
22
|
};
|
|
23
23
|
/** Adapt operation and webhook catalogs without evaluating their handlers. */
|
|
24
24
|
export type EffectDefinition<Def> = {
|
|
25
|
-
readonly [Key in keyof Def]: Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "queries" | "mutations" ? Readonly<Record<string, import("../contracts/operations.js").AppOperation>> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Def[Key];
|
|
25
|
+
readonly [Key in keyof Def]: Key extends "dynamicTools" ? NonNullable<NativeDefinition<unknown>["dynamicTools"]> : Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "queries" | "mutations" ? Readonly<Record<string, import("../contracts/operations.js").AppOperation>> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Key extends "skills" ? NonNullable<NativeDefinition<unknown>["skills"]> : Key extends "dynamicSkills" ? NonNullable<NativeDefinition<unknown>["dynamicSkills"]> : Def[Key];
|
|
26
26
|
};
|
|
27
27
|
declare const InternalApp: unique symbol;
|
|
28
28
|
/** Recognize a declaration from this framework instance before host adaptation. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HostCache } from "../contracts/cache.js";
|
|
2
|
+
/** Own all refresh promises until drained or cancelled. Only generated trusted bridges create sessions. */
|
|
3
|
+
export declare const isolatedCacheSession: (callback: (input: unknown) => Promise<unknown>) => {
|
|
4
|
+
cache: HostCache;
|
|
5
|
+
drain: () => Promise<void>;
|
|
6
|
+
cancel: () => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppCache, HostCache } from "../contracts/cache.js";
|
|
2
|
+
import type { ResolvedAccounts } from "../contracts/host.js";
|
|
3
|
+
/** Missing host support is explicit on use; ordinary apps do not need cache support. */
|
|
4
|
+
export declare const unavailableCache: HostCache;
|
|
5
|
+
/** Account scopes are derived from trusted current bindings. Loaders get a fresh owned HTTP signal. */
|
|
6
|
+
export declare const authorCache: (host: HostCache, accounts: ResolvedAccounts, signal: AbortSignal,
|
|
7
|
+
/** The invocation's trusted deadline. Waiting on another caller's load never runs past it. */
|
|
8
|
+
deadline?: number) => AppCache;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Duration, Effect, Schema } from "effect";
|
|
2
|
+
import type { AppCache, CacheLoadContext } from "../contracts/cache.js";
|
|
3
|
+
import { type JsonValue } from "../contracts/schema.js";
|
|
4
|
+
export interface CatalogCacheOptions {
|
|
5
|
+
/** App/build scope, optionally narrowed to the current account. */
|
|
6
|
+
readonly cache?: AppCache;
|
|
7
|
+
/** Reuse metadata for this duration. Defaults to five minutes. */
|
|
8
|
+
readonly freshFor?: Duration.Input;
|
|
9
|
+
/** Serve retained metadata while refreshing. Defaults to one day. */
|
|
10
|
+
readonly staleFor?: Duration.Input;
|
|
11
|
+
/** Await a fresh revision at an explicit logical connection or refresh boundary. */
|
|
12
|
+
readonly revalidate?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const catalogCache: <A extends {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
}, S>(options: CatalogCacheOptions & {
|
|
17
|
+
readonly prefix: readonly JsonValue[];
|
|
18
|
+
readonly schema: Schema.Decoder<A>;
|
|
19
|
+
/** Schema-free projection stored beside the full pages, so browsing never reads schemas. */
|
|
20
|
+
readonly summary: {
|
|
21
|
+
readonly schema: Schema.Decoder<S>;
|
|
22
|
+
readonly of: (tool: A) => S;
|
|
23
|
+
};
|
|
24
|
+
readonly load: (context?: CacheLoadContext) => Effect.Effect<readonly A[], unknown>;
|
|
25
|
+
}) => Effect.Effect<{
|
|
26
|
+
list: () => Effect.Effect<readonly A[], unknown, never>;
|
|
27
|
+
summaries: () => Effect.Effect<S[], unknown, never>;
|
|
28
|
+
resolve: (name: string) => Effect.Effect<A | undefined, unknown, never>;
|
|
29
|
+
}, unknown, never>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Author-facing lazy skill sources adapt once to the framework's Effect execution path. */
|
|
2
|
+
import type { DynamicSkills } from "../contracts/dynamic-skills.js";
|
|
3
|
+
import type { AppSkillSource } from "../contracts/skills.js";
|
|
4
|
+
/** Declare skills that load only when skills are read, such as `list: () => githubSkills({...})`. */
|
|
5
|
+
export declare const dynamicSkills: (source: {
|
|
6
|
+
readonly list: () => readonly AppSkillSource[] | Promise<readonly AppSkillSource[]>;
|
|
7
|
+
}) => DynamicSkills;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HostedTool } from "../contracts/host.js";
|
|
2
|
+
import type { DynamicTools } from "../contracts/dynamic-tools.js";
|
|
3
|
+
import { type OperationDeclaration } from "./operations.js";
|
|
4
|
+
/** Declare metadata discovery separately from executable resolution. Names are fully qualified. */
|
|
5
|
+
export declare const dynamicTools: (source: {
|
|
6
|
+
readonly list: () => Promise<readonly HostedTool[]>;
|
|
7
|
+
readonly resolve: (name: string) => Promise<OperationDeclaration<"query" | "mutation"> | undefined>;
|
|
8
|
+
}) => DynamicTools;
|
|
@@ -7,76 +7,76 @@ export declare const prepareElicitation: (input: unknown) => Effect.Effect<{
|
|
|
7
7
|
readonly message: string;
|
|
8
8
|
readonly mode: "form";
|
|
9
9
|
readonly requestedSchema: {
|
|
10
|
+
readonly type: "object";
|
|
10
11
|
readonly properties: {
|
|
11
12
|
readonly [x: string]: {
|
|
12
13
|
readonly type: "string";
|
|
13
14
|
readonly enum: readonly string[];
|
|
14
15
|
readonly default?: string;
|
|
15
|
-
readonly title?: string;
|
|
16
16
|
readonly description?: string;
|
|
17
|
+
readonly title?: string;
|
|
17
18
|
readonly enumNames?: readonly string[];
|
|
18
19
|
} | {
|
|
19
20
|
readonly type: "string";
|
|
20
21
|
readonly enum: readonly string[];
|
|
21
22
|
readonly default?: string;
|
|
22
|
-
readonly title?: string;
|
|
23
23
|
readonly description?: string;
|
|
24
|
+
readonly title?: string;
|
|
24
25
|
} | {
|
|
26
|
+
readonly type: "string";
|
|
25
27
|
readonly oneOf: readonly {
|
|
26
28
|
readonly const: string;
|
|
27
29
|
readonly title: string;
|
|
28
30
|
}[];
|
|
29
|
-
readonly type: "string";
|
|
30
31
|
readonly default?: string;
|
|
31
|
-
readonly title?: string;
|
|
32
32
|
readonly description?: string;
|
|
33
|
+
readonly title?: string;
|
|
33
34
|
} | {
|
|
35
|
+
readonly type: "array";
|
|
34
36
|
readonly items: {
|
|
35
37
|
readonly type: "string";
|
|
36
38
|
readonly enum: readonly string[];
|
|
37
39
|
};
|
|
38
|
-
readonly type: "array";
|
|
39
40
|
readonly default?: readonly string[];
|
|
40
|
-
readonly title?: string;
|
|
41
41
|
readonly description?: string;
|
|
42
|
+
readonly title?: string;
|
|
42
43
|
readonly minItems?: number;
|
|
43
44
|
readonly maxItems?: number;
|
|
44
45
|
} | {
|
|
46
|
+
readonly type: "array";
|
|
45
47
|
readonly items: {
|
|
46
48
|
readonly anyOf: readonly {
|
|
47
49
|
readonly const: string;
|
|
48
50
|
readonly title: string;
|
|
49
51
|
}[];
|
|
50
52
|
};
|
|
51
|
-
readonly type: "array";
|
|
52
53
|
readonly default?: readonly string[];
|
|
53
|
-
readonly title?: string;
|
|
54
54
|
readonly description?: string;
|
|
55
|
+
readonly title?: string;
|
|
55
56
|
readonly minItems?: number;
|
|
56
57
|
readonly maxItems?: number;
|
|
57
58
|
} | {
|
|
58
59
|
readonly type: "string";
|
|
59
60
|
readonly default?: string;
|
|
60
61
|
readonly format?: "email" | "uri" | "date" | "date-time";
|
|
61
|
-
readonly title?: string;
|
|
62
62
|
readonly description?: string;
|
|
63
|
+
readonly title?: string;
|
|
63
64
|
readonly minLength?: number;
|
|
64
65
|
readonly maxLength?: number;
|
|
65
66
|
} | {
|
|
66
67
|
readonly type: "number" | "integer";
|
|
67
68
|
readonly default?: number;
|
|
68
|
-
readonly title?: string;
|
|
69
69
|
readonly description?: string;
|
|
70
|
+
readonly title?: string;
|
|
70
71
|
readonly minimum?: number;
|
|
71
72
|
readonly maximum?: number;
|
|
72
73
|
} | {
|
|
73
74
|
readonly type: "boolean";
|
|
74
75
|
readonly default?: boolean;
|
|
75
|
-
readonly title?: string;
|
|
76
76
|
readonly description?: string;
|
|
77
|
+
readonly title?: string;
|
|
77
78
|
};
|
|
78
79
|
};
|
|
79
|
-
readonly type: "object";
|
|
80
80
|
readonly required?: readonly string[];
|
|
81
81
|
readonly $schema?: string;
|
|
82
82
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** A malformed git response; callers report it as an unreadable source document. */
|
|
2
|
+
export declare class GitProtocolError extends Error {
|
|
3
|
+
}
|
|
4
|
+
export declare const gitRequestHeaders: {
|
|
5
|
+
readonly "Content-Type": "application/x-git-upload-pack-request";
|
|
6
|
+
readonly "Git-Protocol": "version=2";
|
|
7
|
+
};
|
|
8
|
+
/** Candidate ref names for a branch, tag or HEAD, in lookup order. */
|
|
9
|
+
export declare const refCandidates: (ref: string | undefined) => string[];
|
|
10
|
+
/** Ask only for the named refs, peeling annotated tags to their commits. */
|
|
11
|
+
export declare const lsRefsRequest: (names: readonly string[]) => Uint8Array<ArrayBuffer>;
|
|
12
|
+
/** Map each advertised ref to its commit, using the peeled commit for annotated tags. */
|
|
13
|
+
export declare const parseLsRefs: (bytes: Uint8Array) => Map<string, string>;
|
|
14
|
+
/** Fetch one commit and its trees without file contents or history. */
|
|
15
|
+
export declare const treeFetchRequest: (commit: string) => Uint8Array<ArrayBuffer>;
|
|
16
|
+
export interface GitTreeEntry {
|
|
17
|
+
/** Repository-relative path. */
|
|
18
|
+
readonly path: string;
|
|
19
|
+
/** Git file mode, such as 100644, 100755 or 120000 for a symbolic link. */
|
|
20
|
+
readonly mode: string;
|
|
21
|
+
}
|
|
22
|
+
/** List the files at a commit, limited to one directory when `path` is set. */
|
|
23
|
+
export declare const parseTreeFetch: (bytes: Uint8Array, commit: string, path: string | undefined, limits: {
|
|
24
|
+
readonly objectBytes: number;
|
|
25
|
+
}) => Promise<GitTreeEntry[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GraphqlToolsOptions } from "../contracts/graphql.js";
|
|
3
|
+
import type { DynamicTools } from "../contracts/dynamic-tools.js";
|
|
4
|
+
import { type CatalogCacheOptions } from "./catalog-cache.js";
|
|
5
|
+
import { type OperationKinds } from "./protocol-operations.js";
|
|
6
|
+
export interface GraphqlCatalogOptions extends GraphqlToolsOptions, CatalogCacheOptions {
|
|
7
|
+
}
|
|
8
|
+
export declare const graphqlCatalog: (options: GraphqlCatalogOptions, kinds: OperationKinds) => Effect.Effect<{
|
|
9
|
+
dynamicTools: DynamicTools;
|
|
10
|
+
}, unknown, never>;
|