@opencode/browse 0.0.15-dev.110 → 0.0.15-dev.111
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/{Undici-88kyhfpm.mjs → Undici-mxpvn7gy.mjs} +1 -1
- package/dist/{cli-ftng02ff.mjs → cli-qbevp261.mjs} +134 -130
- package/dist/cli.mjs +13 -13
- package/dist/{helpers-xcy6tqv8.mjs → helpers-3qe84bs4.mjs} +2 -2
- package/dist/{index-yzz55kxm.mjs → index-6gkr235e.mjs} +1 -1
- package/dist/{main-w79fw3mt.mjs → main-08xv9zty.mjs} +3 -3
- package/dist/main-2r3wkhaa.mjs +4 -0
- package/dist/main-9t2s5ptx.mjs +5405 -0
- package/dist/{main-fpc5be6h.mjs → main-agbjz9vc.mjs} +3 -3
- package/dist/{main-vgzr4689.mjs → main-azpzpy0x.mjs} +1 -1
- package/dist/{main-8z9d979q.mjs → main-er120rjm.mjs} +2 -2
- package/dist/{main-yf9xhpn4.mjs → main-ken6azcs.mjs} +2 -2
- package/dist/main-m7hxrgtg.mjs +1694 -0
- package/dist/{main-pnhrdk7y.mjs → main-p8dn427e.mjs} +2 -2
- package/dist/{main-2vk5mg8n.mjs → main-qya10zvn.mjs} +4 -4
- package/dist/{main-dghqndja.mjs → main-vyr67qdb.mjs} +2 -2
- package/dist/main-wb8sbtr1.mjs +1255 -0
- package/dist/{main-tyydn3xk.mjs → main-wmpmewe1.mjs} +2 -2
- package/dist/{main-csnx585b.mjs → main-yf5j8g79.mjs} +2800 -8017
- package/dist/{main-7p43gjgk.mjs → main-ym0evywx.mjs} +4 -4
- package/dist/{main-x8sv1x9z.mjs → main-zptcnvy8.mjs} +59 -57
- package/dist/{mcp-mhms2jng.mjs → mcp-cstaf6x0.mjs} +415 -411
- package/dist/{migrate-w1ted1w6.mjs → migrate-bynvsqpe.mjs} +5 -5
- package/dist/{relay-xhz6s81w.mjs → relay-aems8waq.mjs} +127 -123
- package/dist/{runtime-update-fm0me22e.mjs → runtime-update-6gpw6b15.mjs} +7 -6
- package/dist/{setup-g3fpqzqe.mjs → setup-aca4zwxc.mjs} +19 -10
- package/dist/{supervisor-40ckz6kf.mjs → supervisor-xavypw3x.mjs} +3 -3
- package/dist/{update-83zpyvjn.mjs → update-v09y9tza.mjs} +3 -3
- package/dist/{version-njstahmg.mjs → version-pkmxp5at.mjs} +1 -1
- package/package.json +1 -1
- package/dist/main-rty99vp8.mjs +0 -4
- package/dist/main-tams6t1b.mjs +0 -2924
|
@@ -1,4 +1,83 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
make4,
|
|
4
|
+
value2,
|
|
5
|
+
take2,
|
|
6
|
+
FileSystem,
|
|
7
|
+
Path,
|
|
8
|
+
errorExitCode,
|
|
9
|
+
errorReported,
|
|
10
|
+
QuitError,
|
|
11
|
+
isQuitError,
|
|
12
|
+
Terminal,
|
|
13
|
+
runMain,
|
|
14
|
+
layer2
|
|
15
|
+
} from "./main-9t2s5ptx.mjs";
|
|
16
|
+
import {
|
|
17
|
+
opencodeBrowserVersion2,
|
|
18
|
+
opencodeBrowserBuildId2
|
|
19
|
+
} from "./main-2r3wkhaa.mjs";
|
|
20
|
+
import {
|
|
21
|
+
configRoot2,
|
|
22
|
+
dataRoot,
|
|
23
|
+
stateRoot,
|
|
24
|
+
cacheRoot,
|
|
25
|
+
fromCheckout,
|
|
26
|
+
compiledBinary,
|
|
27
|
+
binaryPackage,
|
|
28
|
+
cliCommand,
|
|
29
|
+
devExtension,
|
|
30
|
+
installCommand,
|
|
31
|
+
autoUpdateStatus
|
|
32
|
+
} from "./main-agbjz9vc.mjs";
|
|
33
|
+
import {
|
|
34
|
+
extensionProtocolVersion,
|
|
35
|
+
extensionProtocolAdvice
|
|
36
|
+
} from "./main-mrew6jy8.mjs";
|
|
37
|
+
import {
|
|
38
|
+
option,
|
|
39
|
+
String2,
|
|
40
|
+
Int,
|
|
41
|
+
defaultPort2,
|
|
42
|
+
isValidSessionId2,
|
|
43
|
+
portConfig,
|
|
44
|
+
extensionOriginsConfig,
|
|
45
|
+
endpointForPort,
|
|
46
|
+
RelayUnreachable,
|
|
47
|
+
RelayRejected,
|
|
48
|
+
Service,
|
|
49
|
+
layerFetch,
|
|
50
|
+
shouldWaitForExtensionReconnect,
|
|
51
|
+
relayBuildProblem,
|
|
52
|
+
ensureRelay,
|
|
53
|
+
restartRelay,
|
|
54
|
+
extensionReconnectWaitMs,
|
|
55
|
+
ensureExtensionConnected,
|
|
56
|
+
stoppedRelayStatus,
|
|
57
|
+
statusCollections
|
|
58
|
+
} from "./main-zptcnvy8.mjs";
|
|
59
|
+
import"./main-azpzpy0x.mjs";
|
|
60
|
+
import {
|
|
61
|
+
updateJson2,
|
|
62
|
+
formatUpdateNotice2,
|
|
63
|
+
updateNotice2
|
|
64
|
+
} from "./main-vyr67qdb.mjs";
|
|
65
|
+
import {
|
|
66
|
+
settingKeys,
|
|
67
|
+
formatSettings,
|
|
68
|
+
ensureSessionExists
|
|
69
|
+
} from "./main-m7hxrgtg.mjs";
|
|
70
|
+
import {
|
|
71
|
+
addSecret,
|
|
72
|
+
listSecrets,
|
|
73
|
+
removeSecret
|
|
74
|
+
} from "./main-wb8sbtr1.mjs";
|
|
75
|
+
import {
|
|
76
|
+
defaultJournalBaseDir,
|
|
77
|
+
readJournalEntries,
|
|
78
|
+
formatJournalEntry
|
|
79
|
+
} from "./main-ym0evywx.mjs";
|
|
80
|
+
import"./main-wmpmewe1.mjs";
|
|
2
81
|
import {
|
|
3
82
|
format,
|
|
4
83
|
assignProperty,
|
|
@@ -15,8 +94,8 @@ import {
|
|
|
15
94
|
map,
|
|
16
95
|
exists,
|
|
17
96
|
Service2,
|
|
18
|
-
|
|
19
|
-
|
|
97
|
+
empty4,
|
|
98
|
+
make9,
|
|
20
99
|
Reference,
|
|
21
100
|
succeed,
|
|
22
101
|
fail2,
|
|
@@ -26,7 +105,7 @@ import {
|
|
|
26
105
|
findFirstIndex,
|
|
27
106
|
findFirst,
|
|
28
107
|
findLast,
|
|
29
|
-
|
|
108
|
+
empty5,
|
|
30
109
|
map3,
|
|
31
110
|
reduce,
|
|
32
111
|
taggedEnum,
|
|
@@ -47,10 +126,10 @@ import {
|
|
|
47
126
|
void_3,
|
|
48
127
|
never,
|
|
49
128
|
gen,
|
|
50
|
-
|
|
51
|
-
|
|
129
|
+
fail6,
|
|
130
|
+
try_2,
|
|
52
131
|
flatMap3,
|
|
53
|
-
|
|
132
|
+
andThen2,
|
|
54
133
|
result,
|
|
55
134
|
map5,
|
|
56
135
|
catch_,
|
|
@@ -64,15 +143,13 @@ import {
|
|
|
64
143
|
raceFirst,
|
|
65
144
|
match3,
|
|
66
145
|
provide3,
|
|
67
|
-
|
|
146
|
+
provideContext2,
|
|
68
147
|
provideService,
|
|
69
148
|
scoped,
|
|
70
149
|
ensuring,
|
|
71
|
-
|
|
150
|
+
interrupt3,
|
|
72
151
|
fnUntraced,
|
|
73
152
|
fn,
|
|
74
|
-
make7,
|
|
75
|
-
value2,
|
|
76
153
|
is2,
|
|
77
154
|
decodeUnknownEffect2,
|
|
78
155
|
optionalKey,
|
|
@@ -90,81 +167,8 @@ import {
|
|
|
90
167
|
Int2,
|
|
91
168
|
Defect,
|
|
92
169
|
TaggedError2,
|
|
93
|
-
toCodecStringTree
|
|
94
|
-
|
|
95
|
-
FileSystem,
|
|
96
|
-
Path,
|
|
97
|
-
errorExitCode,
|
|
98
|
-
errorReported,
|
|
99
|
-
QuitError,
|
|
100
|
-
isQuitError,
|
|
101
|
-
Terminal,
|
|
102
|
-
runMain,
|
|
103
|
-
layer2
|
|
104
|
-
} from "./main-csnx585b.mjs";
|
|
105
|
-
import {
|
|
106
|
-
opencodeBrowserVersion2,
|
|
107
|
-
opencodeBrowserBuildId2
|
|
108
|
-
} from "./main-rty99vp8.mjs";
|
|
109
|
-
import {
|
|
110
|
-
configRoot2,
|
|
111
|
-
dataRoot,
|
|
112
|
-
stateRoot,
|
|
113
|
-
cacheRoot,
|
|
114
|
-
fromCheckout,
|
|
115
|
-
compiledBinary,
|
|
116
|
-
binaryPackage,
|
|
117
|
-
cliCommand,
|
|
118
|
-
devExtension,
|
|
119
|
-
installCommand,
|
|
120
|
-
autoUpdateStatus
|
|
121
|
-
} from "./main-fpc5be6h.mjs";
|
|
122
|
-
import {
|
|
123
|
-
extensionProtocolVersion,
|
|
124
|
-
extensionProtocolAdvice
|
|
125
|
-
} from "./main-mrew6jy8.mjs";
|
|
126
|
-
import {
|
|
127
|
-
option,
|
|
128
|
-
String2,
|
|
129
|
-
Int,
|
|
130
|
-
defaultPort2,
|
|
131
|
-
isValidSessionId2,
|
|
132
|
-
portConfig,
|
|
133
|
-
extensionOriginsConfig,
|
|
134
|
-
endpointForPort,
|
|
135
|
-
RelayUnreachable,
|
|
136
|
-
RelayRejected,
|
|
137
|
-
Service,
|
|
138
|
-
layerFetch,
|
|
139
|
-
shouldWaitForExtensionReconnect,
|
|
140
|
-
relayBuildProblem,
|
|
141
|
-
ensureRelay,
|
|
142
|
-
restartRelay,
|
|
143
|
-
extensionReconnectWaitMs,
|
|
144
|
-
ensureExtensionConnected,
|
|
145
|
-
stoppedRelayStatus,
|
|
146
|
-
statusCollections
|
|
147
|
-
} from "./main-x8sv1x9z.mjs";
|
|
148
|
-
import"./main-vgzr4689.mjs";
|
|
149
|
-
import {
|
|
150
|
-
updateJson2,
|
|
151
|
-
formatUpdateNotice2,
|
|
152
|
-
updateNotice2
|
|
153
|
-
} from "./main-dghqndja.mjs";
|
|
154
|
-
import {
|
|
155
|
-
settingKeys,
|
|
156
|
-
formatSettings,
|
|
157
|
-
ensureSessionExists,
|
|
158
|
-
addSecret,
|
|
159
|
-
listSecrets,
|
|
160
|
-
removeSecret
|
|
161
|
-
} from "./main-tams6t1b.mjs";
|
|
162
|
-
import {
|
|
163
|
-
defaultJournalBaseDir,
|
|
164
|
-
readJournalEntries,
|
|
165
|
-
formatJournalEntry
|
|
166
|
-
} from "./main-7p43gjgk.mjs";
|
|
167
|
-
import"./main-tyydn3xk.mjs";
|
|
170
|
+
toCodecStringTree
|
|
171
|
+
} from "./main-yf5j8g79.mjs";
|
|
168
172
|
import {
|
|
169
173
|
pipeArguments,
|
|
170
174
|
dual,
|
|
@@ -175,7 +179,7 @@ import {
|
|
|
175
179
|
isObject,
|
|
176
180
|
hasProperty,
|
|
177
181
|
isTagged
|
|
178
|
-
} from "./main-
|
|
182
|
+
} from "./main-ken6azcs.mjs";
|
|
179
183
|
|
|
180
184
|
// node_modules/effect/dist/Number.js
|
|
181
185
|
var Number2 = globalThis.Number;
|
|
@@ -348,7 +352,7 @@ var Choice = (choices) => {
|
|
|
348
352
|
if (choiceMap.has(value)) {
|
|
349
353
|
return succeed6(choiceMap.get(value));
|
|
350
354
|
}
|
|
351
|
-
return
|
|
355
|
+
return fail6(validChoices);
|
|
352
356
|
});
|
|
353
357
|
return Object.assign(primitive, {
|
|
354
358
|
choiceKeys: choices.map(([key]) => key)
|
|
@@ -585,10 +589,10 @@ var Number3 = (options) => {
|
|
|
585
589
|
precision: 2,
|
|
586
590
|
validate: (n) => {
|
|
587
591
|
if (n < opts.min) {
|
|
588
|
-
return
|
|
592
|
+
return fail6(`${n} must be greater than or equal to ${opts.min}`);
|
|
589
593
|
}
|
|
590
594
|
if (n > opts.max) {
|
|
591
|
-
return
|
|
595
|
+
return fail6(`${n} must be less than or equal to ${opts.max}`);
|
|
592
596
|
}
|
|
593
597
|
return succeed6(n);
|
|
594
598
|
},
|
|
@@ -615,10 +619,10 @@ var Int4 = (options) => {
|
|
|
615
619
|
decrementBy: 1,
|
|
616
620
|
validate: (n) => {
|
|
617
621
|
if (n < opts.min) {
|
|
618
|
-
return
|
|
622
|
+
return fail6(`${n} must be greater than or equal to ${opts.min}`);
|
|
619
623
|
}
|
|
620
624
|
if (n > opts.max) {
|
|
621
|
-
return
|
|
625
|
+
return fail6(`${n} must be less than or equal to ${opts.max}`);
|
|
622
626
|
}
|
|
623
627
|
return succeed6(n);
|
|
624
628
|
},
|
|
@@ -637,7 +641,7 @@ var Int4 = (options) => {
|
|
|
637
641
|
});
|
|
638
642
|
};
|
|
639
643
|
var map2 = /* @__PURE__ */ dual(2, (self, f) => flatMap(self, (a) => succeed2(f(a))));
|
|
640
|
-
var Password = (options) => basePrompt(options, "password").pipe(map2(
|
|
644
|
+
var Password = (options) => basePrompt(options, "password").pipe(map2(make4));
|
|
641
645
|
var run = /* @__PURE__ */ fnUntraced(function* (self) {
|
|
642
646
|
const terminal = yield* Terminal;
|
|
643
647
|
const input = yield* terminal.readInput;
|
|
@@ -728,17 +732,17 @@ var runLoop = /* @__PURE__ */ fnUntraced(function* (loop, terminal, input) {
|
|
|
728
732
|
yield* orDie(terminal.display(clear + msg));
|
|
729
733
|
clear = "";
|
|
730
734
|
if (loop.events) {
|
|
731
|
-
const takeInput =
|
|
735
|
+
const takeInput = take2(input).pipe(map5((input) => ({
|
|
732
736
|
_tag: "Input",
|
|
733
737
|
input
|
|
734
738
|
})));
|
|
735
|
-
const result = yield* raceFirst(takeInput,
|
|
739
|
+
const result = yield* raceFirst(takeInput, take2(loop.events).pipe(map5((value) => ({
|
|
736
740
|
_tag: "Event",
|
|
737
741
|
value
|
|
738
742
|
}))));
|
|
739
743
|
action = yield* loop.process(result, state);
|
|
740
744
|
} else {
|
|
741
|
-
const result = yield*
|
|
745
|
+
const result = yield* take2(input);
|
|
742
746
|
action = yield* loop.process(result, state);
|
|
743
747
|
}
|
|
744
748
|
switch (action._tag) {
|
|
@@ -1088,7 +1092,7 @@ var makeDateParts = (dateMask, date, locales) => {
|
|
|
1088
1092
|
array.push(element);
|
|
1089
1093
|
}
|
|
1090
1094
|
return array;
|
|
1091
|
-
},
|
|
1095
|
+
}, empty5());
|
|
1092
1096
|
parts.splice(0, parts.length, ...orderedParts);
|
|
1093
1097
|
return parts;
|
|
1094
1098
|
};
|
|
@@ -3395,10 +3399,10 @@ var makeCommand = (options) => {
|
|
|
3395
3399
|
const config = options.config;
|
|
3396
3400
|
const contextConfig = options.contextConfig ?? emptyConfig;
|
|
3397
3401
|
const service = options.service ?? Service2(`${TypeId5}/${options.name}`);
|
|
3398
|
-
const annotations = options.annotations ??
|
|
3402
|
+
const annotations = options.annotations ?? empty4();
|
|
3399
3403
|
const globalFlags = options.globalFlags ?? [];
|
|
3400
3404
|
const subcommands = options.subcommands ?? [];
|
|
3401
|
-
const handle = (input, commandPath) => isNotUndefined(options.handle) ? options.handle(input, commandPath) :
|
|
3405
|
+
const handle = (input, commandPath) => isNotUndefined(options.handle) ? options.handle(input, commandPath) : fail6(new ShowHelp({
|
|
3402
3406
|
commandPath,
|
|
3403
3407
|
errors: []
|
|
3404
3408
|
}));
|
|
@@ -4977,11 +4981,11 @@ var runWith = (command, config) => {
|
|
|
4977
4981
|
program = provideService(program, flag, value);
|
|
4978
4982
|
}
|
|
4979
4983
|
const services = match(logLevel, {
|
|
4980
|
-
onNone: () =>
|
|
4981
|
-
onSome: (level) =>
|
|
4984
|
+
onNone: () => empty4(),
|
|
4985
|
+
onSome: (level) => make9(MinimumLogLevel, level)
|
|
4982
4986
|
});
|
|
4983
|
-
yield*
|
|
4984
|
-
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed(error) : fail2(error), (error) =>
|
|
4987
|
+
yield* provideContext2(program, services);
|
|
4988
|
+
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed(error) : fail2(error), (error) => andThen2(showHelp(command, error, config.renderErrors !== false), fail6(error))), catchFilter((error) => config.renderErrors !== false && isCliError(error) && error._tag === "UserError" ? succeed(error) : fail2(error), (error) => andThen2(showUserError(error), fail6(error))), catchFilter((e) => isQuitError(e) ? succeed(e) : fail2(e), (_) => interrupt3));
|
|
4985
4989
|
};
|
|
4986
4990
|
// src/cli.ts
|
|
4987
4991
|
import path5 from "node:path";
|
|
@@ -5061,9 +5065,9 @@ var make2 = fn("SessionStore.make")(function* (options) {
|
|
|
5061
5065
|
operation,
|
|
5062
5066
|
cause
|
|
5063
5067
|
});
|
|
5064
|
-
const readStore = fs.readFileString(filePath).pipe(map5(some), catchTag("PlatformError", (error) => isTagged(error.reason, "NotFound") ? succeed6(none()) :
|
|
5068
|
+
const readStore = fs.readFileString(filePath).pipe(map5(some), catchTag("PlatformError", (error) => isTagged(error.reason, "NotFound") ? succeed6(none()) : fail6(error)), mapError(storeError("read")), flatMap3(match({
|
|
5065
5069
|
onNone: () => succeed6({}),
|
|
5066
|
-
onSome: (text) =>
|
|
5070
|
+
onSome: (text) => try_2({
|
|
5067
5071
|
try: () => JSON.parse(text),
|
|
5068
5072
|
catch: (cause) => cause
|
|
5069
5073
|
}).pipe(flatMap3(decodeUnknownEffect2(StoreFile)), mapError(storeError("decode")))
|
|
@@ -5075,8 +5079,8 @@ var make2 = fn("SessionStore.make")(function* (options) {
|
|
|
5075
5079
|
}
|
|
5076
5080
|
return entries;
|
|
5077
5081
|
};
|
|
5078
|
-
const writeStore = (entries) => fs.makeDirectory(path.dirname(filePath), { recursive: true, mode: 448 }).pipe(
|
|
5079
|
-
`, { mode: 384 })),
|
|
5082
|
+
const writeStore = (entries) => fs.makeDirectory(path.dirname(filePath), { recursive: true, mode: 448 }).pipe(andThen2(fs.writeFileString(filePath, `${JSON.stringify({ endpoints: entries }, null, 2)}
|
|
5083
|
+
`, { mode: 384 })), andThen2(fs.chmod(filePath, 384)), mapError(storeError("write")));
|
|
5080
5084
|
const read = readStore.pipe(map5((store) => currentEntries(store)[endpoint]?.id));
|
|
5081
5085
|
const write = (id) => readStore.pipe(flatMap3((store) => {
|
|
5082
5086
|
const entries = currentEntries(store);
|
|
@@ -5119,7 +5123,7 @@ var createDoctorReport = fn("Doctor.createReport")(function* (options) {
|
|
|
5119
5123
|
const store = yield* Service3;
|
|
5120
5124
|
const fs = yield* FileSystem;
|
|
5121
5125
|
const path = yield* Path;
|
|
5122
|
-
const readJsonFile = (relativePath, schema) => fs.readFileString(path.join(options.packageRoot, relativePath)).pipe(mapError((cause) => new Error(`read ${relativePath}: ${cause.reason.message}`)), flatMap3((text) =>
|
|
5126
|
+
const readJsonFile = (relativePath, schema) => fs.readFileString(path.join(options.packageRoot, relativePath)).pipe(mapError((cause) => new Error(`read ${relativePath}: ${cause.reason.message}`)), flatMap3((text) => try_2({
|
|
5123
5127
|
try: () => JSON.parse(text),
|
|
5124
5128
|
catch: () => new Error(`parse ${relativePath}: invalid JSON`)
|
|
5125
5129
|
})), flatMap3((value) => decodeUnknownEffect2(schema)(value).pipe(mapError((cause) => new Error(`decode ${relativePath}: ${cause.message}`)))));
|
|
@@ -5625,7 +5629,7 @@ var ensureCliRelay = fnUntraced(function* () {
|
|
|
5625
5629
|
yield* error(`Started browse relay at ${relay.endpoint}`);
|
|
5626
5630
|
}
|
|
5627
5631
|
if (readiness.buildProblem) {
|
|
5628
|
-
return yield*
|
|
5632
|
+
return yield* fail6(new Error(readiness.buildProblem));
|
|
5629
5633
|
}
|
|
5630
5634
|
return readiness;
|
|
5631
5635
|
});
|
|
@@ -5643,7 +5647,7 @@ var resolveSelectedSessionId = fnUntraced(function* (explicitSessionId) {
|
|
|
5643
5647
|
const store = yield* Service3;
|
|
5644
5648
|
const sessionId = explicitSessionId ?? (yield* store.read);
|
|
5645
5649
|
if (!sessionId) {
|
|
5646
|
-
return yield*
|
|
5650
|
+
return yield* fail6(new Error("No session provided and no current browse session exists"));
|
|
5647
5651
|
}
|
|
5648
5652
|
return sessionId;
|
|
5649
5653
|
});
|
|
@@ -5663,7 +5667,7 @@ var recordingTarget = fnUntraced(function* (options) {
|
|
|
5663
5667
|
const sessionId = getOrUndefined(options.session);
|
|
5664
5668
|
const tabId = getOrUndefined(options.tabId);
|
|
5665
5669
|
if (sessionId && tabId !== undefined) {
|
|
5666
|
-
return yield*
|
|
5670
|
+
return yield* fail6(new Error("Use only one recording target selector: --session or --tab-id"));
|
|
5667
5671
|
}
|
|
5668
5672
|
return {
|
|
5669
5673
|
...sessionId ? { sessionId } : {},
|
|
@@ -5677,7 +5681,7 @@ var parseRecordingModeOption = fnUntraced(function* (value) {
|
|
|
5677
5681
|
if (value === "auto" || value === "tab-capture" || value === "cdp") {
|
|
5678
5682
|
return value;
|
|
5679
5683
|
}
|
|
5680
|
-
return yield*
|
|
5684
|
+
return yield* fail6(new Error("Recording mode must be auto, tab-capture, or cdp"));
|
|
5681
5685
|
});
|
|
5682
5686
|
var networkSession = fnUntraced(function* (session) {
|
|
5683
5687
|
return yield* resolveSelectedSessionId(getOrUndefined(session) ?? getOrUndefined(yield* sessionIdConfig));
|
|
@@ -5729,7 +5733,7 @@ var settingsSet = make("set", {
|
|
|
5729
5733
|
for (const assignment of assignments) {
|
|
5730
5734
|
const index = assignment.indexOf("=");
|
|
5731
5735
|
if (index <= 0)
|
|
5732
|
-
return yield*
|
|
5736
|
+
return yield* fail6(new Error(`Expected key=value, got "${assignment}". Settings: ${settingKeys.join(", ")}.`));
|
|
5733
5737
|
changes[assignment.slice(0, index)] = assignment.slice(index + 1);
|
|
5734
5738
|
}
|
|
5735
5739
|
const relay = yield* Service;
|
|
@@ -5867,7 +5871,7 @@ var status = make("status", {
|
|
|
5867
5871
|
}
|
|
5868
5872
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5869
5873
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5870
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5874
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-cstaf6x0.mjs"));
|
|
5871
5875
|
yield* runMcpServer;
|
|
5872
5876
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5873
5877
|
registerCliCommand(400, () => tabs);
|
|
@@ -5973,19 +5977,19 @@ var execute = make("execute", {
|
|
|
5973
5977
|
const relay = yield* Service;
|
|
5974
5978
|
const filePath = getOrUndefined(file);
|
|
5975
5979
|
if (code.length > 0 && filePath) {
|
|
5976
|
-
return yield*
|
|
5980
|
+
return yield* fail6(new Error("Use either positional code or --file, not both"));
|
|
5977
5981
|
}
|
|
5978
5982
|
if (code.length === 0 && !filePath) {
|
|
5979
|
-
return yield*
|
|
5983
|
+
return yield* fail6(new Error("Execute requires positional code or --file <path>"));
|
|
5980
5984
|
}
|
|
5981
5985
|
const timeoutMsValue = getOrUndefined(timeoutMs);
|
|
5982
5986
|
if (timeoutMsValue !== undefined && timeoutMsValue < 0) {
|
|
5983
|
-
return yield*
|
|
5987
|
+
return yield* fail6(new Error("Timeout must be a non-negative integer"));
|
|
5984
5988
|
}
|
|
5985
5989
|
const executeCode = filePath ? yield* readExecuteFile(filePath) : code.join(" ");
|
|
5986
5990
|
const explicitSessionId = getOrUndefined(session) ?? getOrUndefined(yield* sessionIdConfig);
|
|
5987
5991
|
if (rm && explicitSessionId) {
|
|
5988
|
-
return yield*
|
|
5992
|
+
return yield* fail6(new Error("Use --rm without --session or OPENCODE_BROWSER_SESSION"));
|
|
5989
5993
|
}
|
|
5990
5994
|
const agentWorkSessionId = agentDefaultSessionId(getOrUndefined(yield* agentSessionIdConfig));
|
|
5991
5995
|
const workSessionId = explicitSessionId ?? (rm ? undefined : agentWorkSessionId);
|
|
@@ -5993,10 +5997,10 @@ var execute = make("execute", {
|
|
|
5993
5997
|
const targetUrlValue = getOrUndefined(targetUrl) ?? getOrUndefined(yield* targetUrlConfig);
|
|
5994
5998
|
const targetIndexValue = getOrUndefined(targetIndex) ?? getOrUndefined(yield* targetIndexConfig);
|
|
5995
5999
|
if (targetIndexValue !== undefined && targetIndexValue < 0) {
|
|
5996
|
-
return yield*
|
|
6000
|
+
return yield* fail6(new Error("Target index must be a non-negative integer"));
|
|
5997
6001
|
}
|
|
5998
6002
|
if (targetUrlValue && targetIndexValue !== undefined) {
|
|
5999
|
-
return yield*
|
|
6003
|
+
return yield* fail6(new Error("Use only one target selector: --target-url/OPENCODE_BROWSER_TARGET_URL or --target-index/OPENCODE_BROWSER_TARGET_INDEX"));
|
|
6000
6004
|
}
|
|
6001
6005
|
const result2 = yield* relay.execute({
|
|
6002
6006
|
...workSessionId ? { sessionId: workSessionId } : {},
|
|
@@ -6058,7 +6062,7 @@ var parseNetworkContent = fnUntraced(function* (content) {
|
|
|
6058
6062
|
const value = getOrUndefined(content);
|
|
6059
6063
|
if (value === undefined || value === "embed" || value === "omit")
|
|
6060
6064
|
return value;
|
|
6061
|
-
return yield*
|
|
6065
|
+
return yield* fail6(new Error("Network content must be embed or omit"));
|
|
6062
6066
|
});
|
|
6063
6067
|
function formatNetworkStatus(status) {
|
|
6064
6068
|
if (!status.active)
|
|
@@ -6127,7 +6131,7 @@ var networkStop = make("stop", {
|
|
|
6127
6131
|
const outputValue = getOrUndefined(output);
|
|
6128
6132
|
const secretsValue = getOrUndefined(secrets);
|
|
6129
6133
|
if (!outputValue && !secretsValue) {
|
|
6130
|
-
return yield*
|
|
6134
|
+
return yield* fail6(new Error("network stop requires --output, --secrets, or both"));
|
|
6131
6135
|
}
|
|
6132
6136
|
const sessionId = yield* networkSession(session);
|
|
6133
6137
|
yield* ensureCliRelay();
|
|
@@ -6172,7 +6176,7 @@ var recordingStart = make("start", {
|
|
|
6172
6176
|
json
|
|
6173
6177
|
}) {
|
|
6174
6178
|
if (isSome(frameRate) && (frameRate.value < 1 || frameRate.value > 60)) {
|
|
6175
|
-
return yield*
|
|
6179
|
+
return yield* fail6(new Error("Recording frameRate must be an integer from 1 to 60"));
|
|
6176
6180
|
}
|
|
6177
6181
|
const relay = yield* Service;
|
|
6178
6182
|
yield* ensureCliRelayAndExtension();
|
|
@@ -6189,7 +6193,7 @@ var recordingStart = make("start", {
|
|
|
6189
6193
|
...cursor ? { cursor } : {}
|
|
6190
6194
|
});
|
|
6191
6195
|
if (!result.success) {
|
|
6192
|
-
return yield*
|
|
6196
|
+
return yield* fail6(new Error(result.error ?? "Failed to start recording"));
|
|
6193
6197
|
}
|
|
6194
6198
|
yield* printOr(json, result, `Recording started: ${result.path ?? resolvedOutputPath} tab=${result.tabId ?? "unknown"} mode=${result.mode ?? "tab-capture"} artifact=${result.artifactType ?? "webm"} mime=${result.mimeType ?? "video/webm"} fps=${result.frameRate ?? "unknown"}`);
|
|
6195
6199
|
})).pipe(withDescription4("Start recording an attached tab"));
|
|
@@ -6203,7 +6207,7 @@ var recordingStop = make("stop", {
|
|
|
6203
6207
|
const target = yield* recordingTarget({ session, tabId });
|
|
6204
6208
|
const result = yield* relay.recordingStop(target);
|
|
6205
6209
|
if (!result.success) {
|
|
6206
|
-
return yield*
|
|
6210
|
+
return yield* fail6(new Error(result.error ?? "Failed to stop recording"));
|
|
6207
6211
|
}
|
|
6208
6212
|
if (json)
|
|
6209
6213
|
return yield* emitJson(result);
|
|
@@ -6241,7 +6245,7 @@ var recordingCancel = make("cancel", {
|
|
|
6241
6245
|
const target = yield* recordingTarget({ session, tabId });
|
|
6242
6246
|
const result = yield* relay.recordingCancel(target);
|
|
6243
6247
|
if (!result.success) {
|
|
6244
|
-
return yield*
|
|
6248
|
+
return yield* fail6(new Error(result.error ?? "Failed to cancel recording"));
|
|
6245
6249
|
}
|
|
6246
6250
|
yield* log("Recording cancelled");
|
|
6247
6251
|
})).pipe(withDescription4("Cancel recording without writing a file"));
|
|
@@ -6315,7 +6319,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6315
6319
|
|
|
6316
6320
|
// src/cli/relay.ts
|
|
6317
6321
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6318
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6322
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-aems8waq.mjs"), import("./helpers-3qe84bs4.mjs")]));
|
|
6319
6323
|
const port = yield* portConfig;
|
|
6320
6324
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6321
6325
|
yield* scoped(gen(function* () {
|
|
@@ -6382,7 +6386,7 @@ var secretsRun = make("run", {
|
|
|
6382
6386
|
yield* ensureCliRelay();
|
|
6383
6387
|
const [executable, ...args] = decodeCliOperands(command);
|
|
6384
6388
|
if (!executable)
|
|
6385
|
-
return yield*
|
|
6389
|
+
return yield* fail6(new Error("secrets run requires a command after --"));
|
|
6386
6390
|
const result = yield* relay.authRun({
|
|
6387
6391
|
name,
|
|
6388
6392
|
command: executable,
|
|
@@ -6569,11 +6573,11 @@ var sessionAdopt = make("adopt", {
|
|
|
6569
6573
|
const targetUrlValue = getOrUndefined(targetUrl);
|
|
6570
6574
|
const targetIndexValue = getOrUndefined(targetIndex);
|
|
6571
6575
|
if (targetIndexValue !== undefined && targetIndexValue < 0) {
|
|
6572
|
-
return yield*
|
|
6576
|
+
return yield* fail6(new Error("Target index must be a non-negative integer"));
|
|
6573
6577
|
}
|
|
6574
6578
|
const tabIdValue = getOrUndefined(tabId);
|
|
6575
6579
|
if ([targetUrlValue, targetIndexValue, tabIdValue].filter((value) => value !== undefined).length > 1) {
|
|
6576
|
-
return yield*
|
|
6580
|
+
return yield* fail6(new Error("Use only one target selector: --target-url, --target-index, or --tab-id"));
|
|
6577
6581
|
}
|
|
6578
6582
|
const targetSelection = targetUrlValue ? { urlIncludes: targetUrlValue } : targetIndexValue !== undefined ? { index: targetIndexValue } : undefined;
|
|
6579
6583
|
const result = yield* relay.sessionAdopt({
|
|
@@ -6613,7 +6617,7 @@ var sessionAllow = make("allow", {
|
|
|
6613
6617
|
const relay = yield* Service;
|
|
6614
6618
|
yield* ensureCliRelay();
|
|
6615
6619
|
if (!clear && origins.length === 0) {
|
|
6616
|
-
return yield*
|
|
6620
|
+
return yield* fail6(new Error("session allow needs origins, or --clear to remove the allowlist"));
|
|
6617
6621
|
}
|
|
6618
6622
|
const id = yield* resolvePositionalOrFlagSessionId(none(), session);
|
|
6619
6623
|
const result = yield* relay.sessionAllowlist(id, clear ? [] : origins);
|
package/dist/cli.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
// src/main.ts
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
var embeddedVersion = "0.0.15-dev.
|
|
9
|
+
var embeddedVersion = "0.0.15-dev.111";
|
|
10
10
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
|
|
11
11
|
var command = process.argv[2];
|
|
12
12
|
var args = process.argv.slice(3);
|
|
@@ -17,29 +17,29 @@ var askedForHelp = command === "--help" || command === "-h" || options.some((arg
|
|
|
17
17
|
var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
|
|
18
18
|
if (command !== "--version" && command !== "-v" && !askedForHelp && !process.env.OPENCODE_BROWSER_HOME && legacyRoots().some((root) => fs.existsSync(root))) {
|
|
19
19
|
try {
|
|
20
|
-
const { migrateLegacy } = await import("./migrate-
|
|
20
|
+
const { migrateLegacy } = await import("./migrate-bynvsqpe.mjs");
|
|
21
21
|
migrateLegacy();
|
|
22
22
|
} catch {}
|
|
23
23
|
}
|
|
24
24
|
if (command === "--version" || command === "-v") {
|
|
25
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
25
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-pkmxp5at.mjs")).opencodeBrowserVersion;
|
|
26
26
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
27
27
|
`);
|
|
28
|
-
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-
|
|
29
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
28
|
+
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-xavypw3x.mjs")).supervisesMcp()) {
|
|
29
|
+
const { runBinaryMcp } = await import("./supervisor-xavypw3x.mjs");
|
|
30
30
|
await runBinaryMcp(process.argv.slice(3));
|
|
31
31
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
32
|
-
const { NodeRuntime } = await import("./index-
|
|
33
|
-
const { runMcpServer } = await import("./mcp-
|
|
32
|
+
const { NodeRuntime } = await import("./index-6gkr235e.mjs");
|
|
33
|
+
const { runMcpServer } = await import("./mcp-cstaf6x0.mjs");
|
|
34
34
|
runMcpServer.pipe(NodeRuntime.runMain);
|
|
35
35
|
} else if (command === "self-update" || command === "runtime-switch") {
|
|
36
|
-
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-
|
|
36
|
+
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-6gpw6b15.mjs");
|
|
37
37
|
await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
|
|
38
38
|
} else if (command === "update" && !askedForHelp) {
|
|
39
|
-
const { runUpdateCommand } = await import("./update-
|
|
39
|
+
const { runUpdateCommand } = await import("./update-v09y9tza.mjs");
|
|
40
40
|
await runUpdateCommand(process.argv.slice(3));
|
|
41
41
|
} else if (command && setupCommands.has(command) && !askedForHelp) {
|
|
42
|
-
const { runSetup } = await import("./setup-
|
|
42
|
+
const { runSetup } = await import("./setup-aca4zwxc.mjs");
|
|
43
43
|
await runSetup(command, process.argv.slice(3));
|
|
44
44
|
} else {
|
|
45
45
|
if (preCliHelp || !command || command === "--help" || command === "-h") {
|
|
@@ -67,7 +67,7 @@ if (command === "--version" || command === "-v") {
|
|
|
67
67
|
install, npm install -g for an npm one); --check only says whether there's an
|
|
68
68
|
update. A git clone pulls the newer commits and runs setup again.
|
|
69
69
|
uninstall [--yes] Remove everything install set up (--yes skips confirming that stored
|
|
70
|
-
secret profiles are deleted)
|
|
70
|
+
secret profiles and site secrets are deleted)
|
|
71
71
|
|
|
72
72
|
browse keeps its files in $XDG_CONFIG_HOME/browse, $XDG_DATA_HOME/browse, $XDG_STATE_HOME/browse and
|
|
73
73
|
$XDG_CACHE_HOME/browse (defaults under ~/.config, ~/.local/share, ~/.local/state and ~/.cache), and the
|
|
@@ -76,9 +76,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
|
|
|
76
76
|
`);
|
|
77
77
|
}
|
|
78
78
|
if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
|
|
79
|
-
const { printSetupStatus } = await import("./setup-
|
|
79
|
+
const { printSetupStatus } = await import("./setup-aca4zwxc.mjs");
|
|
80
80
|
printSetupStatus();
|
|
81
81
|
}
|
|
82
|
-
const { runCli } = await import("./cli-
|
|
82
|
+
const { runCli } = await import("./cli-qbevp261.mjs");
|
|
83
83
|
runCli(preCliHelp ? ["--help"] : undefined);
|
|
84
84
|
}
|
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
isRestrictedTarget2,
|
|
33
33
|
isRestrictedUrl2,
|
|
34
34
|
dataUrlDocument2
|
|
35
|
-
} from "./main-
|
|
36
|
-
import"./main-
|
|
35
|
+
} from "./main-zptcnvy8.mjs";
|
|
36
|
+
import"./main-azpzpy0x.mjs";
|
|
37
37
|
import"./main-mrew6jy8.mjs";
|
|
38
38
|
export {
|
|
39
39
|
HttpRouteError2 as HttpRouteError,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-azpzpy0x.mjs";
|
|
4
4
|
import {
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-p8dn427e.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-agbjz9vc.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|