@opencode/browse 0.0.11-dev.76 → 0.0.11-dev.78
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/dist/{cli-qpkh40gh.mjs → cli-e9x2hzbm.mjs} +63 -52
- package/dist/cli.mjs +30 -19
- package/dist/{helpers-kp0j46jt.mjs → helpers-681ybn8r.mjs} +2 -2
- package/dist/{index-0dcypq31.mjs → index-yzz55kxm.mjs} +1 -1
- package/dist/{main-eej5z0y5.mjs → main-0yxzwqt8.mjs} +6 -6
- package/dist/main-1ja7rnnp.mjs +4 -0
- package/dist/main-3d4mj1xj.mjs +157 -0
- package/dist/main-4qeb707s.mjs +161 -0
- package/dist/{main-rt6g5418.mjs → main-8z9d979q.mjs} +15 -15
- package/dist/{main-nqmm7pdz.mjs → main-93xmqcr3.mjs} +47 -47
- package/dist/{main-gevbt7h7.mjs → main-csnx585b.mjs} +151 -151
- package/dist/{setup-j76yv51b.mjs → main-fkskfb8a.mjs} +3608 -4406
- package/dist/main-ftsbt0hk.mjs +73 -0
- package/dist/{main-brv9dhy5.mjs → main-gdvgbgce.mjs} +9 -9
- package/dist/{main-ajza8egc.mjs → main-mysz5yma.mjs} +44 -39
- package/dist/main-qzvstggv.mjs +465 -0
- package/dist/main-vgzr4689.mjs +61 -0
- package/dist/{mcp-sy8qgkyr.mjs → mcp-3v0wxzr5.mjs} +139 -138
- package/dist/migrate-5phz1hha.mjs +233 -0
- package/dist/{relay-ateyg5ax.mjs → relay-4chyv51v.mjs} +128 -123
- package/dist/runtime-update-pzazb7sh.mjs +156 -0
- package/dist/setup-5g5kza58.mjs +956 -0
- package/dist/{skill-text-x7sccp6h.mjs → skill-text-mrxy6zpc.mjs} +5 -4
- package/dist/{supervisor-0rvjpf4e.mjs → supervisor-bfrn5cxb.mjs} +38 -17
- package/dist/{update-rbd2025v.mjs → update-42j1j7w1.mjs} +3 -3
- package/dist/{version-4cjr3wpp.mjs → version-w0dwcyve.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +5 -4
- package/dist/main-7wgmq04v.mjs +0 -303
- package/dist/main-exnm62gg.mjs +0 -4
- package/dist/main-hm4fcpfz.mjs +0 -131
- package/dist/main-rn7hdcq2.mjs +0 -805
- package/dist/runtime-update-70gqzynp.mjs +0 -200
|
@@ -26,18 +26,18 @@ import {
|
|
|
26
26
|
get,
|
|
27
27
|
merge,
|
|
28
28
|
Reference,
|
|
29
|
-
fromInputUnsafe,
|
|
30
|
-
isFinite2,
|
|
31
|
-
isZero,
|
|
32
|
-
zero,
|
|
33
|
-
millis,
|
|
34
|
-
toMillis,
|
|
35
29
|
normalize,
|
|
36
30
|
isFailure,
|
|
37
31
|
isSuccess,
|
|
38
32
|
filter,
|
|
39
33
|
take,
|
|
40
34
|
empty2,
|
|
35
|
+
fromInputUnsafe,
|
|
36
|
+
isFinite2,
|
|
37
|
+
isZero,
|
|
38
|
+
zero,
|
|
39
|
+
millis,
|
|
40
|
+
toMillis,
|
|
41
41
|
Scheduler,
|
|
42
42
|
Class,
|
|
43
43
|
taggedEnum,
|
|
@@ -46,16 +46,23 @@ import {
|
|
|
46
46
|
externalSpan,
|
|
47
47
|
LogLevelOrder,
|
|
48
48
|
reportCauseUnsafe,
|
|
49
|
+
map4,
|
|
50
|
+
squash,
|
|
51
|
+
hasDies,
|
|
52
|
+
hasInterrupts,
|
|
53
|
+
interruptors,
|
|
54
|
+
IllegalArgumentError,
|
|
55
|
+
ExceededCapacityError,
|
|
49
56
|
isExit,
|
|
50
57
|
succeed3,
|
|
51
58
|
failCause,
|
|
52
|
-
|
|
59
|
+
fail3,
|
|
53
60
|
die,
|
|
54
61
|
interrupt,
|
|
55
62
|
void_2,
|
|
56
63
|
isSuccess2,
|
|
57
64
|
isFailure2,
|
|
58
|
-
|
|
65
|
+
hasInterrupts2,
|
|
59
66
|
isDeferred,
|
|
60
67
|
makeUnsafe3,
|
|
61
68
|
make5,
|
|
@@ -81,13 +88,6 @@ import {
|
|
|
81
88
|
provide2,
|
|
82
89
|
provideMerge,
|
|
83
90
|
launch,
|
|
84
|
-
map4,
|
|
85
|
-
squash,
|
|
86
|
-
hasDies,
|
|
87
|
-
hasInterrupts2,
|
|
88
|
-
interruptors,
|
|
89
|
-
IllegalArgumentError,
|
|
90
|
-
ExceededCapacityError,
|
|
91
91
|
catchDone,
|
|
92
92
|
spaced,
|
|
93
93
|
isEffect,
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
callback2,
|
|
103
103
|
never,
|
|
104
104
|
gen,
|
|
105
|
-
|
|
105
|
+
fail5,
|
|
106
106
|
die2,
|
|
107
107
|
try_,
|
|
108
108
|
withFiber2,
|
|
@@ -131,11 +131,11 @@ import {
|
|
|
131
131
|
ignoreCause,
|
|
132
132
|
timeout,
|
|
133
133
|
race,
|
|
134
|
-
|
|
134
|
+
when2,
|
|
135
135
|
match3,
|
|
136
136
|
matchCauseEffect,
|
|
137
137
|
matchEffect,
|
|
138
|
-
|
|
138
|
+
context2,
|
|
139
139
|
contextWith,
|
|
140
140
|
provide3,
|
|
141
141
|
provideContext,
|
|
@@ -168,6 +168,8 @@ import {
|
|
|
168
168
|
logError,
|
|
169
169
|
logDebug,
|
|
170
170
|
annotateLogs,
|
|
171
|
+
encode,
|
|
172
|
+
decode,
|
|
171
173
|
empty3,
|
|
172
174
|
empty4,
|
|
173
175
|
fromInput,
|
|
@@ -176,42 +178,11 @@ import {
|
|
|
176
178
|
setAll,
|
|
177
179
|
merge2,
|
|
178
180
|
remove,
|
|
179
|
-
interrupt3,
|
|
180
|
-
getCurrent,
|
|
181
|
-
runIn,
|
|
182
|
-
make8,
|
|
183
|
-
set2,
|
|
184
|
-
makeUnsafe5,
|
|
185
|
-
Empty,
|
|
186
|
-
make9,
|
|
187
|
-
append,
|
|
188
|
-
prepend,
|
|
189
|
-
takeAll,
|
|
190
|
-
take2,
|
|
191
|
-
remove2,
|
|
192
|
-
make10,
|
|
193
|
-
bounded,
|
|
194
|
-
dropping,
|
|
195
|
-
offer,
|
|
196
|
-
offerUnsafe,
|
|
197
|
-
offerAll,
|
|
198
|
-
failCause2,
|
|
199
|
-
end,
|
|
200
|
-
shutdownUnsafe,
|
|
201
|
-
takeAll2,
|
|
202
|
-
take3,
|
|
203
|
-
fromQueue,
|
|
204
|
-
unwrap,
|
|
205
|
-
run2,
|
|
206
|
-
runForEach,
|
|
207
|
-
runForEachArray,
|
|
208
|
-
encode,
|
|
209
|
-
decode,
|
|
210
181
|
defaultFormatter,
|
|
211
182
|
passthrough,
|
|
212
183
|
transformOptional,
|
|
213
184
|
omit,
|
|
214
|
-
|
|
185
|
+
is2,
|
|
215
186
|
decodeUnknownEffect2,
|
|
216
187
|
decodeUnknownResult,
|
|
217
188
|
decodeSync,
|
|
@@ -249,18 +220,47 @@ import {
|
|
|
249
220
|
toCodecJson,
|
|
250
221
|
Json,
|
|
251
222
|
JsonObject,
|
|
223
|
+
interrupt3,
|
|
224
|
+
getCurrent,
|
|
225
|
+
runIn,
|
|
226
|
+
makeUnsafe5,
|
|
227
|
+
make9,
|
|
228
|
+
set2,
|
|
229
|
+
Empty,
|
|
230
|
+
make10,
|
|
231
|
+
append,
|
|
232
|
+
prepend,
|
|
233
|
+
takeAll,
|
|
234
|
+
take2,
|
|
235
|
+
remove2,
|
|
236
|
+
make11,
|
|
237
|
+
bounded,
|
|
238
|
+
dropping,
|
|
239
|
+
offer,
|
|
240
|
+
offerUnsafe,
|
|
241
|
+
offerAll,
|
|
242
|
+
failCause2,
|
|
243
|
+
end,
|
|
244
|
+
shutdownUnsafe,
|
|
245
|
+
takeAll2,
|
|
246
|
+
take3,
|
|
247
|
+
fromQueue,
|
|
248
|
+
unwrap,
|
|
249
|
+
run2,
|
|
250
|
+
runForEach,
|
|
251
|
+
runForEachArray,
|
|
252
|
+
Stdio,
|
|
252
253
|
empty5,
|
|
253
254
|
jsonUnsafe,
|
|
254
|
-
Stdio,
|
|
255
255
|
layer
|
|
256
|
-
} from "./main-
|
|
256
|
+
} from "./main-csnx585b.mjs";
|
|
257
257
|
import {
|
|
258
258
|
opencodeBrowserVersion2
|
|
259
|
-
} from "./main-
|
|
259
|
+
} from "./main-1ja7rnnp.mjs";
|
|
260
260
|
import {
|
|
261
261
|
cliCommand,
|
|
262
262
|
autoUpdateStatus
|
|
263
|
-
} from "./main-
|
|
263
|
+
} from "./main-qzvstggv.mjs";
|
|
264
264
|
import"./main-mrew6jy8.mjs";
|
|
265
265
|
import {
|
|
266
266
|
option,
|
|
@@ -280,12 +280,12 @@ import {
|
|
|
280
280
|
relayBuildProblem,
|
|
281
281
|
ensureRelay,
|
|
282
282
|
ensureExtensionConnected
|
|
283
|
-
} from "./main-
|
|
284
|
-
import"./main-
|
|
283
|
+
} from "./main-mysz5yma.mjs";
|
|
284
|
+
import"./main-vgzr4689.mjs";
|
|
285
285
|
import {
|
|
286
286
|
updateJson2,
|
|
287
287
|
createUpdateWatcher2
|
|
288
|
-
} from "./main-
|
|
288
|
+
} from "./main-gdvgbgce.mjs";
|
|
289
289
|
import {
|
|
290
290
|
makeUnsafe,
|
|
291
291
|
make,
|
|
@@ -369,21 +369,22 @@ import {
|
|
|
369
369
|
mcpErrorMessage2,
|
|
370
370
|
toolResult,
|
|
371
371
|
listSecrets
|
|
372
|
-
} from "./main-
|
|
372
|
+
} from "./main-93xmqcr3.mjs";
|
|
373
373
|
import {
|
|
374
374
|
Clock,
|
|
375
375
|
type,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
376
|
+
value,
|
|
377
|
+
when,
|
|
378
|
+
tag,
|
|
379
379
|
tags,
|
|
380
|
-
|
|
380
|
+
is,
|
|
381
381
|
string,
|
|
382
382
|
number,
|
|
383
383
|
boolean,
|
|
384
384
|
orElse,
|
|
385
385
|
exhaustive
|
|
386
|
-
} from "./main-
|
|
386
|
+
} from "./main-8z9d979q.mjs";
|
|
387
|
+
import"./main-ftsbt0hk.mjs";
|
|
387
388
|
import {
|
|
388
389
|
pipeArguments,
|
|
389
390
|
dual,
|
|
@@ -403,7 +404,7 @@ import {
|
|
|
403
404
|
// node_modules/effect/dist/PubSub.js
|
|
404
405
|
var TypeId = "~effect/PubSub";
|
|
405
406
|
var SubscriptionTypeId = "~effect/PubSub/Subscription";
|
|
406
|
-
var make4 = (options) => sync2(() => makePubSubUnsafe(options.atomicPubSub(), new Map, makeUnsafe4(), makeUnsafe5(false),
|
|
407
|
+
var make4 = (options) => sync2(() => makePubSubUnsafe(options.atomicPubSub(), new Map, makeUnsafe4(), makeUnsafe5(false), make9(false), options.strategy(), make9(none())));
|
|
407
408
|
var unbounded = (options) => make4({
|
|
408
409
|
atomicPubSub: () => makeAtomicUnbounded(options),
|
|
409
410
|
strategy: () => new DroppingStrategy
|
|
@@ -438,7 +439,7 @@ var unsubscribe = (self) => uninterruptible(withFiber2((state) => {
|
|
|
438
439
|
self.subscription.unsubscribe();
|
|
439
440
|
self.replayWindow.close();
|
|
440
441
|
self.strategy.onPubSubEmptySpaceUnsafe(self.pubsub, self.subscribers);
|
|
441
|
-
})),
|
|
442
|
+
})), when2(self.shutdownHook.open), asVoid2);
|
|
442
443
|
}));
|
|
443
444
|
var take4 = (self) => suspend2(() => {
|
|
444
445
|
if (self.shutdownFlag.current) {
|
|
@@ -493,7 +494,7 @@ var removeSubscribers = (subscribers, subscription, pollers) => {
|
|
|
493
494
|
subscribers.delete(subscription);
|
|
494
495
|
}
|
|
495
496
|
};
|
|
496
|
-
var makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(),
|
|
497
|
+
var makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make10(), makeUnsafe5(false), make9(false), strategy, pubsub.replayWindow(), ended);
|
|
497
498
|
class UnboundedPubSub {
|
|
498
499
|
publisherHead = {
|
|
499
500
|
value: AbsentValue,
|
|
@@ -1047,7 +1048,7 @@ var get3 = /* @__PURE__ */ dual(2, (self, key) => uninterruptibleMask2((restore)
|
|
|
1047
1048
|
entry = o.value;
|
|
1048
1049
|
entry.refCount++;
|
|
1049
1050
|
} else if (Number.isFinite(self.capacity) && size(self.state.map) >= self.capacity) {
|
|
1050
|
-
return
|
|
1051
|
+
return fail5(new ExceededCapacityError(`RcMap attempted to exceed capacity of ${self.capacity}`));
|
|
1051
1052
|
} else {
|
|
1052
1053
|
entry = {
|
|
1053
1054
|
deferred: makeUnsafe3(),
|
|
@@ -1067,7 +1068,7 @@ var get3 = /* @__PURE__ */ dual(2, (self, key) => uninterruptibleMask2((restore)
|
|
|
1067
1068
|
context.set(Scope.key, entry.scope);
|
|
1068
1069
|
const lookupContext = makeUnsafe2(context);
|
|
1069
1070
|
suspend2(() => self.lookup(key)).pipe(runForkWith(lookupContext), runIn(entry.scope)).addObserver((exit) => {
|
|
1070
|
-
if (
|
|
1071
|
+
if (hasInterrupts2(exit))
|
|
1071
1072
|
removeInterrupted(self, key, entry, lookupContext);
|
|
1072
1073
|
doneUnsafe(entry.deferred, exit);
|
|
1073
1074
|
});
|
|
@@ -1167,7 +1168,7 @@ class PromptNotFound extends (/* @__PURE__ */ TaggedError("PromptNotFound")) {
|
|
|
1167
1168
|
}
|
|
1168
1169
|
var ClientNotification = /* @__PURE__ */ taggedEnum();
|
|
1169
1170
|
var ServerNotification = /* @__PURE__ */ taggedEnum();
|
|
1170
|
-
var
|
|
1171
|
+
var make8 = /* @__PURE__ */ sync2(() => {
|
|
1171
1172
|
const registrations = new Map;
|
|
1172
1173
|
const resourceRegistrations = [];
|
|
1173
1174
|
const resourceTemplateRegistrations = [];
|
|
@@ -1693,7 +1694,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
1693
1694
|
const supportsAck = options?.supportsAck ?? true;
|
|
1694
1695
|
const disableTracing = options?.disableTracing ?? false;
|
|
1695
1696
|
const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
|
|
1696
|
-
const services = yield*
|
|
1697
|
+
const services = yield* context2();
|
|
1697
1698
|
const scope = get(services, Scope);
|
|
1698
1699
|
const entries = new Map;
|
|
1699
1700
|
let isShutdown = false;
|
|
@@ -2011,7 +2012,7 @@ var make12 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
|
2011
2012
|
clientId: 0,
|
|
2012
2013
|
requestId,
|
|
2013
2014
|
exit: failCause(cause)
|
|
2014
|
-
}).pipe(andThen(
|
|
2015
|
+
}).pipe(andThen(hasInterrupts(cause) ? void_3 : ignore(interruptRequest(requestId))))), catchCauseIf((cause) => !hasInterrupts(cause), () => void_3)));
|
|
2015
2016
|
}
|
|
2016
2017
|
case "Exit": {
|
|
2017
2018
|
const requestId = RequestId(message.requestId);
|
|
@@ -2042,7 +2043,7 @@ var make12 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
|
2042
2043
|
});
|
|
2043
2044
|
}
|
|
2044
2045
|
case "ClientProtocolError": {
|
|
2045
|
-
const exit =
|
|
2046
|
+
const exit = fail3(message.error);
|
|
2046
2047
|
return forEach(Array.from(entries.keys()), (requestId) => write({
|
|
2047
2048
|
_tag: "Exit",
|
|
2048
2049
|
clientId: 0,
|
|
@@ -2166,7 +2167,7 @@ var invocationFromRequestContext = (request) => ({
|
|
|
2166
2167
|
},
|
|
2167
2168
|
requestContext: request
|
|
2168
2169
|
});
|
|
2169
|
-
var requireCompleteOperation = (protocolVersion, outcome) => outcome._tag === "Complete" ? succeed6(outcome.value) :
|
|
2170
|
+
var requireCompleteOperation = (protocolVersion, outcome) => outcome._tag === "Complete" ? succeed6(outcome.value) : fail5(new UnsupportedByProtocol({
|
|
2170
2171
|
protocolVersion,
|
|
2171
2172
|
feature: "Client input"
|
|
2172
2173
|
}));
|
|
@@ -2201,7 +2202,7 @@ var samplingRequestRequiresTools = (request) => {
|
|
|
2201
2202
|
|
|
2202
2203
|
class ProtocolError extends (/* @__PURE__ */ TaggedError("ProtocolError")) {
|
|
2203
2204
|
static fromTool(error) {
|
|
2204
|
-
const message =
|
|
2205
|
+
const message = value(error).pipe(tag("ToolNotFound", (error) => `Tool '${error.name}' not found`), tag("UnsupportedByProtocol", (error) => `${error.feature} is not supported by MCP ${error.protocolVersion}`), tags({
|
|
2205
2206
|
InvalidToolInput: (error) => error.message,
|
|
2206
2207
|
InvalidToolContinuation: (error) => error.message,
|
|
2207
2208
|
ToolExecutionError: (error) => error.message
|
|
@@ -2527,7 +2528,7 @@ var make15 = () => {
|
|
|
2527
2528
|
subscribe: (uri, clientId, headers) => {
|
|
2528
2529
|
const subscriptions = resolveSession(clientId, headers)?.resourceSubscriptions;
|
|
2529
2530
|
if (subscriptions === undefined) {
|
|
2530
|
-
return
|
|
2531
|
+
return fail5(new ProtocolError({
|
|
2531
2532
|
code: METHOD_NOT_FOUND_ERROR_CODE,
|
|
2532
2533
|
message: "Resource subscriptions are not supported"
|
|
2533
2534
|
}));
|
|
@@ -2537,7 +2538,7 @@ var make15 = () => {
|
|
|
2537
2538
|
unsubscribe: (uri, clientId, headers) => {
|
|
2538
2539
|
const subscriptions = resolveSession(clientId, headers)?.resourceSubscriptions;
|
|
2539
2540
|
if (subscriptions === undefined) {
|
|
2540
|
-
return
|
|
2541
|
+
return fail5(new ProtocolError({
|
|
2541
2542
|
code: METHOD_NOT_FOUND_ERROR_CODE,
|
|
2542
2543
|
message: "Resource subscriptions are not supported"
|
|
2543
2544
|
}));
|
|
@@ -3451,7 +3452,7 @@ var unsupported = (operation, reason) => new McpReverseOperationUnsupported({
|
|
|
3451
3452
|
protocolVersion,
|
|
3452
3453
|
reason
|
|
3453
3454
|
});
|
|
3454
|
-
var requireCapability = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 :
|
|
3455
|
+
var requireCapability = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 : fail5(unsupported(operation, `Client did not advertise the ${capability} capability`));
|
|
3455
3456
|
var projectCapabilities = (capabilities) => ({
|
|
3456
3457
|
experimental: capabilities.experimental,
|
|
3457
3458
|
extensions: capabilities.extensions,
|
|
@@ -3461,19 +3462,19 @@ var projectCapabilities = (capabilities) => ({
|
|
|
3461
3462
|
tools: capabilities.tools
|
|
3462
3463
|
});
|
|
3463
3464
|
var projectContent = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
3464
|
-
const projected =
|
|
3465
|
+
const projected = value(content).pipe(when({
|
|
3465
3466
|
type: "text"
|
|
3466
3467
|
}, (content) => ({
|
|
3467
3468
|
...content,
|
|
3468
3469
|
annotations: content.annotations
|
|
3469
|
-
})),
|
|
3470
|
+
})), when({
|
|
3470
3471
|
type: "image"
|
|
3471
3472
|
}, (content) => ImageContent.make({
|
|
3472
3473
|
type: "image",
|
|
3473
3474
|
mimeType: content.mimeType,
|
|
3474
3475
|
data: encode(content.data),
|
|
3475
3476
|
annotations: content.annotations
|
|
3476
|
-
})),
|
|
3477
|
+
})), when({
|
|
3477
3478
|
type: "resource"
|
|
3478
3479
|
}, (content) => {
|
|
3479
3480
|
const resource = content.resource;
|
|
@@ -3497,8 +3498,8 @@ var projectContent = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
|
3497
3498
|
},
|
|
3498
3499
|
annotations: content.annotations
|
|
3499
3500
|
});
|
|
3500
|
-
}),
|
|
3501
|
-
type:
|
|
3501
|
+
}), when({
|
|
3502
|
+
type: is("audio", "resource_link")
|
|
3502
3503
|
}, (content) => new UnsupportedByProtocol({
|
|
3503
3504
|
protocolVersion,
|
|
3504
3505
|
feature: `${content.type} tool content`
|
|
@@ -3686,7 +3687,7 @@ var protocol = /* @__PURE__ */ make13({
|
|
|
3686
3687
|
const result = yield* client["sampling/createMessage"](wireRequest).pipe(mapError(reverseError("sampling/createMessage")));
|
|
3687
3688
|
return yield* transcode(CreateMessage2.successSchema, CreateMessage.successSchema, result).pipe(mapError(() => unsupported("sampling/createMessage", "Response is not representable by the canonical model")));
|
|
3688
3689
|
}),
|
|
3689
|
-
elicit: () =>
|
|
3690
|
+
elicit: () => fail5(unsupported("elicitation/create", "Elicitation was introduced after this protocol revision"))
|
|
3690
3691
|
}),
|
|
3691
3692
|
projectNotification: (notification) => makeNotificationProjector({
|
|
3692
3693
|
supportsProgressMessage: false
|
|
@@ -3857,21 +3858,21 @@ var unsupported2 = (operation, reason) => new McpReverseOperationUnsupported({
|
|
|
3857
3858
|
protocolVersion: protocolVersion2,
|
|
3858
3859
|
reason
|
|
3859
3860
|
});
|
|
3860
|
-
var requireCapability2 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 :
|
|
3861
|
+
var requireCapability2 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 : fail5(unsupported2(operation, `Client did not advertise the ${capability} capability`));
|
|
3861
3862
|
var projectContent2 = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
3862
|
-
const projected =
|
|
3863
|
+
const projected = value(content).pipe(when({
|
|
3863
3864
|
type: "text"
|
|
3864
3865
|
}, (content) => ({
|
|
3865
3866
|
...content,
|
|
3866
3867
|
annotations: content.annotations
|
|
3867
|
-
})),
|
|
3868
|
-
type:
|
|
3868
|
+
})), when({
|
|
3869
|
+
type: is("image", "audio")
|
|
3869
3870
|
}, (content) => ({
|
|
3870
3871
|
type: content.type,
|
|
3871
3872
|
mimeType: content.mimeType,
|
|
3872
3873
|
data: encode(content.data),
|
|
3873
3874
|
annotations: content.annotations
|
|
3874
|
-
})),
|
|
3875
|
+
})), when({
|
|
3875
3876
|
type: "resource"
|
|
3876
3877
|
}, (content) => {
|
|
3877
3878
|
const resource = content.resource;
|
|
@@ -3895,7 +3896,7 @@ var projectContent2 = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
|
3895
3896
|
},
|
|
3896
3897
|
annotations: content.annotations
|
|
3897
3898
|
});
|
|
3898
|
-
}),
|
|
3899
|
+
}), when({
|
|
3899
3900
|
type: "resource_link"
|
|
3900
3901
|
}, () => new UnsupportedByProtocol({
|
|
3901
3902
|
protocolVersion: protocolVersion2,
|
|
@@ -4112,7 +4113,7 @@ var protocol2 = /* @__PURE__ */ make13({
|
|
|
4112
4113
|
const result = yield* client["sampling/createMessage"](wireRequest).pipe(mapError(reverseError("sampling/createMessage")));
|
|
4113
4114
|
return yield* transcode(CreateMessage3.successSchema, CreateMessage.successSchema, result).pipe(mapError(() => unsupported2("sampling/createMessage", "Response is not representable by the canonical model")));
|
|
4114
4115
|
}),
|
|
4115
|
-
elicit: () =>
|
|
4116
|
+
elicit: () => fail5(unsupported2("elicitation/create", "Elicitation was introduced after this protocol revision"))
|
|
4116
4117
|
}),
|
|
4117
4118
|
projectNotification: (notification) => makeNotificationProjector({
|
|
4118
4119
|
supportsProgressMessage: true
|
|
@@ -4473,19 +4474,19 @@ var unsupported3 = (operation, reason) => new McpReverseOperationUnsupported({
|
|
|
4473
4474
|
protocolVersion: protocolVersion3,
|
|
4474
4475
|
reason
|
|
4475
4476
|
});
|
|
4476
|
-
var requireCapability3 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 :
|
|
4477
|
+
var requireCapability3 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 : fail5(unsupported3(operation, `Client did not advertise the ${capability} capability`));
|
|
4477
4478
|
var projectContent3 = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
4478
|
-
return
|
|
4479
|
-
type:
|
|
4480
|
-
}, (content) => content),
|
|
4481
|
-
type:
|
|
4479
|
+
return value(content).pipe(when({
|
|
4480
|
+
type: is("text", "resource_link")
|
|
4481
|
+
}, (content) => content), when({
|
|
4482
|
+
type: is("image", "audio")
|
|
4482
4483
|
}, (content) => ({
|
|
4483
4484
|
type: content.type,
|
|
4484
4485
|
mimeType: content.mimeType,
|
|
4485
4486
|
data: encode(content.data),
|
|
4486
4487
|
annotations: content.annotations,
|
|
4487
4488
|
_meta: content._meta
|
|
4488
|
-
})),
|
|
4489
|
+
})), when({
|
|
4489
4490
|
type: "resource"
|
|
4490
4491
|
}, (content) => {
|
|
4491
4492
|
const resource = content.resource;
|
|
@@ -5102,7 +5103,7 @@ var unsupported4 = (operation, reason) => new McpReverseOperationUnsupported({
|
|
|
5102
5103
|
protocolVersion: protocolVersion4,
|
|
5103
5104
|
reason
|
|
5104
5105
|
});
|
|
5105
|
-
var requireCapability4 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 :
|
|
5106
|
+
var requireCapability4 = (profile, operation, capability) => Object.hasOwn(profile.clientCapabilities, capability) && profile.clientCapabilities[capability] !== undefined ? void_3 : fail5(unsupported4(operation, `Client did not advertise the ${capability} capability`));
|
|
5106
5107
|
var resultRequiresSamplingTools = (result) => result.stopReason === "toolUse" || ("type" in result.content ? result.content.type === "tool_use" || result.content.type === "tool_result" : result.content.some((block) => block.type === "tool_use" || block.type === "tool_result"));
|
|
5107
5108
|
var hasElicitationModeCapability = (profile, mode) => {
|
|
5108
5109
|
const elicitation = profile.clientCapabilities.elicitation;
|
|
@@ -5111,17 +5112,17 @@ var hasElicitationModeCapability = (profile, mode) => {
|
|
|
5111
5112
|
return mode === "form" ? elicitation.form !== undefined || elicitation.url === undefined : elicitation.url !== undefined;
|
|
5112
5113
|
};
|
|
5113
5114
|
var projectContent4 = /* @__PURE__ */ fnUntraced(function* (content) {
|
|
5114
|
-
return
|
|
5115
|
-
type:
|
|
5116
|
-
}, (content) => content),
|
|
5117
|
-
type:
|
|
5115
|
+
return value(content).pipe(when({
|
|
5116
|
+
type: is("text", "resource_link")
|
|
5117
|
+
}, (content) => content), when({
|
|
5118
|
+
type: is("image", "audio")
|
|
5118
5119
|
}, (content) => ({
|
|
5119
5120
|
type: content.type,
|
|
5120
5121
|
mimeType: content.mimeType,
|
|
5121
5122
|
data: encode(content.data),
|
|
5122
5123
|
annotations: content.annotations,
|
|
5123
5124
|
_meta: content._meta
|
|
5124
|
-
})),
|
|
5125
|
+
})), when({
|
|
5125
5126
|
type: "resource"
|
|
5126
5127
|
}, (content) => {
|
|
5127
5128
|
const resource = content.resource;
|
|
@@ -5874,7 +5875,7 @@ class ServerNotificationRpcs6 extends (/* @__PURE__ */ make3(CancelledNotificati
|
|
|
5874
5875
|
var InputResponses2 = /* @__PURE__ */ Record(String3, JsonObject);
|
|
5875
5876
|
var decodeRequestMetadata = /* @__PURE__ */ decodeUnknownEffect2(RequestMetaObject);
|
|
5876
5877
|
var decodeCancellation = /* @__PURE__ */ decodeUnknownEffect2(CancelledNotification3.payloadSchema);
|
|
5877
|
-
var isJson = /* @__PURE__ */
|
|
5878
|
+
var isJson = /* @__PURE__ */ is2(Json);
|
|
5878
5879
|
var encodeImplementation = /* @__PURE__ */ encodeEffect(Implementation5);
|
|
5879
5880
|
var MAX_PENDING_SUBSCRIPTION_NOTIFICATIONS = 64;
|
|
5880
5881
|
var omitUndefined = (value) => {
|
|
@@ -5897,7 +5898,7 @@ var parameterHeaderMatches = (header, argument) => {
|
|
|
5897
5898
|
if (decoded === undefined) {
|
|
5898
5899
|
return false;
|
|
5899
5900
|
}
|
|
5900
|
-
return
|
|
5901
|
+
return value(argument).pipe(when(string, (argument) => decoded === argument), when(boolean, (argument) => decoded === String(argument)), when(number, (argument) => Number.isSafeInteger(argument) && decoded.trim().length > 0 && Number(decoded) === argument), orElse(() => false));
|
|
5901
5902
|
};
|
|
5902
5903
|
var profileFromRequestMetadata = /* @__PURE__ */ fnUntraced(function* (metadata) {
|
|
5903
5904
|
const requestMetadata = yield* decodeRequestMetadata(metadata);
|
|
@@ -5938,12 +5939,12 @@ var projectCallToolOutcome = /* @__PURE__ */ fnUntraced(function* (outcome, serv
|
|
|
5938
5939
|
var requiredCapabilitiesForInputRequests = (inputRequests, capabilities) => {
|
|
5939
5940
|
const required = {};
|
|
5940
5941
|
for (const request of Object.values(inputRequests ?? {})) {
|
|
5941
|
-
|
|
5942
|
+
value(request).pipe(when({
|
|
5942
5943
|
method: "roots/list"
|
|
5943
5944
|
}, () => {
|
|
5944
5945
|
if (capabilities.roots === undefined)
|
|
5945
5946
|
required.roots = {};
|
|
5946
|
-
}),
|
|
5947
|
+
}), when({
|
|
5947
5948
|
method: "sampling/createMessage"
|
|
5948
5949
|
}, (request) => {
|
|
5949
5950
|
const sampling = required.sampling ?? {};
|
|
@@ -5955,7 +5956,7 @@ var requiredCapabilitiesForInputRequests = (inputRequests, capabilities) => {
|
|
|
5955
5956
|
}
|
|
5956
5957
|
if (capabilities.sampling === undefined || Object.keys(sampling).length > 0)
|
|
5957
5958
|
required.sampling = sampling;
|
|
5958
|
-
}),
|
|
5959
|
+
}), when({
|
|
5959
5960
|
method: "elicitation/create"
|
|
5960
5961
|
}, (request) => {
|
|
5961
5962
|
const mode = request.params.mode === "url" ? "url" : "form";
|
|
@@ -5977,17 +5978,17 @@ var projectResourceContents3 = (resource) => omitUndefined({
|
|
|
5977
5978
|
blob: encode(resource.blob)
|
|
5978
5979
|
}
|
|
5979
5980
|
});
|
|
5980
|
-
var projectContent5 = /* @__PURE__ */ type().pipe(/* @__PURE__ */
|
|
5981
|
-
type: /* @__PURE__ */
|
|
5982
|
-
}, (content) => content), /* @__PURE__ */
|
|
5983
|
-
type: /* @__PURE__ */
|
|
5981
|
+
var projectContent5 = /* @__PURE__ */ type().pipe(/* @__PURE__ */ when({
|
|
5982
|
+
type: /* @__PURE__ */ is("text", "resource_link")
|
|
5983
|
+
}, (content) => content), /* @__PURE__ */ when({
|
|
5984
|
+
type: /* @__PURE__ */ is("image", "audio")
|
|
5984
5985
|
}, (content) => omitUndefined({
|
|
5985
5986
|
type: content.type,
|
|
5986
5987
|
mimeType: content.mimeType,
|
|
5987
5988
|
data: encode(content.data),
|
|
5988
5989
|
annotations: content.annotations,
|
|
5989
5990
|
_meta: content._meta
|
|
5990
|
-
})), /* @__PURE__ */
|
|
5991
|
+
})), /* @__PURE__ */ when({
|
|
5991
5992
|
type: "resource"
|
|
5992
5993
|
}, (content) => omitUndefined({
|
|
5993
5994
|
type: "resource",
|
|
@@ -6011,13 +6012,13 @@ var projectCompleteResult = /* @__PURE__ */ fnUntraced(function* (value, serverI
|
|
|
6011
6012
|
resultType: "complete"
|
|
6012
6013
|
};
|
|
6013
6014
|
});
|
|
6014
|
-
var matchedProtocolError = /* @__PURE__ */ type().pipe(/* @__PURE__ */
|
|
6015
|
+
var matchedProtocolError = /* @__PURE__ */ type().pipe(/* @__PURE__ */ tag("ResourceNotFound", (error) => new ProtocolError({
|
|
6015
6016
|
code: INVALID_PARAMS,
|
|
6016
6017
|
message: `Resource '${error.uri}' not found`,
|
|
6017
6018
|
data: {
|
|
6018
6019
|
uri: error.uri
|
|
6019
6020
|
}
|
|
6020
|
-
})), /* @__PURE__ */
|
|
6021
|
+
})), /* @__PURE__ */ tag("ToolNotFound", "InvalidToolInput", "InvalidToolContinuation", "ToolExecutionError", "UnsupportedByProtocol", ProtocolError.fromTool), /* @__PURE__ */ orElse(ProtocolError.fromFeature));
|
|
6021
6022
|
var projectError = (error) => {
|
|
6022
6023
|
const protocolError = matchedProtocolError(error);
|
|
6023
6024
|
return McpError3.make({
|
|
@@ -6151,7 +6152,7 @@ var makeHandlers = (core, _lifecycle, context) => {
|
|
|
6151
6152
|
continue;
|
|
6152
6153
|
}
|
|
6153
6154
|
const notification = event.notification;
|
|
6154
|
-
const rpc =
|
|
6155
|
+
const rpc = value(notification).pipe(tags({
|
|
6155
6156
|
ToolsChanged: () => honored.toolsListChanged === true ? ToolListChangedNotification3 : undefined,
|
|
6156
6157
|
PromptsChanged: () => honored.promptsListChanged === true ? PromptListChangedNotification3 : undefined,
|
|
6157
6158
|
ResourcesChanged: () => honored.resourcesListChanged === true ? ResourceListChangedNotification3 : undefined,
|
|
@@ -6396,9 +6397,9 @@ var protocol5 = /* @__PURE__ */ make13({
|
|
|
6396
6397
|
handlerRpcs,
|
|
6397
6398
|
makeHandlers,
|
|
6398
6399
|
toReverseClient: () => ({
|
|
6399
|
-
listRoots: () =>
|
|
6400
|
-
createMessage: () =>
|
|
6401
|
-
elicit: () =>
|
|
6400
|
+
listRoots: () => fail5(unsupported5("roots/list")),
|
|
6401
|
+
createMessage: () => fail5(unsupported5("sampling/createMessage")),
|
|
6402
|
+
elicit: () => fail5(unsupported5("elicitation/create"))
|
|
6402
6403
|
}),
|
|
6403
6404
|
projectNotification: (notification) => isSubscriptionServerNotification(notification) ? succeed6(undefined) : makeNotificationProjector({
|
|
6404
6405
|
supportsProgressMessage: true
|
|
@@ -7247,7 +7248,7 @@ var makeNoSerialization2 = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
7247
7248
|
const spanPrefix = options.spanPrefix ?? "RpcServer";
|
|
7248
7249
|
const concurrency = options.concurrency ?? "unbounded";
|
|
7249
7250
|
const disableFatalDefects = options.disableFatalDefects ?? false;
|
|
7250
|
-
const services = yield*
|
|
7251
|
+
const services = yield* context2();
|
|
7251
7252
|
const scope = get(services, Scope);
|
|
7252
7253
|
const trackFiber = runIn(forkUnsafe(scope, "parallel"));
|
|
7253
7254
|
const concurrencySemaphore = concurrency === "unbounded" ? undefined : yield* make(concurrency);
|
|
@@ -7390,7 +7391,7 @@ var makeNoSerialization2 = /* @__PURE__ */ fnUntraced(function* (group, options)
|
|
|
7390
7391
|
exit
|
|
7391
7392
|
});
|
|
7392
7393
|
}
|
|
7393
|
-
} else if (!disableFatalDefects && hasDies(exit.cause) && !
|
|
7394
|
+
} else if (!disableFatalDefects && hasDies(exit.cause) && !hasInterrupts(exit.cause)) {
|
|
7394
7395
|
write = sendDefect(client, squash(exit.cause));
|
|
7395
7396
|
} else {
|
|
7396
7397
|
write = options.onFromServer({
|
|
@@ -7552,7 +7553,7 @@ var make19 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
|
7552
7553
|
supportsTransferables
|
|
7553
7554
|
} = yield* Protocol2;
|
|
7554
7555
|
const encodeDefectUnsafe = encodeSync(codecFor(Defect()));
|
|
7555
|
-
const services = yield*
|
|
7556
|
+
const services = yield* context2();
|
|
7556
7557
|
const scope = yield* make6();
|
|
7557
7558
|
const server = yield* makeNoSerialization2(group, {
|
|
7558
7559
|
...options,
|
|
@@ -7744,7 +7745,7 @@ var makeProtocolStdio = /* @__PURE__ */ gen(function* () {
|
|
|
7744
7745
|
startImmediately: true
|
|
7745
7746
|
})), forkScoped);
|
|
7746
7747
|
return {
|
|
7747
|
-
disconnects: yield*
|
|
7748
|
+
disconnects: yield* make11(),
|
|
7748
7749
|
send(_clientId, response) {
|
|
7749
7750
|
const responseEncoded = parser.encode(response);
|
|
7750
7751
|
if (responseEncoded === undefined) {
|
|
@@ -7770,7 +7771,7 @@ var layerProtocolStdio = /* @__PURE__ */ effect(Protocol2, makeProtocolStdio);
|
|
|
7770
7771
|
// node_modules/effect/dist/ai/McpServer.js
|
|
7771
7772
|
var internalState = /* @__PURE__ */ new WeakMap;
|
|
7772
7773
|
var BroadcastServerNotificationRpcs = /* @__PURE__ */ ServerNotificationRpcs.omit("notifications/elicitation/complete");
|
|
7773
|
-
var isLoggingLevel = /* @__PURE__ */
|
|
7774
|
+
var isLoggingLevel = /* @__PURE__ */ is2(LoggingLevel);
|
|
7774
7775
|
var toInternalServerNotification = (message) => {
|
|
7775
7776
|
switch (message.tag) {
|
|
7776
7777
|
case "notifications/cancelled":
|
|
@@ -7827,12 +7828,12 @@ var provideInvocationContext = (effect, invocation) => {
|
|
|
7827
7828
|
|
|
7828
7829
|
class McpServer extends (/* @__PURE__ */ Service2()("effect/ai/McpServer")) {
|
|
7829
7830
|
static make = /* @__PURE__ */ gen(function* () {
|
|
7830
|
-
const internalCore = yield*
|
|
7831
|
+
const internalCore = yield* make8;
|
|
7831
7832
|
const tools = empty2();
|
|
7832
7833
|
const resources = [];
|
|
7833
7834
|
const resourceTemplates = [];
|
|
7834
7835
|
const prompts = [];
|
|
7835
|
-
const notificationsQueue = yield*
|
|
7836
|
+
const notificationsQueue = yield* make11();
|
|
7836
7837
|
const notificationDelivery = {
|
|
7837
7838
|
consumers: 0
|
|
7838
7839
|
};
|
|
@@ -7915,11 +7916,11 @@ class McpServer extends (/* @__PURE__ */ Service2()("effect/ai/McpServer")) {
|
|
|
7915
7916
|
clientInfo: profile.clientInfo
|
|
7916
7917
|
}),
|
|
7917
7918
|
handle: (call, invocation) => provideInvocationContext(options.handle(call.arguments), invocation).pipe(catchTags({
|
|
7918
|
-
InternalError: (error) =>
|
|
7919
|
+
InternalError: (error) => fail5(new ToolExecutionError({
|
|
7919
7920
|
name: options.tool.name,
|
|
7920
7921
|
message: error.message
|
|
7921
7922
|
})),
|
|
7922
|
-
InvalidParams: (error) =>
|
|
7923
|
+
InvalidParams: (error) => fail5(new (invocation.requestContext.requestState === undefined && invocation.requestContext.inputResponses === undefined ? InvalidToolInput : InvalidToolContinuation)({
|
|
7923
7924
|
name: options.tool.name,
|
|
7924
7925
|
message: error.message
|
|
7925
7926
|
}))
|
|
@@ -8026,7 +8027,7 @@ class McpServer extends (/* @__PURE__ */ Service2()("effect/ai/McpServer")) {
|
|
|
8026
8027
|
}),
|
|
8027
8028
|
findResource: (uri) => gen(function* () {
|
|
8028
8029
|
const client = yield* McpServerClient;
|
|
8029
|
-
return yield* internalCore.resources.read(uri, invocationFromClient(client)).pipe(catchTag("ResourceNotFound", (error) =>
|
|
8030
|
+
return yield* internalCore.resources.read(uri, invocationFromClient(client)).pipe(catchTag("ResourceNotFound", (error) => fail5(new InvalidParams({
|
|
8030
8031
|
message: `Resource '${error.uri}' not found`
|
|
8031
8032
|
}))));
|
|
8032
8033
|
}),
|
|
@@ -8662,7 +8663,7 @@ var mcpStdioSerialization = (protocols) => {
|
|
|
8662
8663
|
}
|
|
8663
8664
|
});
|
|
8664
8665
|
};
|
|
8665
|
-
var isEncodedMcpFailureCause = /* @__PURE__ */
|
|
8666
|
+
var isEncodedMcpFailureCause = /* @__PURE__ */ is2(/* @__PURE__ */ TaggedStruct("Cause", {
|
|
8666
8667
|
data: /* @__PURE__ */ Tuple([/* @__PURE__ */ TaggedStruct("Fail", {
|
|
8667
8668
|
error: /* @__PURE__ */ toEncoded2(McpError)
|
|
8668
8669
|
})])
|
|
@@ -8872,10 +8873,10 @@ registerMcpTools({
|
|
|
8872
8873
|
}
|
|
8873
8874
|
const changes = getObject2(set);
|
|
8874
8875
|
if (!changes) {
|
|
8875
|
-
return
|
|
8876
|
+
return fail5(new Error('set must be an object, for example { "grouping": "shared" }'));
|
|
8876
8877
|
}
|
|
8877
8878
|
if ("autoUpdate" in changes) {
|
|
8878
|
-
return
|
|
8879
|
+
return fail5(new Error("autoUpdate can't be read or changed from MCP. The user can change it with `browse settings set autoUpdate=...` or the extension's options page; `status` reports the current value."));
|
|
8879
8880
|
}
|
|
8880
8881
|
return ctx.relay.settingsSet(changes).pipe(map5((result) => ({ ...result, settings: agentSettings(result.settings) })));
|
|
8881
8882
|
}
|
|
@@ -8889,7 +8890,7 @@ registerMcpTools({
|
|
|
8889
8890
|
build: (ctx) => [
|
|
8890
8891
|
{
|
|
8891
8892
|
name: "execute",
|
|
8892
|
-
description: `Execute Playwright JavaScript against the browse session. Code runs in a
|
|
8893
|
+
description: `Execute Playwright JavaScript against the browse session. Code runs in a restricted JavaScript realm on the relay without process, require, import(), fs, child_process, http/https or Node fetch; save and read files with the files helper inside the execute file roots, and cookie access is limited to the session's pages. Synchronous code stops after about 2 seconds. It is not a security boundary, so treat code as running as the user. The result includes console logs, warnings, a bounded execution-context diagnostic when relevant, and an aftermath summary (URL movement, navigations, error counts, handoffs, and a bot challenge or block page when one appears: hand interactive ones to the user with handoff(), never solve or retry-loop them).`,
|
|
8893
8894
|
inputSchema: objectSchema({
|
|
8894
8895
|
code: {
|
|
8895
8896
|
type: "string",
|
|
@@ -9028,7 +9029,7 @@ registerMcpTools({
|
|
|
9028
9029
|
const outputPath = optionalStringField(object, "outputPath");
|
|
9029
9030
|
const secrets = optionalStringField(object, "secrets");
|
|
9030
9031
|
if (!outputPath && !secrets) {
|
|
9031
|
-
return yield*
|
|
9032
|
+
return yield* fail5(new Error("network stop requires outputPath, secrets, or both"));
|
|
9032
9033
|
}
|
|
9033
9034
|
return {
|
|
9034
9035
|
action,
|
|
@@ -9051,7 +9052,7 @@ registerMcpTools({
|
|
|
9051
9052
|
yield* ensureExtensionConnected({ relay: ctx.relay, sessionId, waitForReconnect: true });
|
|
9052
9053
|
const content = optionalStringField(object, "content");
|
|
9053
9054
|
if (content !== undefined && content !== "embed" && content !== "omit") {
|
|
9054
|
-
return yield*
|
|
9055
|
+
return yield* fail5(new Error("content must be embed or omit"));
|
|
9055
9056
|
}
|
|
9056
9057
|
const urlFilter = optionalStringField(object, "urlFilter");
|
|
9057
9058
|
const resourceTypes = optionalStringArrayField(object, "resourceTypes");
|
|
@@ -9134,11 +9135,11 @@ registerMcpTools({
|
|
|
9134
9135
|
}
|
|
9135
9136
|
const mode = optionalStringField(object, "mode");
|
|
9136
9137
|
if (mode !== undefined && mode !== "auto" && mode !== "tab-capture" && mode !== "cdp") {
|
|
9137
|
-
return yield*
|
|
9138
|
+
return yield* fail5(new Error("mode must be auto, tab-capture, or cdp"));
|
|
9138
9139
|
}
|
|
9139
9140
|
const frameRate = optionalPositiveIntegerField(object, "frameRate");
|
|
9140
9141
|
if (frameRate !== undefined && frameRate > 60)
|
|
9141
|
-
return yield*
|
|
9142
|
+
return yield* fail5(new Error("frameRate must be at most 60"));
|
|
9142
9143
|
const maxDurationMs = optionalPositiveIntegerField(object, "maxDurationMs");
|
|
9143
9144
|
const audio = optionalBooleanField(object, "audio");
|
|
9144
9145
|
const cursor = optionalBooleanField(object, "cursor");
|
|
@@ -9394,7 +9395,7 @@ registerMcpTools({
|
|
|
9394
9395
|
const sessionId = ctx.resolveSessionId(input);
|
|
9395
9396
|
const allowedOrigins = requireObject(input).allowedOrigins;
|
|
9396
9397
|
if (!Array.isArray(allowedOrigins) || !allowedOrigins.every((item) => isString(item))) {
|
|
9397
|
-
return yield*
|
|
9398
|
+
return yield* fail5(new Error("allowedOrigins must be an array of strings"));
|
|
9398
9399
|
}
|
|
9399
9400
|
return { session: yield* ctx.relay.sessionAllowlist(sessionId, allowedOrigins) };
|
|
9400
9401
|
})
|
|
@@ -9575,7 +9576,7 @@ var registerTools = gen(function* () {
|
|
|
9575
9576
|
annotations: empty(),
|
|
9576
9577
|
handle: (payload) => {
|
|
9577
9578
|
const requiresRelay = typeof spec.requiresRelayCompatibility === "function" ? spec.requiresRelayCompatibility(payload) : spec.requiresRelayCompatibility !== false;
|
|
9578
|
-
const operation = requiresRelay ? ensureRelay({ relay }).pipe(flatMap3((readiness) => readiness.buildProblem ?
|
|
9579
|
+
const operation = requiresRelay ? ensureRelay({ relay }).pipe(flatMap3((readiness) => readiness.buildProblem ? fail5(new Error(readiness.buildProblem)) : spec.handle(payload))) : spec.handle(payload);
|
|
9579
9580
|
return operation.pipe(match3({
|
|
9580
9581
|
onFailure: (error) => toolResult({ text: mcpErrorMessage2(spec.name, error.message), isError: true }),
|
|
9581
9582
|
onSuccess: (value) => spec.result ? spec.result(value) : toolResultForValue2(value, spec.outputSchema ? { outputSchema: spec.outputSchema } : {})
|