apps 0.0.1-beta.1 → 0.0.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-6YBRWRK3.js → chunk-5MQZEB6Y.js} +16 -4
- package/js/chunk-D47C7KG5.js +172 -0
- package/js/{chunk-ZTFQHGEB.js → chunk-FDNTX5QJ.js} +1 -3
- package/js/{chunk-G7IE6BKC.js → chunk-HDTGZWP2.js} +2 -2
- package/js/{chunk-KOXMLKTM.js → chunk-J7O55ZV7.js} +20 -148
- package/js/{chunk-RBAC33PQ.js → chunk-JN55AYQH.js} +3 -57
- package/js/chunk-LGIYBDWA.js +85 -0
- package/js/{chunk-IHQ4ML7K.js → chunk-MYYEW3RA.js} +130 -86
- package/js/{chunk-PZ36XMXW.js → chunk-PYUYJRSK.js} +1 -1
- package/js/{chunk-X7SFGU4Q.js → chunk-RN2MXB4R.js} +4 -4
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-2HHMABB6.js → chunk-WFSQXYUT.js} +46 -10
- package/js/{chunk-6IIO4NPI.js → chunk-Z5NMEGJN.js} +1 -1
- package/js/client.js +1 -1
- package/js/contracts.js +8 -1
- package/js/effect.js +8 -7
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +10 -9
- package/js/host.js +12 -11
- package/js/index.js +7 -5
- package/js/mcp/effect.js +10 -9
- package/js/mcp/stdio.js +10 -9
- package/js/mcp.js +12 -11
- package/js/openapi.js +776 -41590
- package/js/skills/effect.js +1 -2
- package/js/skills.js +47 -10
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +42 -2
- package/types/app-cache/src/index.d.ts +59 -1
- package/types/apps/src/contracts/cache.d.ts +4 -1
- package/types/apps/src/contracts/host.d.ts +8 -672
- package/types/apps/src/contracts/openapi.d.ts +6 -0
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1575 -0
- package/types/apps/src/contracts/skills.d.ts +17 -8
- package/types/apps/src/implementation/cache.d.ts +3 -1
- package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
- package/types/apps/src/implementation/openapi-document.d.ts +0 -2
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +0 -1
- package/types/apps/src/implementation/openapi-source.d.ts +5 -1
- package/types/apps/src/implementation/schema.d.ts +0 -5
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/skills.d.ts +6 -3
|
@@ -90,19 +90,28 @@ export interface SkillTransport {
|
|
|
90
90
|
export interface SkillReaderOptions extends SkillTransport {
|
|
91
91
|
readonly service: string;
|
|
92
92
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
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 {
|
|
95
109
|
readonly repo: string;
|
|
96
110
|
readonly path?: string;
|
|
97
111
|
readonly ref?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Pass `ctx.cache` to keep each commit's skill file list. Content at a commit never changes,
|
|
100
|
-
* so later reads of the same commit skip the tree fetch. The ref is still resolved each read.
|
|
101
|
-
*/
|
|
102
|
-
readonly cache?: import("./cache.js").AppCache;
|
|
103
112
|
}
|
|
104
113
|
/** A published directory index, including its listed skill documents and text references. */
|
|
105
|
-
export interface WellKnownSkillsOptions extends SkillTransport {
|
|
114
|
+
export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {
|
|
106
115
|
readonly url: string;
|
|
107
116
|
}
|
|
108
117
|
/** A folder in the deployed package; omitted path selects skills/. No host filesystem access. */
|
|
@@ -3,4 +3,6 @@ import type { ResolvedAccounts } from "../contracts/host.js";
|
|
|
3
3
|
/** Missing host support is explicit on use; ordinary apps do not need cache support. */
|
|
4
4
|
export declare const unavailableCache: HostCache;
|
|
5
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
|
|
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;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** Compile an OpenAPI document into tool declarations inside the app runtime, never a second execution engine. */
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
import { JsonObject } from "../contracts/schema.js";
|
|
4
|
-
import "../contracts/swagger-client.ts";
|
|
5
4
|
import { OpenapiCompileError as TemplateError } from "../contracts/openapi-compile.js";
|
|
6
5
|
import type { OpenApiImport } from "../contracts/openapi-document.js";
|
|
7
6
|
import { type GeneratedOperation, type GeneratedSecrets } from "../contracts/openapi-document.js";
|
|
@@ -68,6 +67,7 @@ export declare const compileOpenApiDocument: (entry: OpenApiImport, inputDocumen
|
|
|
68
67
|
readonly outputSchema?: {
|
|
69
68
|
readonly [x: string]: Schema.Json;
|
|
70
69
|
};
|
|
70
|
+
readonly operationId?: string;
|
|
71
71
|
readonly streaming?: true;
|
|
72
72
|
readonly errorResponses?: readonly {
|
|
73
73
|
readonly code: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/** OpenAPI reference and dialect rules, shared by every part of the app importer. */
|
|
2
|
-
import "../contracts/swagger-client.ts";
|
|
3
1
|
import { Schema } from "effect";
|
|
4
2
|
import { JsonObject } from "../contracts/schema.js";
|
|
5
3
|
/** Resolve OpenAPI objects once with Swagger; schemas retain their original recursive references.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group generated OpenAPI tool names as `<group>.<leaf>`, ported from Executor v1's tool paths.
|
|
3
|
+
* The group is the first tag, or the first meaningful path segment. The leaf is the operationId
|
|
4
|
+
* without a repeated group prefix, or a method-and-path name when there is no operationId.
|
|
5
|
+
*/
|
|
6
|
+
export interface OperationNameInput {
|
|
7
|
+
readonly operationId: string | undefined;
|
|
8
|
+
/** The first non-empty tag. */
|
|
9
|
+
readonly tag: string | undefined;
|
|
10
|
+
readonly method: string;
|
|
11
|
+
readonly path: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Plan one name per input, in input order. Names that collide are refined together: first by
|
|
15
|
+
* the path's version segment, then by the HTTP method, then by a stable hash. Refinement only
|
|
16
|
+
* touches the colliding names, so adding an operation never renames an unrelated one.
|
|
17
|
+
*/
|
|
18
|
+
export declare const planOperationNames: (inputs: readonly OperationNameInput[]) => string[];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Duration } from "effect";
|
|
3
3
|
import type { AppCache } from "../contracts/cache.js";
|
|
4
4
|
import { OpenapiOperation, type OpenapiToolsOptions } from "../contracts/openapi.js";
|
|
5
|
-
import { JsonObject,
|
|
5
|
+
import { JsonObject, JsonValue } from "../contracts/schema.js";
|
|
6
6
|
import type { DynamicTools } from "../contracts/dynamic-tools.js";
|
|
7
7
|
import { type OperationKinds } from "./protocol-operations.js";
|
|
8
8
|
/** Static credential placement and destination are reviewed when the app is authored/imported. */
|
|
@@ -18,6 +18,10 @@ export interface OpenapiSourceOptions extends Omit<OpenapiToolsOptions, "operati
|
|
|
18
18
|
readonly baseUrl?: string;
|
|
19
19
|
readonly freshFor?: Duration.Input;
|
|
20
20
|
readonly staleFor?: Duration.Input;
|
|
21
|
+
/**
|
|
22
|
+
* Query or mutation overrides keyed by the document's operationId. An operation without an
|
|
23
|
+
* operationId is keyed by its generated name without the kind, such as `users.getUsers`.
|
|
24
|
+
*/
|
|
21
25
|
readonly kinds?: OperationKinds;
|
|
22
26
|
readonly fallbackSecurity?: OpenapiOperation["request"]["security"];
|
|
23
27
|
readonly patches?: readonly {
|
|
@@ -80,11 +80,6 @@ export declare const compileJsonSchemaDecoder: (document: JsonObject) => Effect.
|
|
|
80
80
|
readonly [x: string]: EffectSchema.Json;
|
|
81
81
|
};
|
|
82
82
|
}, ValidationError, never>;
|
|
83
|
-
/**
|
|
84
|
-
* Build the document only when a value is first decoded or the schema is described, then
|
|
85
|
-
* compile its validator once. Imported apps can share definitions between many schemas
|
|
86
|
-
* without making each one self-contained up front.
|
|
87
|
-
*/
|
|
88
83
|
export declare const lazyJsonSchemaDecoder: (document: () => JsonObject) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, never, never>;
|
|
89
84
|
/** Preserve the JSON document; compile its validator only when a value is first decoded. */
|
|
90
85
|
export declare const jsonSchemaDecoder: (input: unknown) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, ValidationError, never>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Swagger is most of the OpenAPI module's code. Discovery from a cached catalog never needs it,
|
|
2
|
+
* so a cold app Worker evaluates it only when it resolves a document or builds a request.
|
|
3
|
+
*/
|
|
4
|
+
import "../contracts/swagger-client.ts";
|
|
5
|
+
export type SwaggerClient = typeof import("swagger-client").default;
|
|
6
|
+
export declare const loadSwaggerClient: () => Promise<{
|
|
7
|
+
buildRequest(options: {
|
|
8
|
+
spec: unknown;
|
|
9
|
+
operationId?: string;
|
|
10
|
+
pathName?: string;
|
|
11
|
+
method?: string;
|
|
12
|
+
parameters?: Readonly<Record<string, unknown>>;
|
|
13
|
+
requestBody?: unknown;
|
|
14
|
+
requestContentType?: string;
|
|
15
|
+
securities?: {
|
|
16
|
+
authorized: Readonly<Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
}): unknown;
|
|
19
|
+
resolve(options: {
|
|
20
|
+
spec: unknown;
|
|
21
|
+
skipNormalization: boolean;
|
|
22
|
+
useCircularStructures: boolean;
|
|
23
|
+
requestInterceptor: () => never;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
spec: unknown;
|
|
26
|
+
errors: readonly unknown[];
|
|
27
|
+
}>;
|
|
28
|
+
}>;
|
|
@@ -1,6 +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 WellKnownSkillsOptions, } from "./contracts/skills.js";
|
|
3
|
-
/**
|
|
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";
|
|
3
|
+
/**
|
|
4
|
+
* Fetch a public GitHub skill collection from one resolved commit. Pass `cache: ctx.cache` to reuse
|
|
5
|
+
* the catalog; without it, mutable refs resolve again on each call.
|
|
6
|
+
*/
|
|
4
7
|
export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<readonly {
|
|
5
8
|
readonly name: string;
|
|
6
9
|
readonly description: string;
|
|
@@ -15,7 +18,7 @@ export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<rea
|
|
|
15
18
|
};
|
|
16
19
|
readonly "allowed-tools"?: string;
|
|
17
20
|
}[]>;
|
|
18
|
-
/** Fetch a published skill index and its text files
|
|
21
|
+
/** Fetch a published skill index and its text files. Pass `cache: ctx.cache` to reuse the catalog. */
|
|
19
22
|
export declare const wellKnownSkills: (options: WellKnownSkillsOptions) => Promise<readonly {
|
|
20
23
|
readonly name: string;
|
|
21
24
|
readonly description: string;
|