@opencode/server 2.4.1 → 2.4.2
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 +45 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{workerd-0rzj25w4.js → range-017ycvbx.js} +1 -1
- package/dist/chunks/{workerd-86dz2n4m.js → range-0x6anvwr.js} +2 -2
- package/dist/chunks/{workerd-39nnfjx1.js → range-39nnfjx1.js} +1 -1
- package/dist/chunks/{workerd-b1x3j2e8.js → range-3rtm8r3z.js} +2 -2
- package/dist/chunks/{workerd-7dtbad8d.js → range-3te71694.js} +7 -7
- package/dist/chunks/{workerd-nkfbbfe7.js → range-5pef2nys.js} +4 -4
- package/dist/chunks/{workerd-hgrkvk6s.js → range-6pm6ek88.js} +1 -1
- package/dist/chunks/{workerd-20wvj9q6.js → range-78jk0pbb.js} +2 -2
- package/dist/chunks/{workerd-kffke7z4.js → range-79t5cra8.js} +14 -10
- package/dist/chunks/{workerd-7x6cg3xs.js → range-7zz6jxhb.js} +2 -2
- package/dist/chunks/{workerd-8sb6qqpn.js → range-8sb6qqpn.js} +1 -1
- package/dist/chunks/{workerd-4r2ye500.js → range-9agv2b4c.js} +2 -2
- package/dist/chunks/{workerd-qahj7606.js → range-aexh791j.js} +1 -1
- package/dist/chunks/{workerd-zrptb2x8.js → range-amxj52x5.js} +2 -2
- package/dist/chunks/{workerd-s8t5gq7c.js → range-ay32z58n.js} +3 -3
- package/dist/chunks/{workerd-pv4dnzzq.js → range-b3sk57wg.js} +1 -1
- package/dist/chunks/{workerd-b7yt2ykh.js → range-c6kzfg4f.js} +2 -2
- package/dist/chunks/{workerd-w13ad1dk.js → range-cddawxec.js} +3 -3
- package/dist/chunks/{workerd-djr0jy89.js → range-djr0jy89.js} +1 -1
- package/dist/chunks/range-dnyhqccw.js +27 -0
- package/dist/chunks/{workerd-d0advawr.js → range-f93zkajm.js} +2 -2
- package/dist/chunks/{workerd-g23ffrnz.js → range-g23ffrnz.js} +2 -2
- package/dist/chunks/{workerd-wh07bcjv.js → range-gwtm9cga.js} +1 -1
- package/dist/chunks/{workerd-v0z8pce5.js → range-heqw7kpr.js} +2 -2
- package/dist/chunks/{workerd-6t6fd9bq.js → range-hgd5b6k8.js} +2 -2
- package/dist/chunks/{workerd-j4at0y5c.js → range-j4at0y5c.js} +1 -1
- package/dist/chunks/{workerd-8mfdzabk.js → range-jrjpfy36.js} +2 -2
- package/dist/chunks/{workerd-n6ypjnhz.js → range-jy2ammbg.js} +1 -1
- package/dist/chunks/{workerd-g97h7k0s.js → range-k2bx5n4e.js} +1 -1
- package/dist/chunks/{workerd-t8azv5ge.js → range-k518ftvz.js} +2 -2
- package/dist/chunks/{workerd-edwk6ehd.js → range-k58xpxwn.js} +1 -1
- package/dist/chunks/{workerd-w9jcwh65.js → range-kqr36gas.js} +7 -7
- package/dist/chunks/{workerd-8n1ypg70.js → range-mjhh6jvz.js} +3 -3
- package/dist/chunks/{workerd-myqk22k5.js → range-myqk22k5.js} +2 -2
- package/dist/chunks/{workerd-77gnb026.js → range-n8nthg9q.js} +4 -4
- package/dist/chunks/{workerd-b87bs0cf.js → range-pa4xtt5h.js} +2 -2
- package/dist/chunks/range-qpnw2qd1.js +58 -0
- package/dist/chunks/{workerd-rktygpea.js → range-rktygpea.js} +1 -1
- package/dist/chunks/{workerd-k26h7zjg.js → range-rn83nvae.js} +2 -2
- package/dist/chunks/{workerd-smaf4a18.js → range-rqgv9x42.js} +6 -2
- package/dist/chunks/{workerd-5dgtfnrn.js → range-s3d15g1k.js} +23 -17
- package/dist/chunks/{workerd-vxy32kc1.js → range-s557cdqw.js} +14 -4
- package/dist/chunks/{workerd-73tyf2qy.js → range-s6q3ch5r.js} +8 -8
- package/dist/chunks/{workerd-t62b1gmw.js → range-sqfq92mf.js} +2 -2
- package/dist/chunks/{workerd-j80tzjj3.js → range-stx1bw5w.js} +3 -3
- package/dist/chunks/{workerd-t32e1bbt.js → range-t32e1bbt.js} +1 -1
- package/dist/chunks/{workerd-g80pvn6e.js → range-tmb89r25.js} +2 -2
- package/dist/chunks/{workerd-jpqse2v9.js → range-tmbyzr8c.js} +35 -35
- package/dist/chunks/{workerd-4gbck4qg.js → range-vkj8vbyf.js} +2 -2
- package/dist/chunks/{workerd-p9wp66hf.js → range-vnpm7f9y.js} +1 -1
- package/dist/chunks/{workerd-3rn5pzng.js → range-wa6vk4hf.js} +14 -9
- package/dist/chunks/{workerd-bvm82fhd.js → range-wazndna9.js} +4 -4
- package/dist/chunks/{workerd-fvpjvjpp.js → range-wecgp61r.js} +7 -7
- package/dist/chunks/{workerd-7ydfwv45.js → range-x2qy7jg1.js} +1 -1
- package/dist/chunks/{workerd-dqfyxmp4.js → range-zs3ssmns.js} +26 -21
- package/dist/chunks/{workerd-p4zkxzv7.js → range-zx60pg73.js} +1 -1
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.d.ts +57 -0
- package/dist/fetch.js +64 -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/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 +17 -16
- 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.d.ts +28 -0
- package/dist/handlers/push.js +6 -0
- 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.d.ts +3 -1
- package/dist/handlers/session-error.js +4 -2
- 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 +54 -53
- 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.d.ts +1 -1
- package/dist/pairing.js +3 -3
- package/dist/process.js +62 -61
- 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 -2
- package/dist/routes.js +58 -57
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.d.ts +20 -6
- package/dist/workerd.js +87 -81
- package/package.json +9 -9
- package/dist/chunks/workerd-4apj6a8e.js +0 -13
- /package/dist/chunks/{workerd-9rqn6x4v.js → range-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{workerd-bd8755ek.js → range-bd8755ek.js} +0 -0
- /package/dist/chunks/{workerd-n26yr6pw.js → range-n26yr6pw.js} +0 -0
- /package/dist/chunks/{workerd-q187pxxd.js → range-q187pxxd.js} +0 -0
- /package/dist/chunks/{workerd-q4bn6dy8.js → range-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{workerd-xthc02cw.js → range-xthc02cw.js} +0 -0
- /package/dist/chunks/{workerd-yc7nft6q.js → range-yc7nft6q.js} +0 -0
package/dist/workerd.d.ts
CHANGED
|
@@ -9,13 +9,18 @@ import type { ServerOptions } from "./options";
|
|
|
9
9
|
* or disabled.
|
|
10
10
|
*
|
|
11
11
|
* - Database runs on the injected `DurableObjectStorage` SQLite.
|
|
12
|
+
* - `Workspace` is configured with `keepWarm: 0`, `pollInterval: null`, and
|
|
13
|
+
* `storage.setAlarm` scheduling so the Durable Object can hibernate at zero
|
|
14
|
+
* idle cost. Callers forward the Durable Object's `alarm()` method to
|
|
15
|
+
* `handler.alarm()` (or `opencode.alarm()` via `@opencode/sdk/workerd`).
|
|
12
16
|
* - Watcher and fff are disabled through their existing option flags; pty, fff,
|
|
13
17
|
* and photon native modules resolve to inert stubs under the `workerd` bundle
|
|
14
18
|
* condition.
|
|
15
|
-
* - Bare locations use a typed no-execution-plane process spawner; FileSystem
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* - Bare locations use a typed no-execution-plane process spawner; FileSystem
|
|
20
|
+
* and FileSystemSearch route through Environment (working on attached remote
|
|
21
|
+
* workspaces and failing cleanly on bare locations). Pty fails with a clear
|
|
22
|
+
* defect; Npm fails package installs with a typed workerd error; Snapshot and
|
|
23
|
+
* Vcs degrade to no-op results.
|
|
19
24
|
* - Blob storage and video generation report themselves unsupported: blobs are files on a local disk.
|
|
20
25
|
* - Config is injected as a string (no filesystem); plugin discovery is
|
|
21
26
|
* precompiled-only, and stdio MCP reports the same no-plane failure as Shell.
|
|
@@ -38,12 +43,21 @@ export interface Options {
|
|
|
38
43
|
/** Replaces `globalThis.fetch` for OpenCode's own HTTP requests, e.g. to route them through a Service Binding. */
|
|
39
44
|
readonly fetch?: ServerOptions["fetch"];
|
|
40
45
|
}
|
|
46
|
+
export interface Handler {
|
|
47
|
+
(request: Request): Promise<Response>;
|
|
48
|
+
/** Suspends any workspaces past their idle threshold; call from the Durable Object's `alarm()` method. */
|
|
49
|
+
readonly alarm: () => Promise<void>;
|
|
50
|
+
}
|
|
41
51
|
/**
|
|
42
|
-
* Builds the web-standard fetch handler for a Durable Object
|
|
52
|
+
* Builds the web-standard fetch + alarm handler for a Durable Object. The
|
|
43
53
|
* application layer builds eagerly in the caller's scope, so hold it in the
|
|
44
54
|
* Durable Object instance rather than per request.
|
|
55
|
+
*
|
|
56
|
+
* Callers must forward the Durable Object's `alarm()` lifecycle method to
|
|
57
|
+
* `handler.alarm()`: this profile disables background idle polling so the
|
|
58
|
+
* isolate can hibernate at zero idle cost.
|
|
45
59
|
*/
|
|
46
|
-
export declare
|
|
60
|
+
export declare const create: (options: Options) => Effect.Effect<Handler, Error, import("effect/Scope").Scope>;
|
|
47
61
|
export declare function serverOptions(options: Options): ServerOptions;
|
|
48
62
|
/** The workerd replacement graph, applied after the standard server replacements. */
|
|
49
63
|
export declare function replacements(options: Options): LayerNode.Replacements;
|
package/dist/workerd.js
CHANGED
|
@@ -1,68 +1,71 @@
|
|
|
1
|
-
import"./chunks/
|
|
2
|
-
import"./chunks/
|
|
3
|
-
import"./chunks/workerd-yc7nft6q.js";
|
|
4
|
-
import"./chunks/workerd-smaf4a18.js";
|
|
5
|
-
import"./chunks/workerd-j80tzjj3.js";
|
|
6
|
-
import"./chunks/workerd-n6ypjnhz.js";
|
|
7
|
-
import"./chunks/workerd-qahj7606.js";
|
|
8
|
-
import"./chunks/workerd-s8t5gq7c.js";
|
|
9
|
-
import"./chunks/workerd-j4at0y5c.js";
|
|
10
|
-
import"./chunks/workerd-8mfdzabk.js";
|
|
11
|
-
import"./chunks/workerd-v0z8pce5.js";
|
|
12
|
-
import"./chunks/workerd-xthc02cw.js";
|
|
13
|
-
import"./chunks/workerd-w13ad1dk.js";
|
|
14
|
-
import"./chunks/workerd-d0advawr.js";
|
|
15
|
-
import"./chunks/workerd-6t6fd9bq.js";
|
|
16
|
-
import"./chunks/workerd-dqfyxmp4.js";
|
|
17
|
-
import"./chunks/workerd-8n1ypg70.js";
|
|
18
|
-
import"./chunks/workerd-t32e1bbt.js";
|
|
19
|
-
import"./chunks/workerd-8sb6qqpn.js";
|
|
20
|
-
import"./chunks/workerd-vxy32kc1.js";
|
|
21
|
-
import"./chunks/workerd-zrptb2x8.js";
|
|
22
|
-
import"./chunks/workerd-b87bs0cf.js";
|
|
23
|
-
import"./chunks/workerd-4apj6a8e.js";
|
|
24
|
-
import"./chunks/workerd-p4zkxzv7.js";
|
|
25
|
-
import"./chunks/workerd-fvpjvjpp.js";
|
|
26
|
-
import"./chunks/workerd-77gnb026.js";
|
|
27
|
-
import"./chunks/workerd-k26h7zjg.js";
|
|
28
|
-
import"./chunks/workerd-20wvj9q6.js";
|
|
29
|
-
import"./chunks/workerd-7dtbad8d.js";
|
|
30
|
-
import"./chunks/workerd-w9jcwh65.js";
|
|
31
|
-
import"./chunks/workerd-73tyf2qy.js";
|
|
32
|
-
import"./chunks/workerd-b7yt2ykh.js";
|
|
33
|
-
import"./chunks/workerd-q187pxxd.js";
|
|
34
|
-
import"./chunks/workerd-nkfbbfe7.js";
|
|
35
|
-
import"./chunks/workerd-t62b1gmw.js";
|
|
36
|
-
import"./chunks/workerd-g23ffrnz.js";
|
|
37
|
-
import"./chunks/workerd-hgrkvk6s.js";
|
|
38
|
-
import"./chunks/workerd-7ydfwv45.js";
|
|
39
|
-
import"./chunks/workerd-0rzj25w4.js";
|
|
40
|
-
import"./chunks/workerd-djr0jy89.js";
|
|
41
|
-
import"./chunks/workerd-kffke7z4.js";
|
|
42
|
-
import"./chunks/workerd-b1x3j2e8.js";
|
|
43
|
-
import"./chunks/workerd-t8azv5ge.js";
|
|
44
|
-
import"./chunks/workerd-wh07bcjv.js";
|
|
45
|
-
import"./chunks/workerd-4r2ye500.js";
|
|
46
|
-
import"./chunks/workerd-7x6cg3xs.js";
|
|
47
|
-
import"./chunks/workerd-4gbck4qg.js";
|
|
48
|
-
import"./chunks/workerd-bvm82fhd.js";
|
|
49
|
-
import"./chunks/workerd-86dz2n4m.js";
|
|
50
|
-
import"./chunks/workerd-edwk6ehd.js";
|
|
51
|
-
import"./chunks/workerd-p9wp66hf.js";
|
|
52
|
-
import"./chunks/workerd-g80pvn6e.js";
|
|
53
|
-
import"./chunks/workerd-pv4dnzzq.js";
|
|
54
|
-
import"./chunks/workerd-g97h7k0s.js";
|
|
55
|
-
import"./chunks/workerd-jpqse2v9.js";
|
|
56
|
-
import"./chunks/workerd-rktygpea.js";
|
|
57
|
-
import"./chunks/workerd-bd8755ek.js";
|
|
58
|
-
import"./chunks/workerd-n26yr6pw.js";
|
|
59
|
-
import"./chunks/workerd-5dgtfnrn.js";
|
|
1
|
+
import"./chunks/range-q4bn6dy8.js";
|
|
2
|
+
import"./chunks/range-myqk22k5.js";
|
|
60
3
|
import {
|
|
61
|
-
|
|
62
|
-
} from "./chunks/
|
|
4
|
+
withoutParentSpan2
|
|
5
|
+
} from "./chunks/range-yc7nft6q.js";
|
|
6
|
+
import"./chunks/range-rqgv9x42.js";
|
|
7
|
+
import"./chunks/range-stx1bw5w.js";
|
|
8
|
+
import"./chunks/range-jy2ammbg.js";
|
|
9
|
+
import"./chunks/range-aexh791j.js";
|
|
10
|
+
import"./chunks/range-ay32z58n.js";
|
|
11
|
+
import"./chunks/range-j4at0y5c.js";
|
|
12
|
+
import"./chunks/range-jrjpfy36.js";
|
|
13
|
+
import"./chunks/range-heqw7kpr.js";
|
|
14
|
+
import"./chunks/range-xthc02cw.js";
|
|
15
|
+
import"./chunks/range-cddawxec.js";
|
|
16
|
+
import"./chunks/range-f93zkajm.js";
|
|
17
|
+
import"./chunks/range-hgd5b6k8.js";
|
|
18
|
+
import"./chunks/range-zs3ssmns.js";
|
|
19
|
+
import"./chunks/range-mjhh6jvz.js";
|
|
20
|
+
import"./chunks/range-t32e1bbt.js";
|
|
21
|
+
import"./chunks/range-8sb6qqpn.js";
|
|
22
|
+
import"./chunks/range-s557cdqw.js";
|
|
23
|
+
import"./chunks/range-amxj52x5.js";
|
|
24
|
+
import"./chunks/range-pa4xtt5h.js";
|
|
25
|
+
import"./chunks/range-dnyhqccw.js";
|
|
26
|
+
import"./chunks/range-zx60pg73.js";
|
|
27
|
+
import"./chunks/range-wecgp61r.js";
|
|
28
|
+
import"./chunks/range-n8nthg9q.js";
|
|
29
|
+
import"./chunks/range-rn83nvae.js";
|
|
30
|
+
import"./chunks/range-78jk0pbb.js";
|
|
31
|
+
import"./chunks/range-3te71694.js";
|
|
32
|
+
import"./chunks/range-kqr36gas.js";
|
|
33
|
+
import"./chunks/range-s6q3ch5r.js";
|
|
34
|
+
import"./chunks/range-c6kzfg4f.js";
|
|
35
|
+
import"./chunks/range-q187pxxd.js";
|
|
36
|
+
import"./chunks/range-5pef2nys.js";
|
|
37
|
+
import"./chunks/range-sqfq92mf.js";
|
|
38
|
+
import"./chunks/range-g23ffrnz.js";
|
|
39
|
+
import"./chunks/range-6pm6ek88.js";
|
|
40
|
+
import"./chunks/range-x2qy7jg1.js";
|
|
41
|
+
import"./chunks/range-017ycvbx.js";
|
|
42
|
+
import"./chunks/range-djr0jy89.js";
|
|
43
|
+
import"./chunks/range-qpnw2qd1.js";
|
|
44
|
+
import"./chunks/range-79t5cra8.js";
|
|
45
|
+
import"./chunks/range-3rtm8r3z.js";
|
|
46
|
+
import"./chunks/range-k518ftvz.js";
|
|
47
|
+
import"./chunks/range-gwtm9cga.js";
|
|
48
|
+
import"./chunks/range-9agv2b4c.js";
|
|
49
|
+
import"./chunks/range-7zz6jxhb.js";
|
|
50
|
+
import"./chunks/range-vkj8vbyf.js";
|
|
51
|
+
import"./chunks/range-wazndna9.js";
|
|
52
|
+
import"./chunks/range-0x6anvwr.js";
|
|
53
|
+
import"./chunks/range-k58xpxwn.js";
|
|
54
|
+
import"./chunks/range-vnpm7f9y.js";
|
|
55
|
+
import"./chunks/range-tmb89r25.js";
|
|
56
|
+
import"./chunks/range-b3sk57wg.js";
|
|
57
|
+
import"./chunks/range-k2bx5n4e.js";
|
|
58
|
+
import"./chunks/range-tmbyzr8c.js";
|
|
59
|
+
import"./chunks/range-rktygpea.js";
|
|
60
|
+
import"./chunks/range-bd8755ek.js";
|
|
61
|
+
import"./chunks/range-n26yr6pw.js";
|
|
62
|
+
import"./chunks/range-s3d15g1k.js";
|
|
63
|
+
import {
|
|
64
|
+
makeWithContext2
|
|
65
|
+
} from "./chunks/range-wa6vk4hf.js";
|
|
63
66
|
import {
|
|
64
67
|
__export
|
|
65
|
-
} from "./chunks/
|
|
68
|
+
} from "./chunks/range-9rqn6x4v.js";
|
|
66
69
|
|
|
67
70
|
// src/workerd.ts
|
|
68
71
|
var exports_workerd = {};
|
|
@@ -72,23 +75,31 @@ __export(exports_workerd, {
|
|
|
72
75
|
replacements: () => replacements,
|
|
73
76
|
serverOptions: () => serverOptions
|
|
74
77
|
});
|
|
75
|
-
import { Effect, Layer } from "effect";
|
|
78
|
+
import { Context, Effect, Layer } from "effect";
|
|
79
|
+
import { BlobStore } from "@opencode/core/blob-store";
|
|
76
80
|
import { ConfigPluginSource } from "@opencode/core/config/plugin/source";
|
|
77
81
|
import { Database } from "@opencode/core/database/database";
|
|
78
82
|
import { sqliteLayer } from "@opencode/core/database/sqlite.workerd";
|
|
79
83
|
import { EnvironmentUnavailable } from "@opencode/core/environment/unavailable";
|
|
80
|
-
import {
|
|
81
|
-
import { FileSystemSearch } from "@opencode/core/filesystem/search";
|
|
82
|
-
import { BlobStore } from "@opencode/core/blob-store";
|
|
83
|
-
import { VideoGeneration } from "@opencode/core/video-generation";
|
|
84
|
+
import { Identity } from "@opencode/core/machine/identity";
|
|
84
85
|
import { Pty } from "@opencode/core/pty";
|
|
85
86
|
import { Snapshot } from "@opencode/core/snapshot";
|
|
86
87
|
import { Vcs } from "@opencode/core/vcs";
|
|
88
|
+
import { VideoGeneration } from "@opencode/core/video-generation";
|
|
89
|
+
import { Workspace } from "@opencode/core/workspace";
|
|
87
90
|
import { CrossSpawnSpawner } from "@opencode/util/cross-spawn-spawner";
|
|
88
91
|
import { Npm } from "@opencode/util/npm";
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
var create = Effect.fn("ServerWorkerd.create")(function* (options) {
|
|
93
|
+
const server = yield* makeWithContext2(serverOptions(options), {
|
|
94
|
+
overrides: replacements(options)
|
|
95
|
+
});
|
|
96
|
+
const run = Effect.runPromiseWith(yield* withoutParentSpan2(Effect.context()));
|
|
97
|
+
const workspace = Context.get(server.context, Workspace.Service);
|
|
98
|
+
const handler = Object.assign(server.handler, {
|
|
99
|
+
alarm: () => run(Effect.asVoid(workspace.suspendIdle()))
|
|
100
|
+
});
|
|
101
|
+
return handler;
|
|
102
|
+
});
|
|
92
103
|
function serverOptions(options) {
|
|
93
104
|
return {
|
|
94
105
|
app: options.app,
|
|
@@ -103,11 +114,15 @@ function serverOptions(options) {
|
|
|
103
114
|
function replacements(options) {
|
|
104
115
|
return [
|
|
105
116
|
Database.node.replace(Database.configuredClient(sqliteLayer({ storage: options.storage }))),
|
|
117
|
+
Identity.node.replace(Identity.kvNode),
|
|
118
|
+
Workspace.node.replace(Workspace.configured({
|
|
119
|
+
keepWarm: 0,
|
|
120
|
+
pollInterval: null,
|
|
121
|
+
onIdleScheduled: (atMs) => Effect.tryPromise(() => options.storage.setAlarm(atMs))
|
|
122
|
+
})),
|
|
106
123
|
CrossSpawnSpawner.node.replace(EnvironmentUnavailable.layer),
|
|
107
124
|
Snapshot.node.replace(Snapshot.noopLayer),
|
|
108
125
|
Vcs.node.replace(vcsLayer),
|
|
109
|
-
FileSystem.node.replace(fileSystemLayer),
|
|
110
|
-
FileSystemSearch.node.replace(fileSystemSearchLayer),
|
|
111
126
|
Pty.node.replace(ptyLayer),
|
|
112
127
|
Npm.node.replace(npmLayer),
|
|
113
128
|
BlobStore.node.replace(BlobStore.unsupportedLayer),
|
|
@@ -140,15 +155,6 @@ var vcsLayer = Layer.succeed(Vcs.Service, Vcs.Service.of({
|
|
|
140
155
|
status: () => Effect.succeed([]),
|
|
141
156
|
diff: () => Effect.succeed([])
|
|
142
157
|
}));
|
|
143
|
-
var fileSystemLayer = Layer.succeed(FileSystem.Service, FileSystem.Service.of({
|
|
144
|
-
read: () => unavailable("FileSystem.read"),
|
|
145
|
-
list: () => unavailable("FileSystem.list"),
|
|
146
|
-
find: () => unavailable("FileSystem.find"),
|
|
147
|
-
write: () => unavailable("FileSystem.write")
|
|
148
|
-
}));
|
|
149
|
-
var fileSystemSearchLayer = Layer.succeed(FileSystemSearch.Service, FileSystemSearch.Service.of({
|
|
150
|
-
find: () => unavailable("FileSystemSearch.find")
|
|
151
|
-
}));
|
|
152
158
|
var ptyLayer = Layer.succeed(Pty.Service, Pty.Service.of({
|
|
153
159
|
list: () => Effect.succeed([]),
|
|
154
160
|
get: (ptyID) => Effect.fail(new Pty.NotFoundError({ ptyID })),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/server",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "bun run script/build.ts",
|
|
26
26
|
"pack": "bun run script/pack.ts",
|
|
27
|
-
"test": "bun test
|
|
27
|
+
"test": "bun run ../core/script/test.ts",
|
|
28
28
|
"typecheck": "bun check --no-script -b",
|
|
29
29
|
"typecheck:tsc": "tsc -b",
|
|
30
30
|
"probe:workerd": "bun run script/workerd-probe.ts"
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@effect/platform-node": "4.1.0",
|
|
34
34
|
"@effect/platform-node-shared": "4.1.0",
|
|
35
|
-
"@opencode/core": "2.4.
|
|
36
|
-
"@opencode/protocol": "2.4.
|
|
37
|
-
"@opencode/schema": "2.4.
|
|
38
|
-
"@opencode/simulation": "2.4.
|
|
39
|
-
"@opencode/util": "2.4.
|
|
35
|
+
"@opencode/core": "2.4.2",
|
|
36
|
+
"@opencode/protocol": "2.4.2",
|
|
37
|
+
"@opencode/schema": "2.4.2",
|
|
38
|
+
"@opencode/simulation": "2.4.2",
|
|
39
|
+
"@opencode/util": "2.4.2",
|
|
40
40
|
"effect": "4.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@opencode/pty": "0.6.0",
|
|
44
|
-
"@opencode/client": "2.4.
|
|
45
|
-
"@opencode/plugin": "2.4.
|
|
44
|
+
"@opencode/client": "2.4.2",
|
|
45
|
+
"@opencode/plugin": "2.4.2",
|
|
46
46
|
"@tsconfig/bun": "1.0.9",
|
|
47
47
|
"@types/bun": "1.4.3",
|
|
48
48
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
response2
|
|
3
|
-
} from "./workerd-j80tzjj3.js";
|
|
4
|
-
import {
|
|
5
|
-
Api2
|
|
6
|
-
} from "./workerd-s8t5gq7c.js";
|
|
7
|
-
|
|
8
|
-
// src/handlers/skill.ts
|
|
9
|
-
import { Skill } from "@opencode/core/skill";
|
|
10
|
-
import { HttpApiBuilder } from "effect/http-api";
|
|
11
|
-
var SkillHandler2 = HttpApiBuilder.group(Api2, "server.skill", (handlers) => handlers.handle("skill.list", () => response2(Skill.Service.use((skill) => skill.list()))));
|
|
12
|
-
|
|
13
|
-
export { SkillHandler2 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|