apps 0.0.1-beta.5 → 0.0.1-beta.55
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 +68 -44
- package/framework-reference.json +1 -1
- package/js/chunk-47F7VXST.js +221 -0
- package/js/chunk-5FHWNLCI.js +88 -0
- package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
- package/js/chunk-7UUHJR2Q.js +49 -0
- package/js/{chunk-CYYBFC2K.js → chunk-AQU56EPI.js} +9 -5
- package/js/chunk-BTSIG4NQ.js +1885 -0
- package/js/chunk-CDXQDN7W.js +92 -0
- package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
- package/js/{chunk-27F7W2LG.js → chunk-H2CJWXA3.js} +2 -2
- package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
- package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
- package/js/{chunk-UDDE5KOR.js → chunk-JK5S2N2S.js} +148 -34
- package/js/{chunk-RJDDBDSN.js → chunk-JM7LOD2W.js} +628 -85
- package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
- package/js/{chunk-FWQC6I3C.js → chunk-KGCTYL2S.js} +523 -63
- package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
- package/js/chunk-L4K2K22P.js +42 -0
- package/js/chunk-LTDHQJ2Z.js +171 -0
- package/js/chunk-MWKHKOTL.js +240 -0
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
- package/js/chunk-PXXZ6ABC.js +266 -0
- package/js/chunk-QEBRH5AP.js +729 -0
- package/js/chunk-TLWLJ7PD.js +4342 -0
- package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
- package/js/{chunk-XHO2ZX6W.js → chunk-UM62MBJQ.js} +96 -41
- package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
- package/js/chunk-XCSG7FT7.js +340 -0
- package/js/client.js +142 -94
- package/js/contracts.js +123 -33
- package/js/effect.js +19 -21
- package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
- package/js/graphql.js +63 -60
- package/js/host.js +83 -60
- package/js/index.js +262 -222
- package/js/mcp/effect.js +23 -23
- package/js/mcp/stdio.js +48 -40
- package/js/mcp.js +109 -72
- package/js/openapi.js +4129 -1419
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -3
- package/js/skills.js +208 -82
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -4
- package/js/ui/serving.js +8517 -214
- package/package.json +2 -3
- package/runtime.json +1 -1
- package/types/app-cache/src/index.d.ts +10 -1
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +9 -8
- package/types/apps/src/contracts/cache.d.ts +20 -0
- package/types/apps/src/contracts/context.d.ts +19 -11
- package/types/apps/src/contracts/elicitation.d.ts +6 -6
- package/types/apps/src/contracts/events.d.ts +93 -0
- package/types/apps/src/contracts/failure.d.ts +30 -1
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +57 -18
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +96 -10
- package/types/apps/src/contracts/network.d.ts +84 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +32 -3
- package/types/apps/src/contracts/openapi.d.ts +45 -9
- package/types/apps/src/contracts/operations.d.ts +8 -9
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/1.d.ts +733 -81
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/2.d.ts +69 -26
- package/types/apps/src/contracts/protocols/3.d.ts +133 -33
- 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 +2476 -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 +115 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +50 -13
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/contracts/ui.d.ts +19 -1
- package/types/apps/src/contracts/workflows.d.ts +6 -0
- 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 +5 -4
- 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 +4 -0
- 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 +59 -0
- package/types/apps/src/implementation/failure-detail.d.ts +25 -3
- 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 +16 -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-stdio.d.ts +1 -1
- 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 +27 -6
- package/types/apps/src/implementation/openapi-document.d.ts +46 -19
- package/types/apps/src/implementation/openapi-names.d.ts +9 -4
- package/types/apps/src/implementation/openapi-request.d.ts +10 -2
- package/types/apps/src/implementation/openapi-source.d.ts +8 -6
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +43 -5
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- 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 +19 -5
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +223 -0
- package/types/apps/src/implementation/router.d.ts +70 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schema.d.ts +95 -11
- 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/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +1 -1
- package/types/apps/src/implementation/ui-client.d.ts +2 -2
- 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 +11 -5
- 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 +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +1 -1
- package/types/apps/src/implementation/workflows.d.ts +1 -1
- package/types/apps/src/index.d.ts +32 -13
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +6 -6
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +10 -8
- 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 +1 -0
- package/types/telemetry/src/layer.d.ts +2 -2
- package/types/telemetry/src/ownership.d.ts +56 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +2 -2
- 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/recorded-message.d.ts +18 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-3XKZDQLM.js +0 -93
- package/js/chunk-4M277YTM.js +0 -136
- package/js/chunk-67EVWIGJ.js +0 -224
- package/js/chunk-C3VAOK5B.js +0 -215
- package/js/chunk-DQAZTA4I.js +0 -2375
- package/js/chunk-G7T27IWB.js +0 -63
- package/js/chunk-LUVSFETN.js +0 -1347
- package/js/chunk-N7YDVXYJ.js +0 -186
- package/js/chunk-PJJ24GU7.js +0 -877
- package/js/chunk-PZB6T6KU.js +0 -19
- package/js/chunk-SB3V4YVR.js +0 -18
- package/js/chunk-TDNYXSIX.js +0 -29
- package/js/chunk-W4DMKWAB.js +0 -35
- package/js/chunk-YEPYT6SD.js +0 -85
- package/js/chunk-ZQINWV4W.js +0 -630
- 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 -18
- 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/storage.d.ts +0 -15
|
@@ -0,0 +1,4342 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CacheCommand,
|
|
3
|
+
CacheReply,
|
|
4
|
+
FailureDetail,
|
|
5
|
+
FailureMessage,
|
|
6
|
+
FailureName,
|
|
7
|
+
ProviderError,
|
|
8
|
+
UpstreamError
|
|
9
|
+
} from "./chunk-MWKHKOTL.js";
|
|
10
|
+
import {
|
|
11
|
+
AppSkillName,
|
|
12
|
+
AppSkills
|
|
13
|
+
} from "./chunk-H72MEDMN.js";
|
|
14
|
+
import {
|
|
15
|
+
RecordedMessage
|
|
16
|
+
} from "./chunk-5FHWNLCI.js";
|
|
17
|
+
import {
|
|
18
|
+
AccountId,
|
|
19
|
+
HttpUrl,
|
|
20
|
+
JsonObject as JsonObject2,
|
|
21
|
+
JsonValue
|
|
22
|
+
} from "./chunk-H2CJWXA3.js";
|
|
23
|
+
import {
|
|
24
|
+
Any,
|
|
25
|
+
ArraySchema,
|
|
26
|
+
Boolean,
|
|
27
|
+
Class2 as Class,
|
|
28
|
+
Context_exports,
|
|
29
|
+
Cron_exports,
|
|
30
|
+
Data_exports,
|
|
31
|
+
Defect,
|
|
32
|
+
Error2,
|
|
33
|
+
Finite,
|
|
34
|
+
Int,
|
|
35
|
+
Json,
|
|
36
|
+
JsonObject,
|
|
37
|
+
Literal,
|
|
38
|
+
Literals,
|
|
39
|
+
Never,
|
|
40
|
+
Opaque,
|
|
41
|
+
Record,
|
|
42
|
+
Result_exports,
|
|
43
|
+
Schema_exports,
|
|
44
|
+
String,
|
|
45
|
+
Struct,
|
|
46
|
+
StructWithRest,
|
|
47
|
+
TemplateLiteral,
|
|
48
|
+
Uint8ArrayFromBase64,
|
|
49
|
+
Union,
|
|
50
|
+
Unknown,
|
|
51
|
+
Void,
|
|
52
|
+
add,
|
|
53
|
+
constFalse,
|
|
54
|
+
constTrue,
|
|
55
|
+
declare,
|
|
56
|
+
decode,
|
|
57
|
+
decodeTo,
|
|
58
|
+
empty,
|
|
59
|
+
flatMap,
|
|
60
|
+
fromUndefinedOr,
|
|
61
|
+
isBetween,
|
|
62
|
+
isSchema,
|
|
63
|
+
isStream,
|
|
64
|
+
make2 as make,
|
|
65
|
+
merge,
|
|
66
|
+
optional,
|
|
67
|
+
optionalKey,
|
|
68
|
+
passthrough2 as passthrough,
|
|
69
|
+
pipeArguments,
|
|
70
|
+
symbol3 as symbol,
|
|
71
|
+
sync2 as sync,
|
|
72
|
+
tag,
|
|
73
|
+
toType,
|
|
74
|
+
transformOptional,
|
|
75
|
+
withConstructorDefault,
|
|
76
|
+
withDefault
|
|
77
|
+
} from "./chunk-IFJU5SYQ.js";
|
|
78
|
+
|
|
79
|
+
// src/contracts/api-response-error.ts
|
|
80
|
+
var maxApiErrorInstructionsLength = 4096;
|
|
81
|
+
var ApiErrorRecovery = Schema_exports.Struct({
|
|
82
|
+
action: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(1024)),
|
|
83
|
+
instructions: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(maxApiErrorInstructionsLength))
|
|
84
|
+
});
|
|
85
|
+
var maxApiErrorMessageLength = 4096;
|
|
86
|
+
var ApiErrorResponse = Schema_exports.Struct({
|
|
87
|
+
code: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)),
|
|
88
|
+
status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 400, maximum: 599 })),
|
|
89
|
+
message: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(maxApiErrorMessageLength)),
|
|
90
|
+
recovery: Schema_exports.optionalKey(ApiErrorRecovery)
|
|
91
|
+
});
|
|
92
|
+
var OpenapiResponseError = class extends Schema_exports.TaggedError()(
|
|
93
|
+
"OpenapiResponseError",
|
|
94
|
+
ApiErrorResponse.fields
|
|
95
|
+
) {
|
|
96
|
+
};
|
|
97
|
+
var OpenapiErrorLimits = Schema_exports.Struct({
|
|
98
|
+
maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
99
|
+
readTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
100
|
+
});
|
|
101
|
+
var defaultOpenapiErrorLimits = OpenapiErrorLimits.make({
|
|
102
|
+
maxBodyBytes: 65536,
|
|
103
|
+
readTimeoutMs: 2e3
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// src/contracts/workflows.ts
|
|
107
|
+
var WorkflowRunId = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
|
|
108
|
+
var WorkflowName = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
109
|
+
var durationUnits = {
|
|
110
|
+
millisecond: 1,
|
|
111
|
+
milliseconds: 1,
|
|
112
|
+
second: 1e3,
|
|
113
|
+
seconds: 1e3,
|
|
114
|
+
minute: 6e4,
|
|
115
|
+
minutes: 6e4,
|
|
116
|
+
hour: 36e5,
|
|
117
|
+
hours: 36e5,
|
|
118
|
+
day: 864e5,
|
|
119
|
+
days: 864e5,
|
|
120
|
+
week: 6048e5,
|
|
121
|
+
weeks: 6048e5
|
|
122
|
+
};
|
|
123
|
+
var workflowDurationMillis = (value) => {
|
|
124
|
+
if (typeof value === "number") return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
125
|
+
const match = /^(\d+(?:\.\d+)?) (milliseconds?|seconds?|minutes?|hours?|days?|weeks?)$/.exec(
|
|
126
|
+
value
|
|
127
|
+
);
|
|
128
|
+
const unit = match?.[2] === void 0 ? void 0 : durationUnits[match[2]];
|
|
129
|
+
if (unit === void 0) return void 0;
|
|
130
|
+
const result = Number(match?.[1]) * unit;
|
|
131
|
+
return Number.isFinite(result) ? result : void 0;
|
|
132
|
+
};
|
|
133
|
+
var WorkflowDuration = Schema_exports.Union([
|
|
134
|
+
Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
135
|
+
Schema_exports.NonEmptyString
|
|
136
|
+
]).check(Schema_exports.makeFilter((value) => workflowDurationMillis(value) !== void 0));
|
|
137
|
+
var WorkflowStepOptions = Schema_exports.Struct({
|
|
138
|
+
retries: Schema_exports.optionalKey(
|
|
139
|
+
Schema_exports.Struct({
|
|
140
|
+
limit: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
141
|
+
delay: WorkflowDuration,
|
|
142
|
+
backoff: Schema_exports.optionalKey(Schema_exports.Literals(["constant", "linear", "exponential"]))
|
|
143
|
+
})
|
|
144
|
+
),
|
|
145
|
+
timeout: Schema_exports.optionalKey(WorkflowDuration)
|
|
146
|
+
});
|
|
147
|
+
var WorkflowFailureDetail = {
|
|
148
|
+
step: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(200))),
|
|
149
|
+
errorName: Schema_exports.optionalKey(FailureName),
|
|
150
|
+
message: Schema_exports.optionalKey(FailureMessage)
|
|
151
|
+
};
|
|
152
|
+
var WorkflowRunFailure = Schema_exports.Struct(WorkflowFailureDetail);
|
|
153
|
+
var WorkflowFailure = class extends Schema_exports.TaggedError()("WorkflowFailure", {
|
|
154
|
+
...WorkflowFailureDetail,
|
|
155
|
+
reason: Schema_exports.Literals([
|
|
156
|
+
"unavailable",
|
|
157
|
+
"not_found",
|
|
158
|
+
"input",
|
|
159
|
+
"output",
|
|
160
|
+
"operation",
|
|
161
|
+
"approval",
|
|
162
|
+
"credentials",
|
|
163
|
+
"terminated",
|
|
164
|
+
"execution",
|
|
165
|
+
"conflict",
|
|
166
|
+
"engine"
|
|
167
|
+
]),
|
|
168
|
+
retryable: Schema_exports.Boolean
|
|
169
|
+
}) {
|
|
170
|
+
/**
|
|
171
|
+
* The step name and error detail are the app's. Its run's owner reads them; telemetry records
|
|
172
|
+
* only the reason, however the failure was built or decoded.
|
|
173
|
+
*/
|
|
174
|
+
get [RecordedMessage]() {
|
|
175
|
+
return this.step === void 0 && this.errorName === void 0 && !this.message ? void 0 : `The workflow failed (${this.reason}); the app's error is not recorded`;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
var NonRetryableError = class extends Error {
|
|
179
|
+
name = "NonRetryableError";
|
|
180
|
+
};
|
|
181
|
+
var WorkflowValue = JsonValue.check(
|
|
182
|
+
Schema_exports.makeFilter(
|
|
183
|
+
(value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 1024 * 1024
|
|
184
|
+
)
|
|
185
|
+
);
|
|
186
|
+
var HostedWorkflow = Schema_exports.Struct({
|
|
187
|
+
name: WorkflowName,
|
|
188
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
189
|
+
inputSchema: JsonObject2,
|
|
190
|
+
outputSchema: Schema_exports.optionalKey(JsonObject2)
|
|
191
|
+
});
|
|
192
|
+
var runFields = {
|
|
193
|
+
profile: Schema_exports.optionalKey(Schema_exports.NonEmptyString),
|
|
194
|
+
id: WorkflowRunId,
|
|
195
|
+
app: Schema_exports.NonEmptyString,
|
|
196
|
+
deployment: Schema_exports.NonEmptyString,
|
|
197
|
+
workflow: WorkflowName,
|
|
198
|
+
createdAt: Schema_exports.String
|
|
199
|
+
};
|
|
200
|
+
var WorkflowRun = Schema_exports.Union([
|
|
201
|
+
Schema_exports.Struct({
|
|
202
|
+
...runFields,
|
|
203
|
+
status: Schema_exports.Literals(["queued", "running", "waiting", "paused", "waitingForPause"])
|
|
204
|
+
}),
|
|
205
|
+
Schema_exports.Struct({ ...runFields, status: Schema_exports.Literal("complete"), output: WorkflowValue }),
|
|
206
|
+
Schema_exports.Struct({
|
|
207
|
+
...runFields,
|
|
208
|
+
status: Schema_exports.Literal("errored"),
|
|
209
|
+
error: WorkflowFailure.fields.reason,
|
|
210
|
+
/** The failing step and the app's own error, when the run recorded them. */
|
|
211
|
+
failure: Schema_exports.optionalKey(WorkflowRunFailure)
|
|
212
|
+
}),
|
|
213
|
+
Schema_exports.Struct({ ...runFields, status: Schema_exports.Literal("terminated") })
|
|
214
|
+
]);
|
|
215
|
+
var WorkflowRunPage = Schema_exports.Struct({
|
|
216
|
+
items: Schema_exports.Array(WorkflowRun),
|
|
217
|
+
next: Schema_exports.optionalKey(WorkflowRunId)
|
|
218
|
+
});
|
|
219
|
+
var WorkflowReplay = Schema_exports.Struct({
|
|
220
|
+
key: Schema_exports.NonEmptyString,
|
|
221
|
+
fingerprint: Schema_exports.NonEmptyString
|
|
222
|
+
});
|
|
223
|
+
var WorkflowCommand = Schema_exports.Union([
|
|
224
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("workflows") }),
|
|
225
|
+
Schema_exports.Struct({
|
|
226
|
+
operation: Schema_exports.Literal("workflow-validate"),
|
|
227
|
+
name: WorkflowName,
|
|
228
|
+
input: JsonValue
|
|
229
|
+
}),
|
|
230
|
+
Schema_exports.Struct({
|
|
231
|
+
operation: Schema_exports.Literal("workflow-run"),
|
|
232
|
+
name: WorkflowName,
|
|
233
|
+
input: JsonValue
|
|
234
|
+
})
|
|
235
|
+
]);
|
|
236
|
+
var WorkflowRpcCommand = Schema_exports.Union([
|
|
237
|
+
Schema_exports.Struct({
|
|
238
|
+
operation: Schema_exports.Literal("do"),
|
|
239
|
+
name: WorkflowName,
|
|
240
|
+
options: WorkflowStepOptions
|
|
241
|
+
}),
|
|
242
|
+
Schema_exports.Struct({
|
|
243
|
+
operation: Schema_exports.Literal("sleep"),
|
|
244
|
+
name: WorkflowName,
|
|
245
|
+
duration: WorkflowDuration
|
|
246
|
+
}),
|
|
247
|
+
Schema_exports.Struct({
|
|
248
|
+
operation: Schema_exports.Literal("until"),
|
|
249
|
+
name: WorkflowName,
|
|
250
|
+
timestamp: Schema_exports.Finite
|
|
251
|
+
}),
|
|
252
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("context") }),
|
|
253
|
+
Schema_exports.Struct({
|
|
254
|
+
operation: Schema_exports.Literal("invoke"),
|
|
255
|
+
kind: Schema_exports.Literals(["query", "mutation"]),
|
|
256
|
+
name: Schema_exports.NonEmptyString,
|
|
257
|
+
input: JsonValue,
|
|
258
|
+
stepId: Schema_exports.NonEmptyString,
|
|
259
|
+
timeout: Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
260
|
+
})
|
|
261
|
+
]);
|
|
262
|
+
var WorkflowRpcResult = Schema_exports.Union([
|
|
263
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: JsonValue }),
|
|
264
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: WorkflowFailure })
|
|
265
|
+
]);
|
|
266
|
+
var WorkflowControlCommand = Schema_exports.Union([
|
|
267
|
+
Schema_exports.Struct({
|
|
268
|
+
operation: Schema_exports.Literal("start"),
|
|
269
|
+
workflow: WorkflowName,
|
|
270
|
+
input: WorkflowValue,
|
|
271
|
+
key: Schema_exports.optionalKey(Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)))
|
|
272
|
+
}),
|
|
273
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("get"), run: WorkflowRunId }),
|
|
274
|
+
Schema_exports.Struct({
|
|
275
|
+
operation: Schema_exports.Literal("list"),
|
|
276
|
+
workflow: Schema_exports.optionalKey(WorkflowName),
|
|
277
|
+
cursor: Schema_exports.optionalKey(WorkflowRunId),
|
|
278
|
+
limit: Schema_exports.optionalKey(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 100 })))
|
|
279
|
+
}),
|
|
280
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("terminate"), run: WorkflowRunId })
|
|
281
|
+
]);
|
|
282
|
+
|
|
283
|
+
// ../app-data/src/contracts/database.ts
|
|
284
|
+
var DataName = Schema_exports.String.check(
|
|
285
|
+
Schema_exports.makeFilter((value) => /^[A-Za-z][A-Za-z0-9_]*$/.test(value) && value.length <= 128)
|
|
286
|
+
);
|
|
287
|
+
var Scalar = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
288
|
+
var Field = Schema_exports.Struct({
|
|
289
|
+
kind: Schema_exports.Literals(["string", "number", "boolean", "id", "userId"]),
|
|
290
|
+
optional: Schema_exports.optional(Schema_exports.Boolean),
|
|
291
|
+
default: Schema_exports.optional(Scalar),
|
|
292
|
+
references: Schema_exports.optional(DataName)
|
|
293
|
+
});
|
|
294
|
+
var Index = Schema_exports.Struct({ name: DataName, fields: Schema_exports.NonEmptyArray(DataName) });
|
|
295
|
+
var Table = Schema_exports.Struct({
|
|
296
|
+
fields: Schema_exports.Record(DataName, Field),
|
|
297
|
+
indexes: Schema_exports.Array(Index)
|
|
298
|
+
});
|
|
299
|
+
var DatabaseSchema = Schema_exports.Record(DataName, Table);
|
|
300
|
+
var Row = Schema_exports.Record(Schema_exports.String, Scalar);
|
|
301
|
+
var RowMetadata = Schema_exports.Struct({
|
|
302
|
+
id: Schema_exports.NonEmptyString,
|
|
303
|
+
createdAt: Schema_exports.String,
|
|
304
|
+
updatedAt: Schema_exports.String
|
|
305
|
+
});
|
|
306
|
+
var Patch = Schema_exports.Record(DataName, Schema_exports.NullOr(Scalar));
|
|
307
|
+
var RangeClause = Schema_exports.Struct({
|
|
308
|
+
field: DataName,
|
|
309
|
+
op: Schema_exports.Literals(["eq", "gt", "gte", "lt", "lte"]),
|
|
310
|
+
value: Schema_exports.NullOr(Scalar)
|
|
311
|
+
});
|
|
312
|
+
var QueryPlan = Schema_exports.Struct({
|
|
313
|
+
table: DataName,
|
|
314
|
+
index: DataName,
|
|
315
|
+
order: Schema_exports.Literals(["asc", "desc"]),
|
|
316
|
+
clauses: Schema_exports.Array(RangeClause)
|
|
317
|
+
});
|
|
318
|
+
var QueryTerminal = Schema_exports.Union([
|
|
319
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("collect") }),
|
|
320
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("count") }),
|
|
321
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("first") }),
|
|
322
|
+
Schema_exports.Struct({
|
|
323
|
+
kind: Schema_exports.Literal("take"),
|
|
324
|
+
count: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
325
|
+
}),
|
|
326
|
+
Schema_exports.Struct({
|
|
327
|
+
kind: Schema_exports.Literal("paginate"),
|
|
328
|
+
cursor: Schema_exports.NullOr(Schema_exports.String),
|
|
329
|
+
numItems: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
330
|
+
})
|
|
331
|
+
]);
|
|
332
|
+
var DatabaseOperation = Schema_exports.Union([
|
|
333
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("get"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
334
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("insert"), table: DataName, value: Patch }),
|
|
335
|
+
Schema_exports.Struct({
|
|
336
|
+
kind: Schema_exports.Literal("update"),
|
|
337
|
+
table: DataName,
|
|
338
|
+
id: Schema_exports.NonEmptyString,
|
|
339
|
+
patch: Patch
|
|
340
|
+
}),
|
|
341
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("delete"), table: DataName, id: Schema_exports.NonEmptyString }),
|
|
342
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("query"), plan: QueryPlan, terminal: QueryTerminal })
|
|
343
|
+
]);
|
|
344
|
+
var PaginationResult = Schema_exports.Struct({
|
|
345
|
+
page: Schema_exports.Array(Row),
|
|
346
|
+
continueCursor: Schema_exports.NullOr(Schema_exports.String),
|
|
347
|
+
isDone: Schema_exports.Boolean
|
|
348
|
+
});
|
|
349
|
+
var OperationResult = Schema_exports.Union([
|
|
350
|
+
Row,
|
|
351
|
+
Schema_exports.Array(Row),
|
|
352
|
+
PaginationResult,
|
|
353
|
+
Schema_exports.Boolean,
|
|
354
|
+
Schema_exports.Finite,
|
|
355
|
+
Schema_exports.Null
|
|
356
|
+
]);
|
|
357
|
+
var AppDatabaseError = class extends Schema_exports.TaggedError()("AppDatabaseError", {
|
|
358
|
+
reason: Schema_exports.Literals([
|
|
359
|
+
"schema",
|
|
360
|
+
"schema_changed",
|
|
361
|
+
"table",
|
|
362
|
+
"index",
|
|
363
|
+
"range",
|
|
364
|
+
"value",
|
|
365
|
+
"readonly",
|
|
366
|
+
"cursor",
|
|
367
|
+
"limit",
|
|
368
|
+
"closed",
|
|
369
|
+
"storage",
|
|
370
|
+
"replay"
|
|
371
|
+
])
|
|
372
|
+
}) {
|
|
373
|
+
};
|
|
374
|
+
var DatabaseLimits = Schema_exports.Struct({
|
|
375
|
+
rowsRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
376
|
+
rowsReturned: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
377
|
+
bytesRead: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
378
|
+
writes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
379
|
+
scanCalls: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
380
|
+
directGets: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
381
|
+
valueBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
382
|
+
indexBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
383
|
+
});
|
|
384
|
+
var defaultDatabaseLimits = {
|
|
385
|
+
rowsRead: 5e3,
|
|
386
|
+
rowsReturned: 1e3,
|
|
387
|
+
bytesRead: 4 * 1024 * 1024,
|
|
388
|
+
writes: 1e3,
|
|
389
|
+
scanCalls: 100,
|
|
390
|
+
directGets: 1e3,
|
|
391
|
+
valueBytes: 64 * 1024,
|
|
392
|
+
indexBytes: 2048
|
|
393
|
+
};
|
|
394
|
+
var DatabaseLimit = Schema_exports.Literals([
|
|
395
|
+
"scanCalls",
|
|
396
|
+
"directGets",
|
|
397
|
+
"rowsRead",
|
|
398
|
+
"rowsReturned",
|
|
399
|
+
"pageSize",
|
|
400
|
+
"bytesRead",
|
|
401
|
+
"writes",
|
|
402
|
+
"valueBytes"
|
|
403
|
+
]);
|
|
404
|
+
var count = (value) => value.toLocaleString("en-US");
|
|
405
|
+
var limitMessages = {
|
|
406
|
+
scanCalls: (maximum, requested) => `This invocation made ${count(requested)} index queries; the limit is ${count(maximum)}. Each first(), take(), collect(), count() or paginate() call on withIndex(...) counts once. Read related rows with one take() or paginate() over a shared index prefix instead of one first() per item, use get(id) for known IDs, or split the work across workflow steps.`,
|
|
407
|
+
directGets: (maximum, requested) => `This invocation made ${count(requested)} get(id) calls, including those made by update and delete; the limit is ${count(maximum)}. Split the work across workflow steps or mutations.`,
|
|
408
|
+
rowsRead: (maximum, requested) => `This invocation read ${count(requested)} rows; the limit is ${count(maximum)}. Read fewer rows per call, through an index or a LIMIT, or split the work across calls or workflow steps.`,
|
|
409
|
+
rowsReturned: (maximum, requested) => `This invocation returned ${count(requested)} rows; the limit is ${count(maximum)}. collect() fails rather than truncating. Page with paginate() across calls or workflow steps.`,
|
|
410
|
+
pageSize: (maximum, requested) => `One call asked for ${count(requested)} rows; take(n) and paginate({ numItems }) accept at most ${count(maximum)}. Page with paginate() across calls or workflow steps.`,
|
|
411
|
+
bytesRead: (maximum, requested) => `This invocation read ${count(requested)} bytes; the limit is ${count(maximum)}. Read fewer or smaller rows per call, or page with paginate() across calls or workflow steps.`,
|
|
412
|
+
writes: (maximum, requested) => `This invocation wrote ${count(requested)} rows; the limit is ${count(maximum)}. Split large ingests into batches, one batch per mutation or workflow step.`,
|
|
413
|
+
valueBytes: (maximum, requested) => `A row encodes to ${count(requested)} bytes; each row may use at most ${count(maximum)}. Store large content outside the row or split it across rows.`
|
|
414
|
+
};
|
|
415
|
+
var DatabaseLimitExceeded = class extends Schema_exports.TaggedError()(
|
|
416
|
+
"DatabaseLimitExceeded",
|
|
417
|
+
{
|
|
418
|
+
limit: DatabaseLimit,
|
|
419
|
+
maximum: Schema_exports.Int,
|
|
420
|
+
requested: Schema_exports.Int
|
|
421
|
+
}
|
|
422
|
+
) {
|
|
423
|
+
get message() {
|
|
424
|
+
return limitMessages[this.limit](this.maximum, this.requested);
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
var reservedFieldNames = ["id", "createdAt", "updatedAt"];
|
|
428
|
+
var DatabaseFieldReserved = class extends Schema_exports.TaggedError()(
|
|
429
|
+
"DatabaseFieldReserved",
|
|
430
|
+
{
|
|
431
|
+
table: Schema_exports.String,
|
|
432
|
+
field: Schema_exports.Literals(reservedFieldNames)
|
|
433
|
+
}
|
|
434
|
+
) {
|
|
435
|
+
get message() {
|
|
436
|
+
return `Table "${this.table}" declares "${this.field}", which is reserved: the host adds id, createdAt and updatedAt to every row. Rename the field, or use the row's own ${this.field}.`;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
var DatabaseRuntimeLimits = Schema_exports.Struct({
|
|
440
|
+
maxCursorChars: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
441
|
+
connectionCacheCapacity: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
442
|
+
connectionCacheTtlMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
443
|
+
});
|
|
444
|
+
var defaultDatabaseRuntimeLimits = DatabaseRuntimeLimits.make({
|
|
445
|
+
maxCursorChars: 8192,
|
|
446
|
+
connectionCacheCapacity: 64,
|
|
447
|
+
connectionCacheTtlMs: 5 * 60 * 1e3
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
// src/contracts/sql.ts
|
|
451
|
+
var reservedTablePrefix = "_executor_";
|
|
452
|
+
var migrationsDirectory = "migrations";
|
|
453
|
+
|
|
454
|
+
// ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/rpc/RpcSchema.js
|
|
455
|
+
var StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
|
|
456
|
+
var schema = /* @__PURE__ */ declare(isStream);
|
|
457
|
+
function Stream(success, error) {
|
|
458
|
+
return make(schema.ast, {
|
|
459
|
+
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
460
|
+
success,
|
|
461
|
+
error
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
// ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/rpc/Rpc.js
|
|
466
|
+
var TypeId = "~effect/rpc/Rpc";
|
|
467
|
+
var Proto = {
|
|
468
|
+
[TypeId]: TypeId,
|
|
469
|
+
pipe() {
|
|
470
|
+
return pipeArguments(this, arguments);
|
|
471
|
+
},
|
|
472
|
+
setSuccess(successSchema) {
|
|
473
|
+
return makeProto({
|
|
474
|
+
_tag: this._tag,
|
|
475
|
+
payloadSchema: this.payloadSchema,
|
|
476
|
+
successSchema,
|
|
477
|
+
errorSchema: this.errorSchema,
|
|
478
|
+
defectSchema: this.defectSchema,
|
|
479
|
+
annotations: this.annotations,
|
|
480
|
+
middlewares: this.middlewares
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
setError(errorSchema) {
|
|
484
|
+
return makeProto({
|
|
485
|
+
_tag: this._tag,
|
|
486
|
+
payloadSchema: this.payloadSchema,
|
|
487
|
+
successSchema: this.successSchema,
|
|
488
|
+
errorSchema,
|
|
489
|
+
defectSchema: this.defectSchema,
|
|
490
|
+
annotations: this.annotations,
|
|
491
|
+
middlewares: this.middlewares
|
|
492
|
+
});
|
|
493
|
+
},
|
|
494
|
+
setPayload(payloadSchema) {
|
|
495
|
+
return makeProto({
|
|
496
|
+
_tag: this._tag,
|
|
497
|
+
payloadSchema: isSchema(payloadSchema) ? payloadSchema : Struct(payloadSchema),
|
|
498
|
+
successSchema: this.successSchema,
|
|
499
|
+
errorSchema: this.errorSchema,
|
|
500
|
+
defectSchema: this.defectSchema,
|
|
501
|
+
annotations: this.annotations,
|
|
502
|
+
middlewares: this.middlewares
|
|
503
|
+
});
|
|
504
|
+
},
|
|
505
|
+
middleware(middleware) {
|
|
506
|
+
return makeProto({
|
|
507
|
+
_tag: this._tag,
|
|
508
|
+
payloadSchema: this.payloadSchema,
|
|
509
|
+
successSchema: this.successSchema,
|
|
510
|
+
errorSchema: this.errorSchema,
|
|
511
|
+
defectSchema: this.defectSchema,
|
|
512
|
+
annotations: this.annotations,
|
|
513
|
+
middlewares: /* @__PURE__ */ new Set([...this.middlewares, middleware])
|
|
514
|
+
});
|
|
515
|
+
},
|
|
516
|
+
prefix(prefix) {
|
|
517
|
+
return makeProto({
|
|
518
|
+
_tag: `${prefix}${this._tag}`,
|
|
519
|
+
payloadSchema: this.payloadSchema,
|
|
520
|
+
successSchema: this.successSchema,
|
|
521
|
+
errorSchema: this.errorSchema,
|
|
522
|
+
defectSchema: this.defectSchema,
|
|
523
|
+
annotations: this.annotations,
|
|
524
|
+
middlewares: this.middlewares
|
|
525
|
+
});
|
|
526
|
+
},
|
|
527
|
+
annotate(tag2, value) {
|
|
528
|
+
return makeProto({
|
|
529
|
+
_tag: this._tag,
|
|
530
|
+
payloadSchema: this.payloadSchema,
|
|
531
|
+
successSchema: this.successSchema,
|
|
532
|
+
errorSchema: this.errorSchema,
|
|
533
|
+
defectSchema: this.defectSchema,
|
|
534
|
+
middlewares: this.middlewares,
|
|
535
|
+
annotations: add(this.annotations, tag2, value)
|
|
536
|
+
});
|
|
537
|
+
},
|
|
538
|
+
annotateMerge(context) {
|
|
539
|
+
return makeProto({
|
|
540
|
+
_tag: this._tag,
|
|
541
|
+
payloadSchema: this.payloadSchema,
|
|
542
|
+
successSchema: this.successSchema,
|
|
543
|
+
errorSchema: this.errorSchema,
|
|
544
|
+
defectSchema: this.defectSchema,
|
|
545
|
+
middlewares: this.middlewares,
|
|
546
|
+
annotations: merge(this.annotations, context)
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
var makeProto = (options) => {
|
|
551
|
+
function Rpc() {
|
|
552
|
+
}
|
|
553
|
+
Object.setPrototypeOf(Rpc, Proto);
|
|
554
|
+
Object.assign(Rpc, options);
|
|
555
|
+
Rpc.key = `effect/rpc/Rpc/${options._tag}`;
|
|
556
|
+
return Rpc;
|
|
557
|
+
};
|
|
558
|
+
var make2 = (tag2, options) => {
|
|
559
|
+
const successSchema = options?.success ?? Void;
|
|
560
|
+
const errorSchema = options?.error ?? Never;
|
|
561
|
+
const defectSchema = options?.defect ?? Defect();
|
|
562
|
+
let payloadSchema;
|
|
563
|
+
if (options?.primaryKey) {
|
|
564
|
+
payloadSchema = class Payload extends Class(`effect/rpc/Rpc/${tag2}`)(options.payload) {
|
|
565
|
+
[symbol]() {
|
|
566
|
+
return options.primaryKey(this);
|
|
567
|
+
}
|
|
568
|
+
};
|
|
569
|
+
} else {
|
|
570
|
+
payloadSchema = isSchema(options?.payload) ? options?.payload : options?.payload ? Struct(options?.payload) : Void;
|
|
571
|
+
}
|
|
572
|
+
return makeProto({
|
|
573
|
+
_tag: tag2,
|
|
574
|
+
payloadSchema,
|
|
575
|
+
successSchema: options?.stream ? Stream(successSchema, errorSchema) : successSchema,
|
|
576
|
+
errorSchema: options?.stream ? Never : errorSchema,
|
|
577
|
+
defectSchema,
|
|
578
|
+
annotations: empty(),
|
|
579
|
+
middlewares: /* @__PURE__ */ new Set()
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
// ../../node_modules/.bun/effect@4.0.1/node_modules/effect/dist/ai/McpSchema.js
|
|
584
|
+
var optionalWithDefault = (schema2, defaultValue) => {
|
|
585
|
+
const effect = sync(defaultValue);
|
|
586
|
+
return optionalKey(schema2).pipe(decode({
|
|
587
|
+
decode: withDefault(effect),
|
|
588
|
+
encode: passthrough()
|
|
589
|
+
}), withConstructorDefault(effect));
|
|
590
|
+
};
|
|
591
|
+
var optional2 = (schema2) => optionalKey(schema2).pipe(decodeTo(toType(optional(schema2)), {
|
|
592
|
+
decode: passthrough(),
|
|
593
|
+
encode: transformOptional(flatMap(fromUndefinedOr))
|
|
594
|
+
}));
|
|
595
|
+
var RequestId = /* @__PURE__ */ Union([String, Finite]);
|
|
596
|
+
var ProgressToken = /* @__PURE__ */ Union([String, Finite]);
|
|
597
|
+
var RequestMeta = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
598
|
+
_meta: /* @__PURE__ */ optional2(/* @__PURE__ */ StructWithRest(/* @__PURE__ */ Struct({
|
|
599
|
+
/**
|
|
600
|
+
* If specified, the caller is requesting out-of-band progress notifications
|
|
601
|
+
* for this request (as represented by notifications/progress). The value of
|
|
602
|
+
* this parameter is an opaque token that will be attached to any subsequent
|
|
603
|
+
* notifications. The receiver is not obligated to provide these
|
|
604
|
+
* notifications.
|
|
605
|
+
*/
|
|
606
|
+
progressToken: /* @__PURE__ */ optional2(ProgressToken)
|
|
607
|
+
}), [JsonObject]))
|
|
608
|
+
}))) {
|
|
609
|
+
};
|
|
610
|
+
var ResultMeta = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
611
|
+
/**
|
|
612
|
+
* This result property is reserved by the protocol to allow clients and
|
|
613
|
+
* servers to attach additional metadata to their responses.
|
|
614
|
+
*/
|
|
615
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
616
|
+
}))) {
|
|
617
|
+
};
|
|
618
|
+
var NotificationMeta = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
619
|
+
/**
|
|
620
|
+
* This parameter name is reserved by MCP to allow clients and servers to
|
|
621
|
+
* attach additional metadata to their notifications.
|
|
622
|
+
*/
|
|
623
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
624
|
+
}))) {
|
|
625
|
+
};
|
|
626
|
+
var Cursor = String;
|
|
627
|
+
var PaginatedRequestMeta = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
628
|
+
...RequestMeta.fields,
|
|
629
|
+
/**
|
|
630
|
+
* An opaque token representing the current pagination position.
|
|
631
|
+
* If provided, the server should return results starting after this cursor.
|
|
632
|
+
*/
|
|
633
|
+
cursor: /* @__PURE__ */ optional2(Cursor)
|
|
634
|
+
}))) {
|
|
635
|
+
};
|
|
636
|
+
var PaginatedResultMeta = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
637
|
+
...ResultMeta.fields,
|
|
638
|
+
/**
|
|
639
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
640
|
+
* If present, there may be more results available.
|
|
641
|
+
*/
|
|
642
|
+
nextCursor: /* @__PURE__ */ optional2(Cursor)
|
|
643
|
+
}))) {
|
|
644
|
+
};
|
|
645
|
+
var Role = /* @__PURE__ */ Literals(["user", "assistant"]);
|
|
646
|
+
var Annotations = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
647
|
+
/**
|
|
648
|
+
* Describes who the intended customer of this object or data is.
|
|
649
|
+
*
|
|
650
|
+
* It can include multiple entries to indicate content useful for multiple
|
|
651
|
+
* audiences (e.g., `["user", "assistant"]`).
|
|
652
|
+
*/
|
|
653
|
+
audience: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Role)),
|
|
654
|
+
/**
|
|
655
|
+
* Describes how important this data is for operating the server.
|
|
656
|
+
*
|
|
657
|
+
* A value of 1 means "most important," and indicates that the data is
|
|
658
|
+
* effectively required, while 0 means "least important," and indicates that
|
|
659
|
+
* the data is entirely optional.
|
|
660
|
+
*/
|
|
661
|
+
priority: /* @__PURE__ */ optional2(/* @__PURE__ */ Finite.check(/* @__PURE__ */ isBetween({
|
|
662
|
+
minimum: 0,
|
|
663
|
+
maximum: 1
|
|
664
|
+
}))),
|
|
665
|
+
/**
|
|
666
|
+
* The last time the annotated object was modified, formatted as an ISO 8601
|
|
667
|
+
* timestamp.
|
|
668
|
+
*/
|
|
669
|
+
lastModified: /* @__PURE__ */ optional2(String)
|
|
670
|
+
}))) {
|
|
671
|
+
};
|
|
672
|
+
var Icon = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/Icon")({
|
|
673
|
+
/**
|
|
674
|
+
* URI containing the icon image.
|
|
675
|
+
*/
|
|
676
|
+
src: String,
|
|
677
|
+
/**
|
|
678
|
+
* MIME type of the icon, when known.
|
|
679
|
+
*/
|
|
680
|
+
mimeType: /* @__PURE__ */ optional2(String),
|
|
681
|
+
/**
|
|
682
|
+
* Sizes supported by the icon, such as `"48x48"` or `"any"`.
|
|
683
|
+
*/
|
|
684
|
+
sizes: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String)),
|
|
685
|
+
/**
|
|
686
|
+
* Color theme for which the icon was designed.
|
|
687
|
+
*/
|
|
688
|
+
theme: /* @__PURE__ */ optional2(/* @__PURE__ */ Literals(["light", "dark"]))
|
|
689
|
+
})) {
|
|
690
|
+
};
|
|
691
|
+
var Implementation = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
692
|
+
name: String,
|
|
693
|
+
title: /* @__PURE__ */ optional2(String),
|
|
694
|
+
version: String,
|
|
695
|
+
icons: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Icon)),
|
|
696
|
+
description: /* @__PURE__ */ optional2(String),
|
|
697
|
+
websiteUrl: /* @__PURE__ */ optional2(String)
|
|
698
|
+
}))) {
|
|
699
|
+
};
|
|
700
|
+
var ClientCapabilities = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ClientCapabilities")({
|
|
701
|
+
/**
|
|
702
|
+
* Experimental, non-standard capabilities that the client supports.
|
|
703
|
+
*/
|
|
704
|
+
experimental: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, /* @__PURE__ */ Struct({}))),
|
|
705
|
+
/**
|
|
706
|
+
* Optional extensions capabilities advertised by the client.
|
|
707
|
+
* Keys are extension identifiers following <vendor-prefix>/<extension-name> (e.g. "io.modelcontextprotocol/ui").
|
|
708
|
+
*/
|
|
709
|
+
extensions: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(/* @__PURE__ */ TemplateLiteral([String, "/", String]), Json)),
|
|
710
|
+
/**
|
|
711
|
+
* Present if the client supports listing roots.
|
|
712
|
+
*/
|
|
713
|
+
roots: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
714
|
+
/**
|
|
715
|
+
* Whether the client supports notifications for changes to the roots list.
|
|
716
|
+
*/
|
|
717
|
+
listChanged: /* @__PURE__ */ optional2(Boolean)
|
|
718
|
+
})),
|
|
719
|
+
/**
|
|
720
|
+
* Present if the client supports sampling from an LLM.
|
|
721
|
+
*/
|
|
722
|
+
sampling: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
723
|
+
/**
|
|
724
|
+
* Present if the client supports context inclusion during sampling.
|
|
725
|
+
*/
|
|
726
|
+
context: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({})),
|
|
727
|
+
/**
|
|
728
|
+
* Present if the client supports tool use during sampling.
|
|
729
|
+
*/
|
|
730
|
+
tools: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({}))
|
|
731
|
+
})),
|
|
732
|
+
/**
|
|
733
|
+
* Present if the client supports elicitation from the server.
|
|
734
|
+
*/
|
|
735
|
+
elicitation: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
736
|
+
/**
|
|
737
|
+
* Present if the client supports form-mode elicitation.
|
|
738
|
+
*/
|
|
739
|
+
form: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({})),
|
|
740
|
+
/**
|
|
741
|
+
* Present if the client supports URL-mode elicitation.
|
|
742
|
+
*/
|
|
743
|
+
url: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({}))
|
|
744
|
+
}))
|
|
745
|
+
})) {
|
|
746
|
+
};
|
|
747
|
+
var ServerCapabilities = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
748
|
+
/**
|
|
749
|
+
* Experimental, non-standard capabilities that the server supports.
|
|
750
|
+
*/
|
|
751
|
+
experimental: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, /* @__PURE__ */ Struct({}))),
|
|
752
|
+
/**
|
|
753
|
+
* Optional extensions capabilities advertised by the server.
|
|
754
|
+
* Keys are extension identifiers following <vendor-prefix>/<extension-name> (e.g. "io.modelcontextprotocol/ui").
|
|
755
|
+
*/
|
|
756
|
+
extensions: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(/* @__PURE__ */ TemplateLiteral([String, "/", String]), Json)),
|
|
757
|
+
/**
|
|
758
|
+
* Present if the server supports sending log messages to the client.
|
|
759
|
+
*/
|
|
760
|
+
logging: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({})),
|
|
761
|
+
/**
|
|
762
|
+
* Present if the server supports argument autocompletion suggestions.
|
|
763
|
+
*/
|
|
764
|
+
completions: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({})),
|
|
765
|
+
/**
|
|
766
|
+
* Present if the server offers any prompt templates.
|
|
767
|
+
*/
|
|
768
|
+
prompts: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
769
|
+
/**
|
|
770
|
+
* Whether this server supports notifications for changes to the prompt list.
|
|
771
|
+
*/
|
|
772
|
+
listChanged: /* @__PURE__ */ optional2(Boolean)
|
|
773
|
+
})),
|
|
774
|
+
/**
|
|
775
|
+
* Present if the server offers any resources to read.
|
|
776
|
+
*/
|
|
777
|
+
resources: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
778
|
+
/**
|
|
779
|
+
* Whether this server supports subscribing to resource updates.
|
|
780
|
+
*/
|
|
781
|
+
subscribe: /* @__PURE__ */ optional2(Boolean),
|
|
782
|
+
/**
|
|
783
|
+
* Whether this server supports notifications for changes to the resource list.
|
|
784
|
+
*/
|
|
785
|
+
listChanged: /* @__PURE__ */ optional2(Boolean)
|
|
786
|
+
})),
|
|
787
|
+
/**
|
|
788
|
+
* Present if the server offers any tools to call.
|
|
789
|
+
*/
|
|
790
|
+
tools: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct({
|
|
791
|
+
/**
|
|
792
|
+
* Whether this server supports notifications for changes to the tool list.
|
|
793
|
+
*/
|
|
794
|
+
listChanged: /* @__PURE__ */ optional2(Boolean)
|
|
795
|
+
}))
|
|
796
|
+
}))) {
|
|
797
|
+
};
|
|
798
|
+
var McpErrorBase = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/McpErrorBase")({
|
|
799
|
+
/**
|
|
800
|
+
* The error type that occurred.
|
|
801
|
+
*/
|
|
802
|
+
code: Int,
|
|
803
|
+
/**
|
|
804
|
+
* A short description of the error. The message SHOULD be limited to a
|
|
805
|
+
* concise single sentence.
|
|
806
|
+
*/
|
|
807
|
+
message: String,
|
|
808
|
+
/**
|
|
809
|
+
* Additional information about the error. The value of this member is
|
|
810
|
+
* defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
811
|
+
*/
|
|
812
|
+
data: /* @__PURE__ */ optional2(Any)
|
|
813
|
+
})) {
|
|
814
|
+
};
|
|
815
|
+
var INVALID_REQUEST_ERROR_CODE = -32600;
|
|
816
|
+
var METHOD_NOT_FOUND_ERROR_CODE = -32601;
|
|
817
|
+
var INVALID_PARAMS_ERROR_CODE = -32602;
|
|
818
|
+
var INTERNAL_ERROR_CODE = -32603;
|
|
819
|
+
var PARSE_ERROR_CODE = -32700;
|
|
820
|
+
var ParseError = class extends (/* @__PURE__ */ Error2("effect/ai/McpSchema/ParseError")({
|
|
821
|
+
...McpErrorBase.fields,
|
|
822
|
+
_tag: /* @__PURE__ */ tag("ParseError"),
|
|
823
|
+
code: /* @__PURE__ */ tag(PARSE_ERROR_CODE)
|
|
824
|
+
})) {
|
|
825
|
+
};
|
|
826
|
+
var InvalidRequest = class extends (/* @__PURE__ */ Error2("effect/ai/McpSchema/InvalidRequest")({
|
|
827
|
+
...McpErrorBase.fields,
|
|
828
|
+
_tag: /* @__PURE__ */ tag("InvalidRequest"),
|
|
829
|
+
code: /* @__PURE__ */ tag(INVALID_REQUEST_ERROR_CODE)
|
|
830
|
+
})) {
|
|
831
|
+
};
|
|
832
|
+
var MethodNotFound = class extends (/* @__PURE__ */ Error2("effect/ai/McpSchema/MethodNotFound")({
|
|
833
|
+
...McpErrorBase.fields,
|
|
834
|
+
_tag: /* @__PURE__ */ tag("MethodNotFound"),
|
|
835
|
+
code: /* @__PURE__ */ tag(METHOD_NOT_FOUND_ERROR_CODE)
|
|
836
|
+
})) {
|
|
837
|
+
};
|
|
838
|
+
var InvalidParams = class extends (/* @__PURE__ */ Error2("effect/ai/McpSchema/InvalidParams")({
|
|
839
|
+
...McpErrorBase.fields,
|
|
840
|
+
_tag: /* @__PURE__ */ tag("InvalidParams"),
|
|
841
|
+
code: /* @__PURE__ */ tag(INVALID_PARAMS_ERROR_CODE)
|
|
842
|
+
})) {
|
|
843
|
+
};
|
|
844
|
+
var InternalError = class _InternalError extends (/* @__PURE__ */ Error2("effect/ai/McpSchema/InternalError")({
|
|
845
|
+
...McpErrorBase.fields,
|
|
846
|
+
_tag: /* @__PURE__ */ tag("InternalError"),
|
|
847
|
+
code: /* @__PURE__ */ tag(INTERNAL_ERROR_CODE)
|
|
848
|
+
})) {
|
|
849
|
+
static notImplemented = /* @__PURE__ */ new _InternalError({
|
|
850
|
+
message: "Not implemented"
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
var McpError = /* @__PURE__ */ Union([ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpErrorBase]);
|
|
854
|
+
var InitializeResult = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
855
|
+
...ResultMeta.fields,
|
|
856
|
+
/**
|
|
857
|
+
* The version of the Model Context Protocol that the server wants to use.
|
|
858
|
+
* This may not match the version that the client requested. If the client
|
|
859
|
+
* cannot support this version, it MUST disconnect.
|
|
860
|
+
*/
|
|
861
|
+
protocolVersion: String,
|
|
862
|
+
capabilities: ServerCapabilities,
|
|
863
|
+
serverInfo: Implementation,
|
|
864
|
+
/**
|
|
865
|
+
* Instructions describing how to use the server and its features.
|
|
866
|
+
*
|
|
867
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
868
|
+
* tools, resources, etc. It can be thought of like a "hint" to the model.
|
|
869
|
+
* For example, this information MAY be added to the system prompt.
|
|
870
|
+
*/
|
|
871
|
+
instructions: /* @__PURE__ */ optional2(String)
|
|
872
|
+
}))) {
|
|
873
|
+
};
|
|
874
|
+
var Initialize = class extends (/* @__PURE__ */ make2("initialize", {
|
|
875
|
+
success: InitializeResult,
|
|
876
|
+
error: McpError,
|
|
877
|
+
payload: {
|
|
878
|
+
...RequestMeta.fields,
|
|
879
|
+
/**
|
|
880
|
+
* The latest version of the Model Context Protocol that the client
|
|
881
|
+
* supports. The client MAY decide to support older versions as well.
|
|
882
|
+
*/
|
|
883
|
+
protocolVersion: String,
|
|
884
|
+
/**
|
|
885
|
+
* Capabilities a client may support. Known capabilities are defined here,
|
|
886
|
+
* in this schema, but this is not a closed set: any client can define its
|
|
887
|
+
* own, additional capabilities.
|
|
888
|
+
*/
|
|
889
|
+
capabilities: ClientCapabilities,
|
|
890
|
+
/**
|
|
891
|
+
* Describes the name and version of an MCP implementation.
|
|
892
|
+
*/
|
|
893
|
+
clientInfo: Implementation
|
|
894
|
+
}
|
|
895
|
+
})) {
|
|
896
|
+
};
|
|
897
|
+
var CancelledNotification = class extends (/* @__PURE__ */ make2("notifications/cancelled", {
|
|
898
|
+
payload: {
|
|
899
|
+
...NotificationMeta.fields,
|
|
900
|
+
/**
|
|
901
|
+
* The ID of the request to cancel.
|
|
902
|
+
*
|
|
903
|
+
* This MUST correspond to the ID of a request previously issued in the
|
|
904
|
+
* same direction.
|
|
905
|
+
*/
|
|
906
|
+
requestId: RequestId,
|
|
907
|
+
/**
|
|
908
|
+
* An optional string describing the reason for the cancellation. This MAY
|
|
909
|
+
* be logged or presented to the user.
|
|
910
|
+
*/
|
|
911
|
+
reason: /* @__PURE__ */ optional2(String)
|
|
912
|
+
}
|
|
913
|
+
})) {
|
|
914
|
+
};
|
|
915
|
+
var ProgressNotification = class extends (/* @__PURE__ */ make2("notifications/progress", {
|
|
916
|
+
payload: {
|
|
917
|
+
...NotificationMeta.fields,
|
|
918
|
+
/**
|
|
919
|
+
* The progress token which was given in the initial request, used to
|
|
920
|
+
* associate this notification with the request that is proceeding.
|
|
921
|
+
*/
|
|
922
|
+
progressToken: ProgressToken,
|
|
923
|
+
/**
|
|
924
|
+
* The progress thus far. This should increase every time progress is made,
|
|
925
|
+
* even if the total is unknown.
|
|
926
|
+
*/
|
|
927
|
+
progress: Finite,
|
|
928
|
+
/**
|
|
929
|
+
* Total number of items to process (or total progress required), if known.
|
|
930
|
+
*/
|
|
931
|
+
total: /* @__PURE__ */ optional2(Finite),
|
|
932
|
+
/**
|
|
933
|
+
* An optional message describing the current progress.
|
|
934
|
+
*/
|
|
935
|
+
message: /* @__PURE__ */ optional2(String)
|
|
936
|
+
}
|
|
937
|
+
})) {
|
|
938
|
+
};
|
|
939
|
+
var Resource = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/Resource")({
|
|
940
|
+
/**
|
|
941
|
+
* The URI of this resource.
|
|
942
|
+
*/
|
|
943
|
+
uri: String,
|
|
944
|
+
/**
|
|
945
|
+
* A human-readable name for this resource.
|
|
946
|
+
*
|
|
947
|
+
* This can be used by clients to populate UI elements.
|
|
948
|
+
*/
|
|
949
|
+
name: String,
|
|
950
|
+
title: /* @__PURE__ */ optional2(String),
|
|
951
|
+
/**
|
|
952
|
+
* A description of what this resource represents.
|
|
953
|
+
*
|
|
954
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
955
|
+
* resources. It can be thought of like a "hint" to the model.
|
|
956
|
+
*/
|
|
957
|
+
description: /* @__PURE__ */ optional2(String),
|
|
958
|
+
/**
|
|
959
|
+
* The MIME type of this resource, if known.
|
|
960
|
+
*/
|
|
961
|
+
mimeType: /* @__PURE__ */ optional2(String),
|
|
962
|
+
/**
|
|
963
|
+
* Optional annotations for the client.
|
|
964
|
+
*/
|
|
965
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
966
|
+
/**
|
|
967
|
+
* Icons that clients can display for this resource.
|
|
968
|
+
*/
|
|
969
|
+
icons: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Icon)),
|
|
970
|
+
/**
|
|
971
|
+
* The size of the raw resource content, in bytes (i.e., before base64
|
|
972
|
+
* encoding or any tokenization), if known.
|
|
973
|
+
*
|
|
974
|
+
* This can be used by Hosts to display file sizes and estimate context
|
|
975
|
+
* window usage.
|
|
976
|
+
*/
|
|
977
|
+
size: /* @__PURE__ */ optional2(Int),
|
|
978
|
+
/**
|
|
979
|
+
* Optional additional metadata for the client.
|
|
980
|
+
*
|
|
981
|
+
* This parameter name is reserved by MCP to allow clients and servers to
|
|
982
|
+
* attach additional metadata to resources.
|
|
983
|
+
*/
|
|
984
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
985
|
+
})) {
|
|
986
|
+
};
|
|
987
|
+
var ResourceTemplate = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ResourceTemplate")({
|
|
988
|
+
/**
|
|
989
|
+
* A URI template (according to RFC 6570) that can be used to construct
|
|
990
|
+
* resource URIs.
|
|
991
|
+
*/
|
|
992
|
+
uriTemplate: String,
|
|
993
|
+
/**
|
|
994
|
+
* A human-readable name for the type of resource this template refers to.
|
|
995
|
+
*
|
|
996
|
+
* This can be used by clients to populate UI elements.
|
|
997
|
+
*/
|
|
998
|
+
name: String,
|
|
999
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1000
|
+
/**
|
|
1001
|
+
* A description of what this template is for.
|
|
1002
|
+
*
|
|
1003
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
1004
|
+
* resources. It can be thought of like a "hint" to the model.
|
|
1005
|
+
*/
|
|
1006
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1007
|
+
/**
|
|
1008
|
+
* The MIME type for all resources that match this template. This should only
|
|
1009
|
+
* be included if all resources matching this template have the same type.
|
|
1010
|
+
*/
|
|
1011
|
+
mimeType: /* @__PURE__ */ optional2(String),
|
|
1012
|
+
/**
|
|
1013
|
+
* Optional annotations for the client.
|
|
1014
|
+
*/
|
|
1015
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
1016
|
+
/**
|
|
1017
|
+
* Icons that clients can display for this resource template.
|
|
1018
|
+
*/
|
|
1019
|
+
icons: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Icon)),
|
|
1020
|
+
/**
|
|
1021
|
+
* Optional additional metadata for the client.
|
|
1022
|
+
*/
|
|
1023
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1024
|
+
})) {
|
|
1025
|
+
};
|
|
1026
|
+
var ResourceContents = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1027
|
+
/**
|
|
1028
|
+
* The URI of this resource.
|
|
1029
|
+
*/
|
|
1030
|
+
uri: String,
|
|
1031
|
+
/**
|
|
1032
|
+
* The MIME type of this resource, if known.
|
|
1033
|
+
*/
|
|
1034
|
+
mimeType: /* @__PURE__ */ optional2(String),
|
|
1035
|
+
/**
|
|
1036
|
+
* Optional additional metadata for the client.
|
|
1037
|
+
*/
|
|
1038
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1039
|
+
}))) {
|
|
1040
|
+
};
|
|
1041
|
+
var TextResourceContents = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1042
|
+
...ResourceContents.fields,
|
|
1043
|
+
/**
|
|
1044
|
+
* The text of the item. This must only be set if the item can actually be
|
|
1045
|
+
* represented as text (not binary data).
|
|
1046
|
+
*/
|
|
1047
|
+
text: String
|
|
1048
|
+
}))) {
|
|
1049
|
+
};
|
|
1050
|
+
var BlobResourceContents = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1051
|
+
...ResourceContents.fields,
|
|
1052
|
+
/**
|
|
1053
|
+
* The binary data of the item decoded from a base64-encoded string.
|
|
1054
|
+
*/
|
|
1055
|
+
blob: Uint8ArrayFromBase64
|
|
1056
|
+
}))) {
|
|
1057
|
+
};
|
|
1058
|
+
var ListResourcesResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ListResourcesResult")({
|
|
1059
|
+
...PaginatedResultMeta.fields,
|
|
1060
|
+
resources: /* @__PURE__ */ ArraySchema(Resource)
|
|
1061
|
+
})) {
|
|
1062
|
+
};
|
|
1063
|
+
var ListResourceTemplatesResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ListResourceTemplatesResult")({
|
|
1064
|
+
...PaginatedResultMeta.fields,
|
|
1065
|
+
resourceTemplates: /* @__PURE__ */ ArraySchema(ResourceTemplate)
|
|
1066
|
+
})) {
|
|
1067
|
+
};
|
|
1068
|
+
var ReadResourceResult = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1069
|
+
...ResultMeta.fields,
|
|
1070
|
+
contents: /* @__PURE__ */ ArraySchema(/* @__PURE__ */ Union([TextResourceContents, BlobResourceContents]))
|
|
1071
|
+
}))) {
|
|
1072
|
+
};
|
|
1073
|
+
var ReadResource = class extends (/* @__PURE__ */ make2("resources/read", {
|
|
1074
|
+
success: ReadResourceResult,
|
|
1075
|
+
error: McpError,
|
|
1076
|
+
payload: {
|
|
1077
|
+
...RequestMeta.fields,
|
|
1078
|
+
/**
|
|
1079
|
+
* The URI of the resource to read. The URI can use any protocol; it is up
|
|
1080
|
+
* to the server how to interpret it.
|
|
1081
|
+
*/
|
|
1082
|
+
uri: String
|
|
1083
|
+
}
|
|
1084
|
+
})) {
|
|
1085
|
+
};
|
|
1086
|
+
var Subscribe = class extends (/* @__PURE__ */ make2("resources/subscribe", {
|
|
1087
|
+
success: /* @__PURE__ */ Struct({}),
|
|
1088
|
+
error: McpError,
|
|
1089
|
+
payload: {
|
|
1090
|
+
...RequestMeta.fields,
|
|
1091
|
+
/**
|
|
1092
|
+
* The URI of the resource to subscribe to. The URI can use any protocol;
|
|
1093
|
+
* it is up to the server how to interpret it.
|
|
1094
|
+
*/
|
|
1095
|
+
uri: String
|
|
1096
|
+
}
|
|
1097
|
+
})) {
|
|
1098
|
+
};
|
|
1099
|
+
var Unsubscribe = class extends (/* @__PURE__ */ make2("resources/unsubscribe", {
|
|
1100
|
+
success: /* @__PURE__ */ Struct({}),
|
|
1101
|
+
error: McpError,
|
|
1102
|
+
payload: {
|
|
1103
|
+
...RequestMeta.fields,
|
|
1104
|
+
/**
|
|
1105
|
+
* The URI of the resource to subscribe to. The URI can use any protocol;
|
|
1106
|
+
* it is up to the server how to interpret it.
|
|
1107
|
+
*/
|
|
1108
|
+
uri: String
|
|
1109
|
+
}
|
|
1110
|
+
})) {
|
|
1111
|
+
};
|
|
1112
|
+
var ResourceUpdatedNotification = class extends (/* @__PURE__ */ make2("notifications/resources/updated", {
|
|
1113
|
+
payload: {
|
|
1114
|
+
...NotificationMeta.fields,
|
|
1115
|
+
/**
|
|
1116
|
+
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
1117
|
+
*/
|
|
1118
|
+
uri: String
|
|
1119
|
+
}
|
|
1120
|
+
})) {
|
|
1121
|
+
};
|
|
1122
|
+
var PromptArgument = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1123
|
+
/**
|
|
1124
|
+
* The name of the argument.
|
|
1125
|
+
*/
|
|
1126
|
+
name: String,
|
|
1127
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1128
|
+
/**
|
|
1129
|
+
* A human-readable description of the argument.
|
|
1130
|
+
*/
|
|
1131
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1132
|
+
/**
|
|
1133
|
+
* Whether this argument must be provided.
|
|
1134
|
+
*/
|
|
1135
|
+
required: /* @__PURE__ */ optional2(Boolean)
|
|
1136
|
+
}))) {
|
|
1137
|
+
};
|
|
1138
|
+
var Prompt = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/Prompt")({
|
|
1139
|
+
/**
|
|
1140
|
+
* The name of the prompt or prompt template.
|
|
1141
|
+
*/
|
|
1142
|
+
name: String,
|
|
1143
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1144
|
+
/**
|
|
1145
|
+
* An optional description of what this prompt provides
|
|
1146
|
+
*/
|
|
1147
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1148
|
+
/**
|
|
1149
|
+
* A list of arguments to use for templating the prompt.
|
|
1150
|
+
*/
|
|
1151
|
+
arguments: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(PromptArgument)),
|
|
1152
|
+
/**
|
|
1153
|
+
* Icons that clients can display for this prompt.
|
|
1154
|
+
*/
|
|
1155
|
+
icons: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Icon)),
|
|
1156
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1157
|
+
})) {
|
|
1158
|
+
};
|
|
1159
|
+
var TextContent = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1160
|
+
type: /* @__PURE__ */ tag("text"),
|
|
1161
|
+
/**
|
|
1162
|
+
* The text content of the message.
|
|
1163
|
+
*/
|
|
1164
|
+
text: String,
|
|
1165
|
+
/**
|
|
1166
|
+
* Optional annotations for the client.
|
|
1167
|
+
*/
|
|
1168
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
1169
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1170
|
+
}))) {
|
|
1171
|
+
};
|
|
1172
|
+
var ImageContent = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1173
|
+
type: /* @__PURE__ */ tag("image"),
|
|
1174
|
+
/**
|
|
1175
|
+
* The image data.
|
|
1176
|
+
*/
|
|
1177
|
+
data: Uint8ArrayFromBase64,
|
|
1178
|
+
/**
|
|
1179
|
+
* The MIME type of the image. Different providers may support different
|
|
1180
|
+
* image types.
|
|
1181
|
+
*/
|
|
1182
|
+
mimeType: String,
|
|
1183
|
+
/**
|
|
1184
|
+
* Optional annotations for the client.
|
|
1185
|
+
*/
|
|
1186
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
1187
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1188
|
+
}))) {
|
|
1189
|
+
};
|
|
1190
|
+
var AudioContent = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1191
|
+
type: /* @__PURE__ */ tag("audio"),
|
|
1192
|
+
/**
|
|
1193
|
+
* The audio data.
|
|
1194
|
+
*/
|
|
1195
|
+
data: Uint8ArrayFromBase64,
|
|
1196
|
+
/**
|
|
1197
|
+
* The MIME type of the audio. Different providers may support different
|
|
1198
|
+
* audio types.
|
|
1199
|
+
*/
|
|
1200
|
+
mimeType: String,
|
|
1201
|
+
/**
|
|
1202
|
+
* Optional annotations for the client.
|
|
1203
|
+
*/
|
|
1204
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
1205
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1206
|
+
}))) {
|
|
1207
|
+
};
|
|
1208
|
+
var EmbeddedResource = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1209
|
+
type: /* @__PURE__ */ tag("resource"),
|
|
1210
|
+
resource: /* @__PURE__ */ Union([TextResourceContents, BlobResourceContents]),
|
|
1211
|
+
/**
|
|
1212
|
+
* Optional annotations for the client.
|
|
1213
|
+
*/
|
|
1214
|
+
annotations: /* @__PURE__ */ optional2(Annotations),
|
|
1215
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1216
|
+
}))) {
|
|
1217
|
+
};
|
|
1218
|
+
var ResourceLink = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1219
|
+
...Resource.fields,
|
|
1220
|
+
type: /* @__PURE__ */ tag("resource_link")
|
|
1221
|
+
}))) {
|
|
1222
|
+
};
|
|
1223
|
+
var ContentBlock = /* @__PURE__ */ Union([TextContent, ImageContent, AudioContent, EmbeddedResource, ResourceLink]);
|
|
1224
|
+
var PromptMessage = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1225
|
+
role: Role,
|
|
1226
|
+
content: ContentBlock
|
|
1227
|
+
}))) {
|
|
1228
|
+
};
|
|
1229
|
+
var ListPromptsResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ListPromptsResult")({
|
|
1230
|
+
...PaginatedResultMeta.fields,
|
|
1231
|
+
prompts: /* @__PURE__ */ ArraySchema(Prompt)
|
|
1232
|
+
})) {
|
|
1233
|
+
};
|
|
1234
|
+
var GetPromptResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/GetPromptResult")({
|
|
1235
|
+
...ResultMeta.fields,
|
|
1236
|
+
messages: /* @__PURE__ */ ArraySchema(PromptMessage),
|
|
1237
|
+
/**
|
|
1238
|
+
* An optional description for the prompt.
|
|
1239
|
+
*/
|
|
1240
|
+
description: /* @__PURE__ */ optional2(String)
|
|
1241
|
+
})) {
|
|
1242
|
+
};
|
|
1243
|
+
var GetPrompt = class extends (/* @__PURE__ */ make2("prompts/get", {
|
|
1244
|
+
success: GetPromptResult,
|
|
1245
|
+
error: McpError,
|
|
1246
|
+
payload: {
|
|
1247
|
+
...RequestMeta.fields,
|
|
1248
|
+
/**
|
|
1249
|
+
* The name of the prompt or prompt template.
|
|
1250
|
+
*/
|
|
1251
|
+
name: String,
|
|
1252
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1253
|
+
/**
|
|
1254
|
+
* Arguments to use for templating the prompt.
|
|
1255
|
+
*/
|
|
1256
|
+
arguments: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, String))
|
|
1257
|
+
}
|
|
1258
|
+
})) {
|
|
1259
|
+
};
|
|
1260
|
+
var ToolAnnotations = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1261
|
+
/**
|
|
1262
|
+
* A human-readable title for the tool.
|
|
1263
|
+
*/
|
|
1264
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1265
|
+
/**
|
|
1266
|
+
* If true, the tool does not modify its environment.
|
|
1267
|
+
*
|
|
1268
|
+
* Default: `false`
|
|
1269
|
+
*/
|
|
1270
|
+
readOnlyHint: /* @__PURE__ */ optionalWithDefault(Boolean, constFalse),
|
|
1271
|
+
/**
|
|
1272
|
+
* If true, the tool may perform destructive updates to its environment.
|
|
1273
|
+
* If false, the tool performs only additive updates.
|
|
1274
|
+
*
|
|
1275
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
1276
|
+
*
|
|
1277
|
+
* Default: `true`
|
|
1278
|
+
*/
|
|
1279
|
+
destructiveHint: /* @__PURE__ */ optionalWithDefault(Boolean, constTrue),
|
|
1280
|
+
/**
|
|
1281
|
+
* If true, calling the tool repeatedly with the same arguments
|
|
1282
|
+
* will have no additional effect on the its environment.
|
|
1283
|
+
*
|
|
1284
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
1285
|
+
*
|
|
1286
|
+
* Default: `false`
|
|
1287
|
+
*/
|
|
1288
|
+
idempotentHint: /* @__PURE__ */ optionalWithDefault(Boolean, constFalse),
|
|
1289
|
+
/**
|
|
1290
|
+
* If true, this tool may interact with an "open world" of external
|
|
1291
|
+
* entities. If false, the tool's domain of interaction is closed.
|
|
1292
|
+
* For example, the world of a web search tool is open, whereas that
|
|
1293
|
+
* of a memory tool is not.
|
|
1294
|
+
*
|
|
1295
|
+
* Default: `true`
|
|
1296
|
+
*/
|
|
1297
|
+
openWorldHint: /* @__PURE__ */ optionalWithDefault(Boolean, constTrue)
|
|
1298
|
+
}))) {
|
|
1299
|
+
};
|
|
1300
|
+
var ToolJson = /* @__PURE__ */ StructWithRest(/* @__PURE__ */ Struct({
|
|
1301
|
+
type: /* @__PURE__ */ Literal("object"),
|
|
1302
|
+
properties: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, JsonObject)),
|
|
1303
|
+
required: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String))
|
|
1304
|
+
}), [JsonObject]);
|
|
1305
|
+
var ToolOutputJson = JsonObject;
|
|
1306
|
+
var Tool = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/Tool")({
|
|
1307
|
+
/**
|
|
1308
|
+
* The name of the tool.
|
|
1309
|
+
*/
|
|
1310
|
+
name: String,
|
|
1311
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1312
|
+
/**
|
|
1313
|
+
* A human-readable description of the tool.
|
|
1314
|
+
*
|
|
1315
|
+
* This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
|
|
1316
|
+
*/
|
|
1317
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1318
|
+
/**
|
|
1319
|
+
* A JSON Schema object defining the expected parameters for the tool.
|
|
1320
|
+
*/
|
|
1321
|
+
inputSchema: ToolJson,
|
|
1322
|
+
/**
|
|
1323
|
+
* An optional JSON Schema object defining the structure of the tool output.
|
|
1324
|
+
*/
|
|
1325
|
+
outputSchema: /* @__PURE__ */ optional2(ToolOutputJson),
|
|
1326
|
+
/**
|
|
1327
|
+
* Optional additional tool information.
|
|
1328
|
+
*/
|
|
1329
|
+
annotations: /* @__PURE__ */ optional2(ToolAnnotations),
|
|
1330
|
+
/**
|
|
1331
|
+
* Icons that clients can display for this tool.
|
|
1332
|
+
*/
|
|
1333
|
+
icons: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(Icon)),
|
|
1334
|
+
/**
|
|
1335
|
+
* Optional additional metadata for the client.
|
|
1336
|
+
*
|
|
1337
|
+
* This parameter name is reserved by MCP to allow clients and servers to
|
|
1338
|
+
* attach additional metadata to resources.
|
|
1339
|
+
*/
|
|
1340
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1341
|
+
})) {
|
|
1342
|
+
};
|
|
1343
|
+
var ListToolsResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ListToolsResult")({
|
|
1344
|
+
...PaginatedResultMeta.fields,
|
|
1345
|
+
tools: /* @__PURE__ */ ArraySchema(Tool)
|
|
1346
|
+
})) {
|
|
1347
|
+
};
|
|
1348
|
+
var CallToolResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/CallToolResult")({
|
|
1349
|
+
...ResultMeta.fields,
|
|
1350
|
+
content: /* @__PURE__ */ ArraySchema(ContentBlock),
|
|
1351
|
+
/**
|
|
1352
|
+
* An optional JSON value containing the structured result of the tool call.
|
|
1353
|
+
*/
|
|
1354
|
+
structuredContent: /* @__PURE__ */ optional2(Json),
|
|
1355
|
+
/**
|
|
1356
|
+
* Whether the tool call ended in an error.
|
|
1357
|
+
*
|
|
1358
|
+
* If not set, this is assumed to be false (the call was successful).
|
|
1359
|
+
*/
|
|
1360
|
+
isError: /* @__PURE__ */ optional2(Boolean)
|
|
1361
|
+
})) {
|
|
1362
|
+
};
|
|
1363
|
+
var CallTool = class extends (/* @__PURE__ */ make2("tools/call", {
|
|
1364
|
+
success: CallToolResult,
|
|
1365
|
+
error: McpError,
|
|
1366
|
+
payload: {
|
|
1367
|
+
...RequestMeta.fields,
|
|
1368
|
+
name: String,
|
|
1369
|
+
arguments: /* @__PURE__ */ optionalWithDefault(/* @__PURE__ */ Record(String, Any), () => ({}))
|
|
1370
|
+
}
|
|
1371
|
+
})) {
|
|
1372
|
+
};
|
|
1373
|
+
var LoggingLevel = /* @__PURE__ */ Literals(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
1374
|
+
var SetLevel = class extends (/* @__PURE__ */ make2("logging/setLevel", {
|
|
1375
|
+
payload: {
|
|
1376
|
+
...RequestMeta.fields,
|
|
1377
|
+
/**
|
|
1378
|
+
* The level of logging that the client wants to receive from the server.
|
|
1379
|
+
* The server should send all logs at this level and higher (i.e., more
|
|
1380
|
+
* severe) to the client as notifications/message.
|
|
1381
|
+
*/
|
|
1382
|
+
level: LoggingLevel
|
|
1383
|
+
},
|
|
1384
|
+
success: /* @__PURE__ */ Struct({}),
|
|
1385
|
+
error: McpError
|
|
1386
|
+
})) {
|
|
1387
|
+
};
|
|
1388
|
+
var LoggingMessageNotification = class extends (/* @__PURE__ */ make2("notifications/message", {
|
|
1389
|
+
payload: /* @__PURE__ */ Struct({
|
|
1390
|
+
...NotificationMeta.fields,
|
|
1391
|
+
/**
|
|
1392
|
+
* The severity of this log message.
|
|
1393
|
+
*/
|
|
1394
|
+
level: LoggingLevel,
|
|
1395
|
+
/**
|
|
1396
|
+
* An optional name of the logger issuing this message.
|
|
1397
|
+
*/
|
|
1398
|
+
logger: /* @__PURE__ */ optional2(String),
|
|
1399
|
+
/**
|
|
1400
|
+
* The data to be logged, such as a string message or an object. Any JSON
|
|
1401
|
+
* serializable type is allowed here.
|
|
1402
|
+
*/
|
|
1403
|
+
data: Any
|
|
1404
|
+
})
|
|
1405
|
+
})) {
|
|
1406
|
+
};
|
|
1407
|
+
var ToolUseContent = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ToolUseContent")({
|
|
1408
|
+
type: /* @__PURE__ */ tag("tool_use"),
|
|
1409
|
+
/**
|
|
1410
|
+
* Identifier used to associate a later tool result with this request.
|
|
1411
|
+
*/
|
|
1412
|
+
id: String,
|
|
1413
|
+
/**
|
|
1414
|
+
* Name of the tool to invoke.
|
|
1415
|
+
*/
|
|
1416
|
+
name: String,
|
|
1417
|
+
/**
|
|
1418
|
+
* Arguments supplied to the tool.
|
|
1419
|
+
*/
|
|
1420
|
+
input: /* @__PURE__ */ Record(String, Unknown),
|
|
1421
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1422
|
+
})) {
|
|
1423
|
+
};
|
|
1424
|
+
var ToolResultContent = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ToolResultContent")({
|
|
1425
|
+
type: /* @__PURE__ */ tag("tool_result"),
|
|
1426
|
+
/**
|
|
1427
|
+
* Identifier of the tool-use request that produced this result.
|
|
1428
|
+
*/
|
|
1429
|
+
toolUseId: String,
|
|
1430
|
+
/**
|
|
1431
|
+
* Content returned by the tool.
|
|
1432
|
+
*/
|
|
1433
|
+
content: /* @__PURE__ */ ArraySchema(ContentBlock),
|
|
1434
|
+
/**
|
|
1435
|
+
* Optional structured result returned by the tool.
|
|
1436
|
+
*/
|
|
1437
|
+
structuredContent: /* @__PURE__ */ optional2(Json),
|
|
1438
|
+
/**
|
|
1439
|
+
* Whether tool execution ended in an error.
|
|
1440
|
+
*/
|
|
1441
|
+
isError: /* @__PURE__ */ optional2(Boolean),
|
|
1442
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1443
|
+
})) {
|
|
1444
|
+
};
|
|
1445
|
+
var SamplingMessageContentBlock = /* @__PURE__ */ Union([TextContent, ImageContent, AudioContent, ToolUseContent, ToolResultContent]);
|
|
1446
|
+
var SamplingMessage = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1447
|
+
role: Role,
|
|
1448
|
+
content: /* @__PURE__ */ Union([SamplingMessageContentBlock, /* @__PURE__ */ ArraySchema(SamplingMessageContentBlock)]),
|
|
1449
|
+
_meta: /* @__PURE__ */ optional2(JsonObject)
|
|
1450
|
+
}))) {
|
|
1451
|
+
};
|
|
1452
|
+
var ToolChoice = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ToolChoice")({
|
|
1453
|
+
/**
|
|
1454
|
+
* Tool-selection mode requested from the client.
|
|
1455
|
+
*/
|
|
1456
|
+
mode: /* @__PURE__ */ optional2(/* @__PURE__ */ Literals(["auto", "required", "none"]))
|
|
1457
|
+
})) {
|
|
1458
|
+
};
|
|
1459
|
+
var ModelHint = class extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1460
|
+
/**
|
|
1461
|
+
* A hint for a model name.
|
|
1462
|
+
*
|
|
1463
|
+
* The client SHOULD treat this as a substring of a model name; for example:
|
|
1464
|
+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
|
|
1465
|
+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
|
|
1466
|
+
* - `claude` should match any Claude model
|
|
1467
|
+
*
|
|
1468
|
+
* The client MAY also map the string to a different provider's model name or
|
|
1469
|
+
* a different model family, as long as it fills a similar niche; for example:
|
|
1470
|
+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
|
|
1471
|
+
*/
|
|
1472
|
+
name: /* @__PURE__ */ optional2(String)
|
|
1473
|
+
}))) {
|
|
1474
|
+
};
|
|
1475
|
+
var ModelPreferences = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ModelPreferences")({
|
|
1476
|
+
/**
|
|
1477
|
+
* Optional hints to use for model selection.
|
|
1478
|
+
*
|
|
1479
|
+
* If multiple hints are specified, the client MUST evaluate them in order
|
|
1480
|
+
* (such that the first match is taken).
|
|
1481
|
+
*
|
|
1482
|
+
* The client SHOULD prioritize these hints over the numeric priorities, but
|
|
1483
|
+
* MAY still use the priorities to select from ambiguous matches.
|
|
1484
|
+
*/
|
|
1485
|
+
hints: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(ModelHint)),
|
|
1486
|
+
/**
|
|
1487
|
+
* How much to prioritize cost when selecting a model. A value of 0 means cost
|
|
1488
|
+
* is not important, while a value of 1 means cost is the most important
|
|
1489
|
+
* factor.
|
|
1490
|
+
*/
|
|
1491
|
+
costPriority: /* @__PURE__ */ optional2(/* @__PURE__ */ Finite.check(/* @__PURE__ */ isBetween({
|
|
1492
|
+
minimum: 0,
|
|
1493
|
+
maximum: 1
|
|
1494
|
+
}))),
|
|
1495
|
+
/**
|
|
1496
|
+
* How much to prioritize sampling speed (latency) when selecting a model. A
|
|
1497
|
+
* value of 0 means speed is not important, while a value of 1 means speed is
|
|
1498
|
+
* the most important factor.
|
|
1499
|
+
*/
|
|
1500
|
+
speedPriority: /* @__PURE__ */ optional2(/* @__PURE__ */ Finite.check(/* @__PURE__ */ isBetween({
|
|
1501
|
+
minimum: 0,
|
|
1502
|
+
maximum: 1
|
|
1503
|
+
}))),
|
|
1504
|
+
/**
|
|
1505
|
+
* How much to prioritize intelligence and capabilities when selecting a
|
|
1506
|
+
* model. A value of 0 means intelligence is not important, while a value of 1
|
|
1507
|
+
* means intelligence is the most important factor.
|
|
1508
|
+
*/
|
|
1509
|
+
intelligencePriority: /* @__PURE__ */ optional2(/* @__PURE__ */ Finite.check(/* @__PURE__ */ isBetween({
|
|
1510
|
+
minimum: 0,
|
|
1511
|
+
maximum: 1
|
|
1512
|
+
})))
|
|
1513
|
+
})) {
|
|
1514
|
+
};
|
|
1515
|
+
var CreateMessageResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/CreateMessageResult")({
|
|
1516
|
+
role: Role,
|
|
1517
|
+
content: /* @__PURE__ */ Union([SamplingMessageContentBlock, /* @__PURE__ */ ArraySchema(SamplingMessageContentBlock)]),
|
|
1518
|
+
_meta: /* @__PURE__ */ optional2(JsonObject),
|
|
1519
|
+
/**
|
|
1520
|
+
* The name of the model that generated the message.
|
|
1521
|
+
*/
|
|
1522
|
+
model: String,
|
|
1523
|
+
/**
|
|
1524
|
+
* The reason why sampling stopped, if known.
|
|
1525
|
+
*/
|
|
1526
|
+
stopReason: /* @__PURE__ */ optional2(String)
|
|
1527
|
+
})) {
|
|
1528
|
+
};
|
|
1529
|
+
var CreateMessage = class extends (/* @__PURE__ */ make2("sampling/createMessage", {
|
|
1530
|
+
success: CreateMessageResult,
|
|
1531
|
+
error: McpError,
|
|
1532
|
+
payload: {
|
|
1533
|
+
messages: /* @__PURE__ */ ArraySchema(SamplingMessage),
|
|
1534
|
+
/**
|
|
1535
|
+
* The server's preferences for which model to select. The client MAY ignore
|
|
1536
|
+
* these preferences.
|
|
1537
|
+
*/
|
|
1538
|
+
modelPreferences: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct(ModelPreferences.fields)),
|
|
1539
|
+
/**
|
|
1540
|
+
* An optional system prompt the server wants to use for sampling. The
|
|
1541
|
+
* client MAY modify or omit this prompt.
|
|
1542
|
+
*/
|
|
1543
|
+
systemPrompt: /* @__PURE__ */ optional2(String),
|
|
1544
|
+
/**
|
|
1545
|
+
* A request to include context from one or more MCP servers (including the
|
|
1546
|
+
* caller), to be attached to the prompt. The client MAY ignore this request.
|
|
1547
|
+
*/
|
|
1548
|
+
includeContext: /* @__PURE__ */ optional2(/* @__PURE__ */ Literals(["none", "thisServer", "allServers"])),
|
|
1549
|
+
temperature: /* @__PURE__ */ optional2(Finite),
|
|
1550
|
+
/**
|
|
1551
|
+
* The maximum number of tokens to sample, as requested by the server. The
|
|
1552
|
+
* client MAY choose to sample fewer tokens than requested.
|
|
1553
|
+
*/
|
|
1554
|
+
maxTokens: Int,
|
|
1555
|
+
stopSequences: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String)),
|
|
1556
|
+
/**
|
|
1557
|
+
* Optional metadata to pass through to the LLM provider. The format of
|
|
1558
|
+
* this metadata is provider-specific.
|
|
1559
|
+
*/
|
|
1560
|
+
metadata: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, Unknown)),
|
|
1561
|
+
/**
|
|
1562
|
+
* Tools that the model may call while producing the response.
|
|
1563
|
+
*/
|
|
1564
|
+
tools: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(/* @__PURE__ */ Struct(Tool.fields))),
|
|
1565
|
+
/**
|
|
1566
|
+
* Controls whether the model may or must call a tool.
|
|
1567
|
+
*/
|
|
1568
|
+
toolChoice: /* @__PURE__ */ optional2(/* @__PURE__ */ Struct(ToolChoice.fields))
|
|
1569
|
+
}
|
|
1570
|
+
})) {
|
|
1571
|
+
};
|
|
1572
|
+
var CompleteResult = class _CompleteResult extends (/* @__PURE__ */ Opaque()(/* @__PURE__ */ Struct({
|
|
1573
|
+
...ResultMeta.fields,
|
|
1574
|
+
completion: /* @__PURE__ */ Struct({
|
|
1575
|
+
/**
|
|
1576
|
+
* An array of completion values. Must not exceed 100 items.
|
|
1577
|
+
*/
|
|
1578
|
+
values: /* @__PURE__ */ ArraySchema(String),
|
|
1579
|
+
/**
|
|
1580
|
+
* The total number of completion options available. This can exceed the
|
|
1581
|
+
* number of values actually sent in the response.
|
|
1582
|
+
*/
|
|
1583
|
+
total: /* @__PURE__ */ optional2(Int),
|
|
1584
|
+
/**
|
|
1585
|
+
* Indicates whether there are additional completion options beyond those
|
|
1586
|
+
* provided in the current response, even if the exact total is unknown.
|
|
1587
|
+
*/
|
|
1588
|
+
hasMore: /* @__PURE__ */ optional2(Boolean)
|
|
1589
|
+
})
|
|
1590
|
+
}))) {
|
|
1591
|
+
/**
|
|
1592
|
+
* Empty completion result used when a completion request has no values.
|
|
1593
|
+
*
|
|
1594
|
+
* @stability unstable
|
|
1595
|
+
* @since 4.0.0
|
|
1596
|
+
*/
|
|
1597
|
+
static empty = /* @__PURE__ */ _CompleteResult.make({
|
|
1598
|
+
completion: {
|
|
1599
|
+
values: [],
|
|
1600
|
+
total: 0,
|
|
1601
|
+
hasMore: false
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
};
|
|
1605
|
+
var ElicitationString = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitationString")({
|
|
1606
|
+
type: /* @__PURE__ */ tag("string"),
|
|
1607
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1608
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1609
|
+
minLength: /* @__PURE__ */ optional2(Int),
|
|
1610
|
+
maxLength: /* @__PURE__ */ optional2(Int),
|
|
1611
|
+
format: /* @__PURE__ */ optional2(/* @__PURE__ */ Literals(["email", "uri", "date", "date-time"])),
|
|
1612
|
+
default: /* @__PURE__ */ optional2(String)
|
|
1613
|
+
})) {
|
|
1614
|
+
};
|
|
1615
|
+
var ElicitationNumber = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitationNumber")({
|
|
1616
|
+
type: /* @__PURE__ */ Literals(["number", "integer"]),
|
|
1617
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1618
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1619
|
+
minimum: /* @__PURE__ */ optional2(Finite),
|
|
1620
|
+
maximum: /* @__PURE__ */ optional2(Finite),
|
|
1621
|
+
default: /* @__PURE__ */ optional2(Finite)
|
|
1622
|
+
})) {
|
|
1623
|
+
};
|
|
1624
|
+
var ElicitationBoolean = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitationBoolean")({
|
|
1625
|
+
type: /* @__PURE__ */ tag("boolean"),
|
|
1626
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1627
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1628
|
+
default: /* @__PURE__ */ optional2(Boolean)
|
|
1629
|
+
})) {
|
|
1630
|
+
};
|
|
1631
|
+
var UntitledSingleSelectEnum = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/UntitledSingleSelectEnum")({
|
|
1632
|
+
type: /* @__PURE__ */ tag("string"),
|
|
1633
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1634
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1635
|
+
enum: /* @__PURE__ */ ArraySchema(String),
|
|
1636
|
+
default: /* @__PURE__ */ optional2(String)
|
|
1637
|
+
})) {
|
|
1638
|
+
};
|
|
1639
|
+
var TitledSingleSelectEnum = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/TitledSingleSelectEnum")({
|
|
1640
|
+
type: /* @__PURE__ */ tag("string"),
|
|
1641
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1642
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1643
|
+
oneOf: /* @__PURE__ */ ArraySchema(/* @__PURE__ */ Struct({
|
|
1644
|
+
const: String,
|
|
1645
|
+
title: String
|
|
1646
|
+
})),
|
|
1647
|
+
default: /* @__PURE__ */ optional2(String)
|
|
1648
|
+
})) {
|
|
1649
|
+
};
|
|
1650
|
+
var SingleSelectEnum = /* @__PURE__ */ Union([UntitledSingleSelectEnum, TitledSingleSelectEnum]);
|
|
1651
|
+
var UntitledMultiSelectEnum = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/UntitledMultiSelectEnum")({
|
|
1652
|
+
type: /* @__PURE__ */ tag("array"),
|
|
1653
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1654
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1655
|
+
minItems: /* @__PURE__ */ optional2(Int),
|
|
1656
|
+
maxItems: /* @__PURE__ */ optional2(Int),
|
|
1657
|
+
items: /* @__PURE__ */ Struct({
|
|
1658
|
+
type: /* @__PURE__ */ tag("string"),
|
|
1659
|
+
enum: /* @__PURE__ */ ArraySchema(String)
|
|
1660
|
+
}),
|
|
1661
|
+
default: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String))
|
|
1662
|
+
})) {
|
|
1663
|
+
};
|
|
1664
|
+
var TitledMultiSelectEnum = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/TitledMultiSelectEnum")({
|
|
1665
|
+
type: /* @__PURE__ */ tag("array"),
|
|
1666
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1667
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1668
|
+
minItems: /* @__PURE__ */ optional2(Int),
|
|
1669
|
+
maxItems: /* @__PURE__ */ optional2(Int),
|
|
1670
|
+
items: /* @__PURE__ */ Struct({
|
|
1671
|
+
anyOf: /* @__PURE__ */ ArraySchema(/* @__PURE__ */ Struct({
|
|
1672
|
+
const: String,
|
|
1673
|
+
title: String
|
|
1674
|
+
}))
|
|
1675
|
+
}),
|
|
1676
|
+
default: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String))
|
|
1677
|
+
})) {
|
|
1678
|
+
};
|
|
1679
|
+
var MultiSelectEnum = /* @__PURE__ */ Union([UntitledMultiSelectEnum, TitledMultiSelectEnum]);
|
|
1680
|
+
var LegacyTitledEnum = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/LegacyTitledEnum")({
|
|
1681
|
+
type: /* @__PURE__ */ tag("string"),
|
|
1682
|
+
title: /* @__PURE__ */ optional2(String),
|
|
1683
|
+
description: /* @__PURE__ */ optional2(String),
|
|
1684
|
+
enum: /* @__PURE__ */ ArraySchema(String),
|
|
1685
|
+
enumNames: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String)),
|
|
1686
|
+
default: /* @__PURE__ */ optional2(String)
|
|
1687
|
+
})) {
|
|
1688
|
+
};
|
|
1689
|
+
var ElicitationEnum = /* @__PURE__ */ Union([LegacyTitledEnum, SingleSelectEnum, MultiSelectEnum]);
|
|
1690
|
+
var PrimitiveSchemaDefinition = /* @__PURE__ */ Union([ElicitationEnum, ElicitationString, ElicitationNumber, ElicitationBoolean]);
|
|
1691
|
+
var ElicitationForm = /* @__PURE__ */ Struct({
|
|
1692
|
+
$schema: /* @__PURE__ */ optional2(String),
|
|
1693
|
+
type: /* @__PURE__ */ tag("object"),
|
|
1694
|
+
properties: /* @__PURE__ */ Record(String, PrimitiveSchemaDefinition),
|
|
1695
|
+
required: /* @__PURE__ */ optional2(/* @__PURE__ */ ArraySchema(String))
|
|
1696
|
+
});
|
|
1697
|
+
var ElicitRequestFormParams = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitRequestFormParams")({
|
|
1698
|
+
...RequestMeta.fields,
|
|
1699
|
+
mode: /* @__PURE__ */ optional2(/* @__PURE__ */ Literal("form")),
|
|
1700
|
+
message: String,
|
|
1701
|
+
requestedSchema: ElicitationForm
|
|
1702
|
+
})) {
|
|
1703
|
+
};
|
|
1704
|
+
var ElicitRequestURLParams = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitRequestURLParams")({
|
|
1705
|
+
...RequestMeta.fields,
|
|
1706
|
+
mode: /* @__PURE__ */ Literal("url"),
|
|
1707
|
+
message: String,
|
|
1708
|
+
elicitationId: String,
|
|
1709
|
+
url: String
|
|
1710
|
+
})) {
|
|
1711
|
+
};
|
|
1712
|
+
var ElicitRequestParams = /* @__PURE__ */ Union([ElicitRequestFormParams, ElicitRequestURLParams]);
|
|
1713
|
+
var ElicitAcceptResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitAcceptResult")({
|
|
1714
|
+
...ResultMeta.fields,
|
|
1715
|
+
/**
|
|
1716
|
+
* The user action in response to the elicitation.
|
|
1717
|
+
* - "accept": User submitted the form/confirmed the action
|
|
1718
|
+
* - "decline": User explicitly declined the action
|
|
1719
|
+
* - "cancel": User dismissed without making an explicit choice
|
|
1720
|
+
*/
|
|
1721
|
+
action: /* @__PURE__ */ Literal("accept"),
|
|
1722
|
+
/**
|
|
1723
|
+
* The submitted form data, only present when action is "accept".
|
|
1724
|
+
* Contains values matching the requested schema.
|
|
1725
|
+
*/
|
|
1726
|
+
content: /* @__PURE__ */ optional2(/* @__PURE__ */ Record(String, /* @__PURE__ */ Union([String, Finite, Boolean, /* @__PURE__ */ ArraySchema(String)])))
|
|
1727
|
+
})) {
|
|
1728
|
+
};
|
|
1729
|
+
var ElicitDeclineResult = class extends (/* @__PURE__ */ Class("@effect/ai/McpSchema/ElicitDeclineResult")({
|
|
1730
|
+
...ResultMeta.fields,
|
|
1731
|
+
/**
|
|
1732
|
+
* The user action in response to the elicitation.
|
|
1733
|
+
* - "accept": User submitted the form/confirmed the action
|
|
1734
|
+
* - "decline": User explicitly declined the action
|
|
1735
|
+
* - "cancel": User dismissed without making an explicit choice
|
|
1736
|
+
*/
|
|
1737
|
+
action: /* @__PURE__ */ Literals(["cancel", "decline"])
|
|
1738
|
+
})) {
|
|
1739
|
+
};
|
|
1740
|
+
var ElicitResult = /* @__PURE__ */ Union([ElicitAcceptResult, ElicitDeclineResult]);
|
|
1741
|
+
var Elicit = class extends (/* @__PURE__ */ make2("elicitation/create", {
|
|
1742
|
+
success: ElicitResult,
|
|
1743
|
+
error: McpError,
|
|
1744
|
+
payload: ElicitRequestParams
|
|
1745
|
+
})) {
|
|
1746
|
+
};
|
|
1747
|
+
var ElicitationDeclined = class extends (/* @__PURE__ */ Error2("@effect/ai/McpSchema/ElicitationDeclined")({
|
|
1748
|
+
_tag: /* @__PURE__ */ tag("ElicitationDeclined"),
|
|
1749
|
+
request: Elicit.payloadSchema,
|
|
1750
|
+
cause: /* @__PURE__ */ optional2(/* @__PURE__ */ Defect())
|
|
1751
|
+
})) {
|
|
1752
|
+
};
|
|
1753
|
+
|
|
1754
|
+
// src/contracts/elicitation.ts
|
|
1755
|
+
var ElicitationLimits = Schema_exports.Struct({
|
|
1756
|
+
timeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
1757
|
+
});
|
|
1758
|
+
var defaultElicitationLimits = ElicitationLimits.make({ timeoutMs: 15 * 60 * 1e3 });
|
|
1759
|
+
var FormElicitation = Schema_exports.Struct({
|
|
1760
|
+
...ElicitRequestFormParams.fields,
|
|
1761
|
+
mode: Schema_exports.Literal("form"),
|
|
1762
|
+
requestedSchema: Schema_exports.toEncoded(ElicitRequestFormParams.fields.requestedSchema),
|
|
1763
|
+
_meta: Schema_exports.optional(JsonObject2)
|
|
1764
|
+
});
|
|
1765
|
+
var ElicitationResponse = Schema_exports.Union([
|
|
1766
|
+
Schema_exports.Struct({ ...ElicitAcceptResult.fields, _meta: Schema_exports.optional(JsonObject2) }),
|
|
1767
|
+
Schema_exports.Struct({ ...ElicitDeclineResult.fields, _meta: Schema_exports.optional(JsonObject2) })
|
|
1768
|
+
]);
|
|
1769
|
+
var ElicitationFailed = class extends Schema_exports.TaggedError()(
|
|
1770
|
+
"ElicitationFailed",
|
|
1771
|
+
{
|
|
1772
|
+
reason: Schema_exports.Literals([
|
|
1773
|
+
"unavailable",
|
|
1774
|
+
"transaction",
|
|
1775
|
+
"invalid-request",
|
|
1776
|
+
"invalid-response",
|
|
1777
|
+
"transport",
|
|
1778
|
+
"expired",
|
|
1779
|
+
"forbidden"
|
|
1780
|
+
])
|
|
1781
|
+
}
|
|
1782
|
+
) {
|
|
1783
|
+
};
|
|
1784
|
+
var ElicitationReply = Schema_exports.Union([
|
|
1785
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), response: ElicitationResponse }),
|
|
1786
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: ElicitationFailed })
|
|
1787
|
+
]);
|
|
1788
|
+
var ApprovalElicitation = Schema_exports.Struct({
|
|
1789
|
+
...FormElicitation.fields,
|
|
1790
|
+
requestedSchema: Schema_exports.Struct({
|
|
1791
|
+
type: Schema_exports.Literal("object"),
|
|
1792
|
+
properties: Schema_exports.Record(Schema_exports.String, Schema_exports.Never)
|
|
1793
|
+
})
|
|
1794
|
+
});
|
|
1795
|
+
var ApprovalResponse = ElicitationResponse.check(
|
|
1796
|
+
Schema_exports.makeFilter(
|
|
1797
|
+
(response) => response.action !== "accept" || response.content === void 0 || Object.keys(response.content).length === 0
|
|
1798
|
+
)
|
|
1799
|
+
);
|
|
1800
|
+
var approvalElicitation = (toolName, input) => ({
|
|
1801
|
+
mode: "form",
|
|
1802
|
+
message: `Approve ${toolName}?
|
|
1803
|
+
|
|
1804
|
+
Arguments:
|
|
1805
|
+
${JSON.stringify(input, null, 2)}`,
|
|
1806
|
+
requestedSchema: { type: "object", properties: {} }
|
|
1807
|
+
});
|
|
1808
|
+
|
|
1809
|
+
// src/contracts/router.ts
|
|
1810
|
+
var reservedRouterKeys = /* @__PURE__ */ new Set([
|
|
1811
|
+
"__proto__",
|
|
1812
|
+
"constructor",
|
|
1813
|
+
"prototype"
|
|
1814
|
+
]);
|
|
1815
|
+
var RouterKey = Schema_exports.String.check(
|
|
1816
|
+
Schema_exports.isPattern(/^[A-Za-z_][A-Za-z0-9_-]{0,99}$/u),
|
|
1817
|
+
Schema_exports.makeFilter((key) => !reservedRouterKeys.has(key))
|
|
1818
|
+
);
|
|
1819
|
+
var RouterIcon = Schema_exports.Struct({
|
|
1820
|
+
src: Schema_exports.NonEmptyString,
|
|
1821
|
+
mimeType: Schema_exports.optionalKey(Schema_exports.String),
|
|
1822
|
+
sizes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
1823
|
+
theme: Schema_exports.optionalKey(Schema_exports.Literals(["light", "dark"]))
|
|
1824
|
+
});
|
|
1825
|
+
var RouterMeta = Schema_exports.Struct({
|
|
1826
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
1827
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
1828
|
+
instructions: Schema_exports.optionalKey(Schema_exports.String),
|
|
1829
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
1830
|
+
tags: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.NonEmptyString, Schema_exports.String))
|
|
1831
|
+
});
|
|
1832
|
+
|
|
1833
|
+
// src/contracts/tools.ts
|
|
1834
|
+
var ToolAnnotations2 = Schema_exports.Struct({
|
|
1835
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
1836
|
+
readOnlyHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
1837
|
+
destructiveHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
1838
|
+
idempotentHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
1839
|
+
openWorldHint: Schema_exports.optionalKey(Schema_exports.Boolean)
|
|
1840
|
+
});
|
|
1841
|
+
|
|
1842
|
+
// src/contracts/mcp.ts
|
|
1843
|
+
var McpClientLimits = Schema_exports.Struct({
|
|
1844
|
+
timeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1845
|
+
maxTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1846
|
+
maxTools: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1847
|
+
maxPaginationCursors: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1848
|
+
cleanupTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
1849
|
+
});
|
|
1850
|
+
var defaultMcpClientLimits = McpClientLimits.make({
|
|
1851
|
+
timeoutMs: 3e4,
|
|
1852
|
+
maxTimeoutMs: 3e5,
|
|
1853
|
+
maxTools: 5e4,
|
|
1854
|
+
maxPaginationCursors: 1e3,
|
|
1855
|
+
cleanupTimeoutMs: 1e3
|
|
1856
|
+
});
|
|
1857
|
+
var mcpSdkTimerCeilingMs = 2147483647;
|
|
1858
|
+
var McpToolsOptions = Schema_exports.Struct({
|
|
1859
|
+
url: HttpUrl,
|
|
1860
|
+
accountId: Schema_exports.optional(AccountId),
|
|
1861
|
+
headers: Schema_exports.optional(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
|
|
1862
|
+
signal: Schema_exports.optional(Schema_exports.instanceOf(AbortSignal)),
|
|
1863
|
+
timeoutMs: Schema_exports.optional(
|
|
1864
|
+
Schema_exports.Number.check(
|
|
1865
|
+
Schema_exports.isInt(),
|
|
1866
|
+
Schema_exports.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs })
|
|
1867
|
+
)
|
|
1868
|
+
)
|
|
1869
|
+
});
|
|
1870
|
+
var McpHealthInput = Schema_exports.Struct({
|
|
1871
|
+
...McpToolsOptions.fields,
|
|
1872
|
+
headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
|
|
1873
|
+
deadline: Schema_exports.optional(Schema_exports.Finite)
|
|
1874
|
+
});
|
|
1875
|
+
var mcpHealthReserveMs = 2 * defaultMcpClientLimits.cleanupTimeoutMs + 250;
|
|
1876
|
+
var McpToolResult = Schema_exports.Struct({
|
|
1877
|
+
content: Schema_exports.Array(JsonObject2),
|
|
1878
|
+
structuredContent: Schema_exports.optionalKey(JsonObject2),
|
|
1879
|
+
isError: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
1880
|
+
_meta: Schema_exports.optionalKey(JsonObject2)
|
|
1881
|
+
});
|
|
1882
|
+
var McpToolMetadata = Schema_exports.Struct({
|
|
1883
|
+
name: Schema_exports.String,
|
|
1884
|
+
title: Schema_exports.optional(Schema_exports.String),
|
|
1885
|
+
description: Schema_exports.optional(Schema_exports.String),
|
|
1886
|
+
inputSchema: JsonObject2,
|
|
1887
|
+
outputSchema: Schema_exports.optional(JsonObject2),
|
|
1888
|
+
annotations: Schema_exports.optional(ToolAnnotations2),
|
|
1889
|
+
_meta: Schema_exports.optional(JsonObject2)
|
|
1890
|
+
});
|
|
1891
|
+
var McpServerHeader = Schema_exports.Struct({
|
|
1892
|
+
name: Schema_exports.optionalKey(Schema_exports.String),
|
|
1893
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
1894
|
+
version: Schema_exports.optionalKey(Schema_exports.String),
|
|
1895
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
1896
|
+
websiteUrl: Schema_exports.optionalKey(Schema_exports.String),
|
|
1897
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
1898
|
+
instructions: Schema_exports.optionalKey(Schema_exports.String)
|
|
1899
|
+
});
|
|
1900
|
+
var McpError2 = class extends Schema_exports.TaggedError()("McpError", {
|
|
1901
|
+
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
1902
|
+
reason: Schema_exports.Literals([
|
|
1903
|
+
"request",
|
|
1904
|
+
"unauthorized",
|
|
1905
|
+
"invalid_response",
|
|
1906
|
+
"timeout",
|
|
1907
|
+
"invalid_input"
|
|
1908
|
+
]),
|
|
1909
|
+
status: Schema_exports.optional(Schema_exports.Number),
|
|
1910
|
+
upstream: Schema_exports.optional(UpstreamError),
|
|
1911
|
+
session: Schema_exports.optional(Schema_exports.Literal(true))
|
|
1912
|
+
}) {
|
|
1913
|
+
};
|
|
1914
|
+
var McpCredentialsUnverified = class extends Schema_exports.TaggedError()(
|
|
1915
|
+
"McpCredentialsUnverified",
|
|
1916
|
+
{ anonymous: Schema_exports.Union([Schema_exports.Literal("answered"), McpError2, ProviderError]) }
|
|
1917
|
+
) {
|
|
1918
|
+
};
|
|
1919
|
+
var ProcessConfig = Schema_exports.Struct({
|
|
1920
|
+
command: Schema_exports.NonEmptyString,
|
|
1921
|
+
args: Schema_exports.Array(Schema_exports.String),
|
|
1922
|
+
cwd: Schema_exports.optional(Schema_exports.String),
|
|
1923
|
+
env: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
|
|
1924
|
+
timeoutMs: Schema_exports.Int.check(
|
|
1925
|
+
Schema_exports.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs })
|
|
1926
|
+
)
|
|
1927
|
+
});
|
|
1928
|
+
|
|
1929
|
+
// src/contracts/webhook-protocol.ts
|
|
1930
|
+
var WebhookTransportLimits = Schema_exports.Struct({
|
|
1931
|
+
maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
1932
|
+
});
|
|
1933
|
+
var defaultWebhookTransportLimits = WebhookTransportLimits.make({
|
|
1934
|
+
maxBodyBytes: 1024 * 1024
|
|
1935
|
+
});
|
|
1936
|
+
var encodedBodyChars = 4 * Math.ceil(defaultWebhookTransportLimits.maxBodyBytes / 3);
|
|
1937
|
+
var WebhookRequestData = Schema_exports.Struct({
|
|
1938
|
+
url: HttpUrl,
|
|
1939
|
+
method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
|
|
1940
|
+
headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
|
|
1941
|
+
body: Schema_exports.String.check(Schema_exports.isMaxLength(encodedBodyChars))
|
|
1942
|
+
});
|
|
1943
|
+
var WebhookResponseData = Schema_exports.Struct({
|
|
1944
|
+
status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 200, maximum: 599 })),
|
|
1945
|
+
headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
|
|
1946
|
+
body: Schema_exports.String.check(Schema_exports.isMaxLength(encodedBodyChars))
|
|
1947
|
+
});
|
|
1948
|
+
var ManualWebhookSetup = Schema_exports.Struct({
|
|
1949
|
+
instructions: Schema_exports.NonEmptyString,
|
|
1950
|
+
signingSecret: Schema_exports.Literals(["executor", "provider"])
|
|
1951
|
+
});
|
|
1952
|
+
var ManualWebhookDescriptor = Schema_exports.Struct({
|
|
1953
|
+
...ManualWebhookSetup.fields,
|
|
1954
|
+
stateSchema: JsonObject2
|
|
1955
|
+
});
|
|
1956
|
+
var HostedWebhook = Schema_exports.Struct({
|
|
1957
|
+
name: Schema_exports.NonEmptyString,
|
|
1958
|
+
account: Schema_exports.NonEmptyString,
|
|
1959
|
+
configSchema: JsonObject2,
|
|
1960
|
+
setup: Schema_exports.optionalKey(ManualWebhookDescriptor)
|
|
1961
|
+
});
|
|
1962
|
+
var identity = {
|
|
1963
|
+
name: Schema_exports.NonEmptyString,
|
|
1964
|
+
subscriptionId: Schema_exports.NonEmptyString,
|
|
1965
|
+
sourceAccount: AccountId,
|
|
1966
|
+
callbackUrl: HttpUrl,
|
|
1967
|
+
secret: Schema_exports.String,
|
|
1968
|
+
config: JsonValue
|
|
1969
|
+
};
|
|
1970
|
+
var WebhookCommand = Schema_exports.Union([
|
|
1971
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhooks") }),
|
|
1972
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-validate"), ...identity }),
|
|
1973
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-complete"), ...identity, state: JsonValue }),
|
|
1974
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-register"), ...identity }),
|
|
1975
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-unregister"), ...identity, state: JsonValue }),
|
|
1976
|
+
Schema_exports.Struct({
|
|
1977
|
+
operation: Schema_exports.Literal("webhook-handle"),
|
|
1978
|
+
...identity,
|
|
1979
|
+
state: JsonValue,
|
|
1980
|
+
request: WebhookRequestData
|
|
1981
|
+
})
|
|
1982
|
+
]);
|
|
1983
|
+
|
|
1984
|
+
// src/contracts/events.ts
|
|
1985
|
+
var EventName = Schema_exports.String.check(
|
|
1986
|
+
Schema_exports.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u),
|
|
1987
|
+
Schema_exports.isMaxLength(64)
|
|
1988
|
+
);
|
|
1989
|
+
var EventFilterValue = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
1990
|
+
var EventLimits = Schema_exports.Struct({
|
|
1991
|
+
/** An occurrence's `data`, leaving room under a 256 KiB delivery for its envelope. */
|
|
1992
|
+
maxDataBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1993
|
+
maxEventsPerInvocation: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1994
|
+
maxDescriptionLength: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1995
|
+
maxIdLength: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
1996
|
+
});
|
|
1997
|
+
var defaultEventLimits = EventLimits.make({
|
|
1998
|
+
maxDataBytes: 250 * 1024,
|
|
1999
|
+
maxEventsPerInvocation: 100,
|
|
2000
|
+
maxDescriptionLength: 1e3,
|
|
2001
|
+
maxIdLength: 200
|
|
2002
|
+
});
|
|
2003
|
+
var DeclaredEvent = Schema_exports.Struct({
|
|
2004
|
+
description: Schema_exports.String.check(
|
|
2005
|
+
Schema_exports.isMinLength(1),
|
|
2006
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxDescriptionLength)
|
|
2007
|
+
),
|
|
2008
|
+
/** An object of scalar fields. Subscribers may name any of them to narrow an event. */
|
|
2009
|
+
filters: JsonObject2,
|
|
2010
|
+
/** The shape of each occurrence's `data`. */
|
|
2011
|
+
payload: JsonObject2
|
|
2012
|
+
});
|
|
2013
|
+
var DeclaredEvents = Schema_exports.Record(EventName, DeclaredEvent);
|
|
2014
|
+
var EmittedEvent = Schema_exports.Struct({
|
|
2015
|
+
name: EventName,
|
|
2016
|
+
id: Schema_exports.String.check(
|
|
2017
|
+
Schema_exports.isMinLength(1),
|
|
2018
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxIdLength)
|
|
2019
|
+
),
|
|
2020
|
+
/** Milliseconds since the epoch when the event happened. */
|
|
2021
|
+
occurredAt: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
2022
|
+
data: JsonValue,
|
|
2023
|
+
filters: Schema_exports.Record(Schema_exports.String, EventFilterValue),
|
|
2024
|
+
account: Schema_exports.NullOr(AccountId)
|
|
2025
|
+
});
|
|
2026
|
+
var EmittedEvents = Schema_exports.Array(EmittedEvent).check(
|
|
2027
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxEventsPerInvocation)
|
|
2028
|
+
);
|
|
2029
|
+
|
|
2030
|
+
// src/contracts/provider.ts
|
|
2031
|
+
var SecretsMethod = class extends Data_exports.TaggedClass(
|
|
2032
|
+
"secrets"
|
|
2033
|
+
) {
|
|
2034
|
+
};
|
|
2035
|
+
var OAuthClientAuth = Schema_exports.Literals([
|
|
2036
|
+
"none",
|
|
2037
|
+
"client_secret_post",
|
|
2038
|
+
"client_secret_basic",
|
|
2039
|
+
"client_secret_basic_raw"
|
|
2040
|
+
]);
|
|
2041
|
+
var OAuthSecretClientAuth = Schema_exports.Literals([
|
|
2042
|
+
"client_secret_post",
|
|
2043
|
+
"client_secret_basic",
|
|
2044
|
+
"client_secret_basic_raw"
|
|
2045
|
+
]);
|
|
2046
|
+
var reservedAuthorizationParams = [
|
|
2047
|
+
"response_type",
|
|
2048
|
+
"client_id",
|
|
2049
|
+
"redirect_uri",
|
|
2050
|
+
"state",
|
|
2051
|
+
"scope",
|
|
2052
|
+
"code_challenge",
|
|
2053
|
+
"code_challenge_method",
|
|
2054
|
+
"nonce",
|
|
2055
|
+
"resource",
|
|
2056
|
+
"request",
|
|
2057
|
+
"request_uri"
|
|
2058
|
+
];
|
|
2059
|
+
var reserved = new Set(reservedAuthorizationParams);
|
|
2060
|
+
var OAuthAuthorizationParams = Schema_exports.Record(Schema_exports.String, Schema_exports.String).check(
|
|
2061
|
+
Schema_exports.makeFilter((params) => Object.keys(params).every((key) => !reserved.has(key)), {
|
|
2062
|
+
message: "Authorization parameters cannot replace protocol parameters such as state or scope."
|
|
2063
|
+
})
|
|
2064
|
+
);
|
|
2065
|
+
var declaredAuthorizationQuery = Schema_exports.makeFilter(
|
|
2066
|
+
(config) => {
|
|
2067
|
+
const keys = [...new URL(config.authorizationUrl).searchParams.keys()];
|
|
2068
|
+
const owned = keys.filter((key) => reserved.has(key));
|
|
2069
|
+
if (owned.length > 0)
|
|
2070
|
+
return {
|
|
2071
|
+
path: ["authorizationUrl"],
|
|
2072
|
+
issue: `authorizationUrl cannot set protocol parameters: ${owned.join(", ")}.`
|
|
2073
|
+
};
|
|
2074
|
+
const repeated = keys.filter((key) => Object.hasOwn(config.authorizationParams ?? {}, key));
|
|
2075
|
+
if (repeated.length > 0)
|
|
2076
|
+
return {
|
|
2077
|
+
path: ["authorizationParams"],
|
|
2078
|
+
issue: `Declare each parameter once; authorizationUrl already sets: ${repeated.join(", ")}.`
|
|
2079
|
+
};
|
|
2080
|
+
return void 0;
|
|
2081
|
+
}
|
|
2082
|
+
);
|
|
2083
|
+
var OAuthTokenRequestFormat = Schema_exports.Literals(["form", "json"]);
|
|
2084
|
+
var OAuthTokenResponse = Schema_exports.Struct({
|
|
2085
|
+
path: Schema_exports.String.check(Schema_exports.isPattern(/^[^.]+(\.[^.]+)*$/))
|
|
2086
|
+
});
|
|
2087
|
+
var tokenRequestOptions = {
|
|
2088
|
+
/** Joins requested scopes; Linear wants `","`. Defaults to RFC 6749's space. */
|
|
2089
|
+
scopeSeparator: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMinLength(1))),
|
|
2090
|
+
/** Encoding of token requests. Defaults to `"form"`; Atlassian, ClickUp and Notion need `"json"`. */
|
|
2091
|
+
tokenRequestFormat: Schema_exports.optionalKey(OAuthTokenRequestFormat)
|
|
2092
|
+
};
|
|
2093
|
+
var oauthOptions = {
|
|
2094
|
+
...tokenRequestOptions,
|
|
2095
|
+
/**
|
|
2096
|
+
* Read the grant from this nested member of the token response when the top-level response has
|
|
2097
|
+
* no access token or no scope. Slack's user tokens use `{ path: "authed_user" }`.
|
|
2098
|
+
*/
|
|
2099
|
+
tokenResponse: Schema_exports.optionalKey(OAuthTokenResponse),
|
|
2100
|
+
grant: Schema_exports.optionalKey(Schema_exports.Literal("authorization_code")),
|
|
2101
|
+
/**
|
|
2102
|
+
* Service-defined authorization request parameters, such as Google's
|
|
2103
|
+
* `{ access_type: "offline", prompt: "consent" }`. Host-owned protocol parameters
|
|
2104
|
+
* (`state`, `scope`, `redirect_uri`, PKCE and the others in `reservedAuthorizationParams`)
|
|
2105
|
+
* are rejected. A discovered endpoint's own query parameter of the same name is replaced.
|
|
2106
|
+
*/
|
|
2107
|
+
authorizationParams: Schema_exports.optionalKey(OAuthAuthorizationParams),
|
|
2108
|
+
tokenEndpointAuthMethod: Schema_exports.optionalKey(OAuthClientAuth),
|
|
2109
|
+
/** Omitted uses discovery; null explicitly suppresses the resource parameter. */
|
|
2110
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl))
|
|
2111
|
+
};
|
|
2112
|
+
var OAuth2Config = Schema_exports.Union([
|
|
2113
|
+
Schema_exports.Struct({
|
|
2114
|
+
...oauthOptions,
|
|
2115
|
+
discover: HttpUrl,
|
|
2116
|
+
/** Fetch this exact metadata document and verify its issuer against discovery. */
|
|
2117
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl),
|
|
2118
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2119
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2120
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2121
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String))
|
|
2122
|
+
}),
|
|
2123
|
+
Schema_exports.Struct({
|
|
2124
|
+
...oauthOptions,
|
|
2125
|
+
/** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
|
|
2126
|
+
authorizationUrl: HttpUrl,
|
|
2127
|
+
tokenUrl: HttpUrl,
|
|
2128
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl),
|
|
2129
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
2130
|
+
/** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
|
|
2131
|
+
issuer: Schema_exports.optionalKey(HttpUrl),
|
|
2132
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2133
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
|
|
2134
|
+
}).check(declaredAuthorizationQuery),
|
|
2135
|
+
Schema_exports.Struct({
|
|
2136
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
2137
|
+
discover: HttpUrl,
|
|
2138
|
+
/** Fetch this exact metadata document and verify its issuer against discovery. */
|
|
2139
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl),
|
|
2140
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2141
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2142
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2143
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
2144
|
+
...tokenRequestOptions,
|
|
2145
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth,
|
|
2146
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl))
|
|
2147
|
+
}),
|
|
2148
|
+
Schema_exports.Struct({
|
|
2149
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
2150
|
+
tokenUrl: HttpUrl,
|
|
2151
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl),
|
|
2152
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
2153
|
+
...tokenRequestOptions,
|
|
2154
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth,
|
|
2155
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl)),
|
|
2156
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2157
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2158
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
|
|
2159
|
+
})
|
|
2160
|
+
]);
|
|
2161
|
+
var OAuth2AccessToken = Schema_exports.Struct({ access_token: Schema_exports.String });
|
|
2162
|
+
var OAuth2Method = class extends Data_exports.TaggedClass(
|
|
2163
|
+
"oauth2"
|
|
2164
|
+
) {
|
|
2165
|
+
};
|
|
2166
|
+
var displayText = Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(255));
|
|
2167
|
+
var AccountInfo = Schema_exports.Struct({
|
|
2168
|
+
externalId: Schema_exports.optionalKey(displayText),
|
|
2169
|
+
displayName: Schema_exports.optionalKey(displayText),
|
|
2170
|
+
username: Schema_exports.optionalKey(displayText),
|
|
2171
|
+
email: Schema_exports.optionalKey(displayText),
|
|
2172
|
+
avatarUrl: Schema_exports.optionalKey(HttpUrl),
|
|
2173
|
+
profileUrl: Schema_exports.optionalKey(HttpUrl)
|
|
2174
|
+
});
|
|
2175
|
+
var AccountCheckResult = Schema_exports.Struct({ accountInfo: Schema_exports.optionalKey(AccountInfo) });
|
|
2176
|
+
var Provider = class extends Data_exports.Class {
|
|
2177
|
+
/** Declare zero or more accounts from this provider without performing I/O. */
|
|
2178
|
+
many() {
|
|
2179
|
+
return new ManyAccounts({ provider: this });
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
var ManyAccounts = class extends Data_exports.TaggedClass("many") {
|
|
2183
|
+
};
|
|
2184
|
+
|
|
2185
|
+
// src/contracts/protocol-version.ts
|
|
2186
|
+
var frameworkProtocol = 11;
|
|
2187
|
+
|
|
2188
|
+
// src/contracts/protocols/oauth.ts
|
|
2189
|
+
var HttpUrl2 = Schema_exports.String.check(
|
|
2190
|
+
Schema_exports.makeFilter((value) => {
|
|
2191
|
+
try {
|
|
2192
|
+
const url = new URL(value);
|
|
2193
|
+
return url.protocol === "https:" || url.protocol === "http:";
|
|
2194
|
+
} catch {
|
|
2195
|
+
return false;
|
|
2196
|
+
}
|
|
2197
|
+
})
|
|
2198
|
+
);
|
|
2199
|
+
var OAuthClientAuth2 = Schema_exports.Literals([
|
|
2200
|
+
"none",
|
|
2201
|
+
"client_secret_post",
|
|
2202
|
+
"client_secret_basic",
|
|
2203
|
+
"client_secret_basic_raw"
|
|
2204
|
+
]);
|
|
2205
|
+
var OAuthSecretClientAuth2 = Schema_exports.Literals([
|
|
2206
|
+
"client_secret_post",
|
|
2207
|
+
"client_secret_basic",
|
|
2208
|
+
"client_secret_basic_raw"
|
|
2209
|
+
]);
|
|
2210
|
+
var reservedAuthorizationParams2 = [
|
|
2211
|
+
"response_type",
|
|
2212
|
+
"client_id",
|
|
2213
|
+
"redirect_uri",
|
|
2214
|
+
"state",
|
|
2215
|
+
"scope",
|
|
2216
|
+
"code_challenge",
|
|
2217
|
+
"code_challenge_method",
|
|
2218
|
+
"nonce",
|
|
2219
|
+
"resource",
|
|
2220
|
+
"request",
|
|
2221
|
+
"request_uri"
|
|
2222
|
+
];
|
|
2223
|
+
var reserved2 = new Set(reservedAuthorizationParams2);
|
|
2224
|
+
var OAuthAuthorizationParams2 = Schema_exports.Record(Schema_exports.String, Schema_exports.String).check(
|
|
2225
|
+
Schema_exports.makeFilter((params) => Object.keys(params).every((key) => !reserved2.has(key)), {
|
|
2226
|
+
message: "Authorization parameters cannot replace protocol parameters such as state or scope."
|
|
2227
|
+
})
|
|
2228
|
+
);
|
|
2229
|
+
var declaredAuthorizationQuery2 = Schema_exports.makeFilter(
|
|
2230
|
+
(config) => {
|
|
2231
|
+
const keys = [...new URL(config.authorizationUrl).searchParams.keys()];
|
|
2232
|
+
const owned = keys.filter((key) => reserved2.has(key));
|
|
2233
|
+
if (owned.length > 0)
|
|
2234
|
+
return {
|
|
2235
|
+
path: ["authorizationUrl"],
|
|
2236
|
+
issue: `authorizationUrl cannot set protocol parameters: ${owned.join(", ")}.`
|
|
2237
|
+
};
|
|
2238
|
+
const repeated = keys.filter((key) => Object.hasOwn(config.authorizationParams ?? {}, key));
|
|
2239
|
+
if (repeated.length > 0)
|
|
2240
|
+
return {
|
|
2241
|
+
path: ["authorizationParams"],
|
|
2242
|
+
issue: `Declare each parameter once; authorizationUrl already sets: ${repeated.join(", ")}.`
|
|
2243
|
+
};
|
|
2244
|
+
return void 0;
|
|
2245
|
+
}
|
|
2246
|
+
);
|
|
2247
|
+
var OAuthTokenRequestFormat2 = Schema_exports.Literals(["form", "json"]);
|
|
2248
|
+
var OAuthTokenResponse2 = Schema_exports.Struct({
|
|
2249
|
+
path: Schema_exports.String.check(Schema_exports.isPattern(/^[^.]+(\.[^.]+)*$/))
|
|
2250
|
+
});
|
|
2251
|
+
var tokenRequestOptions2 = {
|
|
2252
|
+
/** Joins requested scopes; Linear wants `","`. Defaults to RFC 6749's space. */
|
|
2253
|
+
scopeSeparator: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMinLength(1))),
|
|
2254
|
+
/** Encoding of token requests. Defaults to `"form"`; Atlassian, ClickUp and Notion need `"json"`. */
|
|
2255
|
+
tokenRequestFormat: Schema_exports.optionalKey(OAuthTokenRequestFormat2)
|
|
2256
|
+
};
|
|
2257
|
+
var oauthOptions2 = {
|
|
2258
|
+
...tokenRequestOptions2,
|
|
2259
|
+
/**
|
|
2260
|
+
* Read the grant from this nested member of the token response when the top-level response has
|
|
2261
|
+
* no access token or no scope. Slack's user tokens use `{ path: "authed_user" }`.
|
|
2262
|
+
*/
|
|
2263
|
+
tokenResponse: Schema_exports.optionalKey(OAuthTokenResponse2),
|
|
2264
|
+
grant: Schema_exports.optionalKey(Schema_exports.Literal("authorization_code")),
|
|
2265
|
+
/**
|
|
2266
|
+
* Service-defined authorization request parameters, such as Google's
|
|
2267
|
+
* `{ access_type: "offline", prompt: "consent" }`. Host-owned protocol parameters
|
|
2268
|
+
* (`state`, `scope`, `redirect_uri`, PKCE and the others in `reservedAuthorizationParams`)
|
|
2269
|
+
* are rejected. A discovered endpoint's own query parameter of the same name is replaced.
|
|
2270
|
+
*/
|
|
2271
|
+
authorizationParams: Schema_exports.optionalKey(OAuthAuthorizationParams2),
|
|
2272
|
+
tokenEndpointAuthMethod: Schema_exports.optionalKey(OAuthClientAuth2),
|
|
2273
|
+
/** Omitted uses discovery; null explicitly suppresses the resource parameter. */
|
|
2274
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl2))
|
|
2275
|
+
};
|
|
2276
|
+
var OAuth2Config2 = Schema_exports.Union([
|
|
2277
|
+
Schema_exports.Struct({
|
|
2278
|
+
...oauthOptions2,
|
|
2279
|
+
discover: HttpUrl2,
|
|
2280
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2281
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2282
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2283
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String))
|
|
2284
|
+
}),
|
|
2285
|
+
Schema_exports.Struct({
|
|
2286
|
+
...oauthOptions2,
|
|
2287
|
+
/** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
|
|
2288
|
+
authorizationUrl: HttpUrl2,
|
|
2289
|
+
tokenUrl: HttpUrl2,
|
|
2290
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
2291
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
2292
|
+
/** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
|
|
2293
|
+
issuer: Schema_exports.optionalKey(HttpUrl2),
|
|
2294
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never)
|
|
2295
|
+
}).check(declaredAuthorizationQuery2),
|
|
2296
|
+
Schema_exports.Struct({
|
|
2297
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
2298
|
+
discover: HttpUrl2,
|
|
2299
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2300
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2301
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2302
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
2303
|
+
...tokenRequestOptions2,
|
|
2304
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth2,
|
|
2305
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl2))
|
|
2306
|
+
}),
|
|
2307
|
+
Schema_exports.Struct({
|
|
2308
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
2309
|
+
tokenUrl: HttpUrl2,
|
|
2310
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
2311
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
2312
|
+
...tokenRequestOptions2,
|
|
2313
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth2,
|
|
2314
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl2)),
|
|
2315
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
2316
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never)
|
|
2317
|
+
})
|
|
2318
|
+
]);
|
|
2319
|
+
|
|
2320
|
+
// src/contracts/protocols/1.ts
|
|
2321
|
+
var JsonValue2 = Schema_exports.Json;
|
|
2322
|
+
var JsonObject3 = Schema_exports.Record(Schema_exports.String, JsonValue2);
|
|
2323
|
+
var AccountId2 = Schema_exports.String.pipe(
|
|
2324
|
+
Schema_exports.check(Schema_exports.isStartingWith("acc_"), Schema_exports.isMinLength(5)),
|
|
2325
|
+
Schema_exports.brand("acc")
|
|
2326
|
+
);
|
|
2327
|
+
var CacheError = class extends Schema_exports.TaggedError()("CacheError", {
|
|
2328
|
+
reason: Schema_exports.Literals(["unavailable", "storage", "invalid", "capacity", "timeout"])
|
|
2329
|
+
}) {
|
|
2330
|
+
};
|
|
2331
|
+
var Key = Schema_exports.String.check(Schema_exports.isPattern(/^[a-f0-9]{64}$/));
|
|
2332
|
+
var Time = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
|
|
2333
|
+
var CacheEntry = Schema_exports.Struct({
|
|
2334
|
+
value: Schema_exports.Json,
|
|
2335
|
+
version: Schema_exports.String,
|
|
2336
|
+
freshUntil: Time,
|
|
2337
|
+
staleUntil: Time
|
|
2338
|
+
});
|
|
2339
|
+
var CacheCommand2 = Schema_exports.Union([
|
|
2340
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("read"), keys: Schema_exports.Array(Key) }),
|
|
2341
|
+
Schema_exports.Struct({
|
|
2342
|
+
operation: Schema_exports.Literal("acquire"),
|
|
2343
|
+
key: Key,
|
|
2344
|
+
/** Claim even a fresh entry, as an explicit refresh does. */
|
|
2345
|
+
refresh: Schema_exports.Boolean,
|
|
2346
|
+
/** Claim only while the entry still has this version. Absent accepts the current one. */
|
|
2347
|
+
version: Schema_exports.optionalKey(Schema_exports.NullOr(Schema_exports.String))
|
|
2348
|
+
}),
|
|
2349
|
+
Schema_exports.Struct({
|
|
2350
|
+
operation: Schema_exports.Literal("claim"),
|
|
2351
|
+
key: Key,
|
|
2352
|
+
version: Schema_exports.NullOr(Schema_exports.String)
|
|
2353
|
+
}),
|
|
2354
|
+
Schema_exports.Struct({
|
|
2355
|
+
operation: Schema_exports.Literal("publish"),
|
|
2356
|
+
key: Key,
|
|
2357
|
+
lease: Schema_exports.String,
|
|
2358
|
+
entry: CacheEntry
|
|
2359
|
+
}),
|
|
2360
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("release"), key: Key, lease: Schema_exports.String }),
|
|
2361
|
+
/** Extend a lease its holder still owns. Replies false once the lease lapsed or was replaced. */
|
|
2362
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("renew"), key: Key, lease: Schema_exports.String }),
|
|
2363
|
+
Schema_exports.Struct({
|
|
2364
|
+
operation: Schema_exports.Literal("write"),
|
|
2365
|
+
entries: Schema_exports.Array(Schema_exports.Struct({ key: Key, entry: CacheEntry }))
|
|
2366
|
+
}),
|
|
2367
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("invalidate"), key: Key })
|
|
2368
|
+
]);
|
|
2369
|
+
var CacheReply2 = Schema_exports.Union([
|
|
2370
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: Schema_exports.Json }),
|
|
2371
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: CacheError })
|
|
2372
|
+
]);
|
|
2373
|
+
var DataName2 = Schema_exports.String.check(
|
|
2374
|
+
Schema_exports.makeFilter((value) => /^[A-Za-z][A-Za-z0-9_]*$/.test(value) && value.length <= 128)
|
|
2375
|
+
);
|
|
2376
|
+
var Scalar2 = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
2377
|
+
var Field2 = Schema_exports.Struct({
|
|
2378
|
+
kind: Schema_exports.Literals(["string", "number", "boolean", "id", "userId"]),
|
|
2379
|
+
optional: Schema_exports.optional(Schema_exports.Boolean),
|
|
2380
|
+
default: Schema_exports.optional(Scalar2),
|
|
2381
|
+
references: Schema_exports.optional(DataName2)
|
|
2382
|
+
});
|
|
2383
|
+
var Index2 = Schema_exports.Struct({ name: DataName2, fields: Schema_exports.NonEmptyArray(DataName2) });
|
|
2384
|
+
var Table2 = Schema_exports.Struct({
|
|
2385
|
+
fields: Schema_exports.Record(DataName2, Field2),
|
|
2386
|
+
indexes: Schema_exports.Array(Index2)
|
|
2387
|
+
});
|
|
2388
|
+
var DatabaseSchema2 = Schema_exports.Record(DataName2, Table2);
|
|
2389
|
+
var maxApiErrorInstructionsLength2 = 4096;
|
|
2390
|
+
var ApiErrorRecovery2 = Schema_exports.Struct({
|
|
2391
|
+
action: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(1024)),
|
|
2392
|
+
instructions: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(maxApiErrorInstructionsLength2))
|
|
2393
|
+
});
|
|
2394
|
+
var maxApiErrorMessageLength2 = 4096;
|
|
2395
|
+
var ApiErrorResponse2 = Schema_exports.Struct({
|
|
2396
|
+
code: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)),
|
|
2397
|
+
status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 400, maximum: 599 })),
|
|
2398
|
+
message: Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(maxApiErrorMessageLength2)),
|
|
2399
|
+
recovery: Schema_exports.optionalKey(ApiErrorRecovery2)
|
|
2400
|
+
});
|
|
2401
|
+
var OpenapiResponseError2 = class extends Schema_exports.TaggedError()(
|
|
2402
|
+
"OpenapiResponseError",
|
|
2403
|
+
ApiErrorResponse2.fields
|
|
2404
|
+
) {
|
|
2405
|
+
};
|
|
2406
|
+
var FormElicitation2 = Schema_exports.Struct({
|
|
2407
|
+
...ElicitRequestFormParams.fields,
|
|
2408
|
+
mode: Schema_exports.Literal("form"),
|
|
2409
|
+
requestedSchema: Schema_exports.toEncoded(ElicitRequestFormParams.fields.requestedSchema),
|
|
2410
|
+
_meta: Schema_exports.optional(JsonObject3)
|
|
2411
|
+
});
|
|
2412
|
+
var ElicitationResponse2 = Schema_exports.Union([
|
|
2413
|
+
Schema_exports.Struct({ ...ElicitAcceptResult.fields, _meta: Schema_exports.optional(JsonObject3) }),
|
|
2414
|
+
Schema_exports.Struct({ ...ElicitDeclineResult.fields, _meta: Schema_exports.optional(JsonObject3) })
|
|
2415
|
+
]);
|
|
2416
|
+
var ElicitationFailed2 = class extends Schema_exports.TaggedError()(
|
|
2417
|
+
"ElicitationFailed",
|
|
2418
|
+
{
|
|
2419
|
+
reason: Schema_exports.Literals([
|
|
2420
|
+
"unavailable",
|
|
2421
|
+
"transaction",
|
|
2422
|
+
"invalid-request",
|
|
2423
|
+
"invalid-response",
|
|
2424
|
+
"transport",
|
|
2425
|
+
"expired",
|
|
2426
|
+
"forbidden"
|
|
2427
|
+
])
|
|
2428
|
+
}
|
|
2429
|
+
) {
|
|
2430
|
+
};
|
|
2431
|
+
var ElicitationReply2 = Schema_exports.Union([
|
|
2432
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), response: ElicitationResponse2 }),
|
|
2433
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: ElicitationFailed2 })
|
|
2434
|
+
]);
|
|
2435
|
+
var ApprovalElicitation2 = Schema_exports.Struct({
|
|
2436
|
+
...FormElicitation2.fields,
|
|
2437
|
+
requestedSchema: Schema_exports.Struct({
|
|
2438
|
+
type: Schema_exports.Literal("object"),
|
|
2439
|
+
properties: Schema_exports.Record(Schema_exports.String, Schema_exports.Never)
|
|
2440
|
+
})
|
|
2441
|
+
});
|
|
2442
|
+
var minimumIntervalMilliseconds = 6e4;
|
|
2443
|
+
var CalendarSchedule = Schema_exports.Struct({
|
|
2444
|
+
expression: Schema_exports.NonEmptyString,
|
|
2445
|
+
timezone: Schema_exports.NonEmptyString
|
|
2446
|
+
}).check(
|
|
2447
|
+
Schema_exports.makeFilter(
|
|
2448
|
+
(value) => value.expression.trim().split(/\s+/).length === 5 && Result_exports.isSuccess(Cron_exports.parse(value.expression, value.timezone))
|
|
2449
|
+
)
|
|
2450
|
+
);
|
|
2451
|
+
var ScheduleTiming = Schema_exports.Union([
|
|
2452
|
+
Schema_exports.Struct({
|
|
2453
|
+
kind: Schema_exports.Literal("interval"),
|
|
2454
|
+
milliseconds: Schema_exports.Int.check(
|
|
2455
|
+
Schema_exports.makeFilter((value) => value >= minimumIntervalMilliseconds, {
|
|
2456
|
+
message: "Schedule intervals must be at least 60 seconds"
|
|
2457
|
+
}),
|
|
2458
|
+
Schema_exports.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)
|
|
2459
|
+
)
|
|
2460
|
+
}),
|
|
2461
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("cron"), calendar: CalendarSchedule })
|
|
2462
|
+
]);
|
|
2463
|
+
var OperationSchedule = Schema_exports.Struct({
|
|
2464
|
+
name: Schema_exports.NonEmptyString,
|
|
2465
|
+
timing: ScheduleTiming,
|
|
2466
|
+
input: JsonValue2
|
|
2467
|
+
});
|
|
2468
|
+
var SkillFilePath = Schema_exports.NonEmptyString.check(
|
|
2469
|
+
Schema_exports.makeFilter(
|
|
2470
|
+
(path) => !path.startsWith("/") && !path.includes("\\") && !path.includes("\0") && path.split("/").every((part) => part !== "" && part !== "." && part !== "..")
|
|
2471
|
+
)
|
|
2472
|
+
);
|
|
2473
|
+
var SkillFile = Schema_exports.Struct({ path: SkillFilePath, content: Schema_exports.String });
|
|
2474
|
+
var skillFormatLimits = {
|
|
2475
|
+
nameCharacters: 64,
|
|
2476
|
+
descriptionCharacters: 1024,
|
|
2477
|
+
compatibilityCharacters: 500
|
|
2478
|
+
};
|
|
2479
|
+
var AppSkillName2 = Schema_exports.NonEmptyString.check(
|
|
2480
|
+
Schema_exports.makeFilter(
|
|
2481
|
+
(value) => value === value.toLowerCase() && /^[\p{L}\p{N}]+(?:-[\p{L}\p{N}]+)*$/u.test(value) && [...value].length <= skillFormatLimits.nameCharacters
|
|
2482
|
+
)
|
|
2483
|
+
);
|
|
2484
|
+
var AppSkillMetadata = Schema_exports.Struct({
|
|
2485
|
+
name: AppSkillName2,
|
|
2486
|
+
description: Schema_exports.String.check(
|
|
2487
|
+
Schema_exports.makeFilter(
|
|
2488
|
+
(value) => value.trim().length > 0 && [...value].length <= skillFormatLimits.descriptionCharacters
|
|
2489
|
+
)
|
|
2490
|
+
),
|
|
2491
|
+
license: Schema_exports.optionalKey(Schema_exports.String),
|
|
2492
|
+
compatibility: Schema_exports.optionalKey(
|
|
2493
|
+
Schema_exports.String.check(
|
|
2494
|
+
Schema_exports.makeFilter(
|
|
2495
|
+
(value) => value.trim().length > 0 && [...value].length <= skillFormatLimits.compatibilityCharacters
|
|
2496
|
+
)
|
|
2497
|
+
)
|
|
2498
|
+
),
|
|
2499
|
+
metadata: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
|
|
2500
|
+
"allowed-tools": Schema_exports.optionalKey(Schema_exports.String)
|
|
2501
|
+
});
|
|
2502
|
+
var AppSkillSource = Schema_exports.Struct({
|
|
2503
|
+
...AppSkillMetadata.fields,
|
|
2504
|
+
files: Schema_exports.Array(SkillFile).check(
|
|
2505
|
+
Schema_exports.makeFilter(
|
|
2506
|
+
(files) => files.some((file) => file.path === "SKILL.md") && new Set(files.map((file) => file.path)).size === files.length
|
|
2507
|
+
)
|
|
2508
|
+
)
|
|
2509
|
+
});
|
|
2510
|
+
var AppSkills2 = Schema_exports.Array(AppSkillSource).check(
|
|
2511
|
+
Schema_exports.makeFilter((skills) => new Set(skills.map((skill) => skill.name)).size === skills.length)
|
|
2512
|
+
);
|
|
2513
|
+
var ToolAnnotations3 = Schema_exports.Struct({
|
|
2514
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
2515
|
+
readOnlyHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
2516
|
+
destructiveHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
2517
|
+
idempotentHint: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
2518
|
+
openWorldHint: Schema_exports.optionalKey(Schema_exports.Boolean)
|
|
2519
|
+
});
|
|
2520
|
+
var WebhookTransportLimits2 = Schema_exports.Struct({
|
|
2521
|
+
maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
2522
|
+
});
|
|
2523
|
+
var defaultWebhookTransportLimits2 = WebhookTransportLimits2.make({
|
|
2524
|
+
maxBodyBytes: 1024 * 1024
|
|
2525
|
+
});
|
|
2526
|
+
var encodedBodyChars2 = 4 * Math.ceil(defaultWebhookTransportLimits2.maxBodyBytes / 3);
|
|
2527
|
+
var WebhookRequestData2 = Schema_exports.Struct({
|
|
2528
|
+
url: HttpUrl2,
|
|
2529
|
+
method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
|
|
2530
|
+
headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
|
|
2531
|
+
body: Schema_exports.String.check(Schema_exports.isMaxLength(encodedBodyChars2))
|
|
2532
|
+
});
|
|
2533
|
+
var identity2 = {
|
|
2534
|
+
name: Schema_exports.NonEmptyString,
|
|
2535
|
+
subscriptionId: Schema_exports.NonEmptyString,
|
|
2536
|
+
sourceAccount: AccountId2,
|
|
2537
|
+
callbackUrl: HttpUrl2,
|
|
2538
|
+
secret: Schema_exports.String,
|
|
2539
|
+
config: JsonValue2
|
|
2540
|
+
};
|
|
2541
|
+
var WebhookCommand2 = Schema_exports.Union([
|
|
2542
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhooks") }),
|
|
2543
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-validate"), ...identity2 }),
|
|
2544
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-complete"), ...identity2, state: JsonValue2 }),
|
|
2545
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-register"), ...identity2 }),
|
|
2546
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-unregister"), ...identity2, state: JsonValue2 }),
|
|
2547
|
+
Schema_exports.Struct({
|
|
2548
|
+
operation: Schema_exports.Literal("webhook-handle"),
|
|
2549
|
+
...identity2,
|
|
2550
|
+
state: JsonValue2,
|
|
2551
|
+
request: WebhookRequestData2
|
|
2552
|
+
})
|
|
2553
|
+
]);
|
|
2554
|
+
var WorkflowRunId2 = Schema_exports.NonEmptyString.pipe(Schema_exports.brand("wfr"));
|
|
2555
|
+
var WorkflowName2 = Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(200));
|
|
2556
|
+
var durationUnits2 = {
|
|
2557
|
+
millisecond: 1,
|
|
2558
|
+
milliseconds: 1,
|
|
2559
|
+
second: 1e3,
|
|
2560
|
+
seconds: 1e3,
|
|
2561
|
+
minute: 6e4,
|
|
2562
|
+
minutes: 6e4,
|
|
2563
|
+
hour: 36e5,
|
|
2564
|
+
hours: 36e5,
|
|
2565
|
+
day: 864e5,
|
|
2566
|
+
days: 864e5,
|
|
2567
|
+
week: 6048e5,
|
|
2568
|
+
weeks: 6048e5
|
|
2569
|
+
};
|
|
2570
|
+
var workflowDurationMillis2 = (value) => {
|
|
2571
|
+
if (typeof value === "number") return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
2572
|
+
const match = /^(\d+(?:\.\d+)?) (milliseconds?|seconds?|minutes?|hours?|days?|weeks?)$/.exec(
|
|
2573
|
+
value
|
|
2574
|
+
);
|
|
2575
|
+
const unit = match?.[2] === void 0 ? void 0 : durationUnits2[match[2]];
|
|
2576
|
+
if (unit === void 0) return void 0;
|
|
2577
|
+
const result = Number(match?.[1]) * unit;
|
|
2578
|
+
return Number.isFinite(result) ? result : void 0;
|
|
2579
|
+
};
|
|
2580
|
+
var WorkflowDuration2 = Schema_exports.Union([
|
|
2581
|
+
Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
2582
|
+
Schema_exports.NonEmptyString
|
|
2583
|
+
]).check(Schema_exports.makeFilter((value) => workflowDurationMillis2(value) !== void 0));
|
|
2584
|
+
var WorkflowStepOptions2 = Schema_exports.Struct({
|
|
2585
|
+
retries: Schema_exports.optionalKey(
|
|
2586
|
+
Schema_exports.Struct({
|
|
2587
|
+
limit: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
2588
|
+
delay: WorkflowDuration2,
|
|
2589
|
+
backoff: Schema_exports.optionalKey(Schema_exports.Literals(["constant", "linear", "exponential"]))
|
|
2590
|
+
})
|
|
2591
|
+
),
|
|
2592
|
+
timeout: Schema_exports.optionalKey(WorkflowDuration2)
|
|
2593
|
+
});
|
|
2594
|
+
var WorkflowValue2 = JsonValue2.check(
|
|
2595
|
+
Schema_exports.makeFilter(
|
|
2596
|
+
(value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 1024 * 1024
|
|
2597
|
+
)
|
|
2598
|
+
);
|
|
2599
|
+
var WorkflowReplay2 = Schema_exports.Struct({
|
|
2600
|
+
key: Schema_exports.NonEmptyString,
|
|
2601
|
+
fingerprint: Schema_exports.NonEmptyString
|
|
2602
|
+
});
|
|
2603
|
+
var WorkflowCommand2 = Schema_exports.Union([
|
|
2604
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("workflows") }),
|
|
2605
|
+
Schema_exports.Struct({
|
|
2606
|
+
operation: Schema_exports.Literal("workflow-validate"),
|
|
2607
|
+
name: WorkflowName2,
|
|
2608
|
+
input: JsonValue2
|
|
2609
|
+
}),
|
|
2610
|
+
Schema_exports.Struct({
|
|
2611
|
+
operation: Schema_exports.Literal("workflow-run"),
|
|
2612
|
+
name: WorkflowName2,
|
|
2613
|
+
input: JsonValue2
|
|
2614
|
+
})
|
|
2615
|
+
]);
|
|
2616
|
+
var WorkflowRpcCommand2 = Schema_exports.Union([
|
|
2617
|
+
Schema_exports.Struct({
|
|
2618
|
+
operation: Schema_exports.Literal("do"),
|
|
2619
|
+
name: WorkflowName2,
|
|
2620
|
+
options: WorkflowStepOptions2
|
|
2621
|
+
}),
|
|
2622
|
+
Schema_exports.Struct({
|
|
2623
|
+
operation: Schema_exports.Literal("sleep"),
|
|
2624
|
+
name: WorkflowName2,
|
|
2625
|
+
duration: WorkflowDuration2
|
|
2626
|
+
}),
|
|
2627
|
+
Schema_exports.Struct({
|
|
2628
|
+
operation: Schema_exports.Literal("until"),
|
|
2629
|
+
name: WorkflowName2,
|
|
2630
|
+
timestamp: Schema_exports.Finite
|
|
2631
|
+
}),
|
|
2632
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("context") }),
|
|
2633
|
+
Schema_exports.Struct({
|
|
2634
|
+
operation: Schema_exports.Literal("invoke"),
|
|
2635
|
+
kind: Schema_exports.Literals(["query", "mutation"]),
|
|
2636
|
+
name: Schema_exports.NonEmptyString,
|
|
2637
|
+
input: JsonValue2,
|
|
2638
|
+
stepId: Schema_exports.NonEmptyString,
|
|
2639
|
+
timeout: Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0))
|
|
2640
|
+
})
|
|
2641
|
+
]);
|
|
2642
|
+
var WorkflowControlCommand2 = Schema_exports.Union([
|
|
2643
|
+
Schema_exports.Struct({
|
|
2644
|
+
operation: Schema_exports.Literal("start"),
|
|
2645
|
+
workflow: WorkflowName2,
|
|
2646
|
+
input: WorkflowValue2,
|
|
2647
|
+
key: Schema_exports.optionalKey(Schema_exports.NonEmptyString.check(Schema_exports.isMaxLength(128)))
|
|
2648
|
+
}),
|
|
2649
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("get"), run: WorkflowRunId2 }),
|
|
2650
|
+
Schema_exports.Struct({
|
|
2651
|
+
operation: Schema_exports.Literal("list"),
|
|
2652
|
+
workflow: Schema_exports.optionalKey(WorkflowName2),
|
|
2653
|
+
cursor: Schema_exports.optionalKey(WorkflowRunId2),
|
|
2654
|
+
limit: Schema_exports.optionalKey(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1, maximum: 100 })))
|
|
2655
|
+
}),
|
|
2656
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("terminate"), run: WorkflowRunId2 })
|
|
2657
|
+
]);
|
|
2658
|
+
var ProviderError2 = class extends Schema_exports.TaggedError()("ProviderError", {
|
|
2659
|
+
reason: Schema_exports.Literals(["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]),
|
|
2660
|
+
status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
|
|
2661
|
+
accountId: Schema_exports.optional(AccountId2)
|
|
2662
|
+
}) {
|
|
2663
|
+
};
|
|
2664
|
+
var McpError3 = class extends Schema_exports.TaggedError()("McpError", {
|
|
2665
|
+
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
2666
|
+
reason: Schema_exports.Literals([
|
|
2667
|
+
"request",
|
|
2668
|
+
"unauthorized",
|
|
2669
|
+
"invalid_response",
|
|
2670
|
+
"timeout",
|
|
2671
|
+
"invalid_input"
|
|
2672
|
+
]),
|
|
2673
|
+
status: Schema_exports.optional(Schema_exports.Number)
|
|
2674
|
+
}) {
|
|
2675
|
+
};
|
|
2676
|
+
var SkillLoadFailed = class extends Schema_exports.TaggedError()("SkillLoadFailed", {
|
|
2677
|
+
reason: Schema_exports.Literals([
|
|
2678
|
+
"source",
|
|
2679
|
+
"request",
|
|
2680
|
+
"rate_limited",
|
|
2681
|
+
"document",
|
|
2682
|
+
"limit",
|
|
2683
|
+
"changed",
|
|
2684
|
+
"encoding"
|
|
2685
|
+
]),
|
|
2686
|
+
message: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isMaxLength(500))),
|
|
2687
|
+
status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 })))
|
|
2688
|
+
}) {
|
|
2689
|
+
};
|
|
2690
|
+
var WorkflowFailure2 = class extends Schema_exports.TaggedError()("WorkflowFailure", {
|
|
2691
|
+
reason: Schema_exports.Literals([
|
|
2692
|
+
"unavailable",
|
|
2693
|
+
"not_found",
|
|
2694
|
+
"input",
|
|
2695
|
+
"output",
|
|
2696
|
+
"operation",
|
|
2697
|
+
"approval",
|
|
2698
|
+
"credentials",
|
|
2699
|
+
"terminated",
|
|
2700
|
+
"execution",
|
|
2701
|
+
"conflict",
|
|
2702
|
+
"engine"
|
|
2703
|
+
]),
|
|
2704
|
+
retryable: Schema_exports.Boolean
|
|
2705
|
+
}) {
|
|
2706
|
+
};
|
|
2707
|
+
var WorkflowRpcResult2 = Schema_exports.Union([
|
|
2708
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: JsonValue2 }),
|
|
2709
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: WorkflowFailure2 })
|
|
2710
|
+
]);
|
|
2711
|
+
var DeclaredAuthMethod = Schema_exports.Union([
|
|
2712
|
+
Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject3 }),
|
|
2713
|
+
Schema_exports.Struct({
|
|
2714
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2715
|
+
...OAuth2Config2.members[0].fields,
|
|
2716
|
+
response: JsonObject3
|
|
2717
|
+
}),
|
|
2718
|
+
Schema_exports.Struct({
|
|
2719
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2720
|
+
...OAuth2Config2.members[1].fields,
|
|
2721
|
+
response: JsonObject3
|
|
2722
|
+
}),
|
|
2723
|
+
Schema_exports.Struct({
|
|
2724
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2725
|
+
...OAuth2Config2.members[2].fields,
|
|
2726
|
+
response: JsonObject3
|
|
2727
|
+
}),
|
|
2728
|
+
Schema_exports.Struct({
|
|
2729
|
+
type: Schema_exports.Literal("oauth2"),
|
|
2730
|
+
...OAuth2Config2.members[3].fields,
|
|
2731
|
+
response: JsonObject3
|
|
2732
|
+
})
|
|
2733
|
+
]);
|
|
2734
|
+
var DeclaredProvider = Schema_exports.Struct({
|
|
2735
|
+
name: Schema_exports.NonEmptyString,
|
|
2736
|
+
auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod)
|
|
2737
|
+
});
|
|
2738
|
+
var DeclaredRequirements = Schema_exports.Struct({
|
|
2739
|
+
/** Protocol support of this retained framework build, not an author-declared requirement. */
|
|
2740
|
+
capabilities: Schema_exports.optionalKey(
|
|
2741
|
+
Schema_exports.Struct({
|
|
2742
|
+
skills: Schema_exports.Literal(true),
|
|
2743
|
+
/** Accepts inspect detail and tools. Earlier builds reject both as excess fields. */
|
|
2744
|
+
toolIndex: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
2745
|
+
/** Accepts skills sources and reports whether the catalog includes a live loader. */
|
|
2746
|
+
skillSources: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
2747
|
+
/** Accepts scheduled inspection. Earlier builds reject it as an excess field. */
|
|
2748
|
+
scheduledTools: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2749
|
+
})
|
|
2750
|
+
),
|
|
2751
|
+
database: Schema_exports.optionalKey(DatabaseSchema2),
|
|
2752
|
+
accounts: Schema_exports.Record(
|
|
2753
|
+
Schema_exports.NonEmptyString,
|
|
2754
|
+
Schema_exports.Struct({
|
|
2755
|
+
definition: DeclaredProvider,
|
|
2756
|
+
cardinality: Schema_exports.Literals(["one", "many"])
|
|
2757
|
+
})
|
|
2758
|
+
)
|
|
2759
|
+
});
|
|
2760
|
+
var ResolvedAccount = Schema_exports.Struct({
|
|
2761
|
+
id: AccountId2,
|
|
2762
|
+
provider: DeclaredProvider,
|
|
2763
|
+
method: Schema_exports.NonEmptyString,
|
|
2764
|
+
/**
|
|
2765
|
+
* Changes when the account is reconnected or its credentials replaced, not on renewal. Hosts
|
|
2766
|
+
* send it since credential generations; `apps@0.0.1-beta.0` and `beta.1` ignore it.
|
|
2767
|
+
*/
|
|
2768
|
+
generation: Schema_exports.optionalKey(Schema_exports.Int),
|
|
2769
|
+
fields: JsonObject3
|
|
2770
|
+
});
|
|
2771
|
+
var ResolvedAccounts = Schema_exports.Record(
|
|
2772
|
+
Schema_exports.NonEmptyString,
|
|
2773
|
+
Schema_exports.Union([ResolvedAccount, Schema_exports.Array(ResolvedAccount)])
|
|
2774
|
+
);
|
|
2775
|
+
var TrustedToolApproval = Schema_exports.Struct({ tool: Schema_exports.NonEmptyString, input: JsonValue2 });
|
|
2776
|
+
var InvocationDeadline = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
|
|
2777
|
+
var HostedTool = Schema_exports.Struct({
|
|
2778
|
+
schedules: Schema_exports.optionalKey(Schema_exports.Array(OperationSchedule)),
|
|
2779
|
+
name: Schema_exports.NonEmptyString,
|
|
2780
|
+
description: Schema_exports.String,
|
|
2781
|
+
inputSchema: JsonObject3,
|
|
2782
|
+
readOnly: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
2783
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
2784
|
+
outputSchema: Schema_exports.optionalKey(JsonObject3),
|
|
2785
|
+
annotations: Schema_exports.optionalKey(ToolAnnotations3),
|
|
2786
|
+
_meta: Schema_exports.optionalKey(JsonObject3)
|
|
2787
|
+
});
|
|
2788
|
+
var HostedToolSummary = HostedTool.mapFields(
|
|
2789
|
+
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
2790
|
+
);
|
|
2791
|
+
var SkillSources = Schema_exports.Struct({ skills: AppSkills2, dynamic: Schema_exports.Boolean });
|
|
2792
|
+
var SkillCatalogResponse = Schema_exports.Union([SkillSources, AppSkills2]);
|
|
2793
|
+
var HostRequest = Schema_exports.Union([
|
|
2794
|
+
WorkflowCommand2,
|
|
2795
|
+
WebhookCommand2,
|
|
2796
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("requirements") }),
|
|
2797
|
+
Schema_exports.Struct({
|
|
2798
|
+
operation: Schema_exports.Literal("inspect"),
|
|
2799
|
+
/** Omit schemas. Only builds that declare the toolIndex capability accept this. */
|
|
2800
|
+
detail: Schema_exports.optionalKey(Schema_exports.Literal("summary")),
|
|
2801
|
+
/** Describe only these tools. Only builds that declare the toolIndex capability accept this. */
|
|
2802
|
+
tools: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
2803
|
+
/**
|
|
2804
|
+
* Describe only declared operations that have schedules, without dynamic tool discovery.
|
|
2805
|
+
* Only builds that declare the scheduledTools capability accept this.
|
|
2806
|
+
*/
|
|
2807
|
+
scheduled: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2808
|
+
}),
|
|
2809
|
+
Schema_exports.Struct({
|
|
2810
|
+
operation: Schema_exports.Literal("skills"),
|
|
2811
|
+
/** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
|
|
2812
|
+
sources: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2813
|
+
}),
|
|
2814
|
+
Schema_exports.Struct({
|
|
2815
|
+
operation: Schema_exports.Literal("query"),
|
|
2816
|
+
name: Schema_exports.NonEmptyString,
|
|
2817
|
+
input: JsonValue2
|
|
2818
|
+
}),
|
|
2819
|
+
Schema_exports.Struct({
|
|
2820
|
+
operation: Schema_exports.Literal("mutate"),
|
|
2821
|
+
name: Schema_exports.NonEmptyString,
|
|
2822
|
+
input: JsonValue2
|
|
2823
|
+
}),
|
|
2824
|
+
Schema_exports.Struct({
|
|
2825
|
+
operation: Schema_exports.Literal("call"),
|
|
2826
|
+
tool: Schema_exports.NonEmptyString,
|
|
2827
|
+
input: JsonValue2
|
|
2828
|
+
})
|
|
2829
|
+
]);
|
|
2830
|
+
var HostRequestInvalid = class extends Schema_exports.TaggedError()(
|
|
2831
|
+
"HostRequestInvalid",
|
|
2832
|
+
{}
|
|
2833
|
+
) {
|
|
2834
|
+
};
|
|
2835
|
+
var HostAccountsInvalid = class extends Schema_exports.TaggedError()(
|
|
2836
|
+
"HostAccountsInvalid",
|
|
2837
|
+
{}
|
|
2838
|
+
) {
|
|
2839
|
+
};
|
|
2840
|
+
var HostDeclarationInvalid = class extends Schema_exports.TaggedError()(
|
|
2841
|
+
"HostDeclarationInvalid",
|
|
2842
|
+
{}
|
|
2843
|
+
) {
|
|
2844
|
+
};
|
|
2845
|
+
var HostEvaluationFailed = class extends Schema_exports.TaggedError()(
|
|
2846
|
+
"HostEvaluationFailed",
|
|
2847
|
+
{}
|
|
2848
|
+
) {
|
|
2849
|
+
};
|
|
2850
|
+
var HostOperationNotFound = class extends Schema_exports.TaggedError()(
|
|
2851
|
+
"HostOperationNotFound",
|
|
2852
|
+
{}
|
|
2853
|
+
) {
|
|
2854
|
+
};
|
|
2855
|
+
var HostOperationFailed = class extends Schema_exports.TaggedError()(
|
|
2856
|
+
"HostOperationFailed",
|
|
2857
|
+
{}
|
|
2858
|
+
) {
|
|
2859
|
+
};
|
|
2860
|
+
var HostToolNotFound = class extends Schema_exports.TaggedError()(
|
|
2861
|
+
"HostToolNotFound",
|
|
2862
|
+
{}
|
|
2863
|
+
) {
|
|
2864
|
+
};
|
|
2865
|
+
var InputProblem = Schema_exports.String.check(Schema_exports.isMaxLength(512));
|
|
2866
|
+
var maxInputProblems = 10;
|
|
2867
|
+
var HostInputInvalid = class extends Schema_exports.TaggedError()("HostInputInvalid", {
|
|
2868
|
+
problems: Schema_exports.optionalKey(
|
|
2869
|
+
Schema_exports.Array(InputProblem).check(Schema_exports.isMaxLength(maxInputProblems))
|
|
2870
|
+
)
|
|
2871
|
+
}) {
|
|
2872
|
+
};
|
|
2873
|
+
var HostToolBlocked = class extends Schema_exports.TaggedError()("HostToolBlocked", {}) {
|
|
2874
|
+
};
|
|
2875
|
+
var HostToolApprovalRequired = class extends Schema_exports.TaggedError()(
|
|
2876
|
+
"HostToolApprovalRequired",
|
|
2877
|
+
{ input: JsonValue2, elicitation: ApprovalElicitation2 }
|
|
2878
|
+
) {
|
|
2879
|
+
};
|
|
2880
|
+
var HostToolPolicyFailed = class extends Schema_exports.TaggedError()(
|
|
2881
|
+
"HostToolPolicyFailed",
|
|
2882
|
+
{}
|
|
2883
|
+
) {
|
|
2884
|
+
};
|
|
2885
|
+
var HostOutputInvalid = class extends Schema_exports.TaggedError()(
|
|
2886
|
+
"HostOutputInvalid",
|
|
2887
|
+
{}
|
|
2888
|
+
) {
|
|
2889
|
+
};
|
|
2890
|
+
var HostError = Schema_exports.Union([
|
|
2891
|
+
OpenapiResponseError2,
|
|
2892
|
+
ProviderError2,
|
|
2893
|
+
McpError3,
|
|
2894
|
+
SkillLoadFailed,
|
|
2895
|
+
WorkflowFailure2,
|
|
2896
|
+
HostRequestInvalid,
|
|
2897
|
+
HostAccountsInvalid,
|
|
2898
|
+
HostDeclarationInvalid,
|
|
2899
|
+
HostEvaluationFailed,
|
|
2900
|
+
HostOperationNotFound,
|
|
2901
|
+
HostOperationFailed,
|
|
2902
|
+
HostToolNotFound,
|
|
2903
|
+
HostInputInvalid,
|
|
2904
|
+
HostOutputInvalid,
|
|
2905
|
+
HostToolBlocked,
|
|
2906
|
+
HostToolApprovalRequired,
|
|
2907
|
+
HostToolPolicyFailed,
|
|
2908
|
+
ElicitationFailed2
|
|
2909
|
+
]);
|
|
2910
|
+
var HostResponse = Schema_exports.Union([
|
|
2911
|
+
Schema_exports.Struct({
|
|
2912
|
+
ok: Schema_exports.Literal(true),
|
|
2913
|
+
value: JsonValue2,
|
|
2914
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
2915
|
+
}),
|
|
2916
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError })
|
|
2917
|
+
]);
|
|
2918
|
+
var HostInvocation = Schema_exports.Struct({
|
|
2919
|
+
command: HostRequest,
|
|
2920
|
+
accounts: ResolvedAccounts,
|
|
2921
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
2922
|
+
replay: Schema_exports.optionalKey(WorkflowReplay2),
|
|
2923
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
2924
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId2)
|
|
2925
|
+
});
|
|
2926
|
+
var protocol1 = {
|
|
2927
|
+
version: 1,
|
|
2928
|
+
schemas: {
|
|
2929
|
+
invocation: HostInvocation,
|
|
2930
|
+
request: HostRequest,
|
|
2931
|
+
response: HostResponse,
|
|
2932
|
+
requirements: DeclaredRequirements,
|
|
2933
|
+
tools: Schema_exports.Array(HostedTool),
|
|
2934
|
+
toolSummaries: Schema_exports.Array(HostedToolSummary),
|
|
2935
|
+
skills: SkillCatalogResponse,
|
|
2936
|
+
elicitationRequest: FormElicitation2,
|
|
2937
|
+
elicitationReply: ElicitationReply2,
|
|
2938
|
+
workflowStep: WorkflowRpcCommand2,
|
|
2939
|
+
workflowStepReply: WorkflowRpcResult2,
|
|
2940
|
+
workflowControl: WorkflowControlCommand2,
|
|
2941
|
+
cacheCommand: CacheCommand2,
|
|
2942
|
+
cacheReply: CacheReply2
|
|
2943
|
+
}
|
|
2944
|
+
};
|
|
2945
|
+
|
|
2946
|
+
// src/contracts/protocols/2.ts
|
|
2947
|
+
var SkillSources2 = Schema_exports.Struct({
|
|
2948
|
+
skills: AppSkills2,
|
|
2949
|
+
dynamic: Schema_exports.Boolean,
|
|
2950
|
+
cached: Schema_exports.optionalKey(Schema_exports.Boolean)
|
|
2951
|
+
});
|
|
2952
|
+
var SkillCatalogResponse2 = Schema_exports.Union([SkillSources2, AppSkills2]);
|
|
2953
|
+
var protocol2 = {
|
|
2954
|
+
version: 2,
|
|
2955
|
+
schemas: { ...protocol1.schemas, skills: SkillCatalogResponse2 }
|
|
2956
|
+
};
|
|
2957
|
+
|
|
2958
|
+
// src/contracts/protocols/3.ts
|
|
2959
|
+
var maxFailureMessageLength = 2048;
|
|
2960
|
+
var FailureSource = Schema_exports.Literals(["app", "storage", "service"]);
|
|
2961
|
+
var FailureName2 = Schema_exports.String.check(Schema_exports.isMaxLength(128));
|
|
2962
|
+
var FailureCode = Schema_exports.String.check(Schema_exports.isMaxLength(128));
|
|
2963
|
+
var FailureMessage2 = Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureMessageLength));
|
|
2964
|
+
var WorkflowFailureDetail2 = {
|
|
2965
|
+
step: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(200))),
|
|
2966
|
+
errorName: Schema_exports.optionalKey(FailureName2),
|
|
2967
|
+
message: Schema_exports.optionalKey(FailureMessage2)
|
|
2968
|
+
};
|
|
2969
|
+
var WorkflowFailure3 = class extends Schema_exports.TaggedError()("WorkflowFailure", {
|
|
2970
|
+
...WorkflowFailureDetail2,
|
|
2971
|
+
reason: Schema_exports.Literals([
|
|
2972
|
+
"unavailable",
|
|
2973
|
+
"not_found",
|
|
2974
|
+
"input",
|
|
2975
|
+
"output",
|
|
2976
|
+
"operation",
|
|
2977
|
+
"approval",
|
|
2978
|
+
"credentials",
|
|
2979
|
+
"terminated",
|
|
2980
|
+
"execution",
|
|
2981
|
+
"conflict",
|
|
2982
|
+
"engine"
|
|
2983
|
+
]),
|
|
2984
|
+
retryable: Schema_exports.Boolean
|
|
2985
|
+
}) {
|
|
2986
|
+
};
|
|
2987
|
+
var WorkflowRpcResult3 = Schema_exports.Union([
|
|
2988
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(true), value: JsonValue2 }),
|
|
2989
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: WorkflowFailure3 })
|
|
2990
|
+
]);
|
|
2991
|
+
var DatabaseLimit2 = Schema_exports.Literals([
|
|
2992
|
+
"scanCalls",
|
|
2993
|
+
"directGets",
|
|
2994
|
+
"rowsRead",
|
|
2995
|
+
"rowsReturned",
|
|
2996
|
+
"pageSize",
|
|
2997
|
+
"bytesRead",
|
|
2998
|
+
"writes",
|
|
2999
|
+
"valueBytes"
|
|
3000
|
+
]);
|
|
3001
|
+
var DatabaseLimitExceeded2 = class extends Schema_exports.TaggedError()(
|
|
3002
|
+
"DatabaseLimitExceeded",
|
|
3003
|
+
{
|
|
3004
|
+
limit: DatabaseLimit2,
|
|
3005
|
+
maximum: Schema_exports.Int,
|
|
3006
|
+
requested: Schema_exports.Int
|
|
3007
|
+
}
|
|
3008
|
+
) {
|
|
3009
|
+
};
|
|
3010
|
+
var reservedFieldNames2 = ["id", "createdAt", "updatedAt"];
|
|
3011
|
+
var DatabaseFieldReserved2 = class extends Schema_exports.TaggedError()(
|
|
3012
|
+
"DatabaseFieldReserved",
|
|
3013
|
+
{
|
|
3014
|
+
table: Schema_exports.String,
|
|
3015
|
+
field: Schema_exports.Literals(reservedFieldNames2)
|
|
3016
|
+
}
|
|
3017
|
+
) {
|
|
3018
|
+
};
|
|
3019
|
+
var FailureDetail2 = {
|
|
3020
|
+
source: Schema_exports.optionalKey(FailureSource),
|
|
3021
|
+
errorName: Schema_exports.optionalKey(FailureName2),
|
|
3022
|
+
code: Schema_exports.optionalKey(FailureCode),
|
|
3023
|
+
message: Schema_exports.optionalKey(FailureMessage2)
|
|
3024
|
+
};
|
|
3025
|
+
var HostDeclarationInvalid2 = class extends Schema_exports.TaggedError()(
|
|
3026
|
+
"HostDeclarationInvalid",
|
|
3027
|
+
FailureDetail2
|
|
3028
|
+
) {
|
|
3029
|
+
};
|
|
3030
|
+
var HostEvaluationFailed2 = class extends Schema_exports.TaggedError()(
|
|
3031
|
+
"HostEvaluationFailed",
|
|
3032
|
+
FailureDetail2
|
|
3033
|
+
) {
|
|
3034
|
+
};
|
|
3035
|
+
var HostOperationFailed2 = class extends Schema_exports.TaggedError()(
|
|
3036
|
+
"HostOperationFailed",
|
|
3037
|
+
FailureDetail2
|
|
3038
|
+
) {
|
|
3039
|
+
};
|
|
3040
|
+
var HostError2 = Schema_exports.Union([
|
|
3041
|
+
OpenapiResponseError2,
|
|
3042
|
+
ProviderError2,
|
|
3043
|
+
McpError3,
|
|
3044
|
+
SkillLoadFailed,
|
|
3045
|
+
WorkflowFailure3,
|
|
3046
|
+
HostRequestInvalid,
|
|
3047
|
+
HostAccountsInvalid,
|
|
3048
|
+
HostDeclarationInvalid2,
|
|
3049
|
+
HostEvaluationFailed2,
|
|
3050
|
+
HostOperationNotFound,
|
|
3051
|
+
HostOperationFailed2,
|
|
3052
|
+
DatabaseLimitExceeded2,
|
|
3053
|
+
DatabaseFieldReserved2,
|
|
3054
|
+
HostToolNotFound,
|
|
3055
|
+
HostInputInvalid,
|
|
3056
|
+
HostOutputInvalid,
|
|
3057
|
+
HostToolBlocked,
|
|
3058
|
+
HostToolApprovalRequired,
|
|
3059
|
+
HostToolPolicyFailed,
|
|
3060
|
+
ElicitationFailed2
|
|
3061
|
+
]);
|
|
3062
|
+
var HostResponse2 = Schema_exports.Union([
|
|
3063
|
+
Schema_exports.Struct({
|
|
3064
|
+
ok: Schema_exports.Literal(true),
|
|
3065
|
+
value: JsonValue2,
|
|
3066
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3067
|
+
}),
|
|
3068
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError2 })
|
|
3069
|
+
]);
|
|
3070
|
+
var protocol3 = {
|
|
3071
|
+
version: 3,
|
|
3072
|
+
schemas: {
|
|
3073
|
+
invocation: HostInvocation,
|
|
3074
|
+
request: HostRequest,
|
|
3075
|
+
response: HostResponse2,
|
|
3076
|
+
requirements: DeclaredRequirements,
|
|
3077
|
+
tools: protocol1.schemas.tools,
|
|
3078
|
+
toolSummaries: protocol1.schemas.toolSummaries,
|
|
3079
|
+
skills: SkillCatalogResponse2,
|
|
3080
|
+
elicitationRequest: FormElicitation2,
|
|
3081
|
+
elicitationReply: ElicitationReply2,
|
|
3082
|
+
workflowStep: WorkflowRpcCommand2,
|
|
3083
|
+
workflowStepReply: WorkflowRpcResult3,
|
|
3084
|
+
workflowControl: WorkflowControlCommand2,
|
|
3085
|
+
cacheCommand: CacheCommand2,
|
|
3086
|
+
cacheReply: CacheReply2
|
|
3087
|
+
}
|
|
3088
|
+
};
|
|
3089
|
+
|
|
3090
|
+
// src/contracts/protocols/4.ts
|
|
3091
|
+
var RouterIcon2 = Schema_exports.Struct({
|
|
3092
|
+
src: Schema_exports.NonEmptyString,
|
|
3093
|
+
mimeType: Schema_exports.optionalKey(Schema_exports.String),
|
|
3094
|
+
sizes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
3095
|
+
theme: Schema_exports.optionalKey(Schema_exports.Literals(["light", "dark"]))
|
|
3096
|
+
});
|
|
3097
|
+
var HostedTool2 = Schema_exports.Struct({
|
|
3098
|
+
schedules: Schema_exports.optionalKey(Schema_exports.Array(OperationSchedule)),
|
|
3099
|
+
name: Schema_exports.NonEmptyString,
|
|
3100
|
+
router: Schema_exports.optionalKey(Schema_exports.NonEmptyString),
|
|
3101
|
+
tags: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3102
|
+
description: Schema_exports.String,
|
|
3103
|
+
inputSchema: JsonObject3,
|
|
3104
|
+
readOnly: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
3105
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
3106
|
+
outputSchema: Schema_exports.optionalKey(JsonObject3),
|
|
3107
|
+
annotations: Schema_exports.optionalKey(ToolAnnotations3),
|
|
3108
|
+
_meta: Schema_exports.optionalKey(JsonObject3)
|
|
3109
|
+
});
|
|
3110
|
+
var HostedToolSummary2 = HostedTool2.mapFields(
|
|
3111
|
+
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
3112
|
+
);
|
|
3113
|
+
var HostRouterError = Schema_exports.Union([
|
|
3114
|
+
ProviderError2,
|
|
3115
|
+
McpError3,
|
|
3116
|
+
SkillLoadFailed,
|
|
3117
|
+
HostDeclarationInvalid2,
|
|
3118
|
+
HostEvaluationFailed2
|
|
3119
|
+
]);
|
|
3120
|
+
var HostedRouter = Schema_exports.Struct({
|
|
3121
|
+
path: Schema_exports.String,
|
|
3122
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
3123
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
3124
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon2)),
|
|
3125
|
+
tags: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.NonEmptyString, Schema_exports.String)),
|
|
3126
|
+
skill: Schema_exports.optionalKey(AppSkillName2),
|
|
3127
|
+
error: Schema_exports.optionalKey(HostRouterError)
|
|
3128
|
+
});
|
|
3129
|
+
var HostedCatalog = Schema_exports.Struct({
|
|
3130
|
+
tools: Schema_exports.Array(HostedTool2),
|
|
3131
|
+
routers: Schema_exports.Array(HostedRouter)
|
|
3132
|
+
});
|
|
3133
|
+
var HostedCatalogSummary = Schema_exports.Struct({
|
|
3134
|
+
tools: Schema_exports.Array(HostedToolSummary2),
|
|
3135
|
+
routers: Schema_exports.Array(HostedRouter)
|
|
3136
|
+
});
|
|
3137
|
+
var ToolKind = Schema_exports.Literals(["query", "mutation"]);
|
|
3138
|
+
var HostRequest2 = Schema_exports.Union([
|
|
3139
|
+
WorkflowCommand2,
|
|
3140
|
+
WebhookCommand2,
|
|
3141
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("requirements") }),
|
|
3142
|
+
Schema_exports.Struct({
|
|
3143
|
+
operation: Schema_exports.Literal("inspect"),
|
|
3144
|
+
/** Omit schemas. Only builds that declare the toolIndex capability accept this. */
|
|
3145
|
+
detail: Schema_exports.optionalKey(Schema_exports.Literal("summary")),
|
|
3146
|
+
/** Describe only these tools. Only builds that declare the toolIndex capability accept this. */
|
|
3147
|
+
tools: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3148
|
+
/**
|
|
3149
|
+
* Describe only declared operations that have schedules, without dynamic tool discovery.
|
|
3150
|
+
* Only builds that declare the scheduledTools capability accept this.
|
|
3151
|
+
*/
|
|
3152
|
+
scheduled: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3153
|
+
}),
|
|
3154
|
+
Schema_exports.Struct({
|
|
3155
|
+
operation: Schema_exports.Literal("skills"),
|
|
3156
|
+
/** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
|
|
3157
|
+
sources: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3158
|
+
}),
|
|
3159
|
+
Schema_exports.Struct({
|
|
3160
|
+
operation: Schema_exports.Literal("query"),
|
|
3161
|
+
name: Schema_exports.NonEmptyString,
|
|
3162
|
+
input: JsonValue2
|
|
3163
|
+
}),
|
|
3164
|
+
Schema_exports.Struct({
|
|
3165
|
+
operation: Schema_exports.Literal("mutate"),
|
|
3166
|
+
name: Schema_exports.NonEmptyString,
|
|
3167
|
+
input: JsonValue2
|
|
3168
|
+
}),
|
|
3169
|
+
Schema_exports.Struct({
|
|
3170
|
+
operation: Schema_exports.Literal("call"),
|
|
3171
|
+
tool: Schema_exports.NonEmptyString,
|
|
3172
|
+
/**
|
|
3173
|
+
* The caller's claim; the bundle rejects a call whose tool has the other kind. The host omits
|
|
3174
|
+
* it for a tool its catalog does not list, and then opens storage for writing.
|
|
3175
|
+
*/
|
|
3176
|
+
kind: Schema_exports.optionalKey(ToolKind),
|
|
3177
|
+
input: JsonValue2
|
|
3178
|
+
})
|
|
3179
|
+
]);
|
|
3180
|
+
var HostKindMismatch = class extends Schema_exports.TaggedError()("HostKindMismatch", {
|
|
3181
|
+
tool: Schema_exports.NonEmptyString,
|
|
3182
|
+
requested: ToolKind,
|
|
3183
|
+
actual: ToolKind
|
|
3184
|
+
}) {
|
|
3185
|
+
};
|
|
3186
|
+
var HostError3 = Schema_exports.Union([...HostError2.members, HostKindMismatch]);
|
|
3187
|
+
var HostResponse3 = Schema_exports.Union([
|
|
3188
|
+
Schema_exports.Struct({
|
|
3189
|
+
ok: Schema_exports.Literal(true),
|
|
3190
|
+
value: JsonValue2,
|
|
3191
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3192
|
+
}),
|
|
3193
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError3 })
|
|
3194
|
+
]);
|
|
3195
|
+
var HostInvocation2 = Schema_exports.Struct({
|
|
3196
|
+
command: HostRequest2,
|
|
3197
|
+
accounts: ResolvedAccounts,
|
|
3198
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
3199
|
+
replay: Schema_exports.optionalKey(WorkflowReplay2),
|
|
3200
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
3201
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId2)
|
|
3202
|
+
});
|
|
3203
|
+
var protocol4 = {
|
|
3204
|
+
version: 4,
|
|
3205
|
+
schemas: {
|
|
3206
|
+
invocation: HostInvocation2,
|
|
3207
|
+
request: HostRequest2,
|
|
3208
|
+
response: HostResponse3,
|
|
3209
|
+
requirements: protocol3.schemas.requirements,
|
|
3210
|
+
catalog: HostedCatalog,
|
|
3211
|
+
catalogSummary: HostedCatalogSummary,
|
|
3212
|
+
skills: protocol3.schemas.skills,
|
|
3213
|
+
elicitationRequest: protocol3.schemas.elicitationRequest,
|
|
3214
|
+
elicitationReply: protocol3.schemas.elicitationReply,
|
|
3215
|
+
workflowStep: protocol3.schemas.workflowStep,
|
|
3216
|
+
workflowStepReply: protocol3.schemas.workflowStepReply,
|
|
3217
|
+
workflowControl: protocol3.schemas.workflowControl,
|
|
3218
|
+
cacheCommand: protocol3.schemas.cacheCommand,
|
|
3219
|
+
cacheReply: protocol3.schemas.cacheReply
|
|
3220
|
+
}
|
|
3221
|
+
};
|
|
3222
|
+
|
|
3223
|
+
// src/contracts/protocols/5.ts
|
|
3224
|
+
var displayText2 = Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(255));
|
|
3225
|
+
var AccountInfo2 = Schema_exports.Struct({
|
|
3226
|
+
externalId: Schema_exports.optionalKey(displayText2),
|
|
3227
|
+
displayName: Schema_exports.optionalKey(displayText2),
|
|
3228
|
+
username: Schema_exports.optionalKey(displayText2),
|
|
3229
|
+
email: Schema_exports.optionalKey(displayText2),
|
|
3230
|
+
avatarUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
3231
|
+
profileUrl: Schema_exports.optionalKey(HttpUrl2)
|
|
3232
|
+
});
|
|
3233
|
+
var AccountCheckResult2 = Schema_exports.Struct({ accountInfo: Schema_exports.optionalKey(AccountInfo2) });
|
|
3234
|
+
var DeclaredRequirements2 = Schema_exports.Struct({
|
|
3235
|
+
/** Protocol support of this retained framework build, not an author-declared requirement. */
|
|
3236
|
+
capabilities: Schema_exports.optionalKey(
|
|
3237
|
+
Schema_exports.Struct({
|
|
3238
|
+
skills: Schema_exports.Literal(true),
|
|
3239
|
+
toolIndex: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3240
|
+
skillSources: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3241
|
+
scheduledTools: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3242
|
+
})
|
|
3243
|
+
),
|
|
3244
|
+
database: Schema_exports.optionalKey(DatabaseSchema2),
|
|
3245
|
+
accounts: Schema_exports.Record(
|
|
3246
|
+
Schema_exports.NonEmptyString,
|
|
3247
|
+
Schema_exports.Struct({
|
|
3248
|
+
definition: DeclaredProvider,
|
|
3249
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
3250
|
+
/**
|
|
3251
|
+
* The slot's provider defines an account check. Kept beside the definition, not in it, so
|
|
3252
|
+
* adding or editing a check never changes the provider's identity.
|
|
3253
|
+
*/
|
|
3254
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3255
|
+
})
|
|
3256
|
+
)
|
|
3257
|
+
});
|
|
3258
|
+
var AccountCheckCommand = Schema_exports.Struct({
|
|
3259
|
+
operation: Schema_exports.Literal("account-check"),
|
|
3260
|
+
requirement: Schema_exports.NonEmptyString
|
|
3261
|
+
});
|
|
3262
|
+
var HostRequest3 = Schema_exports.Union([
|
|
3263
|
+
...protocol4.schemas.request.members,
|
|
3264
|
+
AccountCheckCommand
|
|
3265
|
+
]);
|
|
3266
|
+
var HostInvocation3 = Schema_exports.Struct({
|
|
3267
|
+
command: HostRequest3,
|
|
3268
|
+
accounts: ResolvedAccounts,
|
|
3269
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval),
|
|
3270
|
+
replay: Schema_exports.optionalKey(WorkflowReplay2),
|
|
3271
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline),
|
|
3272
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId2)
|
|
3273
|
+
});
|
|
3274
|
+
var protocol5 = {
|
|
3275
|
+
version: 5,
|
|
3276
|
+
schemas: {
|
|
3277
|
+
...protocol4.schemas,
|
|
3278
|
+
invocation: HostInvocation3,
|
|
3279
|
+
request: HostRequest3,
|
|
3280
|
+
requirements: DeclaredRequirements2,
|
|
3281
|
+
accountCheck: AccountCheckResult2
|
|
3282
|
+
}
|
|
3283
|
+
};
|
|
3284
|
+
|
|
3285
|
+
// src/contracts/protocols/oauth-6.ts
|
|
3286
|
+
var OAuth2Config3 = Schema_exports.Union([
|
|
3287
|
+
Schema_exports.Struct({
|
|
3288
|
+
...oauthOptions2,
|
|
3289
|
+
discover: HttpUrl2,
|
|
3290
|
+
/** Fetch this exact metadata document and verify its issuer against discovery. */
|
|
3291
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
3292
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3293
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3294
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3295
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String))
|
|
3296
|
+
}),
|
|
3297
|
+
Schema_exports.Struct({
|
|
3298
|
+
...oauthOptions2,
|
|
3299
|
+
/** Its query is kept; it cannot set protocol parameters or repeat `authorizationParams`. */
|
|
3300
|
+
authorizationUrl: HttpUrl2,
|
|
3301
|
+
tokenUrl: HttpUrl2,
|
|
3302
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
3303
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
3304
|
+
/** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
|
|
3305
|
+
issuer: Schema_exports.optionalKey(HttpUrl2),
|
|
3306
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3307
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
|
|
3308
|
+
}).check(declaredAuthorizationQuery2),
|
|
3309
|
+
Schema_exports.Struct({
|
|
3310
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
3311
|
+
discover: HttpUrl2,
|
|
3312
|
+
/** Fetch this exact metadata document and verify its issuer against discovery. */
|
|
3313
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
3314
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3315
|
+
tokenUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3316
|
+
revocationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3317
|
+
scopes: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.String)),
|
|
3318
|
+
...tokenRequestOptions2,
|
|
3319
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth2,
|
|
3320
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl2))
|
|
3321
|
+
}),
|
|
3322
|
+
Schema_exports.Struct({
|
|
3323
|
+
grant: Schema_exports.Literal("client_credentials"),
|
|
3324
|
+
tokenUrl: HttpUrl2,
|
|
3325
|
+
revocationUrl: Schema_exports.optionalKey(HttpUrl2),
|
|
3326
|
+
scopes: Schema_exports.Array(Schema_exports.String),
|
|
3327
|
+
...tokenRequestOptions2,
|
|
3328
|
+
tokenEndpointAuthMethod: OAuthSecretClientAuth2,
|
|
3329
|
+
resource: Schema_exports.optionalKey(Schema_exports.NullOr(HttpUrl2)),
|
|
3330
|
+
authorizationUrl: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3331
|
+
discover: Schema_exports.optionalKey(Schema_exports.Never),
|
|
3332
|
+
authorizationServerMetadataUrl: Schema_exports.optionalKey(Schema_exports.Never)
|
|
3333
|
+
})
|
|
3334
|
+
]);
|
|
3335
|
+
|
|
3336
|
+
// src/contracts/protocols/6.ts
|
|
3337
|
+
var DeclaredAuthMethod2 = Schema_exports.Union([
|
|
3338
|
+
Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject3 }),
|
|
3339
|
+
Schema_exports.Struct({
|
|
3340
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3341
|
+
...OAuth2Config3.members[0].fields,
|
|
3342
|
+
response: JsonObject3
|
|
3343
|
+
}),
|
|
3344
|
+
Schema_exports.Struct({
|
|
3345
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3346
|
+
...OAuth2Config3.members[1].fields,
|
|
3347
|
+
response: JsonObject3
|
|
3348
|
+
}),
|
|
3349
|
+
Schema_exports.Struct({
|
|
3350
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3351
|
+
...OAuth2Config3.members[2].fields,
|
|
3352
|
+
response: JsonObject3
|
|
3353
|
+
}),
|
|
3354
|
+
Schema_exports.Struct({
|
|
3355
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3356
|
+
...OAuth2Config3.members[3].fields,
|
|
3357
|
+
response: JsonObject3
|
|
3358
|
+
})
|
|
3359
|
+
]);
|
|
3360
|
+
var DeclaredProvider2 = Schema_exports.Struct({
|
|
3361
|
+
name: Schema_exports.NonEmptyString,
|
|
3362
|
+
auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod2)
|
|
3363
|
+
});
|
|
3364
|
+
var DeclaredRequirements3 = Schema_exports.Struct({
|
|
3365
|
+
...DeclaredRequirements2.fields,
|
|
3366
|
+
accounts: Schema_exports.Record(
|
|
3367
|
+
Schema_exports.NonEmptyString,
|
|
3368
|
+
Schema_exports.Struct({
|
|
3369
|
+
definition: DeclaredProvider2,
|
|
3370
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
3371
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3372
|
+
})
|
|
3373
|
+
)
|
|
3374
|
+
});
|
|
3375
|
+
var ResolvedAccount2 = Schema_exports.Struct({
|
|
3376
|
+
...ResolvedAccount.fields,
|
|
3377
|
+
provider: DeclaredProvider2
|
|
3378
|
+
});
|
|
3379
|
+
var ResolvedAccounts2 = Schema_exports.Record(
|
|
3380
|
+
Schema_exports.NonEmptyString,
|
|
3381
|
+
Schema_exports.Union([ResolvedAccount2, Schema_exports.Array(ResolvedAccount2)])
|
|
3382
|
+
);
|
|
3383
|
+
var HostInvocation4 = Schema_exports.Struct({
|
|
3384
|
+
...HostInvocation3.fields,
|
|
3385
|
+
accounts: ResolvedAccounts2
|
|
3386
|
+
});
|
|
3387
|
+
var protocol6 = {
|
|
3388
|
+
version: 6,
|
|
3389
|
+
schemas: {
|
|
3390
|
+
...protocol5.schemas,
|
|
3391
|
+
requirements: DeclaredRequirements3,
|
|
3392
|
+
accounts: ResolvedAccounts2,
|
|
3393
|
+
invocation: HostInvocation4
|
|
3394
|
+
}
|
|
3395
|
+
};
|
|
3396
|
+
|
|
3397
|
+
// src/contracts/protocols/7.ts
|
|
3398
|
+
var CredentialHost = Schema_exports.String.check(
|
|
3399
|
+
Schema_exports.isPattern(
|
|
3400
|
+
/^(\*\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[0-9]{1,5})?$/
|
|
3401
|
+
)
|
|
3402
|
+
);
|
|
3403
|
+
var exposure = {
|
|
3404
|
+
/** Not secret: app code reads the real value and forms show it. */
|
|
3405
|
+
plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3406
|
+
/** Secret, but app code reads the real value, for signing and similar uses. */
|
|
3407
|
+
raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString))
|
|
3408
|
+
};
|
|
3409
|
+
var DeclaredAuthMethod3 = Schema_exports.Union([
|
|
3410
|
+
Schema_exports.Struct({
|
|
3411
|
+
type: Schema_exports.Literal("secrets"),
|
|
3412
|
+
label: Schema_exports.String,
|
|
3413
|
+
fields: JsonObject3,
|
|
3414
|
+
...exposure
|
|
3415
|
+
}),
|
|
3416
|
+
Schema_exports.Struct({
|
|
3417
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3418
|
+
...OAuth2Config3.members[0].fields,
|
|
3419
|
+
response: JsonObject3,
|
|
3420
|
+
...exposure
|
|
3421
|
+
}),
|
|
3422
|
+
Schema_exports.Struct({
|
|
3423
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3424
|
+
...OAuth2Config3.members[1].fields,
|
|
3425
|
+
response: JsonObject3,
|
|
3426
|
+
...exposure
|
|
3427
|
+
}),
|
|
3428
|
+
Schema_exports.Struct({
|
|
3429
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3430
|
+
...OAuth2Config3.members[2].fields,
|
|
3431
|
+
response: JsonObject3,
|
|
3432
|
+
...exposure
|
|
3433
|
+
}),
|
|
3434
|
+
Schema_exports.Struct({
|
|
3435
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3436
|
+
...OAuth2Config3.members[3].fields,
|
|
3437
|
+
response: JsonObject3,
|
|
3438
|
+
...exposure
|
|
3439
|
+
})
|
|
3440
|
+
]);
|
|
3441
|
+
var DeclaredProvider3 = Schema_exports.Struct({
|
|
3442
|
+
name: Schema_exports.NonEmptyString,
|
|
3443
|
+
auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod3),
|
|
3444
|
+
hosts: Schema_exports.optionalKey(Schema_exports.Array(CredentialHost))
|
|
3445
|
+
});
|
|
3446
|
+
var DeclaredRequirements4 = Schema_exports.Struct({
|
|
3447
|
+
...DeclaredRequirements3.fields,
|
|
3448
|
+
accounts: Schema_exports.Record(
|
|
3449
|
+
Schema_exports.NonEmptyString,
|
|
3450
|
+
Schema_exports.Struct({
|
|
3451
|
+
definition: DeclaredProvider3,
|
|
3452
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
3453
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3454
|
+
})
|
|
3455
|
+
)
|
|
3456
|
+
});
|
|
3457
|
+
var ResolvedAccount3 = Schema_exports.Struct({
|
|
3458
|
+
...ResolvedAccount2.fields,
|
|
3459
|
+
provider: DeclaredProvider3
|
|
3460
|
+
});
|
|
3461
|
+
var ResolvedAccounts3 = Schema_exports.Record(
|
|
3462
|
+
Schema_exports.NonEmptyString,
|
|
3463
|
+
Schema_exports.Union([ResolvedAccount3, Schema_exports.Array(ResolvedAccount3)])
|
|
3464
|
+
);
|
|
3465
|
+
var HostInvocation5 = Schema_exports.Struct({
|
|
3466
|
+
...HostInvocation4.fields,
|
|
3467
|
+
accounts: ResolvedAccounts3
|
|
3468
|
+
});
|
|
3469
|
+
var protocol7 = {
|
|
3470
|
+
version: 7,
|
|
3471
|
+
schemas: {
|
|
3472
|
+
...protocol6.schemas,
|
|
3473
|
+
requirements: DeclaredRequirements4,
|
|
3474
|
+
accounts: ResolvedAccounts3,
|
|
3475
|
+
invocation: HostInvocation5
|
|
3476
|
+
}
|
|
3477
|
+
};
|
|
3478
|
+
|
|
3479
|
+
// src/contracts/protocols/8.ts
|
|
3480
|
+
var maxFailureFields = 8;
|
|
3481
|
+
var maxFailureFieldLength = 256;
|
|
3482
|
+
var FailureFieldName = Schema_exports.String.check(
|
|
3483
|
+
Schema_exports.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]{0,63}$/)
|
|
3484
|
+
);
|
|
3485
|
+
var FailureFieldValue = Schema_exports.Union([
|
|
3486
|
+
Schema_exports.String.check(Schema_exports.isMaxLength(maxFailureFieldLength)),
|
|
3487
|
+
Schema_exports.Finite,
|
|
3488
|
+
Schema_exports.Boolean
|
|
3489
|
+
]);
|
|
3490
|
+
var FailureFields = Schema_exports.Record(FailureFieldName, FailureFieldValue).check(
|
|
3491
|
+
Schema_exports.isMaxProperties(maxFailureFields)
|
|
3492
|
+
);
|
|
3493
|
+
var FailureDetail3 = {
|
|
3494
|
+
source: Schema_exports.optionalKey(FailureSource),
|
|
3495
|
+
errorName: Schema_exports.optionalKey(FailureName2),
|
|
3496
|
+
code: Schema_exports.optionalKey(FailureCode),
|
|
3497
|
+
message: Schema_exports.optionalKey(FailureMessage2),
|
|
3498
|
+
fields: Schema_exports.optionalKey(FailureFields)
|
|
3499
|
+
};
|
|
3500
|
+
var maxUpstreamMessageLength = 1024;
|
|
3501
|
+
var UpstreamError2 = Schema_exports.Struct({
|
|
3502
|
+
code: Schema_exports.Union([
|
|
3503
|
+
Schema_exports.Int,
|
|
3504
|
+
Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(128))
|
|
3505
|
+
]),
|
|
3506
|
+
message: Schema_exports.optionalKey(Schema_exports.String.check(Schema_exports.isMaxLength(maxUpstreamMessageLength)))
|
|
3507
|
+
});
|
|
3508
|
+
var FailurePhase = Schema_exports.Literals(["connect", "discover", "call"]);
|
|
3509
|
+
var ProviderError3 = class extends Schema_exports.TaggedError()("ProviderError", {
|
|
3510
|
+
reason: Schema_exports.Literals(["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]),
|
|
3511
|
+
status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
|
|
3512
|
+
accountId: Schema_exports.optional(AccountId2),
|
|
3513
|
+
phase: Schema_exports.optional(FailurePhase),
|
|
3514
|
+
upstream: Schema_exports.optional(UpstreamError2)
|
|
3515
|
+
}) {
|
|
3516
|
+
};
|
|
3517
|
+
var McpError4 = class extends Schema_exports.TaggedError()("McpError", {
|
|
3518
|
+
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
3519
|
+
reason: Schema_exports.Literals([
|
|
3520
|
+
"request",
|
|
3521
|
+
"unauthorized",
|
|
3522
|
+
"invalid_response",
|
|
3523
|
+
"timeout",
|
|
3524
|
+
"invalid_input"
|
|
3525
|
+
]),
|
|
3526
|
+
status: Schema_exports.optional(Schema_exports.Number),
|
|
3527
|
+
upstream: Schema_exports.optional(UpstreamError2)
|
|
3528
|
+
}) {
|
|
3529
|
+
};
|
|
3530
|
+
var HostDeclarationInvalid3 = class extends Schema_exports.TaggedError()(
|
|
3531
|
+
"HostDeclarationInvalid",
|
|
3532
|
+
FailureDetail3
|
|
3533
|
+
) {
|
|
3534
|
+
};
|
|
3535
|
+
var HostEvaluationFailed3 = class extends Schema_exports.TaggedError()(
|
|
3536
|
+
"HostEvaluationFailed",
|
|
3537
|
+
FailureDetail3
|
|
3538
|
+
) {
|
|
3539
|
+
};
|
|
3540
|
+
var HostOperationFailed3 = class extends Schema_exports.TaggedError()(
|
|
3541
|
+
"HostOperationFailed",
|
|
3542
|
+
FailureDetail3
|
|
3543
|
+
) {
|
|
3544
|
+
};
|
|
3545
|
+
var HostRouterError2 = Schema_exports.Union([
|
|
3546
|
+
ProviderError3,
|
|
3547
|
+
McpError4,
|
|
3548
|
+
SkillLoadFailed,
|
|
3549
|
+
HostDeclarationInvalid3,
|
|
3550
|
+
HostEvaluationFailed3
|
|
3551
|
+
]);
|
|
3552
|
+
var HostedRouter2 = Schema_exports.Struct({
|
|
3553
|
+
...HostedRouter.fields,
|
|
3554
|
+
error: Schema_exports.optionalKey(HostRouterError2)
|
|
3555
|
+
});
|
|
3556
|
+
var HostedCatalog2 = Schema_exports.Struct({
|
|
3557
|
+
...HostedCatalog.fields,
|
|
3558
|
+
routers: Schema_exports.Array(HostedRouter2)
|
|
3559
|
+
});
|
|
3560
|
+
var HostedCatalogSummary2 = Schema_exports.Struct({
|
|
3561
|
+
...HostedCatalogSummary.fields,
|
|
3562
|
+
routers: Schema_exports.Array(HostedRouter2)
|
|
3563
|
+
});
|
|
3564
|
+
var HostError4 = Schema_exports.Union([
|
|
3565
|
+
OpenapiResponseError2,
|
|
3566
|
+
ProviderError3,
|
|
3567
|
+
McpError4,
|
|
3568
|
+
SkillLoadFailed,
|
|
3569
|
+
WorkflowFailure3,
|
|
3570
|
+
HostRequestInvalid,
|
|
3571
|
+
HostAccountsInvalid,
|
|
3572
|
+
HostDeclarationInvalid3,
|
|
3573
|
+
HostEvaluationFailed3,
|
|
3574
|
+
HostOperationNotFound,
|
|
3575
|
+
HostOperationFailed3,
|
|
3576
|
+
DatabaseLimitExceeded2,
|
|
3577
|
+
DatabaseFieldReserved2,
|
|
3578
|
+
HostToolNotFound,
|
|
3579
|
+
HostInputInvalid,
|
|
3580
|
+
HostOutputInvalid,
|
|
3581
|
+
HostToolBlocked,
|
|
3582
|
+
HostToolApprovalRequired,
|
|
3583
|
+
HostToolPolicyFailed,
|
|
3584
|
+
ElicitationFailed2,
|
|
3585
|
+
HostKindMismatch
|
|
3586
|
+
]);
|
|
3587
|
+
var HostResponse4 = Schema_exports.Union([
|
|
3588
|
+
Schema_exports.Struct({
|
|
3589
|
+
ok: Schema_exports.Literal(true),
|
|
3590
|
+
value: JsonValue2,
|
|
3591
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3592
|
+
}),
|
|
3593
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError4 })
|
|
3594
|
+
]);
|
|
3595
|
+
var protocol8 = {
|
|
3596
|
+
version: 8,
|
|
3597
|
+
schemas: {
|
|
3598
|
+
...protocol7.schemas,
|
|
3599
|
+
response: HostResponse4,
|
|
3600
|
+
catalog: HostedCatalog2,
|
|
3601
|
+
catalogSummary: HostedCatalogSummary2
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
|
|
3605
|
+
// src/contracts/protocols/9.ts
|
|
3606
|
+
var McpError5 = class extends Schema_exports.TaggedError()("McpError", {
|
|
3607
|
+
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
3608
|
+
reason: Schema_exports.Literals([
|
|
3609
|
+
"request",
|
|
3610
|
+
"unauthorized",
|
|
3611
|
+
"invalid_response",
|
|
3612
|
+
"timeout",
|
|
3613
|
+
"invalid_input"
|
|
3614
|
+
]),
|
|
3615
|
+
status: Schema_exports.optional(Schema_exports.Number),
|
|
3616
|
+
upstream: Schema_exports.optional(UpstreamError2),
|
|
3617
|
+
session: Schema_exports.optional(Schema_exports.Literal(true))
|
|
3618
|
+
}) {
|
|
3619
|
+
};
|
|
3620
|
+
var SkillLoadFailed2 = class extends Schema_exports.TaggedError()("SkillLoadFailed", {
|
|
3621
|
+
reason: Schema_exports.Literals([
|
|
3622
|
+
"source",
|
|
3623
|
+
"request",
|
|
3624
|
+
"rate_limited",
|
|
3625
|
+
"document",
|
|
3626
|
+
"limit",
|
|
3627
|
+
"changed",
|
|
3628
|
+
"encoding"
|
|
3629
|
+
]),
|
|
3630
|
+
message: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isMaxLength(500))),
|
|
3631
|
+
status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
|
|
3632
|
+
missing: Schema_exports.optional(Schema_exports.Literals(["repository", "ref"]))
|
|
3633
|
+
}) {
|
|
3634
|
+
};
|
|
3635
|
+
var HostRouterError3 = Schema_exports.Union([
|
|
3636
|
+
ProviderError3,
|
|
3637
|
+
McpError5,
|
|
3638
|
+
SkillLoadFailed2,
|
|
3639
|
+
HostDeclarationInvalid3,
|
|
3640
|
+
HostEvaluationFailed3
|
|
3641
|
+
]);
|
|
3642
|
+
var HostedRouter3 = Schema_exports.Struct({
|
|
3643
|
+
...HostedRouter2.fields,
|
|
3644
|
+
error: Schema_exports.optionalKey(HostRouterError3)
|
|
3645
|
+
});
|
|
3646
|
+
var HostedCatalog3 = Schema_exports.Struct({
|
|
3647
|
+
...HostedCatalog2.fields,
|
|
3648
|
+
routers: Schema_exports.Array(HostedRouter3)
|
|
3649
|
+
});
|
|
3650
|
+
var HostedCatalogSummary3 = Schema_exports.Struct({
|
|
3651
|
+
...HostedCatalogSummary2.fields,
|
|
3652
|
+
routers: Schema_exports.Array(HostedRouter3)
|
|
3653
|
+
});
|
|
3654
|
+
var HostError5 = Schema_exports.Union([
|
|
3655
|
+
OpenapiResponseError2,
|
|
3656
|
+
ProviderError3,
|
|
3657
|
+
McpError5,
|
|
3658
|
+
SkillLoadFailed2,
|
|
3659
|
+
WorkflowFailure3,
|
|
3660
|
+
HostRequestInvalid,
|
|
3661
|
+
HostAccountsInvalid,
|
|
3662
|
+
HostDeclarationInvalid3,
|
|
3663
|
+
HostEvaluationFailed3,
|
|
3664
|
+
HostOperationNotFound,
|
|
3665
|
+
HostOperationFailed3,
|
|
3666
|
+
DatabaseLimitExceeded2,
|
|
3667
|
+
DatabaseFieldReserved2,
|
|
3668
|
+
HostToolNotFound,
|
|
3669
|
+
HostInputInvalid,
|
|
3670
|
+
HostOutputInvalid,
|
|
3671
|
+
HostToolBlocked,
|
|
3672
|
+
HostToolApprovalRequired,
|
|
3673
|
+
HostToolPolicyFailed,
|
|
3674
|
+
ElicitationFailed2,
|
|
3675
|
+
HostKindMismatch
|
|
3676
|
+
]);
|
|
3677
|
+
var HostResponse5 = Schema_exports.Union([
|
|
3678
|
+
Schema_exports.Struct({
|
|
3679
|
+
ok: Schema_exports.Literal(true),
|
|
3680
|
+
value: JsonValue2,
|
|
3681
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3682
|
+
}),
|
|
3683
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError5 })
|
|
3684
|
+
]);
|
|
3685
|
+
var protocol9 = {
|
|
3686
|
+
version: 9,
|
|
3687
|
+
schemas: {
|
|
3688
|
+
...protocol8.schemas,
|
|
3689
|
+
response: HostResponse5,
|
|
3690
|
+
catalog: HostedCatalog3,
|
|
3691
|
+
catalogSummary: HostedCatalogSummary3
|
|
3692
|
+
}
|
|
3693
|
+
};
|
|
3694
|
+
|
|
3695
|
+
// src/contracts/protocols/10.ts
|
|
3696
|
+
var DeclaredRequirements5 = Schema_exports.Struct({
|
|
3697
|
+
...DeclaredRequirements4.fields,
|
|
3698
|
+
sql: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3699
|
+
});
|
|
3700
|
+
var MigrateCommand = Schema_exports.Struct({ operation: Schema_exports.Literal("migrate") });
|
|
3701
|
+
var MigrateResult = Schema_exports.Array(
|
|
3702
|
+
Schema_exports.Struct({ id: Schema_exports.Int, name: Schema_exports.NonEmptyString })
|
|
3703
|
+
);
|
|
3704
|
+
var HostRequest4 = Schema_exports.Union([...HostRequest3.members, MigrateCommand]);
|
|
3705
|
+
var HostInvocation6 = Schema_exports.Struct({
|
|
3706
|
+
...HostInvocation5.fields,
|
|
3707
|
+
command: HostRequest4
|
|
3708
|
+
});
|
|
3709
|
+
var protocol10 = {
|
|
3710
|
+
version: 10,
|
|
3711
|
+
schemas: {
|
|
3712
|
+
...protocol9.schemas,
|
|
3713
|
+
request: HostRequest4,
|
|
3714
|
+
requirements: DeclaredRequirements5,
|
|
3715
|
+
invocation: HostInvocation6,
|
|
3716
|
+
migrate: MigrateResult
|
|
3717
|
+
}
|
|
3718
|
+
};
|
|
3719
|
+
|
|
3720
|
+
// src/contracts/schedules.ts
|
|
3721
|
+
var minimumIntervalMilliseconds2 = 6e4;
|
|
3722
|
+
var count2 = Schema_exports.Int.check(Schema_exports.isGreaterThan(0));
|
|
3723
|
+
var absent = Schema_exports.optionalKey(Schema_exports.Never);
|
|
3724
|
+
var Interval = Schema_exports.Union([
|
|
3725
|
+
Schema_exports.Struct({ seconds: count2, minutes: absent, hours: absent }),
|
|
3726
|
+
Schema_exports.Struct({ seconds: absent, minutes: count2, hours: absent }),
|
|
3727
|
+
Schema_exports.Struct({ seconds: absent, minutes: absent, hours: count2 })
|
|
3728
|
+
]);
|
|
3729
|
+
var CalendarSchedule2 = Schema_exports.Struct({
|
|
3730
|
+
expression: Schema_exports.NonEmptyString,
|
|
3731
|
+
timezone: Schema_exports.NonEmptyString
|
|
3732
|
+
}).check(
|
|
3733
|
+
Schema_exports.makeFilter(
|
|
3734
|
+
(value) => value.expression.trim().split(/\s+/).length === 5 && Result_exports.isSuccess(Cron_exports.parse(value.expression, value.timezone))
|
|
3735
|
+
)
|
|
3736
|
+
);
|
|
3737
|
+
var ScheduleTiming2 = Schema_exports.Union([
|
|
3738
|
+
Schema_exports.Struct({
|
|
3739
|
+
kind: Schema_exports.Literal("interval"),
|
|
3740
|
+
milliseconds: Schema_exports.Int.check(
|
|
3741
|
+
Schema_exports.makeFilter((value) => value >= minimumIntervalMilliseconds2, {
|
|
3742
|
+
message: "Schedule intervals must be at least 60 seconds"
|
|
3743
|
+
}),
|
|
3744
|
+
Schema_exports.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)
|
|
3745
|
+
)
|
|
3746
|
+
}),
|
|
3747
|
+
Schema_exports.Struct({ kind: Schema_exports.Literal("cron"), calendar: CalendarSchedule2 })
|
|
3748
|
+
]);
|
|
3749
|
+
var OperationSchedule2 = Schema_exports.Struct({
|
|
3750
|
+
name: Schema_exports.NonEmptyString,
|
|
3751
|
+
timing: ScheduleTiming2,
|
|
3752
|
+
input: JsonValue
|
|
3753
|
+
});
|
|
3754
|
+
|
|
3755
|
+
// src/contracts/protocols/current.ts
|
|
3756
|
+
var McpError6 = class extends Schema_exports.TaggedError()("McpError", {
|
|
3757
|
+
phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
|
|
3758
|
+
reason: Schema_exports.Literals([
|
|
3759
|
+
"request",
|
|
3760
|
+
"unauthorized",
|
|
3761
|
+
"invalid_response",
|
|
3762
|
+
"timeout",
|
|
3763
|
+
"invalid_input"
|
|
3764
|
+
]),
|
|
3765
|
+
status: Schema_exports.optional(Schema_exports.Number),
|
|
3766
|
+
/** The JSON-RPC error the server stated. */
|
|
3767
|
+
upstream: Schema_exports.optional(UpstreamError),
|
|
3768
|
+
/**
|
|
3769
|
+
* The refused request carried the session ID the server issued at initialization, so a 404 reads
|
|
3770
|
+
* as a session the server may have lost. Chooses the explanation only; the host never decides from
|
|
3771
|
+
* it whose side a failure is on.
|
|
3772
|
+
*/
|
|
3773
|
+
session: Schema_exports.optional(Schema_exports.Literal(true))
|
|
3774
|
+
}) {
|
|
3775
|
+
};
|
|
3776
|
+
var SkillLoadFailed3 = class extends Schema_exports.TaggedError()("SkillLoadFailed", {
|
|
3777
|
+
reason: Schema_exports.Literals([
|
|
3778
|
+
"source",
|
|
3779
|
+
"request",
|
|
3780
|
+
"rate_limited",
|
|
3781
|
+
"document",
|
|
3782
|
+
"limit",
|
|
3783
|
+
"changed",
|
|
3784
|
+
"encoding"
|
|
3785
|
+
]),
|
|
3786
|
+
message: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isMaxLength(500))),
|
|
3787
|
+
status: Schema_exports.optional(Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 100, maximum: 599 }))),
|
|
3788
|
+
/** What the service's answer points to as missing: the repository, or the branch or tag. */
|
|
3789
|
+
missing: Schema_exports.optional(Schema_exports.Literals(["repository", "ref"]))
|
|
3790
|
+
}) {
|
|
3791
|
+
};
|
|
3792
|
+
var CredentialHost2 = Schema_exports.String.check(
|
|
3793
|
+
Schema_exports.isPattern(
|
|
3794
|
+
/^(\*\.)?[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*(?::[0-9]{1,5})?$/
|
|
3795
|
+
)
|
|
3796
|
+
);
|
|
3797
|
+
var exposure2 = {
|
|
3798
|
+
/** Not secret: app code reads the real value and forms show it. */
|
|
3799
|
+
plain: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3800
|
+
/** Secret, but app code reads the real value, for signing and similar uses. */
|
|
3801
|
+
raw: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString))
|
|
3802
|
+
};
|
|
3803
|
+
var DeclaredAuthMethod4 = Schema_exports.Union([
|
|
3804
|
+
Schema_exports.Struct({
|
|
3805
|
+
type: Schema_exports.Literal("secrets"),
|
|
3806
|
+
label: Schema_exports.String,
|
|
3807
|
+
fields: JsonObject2,
|
|
3808
|
+
...exposure2
|
|
3809
|
+
}),
|
|
3810
|
+
Schema_exports.Struct({
|
|
3811
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3812
|
+
...OAuth2Config.members[0].fields,
|
|
3813
|
+
response: JsonObject2,
|
|
3814
|
+
...exposure2
|
|
3815
|
+
}),
|
|
3816
|
+
Schema_exports.Struct({
|
|
3817
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3818
|
+
...OAuth2Config.members[1].fields,
|
|
3819
|
+
response: JsonObject2,
|
|
3820
|
+
...exposure2
|
|
3821
|
+
}),
|
|
3822
|
+
Schema_exports.Struct({
|
|
3823
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3824
|
+
...OAuth2Config.members[2].fields,
|
|
3825
|
+
response: JsonObject2,
|
|
3826
|
+
...exposure2
|
|
3827
|
+
}),
|
|
3828
|
+
Schema_exports.Struct({
|
|
3829
|
+
type: Schema_exports.Literal("oauth2"),
|
|
3830
|
+
...OAuth2Config.members[3].fields,
|
|
3831
|
+
response: JsonObject2,
|
|
3832
|
+
...exposure2
|
|
3833
|
+
})
|
|
3834
|
+
]);
|
|
3835
|
+
var DeclaredProvider4 = Schema_exports.Struct({
|
|
3836
|
+
name: Schema_exports.NonEmptyString,
|
|
3837
|
+
auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod4),
|
|
3838
|
+
hosts: Schema_exports.optionalKey(Schema_exports.Array(CredentialHost2))
|
|
3839
|
+
});
|
|
3840
|
+
var DeclaredRequirements6 = Schema_exports.Struct({
|
|
3841
|
+
/** Protocol support of this retained framework build, not an author-declared requirement. */
|
|
3842
|
+
capabilities: Schema_exports.optionalKey(
|
|
3843
|
+
Schema_exports.Struct({
|
|
3844
|
+
skills: Schema_exports.Literal(true),
|
|
3845
|
+
/** Accepts inspect detail and tools. Earlier builds reject both as excess fields. */
|
|
3846
|
+
toolIndex: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3847
|
+
/** Accepts skills sources and reports whether the catalog includes a live loader. */
|
|
3848
|
+
skillSources: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3849
|
+
/** Accepts scheduled inspection. Earlier builds reject it as an excess field. */
|
|
3850
|
+
scheduledTools: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3851
|
+
})
|
|
3852
|
+
),
|
|
3853
|
+
/**
|
|
3854
|
+
* The document database an app of protocol 9 or earlier declared. Apps of this protocol declare
|
|
3855
|
+
* `sql` instead; the field remains so requirements read from older retained builds keep their meaning.
|
|
3856
|
+
*/
|
|
3857
|
+
database: Schema_exports.optionalKey(DatabaseSchema),
|
|
3858
|
+
accounts: Schema_exports.Record(
|
|
3859
|
+
Schema_exports.NonEmptyString,
|
|
3860
|
+
Schema_exports.Struct({
|
|
3861
|
+
definition: DeclaredProvider4,
|
|
3862
|
+
cardinality: Schema_exports.Literals(["one", "many"]),
|
|
3863
|
+
/**
|
|
3864
|
+
* The slot's provider defines an account check. Kept beside the definition, not in it, so
|
|
3865
|
+
* adding or editing a check never changes the provider's identity.
|
|
3866
|
+
*/
|
|
3867
|
+
health: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3868
|
+
})
|
|
3869
|
+
),
|
|
3870
|
+
/** The build has SQL files in `migrations/` and owns a raw SQLite database. */
|
|
3871
|
+
sql: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3872
|
+
/** The events the app declares, so a host lists them without evaluating the app. */
|
|
3873
|
+
events: Schema_exports.optionalKey(DeclaredEvents)
|
|
3874
|
+
});
|
|
3875
|
+
var ResolvedAccount4 = Schema_exports.Struct({
|
|
3876
|
+
id: AccountId,
|
|
3877
|
+
provider: DeclaredProvider4,
|
|
3878
|
+
method: Schema_exports.NonEmptyString,
|
|
3879
|
+
/**
|
|
3880
|
+
* Changes when the account is reconnected or its credentials replaced, not on renewal. Hosts
|
|
3881
|
+
* send it since credential generations; `apps@0.0.1-beta.0` and `beta.1` ignore it.
|
|
3882
|
+
*/
|
|
3883
|
+
generation: Schema_exports.optionalKey(Schema_exports.Int),
|
|
3884
|
+
fields: JsonObject2
|
|
3885
|
+
});
|
|
3886
|
+
var ResolvedAccounts4 = Schema_exports.Record(
|
|
3887
|
+
Schema_exports.NonEmptyString,
|
|
3888
|
+
Schema_exports.Union([ResolvedAccount4, Schema_exports.Array(ResolvedAccount4)])
|
|
3889
|
+
);
|
|
3890
|
+
var TrustedToolApproval2 = Schema_exports.Struct({ tool: Schema_exports.NonEmptyString, input: JsonValue });
|
|
3891
|
+
var InvocationDeadline2 = Schema_exports.Finite.check(Schema_exports.isGreaterThanOrEqualTo(0));
|
|
3892
|
+
var HostedTool3 = Schema_exports.Struct({
|
|
3893
|
+
schedules: Schema_exports.optionalKey(Schema_exports.Array(OperationSchedule2)),
|
|
3894
|
+
name: Schema_exports.NonEmptyString,
|
|
3895
|
+
router: Schema_exports.optionalKey(Schema_exports.NonEmptyString),
|
|
3896
|
+
tags: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3897
|
+
description: Schema_exports.String,
|
|
3898
|
+
inputSchema: JsonObject2,
|
|
3899
|
+
readOnly: Schema_exports.optionalKey(Schema_exports.Boolean),
|
|
3900
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
3901
|
+
outputSchema: Schema_exports.optionalKey(JsonObject2),
|
|
3902
|
+
annotations: Schema_exports.optionalKey(ToolAnnotations2),
|
|
3903
|
+
_meta: Schema_exports.optionalKey(JsonObject2)
|
|
3904
|
+
});
|
|
3905
|
+
var HostedToolSummary3 = HostedTool3.mapFields(
|
|
3906
|
+
({ inputSchema: _input, outputSchema: _output, _meta, ...fields }) => fields
|
|
3907
|
+
);
|
|
3908
|
+
var HostDeclarationInvalid4 = class extends Schema_exports.TaggedError()(
|
|
3909
|
+
"HostDeclarationInvalid",
|
|
3910
|
+
FailureDetail
|
|
3911
|
+
) {
|
|
3912
|
+
};
|
|
3913
|
+
var HostEvaluationFailed4 = class extends Schema_exports.TaggedError()(
|
|
3914
|
+
"HostEvaluationFailed",
|
|
3915
|
+
FailureDetail
|
|
3916
|
+
) {
|
|
3917
|
+
};
|
|
3918
|
+
var HostRouterError4 = Schema_exports.Union([
|
|
3919
|
+
ProviderError,
|
|
3920
|
+
McpError6,
|
|
3921
|
+
SkillLoadFailed3,
|
|
3922
|
+
HostDeclarationInvalid4,
|
|
3923
|
+
HostEvaluationFailed4
|
|
3924
|
+
]);
|
|
3925
|
+
var HostedRouter4 = Schema_exports.Struct({
|
|
3926
|
+
path: Schema_exports.String,
|
|
3927
|
+
title: Schema_exports.optionalKey(Schema_exports.String),
|
|
3928
|
+
description: Schema_exports.optionalKey(Schema_exports.String),
|
|
3929
|
+
icons: Schema_exports.optionalKey(Schema_exports.Array(RouterIcon)),
|
|
3930
|
+
tags: Schema_exports.optionalKey(Schema_exports.Record(Schema_exports.NonEmptyString, Schema_exports.String)),
|
|
3931
|
+
skill: Schema_exports.optionalKey(AppSkillName),
|
|
3932
|
+
error: Schema_exports.optionalKey(HostRouterError4)
|
|
3933
|
+
});
|
|
3934
|
+
var HostedCatalog4 = Schema_exports.Struct({
|
|
3935
|
+
tools: Schema_exports.Array(HostedTool3),
|
|
3936
|
+
routers: Schema_exports.Array(HostedRouter4)
|
|
3937
|
+
});
|
|
3938
|
+
var HostedCatalogSummary4 = Schema_exports.Struct({
|
|
3939
|
+
tools: Schema_exports.Array(HostedToolSummary3),
|
|
3940
|
+
routers: Schema_exports.Array(HostedRouter4)
|
|
3941
|
+
});
|
|
3942
|
+
var SkillSources3 = Schema_exports.Struct({
|
|
3943
|
+
skills: AppSkills,
|
|
3944
|
+
dynamic: Schema_exports.Boolean,
|
|
3945
|
+
cached: Schema_exports.optionalKey(Schema_exports.Boolean)
|
|
3946
|
+
});
|
|
3947
|
+
var SkillCatalogResponse3 = Schema_exports.Union([SkillSources3, AppSkills]);
|
|
3948
|
+
var ToolKind2 = Schema_exports.Literals(["query", "mutation"]);
|
|
3949
|
+
var AccountCheckCommand2 = Schema_exports.Struct({
|
|
3950
|
+
operation: Schema_exports.Literal("account-check"),
|
|
3951
|
+
requirement: Schema_exports.NonEmptyString
|
|
3952
|
+
});
|
|
3953
|
+
var MigrateCommand2 = Schema_exports.Struct({ operation: Schema_exports.Literal("migrate") });
|
|
3954
|
+
var MigrateResult2 = Schema_exports.Array(
|
|
3955
|
+
Schema_exports.Struct({ id: Schema_exports.Int, name: Schema_exports.NonEmptyString })
|
|
3956
|
+
);
|
|
3957
|
+
var HostRequest5 = Schema_exports.Union([
|
|
3958
|
+
WorkflowCommand,
|
|
3959
|
+
WebhookCommand,
|
|
3960
|
+
Schema_exports.Struct({ operation: Schema_exports.Literal("requirements") }),
|
|
3961
|
+
Schema_exports.Struct({
|
|
3962
|
+
operation: Schema_exports.Literal("inspect"),
|
|
3963
|
+
/** Omit schemas. Only builds that declare the toolIndex capability accept this. */
|
|
3964
|
+
detail: Schema_exports.optionalKey(Schema_exports.Literal("summary")),
|
|
3965
|
+
/** Describe only these tools. Only builds that declare the toolIndex capability accept this. */
|
|
3966
|
+
tools: Schema_exports.optionalKey(Schema_exports.Array(Schema_exports.NonEmptyString)),
|
|
3967
|
+
/**
|
|
3968
|
+
* Describe only declared operations that have schedules, without dynamic tool discovery.
|
|
3969
|
+
* Only builds that declare the scheduledTools capability accept this.
|
|
3970
|
+
*/
|
|
3971
|
+
scheduled: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3972
|
+
}),
|
|
3973
|
+
Schema_exports.Struct({
|
|
3974
|
+
operation: Schema_exports.Literal("skills"),
|
|
3975
|
+
/** Answer with SkillSources. Only builds that declare the skillSources capability accept this. */
|
|
3976
|
+
sources: Schema_exports.optionalKey(Schema_exports.Literal(true))
|
|
3977
|
+
}),
|
|
3978
|
+
Schema_exports.Struct({
|
|
3979
|
+
operation: Schema_exports.Literal("query"),
|
|
3980
|
+
name: Schema_exports.NonEmptyString,
|
|
3981
|
+
input: JsonValue
|
|
3982
|
+
}),
|
|
3983
|
+
Schema_exports.Struct({
|
|
3984
|
+
operation: Schema_exports.Literal("mutate"),
|
|
3985
|
+
name: Schema_exports.NonEmptyString,
|
|
3986
|
+
input: JsonValue
|
|
3987
|
+
}),
|
|
3988
|
+
Schema_exports.Struct({
|
|
3989
|
+
operation: Schema_exports.Literal("call"),
|
|
3990
|
+
tool: Schema_exports.NonEmptyString,
|
|
3991
|
+
/**
|
|
3992
|
+
* The caller's claim; the bundle rejects a call whose tool has the other kind. The host omits
|
|
3993
|
+
* it for a tool its catalog does not list, and then opens storage for writing.
|
|
3994
|
+
*/
|
|
3995
|
+
kind: Schema_exports.optionalKey(ToolKind2),
|
|
3996
|
+
input: JsonValue
|
|
3997
|
+
}),
|
|
3998
|
+
AccountCheckCommand2,
|
|
3999
|
+
MigrateCommand2
|
|
4000
|
+
]);
|
|
4001
|
+
var HostRequestInvalid2 = class extends Schema_exports.TaggedError()(
|
|
4002
|
+
"HostRequestInvalid",
|
|
4003
|
+
{}
|
|
4004
|
+
) {
|
|
4005
|
+
};
|
|
4006
|
+
var HostAccountsInvalid2 = class extends Schema_exports.TaggedError()(
|
|
4007
|
+
"HostAccountsInvalid",
|
|
4008
|
+
{}
|
|
4009
|
+
) {
|
|
4010
|
+
};
|
|
4011
|
+
var HostOperationNotFound2 = class extends Schema_exports.TaggedError()(
|
|
4012
|
+
"HostOperationNotFound",
|
|
4013
|
+
{}
|
|
4014
|
+
) {
|
|
4015
|
+
};
|
|
4016
|
+
var HostOperationFailed4 = class extends Schema_exports.TaggedError()(
|
|
4017
|
+
"HostOperationFailed",
|
|
4018
|
+
FailureDetail
|
|
4019
|
+
) {
|
|
4020
|
+
};
|
|
4021
|
+
var HostToolNotFound2 = class extends Schema_exports.TaggedError()(
|
|
4022
|
+
"HostToolNotFound",
|
|
4023
|
+
{}
|
|
4024
|
+
) {
|
|
4025
|
+
};
|
|
4026
|
+
var HostKindMismatch2 = class extends Schema_exports.TaggedError()("HostKindMismatch", {
|
|
4027
|
+
tool: Schema_exports.NonEmptyString,
|
|
4028
|
+
requested: ToolKind2,
|
|
4029
|
+
actual: ToolKind2
|
|
4030
|
+
}) {
|
|
4031
|
+
};
|
|
4032
|
+
var InputProblem2 = Schema_exports.String.check(Schema_exports.isMaxLength(512));
|
|
4033
|
+
var maxInputProblems2 = 10;
|
|
4034
|
+
var HostInputInvalid2 = class extends Schema_exports.TaggedError()("HostInputInvalid", {
|
|
4035
|
+
problems: Schema_exports.optionalKey(
|
|
4036
|
+
Schema_exports.Array(InputProblem2).check(Schema_exports.isMaxLength(maxInputProblems2))
|
|
4037
|
+
)
|
|
4038
|
+
}) {
|
|
4039
|
+
};
|
|
4040
|
+
var HostToolBlocked2 = class extends Schema_exports.TaggedError()("HostToolBlocked", {}) {
|
|
4041
|
+
};
|
|
4042
|
+
var HostToolApprovalRequired2 = class extends Schema_exports.TaggedError()(
|
|
4043
|
+
"HostToolApprovalRequired",
|
|
4044
|
+
{ input: JsonValue, elicitation: ApprovalElicitation }
|
|
4045
|
+
) {
|
|
4046
|
+
};
|
|
4047
|
+
var HostToolPolicyFailed2 = class extends Schema_exports.TaggedError()(
|
|
4048
|
+
"HostToolPolicyFailed",
|
|
4049
|
+
{}
|
|
4050
|
+
) {
|
|
4051
|
+
};
|
|
4052
|
+
var HostOutputInvalid2 = class extends Schema_exports.TaggedError()(
|
|
4053
|
+
"HostOutputInvalid",
|
|
4054
|
+
{}
|
|
4055
|
+
) {
|
|
4056
|
+
};
|
|
4057
|
+
var HostError6 = Schema_exports.Union([
|
|
4058
|
+
OpenapiResponseError,
|
|
4059
|
+
ProviderError,
|
|
4060
|
+
McpError6,
|
|
4061
|
+
SkillLoadFailed3,
|
|
4062
|
+
WorkflowFailure,
|
|
4063
|
+
HostRequestInvalid2,
|
|
4064
|
+
HostAccountsInvalid2,
|
|
4065
|
+
HostDeclarationInvalid4,
|
|
4066
|
+
HostEvaluationFailed4,
|
|
4067
|
+
HostOperationNotFound2,
|
|
4068
|
+
HostOperationFailed4,
|
|
4069
|
+
DatabaseLimitExceeded,
|
|
4070
|
+
DatabaseFieldReserved,
|
|
4071
|
+
HostToolNotFound2,
|
|
4072
|
+
HostInputInvalid2,
|
|
4073
|
+
HostOutputInvalid2,
|
|
4074
|
+
HostToolBlocked2,
|
|
4075
|
+
HostToolApprovalRequired2,
|
|
4076
|
+
HostToolPolicyFailed2,
|
|
4077
|
+
ElicitationFailed,
|
|
4078
|
+
HostKindMismatch2
|
|
4079
|
+
]);
|
|
4080
|
+
var HostResponse6 = Schema_exports.Union([
|
|
4081
|
+
Schema_exports.Struct({
|
|
4082
|
+
ok: Schema_exports.Literal(true),
|
|
4083
|
+
value: JsonValue,
|
|
4084
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
4085
|
+
/** The occurrences this invocation emitted, kept only because it succeeded. */
|
|
4086
|
+
events: Schema_exports.optionalKey(EmittedEvents)
|
|
4087
|
+
}),
|
|
4088
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError6 })
|
|
4089
|
+
]);
|
|
4090
|
+
var HostInvocation7 = Schema_exports.Struct({
|
|
4091
|
+
command: HostRequest5,
|
|
4092
|
+
accounts: ResolvedAccounts4,
|
|
4093
|
+
approval: Schema_exports.optionalKey(TrustedToolApproval2),
|
|
4094
|
+
replay: Schema_exports.optionalKey(WorkflowReplay),
|
|
4095
|
+
deadline: Schema_exports.optionalKey(InvocationDeadline2),
|
|
4096
|
+
workflowRun: Schema_exports.optionalKey(WorkflowRunId)
|
|
4097
|
+
});
|
|
4098
|
+
var current = {
|
|
4099
|
+
version: frameworkProtocol,
|
|
4100
|
+
schemas: {
|
|
4101
|
+
invocation: HostInvocation7,
|
|
4102
|
+
request: HostRequest5,
|
|
4103
|
+
response: HostResponse6,
|
|
4104
|
+
requirements: DeclaredRequirements6,
|
|
4105
|
+
catalog: HostedCatalog4,
|
|
4106
|
+
catalogSummary: HostedCatalogSummary4,
|
|
4107
|
+
skills: SkillCatalogResponse3,
|
|
4108
|
+
elicitationRequest: FormElicitation,
|
|
4109
|
+
elicitationReply: ElicitationReply,
|
|
4110
|
+
workflowStep: WorkflowRpcCommand,
|
|
4111
|
+
workflowStepReply: WorkflowRpcResult,
|
|
4112
|
+
workflowControl: WorkflowControlCommand,
|
|
4113
|
+
cacheCommand: CacheCommand,
|
|
4114
|
+
cacheReply: CacheReply,
|
|
4115
|
+
accountCheck: AccountCheckResult,
|
|
4116
|
+
accounts: ResolvedAccounts4,
|
|
4117
|
+
migrate: MigrateResult2
|
|
4118
|
+
}
|
|
4119
|
+
};
|
|
4120
|
+
|
|
4121
|
+
// src/contracts/host.ts
|
|
4122
|
+
var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
|
|
4123
|
+
var skillCatalog = (response) => Schema_exports.is(SkillSources3)(response) ? response : { skills: response };
|
|
4124
|
+
var inspectCommand = (tools, scheduled) => ({
|
|
4125
|
+
operation: "inspect",
|
|
4126
|
+
...tools === void 0 ? {} : { tools: [...tools] },
|
|
4127
|
+
...scheduled === void 0 ? {} : { scheduled }
|
|
4128
|
+
});
|
|
4129
|
+
var indexCommand = { operation: "inspect", detail: "summary" };
|
|
4130
|
+
var selectTools = (tools) => (catalog) => tools === void 0 ? catalog : { ...catalog, tools: catalog.tools.filter((tool) => tools.includes(tool.name)) };
|
|
4131
|
+
var HostRequirementsError = Schema_exports.Union([
|
|
4132
|
+
HostRequestInvalid2,
|
|
4133
|
+
HostDeclarationInvalid4,
|
|
4134
|
+
DatabaseFieldReserved
|
|
4135
|
+
]);
|
|
4136
|
+
var HostInspectError = Schema_exports.Union([
|
|
4137
|
+
ProviderError,
|
|
4138
|
+
McpError6,
|
|
4139
|
+
SkillLoadFailed3,
|
|
4140
|
+
HostRequestInvalid2,
|
|
4141
|
+
HostDeclarationInvalid4,
|
|
4142
|
+
HostAccountsInvalid2,
|
|
4143
|
+
HostEvaluationFailed4
|
|
4144
|
+
]);
|
|
4145
|
+
var HostCallError = Schema_exports.Union([
|
|
4146
|
+
OpenapiResponseError,
|
|
4147
|
+
WorkflowFailure,
|
|
4148
|
+
HostInspectError,
|
|
4149
|
+
HostToolNotFound2,
|
|
4150
|
+
HostOperationNotFound2,
|
|
4151
|
+
HostKindMismatch2,
|
|
4152
|
+
HostOperationFailed4,
|
|
4153
|
+
DatabaseLimitExceeded,
|
|
4154
|
+
HostInputInvalid2,
|
|
4155
|
+
HostOutputInvalid2,
|
|
4156
|
+
HostToolBlocked2,
|
|
4157
|
+
HostToolApprovalRequired2,
|
|
4158
|
+
HostToolPolicyFailed2,
|
|
4159
|
+
ElicitationFailed
|
|
4160
|
+
]);
|
|
4161
|
+
var HostAccountCheckError = Schema_exports.Union([
|
|
4162
|
+
ProviderError,
|
|
4163
|
+
WorkflowFailure,
|
|
4164
|
+
HostRequestInvalid2,
|
|
4165
|
+
HostDeclarationInvalid4,
|
|
4166
|
+
HostAccountsInvalid2,
|
|
4167
|
+
HostOperationNotFound2,
|
|
4168
|
+
HostOperationFailed4,
|
|
4169
|
+
HostOutputInvalid2
|
|
4170
|
+
]);
|
|
4171
|
+
var HostDataError = HostCallError;
|
|
4172
|
+
var ToolResultObservation = Context_exports.Reference(
|
|
4173
|
+
"apps/ToolResultObservation",
|
|
4174
|
+
{ defaultValue: () => ({ failed: () => {
|
|
4175
|
+
} }) }
|
|
4176
|
+
);
|
|
4177
|
+
var InvocationTiming = Schema_exports.Struct({
|
|
4178
|
+
elapsedMs: Schema_exports.Finite,
|
|
4179
|
+
upstreamMs: Schema_exports.Finite,
|
|
4180
|
+
elicitationMs: Schema_exports.Finite,
|
|
4181
|
+
authoredMs: Schema_exports.Finite
|
|
4182
|
+
});
|
|
4183
|
+
var InvocationTimingSink = Context_exports.Reference(
|
|
4184
|
+
"apps/InvocationTimingSink",
|
|
4185
|
+
{ defaultValue: () => () => {
|
|
4186
|
+
} }
|
|
4187
|
+
);
|
|
4188
|
+
|
|
4189
|
+
export {
|
|
4190
|
+
SecretsMethod,
|
|
4191
|
+
OAuthClientAuth,
|
|
4192
|
+
OAuthSecretClientAuth,
|
|
4193
|
+
OAuthTokenRequestFormat,
|
|
4194
|
+
OAuthTokenResponse,
|
|
4195
|
+
OAuth2Config,
|
|
4196
|
+
OAuth2AccessToken,
|
|
4197
|
+
OAuth2Method,
|
|
4198
|
+
AccountInfo,
|
|
4199
|
+
AccountCheckResult,
|
|
4200
|
+
Provider,
|
|
4201
|
+
ManyAccounts,
|
|
4202
|
+
maxApiErrorInstructionsLength,
|
|
4203
|
+
ApiErrorRecovery,
|
|
4204
|
+
maxApiErrorMessageLength,
|
|
4205
|
+
ApiErrorResponse,
|
|
4206
|
+
OpenapiResponseError,
|
|
4207
|
+
defaultOpenapiErrorLimits,
|
|
4208
|
+
WorkflowRunId,
|
|
4209
|
+
WorkflowName,
|
|
4210
|
+
workflowDurationMillis,
|
|
4211
|
+
WorkflowDuration,
|
|
4212
|
+
WorkflowStepOptions,
|
|
4213
|
+
WorkflowFailureDetail,
|
|
4214
|
+
WorkflowRunFailure,
|
|
4215
|
+
WorkflowFailure,
|
|
4216
|
+
NonRetryableError,
|
|
4217
|
+
WorkflowValue,
|
|
4218
|
+
HostedWorkflow,
|
|
4219
|
+
WorkflowRun,
|
|
4220
|
+
WorkflowRunPage,
|
|
4221
|
+
WorkflowReplay,
|
|
4222
|
+
WorkflowCommand,
|
|
4223
|
+
WorkflowRpcCommand,
|
|
4224
|
+
WorkflowRpcResult,
|
|
4225
|
+
WorkflowControlCommand,
|
|
4226
|
+
DatabaseLimitExceeded,
|
|
4227
|
+
DatabaseFieldReserved,
|
|
4228
|
+
reservedTablePrefix,
|
|
4229
|
+
migrationsDirectory,
|
|
4230
|
+
ElicitationLimits,
|
|
4231
|
+
defaultElicitationLimits,
|
|
4232
|
+
FormElicitation,
|
|
4233
|
+
ElicitationResponse,
|
|
4234
|
+
ElicitationFailed,
|
|
4235
|
+
ElicitationReply,
|
|
4236
|
+
ApprovalElicitation,
|
|
4237
|
+
ApprovalResponse,
|
|
4238
|
+
approvalElicitation,
|
|
4239
|
+
reservedRouterKeys,
|
|
4240
|
+
RouterKey,
|
|
4241
|
+
RouterIcon,
|
|
4242
|
+
RouterMeta,
|
|
4243
|
+
ToolAnnotations2 as ToolAnnotations,
|
|
4244
|
+
McpClientLimits,
|
|
4245
|
+
defaultMcpClientLimits,
|
|
4246
|
+
mcpSdkTimerCeilingMs,
|
|
4247
|
+
McpToolsOptions,
|
|
4248
|
+
McpHealthInput,
|
|
4249
|
+
mcpHealthReserveMs,
|
|
4250
|
+
McpToolResult,
|
|
4251
|
+
McpToolMetadata,
|
|
4252
|
+
McpServerHeader,
|
|
4253
|
+
McpError2 as McpError,
|
|
4254
|
+
McpCredentialsUnverified,
|
|
4255
|
+
ProcessConfig,
|
|
4256
|
+
WebhookTransportLimits,
|
|
4257
|
+
defaultWebhookTransportLimits,
|
|
4258
|
+
WebhookRequestData,
|
|
4259
|
+
WebhookResponseData,
|
|
4260
|
+
ManualWebhookSetup,
|
|
4261
|
+
ManualWebhookDescriptor,
|
|
4262
|
+
HostedWebhook,
|
|
4263
|
+
WebhookCommand,
|
|
4264
|
+
EventName,
|
|
4265
|
+
EventFilterValue,
|
|
4266
|
+
EventLimits,
|
|
4267
|
+
defaultEventLimits,
|
|
4268
|
+
DeclaredEvent,
|
|
4269
|
+
DeclaredEvents,
|
|
4270
|
+
EmittedEvent,
|
|
4271
|
+
EmittedEvents,
|
|
4272
|
+
frameworkProtocol,
|
|
4273
|
+
protocol1,
|
|
4274
|
+
protocol2,
|
|
4275
|
+
protocol3,
|
|
4276
|
+
protocol4,
|
|
4277
|
+
protocol5,
|
|
4278
|
+
protocol6,
|
|
4279
|
+
protocol7,
|
|
4280
|
+
protocol8,
|
|
4281
|
+
protocol9,
|
|
4282
|
+
protocol10,
|
|
4283
|
+
minimumIntervalMilliseconds2 as minimumIntervalMilliseconds,
|
|
4284
|
+
Interval,
|
|
4285
|
+
CalendarSchedule2 as CalendarSchedule,
|
|
4286
|
+
ScheduleTiming2 as ScheduleTiming,
|
|
4287
|
+
OperationSchedule2 as OperationSchedule,
|
|
4288
|
+
McpError6 as McpError2,
|
|
4289
|
+
SkillLoadFailed3 as SkillLoadFailed,
|
|
4290
|
+
CredentialHost2 as CredentialHost,
|
|
4291
|
+
DeclaredAuthMethod4 as DeclaredAuthMethod,
|
|
4292
|
+
DeclaredProvider4 as DeclaredProvider,
|
|
4293
|
+
DeclaredRequirements6 as DeclaredRequirements,
|
|
4294
|
+
ResolvedAccount4 as ResolvedAccount,
|
|
4295
|
+
ResolvedAccounts4 as ResolvedAccounts,
|
|
4296
|
+
TrustedToolApproval2 as TrustedToolApproval,
|
|
4297
|
+
InvocationDeadline2 as InvocationDeadline,
|
|
4298
|
+
HostedTool3 as HostedTool,
|
|
4299
|
+
HostedToolSummary3 as HostedToolSummary,
|
|
4300
|
+
HostDeclarationInvalid4 as HostDeclarationInvalid,
|
|
4301
|
+
HostEvaluationFailed4 as HostEvaluationFailed,
|
|
4302
|
+
HostRouterError4 as HostRouterError,
|
|
4303
|
+
HostedRouter4 as HostedRouter,
|
|
4304
|
+
HostedCatalog4 as HostedCatalog,
|
|
4305
|
+
HostedCatalogSummary4 as HostedCatalogSummary,
|
|
4306
|
+
SkillSources3 as SkillSources,
|
|
4307
|
+
SkillCatalogResponse3 as SkillCatalogResponse,
|
|
4308
|
+
AccountCheckCommand2 as AccountCheckCommand,
|
|
4309
|
+
MigrateCommand2 as MigrateCommand,
|
|
4310
|
+
MigrateResult2 as MigrateResult,
|
|
4311
|
+
HostRequest5 as HostRequest,
|
|
4312
|
+
HostRequestInvalid2 as HostRequestInvalid,
|
|
4313
|
+
HostAccountsInvalid2 as HostAccountsInvalid,
|
|
4314
|
+
HostOperationNotFound2 as HostOperationNotFound,
|
|
4315
|
+
HostOperationFailed4 as HostOperationFailed,
|
|
4316
|
+
HostToolNotFound2 as HostToolNotFound,
|
|
4317
|
+
HostKindMismatch2 as HostKindMismatch,
|
|
4318
|
+
InputProblem2 as InputProblem,
|
|
4319
|
+
maxInputProblems2 as maxInputProblems,
|
|
4320
|
+
HostInputInvalid2 as HostInputInvalid,
|
|
4321
|
+
HostToolBlocked2 as HostToolBlocked,
|
|
4322
|
+
HostToolApprovalRequired2 as HostToolApprovalRequired,
|
|
4323
|
+
HostToolPolicyFailed2 as HostToolPolicyFailed,
|
|
4324
|
+
HostOutputInvalid2 as HostOutputInvalid,
|
|
4325
|
+
HostError6 as HostError,
|
|
4326
|
+
HostResponse6 as HostResponse,
|
|
4327
|
+
HostInvocation7 as HostInvocation,
|
|
4328
|
+
current,
|
|
4329
|
+
skillsCommand,
|
|
4330
|
+
skillCatalog,
|
|
4331
|
+
inspectCommand,
|
|
4332
|
+
indexCommand,
|
|
4333
|
+
selectTools,
|
|
4334
|
+
HostRequirementsError,
|
|
4335
|
+
HostInspectError,
|
|
4336
|
+
HostCallError,
|
|
4337
|
+
HostAccountCheckError,
|
|
4338
|
+
HostDataError,
|
|
4339
|
+
ToolResultObservation,
|
|
4340
|
+
InvocationTiming,
|
|
4341
|
+
InvocationTimingSink
|
|
4342
|
+
};
|