@opencode/browse 0.0.17-dev.185 → 0.0.17-dev.188
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/{Runtime-xss8qan1.mjs → Runtime-hmy7zww1.mjs} +1 -1
- package/dist/{cli-fk82qmwb.mjs → cli-5ezftnv2.mjs} +39 -222
- package/dist/cli.mjs +18 -18
- package/dist/{helpers-v2zmfak2.mjs → helpers-k5ybc61c.mjs} +1 -1
- package/dist/{index-gjq7chrk.mjs → index-37ssbv86.mjs} +2 -2
- package/dist/{legacy-runtime-rvfsgmzn.mjs → legacy-runtime-j0sw664c.mjs} +10 -9
- package/dist/{main-m45zegrn.mjs → main-0h387a1q.mjs} +1 -6
- package/dist/{main-jeta10c6.mjs → main-3514h33n.mjs} +11 -11
- package/dist/{main-qwf4vk41.mjs → main-4qq4n32k.mjs} +2 -2
- package/dist/{main-1b344j42.mjs → main-66fy08h5.mjs} +8 -25
- package/dist/{main-x7takqns.mjs → main-7h3v45ag.mjs} +26 -17
- package/dist/{main-t2jyedkv.mjs → main-7v4scg8t.mjs} +8 -6
- package/dist/{main-6hvv25x8.mjs → main-8xd753k5.mjs} +1 -1
- package/dist/{main-akpa411k.mjs → main-9q9919e3.mjs} +118 -2
- package/dist/{main-2wrvr3gc.mjs → main-ba028a85.mjs} +34 -27
- package/dist/{main-sbqypb33.mjs → main-d8km89cz.mjs} +2 -2
- package/dist/main-dab23et4.mjs +17 -0
- package/dist/{main-9frwnsnf.mjs → main-j4kq90pw.mjs} +1 -1
- package/dist/{main-3ewrhbqw.mjs → main-kzcrfvmh.mjs} +4 -4
- package/dist/{main-z32979g4.mjs → main-m9n50a86.mjs} +41 -162
- package/dist/{main-ndmgt6k5.mjs → main-mvjg1jye.mjs} +5 -46
- package/dist/{main-xjskgtdr.mjs → main-pqxrvknr.mjs} +2 -2
- package/dist/main-qrqem3fy.mjs +4 -0
- package/dist/{main-xct4r41x.mjs → main-svhdexdh.mjs} +4 -4
- package/dist/main-tryp3jph.mjs +141 -0
- package/dist/{mcp-2xkjfnqz.mjs → mcp-jh4atts2.mjs} +37 -140
- package/dist/{migrate-fygxtp2g.mjs → migrate-r433scvg.mjs} +14 -7
- package/dist/{relay-mbjgxbtr.mjs → relay-1epy67be.mjs} +648 -372
- package/dist/remove-stored-secrets-wy3pakjj.mjs +6 -0
- package/dist/{runtime-update-ngg3m888.mjs → runtime-update-ww2pejn2.mjs} +13 -11
- package/dist/{setup-t0pbhmzh.mjs → setup-n1hpbkz2.mjs} +27 -49
- package/dist/{skill-text-1rg5b5np.mjs → skill-text-0ndr12dz.mjs} +7 -31
- package/dist/{update-heze6vjn.mjs → update-z7qvagkc.mjs} +3 -3
- package/dist/{version-x1kkvpqn.mjs → version-2123c138.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +7 -31
- package/dist/main-6my7bmf1.mjs +0 -1324
- package/dist/main-ew8jna3e.mjs +0 -4
- package/dist/supervisor-wrrnbfhw.mjs +0 -269
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
makeRunMain2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-j4kq90pw.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Error2,
|
|
6
6
|
TaggedError,
|
|
7
7
|
tag2,
|
|
8
8
|
Error3
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-8xd753k5.mjs";
|
|
10
|
+
import {
|
|
11
|
+
__export
|
|
12
|
+
} from "./main-j98fzrvv.mjs";
|
|
10
13
|
import {
|
|
11
14
|
pipeArguments,
|
|
12
15
|
dual,
|
|
@@ -187,10 +190,7 @@ import {
|
|
|
187
190
|
fnUntraced,
|
|
188
191
|
clockWith,
|
|
189
192
|
effectify
|
|
190
|
-
} from "./main-
|
|
191
|
-
import {
|
|
192
|
-
__export
|
|
193
|
-
} from "./main-j98fzrvv.mjs";
|
|
193
|
+
} from "./main-0h387a1q.mjs";
|
|
194
194
|
|
|
195
195
|
// node_modules/@effect/platform-node/dist/NodeHttpClient.js
|
|
196
196
|
var exports_NodeHttpClient = {};
|
|
@@ -1734,7 +1734,7 @@ var decodeText = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, option
|
|
|
1734
1734
|
var splitLines2 = (self) => self.channel.pipe(pipeTo(splitLines()), fromChannel3);
|
|
1735
1735
|
var ensuring3 = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel3(ensuring2(self.channel, finalizer)));
|
|
1736
1736
|
var provideContext = /* @__PURE__ */ dual(2, (self, context) => fromChannel3(provideContext3(self.channel, context)));
|
|
1737
|
-
var
|
|
1737
|
+
var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => sink.transform(upstream, scope)), map6(([a]) => a))));
|
|
1738
1738
|
var runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
|
|
1739
1739
|
for (let i = 0;i < chunk.length; i++) {
|
|
1740
1740
|
acc.push(chunk[i]);
|
|
@@ -3184,7 +3184,7 @@ var sendBody = (nodeRequest, request, body) => suspend2(() => {
|
|
|
3184
3184
|
});
|
|
3185
3185
|
}
|
|
3186
3186
|
case "Stream": {
|
|
3187
|
-
return
|
|
3187
|
+
return run(mapError3(body.stream, (cause) => new HttpClientError({
|
|
3188
3188
|
reason: new EncodeError({
|
|
3189
3189
|
request,
|
|
3190
3190
|
cause
|
|
@@ -4188,7 +4188,7 @@ var make17 = /* @__PURE__ */ gen(function* () {
|
|
|
4188
4188
|
});
|
|
4189
4189
|
}
|
|
4190
4190
|
if (config.stream) {
|
|
4191
|
-
yield* forkScoped(
|
|
4191
|
+
yield* forkScoped(run(config.stream, sink));
|
|
4192
4192
|
}
|
|
4193
4193
|
inputSinks.set(fd, sink);
|
|
4194
4194
|
break;
|
|
@@ -4228,7 +4228,7 @@ var make17 = /* @__PURE__ */ gen(function* () {
|
|
|
4228
4228
|
});
|
|
4229
4229
|
}
|
|
4230
4230
|
if (isStream(config.stream)) {
|
|
4231
|
-
return as(forkScoped(
|
|
4231
|
+
return as(forkScoped(run(config.stream, sink)), sink);
|
|
4232
4232
|
}
|
|
4233
4233
|
return succeed6(sink);
|
|
4234
4234
|
});
|
|
@@ -5355,4 +5355,4 @@ var layer13 = layer12;
|
|
|
5355
5355
|
|
|
5356
5356
|
// node_modules/@effect/platform-node/dist/NodeServices.js
|
|
5357
5357
|
var layer2 = /* @__PURE__ */ provideMerge(layer4, /* @__PURE__ */ mergeAll(layer8, layer6, layer10, layer, layer13));
|
|
5358
|
-
export { filter, empty, make4, value2, empty2, fromInput, fromRecordUnsafe, set, setAll, merge, remove, join, interrupt, getCurrent, runIn, makeUnsafe2, make5, set2, Empty, make6, append, prepend, takeAll, take, remove2, make7, bounded, dropping, offer, offerUnsafe, offerAll, failCause, end, shutdownUnsafe, takeAll2, take2, isStream, fromQueue, unwrap, provideContext,
|
|
5358
|
+
export { filter, empty, make4, value2, empty2, fromInput, fromRecordUnsafe, set, setAll, merge, remove, join, interrupt, getCurrent, runIn, makeUnsafe2, make5, set2, Empty, make6, append, prepend, takeAll, take, remove2, make7, bounded, dropping, offer, offerUnsafe, offerAll, failCause, end, shutdownUnsafe, takeAll2, take2, isStream, fromQueue, unwrap, provideContext, run, runForEach, runForEachArray, FileSystem, Path, Stdio, QuitError, isQuitError, Terminal, empty3, jsonUnsafe, get, post, setHeader, bodyJson, HttpClient, layerNodeHttp, exports_NodeHttpClient, runMain, exports_NodeRuntime, layer, exports_NodeStdio, layer2, exports_NodeServices };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync,
|
|
3
3
|
defaultPort2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-mvjg1jye.mjs";
|
|
5
5
|
import {
|
|
6
6
|
stateRoot
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-tryp3jph.mjs";
|
|
8
8
|
|
|
9
9
|
// src/relay/port.ts
|
|
10
10
|
import fs from "node:fs";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cliCommand
|
|
3
|
-
} from "./main-z32979g4.mjs";
|
|
4
1
|
import {
|
|
5
2
|
SessionDeleted,
|
|
6
3
|
ExecuteLogEntry,
|
|
@@ -8,18 +5,20 @@ import {
|
|
|
8
5
|
ExecuteAftermath,
|
|
9
6
|
ExtensionStatus,
|
|
10
7
|
RelayVersion,
|
|
11
|
-
AuthProfileSummary,
|
|
12
8
|
RecordingQuality,
|
|
13
9
|
SettingsGetResponse,
|
|
14
10
|
SettingsSetResponse,
|
|
15
11
|
parseTargetSelection2,
|
|
16
12
|
getObject2,
|
|
17
13
|
getString2
|
|
18
|
-
} from "./main-
|
|
14
|
+
} from "./main-mvjg1jye.mjs";
|
|
15
|
+
import {
|
|
16
|
+
cliCommand
|
|
17
|
+
} from "./main-tryp3jph.mjs";
|
|
19
18
|
import {
|
|
20
19
|
isStream,
|
|
21
20
|
provideContext
|
|
22
|
-
} from "./main-
|
|
21
|
+
} from "./main-3514h33n.mjs";
|
|
23
22
|
import {
|
|
24
23
|
TaggedError,
|
|
25
24
|
passthrough,
|
|
@@ -65,7 +64,7 @@ import {
|
|
|
65
64
|
toJsonSchemaDocument,
|
|
66
65
|
Json,
|
|
67
66
|
JsonObject
|
|
68
|
-
} from "./main-
|
|
67
|
+
} from "./main-8xd753k5.mjs";
|
|
69
68
|
import {
|
|
70
69
|
pipeArguments,
|
|
71
70
|
identity,
|
|
@@ -101,7 +100,7 @@ import {
|
|
|
101
100
|
contextWith,
|
|
102
101
|
provide3,
|
|
103
102
|
fnUntraced
|
|
104
|
-
} from "./main-
|
|
103
|
+
} from "./main-0h387a1q.mjs";
|
|
105
104
|
|
|
106
105
|
// node_modules/effect/dist/PrimaryKey.js
|
|
107
106
|
var symbol = "~effect/PrimaryKey";
|
|
@@ -1366,9 +1365,6 @@ var sessionSchemaProperty = {
|
|
|
1366
1365
|
description: "Optional session id. Defaults to your current session."
|
|
1367
1366
|
};
|
|
1368
1367
|
var sessionAliasSchemaProperty = { type: "string", description: "Same as id." };
|
|
1369
|
-
var sessionOnlyInputSchema = objectSchema({
|
|
1370
|
-
session: sessionSchemaProperty
|
|
1371
|
-
});
|
|
1372
1368
|
var ExecuteToolOutput = Struct({
|
|
1373
1369
|
session: String3,
|
|
1374
1370
|
value: optionalKey(Unknown),
|
|
@@ -1409,14 +1405,10 @@ var NetworkToolOutput = Struct({
|
|
|
1409
1405
|
urlFilter: optionalKey(String3),
|
|
1410
1406
|
resourceTypes: optionalKey(ArraySchema(String3)),
|
|
1411
1407
|
content: optionalKey(Literals(["omit", "embed"])),
|
|
1412
|
-
secrets: optionalKey(String3),
|
|
1413
1408
|
endsAt: optionalKey(String3),
|
|
1414
1409
|
ended: optionalKey(String3),
|
|
1415
1410
|
stoppedAt: optionalKey(String3),
|
|
1416
1411
|
outputPath: optionalKey(String3),
|
|
1417
|
-
authProfile: optionalKey(AuthProfileSummary),
|
|
1418
|
-
updatedSecretRefs: optionalKey(ArraySchema(String3)),
|
|
1419
|
-
observedSecretRefs: optionalKey(ArraySchema(String3)),
|
|
1420
1412
|
endpoints: optionalKey(ArraySchema(Struct({
|
|
1421
1413
|
method: String3,
|
|
1422
1414
|
url: String3,
|
|
@@ -1484,15 +1476,6 @@ var SettingsToolOutput = Struct({
|
|
|
1484
1476
|
overridden: optionalKey(SettingsSetResponse.fields.overridden),
|
|
1485
1477
|
message: optionalKey(SettingsSetResponse.fields.message)
|
|
1486
1478
|
});
|
|
1487
|
-
var SecretsListToolOutput = Struct({
|
|
1488
|
-
secrets: ArraySchema(Struct({
|
|
1489
|
-
name: String3,
|
|
1490
|
-
kind: Literals(["password", "totp"]),
|
|
1491
|
-
allowedOrigins: ArraySchema(String3),
|
|
1492
|
-
createdAt: String3,
|
|
1493
|
-
updatedAt: String3
|
|
1494
|
-
}))
|
|
1495
|
-
});
|
|
1496
1479
|
function toolOutputJson(schema) {
|
|
1497
1480
|
const document = toJsonSchemaDocument(schema);
|
|
1498
1481
|
const json = Object.keys(document.definitions).length === 0 ? document.schema : { ...document.schema, $defs: document.definitions };
|
|
@@ -1768,4 +1751,4 @@ function toolResult(options) {
|
|
|
1768
1751
|
});
|
|
1769
1752
|
}
|
|
1770
1753
|
|
|
1771
|
-
export {
|
|
1754
|
+
export { isStreamSchema, getStreamSchemas, ClientAbort, ServerClient, make, exitSchema, isWrapper, make2, Implementation, ClientCapabilities, INVALID_REQUEST_ERROR_CODE, METHOD_NOT_FOUND_ERROR_CODE, INVALID_PARAMS_ERROR_CODE, INTERNAL_ERROR_CODE, HEADER_MISMATCH_ERROR_CODE, ParseError, InvalidRequest, MethodNotFound, InvalidParams, InternalError, McpError, Ping, Initialize, CancelledNotification, ProgressNotification, ResourceListChangedNotification, ResourceUpdatedNotification, Prompt, TextContent, PromptListChangedNotification, Tool, CallToolResult, ToolListChangedNotification, LoggingLevel, LoggingMessageNotification, CreateMessage, ListRootsResult, ListRoots, Elicit, McpReverseOperationUnsupported, McpReverseOperationError, McpRequestContext, McpServerClient, McpServerClientMiddleware, ServerNotificationRpcs, EnabledWhen, settingKeys, settingSpecs, securityVariables, SettingsInputError, parseSettingChanges, settingsFromExtension, settingsToExtension, describeSettings, describeChanges, formatSettings, mcpUpdateNote2, objectSchema, valuesSchema, emptyInputSchema, sessionSchemaProperty, sessionAliasSchemaProperty, StatusToolOutput, CurrentSessionToolOutput, SessionDeleteToolOutput, NetworkToolOutput, RecordingToolOutput, FlightRecorderToolOutput, agentSettingKeys, SettingsToolOutput, toolOutputJson, executeToolResult, ensureSessionExists, parseExecuteArguments, parseAdoptArguments, requiredStringField, requiredAction, optionalStringField, optionalBooleanField, optionalPositiveIntegerField, optionalStringArrayField, requireObject, toolResultForValue2, mcpErrorMessage2, toolResult };
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-qrqem3fy.mjs";
|
|
4
|
+
import {
|
|
5
|
+
unpackedExtensionId,
|
|
6
|
+
npmGlobalRoot,
|
|
7
|
+
installedVersion,
|
|
8
|
+
runCommand
|
|
9
|
+
} from "./main-m9n50a86.mjs";
|
|
10
|
+
import {
|
|
11
|
+
writeStdout
|
|
12
|
+
} from "./main-tk4axre7.mjs";
|
|
13
|
+
import {
|
|
14
|
+
defaultPort2
|
|
15
|
+
} from "./main-mvjg1jye.mjs";
|
|
16
|
+
import {
|
|
17
|
+
formatPairingCode
|
|
18
|
+
} from "./main-d8km89cz.mjs";
|
|
4
19
|
import {
|
|
5
20
|
configRoot2,
|
|
6
21
|
dataRoot,
|
|
@@ -17,21 +32,8 @@ import {
|
|
|
17
32
|
storeConfig,
|
|
18
33
|
devExtension,
|
|
19
34
|
devExtensionFolder,
|
|
20
|
-
storeUrl
|
|
21
|
-
|
|
22
|
-
npmGlobalRoot,
|
|
23
|
-
installedVersion,
|
|
24
|
-
runCommand
|
|
25
|
-
} from "./main-z32979g4.mjs";
|
|
26
|
-
import {
|
|
27
|
-
writeStdout
|
|
28
|
-
} from "./main-tk4axre7.mjs";
|
|
29
|
-
import {
|
|
30
|
-
defaultPort2
|
|
31
|
-
} from "./main-ndmgt6k5.mjs";
|
|
32
|
-
import {
|
|
33
|
-
formatPairingCode
|
|
34
|
-
} from "./main-sbqypb33.mjs";
|
|
35
|
+
storeUrl
|
|
36
|
+
} from "./main-tryp3jph.mjs";
|
|
35
37
|
import {
|
|
36
38
|
__toESM,
|
|
37
39
|
__commonJS,
|
|
@@ -11287,7 +11289,14 @@ function ownedMcp(server, entry) {
|
|
|
11287
11289
|
}
|
|
11288
11290
|
function mergedMcpServer(existing, command, runtime) {
|
|
11289
11291
|
const environment = typeof existing?.environment === "object" && existing.environment !== null && !Array.isArray(existing.environment) ? existing.environment : {};
|
|
11290
|
-
return {
|
|
11292
|
+
return {
|
|
11293
|
+
...existing,
|
|
11294
|
+
type: "local",
|
|
11295
|
+
command,
|
|
11296
|
+
cwd: "~",
|
|
11297
|
+
pool: true,
|
|
11298
|
+
environment: { ...environment, OPENCODE_BROWSER_RUNTIME: runtime }
|
|
11299
|
+
};
|
|
11291
11300
|
}
|
|
11292
11301
|
function configureMcp(file, entry, previousEntry) {
|
|
11293
11302
|
const existing = mcpServers(file)[MCP_NAME];
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
cacheRoot,
|
|
3
|
-
compiledBinary,
|
|
4
|
-
checkoutRoot,
|
|
5
|
-
cliCommand,
|
|
6
2
|
unpackedReloadAdvice,
|
|
7
3
|
installedRuntime2,
|
|
8
4
|
autoUpdateStatus,
|
|
9
5
|
updateAvailable
|
|
10
|
-
} from "./main-
|
|
6
|
+
} from "./main-m9n50a86.mjs";
|
|
7
|
+
import {
|
|
8
|
+
cacheRoot,
|
|
9
|
+
compiledBinary,
|
|
10
|
+
checkoutRoot,
|
|
11
|
+
cliCommand
|
|
12
|
+
} from "./main-tryp3jph.mjs";
|
|
11
13
|
|
|
12
14
|
// src/update.ts
|
|
13
15
|
import { execFile, spawnSync } from "node:child_process";
|
|
@@ -313,7 +315,7 @@ function runUpdate(args, deps) {
|
|
|
313
315
|
async function runUpdateCommand2(args) {
|
|
314
316
|
const log = (line) => process.stdout.write(line + `
|
|
315
317
|
`);
|
|
316
|
-
const { runInstalledUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runInstalledUpdate } = await import("./runtime-update-ww2pejn2.mjs");
|
|
317
319
|
if (await runInstalledUpdate(args))
|
|
318
320
|
return;
|
|
319
321
|
if (compiledBinary()) {
|
|
@@ -4,18 +4,134 @@ import {
|
|
|
4
4
|
isString,
|
|
5
5
|
isNumber,
|
|
6
6
|
isBoolean,
|
|
7
|
+
withFiber,
|
|
7
8
|
succeed,
|
|
8
9
|
fail2,
|
|
9
10
|
isResult,
|
|
10
11
|
isSuccess,
|
|
12
|
+
getCurrentFiber,
|
|
13
|
+
succeed2,
|
|
14
|
+
sync,
|
|
15
|
+
suspend,
|
|
16
|
+
succeedNone,
|
|
17
|
+
void_,
|
|
18
|
+
callback,
|
|
19
|
+
asSome,
|
|
20
|
+
flatMap2,
|
|
21
|
+
onExitPrimitive,
|
|
22
|
+
uninterruptibleMask,
|
|
11
23
|
ClockRef,
|
|
12
24
|
currentTimeMillis2
|
|
13
|
-
} from "./main-
|
|
25
|
+
} from "./main-0h387a1q.mjs";
|
|
14
26
|
|
|
15
27
|
// node_modules/effect/dist/Clock.js
|
|
16
28
|
var Clock = ClockRef;
|
|
17
29
|
var currentTimeMillis = currentTimeMillis2;
|
|
18
30
|
|
|
31
|
+
// node_modules/effect/dist/Semaphore.js
|
|
32
|
+
var makeUnsafe = (permits) => new SemaphoreImpl(permits);
|
|
33
|
+
var waitForPermits = (self, n, effect) => callback((resume) => {
|
|
34
|
+
if (self.free >= n)
|
|
35
|
+
return resume(effect);
|
|
36
|
+
const observer = () => {
|
|
37
|
+
if (self.free < n)
|
|
38
|
+
return;
|
|
39
|
+
self.waiters.delete(observer);
|
|
40
|
+
resume(effect);
|
|
41
|
+
};
|
|
42
|
+
self.waiters.add(observer);
|
|
43
|
+
return sync(() => {
|
|
44
|
+
self.waiters.delete(observer);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
class SemaphoreImpl {
|
|
49
|
+
waiters = /* @__PURE__ */ new Set;
|
|
50
|
+
taken = 0;
|
|
51
|
+
permits;
|
|
52
|
+
constructor(permits) {
|
|
53
|
+
this.permits = permits;
|
|
54
|
+
}
|
|
55
|
+
get free() {
|
|
56
|
+
return this.permits - this.taken;
|
|
57
|
+
}
|
|
58
|
+
take(n) {
|
|
59
|
+
const take = suspend(() => {
|
|
60
|
+
if (this.free < n) {
|
|
61
|
+
return waitForPermits(this, n, take);
|
|
62
|
+
}
|
|
63
|
+
this.taken += n;
|
|
64
|
+
return succeed2(n);
|
|
65
|
+
});
|
|
66
|
+
return take;
|
|
67
|
+
}
|
|
68
|
+
takeIfAvailable(n) {
|
|
69
|
+
return suspend(() => {
|
|
70
|
+
if (this.free < n)
|
|
71
|
+
return succeed2(false);
|
|
72
|
+
this.taken += n;
|
|
73
|
+
return succeed2(true);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
releaseUnsafe(fiber, n) {
|
|
77
|
+
this.taken -= n;
|
|
78
|
+
if (this.waiters.size > 0) {
|
|
79
|
+
fiber.currentDispatcher.scheduleTask(() => {
|
|
80
|
+
for (const observer of this.waiters) {
|
|
81
|
+
if (this.free <= 0)
|
|
82
|
+
break;
|
|
83
|
+
observer();
|
|
84
|
+
}
|
|
85
|
+
}, 0);
|
|
86
|
+
}
|
|
87
|
+
return this.free;
|
|
88
|
+
}
|
|
89
|
+
resize(permits) {
|
|
90
|
+
return withFiber((fiber) => {
|
|
91
|
+
this.permits = permits;
|
|
92
|
+
if (this.free < 0)
|
|
93
|
+
return void_;
|
|
94
|
+
this.releaseUnsafe(fiber, 0);
|
|
95
|
+
return void_;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
release(n) {
|
|
99
|
+
return withFiber((fiber) => succeed2(this.releaseUnsafe(fiber, n)));
|
|
100
|
+
}
|
|
101
|
+
get releaseAll() {
|
|
102
|
+
return withFiber((fiber) => succeed2(this.releaseUnsafe(fiber, this.taken)));
|
|
103
|
+
}
|
|
104
|
+
withPermits(n) {
|
|
105
|
+
return (self) => uninterruptibleMask((restore) => {
|
|
106
|
+
const acquire = suspend(() => {
|
|
107
|
+
if (this.free < n) {
|
|
108
|
+
const wait = waitForPermits(this, n, void_);
|
|
109
|
+
return flatMap2(restore(wait), () => acquire);
|
|
110
|
+
}
|
|
111
|
+
this.taken += n;
|
|
112
|
+
return onExitPrimitive(restore(self), () => {
|
|
113
|
+
this.releaseUnsafe(getCurrentFiber(), n);
|
|
114
|
+
return;
|
|
115
|
+
}, true);
|
|
116
|
+
});
|
|
117
|
+
return acquire;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
withPermit = /* @__PURE__ */ this.withPermits(1);
|
|
121
|
+
withPermitsIfAvailable(n) {
|
|
122
|
+
return (self) => uninterruptibleMask((restore) => {
|
|
123
|
+
if (this.free < n)
|
|
124
|
+
return succeedNone;
|
|
125
|
+
this.taken += n;
|
|
126
|
+
return onExitPrimitive(restore(asSome(self)), () => {
|
|
127
|
+
this.releaseUnsafe(getCurrentFiber(), n);
|
|
128
|
+
return;
|
|
129
|
+
}, true);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
var make3 = (permits) => sync(() => new SemaphoreImpl(permits));
|
|
134
|
+
|
|
19
135
|
// node_modules/effect/dist/internal/matcher.js
|
|
20
136
|
var TypeId = "~effect/Match/Matcher";
|
|
21
137
|
var TypeMatcherProto = {
|
|
@@ -208,4 +324,4 @@ var boolean = isBoolean;
|
|
|
208
324
|
var orElse = orElse2;
|
|
209
325
|
var exhaustive = exhaustive2;
|
|
210
326
|
|
|
211
|
-
export { Clock, currentTimeMillis, type, value, when, tag, tags, is, string, number, boolean, orElse, exhaustive };
|
|
327
|
+
export { Clock, currentTimeMillis, makeUnsafe, make3, type, value, when, tag, tags, is, string, number, boolean, orElse, exhaustive };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
stateRoot,
|
|
3
|
-
compiledBinary,
|
|
4
|
-
scriptEntry,
|
|
5
|
-
cliCommand,
|
|
6
|
-
installCommand,
|
|
7
2
|
browserUnresponsive,
|
|
8
3
|
extensionReconnectAlarmPeriodMs,
|
|
9
4
|
extensionProtocolAdvice,
|
|
10
5
|
compareVersions,
|
|
11
6
|
installedRuntime2,
|
|
12
7
|
installedVersion
|
|
13
|
-
} from "./main-
|
|
8
|
+
} from "./main-m9n50a86.mjs";
|
|
14
9
|
import {
|
|
15
10
|
ensurePrivateDirectorySync,
|
|
16
11
|
SessionContainer,
|
|
@@ -26,10 +21,8 @@ import {
|
|
|
26
21
|
RelayShutdownRequest,
|
|
27
22
|
RelayShutdownResponse,
|
|
28
23
|
NetworkStatusResponse,
|
|
29
|
-
AuthProfileSummary,
|
|
30
24
|
NetworkStopResponse,
|
|
31
25
|
NetworkCancelResponse,
|
|
32
|
-
AuthRunResponse,
|
|
33
26
|
RecordingStartResponse,
|
|
34
27
|
RecordingStopResponse,
|
|
35
28
|
RecordingStatusResponse,
|
|
@@ -43,7 +36,7 @@ import {
|
|
|
43
36
|
RelayErrorCode,
|
|
44
37
|
ErrorEnvelope,
|
|
45
38
|
defaultPort2
|
|
46
|
-
} from "./main-
|
|
39
|
+
} from "./main-mvjg1jye.mjs";
|
|
47
40
|
import {
|
|
48
41
|
get,
|
|
49
42
|
post,
|
|
@@ -51,13 +44,13 @@ import {
|
|
|
51
44
|
bodyJson,
|
|
52
45
|
HttpClient,
|
|
53
46
|
layerNodeHttp
|
|
54
|
-
} from "./main-
|
|
47
|
+
} from "./main-3514h33n.mjs";
|
|
55
48
|
import {
|
|
56
49
|
opencodeBrowserBuildId2
|
|
57
|
-
} from "./main-
|
|
50
|
+
} from "./main-qrqem3fy.mjs";
|
|
58
51
|
import {
|
|
59
52
|
relayAuthorization
|
|
60
|
-
} from "./main-
|
|
53
|
+
} from "./main-pqxrvknr.mjs";
|
|
61
54
|
import {
|
|
62
55
|
endpointForPort,
|
|
63
56
|
configuredRelayPort,
|
|
@@ -65,7 +58,14 @@ import {
|
|
|
65
58
|
readRelayState,
|
|
66
59
|
processAlive,
|
|
67
60
|
resolveRelayPort
|
|
68
|
-
} from "./main-
|
|
61
|
+
} from "./main-4qq4n32k.mjs";
|
|
62
|
+
import {
|
|
63
|
+
stateRoot,
|
|
64
|
+
compiledBinary,
|
|
65
|
+
scriptEntry,
|
|
66
|
+
cliCommand,
|
|
67
|
+
installCommand
|
|
68
|
+
} from "./main-tryp3jph.mjs";
|
|
69
69
|
import {
|
|
70
70
|
Pointer,
|
|
71
71
|
passthrough,
|
|
@@ -92,7 +92,10 @@ import {
|
|
|
92
92
|
Defect,
|
|
93
93
|
TaggedError2,
|
|
94
94
|
toCodecStringTree
|
|
95
|
-
} from "./main-
|
|
95
|
+
} from "./main-8xd753k5.mjs";
|
|
96
|
+
import {
|
|
97
|
+
__require
|
|
98
|
+
} from "./main-j98fzrvv.mjs";
|
|
96
99
|
import {
|
|
97
100
|
dual,
|
|
98
101
|
memoize,
|
|
@@ -145,10 +148,7 @@ import {
|
|
|
145
148
|
mapEager,
|
|
146
149
|
flatMapEager,
|
|
147
150
|
catchEager
|
|
148
|
-
} from "./main-
|
|
149
|
-
import {
|
|
150
|
-
__require
|
|
151
|
-
} from "./main-j98fzrvv.mjs";
|
|
151
|
+
} from "./main-0h387a1q.mjs";
|
|
152
152
|
|
|
153
153
|
// node_modules/effect/dist/ConfigProvider.js
|
|
154
154
|
function makeValue(value) {
|
|
@@ -690,9 +690,6 @@ var make3 = fn("RelayClient.make")(function* (options) {
|
|
|
690
690
|
networkStatus: (request) => postJson("/network/status", { ...request }, NetworkStatusResponse),
|
|
691
691
|
networkStop: (request) => postJson("/network/stop", { ...request }, NetworkStopResponse),
|
|
692
692
|
networkCancel: (request) => postJson("/network/cancel", { ...request }, NetworkCancelResponse),
|
|
693
|
-
authStatus: (request) => postJson("/auth/status", { ...request }, AuthProfileSummary),
|
|
694
|
-
authRefresh: (request) => postJson("/auth/refresh", { ...request }, NetworkStopResponse),
|
|
695
|
-
authRun: (request) => postJson("/auth/run", { ...request }, AuthRunResponse),
|
|
696
693
|
recordingStart: ({ sessionId, tabId, ...request }) => postJson("/recording/start", { ...recordingTargetBody({ sessionId, tabId }), ...request }, RecordingStartResponse),
|
|
697
694
|
recordingStop: (target) => postJson("/recording/stop", recordingTargetBody(target), RecordingStopResponse),
|
|
698
695
|
recordingStatus: (target) => getJson(`/recording/status${recordingTargetQuery(target)}`, RecordingStatusResponse),
|
|
@@ -709,8 +706,8 @@ var make3 = fn("RelayClient.make")(function* (options) {
|
|
|
709
706
|
var layer = effect(Service, make3());
|
|
710
707
|
var layerFetch = layer.pipe(provide2(layerNodeHttp));
|
|
711
708
|
function mcpClientPid() {
|
|
712
|
-
const
|
|
713
|
-
return Number.isSafeInteger(
|
|
709
|
+
const supervisor = Number(process.env.OPENCODE_BROWSER_CLIENT_PID);
|
|
710
|
+
return Number.isSafeInteger(supervisor) && supervisor > 1 && supervisor === process.ppid ? supervisor : process.pid;
|
|
714
711
|
}
|
|
715
712
|
var layerFetchMcp = effect(Service, make3({ clientPid: mcpClientPid() })).pipe(provide2(layerNodeHttp));
|
|
716
713
|
|
|
@@ -924,13 +921,23 @@ function relayBuildProblem(version, buildId = opencodeBrowserBuildId2) {
|
|
|
924
921
|
return `Running relay does not report a build id; use \`${cliCommand("relay restart")}\` for upgrade guidance (${buildId}).`;
|
|
925
922
|
}
|
|
926
923
|
if (version.buildId !== buildId) {
|
|
927
|
-
if (isNewerBuild(version.buildId, buildId))
|
|
928
|
-
return
|
|
929
|
-
}
|
|
924
|
+
if (isNewerBuild(version.buildId, buildId))
|
|
925
|
+
return;
|
|
930
926
|
return `Running relay build ${version.buildId} does not match CLI build ${buildId}; run \`${cliCommand("relay restart")}\` when no agent is using the browser. This leaves browser tabs open but resets in-memory JavaScript state.`;
|
|
931
927
|
}
|
|
932
928
|
return;
|
|
933
929
|
}
|
|
930
|
+
function relayIsNewerThanClient(version, buildId = opencodeBrowserBuildId2) {
|
|
931
|
+
return version.buildId !== undefined && version.buildId !== buildId && isNewerBuild(version.buildId, buildId);
|
|
932
|
+
}
|
|
933
|
+
function olderMcpClientAdvice(version, error, buildId = opencodeBrowserBuildId2) {
|
|
934
|
+
if (!relayIsNewerThanClient(version, buildId))
|
|
935
|
+
return;
|
|
936
|
+
const incompatible = error instanceof RelayDecodeFailed ? error.path !== "/version" : error instanceof RelayRejected && (error.status === 405 || error.status === 415 || error.status === 404 && error.code === undefined || error.status === 400 && error.code === "invalid-request" && error.message.startsWith("Invalid ") && error.message.includes(" request:"));
|
|
937
|
+
if (!incompatible)
|
|
938
|
+
return;
|
|
939
|
+
return "browse was updated, and the running relay can't serve this MCP server's older build. Reconnect browse in the agent so it starts the new version (in OpenCode: /mcps).";
|
|
940
|
+
}
|
|
934
941
|
var ensureRelay = fn("RelayLifecycle.ensureRelay")(function* (options) {
|
|
935
942
|
const buildId = options.buildId ?? opencodeBrowserBuildId2;
|
|
936
943
|
const probe = options.relay.version;
|
|
@@ -1222,4 +1229,4 @@ function isForeignListener(error, pinned) {
|
|
|
1222
1229
|
return error instanceof RelayDecodeFailed;
|
|
1223
1230
|
}
|
|
1224
1231
|
|
|
1225
|
-
export { map, withDefault, option, String2, Int, Boolean2, portConfig, extensionOriginsConfig, RelayUnreachable, RelayRejected, Service, layerFetch, layerFetchMcp, appendManagedRelayProcessLog, relayLog, shouldWaitForExtensionReconnect, relayBuildProblem, ensureRelay, restartRelay, extensionReconnectWaitMs, ensureExtensionConnected, stoppedRelayStatus, statusCollections, startManagedRelay };
|
|
1232
|
+
export { map, withDefault, option, String2, Int, Boolean2, portConfig, extensionOriginsConfig, RelayUnreachable, RelayRejected, Service, layerFetch, layerFetchMcp, appendManagedRelayProcessLog, relayLog, shouldWaitForExtensionReconnect, relayBuildProblem, olderMcpClientAdvice, ensureRelay, restartRelay, extensionReconnectWaitMs, ensureExtensionConnected, stoppedRelayStatus, statusCollections, startManagedRelay };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-mvjg1jye.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
stateRoot
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-tryp3jph.mjs";
|
|
8
8
|
|
|
9
9
|
// src/relay/browser-pairing.ts
|
|
10
10
|
import crypto from "node:crypto";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dataRoot
|
|
3
|
+
} from "./main-tryp3jph.mjs";
|
|
4
|
+
|
|
5
|
+
// src/setup/remove-stored-secrets.ts
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import os from "node:os";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
function removeStoredSecrets2(home = os.homedir()) {
|
|
10
|
+
for (const folder of ["site-secrets", "secrets"]) {
|
|
11
|
+
try {
|
|
12
|
+
fs.rmSync(path.join(dataRoot(home), folder), { recursive: true, force: true });
|
|
13
|
+
} catch {}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { removeStoredSecrets2 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNodeError,
|
|
3
3
|
isValidSessionId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-mvjg1jye.mjs";
|
|
5
5
|
import {
|
|
6
6
|
stateRoot
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-tryp3jph.mjs";
|
|
8
8
|
import {
|
|
9
9
|
decodeUnknownOption,
|
|
10
10
|
optionalKey,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
Struct,
|
|
15
15
|
ArraySchema,
|
|
16
16
|
NullOr
|
|
17
|
-
} from "./main-
|
|
17
|
+
} from "./main-8xd753k5.mjs";
|
|
18
18
|
import {
|
|
19
19
|
isSome
|
|
20
|
-
} from "./main-
|
|
20
|
+
} from "./main-0h387a1q.mjs";
|
|
21
21
|
|
|
22
22
|
// src/session-manager/journal.ts
|
|
23
23
|
import fs from "node:fs";
|