@opencode/server 0.0.0-dev-1365 → 0.0.0-dev-1367
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 +4 -4
- package/dist/chunks/{media-uri-dyvstyyh.js → media-uri-07adkgh3.js} +2 -2
- package/dist/chunks/{media-uri-8xwrz458.js → media-uri-0nzx8p8z.js} +4 -4
- package/dist/chunks/{media-uri-e6e4kz0w.js → media-uri-0q7s66m2.js} +3 -3
- package/dist/chunks/{media-uri-ttd4mjws.js → media-uri-0wwbgx8t.js} +16 -20
- package/dist/chunks/{media-uri-z564cb4b.js → media-uri-0xhepbgy.js} +2 -2
- package/dist/chunks/{media-uri-sn8sqewc.js → media-uri-1qgvww4g.js} +2 -2
- package/dist/chunks/{media-uri-341zm3rs.js → media-uri-20m6qdhp.js} +2 -2
- package/dist/chunks/{media-uri-2h3x7256.js → media-uri-23bsg0bb.js} +1 -1
- package/dist/chunks/{media-uri-raj3p8q0.js → media-uri-3sdebxp3.js} +1 -1
- package/dist/chunks/{media-uri-cgcw2b0e.js → media-uri-44ywgpsx.js} +2 -2
- package/dist/chunks/{media-uri-vyjhrbg0.js → media-uri-44zzbkrb.js} +1 -1
- package/dist/chunks/{media-uri-fegnxd42.js → media-uri-4a2eztcc.js} +1 -1
- package/dist/chunks/{media-uri-r1mf3bzp.js → media-uri-4abt2dvn.js} +2 -2
- package/dist/chunks/{media-uri-ggw25rqf.js → media-uri-4dcft65w.js} +1 -1
- package/dist/chunks/{media-uri-qgjb3f4w.js → media-uri-61xgwjgp.js} +2 -2
- package/dist/chunks/{media-uri-r9w3a44p.js → media-uri-7qa33b41.js} +2 -2
- package/dist/chunks/{media-uri-844nmnmk.js → media-uri-9bpmwzvq.js} +2 -2
- package/dist/chunks/{media-uri-fsvp99pe.js → media-uri-aexh791j.js} +1 -1
- package/dist/chunks/{media-uri-3xfmgb6c.js → media-uri-d77v3xnm.js} +4 -4
- package/dist/chunks/{media-uri-yvy5qft7.js → media-uri-dxh72p2c.js} +2 -2
- package/dist/chunks/{media-uri-4th25279.js → media-uri-ej8k6nk6.js} +2 -2
- package/dist/chunks/{media-uri-kc553r92.js → media-uri-ezydv7x1.js} +2 -2
- package/dist/chunks/{media-uri-zs3a96ke.js → media-uri-g1wjh7qe.js} +2 -2
- package/dist/chunks/{media-uri-hs3dbf8w.js → media-uri-gb9bc2v4.js} +9 -9
- package/dist/chunks/{media-uri-qcnb494j.js → media-uri-gk96xf2h.js} +2 -2
- package/dist/chunks/{media-uri-ws2ckpmb.js → media-uri-hj8z77wc.js} +2 -2
- package/dist/chunks/{media-uri-fcw485c9.js → media-uri-j4hk2st6.js} +2 -2
- package/dist/chunks/{media-uri-0dfmev2z.js → media-uri-jy2ammbg.js} +1 -1
- package/dist/chunks/{media-uri-zy859vyn.js → media-uri-katdrqa2.js} +37 -37
- package/dist/chunks/{media-uri-zmrq0y42.js → media-uri-kpw06y11.js} +2 -2
- package/dist/chunks/{media-uri-7tv8nec1.js → media-uri-kxxxzk43.js} +1 -1
- package/dist/chunks/{media-uri-7dtbad8d.js → media-uri-megkv1kf.js} +4 -4
- package/dist/chunks/{media-uri-r5yb7twv.js → media-uri-mf0jv62d.js} +2 -2
- package/dist/chunks/{media-uri-fmkwyf76.js → media-uri-mj1ewmp1.js} +8 -8
- package/dist/chunks/{media-uri-gqstb6bx.js → media-uri-nfv0r61b.js} +2 -2
- package/dist/chunks/media-uri-njmm6d43.js +43 -0
- package/dist/chunks/{media-uri-k12h8tw9.js → media-uri-npqc081y.js} +1 -1
- package/dist/chunks/{media-uri-8y4d9f30.js → media-uri-p8x80wn6.js} +3 -3
- package/dist/chunks/{media-uri-tktas153.js → media-uri-r3c5pb1c.js} +2 -2
- package/dist/chunks/{media-uri-j605n900.js → media-uri-sar77n3p.js} +2 -2
- package/dist/chunks/{media-uri-sbde0s13.js → media-uri-sh3ejx5x.js} +1 -1
- package/dist/chunks/{media-uri-j6y32kmq.js → media-uri-sqfq92mf.js} +1 -1
- package/dist/chunks/{media-uri-72bf7qt9.js → media-uri-stx1bw5w.js} +2 -2
- package/dist/chunks/{media-uri-9vfv9n1y.js → media-uri-t6q8af35.js} +2 -2
- package/dist/chunks/{media-uri-a7k393fm.js → media-uri-t6ryhghb.js} +2 -2
- package/dist/chunks/{media-uri-py78bw87.js → media-uri-tg713d3t.js} +5 -5
- package/dist/chunks/{media-uri-w9jcwh65.js → media-uri-vb61dkrm.js} +3 -3
- package/dist/chunks/{media-uri-v60tcbt5.js → media-uri-xw05m515.js} +3 -3
- package/dist/event-feed.js +7 -7
- package/dist/fetch.d.ts +22 -11
- package/dist/fetch.js +61 -57
- package/dist/handlers/agent.js +5 -5
- package/dist/handlers/artifact.js +2 -2
- package/dist/handlers/command.js +5 -5
- package/dist/handlers/config.js +5 -5
- package/dist/handlers/credential.js +6 -6
- package/dist/handlers/debug.js +5 -5
- package/dist/handlers/event.js +6 -6
- package/dist/handlers/experimental/browser-tunnel.js +2 -2
- package/dist/handlers/flag.js +5 -5
- package/dist/handlers/form.js +5 -5
- package/dist/handlers/fs.js +6 -6
- package/dist/handlers/generate.js +5 -5
- package/dist/handlers/integration.js +5 -5
- package/dist/handlers/location.js +5 -5
- package/dist/handlers/mcp.js +5 -5
- package/dist/handlers/message.js +5 -5
- package/dist/handlers/migration.js +5 -5
- package/dist/handlers/model.js +5 -5
- package/dist/handlers/permission.js +5 -5
- package/dist/handlers/persistent-pty.js +15 -15
- package/dist/handlers/plugin.js +5 -5
- package/dist/handlers/project.js +5 -5
- package/dist/handlers/provider.js +5 -5
- package/dist/handlers/pty.js +5 -5
- package/dist/handlers/reference.js +5 -5
- package/dist/handlers/rpc.js +5 -5
- package/dist/handlers/server.js +8 -8
- package/dist/handlers/session.js +5 -5
- package/dist/handlers/shell.js +5 -5
- package/dist/handlers/skill.js +5 -5
- package/dist/handlers/space.js +2 -2
- package/dist/handlers/usage.js +5 -5
- package/dist/handlers/vcs.js +5 -5
- package/dist/handlers/voice.js +5 -5
- package/dist/handlers/websearch.js +5 -5
- package/dist/handlers/worktree.js +5 -5
- package/dist/handlers.js +52 -52
- package/dist/location.js +3 -3
- package/dist/middleware/form-location.js +2 -2
- package/dist/middleware/session-location.js +2 -2
- package/dist/options.d.ts +69 -2
- package/dist/options.js +14 -6
- package/dist/pairing.js +3 -3
- package/dist/process.d.ts +5 -5
- package/dist/process.js +50 -50
- package/dist/request-site.js +1 -1
- package/dist/routes.d.ts +8 -2
- package/dist/routes.js +54 -54
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +3 -3
- package/dist/space-store.js +5 -5
- package/dist/workerd.js +50 -59
- package/package.json +8 -8
- package/dist/chunks/media-uri-a7c8a9w3.js +0 -37
- /package/dist/chunks/{media-uri-myqk22k5.js → media-uri-hmwn16zp.js} +0 -0
|
@@ -1,111 +1,111 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenerateHandler2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-kpw06y11.js";
|
|
4
4
|
import {
|
|
5
5
|
VoiceHandler2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-44ywgpsx.js";
|
|
7
7
|
import {
|
|
8
8
|
MessageHandler2
|
|
9
|
-
} from "./media-uri-
|
|
9
|
+
} from "./media-uri-3sdebxp3.js";
|
|
10
10
|
import {
|
|
11
11
|
ModelHandler2
|
|
12
|
-
} from "./media-uri-
|
|
12
|
+
} from "./media-uri-1qgvww4g.js";
|
|
13
13
|
import {
|
|
14
14
|
ProviderHandler2
|
|
15
|
-
} from "./media-uri-
|
|
15
|
+
} from "./media-uri-61xgwjgp.js";
|
|
16
16
|
import {
|
|
17
17
|
SessionHandler2
|
|
18
|
-
} from "./media-uri-
|
|
18
|
+
} from "./media-uri-07adkgh3.js";
|
|
19
19
|
import {
|
|
20
20
|
PermissionHandler2
|
|
21
|
-
} from "./media-uri-
|
|
21
|
+
} from "./media-uri-hj8z77wc.js";
|
|
22
22
|
import {
|
|
23
23
|
FileSystemHandler2
|
|
24
|
-
} from "./media-uri-
|
|
24
|
+
} from "./media-uri-4abt2dvn.js";
|
|
25
25
|
import {
|
|
26
26
|
FormHandler2
|
|
27
|
-
} from "./media-uri-
|
|
27
|
+
} from "./media-uri-gk96xf2h.js";
|
|
28
28
|
import {
|
|
29
29
|
CommandHandler2
|
|
30
|
-
} from "./media-uri-
|
|
30
|
+
} from "./media-uri-20m6qdhp.js";
|
|
31
31
|
import {
|
|
32
32
|
SkillHandler2
|
|
33
|
-
} from "./media-uri-
|
|
33
|
+
} from "./media-uri-7qa33b41.js";
|
|
34
34
|
import {
|
|
35
35
|
RpcHandler2
|
|
36
|
-
} from "./media-uri-
|
|
36
|
+
} from "./media-uri-4dcft65w.js";
|
|
37
37
|
import {
|
|
38
|
-
|
|
39
|
-
} from "./media-uri-
|
|
38
|
+
layer3
|
|
39
|
+
} from "./media-uri-gb9bc2v4.js";
|
|
40
40
|
import {
|
|
41
41
|
EventHandler2
|
|
42
|
-
} from "./media-uri-
|
|
42
|
+
} from "./media-uri-d77v3xnm.js";
|
|
43
43
|
import {
|
|
44
44
|
AgentHandler2
|
|
45
|
-
} from "./media-uri-
|
|
45
|
+
} from "./media-uri-r3c5pb1c.js";
|
|
46
46
|
import {
|
|
47
47
|
PluginHandler2
|
|
48
|
-
} from "./media-uri-
|
|
48
|
+
} from "./media-uri-nfv0r61b.js";
|
|
49
49
|
import {
|
|
50
50
|
ServerHandler2
|
|
51
|
-
} from "./media-uri-
|
|
51
|
+
} from "./media-uri-tg713d3t.js";
|
|
52
52
|
import {
|
|
53
53
|
DebugHandler2
|
|
54
|
-
} from "./media-uri-
|
|
54
|
+
} from "./media-uri-t6ryhghb.js";
|
|
55
55
|
import {
|
|
56
56
|
PtyHandler2
|
|
57
|
-
} from "./media-uri-
|
|
57
|
+
} from "./media-uri-t6q8af35.js";
|
|
58
58
|
import {
|
|
59
59
|
extension2
|
|
60
|
-
} from "./media-uri-
|
|
60
|
+
} from "./media-uri-mj1ewmp1.js";
|
|
61
61
|
import {
|
|
62
62
|
PersistentPtyHandler2
|
|
63
|
-
} from "./media-uri-
|
|
63
|
+
} from "./media-uri-0nzx8p8z.js";
|
|
64
64
|
import {
|
|
65
65
|
ShellHandler2
|
|
66
|
-
} from "./media-uri-
|
|
66
|
+
} from "./media-uri-ezydv7x1.js";
|
|
67
67
|
import {
|
|
68
68
|
ReferenceHandler2
|
|
69
|
-
} from "./media-uri-
|
|
69
|
+
} from "./media-uri-j4hk2st6.js";
|
|
70
70
|
import {
|
|
71
71
|
LocationHandler2
|
|
72
|
-
} from "./media-uri-
|
|
72
|
+
} from "./media-uri-sh3ejx5x.js";
|
|
73
73
|
import {
|
|
74
74
|
IntegrationHandler2
|
|
75
|
-
} from "./media-uri-
|
|
75
|
+
} from "./media-uri-dxh72p2c.js";
|
|
76
76
|
import {
|
|
77
77
|
WebSearchHandler2
|
|
78
|
-
} from "./media-uri-
|
|
78
|
+
} from "./media-uri-g1wjh7qe.js";
|
|
79
79
|
import {
|
|
80
80
|
UsageHandler2
|
|
81
|
-
} from "./media-uri-
|
|
81
|
+
} from "./media-uri-9bpmwzvq.js";
|
|
82
82
|
import {
|
|
83
83
|
FlagHandler2
|
|
84
|
-
} from "./media-uri-
|
|
84
|
+
} from "./media-uri-0xhepbgy.js";
|
|
85
85
|
import {
|
|
86
86
|
McpHandler2
|
|
87
|
-
} from "./media-uri-
|
|
87
|
+
} from "./media-uri-ej8k6nk6.js";
|
|
88
88
|
import {
|
|
89
89
|
CredentialHandler2
|
|
90
|
-
} from "./media-uri-
|
|
90
|
+
} from "./media-uri-sar77n3p.js";
|
|
91
91
|
import {
|
|
92
92
|
ProjectHandler2
|
|
93
|
-
} from "./media-uri-
|
|
93
|
+
} from "./media-uri-npqc081y.js";
|
|
94
94
|
import {
|
|
95
95
|
WorktreeHandler2
|
|
96
|
-
} from "./media-uri-
|
|
96
|
+
} from "./media-uri-kxxxzk43.js";
|
|
97
97
|
import {
|
|
98
98
|
VcsHandler2
|
|
99
|
-
} from "./media-uri-
|
|
99
|
+
} from "./media-uri-mf0jv62d.js";
|
|
100
100
|
import {
|
|
101
101
|
MigrationHandler2
|
|
102
|
-
} from "./media-uri-
|
|
102
|
+
} from "./media-uri-23bsg0bb.js";
|
|
103
103
|
import {
|
|
104
104
|
ConfigHandler2
|
|
105
|
-
} from "./media-uri-
|
|
105
|
+
} from "./media-uri-4a2eztcc.js";
|
|
106
106
|
|
|
107
107
|
// src/handlers.ts
|
|
108
108
|
import { Layer } from "effect";
|
|
109
|
-
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, FlagHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(
|
|
109
|
+
var handlers2 = Layer.mergeAll(ServerHandler2, DebugHandler2, MigrationHandler2, LocationHandler2, AgentHandler2, PluginHandler2, SessionHandler2, MessageHandler2, ModelHandler2, GenerateHandler2, VoiceHandler2, ProviderHandler2, IntegrationHandler2, WebSearchHandler2, UsageHandler2, FlagHandler2, McpHandler2, CredentialHandler2, ProjectHandler2, FormHandler2, PermissionHandler2, FileSystemHandler2, CommandHandler2, SkillHandler2, RpcHandler2, EventHandler2.pipe(Layer.provide(layer3(extension2))), PtyHandler2, PersistentPtyHandler2, ShellHandler2, ReferenceHandler2, WorktreeHandler2, VcsHandler2, ConfigHandler2);
|
|
110
110
|
|
|
111
111
|
export { handlers2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-stx1bw5w.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-p8x80wn6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/generate.ts
|
|
9
9
|
import { Generate } from "@opencode/core/generate";
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
var exports_server_info = {};
|
|
7
7
|
__export(exports_server_info, {
|
|
8
8
|
ServerInfo: () => exports_server_info,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service5,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
11
|
layer: () => layer4
|
|
12
12
|
});
|
|
13
13
|
import { Context, Layer } from "effect";
|
|
14
14
|
import { networkInterfaces } from "node:os";
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class Service5 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
18
|
function layer4(urls, tmp, app = {}) {
|
|
19
|
-
return Layer.succeed(
|
|
19
|
+
return Layer.succeed(Service5, Service5.of({ urls, app, paths: { tmp } }));
|
|
20
20
|
}
|
|
21
21
|
function connectionURLs2(value, requestedHostname) {
|
|
22
22
|
const url = new URL(value);
|
|
@@ -38,4 +38,4 @@ function connectionURLs2(value, requestedHostname) {
|
|
|
38
38
|
];
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export {
|
|
41
|
+
export { Service5, layer4, connectionURLs2, exports_server_info };
|
|
@@ -7,10 +7,10 @@ var exports_space_store = {};
|
|
|
7
7
|
__export(exports_space_store, {
|
|
8
8
|
BatchSize: () => BatchSize2,
|
|
9
9
|
PurgeInterval: () => PurgeInterval2,
|
|
10
|
-
Service: () =>
|
|
10
|
+
Service: () => Service2,
|
|
11
11
|
SpaceStore: () => exports_space_store,
|
|
12
12
|
extension: () => extension2,
|
|
13
|
-
node: () =>
|
|
13
|
+
node: () => node2
|
|
14
14
|
});
|
|
15
15
|
import { SpaceRows } from "@opencode/core/space";
|
|
16
16
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -22,9 +22,9 @@ import { Clock, Context, Effect, Layer } from "effect";
|
|
|
22
22
|
var BatchSize2 = 500;
|
|
23
23
|
var PurgeInterval2 = 64;
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class Service2 extends Context.Service()("@opencode/server/SpaceStore") {
|
|
26
26
|
}
|
|
27
|
-
var layer = Layer.effect(
|
|
27
|
+
var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
28
28
|
const db = (yield* Database.Service).db;
|
|
29
29
|
let epoch = yield* SpaceRows.epoch(db).pipe(Effect.catchCause((cause) => Effect.logWarning("Could not read the space epoch", { cause }).pipe(Effect.as(crypto.randomUUID()))));
|
|
30
30
|
const listeners = new Array;
|
|
@@ -102,7 +102,7 @@ var layer = Layer.effect(Service5, Effect.gen(function* () {
|
|
|
102
102
|
events: read.rows.map((row) => change(space, row, created))
|
|
103
103
|
};
|
|
104
104
|
});
|
|
105
|
-
return
|
|
105
|
+
return Service2.of({
|
|
106
106
|
write: Effect.fn("SpaceStore.write")(function* (changes) {
|
|
107
107
|
return yield* [...new Set(changes.map((change) => change.space))].toSorted().reduceRight((effect, space) => locks.withLock(space)(effect), Effect.uninterruptible(Effect.gen(function* () {
|
|
108
108
|
const result = yield* SpaceRows.write(db, changes);
|
|
@@ -183,9 +183,9 @@ var layer = Layer.effect(Service5, Effect.gen(function* () {
|
|
|
183
183
|
})
|
|
184
184
|
});
|
|
185
185
|
}));
|
|
186
|
-
var
|
|
186
|
+
var node2 = makeGlobalNode({ service: Service2, layer, deps: [Database.node] });
|
|
187
187
|
var extension2 = Effect.gen(function* () {
|
|
188
|
-
const store = yield*
|
|
188
|
+
const store = yield* Service2;
|
|
189
189
|
return { open: (stream, send) => store.attach(stream, send) };
|
|
190
190
|
});
|
|
191
191
|
function change(space, row, created) {
|
|
@@ -216,4 +216,4 @@ function parse(epoch, cursor) {
|
|
|
216
216
|
return { since: Number(parts[0]), head: parts[1] === undefined ? undefined : Number(parts[1]) };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
export { BatchSize2, PurgeInterval2,
|
|
219
|
+
export { BatchSize2, PurgeInterval2, Service2, node2, extension2, exports_space_store };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-stx1bw5w.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-p8x80wn6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/plugin.ts
|
|
9
9
|
import { Plugin } from "@opencode/core/plugin";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isAllowedCorsOrigin2
|
|
3
|
+
} from "./media-uri-q4bn6dy8.js";
|
|
4
|
+
import {
|
|
5
|
+
middleware2
|
|
6
|
+
} from "./media-uri-hmwn16zp.js";
|
|
7
|
+
import {
|
|
8
|
+
withoutParentSpan2
|
|
9
|
+
} from "./media-uri-yc7nft6q.js";
|
|
10
|
+
import {
|
|
11
|
+
createRoutes2
|
|
12
|
+
} from "./media-uri-0wwbgx8t.js";
|
|
13
|
+
import {
|
|
14
|
+
__export
|
|
15
|
+
} from "./media-uri-9rqn6x4v.js";
|
|
16
|
+
|
|
17
|
+
// src/fetch.ts
|
|
18
|
+
var exports_fetch = {};
|
|
19
|
+
__export(exports_fetch, {
|
|
20
|
+
ServerFetch: () => exports_fetch,
|
|
21
|
+
build: () => build2,
|
|
22
|
+
make: () => make2,
|
|
23
|
+
makeWithContext: () => makeWithContext2,
|
|
24
|
+
serve: () => serve2
|
|
25
|
+
});
|
|
26
|
+
import { Context, Effect, flow, Layer } from "effect";
|
|
27
|
+
import { HttpEffect, HttpMiddleware, HttpRouter, HttpServer } from "effect/http";
|
|
28
|
+
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
29
|
+
var makeWithContext2 = Effect.fn("ServerFetch.makeWithContext")(function* (options = {}, boot = {}) {
|
|
30
|
+
const context = yield* build2(createRoutes2(options, () => [], boot.overrides ?? []));
|
|
31
|
+
const handler = yield* serve2(context, flow(middleware2(options), HttpMiddleware.cors({ allowedOrigins: (origin) => isAllowedCorsOrigin2(origin, options), maxAge: 86400 })));
|
|
32
|
+
return { handler, context };
|
|
33
|
+
});
|
|
34
|
+
var build2 = (routes) => Layer.build(routes.pipe(Layer.provide(HttpServer.layerServices))).pipe(withoutParentSpan2);
|
|
35
|
+
var serve2 = Effect.fnUntraced(function* (context, middleware = (app) => app) {
|
|
36
|
+
yield* Context.get(context, SessionRestart.Service).resumeSuspendedSessions.pipe(Effect.provideContext(context), withoutParentSpan2, Effect.forkScoped);
|
|
37
|
+
return Context.get(context, HttpRouter.HttpRouter).asHttpEffect().pipe(middleware, HttpEffect.toWebHandlerWith(context));
|
|
38
|
+
});
|
|
39
|
+
var make2 = Effect.fn("ServerFetch.make")(function* (options = {}, boot = {}) {
|
|
40
|
+
return (yield* makeWithContext2(options, boot)).handler;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { makeWithContext2, build2, serve2, make2, exports_fetch };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-stx1bw5w.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-jy2ammbg.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./media-uri-
|
|
9
|
+
} from "./media-uri-aexh791j.js";
|
|
10
10
|
|
|
11
11
|
// src/api.ts
|
|
12
12
|
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-p8x80wn6.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-dxh72p2c.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -51,7 +51,7 @@ function decode(input) {
|
|
|
51
51
|
return input;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
var
|
|
54
|
+
var layer2 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
55
55
|
const locations = yield* LocationServiceMap.Service;
|
|
56
56
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
57
57
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -59,4 +59,4 @@ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
59
59
|
}));
|
|
60
60
|
}));
|
|
61
61
|
|
|
62
|
-
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2,
|
|
62
|
+
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer2 };
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./media-uri-
|
|
5
|
+
} from "./media-uri-stx1bw5w.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./media-uri-
|
|
8
|
+
} from "./media-uri-p8x80wn6.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-stx1bw5w.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./media-uri-
|
|
6
|
+
} from "./media-uri-p8x80wn6.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./media-uri-
|
|
3
|
+
} from "./media-uri-p8x80wn6.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
sessionCookieName2
|
|
9
9
|
} from "./media-uri-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "./media-uri-
|
|
11
|
+
Service5
|
|
12
|
+
} from "./media-uri-megkv1kf.js";
|
|
13
13
|
import {
|
|
14
14
|
Service3
|
|
15
|
-
} from "./media-uri-
|
|
15
|
+
} from "./media-uri-vb61dkrm.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|
|
@@ -25,7 +25,7 @@ var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => E
|
|
|
25
25
|
const pairing = yield* Service3;
|
|
26
26
|
const auth = yield* Config2;
|
|
27
27
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
28
|
-
const info = yield*
|
|
28
|
+
const info = yield* Service5;
|
|
29
29
|
return {
|
|
30
30
|
version: info.app.version ?? "unknown",
|
|
31
31
|
pid: process.pid ?? 0,
|
|
@@ -7,7 +7,7 @@ var exports_pairing = {};
|
|
|
7
7
|
__export(exports_pairing, {
|
|
8
8
|
ServerPairing: () => exports_pairing,
|
|
9
9
|
Service: () => Service3,
|
|
10
|
-
node: () =>
|
|
10
|
+
node: () => node3
|
|
11
11
|
});
|
|
12
12
|
import { Cache, Context, Duration, Effect, Layer } from "effect";
|
|
13
13
|
import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
@@ -30,6 +30,6 @@ var layer = Layer.effect(Service3, Effect.gen(function* () {
|
|
|
30
30
|
})
|
|
31
31
|
});
|
|
32
32
|
}));
|
|
33
|
-
var
|
|
33
|
+
var node3 = makeGlobalNode({ service: Service3, layer, deps: [] });
|
|
34
34
|
|
|
35
|
-
export { Service3,
|
|
35
|
+
export { Service3, node3, exports_pairing };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./media-uri-
|
|
2
|
+
Service2
|
|
3
|
+
} from "./media-uri-mj1ewmp1.js";
|
|
4
4
|
|
|
5
5
|
// src/handlers/space.ts
|
|
6
6
|
import { InvalidRequestError } from "@opencode/protocol/errors";
|
|
@@ -11,7 +11,7 @@ var streamNotFound = () => new InvalidRequestError({ message: "No open event str
|
|
|
11
11
|
var repeated = (spaces) => new Set(spaces).size !== spaces.length;
|
|
12
12
|
var repeatedSpace = () => new InvalidRequestError({ message: "Each space may appear only once", field: "spaces" });
|
|
13
13
|
var makeSpace2 = Effect.gen(function* () {
|
|
14
|
-
const store = yield*
|
|
14
|
+
const store = yield* Service2;
|
|
15
15
|
return {
|
|
16
16
|
write: Effect.fn("SpaceHandler.write")(function* (changes) {
|
|
17
17
|
const encoder = new TextEncoder;
|
package/dist/event-feed.js
CHANGED
|
@@ -2,19 +2,19 @@ import {
|
|
|
2
2
|
SubscriberCapacity2,
|
|
3
3
|
SubscriberOverflowError2,
|
|
4
4
|
EncodingError2,
|
|
5
|
-
|
|
5
|
+
Service4,
|
|
6
6
|
frame2,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
make3,
|
|
8
|
+
layer3,
|
|
9
9
|
exports_event_feed
|
|
10
|
-
} from "./chunks/media-uri-
|
|
10
|
+
} from "./chunks/media-uri-gb9bc2v4.js";
|
|
11
11
|
export {
|
|
12
12
|
EncodingError2 as EncodingError,
|
|
13
13
|
exports_event_feed as EventFeed,
|
|
14
|
-
|
|
14
|
+
Service4 as Service,
|
|
15
15
|
SubscriberCapacity2 as SubscriberCapacity,
|
|
16
16
|
SubscriberOverflowError2 as SubscriberOverflowError,
|
|
17
17
|
frame2 as frame,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
layer3 as layer,
|
|
19
|
+
make3 as make
|
|
20
20
|
};
|
package/dist/fetch.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as ServerFetch from "./fetch";
|
|
2
|
-
import { Context, Effect } from "effect";
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
3
|
import { HttpRouter } from "effect/http";
|
|
4
4
|
import { SessionRestart } from "@opencode/core/session/execution/restart";
|
|
5
5
|
import type { LayerNode } from "@opencode/util/effect/layer-node";
|
|
@@ -17,11 +17,6 @@ export declare const makeWithContext: (options?: {
|
|
|
17
17
|
readonly version?: string | undefined;
|
|
18
18
|
readonly channel?: string | undefined;
|
|
19
19
|
} | undefined;
|
|
20
|
-
readonly hostname?: string | undefined;
|
|
21
|
-
readonly port?: number | undefined;
|
|
22
|
-
readonly password?: string | undefined;
|
|
23
|
-
readonly cors?: readonly string[] | undefined;
|
|
24
|
-
readonly simulation?: boolean | undefined;
|
|
25
20
|
readonly database?: {
|
|
26
21
|
readonly path?: string | undefined;
|
|
27
22
|
} | undefined;
|
|
@@ -61,10 +56,26 @@ export declare const makeWithContext: (options?: {
|
|
|
61
56
|
readonly filewatcher?: boolean | undefined;
|
|
62
57
|
readonly fff?: boolean | undefined;
|
|
63
58
|
} | undefined;
|
|
59
|
+
readonly hostname?: string | undefined;
|
|
60
|
+
readonly port?: number | undefined;
|
|
61
|
+
readonly password?: string | undefined;
|
|
62
|
+
readonly cors?: readonly string[] | undefined;
|
|
63
|
+
readonly simulation?: boolean | undefined;
|
|
64
64
|
} | undefined, boot?: BootOptions | undefined) => Effect.Effect<{
|
|
65
65
|
handler: (request: Request, context?: Context.Context<never> | undefined) => Promise<globalThis.Response>;
|
|
66
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
|
+
/**
|
|
69
|
+
* Builds a route layer (`createRoutes` or `createEmbeddedRoutes`) in the current Scope. Shared with the SDK's
|
|
70
|
+
* embedded host so both serve the same graph.
|
|
71
|
+
*/
|
|
72
|
+
export declare const build: <A, E, R>(routes: Layer.Layer<A, E, R>) => Effect.Effect<Context.Context<A>, E, import("effect/Scope").Scope | Exclude<R, import("effect/FileSystem").FileSystem | import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/Path").Path>>;
|
|
73
|
+
/**
|
|
74
|
+
* Starts serving a built route context: resumes suspended Sessions in a fiber the current Scope owns, then returns
|
|
75
|
+
* the web handler. Shared with the SDK's embedded host, which registers its plugins between `build` and `serve` so
|
|
76
|
+
* recovery never runs without them.
|
|
77
|
+
*/
|
|
78
|
+
export declare const serve: (context: Context.Context<HttpRouter.HttpRouter | SessionRestart.Service>, middleware?: ((app: ReturnType<HttpRouter.HttpRouter["asHttpEffect"]>) => ReturnType<HttpRouter.HttpRouter["asHttpEffect"]>) | undefined) => Effect.Effect<(request: Request, context?: Context.Context<never> | undefined) => Promise<globalThis.Response>, never, import("effect/Scope").Scope>;
|
|
68
79
|
/**
|
|
69
80
|
* Builds a web-standard fetch handler — `(request: Request) => Promise<Response>` — serving the
|
|
70
81
|
* same HttpApi routes as the Node server process without binding a port, owning a listener, or
|
|
@@ -93,11 +104,6 @@ export declare const make: (options?: {
|
|
|
93
104
|
readonly version?: string | undefined;
|
|
94
105
|
readonly channel?: string | undefined;
|
|
95
106
|
} | undefined;
|
|
96
|
-
readonly hostname?: string | undefined;
|
|
97
|
-
readonly port?: number | undefined;
|
|
98
|
-
readonly password?: string | undefined;
|
|
99
|
-
readonly cors?: readonly string[] | undefined;
|
|
100
|
-
readonly simulation?: boolean | undefined;
|
|
101
107
|
readonly database?: {
|
|
102
108
|
readonly path?: string | undefined;
|
|
103
109
|
} | undefined;
|
|
@@ -137,4 +143,9 @@ export declare const make: (options?: {
|
|
|
137
143
|
readonly filewatcher?: boolean | undefined;
|
|
138
144
|
readonly fff?: boolean | undefined;
|
|
139
145
|
} | undefined;
|
|
146
|
+
readonly hostname?: string | undefined;
|
|
147
|
+
readonly port?: number | undefined;
|
|
148
|
+
readonly password?: string | undefined;
|
|
149
|
+
readonly cors?: readonly string[] | undefined;
|
|
150
|
+
readonly simulation?: boolean | undefined;
|
|
140
151
|
} | undefined, boot?: BootOptions | undefined) => Effect.Effect<(request: Request, context?: Context.Context<never> | undefined) => Promise<globalThis.Response>, Error, import("effect/Scope").Scope>;
|