apps 0.0.1-beta.1 → 0.0.1-beta.11
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 +65 -43
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-SATWJKN6.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-HDJH3RPR.js → chunk-57RKNWL2.js} +2 -2
- package/js/{chunk-2HHMABB6.js → chunk-5T57N25Q.js} +61 -13
- package/js/{chunk-FW5HBOIK.js → chunk-CDL5PM2Q.js} +307 -169
- package/js/{chunk-X7SFGU4Q.js → chunk-EFAPIRVB.js} +28 -9
- package/js/chunk-GPFVWWDZ.js +209 -0
- package/js/{chunk-OHRT55C4.js → chunk-IJX4CYZO.js} +3 -6
- package/js/{chunk-ZTFQHGEB.js → chunk-IPI4MFSN.js} +3 -5
- package/js/{chunk-YEJOQEII.js → chunk-JU7VHODU.js} +1 -1
- package/js/{chunk-IHQ4ML7K.js → chunk-KRSCJDTW.js} +586 -111
- package/js/chunk-KUMBKVJD.js +39 -0
- package/js/{chunk-EVJUVWN2.js → chunk-M3B3DE4K.js} +2 -2
- package/js/{chunk-ZJWDMTE3.js → chunk-MKWZPDR6.js} +3 -3
- package/js/{chunk-BMOIAIVR.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/chunk-NKLWZJLE.js +172 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-ODEIDRGW.js} +3 -4
- package/js/{chunk-M6ZRRIBI.js → chunk-PJJ24GU7.js} +1 -1
- package/js/{chunk-FZJOYIZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/chunk-R3EV5FTO.js +97 -0
- package/js/{chunk-KOXMLKTM.js → chunk-RELFXUOO.js} +308 -316
- package/js/{chunk-6YBRWRK3.js → chunk-RFVIONFX.js} +43 -14
- package/js/{chunk-RBAC33PQ.js → chunk-TYVDBQSI.js} +58 -83
- package/js/{chunk-QKHR7BMF.js → chunk-UK573G7W.js} +1 -1
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-4LPG6RCH.js → chunk-VFZKSM3T.js} +5 -25
- package/js/{chunk-6IIO4NPI.js → chunk-WVVV4TX2.js} +21 -9
- package/js/{chunk-G7IE6BKC.js → chunk-YBRC463S.js} +8 -8
- package/js/chunk-Z2QY3YTF.js +507 -0
- package/js/{chunk-PLCMJREA.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +10 -26
- package/js/contracts.js +70 -15
- package/js/effect.js +19 -19
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +34 -39
- package/js/host.js +23 -23
- package/js/index.js +199 -195
- package/js/mcp/effect.js +21 -21
- package/js/mcp/stdio.js +25 -25
- package/js/mcp.js +60 -44
- package/js/openapi.js +826 -41682
- package/js/react.js +3 -3
- package/js/skills/effect.js +3 -4
- package/js/skills.js +53 -17
- package/js/storage/facet.js +4 -4
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +4 -4
- package/js/ui/serving.js +9 -8
- 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/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/app.d.ts +7 -6
- package/types/apps/src/contracts/cache.d.ts +4 -1
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/host.d.ts +34 -679
- package/types/apps/src/contracts/mcp.d.ts +16 -0
- package/types/apps/src/contracts/openapi.d.ts +11 -1
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1589 -0
- package/types/apps/src/contracts/protocols/2.d.ts +668 -0
- package/types/apps/src/contracts/protocols/3.d.ts +676 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
- package/types/apps/src/contracts/provider.d.ts +56 -5
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +17 -8
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/cache.d.ts +3 -1
- package/types/apps/src/implementation/catalog-cache.d.ts +9 -2
- package/types/apps/src/implementation/elicitation.d.ts +1 -1
- package/types/apps/src/implementation/failure-detail.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-catalog.d.ts +1 -4
- package/types/apps/src/implementation/mcp-client.d.ts +35 -19
- package/types/apps/src/implementation/mcp.d.ts +35 -19
- package/types/apps/src/implementation/openapi-compile.d.ts +3 -2
- 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 +7 -7
- package/types/apps/src/implementation/operations.d.ts +26 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider.d.ts +9 -4
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +59 -0
- package/types/apps/src/implementation/schema.d.ts +5 -6
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-auth.d.ts +11 -5
- package/types/apps/src/implementation/ui-serving.d.ts +4 -2
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +21 -6
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +5 -4
- package/types/apps/src/openapi.d.ts +6 -6
- package/types/apps/src/skills.d.ts +6 -3
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/js/chunk-PZ36XMXW.js +0 -93
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DatabaseFieldReserved,
|
|
3
|
+
DatabaseLimitExceeded,
|
|
2
4
|
DatabaseSchema
|
|
3
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-N7YDVXYJ.js";
|
|
4
6
|
import {
|
|
7
|
+
CacheCommand,
|
|
8
|
+
CacheReply,
|
|
9
|
+
ProviderError
|
|
10
|
+
} from "./chunk-R3EV5FTO.js";
|
|
11
|
+
import {
|
|
12
|
+
AppSkillName,
|
|
5
13
|
AppSkills,
|
|
6
14
|
SkillLoadFailed
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
OpenapiResponseError
|
|
10
|
-
} from "./chunk-SWPD52J7.js";
|
|
11
|
-
import {
|
|
12
|
-
ProviderError
|
|
13
|
-
} from "./chunk-W7D7WVSY.js";
|
|
15
|
+
} from "./chunk-JU7VHODU.js";
|
|
14
16
|
import {
|
|
15
17
|
AccountId,
|
|
16
18
|
HttpUrl,
|
|
17
19
|
JsonObject as JsonObject2,
|
|
18
20
|
JsonValue
|
|
19
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-27F7W2LG.js";
|
|
20
22
|
import {
|
|
21
23
|
Any,
|
|
22
24
|
ArraySchema,
|
|
@@ -70,7 +72,31 @@ import {
|
|
|
70
72
|
transformOptional,
|
|
71
73
|
withConstructorDefault,
|
|
72
74
|
withDefault
|
|
73
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
76
|
+
|
|
77
|
+
// src/contracts/router.ts
|
|
78
|
+
var reservedRouterKeys = /* @__PURE__ */ new Set([
|
|
79
|
+
"__proto__",
|
|
80
|
+
"constructor",
|
|
81
|
+
"prototype"
|
|
82
|
+
]);
|
|
83
|
+
var RouterKey = Schema_exports.String.check(
|
|
84
|
+
Schema_exports.isPattern(/^[A-Za-z_][A-Za-z0-9_-]{0,99}$/),
|
|
85
|
+
Schema_exports.makeFilter((key) => !reservedRouterKeys.has(key))
|
|
86
|
+
);
|
|
87
|
+
var RouterIcon = Schema_exports.Struct({
|
|
88
|
+
src: Schema_exports.NonEmptyString,
|
|
89
|
+
mimeType: Schema_exports.optionalKey(Schema_exports.String),
|
|
90
|
+
sizes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
91
|
+
theme: Schema_exports.optionalKey(Schema_exports.Literals(["light", "dark"]))
|
|
92
|
+
});
|
|
93
|
+
var RouterMeta = Schema_exports.Struct({
|
|
94
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
95
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
96
|
+
instructions: Schema_exports.optionalKey(Schema_exports.String),
|
|
97
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
98
|
+
tags: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.NonEmptyString, Schema_exports.String))
|
|
99
|
+
});
|
|
74
100
|
|
|
75
101
|
// src/contracts/tools.ts
|
|
76
102
|
var ToolAnnotations = Schema_exports.Struct({
|
|
@@ -124,6 +150,15 @@ var McpToolMetadata = Schema_exports.Struct({
|
|
|
124
150
|
annotations: Schema_exports.optional(ToolAnnotations),
|
|
125
151
|
_meta: Schema_exports.optional(JsonObject2)
|
|
126
152
|
});
|
|
153
|
+
var McpServerHeader = Schema_exports.Struct({
|
|
154
|
+
name: Schema_exports.optionalKey(Schema_exports.String),
|
|
155
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
156
|
+
version: Schema_exports.optionalKey(Schema_exports.String),
|
|
157
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
158
|
+
websiteUrl: Schema_exports.optionalKey(Schema_exports.String),
|
|
159
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
160
|
+
instructions: Schema_exports.optionalKey(Schema_exports.String)
|
|
161
|
+
});
|
|
127
162
|
var McpError = class extends Schema_exports.TaggedError()("McpError", {
|
|
128
163
|
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
129
164
|
reason: Schema_exports.Literals([
|
|
@@ -146,6 +181,44 @@ var ProcessConfig = Schema_exports.Struct({
|
|
|
146
181
|
)
|
|
147
182
|
});
|
|
148
183
|
|
|
184
|
+
// src/contracts/api-response-error.ts
|
|
185
|
+
var ApiErrorRecovery = Schema_exports.Struct({
|
|
186
|
+
action: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(1024)),
|
|
187
|
+
instructions: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(4096))
|
|
188
|
+
});
|
|
189
|
+
var ApiErrorResponse = Schema_exports.Struct({
|
|
190
|
+
code: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)),
|
|
191
|
+
status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 400, maximum: 599 })),
|
|
192
|
+
message: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(4096)),
|
|
193
|
+
recovery: Schema_exports.optionalKey(ApiErrorRecovery)
|
|
194
|
+
});
|
|
195
|
+
var OpenapiResponseError = class extends Schema_exports.TaggedError()(
|
|
196
|
+
"OpenapiResponseError",
|
|
197
|
+
ApiErrorResponse.fields
|
|
198
|
+
) {
|
|
199
|
+
};
|
|
200
|
+
var OpenapiErrorLimits = Schema_exports.Struct({
|
|
201
|
+
maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
202
|
+
readTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
203
|
+
});
|
|
204
|
+
var defaultOpenapiErrorLimits = OpenapiErrorLimits.make({
|
|
205
|
+
maxBodyBytes: 65536,
|
|
206
|
+
readTimeoutMs: 2e3
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// src/contracts/failure.ts
|
|
210
|
+
var maxFailureMessageLength = 2048;
|
|
211
|
+
var FailureSource = Schema_exports.Literals(["app", "storage", "service"]);
|
|
212
|
+
var FailureName = Schema_exports.String.check(Schema_exports.isMaxLength(128));
|
|
213
|
+
var FailureCode = Schema_exports.String.check(Schema_exports.isMaxLength(128));
|
|
214
|
+
var FailureMessage = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength));
|
|
215
|
+
var FailureDetail = {
|
|
216
|
+
source: Schema_exports.optionalKey(FailureSource),
|
|
217
|
+
errorName: Schema_exports.optionalKey(FailureName),
|
|
218
|
+
code: Schema_exports.optionalKey(FailureCode),
|
|
219
|
+
message: Schema_exports.optionalKey(FailureMessage)
|
|
220
|
+
};
|
|
221
|
+
|
|
149
222
|
// src/contracts/workflows.ts
|
|
150
223
|
var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
|
|
151
224
|
var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
@@ -187,7 +260,14 @@ var WorkflowStepOptions = Schema_exports.Struct({
|
|
|
187
260
|
),
|
|
188
261
|
timeout: Schema_exports.optionalKey(WorkflowDuration)
|
|
189
262
|
});
|
|
263
|
+
var WorkflowFailureDetail = {
|
|
264
|
+
step: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(200))),
|
|
265
|
+
errorName: Schema_exports.optionalKey(FailureName),
|
|
266
|
+
message: Schema_exports.optionalKey(FailureMessage)
|
|
267
|
+
};
|
|
268
|
+
var WorkflowRunFailure = Schema_exports.Struct(WorkflowFailureDetail);
|
|
190
269
|
var WorkflowFailure = class extends Schema_exports.TaggedError()("WorkflowFailure", {
|
|
270
|
+
...WorkflowFailureDetail,
|
|
191
271
|
reason: Schema_exports.Literals([
|
|
192
272
|
"unavailable",
|
|
193
273
|
"not_found",
|
|
@@ -235,7 +315,9 @@ var WorkflowRun = Schema_exports.Union([
|
|
|
235
315
|
Schema_exports.Struct({
|
|
236
316
|
...runFields,
|
|
237
317
|
status: Schema_exports.Literal("errored"),
|
|
238
|
-
error: WorkflowFailure.fields.reason
|
|
318
|
+
error: WorkflowFailure.fields.reason,
|
|
319
|
+
/** The failing step and the app's own error, when the run recorded them. */
|
|
320
|
+
failure: Schema_exports.optionalKey(WorkflowRunFailure)
|
|
239
321
|
}),
|
|
240
322
|
Schema_exports.Struct({ ...runFields, status: Schema_exports.Literal("terminated") })
|
|
241
323
|
]);
|
|
@@ -307,41 +389,6 @@ var WorkflowControlCommand = Schema_exports.Union([
|
|
|
307
389
|
Schema_exports.Struct({ operation: Schema_exports.Literal("terminate"), run: WorkflowRunId })
|
|
308
390
|
]);
|
|
309
391
|
|
|
310
|
-
// src/contracts/schedules.ts
|
|
311
|
-
var minimumIntervalMilliseconds = 6e4;
|
|
312
|
-
var count = Schema_exports.Int.check(Schema_exports.isGreaterThan(0));
|
|
313
|
-
var absent = Schema_exports.optionalKey(Schema_exports.Never);
|
|
314
|
-
var Interval = Schema_exports.Union([
|
|
315
|
-
Schema_exports.Struct({ seconds: count, minutes: absent, hours: absent }),
|
|
316
|
-
Schema_exports.Struct({ seconds: absent, minutes: count, hours: absent }),
|
|
317
|
-
Schema_exports.Struct({ seconds: absent, minutes: absent, hours: count })
|
|
318
|
-
]);
|
|
319
|
-
var CalendarSchedule = Schema_exports.Struct({
|
|
320
|
-
expression: Schema_exports.NonEmptyString,
|
|
321
|
-
timezone: Schema_exports.NonEmptyString
|
|
322
|
-
}).check(
|
|
323
|
-
Schema_exports.makeFilter(
|
|
324
|
-
(value) => value.expression.trim().split(/\s+/).length === 5 && Result_exports.isSuccess(Cron_exports.parse(value.expression, value.timezone))
|
|
325
|
-
)
|
|
326
|
-
);
|
|
327
|
-
var ScheduleTiming = Schema_exports.Union([
|
|
328
|
-
Schema_exports.Struct({
|
|
329
|
-
kind: Schema_exports.Literal("interval"),
|
|
330
|
-
milliseconds: Schema_exports.Int.check(
|
|
331
|
-
Schema_exports.makeFilter((value) => value >= minimumIntervalMilliseconds, {
|
|
332
|
-
message: "Schedule intervals must be at least 60 seconds"
|
|
333
|
-
}),
|
|
334
|
-
Schema_exports.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)
|
|
335
|
-
)
|
|
336
|
-
}),
|
|
337
|
-
Schema_exports.Struct({ kind: Schema_exports.Literal("cron"), calendar: CalendarSchedule })
|
|
338
|
-
]);
|
|
339
|
-
var OperationSchedule = Schema_exports.Struct({
|
|
340
|
-
name: Schema_exports.NonEmptyString,
|
|
341
|
-
timing: ScheduleTiming,
|
|
342
|
-
input: JsonValue
|
|
343
|
-
});
|
|
344
|
-
|
|
345
392
|
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/rpc/RpcSchema.js
|
|
346
393
|
var StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
347
394
|
var schema = /* @__PURE__ */ declare(isStream);
|
|
@@ -1767,7 +1814,7 @@ var OAuthSecretClientAuth = Schema_exports.Literals([
|
|
|
1767
1814
|
"client_secret_basic",
|
|
1768
1815
|
"client_secret_basic_raw"
|
|
1769
1816
|
]);
|
|
1770
|
-
var reservedAuthorizationParams =
|
|
1817
|
+
var reservedAuthorizationParams = [
|
|
1771
1818
|
"response_type",
|
|
1772
1819
|
"client_id",
|
|
1773
1820
|
"redirect_uri",
|
|
@@ -1779,17 +1826,39 @@ var reservedAuthorizationParams = /* @__PURE__ */ new Set([
|
|
|
1779
1826
|
"resource",
|
|
1780
1827
|
"request",
|
|
1781
1828
|
"request_uri"
|
|
1782
|
-
]
|
|
1829
|
+
];
|
|
1830
|
+
var reserved = new Set(reservedAuthorizationParams);
|
|
1783
1831
|
var OAuthAuthorizationParams = Schema_exports.Record(Schema_exports.String, Schema_exports.String).check(
|
|
1784
|
-
Schema_exports.makeFilter(
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
)
|
|
1832
|
+
Schema_exports.makeFilter((params) => Object.keys(params).every((key) => !reserved.has(key)), {
|
|
1833
|
+
message: "Authorization parameters cannot replace protocol parameters such as state or scope."
|
|
1834
|
+
})
|
|
1835
|
+
);
|
|
1836
|
+
var declaredAuthorizationQuery = Schema_exports.makeFilter(
|
|
1837
|
+
(config) => {
|
|
1838
|
+
const keys = [...new URL(config.authorizationUrl).searchParams.keys()];
|
|
1839
|
+
const owned = keys.filter((key) => reserved.has(key));
|
|
1840
|
+
if (owned.length > 0)
|
|
1841
|
+
return {
|
|
1842
|
+
path: ["authorizationUrl"],
|
|
1843
|
+
issue: `authorizationUrl cannot set protocol parameters: ${owned.join(", ")}.`
|
|
1844
|
+
};
|
|
1845
|
+
const repeated = keys.filter((key) => Object.hasOwn(config.authorizationParams ?? {}, key));
|
|
1846
|
+
if (repeated.length > 0)
|
|
1847
|
+
return {
|
|
1848
|
+
path: ["authorizationParams"],
|
|
1849
|
+
issue: `Declare each parameter once; authorizationUrl already sets: ${repeated.join(", ")}.`
|
|
1850
|
+
};
|
|
1851
|
+
return void 0;
|
|
1852
|
+
}
|
|
1790
1853
|
);
|
|
1791
1854
|
var oauthOptions = {
|
|
1792
1855
|
grant: Schema_exports.optionalKey(Schema_exports.Literal("authorization_code")),
|
|
1856
|
+
/**
|
|
1857
|
+
* Service-defined authorization request parameters, such as Google's
|
|
1858
|
+
* `{ access_type: "offline", prompt: "consent" }`. Host-owned protocol parameters
|
|
1859
|
+
* (`state`, `scope`, `redirect_uri`, PKCE and the others in `reservedAuthorizationParams`)
|
|
1860
|
+
* are rejected. A discovered endpoint's own query parameter of the same name is replaced.
|
|
1861
|
+
*/
|
|
1793
1862
|
authorizationParams: Schema_exports.optionalKey(OAuthAuthorizationParams),
|
|
1794
1863
|
tokenEndpointAuthMethod: Schema_exports.optionalKey(OAuthClientAuth),
|
|
1795
1864
|
/** Omitted uses discovery; null explicitly suppresses the resource parameter. */
|
|
@@ -1806,6 +1875,7 @@ var OAuth2Config = Schema_exports.Union([
|
|
|
1806
1875
|
}),
|
|
1807
1876
|
Schema_exports.Struct({
|
|
1808
1877
|
...oauthOptions,
|
|
1878
|
+
/** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
|
|
1809
1879
|
authorizationUrl: HttpUrl,
|
|
1810
1880
|
tokenUrl: HttpUrl,
|
|
1811
1881
|
revocationUrl: Schema_exports.optionalKey(HttpUrl),
|
|
@@ -1813,7 +1883,7 @@ var OAuth2Config = Schema_exports.Union([
|
|
|
1813
1883
|
/** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
|
|
1814
1884
|
issuer: Schema_exports.optionalKey(HttpUrl),
|
|
1815
1885
|
discover: Schema_exports.optionalKey(Schema_exports.Never)
|
|
1816
|
-
}),
|
|
1886
|
+
}).check(declaredAuthorizationQuery),
|
|
1817
1887
|
Schema_exports.Struct({
|
|
1818
1888
|
grant: Schema_exports.Literal("client_credentials"),
|
|
1819
1889
|
discover: HttpUrl,
|
|
@@ -1840,6 +1910,16 @@ var OAuth2Method = class extends Data_exports.TaggedClass(
|
|
|
1840
1910
|
"oauth2"
|
|
1841
1911
|
) {
|
|
1842
1912
|
};
|
|
1913
|
+
var displayText = Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(255));
|
|
1914
|
+
var AccountInfo = Schema_exports.Struct({
|
|
1915
|
+
externalId: Schema_exports.optionalKey(displayText),
|
|
1916
|
+
displayName: Schema_exports.optionalKey(displayText),
|
|
1917
|
+
username: Schema_exports.optionalKey(displayText),
|
|
1918
|
+
email: Schema_exports.optionalKey(displayText),
|
|
1919
|
+
avatarUrl: Schema_exports.optionalKey(HttpUrl),
|
|
1920
|
+
profileUrl: Schema_exports.optionalKey(HttpUrl)
|
|
1921
|
+
});
|
|
1922
|
+
var AccountCheckResult = Schema_exports.Struct({ accountInfo: Schema_exports.optionalKey(AccountInfo) });
|
|
1843
1923
|
var Provider = class extends Data_exports.Class {
|
|
1844
1924
|
/** Declare zero or more accounts from this provider without performing I/O. */
|
|
1845
1925
|
many() {
|
|
@@ -1849,10 +1929,66 @@ var Provider = class extends Data_exports.Class {
|
|
|
1849
1929
|
var ManyAccounts = class extends Data_exports.TaggedClass("many") {
|
|
1850
1930
|
};
|
|
1851
1931
|
|
|
1852
|
-
// src/contracts/
|
|
1853
|
-
var
|
|
1932
|
+
// src/contracts/protocol-version.ts
|
|
1933
|
+
var frameworkProtocol = 5;
|
|
1854
1934
|
|
|
1855
|
-
// src/contracts/
|
|
1935
|
+
// src/contracts/schedules.ts
|
|
1936
|
+
var minimumIntervalMilliseconds = 6e4;
|
|
1937
|
+
var count = Schema_exports.Int.check(Schema_exports.isGreaterThan(0));
|
|
1938
|
+
var absent = Schema_exports.optionalKey(Schema_exports.Never);
|
|
1939
|
+
var Interval = Schema_exports.Union([
|
|
1940
|
+
Schema_exports.Struct({ seconds: count, minutes: absent, hours: absent }),
|
|
1941
|
+
Schema_exports.Struct({ seconds: absent, minutes: count, hours: absent }),
|
|
1942
|
+
Schema_exports.Struct({ seconds: absent, minutes: absent, hours: count })
|
|
1943
|
+
]);
|
|
1944
|
+
var CalendarSchedule = Schema_exports.Struct({
|
|
1945
|
+
expression: Schema_exports.NonEmptyString,
|
|
1946
|
+
timezone: Schema_exports.NonEmptyString
|
|
1947
|
+
}).check(
|
|
1948
|
+
Schema_exports.makeFilter(
|
|
1949
|
+
(value) => value.expression.trim().split(/\s+/).length === 5 && Result_exports.isSuccess(Cron_exports.parse(value.expression, value.timezone))
|
|
1950
|
+
)
|
|
1951
|
+
);
|
|
1952
|
+
var ScheduleTiming = Schema_exports.Union([
|
|
1953
|
+
Schema_exports.Struct({
|
|
1954
|
+
kind: Schema_exports.Literal("interval"),
|
|
1955
|
+
milliseconds: Schema_exports.Int.check(
|
|
1956
|
+
Schema_exports.makeFilter((value) => value >= minimumIntervalMilliseconds, {
|
|
1957
|
+
message: "Schedule intervals must be at least 60 seconds"
|
|
1958
|
+
}),
|
|
1959
|
+
Schema_exports.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)
|
|
1960
|
+
)
|
|
1961
|
+
}),
|
|
1962
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("cron"), calendar: CalendarSchedule })
|
|
1963
|
+
]);
|
|
1964
|
+
var OperationSchedule = Schema_exports.Struct({
|
|
1965
|
+
name: Schema_exports.NonEmptyString,
|
|
1966
|
+
timing: ScheduleTiming,
|
|
1967
|
+
input: JsonValue
|
|
1968
|
+
});
|
|
1969
|
+
|
|
1970
|
+
// src/contracts/protocols/1.ts
|
|
1971
|
+
var WorkflowFailure2 = class extends Schema_exports.TaggedError()("WorkflowFailure", {
|
|
1972
|
+
reason: Schema_exports.Literals([
|
|
1973
|
+
"unavailable",
|
|
1974
|
+
"not_found",
|
|
1975
|
+
"input",
|
|
1976
|
+
"output",
|
|
1977
|
+
"operation",
|
|
1978
|
+
"approval",
|
|
1979
|
+
"credentials",
|
|
1980
|
+
"terminated",
|
|
1981
|
+
"execution",
|
|
1982
|
+
"conflict",
|
|
1983
|
+
"engine"
|
|
1984
|
+
]),
|
|
1985
|
+
retryable: Schema_exports.Boolean
|
|
1986
|
+
}) {
|
|
1987
|
+
};
|
|
1988
|
+
var WorkflowRpcResult2 = Schema_exports.Union([
|
|
1989
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: JsonValue }),
|
|
1990
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: WorkflowFailure2 })
|
|
1991
|
+
]);
|
|
1856
1992
|
var DeclaredAuthMethod = Schema_exports.Union([
|
|
1857
1993
|
Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject2 }),
|
|
1858
1994
|
Schema_exports.Struct({
|
|
@@ -1906,6 +2042,11 @@ var ResolvedAccount = Schema_exports.Struct({
|
|
|
1906
2042
|
id: AccountId,
|
|
1907
2043
|
provider: DeclaredProvider,
|
|
1908
2044
|
method: Schema_exports.NonEmptyString,
|
|
2045
|
+
/**
|
|
2046
|
+
* Changes when the account is reconnected or its credentials replaced, not on renewal. Hosts
|
|
2047
|
+
* send it since credential generations; `apps@0.0.1-beta.0` and `beta.1` ignore it.
|
|
2048
|
+
*/
|
|
2049
|
+
generation: Schema_exports.optionalKey(Schema_exports.Int),
|
|
1909
2050
|
fields: JsonObject2
|
|
1910
2051
|
});
|
|
1911
2052
|
var ResolvedAccounts = Schema_exports.Record(
|
|
@@ -1929,16 +2070,7 @@ var HostedToolSummary = HostedTool.mapFields(
|
|
|
1929
2070
|
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
1930
2071
|
);
|
|
1931
2072
|
var SkillSources = Schema_exports.Struct({ skills: AppSkills, dynamic: Schema_exports.Boolean });
|
|
1932
|
-
var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
|
|
1933
2073
|
var SkillCatalogResponse = Schema_exports.Union([SkillSources, AppSkills]);
|
|
1934
|
-
var skillCatalog = (response) => Schema_exports.is(SkillSources)(response) ? response : { skills: response };
|
|
1935
|
-
var inspectCommand = (tools, scheduled) => ({
|
|
1936
|
-
operation: "inspect",
|
|
1937
|
-
...tools === void 0 ? {} : { tools: [...tools] },
|
|
1938
|
-
...scheduled === void 0 ? {} : { scheduled }
|
|
1939
|
-
});
|
|
1940
|
-
var indexCommand = { operation: "inspect", detail: "summary" };
|
|
1941
|
-
var selectTools = (tools) => (all) => tools === void 0 ? all : all.filter((tool) => tools.includes(tool.name));
|
|
1942
2074
|
var HostRequest = Schema_exports.Union([
|
|
1943
2075
|
WorkflowCommand,
|
|
1944
2076
|
WebhookCommand,
|
|
@@ -2036,23 +2168,19 @@ var HostOutputInvalid = class extends Schema_exports.TaggedError()(
|
|
|
2036
2168
|
{}
|
|
2037
2169
|
) {
|
|
2038
2170
|
};
|
|
2039
|
-
var
|
|
2040
|
-
|
|
2171
|
+
var HostError = Schema_exports.Union([
|
|
2172
|
+
OpenapiResponseError,
|
|
2041
2173
|
ProviderError,
|
|
2042
2174
|
McpError,
|
|
2043
2175
|
SkillLoadFailed,
|
|
2176
|
+
WorkflowFailure2,
|
|
2044
2177
|
HostRequestInvalid,
|
|
2045
|
-
HostDeclarationInvalid,
|
|
2046
2178
|
HostAccountsInvalid,
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
var HostCallError = Schema_exports.Union([
|
|
2050
|
-
OpenapiResponseError,
|
|
2051
|
-
WorkflowFailure,
|
|
2052
|
-
HostInspectError,
|
|
2053
|
-
HostToolNotFound,
|
|
2179
|
+
HostDeclarationInvalid,
|
|
2180
|
+
HostEvaluationFailed,
|
|
2054
2181
|
HostOperationNotFound,
|
|
2055
2182
|
HostOperationFailed,
|
|
2183
|
+
HostToolNotFound,
|
|
2056
2184
|
HostInputInvalid,
|
|
2057
2185
|
HostOutputInvalid,
|
|
2058
2186
|
HostToolBlocked,
|
|
@@ -2060,8 +2188,71 @@ var HostCallError = Schema_exports.Union([
|
|
|
2060
2188
|
HostToolPolicyFailed,
|
|
2061
2189
|
ElicitationFailed
|
|
2062
2190
|
]);
|
|
2063
|
-
var
|
|
2064
|
-
|
|
2191
|
+
var HostResponse = Schema_exports.Union([
|
|
2192
|
+
Schema_exports.Struct({
|
|
2193
|
+
ok: Schema_exports.Literal(true),
|
|
2194
|
+
value: JsonValue,
|
|
2195
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2196
|
+
}),
|
|
2197
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError })
|
|
2198
|
+
]);
|
|
2199
|
+
var HostInvocation = Schema_exports.Struct({
|
|
2200
|
+
command: HostRequest,
|
|
2201
|
+
accounts: ResolvedAccounts,
|
|
2202
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
2203
|
+
replay: Schema_exports.optionalKey(WorkflowReplay),
|
|
2204
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
2205
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId)
|
|
2206
|
+
});
|
|
2207
|
+
var protocol1 = {
|
|
2208
|
+
version: 1,
|
|
2209
|
+
schemas: {
|
|
2210
|
+
invocation: HostInvocation,
|
|
2211
|
+
request: HostRequest,
|
|
2212
|
+
response: HostResponse,
|
|
2213
|
+
requirements: DeclaredRequirements,
|
|
2214
|
+
tools: Schema_exports.Array(HostedTool),
|
|
2215
|
+
toolSummaries: Schema_exports.Array(HostedToolSummary),
|
|
2216
|
+
skills: SkillCatalogResponse,
|
|
2217
|
+
elicitationRequest: FormElicitation,
|
|
2218
|
+
elicitationReply: ElicitationReply,
|
|
2219
|
+
workflowStep: WorkflowRpcCommand,
|
|
2220
|
+
workflowStepReply: WorkflowRpcResult2,
|
|
2221
|
+
workflowControl: WorkflowControlCommand,
|
|
2222
|
+
cacheCommand: CacheCommand,
|
|
2223
|
+
cacheReply: CacheReply
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
// src/contracts/protocols/2.ts
|
|
2228
|
+
var SkillSources2 = Schema_exports.Struct({
|
|
2229
|
+
skills: AppSkills,
|
|
2230
|
+
dynamic: Schema_exports.Boolean,
|
|
2231
|
+
cached: Schema_exports.optionalKey(Schema_exports.Boolean)
|
|
2232
|
+
});
|
|
2233
|
+
var SkillCatalogResponse2 = Schema_exports.Union([SkillSources2, AppSkills]);
|
|
2234
|
+
var protocol2 = {
|
|
2235
|
+
version: 2,
|
|
2236
|
+
schemas: { ...protocol1.schemas, skills: SkillCatalogResponse2 }
|
|
2237
|
+
};
|
|
2238
|
+
|
|
2239
|
+
// src/contracts/protocols/3.ts
|
|
2240
|
+
var HostDeclarationInvalid2 = class extends Schema_exports.TaggedError()(
|
|
2241
|
+
"HostDeclarationInvalid",
|
|
2242
|
+
FailureDetail
|
|
2243
|
+
) {
|
|
2244
|
+
};
|
|
2245
|
+
var HostEvaluationFailed2 = class extends Schema_exports.TaggedError()(
|
|
2246
|
+
"HostEvaluationFailed",
|
|
2247
|
+
FailureDetail
|
|
2248
|
+
) {
|
|
2249
|
+
};
|
|
2250
|
+
var HostOperationFailed2 = class extends Schema_exports.TaggedError()(
|
|
2251
|
+
"HostOperationFailed",
|
|
2252
|
+
FailureDetail
|
|
2253
|
+
) {
|
|
2254
|
+
};
|
|
2255
|
+
var HostError2 = Schema_exports.Union([
|
|
2065
2256
|
OpenapiResponseError,
|
|
2066
2257
|
ProviderError,
|
|
2067
2258
|
McpError,
|
|
@@ -2069,10 +2260,12 @@ var HostError = Schema_exports.Union([
|
|
|
2069
2260
|
WorkflowFailure,
|
|
2070
2261
|
HostRequestInvalid,
|
|
2071
2262
|
HostAccountsInvalid,
|
|
2072
|
-
|
|
2073
|
-
|
|
2263
|
+
HostDeclarationInvalid2,
|
|
2264
|
+
HostEvaluationFailed2,
|
|
2074
2265
|
HostOperationNotFound,
|
|
2075
|
-
|
|
2266
|
+
HostOperationFailed2,
|
|
2267
|
+
DatabaseLimitExceeded,
|
|
2268
|
+
DatabaseFieldReserved,
|
|
2076
2269
|
HostToolNotFound,
|
|
2077
2270
|
HostInputInvalid,
|
|
2078
2271
|
HostOutputInvalid,
|
|
@@ -2081,19 +2274,269 @@ var HostError = Schema_exports.Union([
|
|
|
2081
2274
|
HostToolPolicyFailed,
|
|
2082
2275
|
ElicitationFailed
|
|
2083
2276
|
]);
|
|
2084
|
-
var
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2277
|
+
var HostResponse2 = Schema_exports.Union([
|
|
2278
|
+
Schema_exports.Struct({
|
|
2279
|
+
ok: Schema_exports.Literal(true),
|
|
2280
|
+
value: JsonValue,
|
|
2281
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2282
|
+
}),
|
|
2283
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError2 })
|
|
2284
|
+
]);
|
|
2285
|
+
var protocol3 = {
|
|
2286
|
+
version: 3,
|
|
2287
|
+
schemas: {
|
|
2288
|
+
invocation: HostInvocation,
|
|
2289
|
+
request: HostRequest,
|
|
2290
|
+
response: HostResponse2,
|
|
2291
|
+
requirements: DeclaredRequirements,
|
|
2292
|
+
tools: Schema_exports.Array(HostedTool),
|
|
2293
|
+
toolSummaries: Schema_exports.Array(HostedToolSummary),
|
|
2294
|
+
skills: SkillCatalogResponse2,
|
|
2295
|
+
elicitationRequest: FormElicitation,
|
|
2296
|
+
elicitationReply: ElicitationReply,
|
|
2297
|
+
workflowStep: WorkflowRpcCommand,
|
|
2298
|
+
workflowStepReply: WorkflowRpcResult,
|
|
2299
|
+
workflowControl: WorkflowControlCommand,
|
|
2300
|
+
cacheCommand: CacheCommand,
|
|
2301
|
+
cacheReply: CacheReply
|
|
2302
|
+
}
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
// src/contracts/protocols/4.ts
|
|
2306
|
+
var HostedTool2 = Schema_exports.Struct({
|
|
2307
|
+
schedules: Schema_exports.optionalKey(Schema_exports.Array(OperationSchedule)),
|
|
2308
|
+
name: Schema_exports.NonEmptyString,
|
|
2309
|
+
router: Schema_exports.optionalKey(Schema_exports.NonEmptyString),
|
|
2310
|
+
tags: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
2311
|
+
description: Schema_exports.String,
|
|
2312
|
+
inputSchema: JsonObject2,
|
|
2313
|
+
readOnly: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
2314
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
2315
|
+
outputSchema: Schema_exports.optionalKey(JsonObject2),
|
|
2316
|
+
annotations: Schema_exports.optionalKey(ToolAnnotations),
|
|
2317
|
+
_meta: Schema_exports.optionalKey(JsonObject2)
|
|
2318
|
+
});
|
|
2319
|
+
var HostedToolSummary2 = HostedTool2.mapFields(
|
|
2320
|
+
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
2088
2321
|
);
|
|
2089
|
-
var
|
|
2322
|
+
var HostRouterError = Schema_exports.Union([
|
|
2323
|
+
ProviderError,
|
|
2324
|
+
McpError,
|
|
2325
|
+
SkillLoadFailed,
|
|
2326
|
+
HostDeclarationInvalid2,
|
|
2327
|
+
HostEvaluationFailed2
|
|
2328
|
+
]);
|
|
2329
|
+
var HostedRouter = Schema_exports.Struct({
|
|
2330
|
+
path: Schema_exports.String,
|
|
2331
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
2332
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
2333
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
2334
|
+
tags: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.NonEmptyString, Schema_exports.String)),
|
|
2335
|
+
skill: Schema_exports.optionalKey(AppSkillName),
|
|
2336
|
+
error: Schema_exports.optionalKey(HostRouterError)
|
|
2337
|
+
});
|
|
2338
|
+
var HostedCatalog = Schema_exports.Struct({
|
|
2339
|
+
tools: Schema_exports.Array(HostedTool2),
|
|
2340
|
+
routers: Schema_exports.Array(HostedRouter)
|
|
2341
|
+
});
|
|
2342
|
+
var HostedCatalogSummary = Schema_exports.Struct({
|
|
2343
|
+
tools: Schema_exports.Array(HostedToolSummary2),
|
|
2344
|
+
routers: Schema_exports.Array(HostedRouter)
|
|
2345
|
+
});
|
|
2346
|
+
var ToolKind = Schema_exports.Literals(["query", "mutation"]);
|
|
2347
|
+
var HostRequest2 = Schema_exports.Union([
|
|
2348
|
+
WorkflowCommand,
|
|
2349
|
+
WebhookCommand,
|
|
2350
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("requirements") }),
|
|
2351
|
+
Schema_exports.Struct({
|
|
2352
|
+
operation: Schema_exports.Literal("inspect"),
|
|
2353
|
+
/** Omit schemas. Only builds that declare the toolIndex capability accept this. */
|
|
2354
|
+
detail: Schema_exports.optionalKey(Schema_exports.Literal("summary")),
|
|
2355
|
+
/** Describe only these tools. Only builds that declare the toolIndex capability accept this. */
|
|
2356
|
+
tools: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
2357
|
+
/**
|
|
2358
|
+
* Describe only declared operations that have schedules, without dynamic tool discovery.
|
|
2359
|
+
* Only builds that declare the scheduledTools capability accept this.
|
|
2360
|
+
*/
|
|
2361
|
+
scheduled: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2362
|
+
}),
|
|
2363
|
+
Schema_exports.Struct({
|
|
2364
|
+
operation: Schema_exports.Literal("skills"),
|
|
2365
|
+
/** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
|
|
2366
|
+
sources: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2367
|
+
}),
|
|
2368
|
+
Schema_exports.Struct({
|
|
2369
|
+
operation: Schema_exports.Literal("query"),
|
|
2370
|
+
name: Schema_exports.NonEmptyString,
|
|
2371
|
+
input: JsonValue
|
|
2372
|
+
}),
|
|
2373
|
+
Schema_exports.Struct({
|
|
2374
|
+
operation: Schema_exports.Literal("mutate"),
|
|
2375
|
+
name: Schema_exports.NonEmptyString,
|
|
2376
|
+
input: JsonValue
|
|
2377
|
+
}),
|
|
2378
|
+
Schema_exports.Struct({
|
|
2379
|
+
operation: Schema_exports.Literal("call"),
|
|
2380
|
+
tool: Schema_exports.NonEmptyString,
|
|
2381
|
+
/**
|
|
2382
|
+
* The caller's claim; the bundle rejects a call whose tool has the other kind. The host omits
|
|
2383
|
+
* it for a tool its catalog does not list, and then opens storage for writing.
|
|
2384
|
+
*/
|
|
2385
|
+
kind: Schema_exports.optionalKey(ToolKind),
|
|
2386
|
+
input: JsonValue
|
|
2387
|
+
})
|
|
2388
|
+
]);
|
|
2389
|
+
var HostKindMismatch = class extends Schema_exports.TaggedError()("HostKindMismatch", {
|
|
2390
|
+
tool: Schema_exports.NonEmptyString,
|
|
2391
|
+
requested: ToolKind,
|
|
2392
|
+
actual: ToolKind
|
|
2393
|
+
}) {
|
|
2394
|
+
};
|
|
2395
|
+
var HostError3 = Schema_exports.Union([...HostError2.members, HostKindMismatch]);
|
|
2396
|
+
var HostResponse3 = Schema_exports.Union([
|
|
2090
2397
|
Schema_exports.Struct({
|
|
2091
2398
|
ok: Schema_exports.Literal(true),
|
|
2092
2399
|
value: JsonValue,
|
|
2093
2400
|
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2094
2401
|
}),
|
|
2095
|
-
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error:
|
|
2402
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError3 })
|
|
2403
|
+
]);
|
|
2404
|
+
var HostInvocation2 = Schema_exports.Struct({
|
|
2405
|
+
command: HostRequest2,
|
|
2406
|
+
accounts: ResolvedAccounts,
|
|
2407
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
2408
|
+
replay: Schema_exports.optionalKey(WorkflowReplay),
|
|
2409
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
2410
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId)
|
|
2411
|
+
});
|
|
2412
|
+
var protocol4 = {
|
|
2413
|
+
version: 4,
|
|
2414
|
+
schemas: {
|
|
2415
|
+
invocation: HostInvocation2,
|
|
2416
|
+
request: HostRequest2,
|
|
2417
|
+
response: HostResponse3,
|
|
2418
|
+
requirements: DeclaredRequirements,
|
|
2419
|
+
catalog: HostedCatalog,
|
|
2420
|
+
catalogSummary: HostedCatalogSummary,
|
|
2421
|
+
skills: SkillCatalogResponse2,
|
|
2422
|
+
elicitationRequest: FormElicitation,
|
|
2423
|
+
elicitationReply: ElicitationReply,
|
|
2424
|
+
workflowStep: WorkflowRpcCommand,
|
|
2425
|
+
workflowStepReply: WorkflowRpcResult,
|
|
2426
|
+
workflowControl: WorkflowControlCommand,
|
|
2427
|
+
cacheCommand: CacheCommand,
|
|
2428
|
+
cacheReply: CacheReply
|
|
2429
|
+
}
|
|
2430
|
+
};
|
|
2431
|
+
|
|
2432
|
+
// src/contracts/protocols/5.ts
|
|
2433
|
+
var DeclaredRequirements2 = Schema_exports.Struct({
|
|
2434
|
+
/** Protocol support of this retained framework build, not an author-declared requirement. */
|
|
2435
|
+
capabilities: Schema_exports.optionalKey(
|
|
2436
|
+
Schema_exports.Struct({
|
|
2437
|
+
skills: Schema_exports.Literal(true),
|
|
2438
|
+
toolIndex: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
2439
|
+
skillSources: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
2440
|
+
scheduledTools: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2441
|
+
})
|
|
2442
|
+
),
|
|
2443
|
+
database: Schema_exports.optionalKey(DatabaseSchema),
|
|
2444
|
+
accounts: Schema_exports.Record(
|
|
2445
|
+
Schema_exports.NonEmptyString,
|
|
2446
|
+
Schema_exports.Struct({
|
|
2447
|
+
definition: DeclaredProvider,
|
|
2448
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
2449
|
+
/**
|
|
2450
|
+
* The slot's provider defines an account check. Kept beside the definition, not in it, so
|
|
2451
|
+
* adding or editing a check never changes the provider's identity.
|
|
2452
|
+
*/
|
|
2453
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2454
|
+
})
|
|
2455
|
+
)
|
|
2456
|
+
});
|
|
2457
|
+
var AccountCheckCommand = Schema_exports.Struct({
|
|
2458
|
+
operation: Schema_exports.Literal("account-check"),
|
|
2459
|
+
requirement: Schema_exports.NonEmptyString
|
|
2460
|
+
});
|
|
2461
|
+
var HostRequest3 = Schema_exports.Union([
|
|
2462
|
+
...protocol4.schemas.request.members,
|
|
2463
|
+
AccountCheckCommand
|
|
2464
|
+
]);
|
|
2465
|
+
var HostInvocation3 = Schema_exports.Struct({
|
|
2466
|
+
command: HostRequest3,
|
|
2467
|
+
accounts: ResolvedAccounts,
|
|
2468
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
2469
|
+
replay: Schema_exports.optionalKey(WorkflowReplay),
|
|
2470
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
2471
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId)
|
|
2472
|
+
});
|
|
2473
|
+
var protocol5 = {
|
|
2474
|
+
version: 5,
|
|
2475
|
+
schemas: {
|
|
2476
|
+
...protocol4.schemas,
|
|
2477
|
+
invocation: HostInvocation3,
|
|
2478
|
+
request: HostRequest3,
|
|
2479
|
+
requirements: DeclaredRequirements2,
|
|
2480
|
+
accountCheck: AccountCheckResult
|
|
2481
|
+
}
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
// src/contracts/host.ts
|
|
2485
|
+
var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
|
|
2486
|
+
var skillCatalog = (response) => Schema_exports.is(SkillSources2)(response) ? response : { skills: response };
|
|
2487
|
+
var inspectCommand = (tools, scheduled) => ({
|
|
2488
|
+
operation: "inspect",
|
|
2489
|
+
...tools === void 0 ? {} : { tools: [...tools] },
|
|
2490
|
+
...scheduled === void 0 ? {} : { scheduled }
|
|
2491
|
+
});
|
|
2492
|
+
var indexCommand = { operation: "inspect", detail: "summary" };
|
|
2493
|
+
var selectTools = (tools) => (catalog) => tools === void 0 ? catalog : { ...catalog, tools: catalog.tools.filter((tool) => tools.includes(tool.name)) };
|
|
2494
|
+
var HostRequirementsError = Schema_exports.Union([
|
|
2495
|
+
HostRequestInvalid,
|
|
2496
|
+
HostDeclarationInvalid2,
|
|
2497
|
+
DatabaseFieldReserved
|
|
2498
|
+
]);
|
|
2499
|
+
var HostInspectError = Schema_exports.Union([
|
|
2500
|
+
ProviderError,
|
|
2501
|
+
McpError,
|
|
2502
|
+
SkillLoadFailed,
|
|
2503
|
+
HostRequestInvalid,
|
|
2504
|
+
HostDeclarationInvalid2,
|
|
2505
|
+
HostAccountsInvalid,
|
|
2506
|
+
HostEvaluationFailed2
|
|
2507
|
+
]);
|
|
2508
|
+
var HostCallError = Schema_exports.Union([
|
|
2509
|
+
OpenapiResponseError,
|
|
2510
|
+
WorkflowFailure,
|
|
2511
|
+
HostInspectError,
|
|
2512
|
+
HostToolNotFound,
|
|
2513
|
+
HostOperationNotFound,
|
|
2514
|
+
HostKindMismatch,
|
|
2515
|
+
HostOperationFailed2,
|
|
2516
|
+
DatabaseLimitExceeded,
|
|
2517
|
+
HostInputInvalid,
|
|
2518
|
+
HostOutputInvalid,
|
|
2519
|
+
HostToolBlocked,
|
|
2520
|
+
HostToolApprovalRequired,
|
|
2521
|
+
HostToolPolicyFailed,
|
|
2522
|
+
ElicitationFailed
|
|
2523
|
+
]);
|
|
2524
|
+
var HostAccountCheckError = Schema_exports.Union([
|
|
2525
|
+
ProviderError,
|
|
2526
|
+
WorkflowFailure,
|
|
2527
|
+
HostRequestInvalid,
|
|
2528
|
+
HostDeclarationInvalid2,
|
|
2529
|
+
HostAccountsInvalid,
|
|
2530
|
+
HostOperationNotFound,
|
|
2531
|
+
HostOperationFailed2,
|
|
2532
|
+
HostOutputInvalid
|
|
2096
2533
|
]);
|
|
2534
|
+
var HostDataError = HostCallError;
|
|
2535
|
+
var ToolResultObservation = Context_exports.Reference(
|
|
2536
|
+
"apps/ToolResultObservation",
|
|
2537
|
+
{ defaultValue: () => ({ failed: () => {
|
|
2538
|
+
} }) }
|
|
2539
|
+
);
|
|
2097
2540
|
|
|
2098
2541
|
export {
|
|
2099
2542
|
SecretsMethod,
|
|
@@ -2102,8 +2545,14 @@ export {
|
|
|
2102
2545
|
OAuth2Config,
|
|
2103
2546
|
OAuth2AccessToken,
|
|
2104
2547
|
OAuth2Method,
|
|
2548
|
+
AccountInfo,
|
|
2549
|
+
AccountCheckResult,
|
|
2105
2550
|
Provider,
|
|
2106
2551
|
ManyAccounts,
|
|
2552
|
+
reservedRouterKeys,
|
|
2553
|
+
RouterKey,
|
|
2554
|
+
RouterIcon,
|
|
2555
|
+
RouterMeta,
|
|
2107
2556
|
ToolAnnotations,
|
|
2108
2557
|
McpClientLimits,
|
|
2109
2558
|
defaultMcpClientLimits,
|
|
@@ -2111,13 +2560,26 @@ export {
|
|
|
2111
2560
|
McpToolsOptions,
|
|
2112
2561
|
McpToolResult,
|
|
2113
2562
|
McpToolMetadata,
|
|
2563
|
+
McpServerHeader,
|
|
2114
2564
|
McpError,
|
|
2115
2565
|
ProcessConfig,
|
|
2566
|
+
ApiErrorRecovery,
|
|
2567
|
+
ApiErrorResponse,
|
|
2568
|
+
OpenapiResponseError,
|
|
2569
|
+
defaultOpenapiErrorLimits,
|
|
2570
|
+
maxFailureMessageLength,
|
|
2571
|
+
FailureSource,
|
|
2572
|
+
FailureName,
|
|
2573
|
+
FailureCode,
|
|
2574
|
+
FailureMessage,
|
|
2575
|
+
FailureDetail,
|
|
2116
2576
|
WorkflowRunId,
|
|
2117
2577
|
WorkflowName,
|
|
2118
2578
|
workflowDurationMillis,
|
|
2119
2579
|
WorkflowDuration,
|
|
2120
2580
|
WorkflowStepOptions,
|
|
2581
|
+
WorkflowFailureDetail,
|
|
2582
|
+
WorkflowRunFailure,
|
|
2121
2583
|
WorkflowFailure,
|
|
2122
2584
|
NonRetryableError,
|
|
2123
2585
|
WorkflowValue,
|
|
@@ -2129,11 +2591,6 @@ export {
|
|
|
2129
2591
|
WorkflowRpcCommand,
|
|
2130
2592
|
WorkflowRpcResult,
|
|
2131
2593
|
WorkflowControlCommand,
|
|
2132
|
-
minimumIntervalMilliseconds,
|
|
2133
|
-
Interval,
|
|
2134
|
-
CalendarSchedule,
|
|
2135
|
-
ScheduleTiming,
|
|
2136
|
-
OperationSchedule,
|
|
2137
2594
|
ElicitationLimits,
|
|
2138
2595
|
defaultElicitationLimits,
|
|
2139
2596
|
FormElicitation,
|
|
@@ -2151,30 +2608,21 @@ export {
|
|
|
2151
2608
|
ManualWebhookDescriptor,
|
|
2152
2609
|
HostedWebhook,
|
|
2153
2610
|
WebhookCommand,
|
|
2154
|
-
|
|
2611
|
+
frameworkProtocol,
|
|
2612
|
+
minimumIntervalMilliseconds,
|
|
2613
|
+
Interval,
|
|
2614
|
+
CalendarSchedule,
|
|
2615
|
+
ScheduleTiming,
|
|
2616
|
+
OperationSchedule,
|
|
2155
2617
|
DeclaredAuthMethod,
|
|
2156
2618
|
DeclaredProvider,
|
|
2157
|
-
DeclaredRequirements,
|
|
2158
2619
|
ResolvedAccount,
|
|
2159
2620
|
ResolvedAccounts,
|
|
2160
2621
|
TrustedToolApproval,
|
|
2161
2622
|
InvocationDeadline,
|
|
2162
|
-
HostedTool,
|
|
2163
|
-
HostedToolSummary,
|
|
2164
|
-
SkillSources,
|
|
2165
|
-
skillsCommand,
|
|
2166
|
-
SkillCatalogResponse,
|
|
2167
|
-
skillCatalog,
|
|
2168
|
-
inspectCommand,
|
|
2169
|
-
indexCommand,
|
|
2170
|
-
selectTools,
|
|
2171
|
-
HostRequest,
|
|
2172
2623
|
HostRequestInvalid,
|
|
2173
2624
|
HostAccountsInvalid,
|
|
2174
|
-
HostDeclarationInvalid,
|
|
2175
|
-
HostEvaluationFailed,
|
|
2176
2625
|
HostOperationNotFound,
|
|
2177
|
-
HostOperationFailed,
|
|
2178
2626
|
HostToolNotFound,
|
|
2179
2627
|
InputProblem,
|
|
2180
2628
|
maxInputProblems,
|
|
@@ -2183,11 +2631,38 @@ export {
|
|
|
2183
2631
|
HostToolApprovalRequired,
|
|
2184
2632
|
HostToolPolicyFailed,
|
|
2185
2633
|
HostOutputInvalid,
|
|
2634
|
+
protocol1,
|
|
2635
|
+
SkillSources2 as SkillSources,
|
|
2636
|
+
SkillCatalogResponse2 as SkillCatalogResponse,
|
|
2637
|
+
protocol2,
|
|
2638
|
+
HostDeclarationInvalid2 as HostDeclarationInvalid,
|
|
2639
|
+
HostEvaluationFailed2 as HostEvaluationFailed,
|
|
2640
|
+
HostOperationFailed2 as HostOperationFailed,
|
|
2641
|
+
protocol3,
|
|
2642
|
+
HostedTool2 as HostedTool,
|
|
2643
|
+
HostedToolSummary2 as HostedToolSummary,
|
|
2644
|
+
HostRouterError,
|
|
2645
|
+
HostedRouter,
|
|
2646
|
+
HostedCatalog,
|
|
2647
|
+
HostedCatalogSummary,
|
|
2648
|
+
HostKindMismatch,
|
|
2649
|
+
HostError3 as HostError,
|
|
2650
|
+
HostResponse3 as HostResponse,
|
|
2651
|
+
protocol4,
|
|
2652
|
+
DeclaredRequirements2 as DeclaredRequirements,
|
|
2653
|
+
AccountCheckCommand,
|
|
2654
|
+
HostRequest3 as HostRequest,
|
|
2655
|
+
HostInvocation3 as HostInvocation,
|
|
2656
|
+
protocol5,
|
|
2657
|
+
skillsCommand,
|
|
2658
|
+
skillCatalog,
|
|
2659
|
+
inspectCommand,
|
|
2660
|
+
indexCommand,
|
|
2661
|
+
selectTools,
|
|
2186
2662
|
HostRequirementsError,
|
|
2187
2663
|
HostInspectError,
|
|
2188
2664
|
HostCallError,
|
|
2665
|
+
HostAccountCheckError,
|
|
2189
2666
|
HostDataError,
|
|
2190
|
-
|
|
2191
|
-
ToolResultObservation,
|
|
2192
|
-
HostResponse
|
|
2667
|
+
ToolResultObservation
|
|
2193
2668
|
};
|