@opencode/server 0.0.0-dev-1299 → 0.0.0-dev-1302
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/{fetch-059rbh9c.js → api-059rbh9c.js} +1 -1
- package/dist/chunks/{fetch-09kw3a77.js → api-09kw3a77.js} +2 -2
- package/dist/chunks/{fetch-yqhefp4s.js → api-1h6b4sc5.js} +23 -3
- package/dist/chunks/{fetch-1ndv3m9h.js → api-1ndv3m9h.js} +4 -4
- package/dist/chunks/{fetch-2eaky32g.js → api-2eaky32g.js} +2 -2
- package/dist/chunks/{fetch-3rjhh738.js → api-3rjhh738.js} +2 -2
- package/dist/chunks/{fetch-4q6e7fh8.js → api-4q6e7fh8.js} +2 -2
- package/dist/chunks/{fetch-50bbk3b2.js → api-50bbk3b2.js} +1 -1
- package/dist/chunks/{fetch-5s0wnsg4.js → api-58psf7ej.js} +3 -3
- package/dist/chunks/{fetch-5cpb32hf.js → api-5cpb32hf.js} +1 -1
- package/dist/chunks/{fetch-6z9pvq7p.js → api-6z9pvq7p.js} +1 -1
- package/dist/chunks/{fetch-78rcgzsr.js → api-78rcgzsr.js} +1 -1
- package/dist/chunks/{fetch-7b9xm1qg.js → api-7b9xm1qg.js} +1 -1
- package/dist/chunks/{fetch-8mj7kvhm.js → api-8mj7kvhm.js} +2 -2
- package/dist/chunks/api-8sb6qqpn.js +28 -0
- package/dist/chunks/{fetch-91858wp1.js → api-91858wp1.js} +2 -2
- package/dist/chunks/{fetch-a8jcac9a.js → api-a8jcac9a.js} +1 -1
- package/dist/chunks/{fetch-az0609r6.js → api-az0609r6.js} +2 -2
- package/dist/chunks/{fetch-b3bmdkga.js → api-b3bmdkga.js} +1 -1
- package/dist/chunks/{fetch-tvqdwt6z.js → api-b6k4wrac.js} +4 -4
- package/dist/chunks/{fetch-btahnm2b.js → api-btahnm2b.js} +3 -3
- package/dist/chunks/{fetch-y9qrjf78.js → api-cdd9f8n8.js} +5 -5
- package/dist/chunks/{fetch-cezwbsk5.js → api-cezwbsk5.js} +1 -1
- package/dist/chunks/{fetch-d0edqfxx.js → api-d0edqfxx.js} +2 -2
- package/dist/chunks/{fetch-djr0jy89.js → api-djr0jy89.js} +1 -1
- package/dist/chunks/{fetch-hgh17xp5.js → api-dq1g6k8x.js} +12 -8
- package/dist/chunks/{fetch-e6e4kz0w.js → api-e6e4kz0w.js} +1 -1
- package/dist/chunks/{fetch-enp1bp7r.js → api-enp1bp7r.js} +1 -1
- package/dist/chunks/{fetch-y6b5qq9t.js → api-ewme8tzg.js} +7 -20
- package/dist/chunks/{fetch-f559fakr.js → api-f559fakr.js} +2 -2
- package/dist/chunks/{fetch-htyf2qs7.js → api-htyf2qs7.js} +1 -1
- package/dist/chunks/{fetch-j4at0y5c.js → api-j4at0y5c.js} +1 -1
- package/dist/chunks/{fetch-j87xz9bt.js → api-j87xz9bt.js} +3 -3
- package/dist/chunks/{fetch-kkdkqt8j.js → api-kkdkqt8j.js} +2 -2
- package/dist/chunks/{fetch-myqk22k5.js → api-myqk22k5.js} +2 -2
- package/dist/chunks/{fetch-mzs0n5xz.js → api-mzs0n5xz.js} +1 -1
- package/dist/chunks/{fetch-ny1j968n.js → api-ny1j968n.js} +2 -2
- package/dist/chunks/{fetch-p86kew8c.js → api-p86kew8c.js} +2 -2
- package/dist/chunks/{fetch-psw29prz.js → api-psw29prz.js} +4 -4
- package/dist/chunks/{fetch-qcg3sqtb.js → api-qcg3sqtb.js} +2 -2
- package/dist/chunks/{fetch-qd0r787n.js → api-qd0r787n.js} +2 -2
- package/dist/chunks/{fetch-qfyg9gb7.js → api-qfyg9gb7.js} +1 -1
- package/dist/chunks/{fetch-rha2aq18.js → api-rha2aq18.js} +2 -2
- package/dist/chunks/{fetch-rs3v36hp.js → api-rs3v36hp.js} +2 -2
- package/dist/chunks/api-sy2e93cn.js +46 -0
- package/dist/chunks/{fetch-t32e1bbt.js → api-t32e1bbt.js} +1 -1
- package/dist/chunks/{fetch-te8jwba1.js → api-te8jwba1.js} +2 -2
- package/dist/chunks/{fetch-tnqtz466.js → api-v8013z1z.js} +16 -12
- package/dist/chunks/{fetch-gyryr0mf.js → api-vdvwckee.js} +4 -4
- package/dist/chunks/{fetch-q2wtc6jx.js → api-wnren0wn.js} +33 -33
- package/dist/chunks/{fetch-yk755swr.js → api-yk755swr.js} +2 -2
- package/dist/chunks/{fetch-z3e7v67k.js → api-z3e7v67k.js} +1 -1
- package/dist/chunks/{fetch-zcvan105.js → api-zcvan105.js} +1 -1
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +1 -1
- package/dist/fetch.js +59 -57
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/blob.d.ts +7 -0
- package/dist/handlers/blob.js +8 -0
- 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/form.js +6 -6
- package/dist/handlers/fs.js +8 -7
- package/dist/handlers/generate.d.ts +2 -1
- 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/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 +15 -13
- 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/reference.js +6 -6
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/schedule.js +2 -2
- 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 +52 -50
- 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 +1 -1
- package/dist/process.js +60 -58
- package/dist/range.d.ts +6 -0
- package/dist/range.js +8 -0
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +4 -2
- package/dist/routes.js +56 -54
- package/dist/server-info.js +1 -1
- package/dist/service-status.js +1 -1
- package/dist/workerd.d.ts +1 -0
- package/dist/workerd.js +64 -58
- package/package.json +8 -8
- /package/dist/chunks/{fetch-9rqn6x4v.js → api-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{fetch-bd8755ek.js → api-bd8755ek.js} +0 -0
- /package/dist/chunks/{fetch-n26yr6pw.js → api-n26yr6pw.js} +0 -0
- /package/dist/chunks/{fetch-q187pxxd.js → api-q187pxxd.js} +0 -0
- /package/dist/chunks/{fetch-q4bn6dy8.js → api-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{fetch-smaf4a18.js → api-smaf4a18.js} +0 -0
- /package/dist/chunks/{fetch-xthc02cw.js → api-xthc02cw.js} +0 -0
- /package/dist/chunks/{fetch-yc7nft6q.js → api-yc7nft6q.js} +0 -0
package/dist/api.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./chunks/
|
|
4
|
-
import"./chunks/
|
|
5
|
-
import"./chunks/
|
|
6
|
-
import"./chunks/
|
|
7
|
-
import"./chunks/
|
|
3
|
+
} from "./chunks/api-j87xz9bt.js";
|
|
4
|
+
import"./chunks/api-htyf2qs7.js";
|
|
5
|
+
import"./chunks/api-b3bmdkga.js";
|
|
6
|
+
import"./chunks/api-50bbk3b2.js";
|
|
7
|
+
import"./chunks/api-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/generate.ts
|
|
10
|
+
import { Flag } from "@opencode/core/flag";
|
|
10
11
|
import { Generate } from "@opencode/core/generate";
|
|
12
|
+
import { VideoGeneration } from "@opencode/core/video-generation";
|
|
11
13
|
import { Location } from "@opencode/core/location";
|
|
12
14
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
13
15
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
14
16
|
import {
|
|
17
|
+
ForbiddenError,
|
|
18
|
+
VideoNotFoundError,
|
|
15
19
|
InvalidRequestError,
|
|
16
20
|
ModelNotFoundError,
|
|
17
21
|
ProviderRequestError,
|
|
@@ -24,6 +28,7 @@ import { HttpApiBuilder } from "effect/http-api";
|
|
|
24
28
|
var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers) => Effect.gen(function* () {
|
|
25
29
|
const global = yield* Global.Service;
|
|
26
30
|
const locations = yield* LocationServiceMap.Service;
|
|
31
|
+
const videos = yield* VideoGeneration.Service;
|
|
27
32
|
const services = locations.get(Location.Ref.make({ directory: AbsolutePath.make(global.config) }));
|
|
28
33
|
const text = Effect.fn("server.generate.text")(function* (request) {
|
|
29
34
|
yield* awaitPlugins2;
|
|
@@ -46,7 +51,22 @@ var GenerateHandler2 = HttpApiBuilder.group(Api2, "server.generate", (handlers)
|
|
|
46
51
|
const generate = yield* Generate.Service;
|
|
47
52
|
return { data: yield* generate.decisions(request.payload).pipe(Effect.mapError(generateError)) };
|
|
48
53
|
}, Effect.provide(services), locationErrors2);
|
|
49
|
-
|
|
54
|
+
const videoEnabled = Effect.gen(function* () {
|
|
55
|
+
if (yield* Flag.enabled("video_generate"))
|
|
56
|
+
return;
|
|
57
|
+
return yield* new ForbiddenError({ message: "Video generation is disabled; enable experimental.video_generate" });
|
|
58
|
+
});
|
|
59
|
+
const videoCreate = Effect.fn("server.generate.video.create")(function* (request) {
|
|
60
|
+
yield* videoEnabled;
|
|
61
|
+
yield* awaitPlugins2;
|
|
62
|
+
return { data: yield* videos.start(request.payload).pipe(Effect.mapError(generateError)) };
|
|
63
|
+
}, Effect.provide(services), locationErrors2);
|
|
64
|
+
const videoGet = Effect.fn("server.generate.video.get")(function* (request) {
|
|
65
|
+
yield* videoEnabled;
|
|
66
|
+
const job = yield* videos.get(request.params.id).pipe(Effect.mapError((error) => new VideoNotFoundError({ videoID: error.id, message: error.message })));
|
|
67
|
+
return { data: job };
|
|
68
|
+
}, Effect.provide(services), locationErrors2);
|
|
69
|
+
return handlers.handle("generate.text", text).handle("generate.textLegacy", text).handle("generate.image", image).handle("generate.decisions", decisions).handle("generate.video.create", videoCreate).handle("generate.video.get", videoGet);
|
|
50
70
|
}));
|
|
51
71
|
function generateError(error) {
|
|
52
72
|
switch (error._tag) {
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./api-50bbk3b2.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./api-j87xz9bt.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,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-smaf4a18.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-j87xz9bt.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";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./api-9rqn6x4v.js";
|
|
4
|
+
|
|
5
|
+
// src/range.ts
|
|
6
|
+
var exports_range = {};
|
|
7
|
+
__export(exports_range, {
|
|
8
|
+
ByteRange: () => exports_range,
|
|
9
|
+
parse: () => parse2
|
|
10
|
+
});
|
|
11
|
+
function parse2(header, size) {
|
|
12
|
+
const match = header === undefined ? null : /^bytes=\s*(\d*)\s*-\s*(\d*)\s*$/i.exec(header.trim());
|
|
13
|
+
if (match === null || match[1] === "" && match[2] === "")
|
|
14
|
+
return;
|
|
15
|
+
if (match[1] === "") {
|
|
16
|
+
const suffix = Number(match[2]);
|
|
17
|
+
if (suffix === 0 || size === 0)
|
|
18
|
+
return "unsatisfiable";
|
|
19
|
+
return { start: Math.max(size - suffix, 0), end: size - 1 };
|
|
20
|
+
}
|
|
21
|
+
const start = Number(match[1]);
|
|
22
|
+
const end = match[2] === "" ? size - 1 : Number(match[2]);
|
|
23
|
+
if (start > end || start >= size)
|
|
24
|
+
return "unsatisfiable";
|
|
25
|
+
return { start, end: Math.min(end, size - 1) };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { parse2, exports_range };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/provider.ts
|
|
10
10
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-j87xz9bt.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./api-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
11
|
Service2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./api-z3e7v67k.js";
|
|
13
13
|
import {
|
|
14
14
|
Service4
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./api-mzs0n5xz.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./api-50bbk3b2.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./api-j87xz9bt.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -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-v8013z1z.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,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-j87xz9bt.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-p86kew8c.js";
|
|
11
|
+
import {
|
|
12
|
+
makeBlobGet2
|
|
13
|
+
} from "./api-sy2e93cn.js";
|
|
11
14
|
import {
|
|
12
15
|
makeJob2
|
|
13
|
-
} from "./
|
|
16
|
+
} from "./api-78rcgzsr.js";
|
|
14
17
|
import {
|
|
15
18
|
makeMediaGet2
|
|
16
|
-
} from "./
|
|
19
|
+
} from "./api-djr0jy89.js";
|
|
17
20
|
import {
|
|
18
21
|
runPtySocket2
|
|
19
|
-
} from "./
|
|
22
|
+
} from "./api-q187pxxd.js";
|
|
20
23
|
import {
|
|
21
24
|
makeSchedule2
|
|
22
|
-
} from "./
|
|
25
|
+
} from "./api-059rbh9c.js";
|
|
23
26
|
|
|
24
27
|
// src/handlers/persistent-pty.ts
|
|
25
28
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -46,8 +49,9 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
46
49
|
const artifact = yield* makeArtifact2;
|
|
47
50
|
const job = yield* makeJob2;
|
|
48
51
|
const mediaGet = yield* makeMediaGet2;
|
|
52
|
+
const blobGet = yield* makeBlobGet2;
|
|
49
53
|
const schedule = yield* makeSchedule2;
|
|
50
|
-
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).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("schedule.create", (ctx) => schedule.create(ctx.payload)).handle("schedule.list", (ctx) => schedule.list(ctx.query.sessionID)).handle("schedule.get", (ctx) => schedule.get(ctx.params.scheduleID)).handle("schedule.pause", (ctx) => schedule.pause(ctx.params.scheduleID)).handle("schedule.resume", (ctx) => schedule.resume(ctx.params.scheduleID)).handle("schedule.delete", (ctx) => schedule.remove(ctx.params.scheduleID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
|
|
54
|
+
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("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("schedule.create", (ctx) => schedule.create(ctx.payload)).handle("schedule.list", (ctx) => schedule.list(ctx.query.sessionID)).handle("schedule.get", (ctx) => schedule.get(ctx.params.scheduleID)).handle("schedule.pause", (ctx) => schedule.pause(ctx.params.scheduleID)).handle("schedule.resume", (ctx) => schedule.resume(ctx.params.scheduleID)).handle("schedule.delete", (ctx) => schedule.remove(ctx.params.scheduleID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
|
|
51
55
|
return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
|
|
52
56
|
})).handle("persistentPty.list", Effect.fn(function* (ctx) {
|
|
53
57
|
return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./api-j87xz9bt.js";
|
|
7
7
|
import {
|
|
8
8
|
download2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./api-t32e1bbt.js";
|
|
10
|
+
import {
|
|
11
|
+
parse2
|
|
12
|
+
} from "./api-8sb6qqpn.js";
|
|
10
13
|
|
|
11
14
|
// src/handlers/fs.ts
|
|
12
15
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -71,7 +74,7 @@ function serveFile(request, file, content) {
|
|
|
71
74
|
if (isNotModified(request, etag, lastModified))
|
|
72
75
|
return HttpServerResponse.empty({ status: 304, headers: { ...validators, ...content } });
|
|
73
76
|
const rangeHeader = request.method === "GET" ? request.headers["range"] : undefined;
|
|
74
|
-
const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ?
|
|
77
|
+
const range = rangeHeader !== undefined && matchesIfRange(request.headers["if-range"], etag, lastModified) ? parse2(rangeHeader, file.size) : undefined;
|
|
75
78
|
if (range === "unsatisfiable")
|
|
76
79
|
return HttpServerResponse.empty({
|
|
77
80
|
status: 416,
|
|
@@ -107,21 +110,5 @@ function matchesIfRange(ifRange, etag, lastModified) {
|
|
|
107
110
|
function stripWeak(etag) {
|
|
108
111
|
return etag.trim().replace(/^w\//i, "");
|
|
109
112
|
}
|
|
110
|
-
function parseRange(header, size) {
|
|
111
|
-
const match = /^bytes=\s*(\d*)\s*-\s*(\d*)\s*$/i.exec(header.trim());
|
|
112
|
-
if (match === null || match[1] === "" && match[2] === "")
|
|
113
|
-
return;
|
|
114
|
-
if (match[1] === "") {
|
|
115
|
-
const suffix = Number(match[2]);
|
|
116
|
-
if (suffix === 0 || size === 0)
|
|
117
|
-
return "unsatisfiable";
|
|
118
|
-
return { start: Math.max(size - suffix, 0), end: size - 1 };
|
|
119
|
-
}
|
|
120
|
-
const start = Number(match[1]);
|
|
121
|
-
const end = match[2] === "" ? size - 1 : Number(match[2]);
|
|
122
|
-
if (start > end || start >= size)
|
|
123
|
-
return "unsatisfiable";
|
|
124
|
-
return { start, end: Math.min(end, size - 1) };
|
|
125
|
-
}
|
|
126
113
|
|
|
127
114
|
export { FileSystemHandler2 };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./api-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./api-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./api-b3bmdkga.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./api-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./api-j87xz9bt.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|