@opencode/server 0.0.0-dev-1357 → 0.0.0-dev-1359
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/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/api-0tgs6603.js +108 -0
- package/dist/chunks/{pairing-cwx7pqk1.js → api-0wjm8gvs.js} +3 -3
- package/dist/chunks/{pairing-10sj2tcf.js → api-10sj2tcf.js} +1 -1
- package/dist/chunks/{pairing-mp1tvqh7.js → api-1eazfxyk.js} +4 -4
- package/dist/chunks/{pairing-rktygpea.js → api-29nx48hm.js} +4 -1
- package/dist/chunks/{pairing-2tmcamrc.js → api-2tmcamrc.js} +2 -2
- package/dist/chunks/api-343ey9kd.js +189 -0
- package/dist/chunks/{pairing-39nnfjx1.js → api-39nnfjx1.js} +1 -1
- package/dist/chunks/{pairing-yjbzmfhm.js → api-3te71694.js} +5 -5
- package/dist/chunks/{pairing-ed0tz0nn.js → api-4aa8a7eb.js} +14 -12
- package/dist/chunks/{pairing-qssmdh31.js → api-5jwtxv1w.js} +4 -4
- package/dist/chunks/{pairing-6pm6ek88.js → api-6pm6ek88.js} +1 -1
- package/dist/chunks/{pairing-74nxvsrn.js → api-74nxvsrn.js} +2 -2
- package/dist/chunks/{pairing-7dkb5ks8.js → api-7dkb5ks8.js} +2 -2
- package/dist/chunks/{pairing-8fhq523v.js → api-8fhq523v.js} +4 -4
- package/dist/chunks/{pairing-8nezxn08.js → api-8nezxn08.js} +1 -1
- package/dist/chunks/{pairing-8qsq6tbs.js → api-8qsq6tbs.js} +2 -2
- package/dist/chunks/{pairing-8sb6qqpn.js → api-8sb6qqpn.js} +1 -1
- package/dist/chunks/{pairing-8xdajgpr.js → api-8xdajgpr.js} +2 -2
- package/dist/chunks/api-9hynp6rm.js +20 -0
- package/dist/chunks/{pairing-am27j67f.js → api-am27j67f.js} +1 -1
- package/dist/chunks/{pairing-ba6cev85.js → api-ba6cev85.js} +4 -4
- package/dist/chunks/{pairing-br4x4prt.js → api-br4x4prt.js} +1 -1
- package/dist/chunks/{pairing-ca564221.js → api-ca564221.js} +1 -1
- package/dist/chunks/{pairing-csnx1nj3.js → api-csnx1nj3.js} +2 -2
- package/dist/chunks/{pairing-djr0jy89.js → api-djr0jy89.js} +1 -1
- package/dist/chunks/{pairing-ehyp3zqd.js → api-ehyp3zqd.js} +1 -1
- package/dist/chunks/{pairing-em7ed65n.js → api-em7ed65n.js} +2 -2
- package/dist/chunks/{pairing-exwy1kbj.js → api-exwy1kbj.js} +2 -2
- package/dist/chunks/{pairing-f3gr6hfv.js → api-f3gr6hfv.js} +2 -2
- package/dist/chunks/{pairing-fvpjvjpp.js → api-fvpjvjpp.js} +1 -1
- package/dist/chunks/{pairing-darcrm5x.js → api-g1xn52zf.js} +8 -8
- package/dist/chunks/{pairing-50kbksvb.js → api-g23ffrnz.js} +2 -2
- package/dist/chunks/{pairing-bng99jk3.js → api-gbjwxtsb.js} +15 -11
- package/dist/chunks/{pairing-j4at0y5c.js → api-j4at0y5c.js} +1 -1
- package/dist/chunks/{pairing-javgytnb.js → api-javgytnb.js} +2 -2
- package/dist/chunks/{pairing-k74zefsg.js → api-k74zefsg.js} +1 -1
- package/dist/chunks/{pairing-kmwr1xw9.js → api-kmwr1xw9.js} +3 -3
- package/dist/chunks/{pairing-kshqfq8s.js → api-kshqfq8s.js} +2 -2
- package/dist/chunks/{pairing-myqk22k5.js → api-myqk22k5.js} +2 -2
- package/dist/chunks/{pairing-w9jcwh65.js → api-mzs0n5xz.js} +7 -7
- package/dist/chunks/{pairing-n2zyxnzr.js → api-n2zyxnzr.js} +1 -1
- package/dist/chunks/{pairing-p3bbq7g3.js → api-p3bbq7g3.js} +1 -1
- package/dist/chunks/{pairing-prwd5gwt.js → api-prwd5gwt.js} +2 -2
- package/dist/chunks/{pairing-qq3f8fnn.js → api-qq3f8fnn.js} +2 -2
- package/dist/chunks/{pairing-rgbnpstw.js → api-rgbnpstw.js} +2 -2
- package/dist/chunks/{pairing-rjhxbsc4.js → api-rjhxbsc4.js} +2 -2
- package/dist/chunks/{pairing-s0zgx365.js → api-s0zgx365.js} +2 -2
- package/dist/chunks/{pairing-t32e1bbt.js → api-t32e1bbt.js} +1 -1
- package/dist/chunks/{pairing-t5vqvama.js → api-thpam3yh.js} +5 -5
- package/dist/chunks/{pairing-g4964mny.js → api-ts1fhe9d.js} +3 -3
- package/dist/chunks/{pairing-whvq72as.js → api-whvq72as.js} +3 -3
- package/dist/chunks/{pairing-wsvmph03.js → api-wsvmph03.js} +2 -2
- package/dist/chunks/{pairing-x2qy7jg1.js → api-x2qy7jg1.js} +1 -1
- package/dist/chunks/{pairing-yc92za0p.js → api-yc92za0p.js} +2 -2
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +1 -1
- package/dist/fetch.d.ts +1 -1
- package/dist/fetch.js +63 -61
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.js +2 -2
- package/dist/handlers/blob.js +3 -3
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.js +7 -7
- package/dist/handlers/debug.js +6 -6
- package/dist/handlers/event.js +7 -7
- package/dist/handlers/experimental/browser-tunnel.d.ts +11 -0
- package/dist/handlers/experimental/browser-tunnel.js +9 -0
- package/dist/handlers/flag.d.ts +1 -0
- package/dist/handlers/flag.js +11 -0
- package/dist/handlers/form.js +6 -6
- package/dist/handlers/fs.js +8 -8
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/machine.js +1 -1
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +2 -2
- package/dist/handlers/message.js +7 -7
- package/dist/handlers/migration.js +6 -6
- package/dist/handlers/model.js +6 -6
- package/dist/handlers/permission.js +6 -6
- package/dist/handlers/persistent-pty.d.ts +1 -1
- package/dist/handlers/persistent-pty.js +18 -17
- package/dist/handlers/plugin.js +6 -6
- package/dist/handlers/project.js +6 -6
- package/dist/handlers/provider.js +6 -6
- package/dist/handlers/pty-socket.js +1 -1
- package/dist/handlers/pty.js +8 -8
- package/dist/handlers/push.js +1 -1
- package/dist/handlers/reference.js +6 -6
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/server.js +9 -9
- package/dist/handlers/session-error.js +1 -1
- package/dist/handlers/session.js +7 -7
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/usage.js +6 -6
- package/dist/handlers/vcs.js +6 -6
- package/dist/handlers/voice.js +6 -6
- package/dist/handlers/websearch.js +6 -6
- package/dist/handlers/worktree.js +6 -6
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +56 -54
- package/dist/location.js +2 -2
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/defect-response.js +1 -1
- package/dist/middleware/form-location.js +3 -3
- package/dist/middleware/schema-error.js +1 -1
- package/dist/middleware/session-location.js +3 -3
- package/dist/pairing.js +3 -3
- package/dist/process.js +73 -63
- package/dist/range.js +1 -1
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +60 -58
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +1 -1
- package/dist/workerd.d.ts +5 -5
- package/dist/workerd.js +66 -93
- package/package.json +8 -8
- package/dist/chunks/pairing-dms2vwqd.js +0 -105
- /package/dist/chunks/{pairing-017ycvbx.js → api-017ycvbx.js} +0 -0
- /package/dist/chunks/{pairing-9rqn6x4v.js → api-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{pairing-bd8755ek.js → api-bd8755ek.js} +0 -0
- /package/dist/chunks/{pairing-n26yr6pw.js → api-n26yr6pw.js} +0 -0
- /package/dist/chunks/{pairing-q187pxxd.js → api-q187pxxd.js} +0 -0
- /package/dist/chunks/{pairing-q4bn6dy8.js → api-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{pairing-qpnw2qd1.js → api-qpnw2qd1.js} +0 -0
- /package/dist/chunks/{pairing-rqgv9x42.js → api-rqgv9x42.js} +0 -0
- /package/dist/chunks/{pairing-xthc02cw.js → api-xthc02cw.js} +0 -0
- /package/dist/chunks/{pairing-yc7nft6q.js → api-yc7nft6q.js} +0 -0
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./api-br4x4prt.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./api-whvq72as.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./api-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2,
|
|
15
15
|
holdLocation2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./api-q187pxxd.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/mcp.ts
|
|
19
19
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-br4x4prt.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./api-whvq72as.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-whvq72as.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
10
|
-
import {
|
|
11
|
-
Service4
|
|
12
|
-
} from "./pairing-yjbzmfhm.js";
|
|
9
|
+
} from "./api-j4at0y5c.js";
|
|
13
10
|
import {
|
|
14
11
|
Service3
|
|
15
|
-
} from "./
|
|
12
|
+
} from "./api-3te71694.js";
|
|
13
|
+
import {
|
|
14
|
+
Service4
|
|
15
|
+
} from "./api-mzs0n5xz.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -22,10 +22,10 @@ import { HttpApiBuilder } from "effect/http-api";
|
|
|
22
22
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
23
23
|
import { UnauthorizedError } from "@opencode/protocol/errors";
|
|
24
24
|
var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
|
|
25
|
-
const pairing = yield*
|
|
25
|
+
const pairing = yield* Service4;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
|
-
const info = yield*
|
|
28
|
+
const info = yield* Service3;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -1,35 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-whvq72as.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./api-javgytnb.js";
|
|
11
11
|
import {
|
|
12
12
|
makeBlobGet2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./api-g23ffrnz.js";
|
|
14
|
+
import {
|
|
15
|
+
makeBrowserTunnel2
|
|
16
|
+
} from "./api-343ey9kd.js";
|
|
14
17
|
import {
|
|
15
18
|
makeAutomation2
|
|
16
|
-
} from "./
|
|
19
|
+
} from "./api-6pm6ek88.js";
|
|
17
20
|
import {
|
|
18
21
|
makeJob2
|
|
19
|
-
} from "./
|
|
22
|
+
} from "./api-x2qy7jg1.js";
|
|
20
23
|
import {
|
|
21
24
|
makeMachineLink2,
|
|
22
25
|
makeMachine2
|
|
23
|
-
} from "./
|
|
26
|
+
} from "./api-017ycvbx.js";
|
|
24
27
|
import {
|
|
25
28
|
makeMediaGet2
|
|
26
|
-
} from "./
|
|
29
|
+
} from "./api-djr0jy89.js";
|
|
27
30
|
import {
|
|
28
31
|
makePush2
|
|
29
|
-
} from "./
|
|
32
|
+
} from "./api-qpnw2qd1.js";
|
|
30
33
|
import {
|
|
31
34
|
runPtySocket2
|
|
32
|
-
} from "./
|
|
35
|
+
} from "./api-q187pxxd.js";
|
|
33
36
|
|
|
34
37
|
// src/handlers/persistent-pty.ts
|
|
35
38
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -60,8 +63,9 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
60
63
|
const automation = yield* makeAutomation2;
|
|
61
64
|
const machine = yield* makeMachine2;
|
|
62
65
|
const machineLink = yield* makeMachineLink2;
|
|
66
|
+
const browserTunnel = yield* makeBrowserTunnel2;
|
|
63
67
|
const push = yield* makePush2;
|
|
64
|
-
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("push.get", () => push.get()).handle("push.device.register", (ctx) => push.register(ctx.params.deviceID, ctx.payload)).handle("push.device.remove", (ctx) => push.remove(ctx.params.deviceID)).handle("push.device.update", (ctx) => push.update(ctx.params.deviceID, ctx.payload)).handle("push.device.session.set", (ctx) => push.setDeviceBell(ctx.params.deviceID, ctx.params.sessionID, ctx.payload)).handle("push.device.session.remove", (ctx) => push.removeDeviceBell(ctx.params.deviceID, ctx.params.sessionID)).handle("push.session.set", (ctx) => push.setSessionBell(ctx.params.sessionID, ctx.payload)).handle("push.session.remove", (ctx) => push.removeSessionBell(ctx.params.sessionID)).handle("push.settings.set", (ctx) => push.setSettings(ctx.payload)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
|
|
68
|
+
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handleRaw("browser.tunnel", (ctx) => browserTunnel(ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("push.get", () => push.get()).handle("push.device.register", (ctx) => push.register(ctx.params.deviceID, ctx.payload)).handle("push.device.remove", (ctx) => push.remove(ctx.params.deviceID)).handle("push.device.update", (ctx) => push.update(ctx.params.deviceID, ctx.payload)).handle("push.device.session.set", (ctx) => push.setDeviceBell(ctx.params.deviceID, ctx.params.sessionID, ctx.payload)).handle("push.device.session.remove", (ctx) => push.removeDeviceBell(ctx.params.deviceID, ctx.params.sessionID)).handle("push.session.set", (ctx) => push.setSessionBell(ctx.params.sessionID, ctx.payload)).handle("push.session.remove", (ctx) => push.removeSessionBell(ctx.params.sessionID)).handle("push.settings.set", (ctx) => push.setSettings(ctx.payload)).handle("artifacts.providers", (ctx) => artifact.providers(ctx.query, ctx.request)).handle("artifacts.list", (ctx) => artifact.list(ctx.query, ctx.request)).handle("artifacts.create", (ctx) => artifact.create(ctx.query, ctx.payload, ctx.request)).handle("artifacts.get", (ctx) => artifact.get(ctx.params.artifactID, ctx.query, ctx.request)).handle("artifacts.update", (ctx) => artifact.update(ctx.params.artifactID, ctx.query, ctx.payload, ctx.request)).handle("artifacts.delete", (ctx) => artifact.remove(ctx.params.artifactID, ctx.query, ctx.request)).handleRaw("artifacts.view", (ctx) => artifact.view(ctx.params.artifactID, ctx.query, ctx.request)).handle("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
|
|
65
69
|
return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
|
|
66
70
|
})).handle("persistentPty.list", Effect.fn(function* (ctx) {
|
|
67
71
|
return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-rqgv9x42.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./api-br4x4prt.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/artifact.ts
|
|
11
11
|
import { Artifact } from "@opencode/core/artifact";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-rqgv9x42.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./api-br4x4prt.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./api-whvq72as.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-whvq72as.js";
|
|
4
4
|
import {
|
|
5
5
|
Service2,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-fvpjvjpp.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/event.ts
|
|
10
10
|
import { Event } from "@opencode/schema/event";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/pairing.ts
|
|
6
6
|
var exports_pairing = {};
|
|
7
7
|
__export(exports_pairing, {
|
|
8
8
|
ServerPairing: () => exports_pairing,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service4,
|
|
10
10
|
node: () => node2
|
|
11
11
|
});
|
|
12
12
|
import { Cache, Context, Duration, Effect, Layer } from "effect";
|
|
@@ -14,12 +14,12 @@ import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
|
14
14
|
import { randomBytes } from "node:crypto";
|
|
15
15
|
var TTL = Duration.minutes(5);
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class Service4 extends Context.Service()("@opencode/ServerPairing") {
|
|
18
18
|
}
|
|
19
19
|
var noLookup = () => Effect.die(new Error("ServerPairing cache must be used via set/invalidateWhen, never get"));
|
|
20
|
-
var layer = Layer.effect(
|
|
20
|
+
var layer = Layer.effect(Service4, Effect.gen(function* () {
|
|
21
21
|
const cache = yield* Cache.make({ capacity: 1000, lookup: noLookup, timeToLive: TTL });
|
|
22
|
-
return
|
|
22
|
+
return Service4.of({
|
|
23
23
|
issue: Effect.fn("ServerPairing.issue")(function* () {
|
|
24
24
|
const code = randomBytes(16).toString("base64url");
|
|
25
25
|
yield* Cache.set(cache, code, true);
|
|
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}));
|
|
33
|
-
var node2 = makeGlobalNode({ service:
|
|
33
|
+
var node2 = makeGlobalNode({ service: Service4, layer, deps: [] });
|
|
34
34
|
|
|
35
|
-
export {
|
|
35
|
+
export { Service4, node2, exports_pairing };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./api-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./api-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./api-4aa8a7eb.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./api-9rqn6x4v.js";
|
|
16
16
|
|
|
17
17
|
// src/fetch.ts
|
|
18
18
|
var exports_fetch = {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-rqgv9x42.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-whvq72as.js";
|
|
8
8
|
import {
|
|
9
9
|
wantsMediaRefs2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./api-xthc02cw.js";
|
|
11
11
|
|
|
12
12
|
// src/handlers/message.ts
|
|
13
13
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-br4x4prt.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./api-ca564221.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./api-ehyp3zqd.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
package/dist/content-headers.js
CHANGED
package/dist/cors.js
CHANGED
package/dist/event-feed.js
CHANGED
package/dist/fetch.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare const makeWithContext: (options?: {
|
|
|
63
63
|
} | undefined;
|
|
64
64
|
} | undefined, boot?: BootOptions | undefined) => Effect.Effect<{
|
|
65
65
|
handler: (request: Request, context?: Context.Context<never> | undefined) => Promise<globalThis.Response>;
|
|
66
|
-
context: Context.Context<import("@opencode/core/shell").Daemon | import("effect/http/HttpClient").HttpClient | HttpRouter.HttpRouter | import("@opencode/util/fs-util").FSUtil.Service | import("@opencode/util/global").Service | import("@opencode/core/database/database").Service | import("@opencode/core/app").Service | import("@opencode/core/credential").Service | import("@opencode/core/kv").Service | import("@opencode/core/wellknown").Service | import("@opencode/core/session/instruction-entry").Service | import("@opencode/core/job").Service | import("@opencode/core/machine/identity").Service | import("@opencode/core/machine/machines").Service | import("@opencode/core/workspace").Service | import("@opencode/core/permission/saved").Service | import("@opencode/core/codemode/api").Service | import("@opencode/core/location-service-map").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/session").Service | import("@opencode/core/automation").Service | import("@opencode/core/worktree").Service | import("@opencode/core/blob-store").Service | import("@opencode/core/session/search-build").Service | import("@opencode/core/video-generation").Service | import("@opencode/core/plugin/sdk").Service | import("@opencode/core/plugin/update").Service | import("@opencode/core/instance").Service | import("@opencode/core/bus").Service | import("@opencode/core/project").Service | SessionRestart.Service | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("@opencode/core/location-activity").Service | import("@opencode/core/push/list").Service | import("@opencode/core/push/sender").Service | import("@opencode/core/filesystem/file-watch").Service | import("./pairing").Service>;
|
|
66
|
+
context: Context.Context<import("@opencode/core/shell").Daemon | import("effect/http/HttpClient").HttpClient | HttpRouter.HttpRouter | import("@opencode/util/fs-util").FSUtil.Service | import("@opencode/util/global").Service | import("@opencode/core/database/database").Service | import("@opencode/core/app").Service | import("@opencode/core/credential").Service | import("@opencode/core/kv").Service | import("@opencode/core/wellknown").Service | import("@opencode/core/session/instruction-entry").Service | import("@opencode/core/job").Service | import("@opencode/core/machine/identity").Service | import("@opencode/core/machine/machines").Service | import("@opencode/core/workspace").Service | import("@opencode/core/permission/saved").Service | import("@opencode/core/codemode/api").Service | import("@opencode/core/location-service-map").Service | import("@opencode/core/persistent-pty/index").Service | import("@opencode/core/session").Service | import("@opencode/core/automation").Service | import("@opencode/core/worktree").Service | import("@opencode/core/blob-store").Service | import("@opencode/core/session/search-build").Service | import("@opencode/core/video-generation").Service | import("@opencode/core/experimental/browser-tunnel").Service | import("@opencode/core/plugin/sdk").Service | import("@opencode/core/plugin/update").Service | import("@opencode/core/instance").Service | import("@opencode/core/bus").Service | import("@opencode/core/project").Service | SessionRestart.Service | import("@opencode/core/pty/ticket").Service | import("@opencode/core/session/transfer").Service | import("@opencode/core/location-activity").Service | import("@opencode/core/push/list").Service | import("@opencode/core/push/sender").Service | import("@opencode/core/filesystem/file-watch").Service | import("./pairing").Service>;
|
|
67
67
|
}, Error, import("effect/Scope").Scope>;
|
|
68
68
|
/**
|
|
69
69
|
* Builds a web-standard fetch handler — `(request: Request) => Promise<Response>` — serving the
|