@opencode/server 0.0.0-dev-1360 → 0.0.0-dev-1362
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.d.ts +171 -2
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{auth-ca564221.js → service-status-0dfmev2z.js} +1 -1
- package/dist/chunks/{auth-xcshf76p.js → service-status-10r1zt22.js} +7 -8
- package/dist/chunks/{auth-29nx48hm.js → service-status-29nx48hm.js} +1 -1
- package/dist/chunks/{auth-10sj2tcf.js → service-status-2h3x7256.js} +1 -1
- package/dist/chunks/{auth-rgbnpstw.js → service-status-341zm3rs.js} +2 -2
- package/dist/chunks/{auth-nvb61mgq.js → service-status-4gs63nyp.js} +4 -4
- package/dist/chunks/service-status-4gt38746.js +111 -0
- package/dist/chunks/{auth-59yyxpa4.js → service-status-4rg1tmcj.js} +8 -8
- package/dist/chunks/{auth-enx9e1dz.js → service-status-4th25279.js} +4 -4
- package/dist/chunks/{auth-g23ffrnz.js → service-status-50kbksvb.js} +2 -2
- package/dist/chunks/{auth-2p8psxn9.js → service-status-5h6n6h4q.js} +24 -23
- package/dist/chunks/{auth-z3e7v67k.js → service-status-5pdfedjd.js} +5 -5
- package/dist/chunks/{auth-w9jcwh65.js → service-status-69weg9qz.js} +8 -8
- package/dist/chunks/{auth-6pm6ek88.js → service-status-6pm6ek88.js} +1 -1
- package/dist/chunks/{auth-br4x4prt.js → service-status-72bf7qt9.js} +3 -3
- package/dist/chunks/{auth-tjxfj8xj.js → service-status-7p3x8m34.js} +33 -16
- package/dist/chunks/{auth-n2zyxnzr.js → service-status-7tv8nec1.js} +1 -1
- package/dist/chunks/{auth-wsvmph03.js → service-status-844nmnmk.js} +2 -2
- package/dist/chunks/{auth-8sb6qqpn.js → service-status-8sb6qqpn.js} +1 -1
- package/dist/chunks/{auth-whvq72as.js → service-status-8y4d9f30.js} +3 -3
- package/dist/chunks/{auth-1z9qd4y2.js → service-status-9vfv9n1y.js} +4 -4
- package/dist/chunks/{auth-csnx1nj3.js → service-status-bcs2rr9e.js} +2 -2
- package/dist/chunks/{auth-rjhxbsc4.js → service-status-cgcw2b0e.js} +2 -2
- package/dist/chunks/{auth-djr0jy89.js → service-status-djr0jy89.js} +1 -1
- package/dist/chunks/{auth-0q7s66m2.js → service-status-e6e4kz0w.js} +4 -4
- package/dist/chunks/{auth-g4964mny.js → service-status-evw6vf0s.js} +3 -3
- package/dist/chunks/{auth-7dkb5ks8.js → service-status-fcw485c9.js} +2 -2
- package/dist/chunks/{auth-am27j67f.js → service-status-fegnxd42.js} +1 -1
- package/dist/chunks/{auth-ehyp3zqd.js → service-status-fsvp99pe.js} +1 -1
- package/dist/chunks/{auth-k74zefsg.js → service-status-ggw25rqf.js} +1 -1
- package/dist/chunks/{auth-em7ed65n.js → service-status-gqstb6bx.js} +2 -2
- package/dist/chunks/{auth-j4at0y5c.js → service-status-j4at0y5c.js} +1 -1
- package/dist/chunks/{auth-8xdajgpr.js → service-status-j605n900.js} +2 -2
- package/dist/chunks/{auth-javgytnb.js → service-status-j6y32kmq.js} +2 -2
- package/dist/chunks/{auth-8nezxn08.js → service-status-k12h8tw9.js} +1 -1
- package/dist/chunks/{auth-f3gr6hfv.js → service-status-kc553r92.js} +2 -2
- package/dist/chunks/service-status-mj1ewmp1.js +219 -0
- package/dist/chunks/{auth-myqk22k5.js → service-status-myqk22k5.js} +2 -2
- package/dist/chunks/{auth-p3bbq7g3.js → service-status-ntf3tw9k.js} +1 -1
- package/dist/chunks/{auth-qssmdh31.js → service-status-pp5985xb.js} +4 -4
- package/dist/chunks/{auth-8qsq6tbs.js → service-status-qcnb494j.js} +2 -2
- package/dist/chunks/{auth-yc92za0p.js → service-status-qgjb3f4w.js} +2 -2
- package/dist/chunks/{auth-1aar1z9e.js → service-status-qw2j92v5.js} +5 -5
- package/dist/chunks/{auth-0wjm8gvs.js → service-status-r5yb7twv.js} +2 -2
- package/dist/chunks/{auth-74nxvsrn.js → service-status-r9w3a44p.js} +7 -4
- package/dist/chunks/{auth-s0zgx365.js → service-status-sn8sqewc.js} +2 -2
- package/dist/chunks/{auth-t32e1bbt.js → service-status-t32e1bbt.js} +1 -1
- package/dist/chunks/{auth-exwy1kbj.js → service-status-tktas153.js} +2 -2
- package/dist/chunks/{auth-ka2mtp6f.js → service-status-vyjhrbg0.js} +2 -2
- package/dist/chunks/{auth-gaegw7xv.js → service-status-w7n3bfa8.js} +16 -12
- package/dist/chunks/{auth-kmwr1xw9.js → service-status-ws2ckpmb.js} +3 -3
- package/dist/chunks/{auth-x2qy7jg1.js → service-status-x2qy7jg1.js} +1 -1
- package/dist/chunks/service-status-xw05m515.js +49 -0
- package/dist/chunks/{auth-2tmcamrc.js → service-status-yvy5qft7.js} +2 -2
- package/dist/chunks/{auth-9hynp6rm.js → service-status-z564cb4b.js} +2 -2
- package/dist/chunks/{auth-prwd5gwt.js → service-status-zmrq0y42.js} +2 -2
- package/dist/chunks/{auth-qq3f8fnn.js → service-status-zs3a96ke.js} +2 -2
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.d.ts +14 -2
- package/dist/event-feed.js +7 -7
- package/dist/fetch.d.ts +1 -1
- package/dist/fetch.js +65 -63
- 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.js +4 -4
- package/dist/handlers/flag.js +6 -6
- 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 +20 -18
- 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/space.d.ts +54 -0
- package/dist/handlers/space.js +7 -0
- 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 +2 -1
- package/dist/handlers.js +58 -56
- package/dist/location.js +4 -4
- 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 +5 -5
- package/dist/process.js +68 -66
- 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 +4 -3
- package/dist/routes.js +62 -60
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +3 -3
- package/dist/space-store.d.ts +62 -0
- package/dist/space-store.js +16 -0
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +67 -65
- package/package.json +8 -8
- package/dist/chunks/auth-ey0z35hy.js +0 -108
- /package/dist/chunks/{auth-017ycvbx.js → service-status-017ycvbx.js} +0 -0
- /package/dist/chunks/{auth-9rqn6x4v.js → service-status-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{auth-bd8755ek.js → service-status-bd8755ek.js} +0 -0
- /package/dist/chunks/{auth-n26yr6pw.js → service-status-n26yr6pw.js} +0 -0
- /package/dist/chunks/{auth-q187pxxd.js → service-status-q187pxxd.js} +0 -0
- /package/dist/chunks/{auth-q4bn6dy8.js → service-status-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{auth-qpnw2qd1.js → service-status-qpnw2qd1.js} +0 -0
- /package/dist/chunks/{auth-rqgv9x42.js → service-status-rqgv9x42.js} +0 -0
- /package/dist/chunks/{auth-xthc02cw.js → service-status-xthc02cw.js} +0 -0
- /package/dist/chunks/{auth-yc7nft6q.js → service-status-yc7nft6q.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedRequestOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/request-site.ts
|
|
9
9
|
var exports_request_site = {};
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
missingMessage2,
|
|
5
5
|
failedMessageDecode2,
|
|
6
6
|
failedSnapshot2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-rqgv9x42.js";
|
|
8
8
|
import {
|
|
9
9
|
locationErrors2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./service-status-72bf7qt9.js";
|
|
11
11
|
import {
|
|
12
12
|
Api2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./service-status-8y4d9f30.js";
|
|
14
14
|
import {
|
|
15
15
|
wantsMediaRefs2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-status-xthc02cw.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/session.ts
|
|
19
19
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/provider.ts
|
|
9
9
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-5h6n6h4q.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./service-status-9rqn6x4v.js";
|
|
16
16
|
|
|
17
17
|
// src/fetch.ts
|
|
18
18
|
var exports_fetch = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/skill.ts
|
|
9
9
|
import { Skill } from "@opencode/core/skill";
|
|
@@ -13,10 +13,13 @@ import { HttpApiBuilder } from "effect/http-api";
|
|
|
13
13
|
var SkillHandler2 = HttpApiBuilder.group(Api2, "server.skill", (handlers) => handlers.handle("skill.list", () => response2(Skill.Service.use((skill) => skill.list()))).handle("skill.file", (ctx) => Effect.gen(function* () {
|
|
14
14
|
const skills = yield* Skill.Service;
|
|
15
15
|
const raw = new URL(ctx.request.url, "http://localhost").pathname.split("/").slice(6).join("/");
|
|
16
|
+
const notFound = new FileNotFoundError({ path: raw, message: `File not found: ${raw}` });
|
|
16
17
|
const file = yield* Effect.try({
|
|
17
|
-
try: () => decodeURIComponent(raw),
|
|
18
|
-
catch: () =>
|
|
18
|
+
try: () => Skill.parseFilePath(decodeURIComponent(raw)),
|
|
19
|
+
catch: () => notFound
|
|
19
20
|
});
|
|
21
|
+
if (!file)
|
|
22
|
+
return yield* notFound;
|
|
20
23
|
return yield* skills.read(ctx.params.skillID, file).pipe(Effect.catchTags({
|
|
21
24
|
"Skill.NotFoundError": (error) => Effect.fail(new SkillNotFoundError({ skill: ctx.params.skillID, message: `Skill not found: ${error.skill}` })),
|
|
22
25
|
"Skill.FileNotFoundError": (error) => Effect.fail(new FileNotFoundError({ path: error.file, message: `File not found: ${error.file}` })),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CorsConfig2,
|
|
3
3
|
isAllowedRequestOrigin2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./service-status-q4bn6dy8.js";
|
|
5
5
|
import {
|
|
6
6
|
locationErrors2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-72bf7qt9.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/experimental/browser-tunnel.ts
|
|
11
11
|
import { NodeHttpServerRequest } from "@effect/platform-node";
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-8y4d9f30.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./service-status-j6y32kmq.js";
|
|
11
11
|
import {
|
|
12
12
|
makeBlobGet2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./service-status-50kbksvb.js";
|
|
14
14
|
import {
|
|
15
15
|
makeBrowserTunnel2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-status-vyjhrbg0.js";
|
|
17
17
|
import {
|
|
18
18
|
makeAutomation2
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./service-status-6pm6ek88.js";
|
|
20
20
|
import {
|
|
21
21
|
makeJob2
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./service-status-x2qy7jg1.js";
|
|
23
23
|
import {
|
|
24
24
|
makeMachineLink2,
|
|
25
25
|
makeMachine2
|
|
26
|
-
} from "./
|
|
26
|
+
} from "./service-status-017ycvbx.js";
|
|
27
27
|
import {
|
|
28
28
|
makeMediaGet2
|
|
29
|
-
} from "./
|
|
29
|
+
} from "./service-status-djr0jy89.js";
|
|
30
30
|
import {
|
|
31
31
|
makePush2
|
|
32
|
-
} from "./
|
|
32
|
+
} from "./service-status-qpnw2qd1.js";
|
|
33
|
+
import {
|
|
34
|
+
makeSpace2
|
|
35
|
+
} from "./service-status-xw05m515.js";
|
|
33
36
|
import {
|
|
34
37
|
runPtySocket2
|
|
35
|
-
} from "./
|
|
38
|
+
} from "./service-status-q187pxxd.js";
|
|
36
39
|
|
|
37
40
|
// src/handlers/persistent-pty.ts
|
|
38
41
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -58,6 +61,7 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
58
61
|
const pty = yield* PersistentPty.Service;
|
|
59
62
|
const artifact = yield* makeArtifact2;
|
|
60
63
|
const job = yield* makeJob2;
|
|
64
|
+
const space = yield* makeSpace2;
|
|
61
65
|
const mediaGet = yield* makeMediaGet2;
|
|
62
66
|
const blobGet = yield* makeBlobGet2;
|
|
63
67
|
const automation = yield* makeAutomation2;
|
|
@@ -65,7 +69,7 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
65
69
|
const machineLink = yield* makeMachineLink2;
|
|
66
70
|
const browserTunnel = yield* makeBrowserTunnel2;
|
|
67
71
|
const push = yield* makePush2;
|
|
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) {
|
|
72
|
+
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("space.write", (ctx) => space.write(ctx.payload.changes)).handle("space.sync", (ctx) => space.sync(ctx.payload.spaces)).handle("space.subscribe", (ctx) => space.subscribe(ctx.payload)).handle("space.unsubscribe", (ctx) => space.unsubscribe(ctx.payload)).handle("space.reset", () => space.reset()).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) {
|
|
69
73
|
return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
|
|
70
74
|
})).handle("persistentPty.list", Effect.fn(function* (ctx) {
|
|
71
75
|
return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-rqgv9x42.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-72bf7qt9.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./service-status-8y4d9f30.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Service2
|
|
3
|
+
} from "./service-status-mj1ewmp1.js";
|
|
4
|
+
|
|
5
|
+
// src/handlers/space.ts
|
|
6
|
+
import { InvalidRequestError } from "@opencode/protocol/errors";
|
|
7
|
+
import { Space } from "@opencode/schema/space";
|
|
8
|
+
import { Effect } from "effect";
|
|
9
|
+
import { HttpApiSchema } from "effect/http-api";
|
|
10
|
+
var streamNotFound = () => new InvalidRequestError({ message: "No open event stream has this ID", kind: "stream_not_found", field: "stream" });
|
|
11
|
+
var repeated = (spaces) => new Set(spaces).size !== spaces.length;
|
|
12
|
+
var repeatedSpace = () => new InvalidRequestError({ message: "Each space may appear only once", field: "spaces" });
|
|
13
|
+
var makeSpace2 = Effect.gen(function* () {
|
|
14
|
+
const store = yield* Service2;
|
|
15
|
+
return {
|
|
16
|
+
write: Effect.fn("SpaceHandler.write")(function* (changes) {
|
|
17
|
+
const encoder = new TextEncoder;
|
|
18
|
+
const bytes = changes.reduce((total, change) => total + (change.value === null ? 0 : encoder.encode(change.value).length), 0);
|
|
19
|
+
if (bytes > Space.MaxValueBytes)
|
|
20
|
+
return yield* new InvalidRequestError({ message: "Values exceed 1 MiB of UTF-8 in total", field: "changes" });
|
|
21
|
+
return { spaces: yield* store.write(changes) };
|
|
22
|
+
}),
|
|
23
|
+
sync: Effect.fn("SpaceHandler.sync")(function* (spaces) {
|
|
24
|
+
if (repeated(spaces.map((item) => item.space)))
|
|
25
|
+
return yield* repeatedSpace();
|
|
26
|
+
return { pages: yield* store.sync(spaces) };
|
|
27
|
+
}),
|
|
28
|
+
subscribe: Effect.fn("SpaceHandler.subscribe")(function* (payload) {
|
|
29
|
+
if (repeated(payload.spaces.map((item) => item.space)))
|
|
30
|
+
return yield* repeatedSpace();
|
|
31
|
+
if (!(yield* store.subscribe(payload.stream, payload.spaces)))
|
|
32
|
+
return yield* streamNotFound();
|
|
33
|
+
return HttpApiSchema.NoContent.make();
|
|
34
|
+
}),
|
|
35
|
+
unsubscribe: Effect.fn("SpaceHandler.unsubscribe")(function* (payload) {
|
|
36
|
+
if (repeated(payload.spaces))
|
|
37
|
+
return yield* repeatedSpace();
|
|
38
|
+
if (!(yield* store.unsubscribe(payload.stream, payload.spaces)))
|
|
39
|
+
return yield* streamNotFound();
|
|
40
|
+
return HttpApiSchema.NoContent.make();
|
|
41
|
+
}),
|
|
42
|
+
reset: Effect.fn("SpaceHandler.reset")(function* () {
|
|
43
|
+
yield* store.resetEpoch;
|
|
44
|
+
return HttpApiSchema.NoContent.make();
|
|
45
|
+
})
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { makeSpace2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/generate.ts
|
|
9
9
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/websearch.ts
|
|
9
9
|
import { WebSearch } from "@opencode/core/websearch";
|
package/dist/content-headers.js
CHANGED
package/dist/cors.js
CHANGED
package/dist/event-feed.d.ts
CHANGED
|
@@ -19,7 +19,18 @@ export declare class EncodingError extends EncodingError_base {
|
|
|
19
19
|
}
|
|
20
20
|
export type Error = SubscriberOverflowError | EncodingError;
|
|
21
21
|
export interface Interface {
|
|
22
|
-
|
|
22
|
+
/** Opens a stream of encoded events, with the random ID that addresses it, e.g. to subscribe it to more events. */
|
|
23
|
+
readonly subscribe: (types?: ReadonlyArray<string>) => Effect.Effect<{
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly events: Stream.Stream<string, Error>;
|
|
26
|
+
}, never, Scope.Scope>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Adds events from outside the bus. `open` runs once for each stream, with its ID and a `send` that reaches that
|
|
30
|
+
* stream, whatever its `types`, until the stream closes along with the scope `open` gets.
|
|
31
|
+
*/
|
|
32
|
+
export interface Extension {
|
|
33
|
+
readonly open: (stream: string, send: (event: OpenCodeEvent) => Effect.Effect<void>) => Effect.Effect<void, never, Scope.Scope>;
|
|
23
34
|
}
|
|
24
35
|
declare const Service_base: Context.ServiceClass<Service, "@opencode/server/EventFeed", Interface>;
|
|
25
36
|
export declare class Service extends Service_base {
|
|
@@ -28,5 +39,6 @@ export declare function frame(event: OpenCodeEvent): string;
|
|
|
28
39
|
export declare const make: (observe: (subscriber: Bus.Subscriber) => Effect.Effect<Bus.Unsubscribe>, options?: {
|
|
29
40
|
readonly capacity?: number;
|
|
30
41
|
readonly encode?: (event: OpenCodeEvent) => string;
|
|
42
|
+
readonly extensions?: ReadonlyArray<Extension>;
|
|
31
43
|
} | undefined) => Effect.Effect<Interface, never, Scope.Scope>;
|
|
32
|
-
export declare const layer: Layer.Layer<Service, never, Bus.Service
|
|
44
|
+
export declare const layer: <R>(...extensions: ReadonlyArray<Effect.Effect<Extension, never, R>>) => Layer.Layer<Service, never, Bus.Service | Exclude<R, Scope.Scope>>;
|
package/dist/event-feed.js
CHANGED
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
SubscriberCapacity2,
|
|
3
3
|
SubscriberOverflowError2,
|
|
4
4
|
EncodingError2,
|
|
5
|
-
|
|
5
|
+
Service5,
|
|
6
6
|
frame2,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
make4,
|
|
8
|
+
layer4,
|
|
9
9
|
exports_event_feed
|
|
10
|
-
} from "./chunks/
|
|
10
|
+
} from "./chunks/service-status-7p3x8m34.js";
|
|
11
11
|
export {
|
|
12
12
|
EncodingError2 as EncodingError,
|
|
13
13
|
exports_event_feed as EventFeed,
|
|
14
|
-
|
|
14
|
+
Service5 as Service,
|
|
15
15
|
SubscriberCapacity2 as SubscriberCapacity,
|
|
16
16
|
SubscriberOverflowError2 as SubscriberOverflowError,
|
|
17
17
|
frame2 as frame,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
layer4 as layer,
|
|
19
|
+
make4 as make
|
|
20
20
|
};
|
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/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>;
|
|
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("./space-store").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
|
package/dist/fetch.js
CHANGED
|
@@ -2,69 +2,71 @@ import {
|
|
|
2
2
|
makeWithContext2,
|
|
3
3
|
make2,
|
|
4
4
|
exports_fetch
|
|
5
|
-
} from "./chunks/
|
|
6
|
-
import"./chunks/
|
|
7
|
-
import"./chunks/
|
|
8
|
-
import"./chunks/
|
|
9
|
-
import"./chunks/
|
|
10
|
-
import"./chunks/
|
|
11
|
-
import"./chunks/
|
|
12
|
-
import"./chunks/
|
|
13
|
-
import"./chunks/
|
|
14
|
-
import"./chunks/
|
|
15
|
-
import"./chunks/
|
|
16
|
-
import"./chunks/
|
|
17
|
-
import"./chunks/
|
|
18
|
-
import"./chunks/
|
|
19
|
-
import"./chunks/
|
|
20
|
-
import"./chunks/
|
|
21
|
-
import"./chunks/
|
|
22
|
-
import"./chunks/
|
|
23
|
-
import"./chunks/
|
|
24
|
-
import"./chunks/
|
|
25
|
-
import"./chunks/
|
|
26
|
-
import"./chunks/
|
|
27
|
-
import"./chunks/
|
|
28
|
-
import"./chunks/
|
|
29
|
-
import"./chunks/
|
|
30
|
-
import"./chunks/
|
|
31
|
-
import"./chunks/
|
|
32
|
-
import"./chunks/
|
|
33
|
-
import"./chunks/
|
|
34
|
-
import"./chunks/
|
|
35
|
-
import"./chunks/
|
|
36
|
-
import"./chunks/
|
|
37
|
-
import"./chunks/
|
|
38
|
-
import"./chunks/
|
|
39
|
-
import"./chunks/
|
|
40
|
-
import"./chunks/
|
|
41
|
-
import"./chunks/
|
|
42
|
-
import"./chunks/
|
|
43
|
-
import"./chunks/
|
|
44
|
-
import"./chunks/
|
|
45
|
-
import"./chunks/
|
|
46
|
-
import"./chunks/
|
|
47
|
-
import"./chunks/
|
|
48
|
-
import"./chunks/
|
|
49
|
-
import"./chunks/
|
|
50
|
-
import"./chunks/
|
|
51
|
-
import"./chunks/
|
|
52
|
-
import"./chunks/
|
|
53
|
-
import"./chunks/
|
|
54
|
-
import"./chunks/
|
|
55
|
-
import"./chunks/
|
|
56
|
-
import"./chunks/
|
|
57
|
-
import"./chunks/
|
|
58
|
-
import"./chunks/
|
|
59
|
-
import"./chunks/
|
|
60
|
-
import"./chunks/
|
|
61
|
-
import"./chunks/
|
|
62
|
-
import"./chunks/
|
|
63
|
-
import"./chunks/
|
|
64
|
-
import"./chunks/
|
|
65
|
-
import"./chunks/
|
|
66
|
-
import"./chunks/
|
|
67
|
-
import"./chunks/
|
|
5
|
+
} from "./chunks/service-status-qw2j92v5.js";
|
|
6
|
+
import"./chunks/service-status-myqk22k5.js";
|
|
7
|
+
import"./chunks/service-status-5h6n6h4q.js";
|
|
8
|
+
import"./chunks/service-status-29nx48hm.js";
|
|
9
|
+
import"./chunks/service-status-4gt38746.js";
|
|
10
|
+
import"./chunks/service-status-w7n3bfa8.js";
|
|
11
|
+
import"./chunks/service-status-pp5985xb.js";
|
|
12
|
+
import"./chunks/service-status-4th25279.js";
|
|
13
|
+
import"./chunks/service-status-kc553r92.js";
|
|
14
|
+
import"./chunks/service-status-vyjhrbg0.js";
|
|
15
|
+
import"./chunks/service-status-ntf3tw9k.js";
|
|
16
|
+
import"./chunks/service-status-9vfv9n1y.js";
|
|
17
|
+
import"./chunks/service-status-2h3x7256.js";
|
|
18
|
+
import"./chunks/service-status-bcs2rr9e.js";
|
|
19
|
+
import"./chunks/service-status-ws2ckpmb.js";
|
|
20
|
+
import"./chunks/service-status-10r1zt22.js";
|
|
21
|
+
import"./chunks/service-status-844nmnmk.js";
|
|
22
|
+
import"./chunks/service-status-cgcw2b0e.js";
|
|
23
|
+
import"./chunks/service-status-gqstb6bx.js";
|
|
24
|
+
import"./chunks/service-status-50kbksvb.js";
|
|
25
|
+
import"./chunks/service-status-sn8sqewc.js";
|
|
26
|
+
import"./chunks/service-status-qcnb494j.js";
|
|
27
|
+
import"./chunks/service-status-6pm6ek88.js";
|
|
28
|
+
import"./chunks/service-status-fcw485c9.js";
|
|
29
|
+
import"./chunks/service-status-zs3a96ke.js";
|
|
30
|
+
import"./chunks/service-status-017ycvbx.js";
|
|
31
|
+
import"./chunks/service-status-x2qy7jg1.js";
|
|
32
|
+
import"./chunks/service-status-z564cb4b.js";
|
|
33
|
+
import"./chunks/service-status-4rg1tmcj.js";
|
|
34
|
+
import"./chunks/service-status-j6y32kmq.js";
|
|
35
|
+
import"./chunks/service-status-r5yb7twv.js";
|
|
36
|
+
import"./chunks/service-status-qpnw2qd1.js";
|
|
37
|
+
import"./chunks/service-status-djr0jy89.js";
|
|
38
|
+
import"./chunks/service-status-fegnxd42.js";
|
|
39
|
+
import"./chunks/service-status-4gs63nyp.js";
|
|
40
|
+
import"./chunks/service-status-tktas153.js";
|
|
41
|
+
import"./chunks/service-status-j605n900.js";
|
|
42
|
+
import"./chunks/service-status-yvy5qft7.js";
|
|
43
|
+
import"./chunks/service-status-xw05m515.js";
|
|
44
|
+
import"./chunks/service-status-evw6vf0s.js";
|
|
45
|
+
import"./chunks/service-status-qgjb3f4w.js";
|
|
46
|
+
import"./chunks/service-status-zmrq0y42.js";
|
|
47
|
+
import"./chunks/service-status-341zm3rs.js";
|
|
48
|
+
import"./chunks/service-status-ggw25rqf.js";
|
|
49
|
+
import"./chunks/service-status-q187pxxd.js";
|
|
50
|
+
import"./chunks/service-status-r9w3a44p.js";
|
|
51
|
+
import"./chunks/service-status-k12h8tw9.js";
|
|
52
|
+
import"./chunks/service-status-7tv8nec1.js";
|
|
53
|
+
import"./chunks/service-status-j4at0y5c.js";
|
|
54
|
+
import"./chunks/service-status-n26yr6pw.js";
|
|
55
|
+
import"./chunks/service-status-bd8755ek.js";
|
|
56
|
+
import"./chunks/service-status-mj1ewmp1.js";
|
|
57
|
+
import"./chunks/service-status-5pdfedjd.js";
|
|
58
|
+
import"./chunks/service-status-69weg9qz.js";
|
|
59
|
+
import"./chunks/service-status-xthc02cw.js";
|
|
60
|
+
import"./chunks/service-status-8y4d9f30.js";
|
|
61
|
+
import"./chunks/service-status-0dfmev2z.js";
|
|
62
|
+
import"./chunks/service-status-fsvp99pe.js";
|
|
63
|
+
import"./chunks/service-status-72bf7qt9.js";
|
|
64
|
+
import"./chunks/service-status-rqgv9x42.js";
|
|
65
|
+
import"./chunks/service-status-q4bn6dy8.js";
|
|
66
|
+
import"./chunks/service-status-7p3x8m34.js";
|
|
67
|
+
import"./chunks/service-status-yc7nft6q.js";
|
|
68
|
+
import"./chunks/service-status-t32e1bbt.js";
|
|
69
|
+
import"./chunks/service-status-8sb6qqpn.js";
|
|
68
70
|
export {
|
|
69
71
|
exports_fetch as ServerFetch,
|
|
70
72
|
make2 as make,
|