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
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read a live router tree into tools, routers and router skills. A nested dynamic router that fails
|
|
3
|
+
* is reported on its own entry; the root failing fails the read, as a single-source app would.
|
|
4
|
+
*/
|
|
5
|
+
import { Effect, Schema } from "effect";
|
|
6
|
+
import { HostDeclarationInvalid, HostEvaluationFailed, type HostRouterError } from "../contracts/host.js";
|
|
7
|
+
import type { AppOperation } from "../contracts/operations.js";
|
|
8
|
+
import type { AppRouter, DynamicRouter, RouterMeta } from "../contracts/router.js";
|
|
9
|
+
import type { OperationSchedule } from "../contracts/schedules.js";
|
|
10
|
+
/**
|
|
11
|
+
* Keep only a failure's safe fields. Anything unrecognized becomes an evaluation failure with the
|
|
12
|
+
* error's name and bounded message, with the given account secrets replaced.
|
|
13
|
+
*/
|
|
14
|
+
export declare const safeFailure: (error: unknown, secrets: readonly string[]) => HostRouterError;
|
|
15
|
+
/**
|
|
16
|
+
* Router skills are named `tools` for the root and `tools-<path>` below it, so a router's
|
|
17
|
+
* instructions never take an authored skill's name by accident.
|
|
18
|
+
*/
|
|
19
|
+
export declare const routerSkillPrefix = "tools";
|
|
20
|
+
/**
|
|
21
|
+
* The skill name for a router path. A path of lowercase letters and digits is spelled out:
|
|
22
|
+
* `issues.open` is `tools-issues-open`. Any other path, or one too long, is a readable slug
|
|
23
|
+
* followed by a hash of the exact path, such as `tools-issues-list-0123456789`. Plain segments
|
|
24
|
+
* start with a letter and a hash is all digits, so the two forms never meet, and paths that slug
|
|
25
|
+
* alike, such as `issues_list` and `issues.list`, get different names.
|
|
26
|
+
*/
|
|
27
|
+
export declare const routerSkillName: (path: string) => string;
|
|
28
|
+
/** A declared operation's catalog entry without schemas. `router` is its owning router's path. */
|
|
29
|
+
export declare const operationSummary: (name: string, router: string, operation: AppOperation, schedules?: readonly OperationSchedule[]) => Effect.Effect<{
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly router?: string;
|
|
33
|
+
readonly title?: string;
|
|
34
|
+
readonly annotations?: {
|
|
35
|
+
readonly title?: string;
|
|
36
|
+
readonly readOnlyHint?: boolean;
|
|
37
|
+
readonly destructiveHint?: boolean;
|
|
38
|
+
readonly idempotentHint?: boolean;
|
|
39
|
+
readonly openWorldHint?: boolean;
|
|
40
|
+
};
|
|
41
|
+
readonly schedules?: readonly {
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly timing: {
|
|
44
|
+
readonly kind: "interval";
|
|
45
|
+
readonly milliseconds: number;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "cron";
|
|
48
|
+
readonly calendar: {
|
|
49
|
+
readonly expression: string;
|
|
50
|
+
readonly timezone: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly input: Schema.Json;
|
|
54
|
+
readonly scope?: "app";
|
|
55
|
+
}[];
|
|
56
|
+
readonly readOnly?: boolean;
|
|
57
|
+
readonly tags?: readonly string[];
|
|
58
|
+
}, HostDeclarationInvalid, never>;
|
|
59
|
+
/** A declared operation's full description, including rendered schemas. */
|
|
60
|
+
export declare const operationDescription: (name: string, router: string, operation: AppOperation, schedules?: readonly OperationSchedule[]) => Effect.Effect<{
|
|
61
|
+
readonly description: string;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
readonly inputSchema: {
|
|
64
|
+
readonly [x: string]: Schema.Json;
|
|
65
|
+
};
|
|
66
|
+
readonly _meta?: {
|
|
67
|
+
readonly [x: string]: Schema.Json;
|
|
68
|
+
};
|
|
69
|
+
readonly router?: string;
|
|
70
|
+
readonly title?: string;
|
|
71
|
+
readonly annotations?: {
|
|
72
|
+
readonly title?: string;
|
|
73
|
+
readonly readOnlyHint?: boolean;
|
|
74
|
+
readonly destructiveHint?: boolean;
|
|
75
|
+
readonly idempotentHint?: boolean;
|
|
76
|
+
readonly openWorldHint?: boolean;
|
|
77
|
+
};
|
|
78
|
+
readonly outputSchema?: {
|
|
79
|
+
readonly [x: string]: Schema.Json;
|
|
80
|
+
};
|
|
81
|
+
readonly schedules?: readonly {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly timing: {
|
|
84
|
+
readonly kind: "interval";
|
|
85
|
+
readonly milliseconds: number;
|
|
86
|
+
} | {
|
|
87
|
+
readonly kind: "cron";
|
|
88
|
+
readonly calendar: {
|
|
89
|
+
readonly expression: string;
|
|
90
|
+
readonly timezone: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly input: Schema.Json;
|
|
94
|
+
readonly scope?: "app";
|
|
95
|
+
}[];
|
|
96
|
+
readonly readOnly?: boolean;
|
|
97
|
+
readonly tags?: readonly string[];
|
|
98
|
+
}, HostDeclarationInvalid, never>;
|
|
99
|
+
/**
|
|
100
|
+
* A dynamic router over operations already discovered, such as an eager OpenAPI document.
|
|
101
|
+
* Upstream names can contain dots, which static router keys cannot.
|
|
102
|
+
*/
|
|
103
|
+
export declare const fixedRouter: (operations: Readonly<Record<string, AppOperation>>, meta?: RouterMeta) => DynamicRouter;
|
|
104
|
+
export interface CatalogOptions {
|
|
105
|
+
/** Omit schemas. */
|
|
106
|
+
readonly summary: boolean;
|
|
107
|
+
/** Account secrets that a failure's message must not reveal. */
|
|
108
|
+
readonly secrets: readonly string[];
|
|
109
|
+
/** Only these full tool names. Routers with none of them are not read. */
|
|
110
|
+
readonly wanted?: ReadonlySet<string>;
|
|
111
|
+
/** Schedules that target a declared operation, by full name. */
|
|
112
|
+
readonly schedules: (name: string) => readonly OperationSchedule[];
|
|
113
|
+
/**
|
|
114
|
+
* Only declared operations that have schedules. Schedules never target dynamic routers, and
|
|
115
|
+
* their catalogs can be expensive to discover, so none is read.
|
|
116
|
+
*/
|
|
117
|
+
readonly scheduled?: true;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Read a router tree. Every nested router is listed, for grouping; the root only when it has
|
|
121
|
+
* metadata. A nested dynamic source that fails is reported on its router's entry.
|
|
122
|
+
*/
|
|
123
|
+
export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined, options: CatalogOptions) => Effect.Effect<{
|
|
124
|
+
tools: ({
|
|
125
|
+
readonly description: string;
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly inputSchema: {
|
|
128
|
+
readonly [x: string]: Schema.Json;
|
|
129
|
+
};
|
|
130
|
+
readonly _meta?: {
|
|
131
|
+
readonly [x: string]: Schema.Json;
|
|
132
|
+
};
|
|
133
|
+
readonly router?: string;
|
|
134
|
+
readonly title?: string;
|
|
135
|
+
readonly annotations?: {
|
|
136
|
+
readonly title?: string;
|
|
137
|
+
readonly readOnlyHint?: boolean;
|
|
138
|
+
readonly destructiveHint?: boolean;
|
|
139
|
+
readonly idempotentHint?: boolean;
|
|
140
|
+
readonly openWorldHint?: boolean;
|
|
141
|
+
};
|
|
142
|
+
readonly outputSchema?: {
|
|
143
|
+
readonly [x: string]: Schema.Json;
|
|
144
|
+
};
|
|
145
|
+
readonly schedules?: readonly {
|
|
146
|
+
readonly name: string;
|
|
147
|
+
readonly timing: {
|
|
148
|
+
readonly kind: "interval";
|
|
149
|
+
readonly milliseconds: number;
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "cron";
|
|
152
|
+
readonly calendar: {
|
|
153
|
+
readonly expression: string;
|
|
154
|
+
readonly timezone: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
readonly input: Schema.Json;
|
|
158
|
+
readonly scope?: "app";
|
|
159
|
+
}[];
|
|
160
|
+
readonly readOnly?: boolean;
|
|
161
|
+
readonly tags?: readonly string[];
|
|
162
|
+
} | {
|
|
163
|
+
readonly description: string;
|
|
164
|
+
readonly name: string;
|
|
165
|
+
readonly router?: string;
|
|
166
|
+
readonly title?: string;
|
|
167
|
+
readonly annotations?: {
|
|
168
|
+
readonly title?: string;
|
|
169
|
+
readonly readOnlyHint?: boolean;
|
|
170
|
+
readonly destructiveHint?: boolean;
|
|
171
|
+
readonly idempotentHint?: boolean;
|
|
172
|
+
readonly openWorldHint?: boolean;
|
|
173
|
+
};
|
|
174
|
+
readonly schedules?: readonly {
|
|
175
|
+
readonly name: string;
|
|
176
|
+
readonly timing: {
|
|
177
|
+
readonly kind: "interval";
|
|
178
|
+
readonly milliseconds: number;
|
|
179
|
+
} | {
|
|
180
|
+
readonly kind: "cron";
|
|
181
|
+
readonly calendar: {
|
|
182
|
+
readonly expression: string;
|
|
183
|
+
readonly timezone: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
readonly input: Schema.Json;
|
|
187
|
+
readonly scope?: "app";
|
|
188
|
+
}[];
|
|
189
|
+
readonly readOnly?: boolean;
|
|
190
|
+
readonly tags?: readonly string[];
|
|
191
|
+
})[];
|
|
192
|
+
routers: {
|
|
193
|
+
readonly path: string;
|
|
194
|
+
readonly description?: string;
|
|
195
|
+
readonly error?: import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed;
|
|
196
|
+
readonly title?: string;
|
|
197
|
+
readonly icons?: readonly {
|
|
198
|
+
readonly src: string;
|
|
199
|
+
readonly mimeType?: string;
|
|
200
|
+
readonly sizes?: readonly string[];
|
|
201
|
+
readonly theme?: "light" | "dark";
|
|
202
|
+
}[];
|
|
203
|
+
readonly tags?: {
|
|
204
|
+
readonly [x: string]: string;
|
|
205
|
+
};
|
|
206
|
+
readonly skill?: string;
|
|
207
|
+
}[];
|
|
208
|
+
}, import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed, never>;
|
|
209
|
+
/**
|
|
210
|
+
* One skill for each router with instructions. Skills and tools fail independently: a dynamic
|
|
211
|
+
* router whose metadata cannot be read, including the root, contributes no skill and does not
|
|
212
|
+
* fail the others. Metadata comes through each source's catalog cache, like a tool listing.
|
|
213
|
+
*/
|
|
214
|
+
export declare const routerSkills: (root: AppRouter | DynamicRouter | undefined) => Effect.Effect<{
|
|
215
|
+
readonly description: string;
|
|
216
|
+
readonly name: string;
|
|
217
|
+
readonly files: readonly {
|
|
218
|
+
readonly path: string;
|
|
219
|
+
readonly content: string;
|
|
220
|
+
}[];
|
|
221
|
+
readonly license?: string;
|
|
222
|
+
readonly compatibility?: string;
|
|
223
|
+
readonly metadata?: {
|
|
224
|
+
readonly [x: string]: string;
|
|
225
|
+
};
|
|
226
|
+
readonly "allowed-tools"?: string;
|
|
227
|
+
}[], never, never>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { HostedTool } from "../contracts/host.js";
|
|
2
|
+
import type { AppOperation } from "../contracts/operations.js";
|
|
3
|
+
import { RouterMeta, type AppRouter, type DynamicRouter, type RouterIcon } from "../contracts/router.js";
|
|
4
|
+
import type { Approval } from "../approval.js";
|
|
5
|
+
import { type OperationChild, type OperationDeclaration, type RouterChild, type RouterDeclaration } from "./operations.js";
|
|
6
|
+
export type { OperationChild, OperationDeclaration, RouterChild, RouterDeclaration, } from "./operations.js";
|
|
7
|
+
/** Author metadata for a router. Instructions become a skill named after the router's path. */
|
|
8
|
+
export interface RouterOptions {
|
|
9
|
+
readonly title?: string;
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly instructions?: string;
|
|
12
|
+
readonly icons?: readonly RouterIcon[];
|
|
13
|
+
readonly tags?: Readonly<Record<string, string>>;
|
|
14
|
+
}
|
|
15
|
+
/** Wrap a native router. Protocol helpers use this for the routers they build. */
|
|
16
|
+
export declare const routerDeclaration: (node: AppRouter | DynamicRouter) => RouterDeclaration;
|
|
17
|
+
/** Accept only framework-created routers. */
|
|
18
|
+
export declare const nativeRouter: (value: unknown) => AppRouter | DynamicRouter | undefined;
|
|
19
|
+
/** Author fields win; a field the author omits keeps the source's value. */
|
|
20
|
+
export declare const mergeMeta: (base: RouterMeta | undefined, override: RouterMeta | undefined) => RouterMeta | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Group operations and routers under path keys, like tRPC's nested routers, with metadata an
|
|
23
|
+
* agent can read. Passing an existing router instead of children overrides its metadata:
|
|
24
|
+
* `router(mcpRouter(options), { description: "..." })`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function router<Query = unknown, Mutation = unknown>(children: Readonly<Record<string, RouterChild<Query, Mutation>>>, options?: RouterOptions): RouterDeclaration<Query, Mutation>;
|
|
27
|
+
export declare function router<Query, Mutation>(source: RouterDeclaration<Query, Mutation>, options: RouterOptions): RouterDeclaration<Query, Mutation>;
|
|
28
|
+
/**
|
|
29
|
+
* Declare a router whose tools are discovered when read. `list` returns tools with names relative
|
|
30
|
+
* to this router; mark queries with `readOnly: true`. `resolve` receives one of those names.
|
|
31
|
+
* The router carries the handler contexts of the operations `resolve` returns, so `defineApp`
|
|
32
|
+
* checks them like a static router's.
|
|
33
|
+
*/
|
|
34
|
+
export declare const dynamicRouter: <Query = unknown, Mutation = unknown>(source: {
|
|
35
|
+
readonly meta?: () => RouterOptions | Promise<RouterOptions>;
|
|
36
|
+
readonly list: () => readonly HostedTool[] | Promise<readonly HostedTool[]>;
|
|
37
|
+
readonly resolve: (name: string) => OperationChild<Query, Mutation> | undefined | Promise<OperationChild<Query, Mutation> | undefined>;
|
|
38
|
+
}) => RouterDeclaration<Query, Mutation>;
|
|
39
|
+
/** Join a router path and a relative name. The root router's path is "". */
|
|
40
|
+
export declare const joinPath: (path: string, name: string) => string;
|
|
41
|
+
/** Where a full tool name points: a declared operation, or a name inside a dynamic router. */
|
|
42
|
+
export type Location = {
|
|
43
|
+
readonly kind: "operation";
|
|
44
|
+
readonly operation: AppOperation;
|
|
45
|
+
readonly router: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "dynamic";
|
|
48
|
+
readonly source: DynamicRouter;
|
|
49
|
+
readonly router: string;
|
|
50
|
+
readonly name: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Walk static keys until the name ends at an operation or enters a dynamic router, which receives
|
|
54
|
+
* the rest of the name. Static keys contain no dots, so every name has at most one location.
|
|
55
|
+
*/
|
|
56
|
+
export declare const locate: (root: AppRouter | DynamicRouter | undefined, name: string) => Location | undefined;
|
|
57
|
+
/** Every declared operation with its full name and owning router. Dynamic routers are not listed. */
|
|
58
|
+
export declare const declaredOperations: (root: AppRouter | undefined, path?: string) => Array<{
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly router: string;
|
|
61
|
+
readonly operation: AppOperation;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Choose an approval for each operation a router contains, including tools a dynamic router
|
|
65
|
+
* resolves later. `policy` receives the operation and its name relative to this router; returning
|
|
66
|
+
* undefined keeps the operation's own approval. Read hints with `toolAnnotations(operation)`.
|
|
67
|
+
* Apply it to each account's router before `accountRouter` combines them, so every account keeps
|
|
68
|
+
* its own tools' hints.
|
|
69
|
+
*/
|
|
70
|
+
export declare const withApprovals: <Query, Mutation>(source: RouterDeclaration<Query, Mutation>, policy: (operation: OperationDeclaration<"query" | "mutation", never>, name: string) => Approval | undefined) => RouterDeclaration<Query, Mutation>;
|
|
71
|
+
/**
|
|
72
|
+
* Expose a protocol router's tools under other names, such as the names an earlier client used.
|
|
73
|
+
* `rename` receives each tool's name relative to this router and returns the name to expose, or
|
|
74
|
+
* undefined to leave the tool out. When two tools would share a name, the first listed keeps it.
|
|
75
|
+
* Calls and descriptions find a tool by its exposed name. Works on routers that discover their
|
|
76
|
+
* tools, such as `mcpRouter`, `graphqlRouter` and `liveOpenapiRouter`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const renameTools: <Query, Mutation>(source: RouterDeclaration<Query, Mutation>, rename: (name: string) => string | undefined) => RouterDeclaration<Query, Mutation>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Let the runtime run its own tasks between long synchronous steps. In a Worker, a large OpenAPI
|
|
3
|
+
* compilation that never yields leaves the garbage collector only long, full pauses; yielding
|
|
4
|
+
* between steps measurably shortens it. A timer is used because a resolved promise would continue
|
|
5
|
+
* without leaving the current task.
|
|
6
|
+
*/
|
|
7
|
+
export declare const yieldToRuntime: () => Promise<void>;
|
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import { Interval, ScheduleTiming } from "../contracts/schedules.js";
|
|
2
2
|
import { JsonValue } from "../contracts/schema.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { AccountScope } from "../contracts/app.js";
|
|
4
|
+
import { type Operation, type OperationDeclaration, type WithoutApproval } from "./operations.js";
|
|
5
|
+
/**
|
|
6
|
+
* The app adapter resolves this operation handle to its declared mutation name. A `"user"`
|
|
7
|
+
* schedule has one copy per member who enables it, run as them with their linked accounts. An
|
|
8
|
+
* `"app"` schedule is one schedule, enabled by an app manager, run without a caller with the app's
|
|
9
|
+
* accounts only.
|
|
10
|
+
*/
|
|
11
|
+
export interface ScheduleDeclaration<Context = never, Scope extends AccountScope = AccountScope> {
|
|
12
|
+
readonly scope: Scope;
|
|
6
13
|
readonly operation: OperationDeclaration<"mutation", Context>;
|
|
7
14
|
readonly timing: ScheduleTiming;
|
|
8
15
|
readonly input: JsonValue;
|
|
9
16
|
}
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Refuses, with a message the type error shows, a mutation whose handler context has the caller's
|
|
19
|
+
* `user`, such as one that declares a context without a type.
|
|
20
|
+
*/
|
|
21
|
+
type RunsAsApp<Context> = [Context] extends [{
|
|
22
|
+
readonly user: unknown;
|
|
23
|
+
}] ? {
|
|
24
|
+
readonly 'An app schedule runs without a caller: type the handler\'s context as MutationContext<typeof requirements, "app">, pass it as the third type argument, or declare no parameters and pass no type arguments': never;
|
|
25
|
+
} : unknown;
|
|
26
|
+
/** Run an existing mutation at a fixed interval, once per member who enables it, as them. */
|
|
27
|
+
export declare const userInterval: <Input, Output, Context>(duration: Interval, operation: Operation<Input, Output, "mutation", Context>, input: NoInfer<Input>) => ScheduleDeclaration<Context, "user">;
|
|
28
|
+
/**
|
|
29
|
+
* Calendar alternative for wall-clock schedules, once per member who enables it, as them. UTC is the
|
|
30
|
+
* explicit default when timezone is omitted.
|
|
31
|
+
*/
|
|
32
|
+
export declare const userCron: <Input, Output, Context>(calendar: {
|
|
14
33
|
readonly expression: string;
|
|
15
34
|
readonly timezone?: string;
|
|
16
|
-
}, operation: Operation<Input, Output, "mutation", Context>, input: NoInfer<Input>) => ScheduleDeclaration<Context>;
|
|
35
|
+
}, operation: Operation<Input, Output, "mutation", Context>, input: NoInfer<Input>) => ScheduleDeclaration<Context, "user">;
|
|
36
|
+
/**
|
|
37
|
+
* Run an existing mutation at a fixed interval as the app: one schedule an app manager enables, run
|
|
38
|
+
* without a caller with the app's accounts. The mutation takes a context of the `"app"` scope and
|
|
39
|
+
* declares no approval.
|
|
40
|
+
*/
|
|
41
|
+
export declare const appInterval: <Input, Output, Context>(duration: Interval, operation: Operation<Input, Output, "mutation", Context> & WithoutApproval & RunsAsApp<Context>, input: NoInfer<Input>) => ScheduleDeclaration<Context, "app">;
|
|
42
|
+
/** Calendar alternative to `appInterval`. UTC is the explicit default when timezone is omitted. */
|
|
43
|
+
export declare const appCron: <Input, Output, Context>(calendar: {
|
|
44
|
+
readonly expression: string;
|
|
45
|
+
readonly timezone?: string;
|
|
46
|
+
}, operation: Operation<Input, Output, "mutation", Context> & WithoutApproval & RunsAsApp<Context>, input: NoInfer<Input>) => ScheduleDeclaration<Context, "app">;
|
|
47
|
+
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/** Author schema facade. Internals use the native decoder retained by each value. */
|
|
2
2
|
import { Effect, Schema as EffectSchema } from "effect";
|
|
3
|
-
import {
|
|
4
|
-
import type {
|
|
5
|
-
declare const StorageField: unique symbol;
|
|
3
|
+
import { DeclarationInvalid, JsonObject, ValidationError } from "../contracts/schema.js";
|
|
4
|
+
import type { FieldExposure } from "../contracts/provider.js";
|
|
6
5
|
declare const Decoder: unique symbol;
|
|
7
6
|
/** An author-facing value schema. Effect is never required in author code. */
|
|
8
7
|
export interface Schema<T, Optional extends boolean = false> {
|
|
9
|
-
readonly [StorageField]?: Field;
|
|
10
8
|
readonly [Decoder]: EffectSchema.Decoder<T>;
|
|
11
9
|
readonly optionalValue: Optional;
|
|
12
10
|
/** Parse an unknown value; invalid input throws a safe ValidationError. */
|
|
@@ -37,10 +35,22 @@ export interface ObjectSchema<F extends Fields> extends Schema<ObjectValue<F>> {
|
|
|
37
35
|
export declare const decoderOf: <T>(schema: Schema<T, boolean>) => EffectSchema.Decoder<T>;
|
|
38
36
|
/** Recognize schemas made by this author facade when adapting a definition. */
|
|
39
37
|
export declare const isSchema: (value: unknown) => value is Schema<unknown, boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Source that skipped type checking can pass any value where a schema belongs, such as `string`
|
|
40
|
+
* for `string()`. Name the argument and the mistake before a native constructor reads it.
|
|
41
|
+
*/
|
|
42
|
+
export declare const schemaArgument: <S extends Schema<unknown, boolean>>(value: S, role: string) => S;
|
|
40
43
|
/** Decode within an Effect program. Invalid input is omitted from the failure. */
|
|
41
44
|
export declare const parse: <T>(decoder: EffectSchema.Decoder<T>, input: unknown) => Effect.Effect<T, ValidationError>;
|
|
45
|
+
/**
|
|
46
|
+
* Decode an author's declaration, naming every failing path. A declaration with several forms,
|
|
47
|
+
* such as `oauth2()`'s discovered, declared and client credentials endpoints, is explained by the
|
|
48
|
+
* form its author chose (`intended`), so the problems are that form's, including the options it
|
|
49
|
+
* lacks, rather than every other form's objections. Messages never include the supplied values.
|
|
50
|
+
*/
|
|
51
|
+
export declare const parseDeclaration: <T>(decoder: EffectSchema.Decoder<T>, input: unknown, declaration: string, intended?: (input: unknown) => EffectSchema.Decoder<unknown>) => Effect.Effect<T, DeclarationInvalid>;
|
|
42
52
|
/** Present a native decoder through the synchronous author API. */
|
|
43
|
-
export declare function wrap<T, Optional extends boolean>(decoder: EffectSchema.Decoder<T>, optionalValue: Optional
|
|
53
|
+
export declare function wrap<T, Optional extends boolean>(decoder: EffectSchema.Decoder<T>, optionalValue: Optional): Schema<T, Optional>;
|
|
44
54
|
/** A string, optionally with a minimum length. No coercion. */
|
|
45
55
|
export declare function string(options?: {
|
|
46
56
|
readonly minLength?: number;
|
|
@@ -59,6 +69,44 @@ export declare function literal<const T extends string | number | boolean | null
|
|
|
59
69
|
export declare const array: <T>(item: Schema<T, boolean>) => Schema<readonly T[]>;
|
|
60
70
|
/** Parse declared fields and omit undeclared fields. */
|
|
61
71
|
export declare function object<const F extends Fields>(fields: F): ObjectSchema<F>;
|
|
72
|
+
declare const Exposure: unique symbol;
|
|
73
|
+
/** A schema marked with how app code sees the field in a provider that declares hosts. */
|
|
74
|
+
export type Exposed<S, E extends FieldExposure = FieldExposure> = S & {
|
|
75
|
+
readonly [Exposure]: E;
|
|
76
|
+
};
|
|
77
|
+
/** The marking of one account field, if any. */
|
|
78
|
+
export declare const exposureOf: (schema: Schema<unknown, boolean>) => FieldExposure | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* A field that is not secret, such as a subdomain or region. App code reads its real value and
|
|
81
|
+
* the connect form shows it.
|
|
82
|
+
*/
|
|
83
|
+
export declare const plain: <S extends Schema<unknown, boolean>>(schema: S) => Exposed<S, "plain">;
|
|
84
|
+
/**
|
|
85
|
+
* A secret field that app code reads as its real value, for request signing and similar uses.
|
|
86
|
+
* The connect form warns that the app can read it. Prefer an unmarked field, which app code
|
|
87
|
+
* receives as a handle that only reaches the provider's declared hosts.
|
|
88
|
+
*/
|
|
89
|
+
export declare const raw: <S extends Schema<unknown, boolean>>(schema: S) => Exposed<S, "raw">;
|
|
90
|
+
/** Marked fields of an account object, by name. */
|
|
91
|
+
export declare const fieldExposure: (fields: Fields) => Readonly<Record<string, FieldExposure>>;
|
|
92
|
+
declare const Secret: unique symbol;
|
|
93
|
+
/**
|
|
94
|
+
* A secret account value. In a provider that declares hosts it is a handle, which the host's
|
|
95
|
+
* outbound network replaces with the real value only on requests to those hosts. Pass it to
|
|
96
|
+
* clients and headers as an ordinary string; do not decode or transform it.
|
|
97
|
+
*/
|
|
98
|
+
export type SecretString = string & {
|
|
99
|
+
readonly [Secret]: true;
|
|
100
|
+
};
|
|
101
|
+
type Sealed<T> = T extends string ? SecretString : T;
|
|
102
|
+
/** Account fields as app code receives them: unmarked string fields are secret. */
|
|
103
|
+
export type SecretFields<F extends Fields> = {
|
|
104
|
+
readonly [Key in keyof ObjectValue<F>]: Key extends keyof F ? F[Key] extends Exposed<unknown> ? ObjectValue<F>[Key] : Sealed<ObjectValue<F>[Key]> : ObjectValue<F>[Key];
|
|
105
|
+
};
|
|
106
|
+
/** An account object without declared fields, such as a default OAuth projection. */
|
|
107
|
+
export type SecretObject<T> = {
|
|
108
|
+
readonly [Key in keyof T]: Sealed<T[Key]>;
|
|
109
|
+
};
|
|
62
110
|
declare const ImportedJsonSchema: unique symbol;
|
|
63
111
|
/** Read the original document for an imported decoder without a lossy schema round trip. */
|
|
64
112
|
export declare const importedJsonSchema: (decoder: EffectSchema.Decoder<unknown>) => unknown | undefined;
|
|
@@ -72,28 +120,76 @@ export declare const withLazyJsonSchemaDocument: <S extends EffectSchema.Decoder
|
|
|
72
120
|
* Relocate a self-contained JSON Schema under a document pointer. Resolve references
|
|
73
121
|
* before nesting so account schemas can reuse definition names, IDs and anchors.
|
|
74
122
|
* Only schema nodes are rewritten; examples and ordinary property values stay intact.
|
|
123
|
+
* A `$recursiveRef` becomes the pointer to its static target, such as the relocated root. The
|
|
124
|
+
* patched validator applies it like `"#"` was: the recursive anchor in scope, else that target.
|
|
75
125
|
*/
|
|
76
126
|
export declare const nestJsonSchema: (input: JsonObject, pointer: string) => JsonObject;
|
|
127
|
+
/**
|
|
128
|
+
* Self-contained schemas placed side by side in one document, such as the branches of a union.
|
|
129
|
+
* A schema whose references all name its root `$defs` gives those entries to the document's root
|
|
130
|
+
* `$defs` when no entry of the same name differs, so definitions stay where listings share them
|
|
131
|
+
* among tools. Any other schema is relocated with `nestJsonSchema` under `pointer(index)`.
|
|
132
|
+
*/
|
|
133
|
+
export declare const combineJsonSchemas: (schemas: readonly JsonObject[], pointer: (index: number) => string) => {
|
|
134
|
+
readonly $defs?: JsonObject;
|
|
135
|
+
readonly schemas: readonly JsonObject[];
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Whether an input key may be named in a validation problem. Other keys can carry supplied data,
|
|
139
|
+
* so problems locate them without echoing them.
|
|
140
|
+
*/
|
|
141
|
+
export declare const echoableKey: (key: string) => boolean;
|
|
142
|
+
/**
|
|
143
|
+
* The keys an object accepts, as `object {name, optional?}`. `...` marks an object that also
|
|
144
|
+
* accepts other keys. Names come from the schema, never from supplied input.
|
|
145
|
+
*/
|
|
146
|
+
export declare const objectShape: (keys: readonly {
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly optional: boolean;
|
|
149
|
+
}[], open: boolean, limit?: number) => string;
|
|
150
|
+
/**
|
|
151
|
+
* The values a schema fixes, as `"v1"` or `one of "a", "b" and 3 more`. Agents already read
|
|
152
|
+
* these values in the tool's signature, so problems list them, up to {@link maxListedValues}
|
|
153
|
+
* values and {@link maxValuesText} characters. They come from the schema, never from input.
|
|
154
|
+
*/
|
|
155
|
+
export declare const allowedValues: (values: readonly unknown[]) => string;
|
|
156
|
+
/** Keys listed for each union alternative, so several alternatives fit in one problem. */
|
|
157
|
+
export declare const maxAlternativeKeys = 8;
|
|
158
|
+
/**
|
|
159
|
+
* The alternatives a union accepts, as `string or object {id}`, and the key whose value tells
|
|
160
|
+
* them apart. Shapes, values and the key come from the schema, never from supplied input.
|
|
161
|
+
*/
|
|
162
|
+
export declare const unionShape: (alternatives: readonly string[], selector: string | undefined) => string;
|
|
163
|
+
/** The problem for a required key the input omits, with what its schema expects when stated. */
|
|
164
|
+
export declare const missingKey: (expected: string | undefined) => string;
|
|
165
|
+
/** The text every missing-key problem starts with, so the caller can add where the input has it. */
|
|
166
|
+
export declare const missingKeyText = "Missing key";
|
|
167
|
+
/**
|
|
168
|
+
* Whether the imported schema whose check failed may accept a key as an object's own key, for a
|
|
169
|
+
* failure's check; undefined when the check is not an imported schema's.
|
|
170
|
+
*/
|
|
171
|
+
export declare const importedSchemaKeys: (check: object) => ((key: string) => boolean) | undefined;
|
|
77
172
|
/** Prepare an interpreted validator. No eval or generated JavaScript runs in any host. */
|
|
78
173
|
export declare const compileJsonSchemaDecoder: (document: JsonObject) => Effect.Effect<EffectSchema.Codec<EffectSchema.Json, EffectSchema.Json, never, never> & {
|
|
79
174
|
[ImportedJsonSchema]: {
|
|
80
175
|
readonly [x: string]: EffectSchema.Json;
|
|
81
176
|
};
|
|
82
177
|
}, ValidationError, never>;
|
|
178
|
+
export declare const lazyJsonSchemaDecoder: (document: () => JsonObject) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, never, never>;
|
|
83
179
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* without making each one self-contained up front.
|
|
180
|
+
* A lazy decoder and the compilation it decodes with. Running `compile` first lets a caller
|
|
181
|
+
* reject an unsupported schema before a side effect whose result the decoder will check.
|
|
87
182
|
*/
|
|
88
|
-
export declare const
|
|
183
|
+
export declare const preparedJsonSchemaDecoder: (document: JsonObject) => {
|
|
184
|
+
decoder: EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>;
|
|
185
|
+
compile: Effect.Effect<EffectSchema.Decoder<EffectSchema.Json, never>, ValidationError, never>;
|
|
186
|
+
};
|
|
89
187
|
/** Preserve the JSON document; compile its validator only when a value is first decoded. */
|
|
90
188
|
export declare const jsonSchemaDecoder: (input: unknown) => Effect.Effect<EffectSchema.declareConstructor<EffectSchema.Json, EffectSchema.Json, readonly [], EffectSchema.Json>, ValidationError, never>;
|
|
91
189
|
/** Import JSON metadata now; unsupported schemas and invalid values fail when parsed. */
|
|
92
190
|
export declare const jsonSchema: (input: unknown) => Schema<EffectSchema.Json>;
|
|
93
|
-
/**
|
|
94
|
-
export declare const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/** A host user identifier, stored as a string without imposing a product auth model. */
|
|
98
|
-
export declare const userId: () => Schema<string>;
|
|
191
|
+
/** Render a decoder as a JSON Schema document, keeping an imported upstream document as-is. */
|
|
192
|
+
export declare const jsonSchemaDocument: (decoder: EffectSchema.Decoder<unknown>) => Effect.Effect<{
|
|
193
|
+
readonly [x: string]: EffectSchema.Json;
|
|
194
|
+
}, EffectSchema.SchemaError, never>;
|
|
99
195
|
export {};
|
|
@@ -1,35 +1,28 @@
|
|
|
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
|
-
export declare const withService: (service: string | undefined) => <A, R>(effect: Effect.Effect<A, SkillLoadFailed, R>) => Effect.Effect<A, SkillLoadFailed, R>;
|
|
7
|
+
export declare const withService: (service: string | undefined) => <A, R>(effect: Effect.Effect<A, SkillLoadFailed | NetworkRefused, R>) => Effect.Effect<A, NetworkRefused | 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 itself. */
|
|
11
|
+
readonly refused?: (refused: NetworkRefused) => SkillLoadFailed | NetworkRefused;
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
json: (url: string) => Effect.Effect<unknown, SkillLoadFailed, never>;
|
|
15
|
+
fetchBytes: (url: string, request?: ReadRequest & {
|
|
16
|
+
readonly body?: Uint8Array;
|
|
17
|
+
}) => Effect.Effect<Uint8Array<ArrayBuffer>, NetworkRefused | SkillLoadFailed, never>;
|
|
18
|
+
read: (url: string, request?: ReadRequest) => Effect.Effect<string, NetworkRefused | SkillLoadFailed, never>;
|
|
19
|
+
json: (url: string) => Effect.Effect<unknown, NetworkRefused | SkillLoadFailed, never>;
|
|
14
20
|
}, never, never>;
|
|
15
|
-
export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<
|
|
16
|
-
readonly name: string;
|
|
17
|
-
readonly description: 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 | NetworkRefused | 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
|
-
readonly name: string;
|
|
32
24
|
readonly description: string;
|
|
25
|
+
readonly name: string;
|
|
33
26
|
readonly files: readonly {
|
|
34
27
|
readonly path: string;
|
|
35
28
|
readonly content: string;
|
|
@@ -40,4 +33,5 @@ export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) =>
|
|
|
40
33
|
readonly [x: string]: string;
|
|
41
34
|
};
|
|
42
35
|
readonly "allowed-tools"?: string;
|
|
43
|
-
}[], SkillLoadFailed, never>;
|
|
36
|
+
}[], NetworkRefused | SkillLoadFailed, never>;
|
|
37
|
+
export {};
|