@opencode/server 2.0.21 → 2.0.23
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 +1 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{request-tracing-26ta7ngt.js → options-0b1t2b2s.js} +2 -2
- package/dist/chunks/{request-tracing-ees77nh9.js → options-2vy10eeh.js} +2 -2
- package/dist/chunks/{request-tracing-s1re0xgr.js → options-30gqa6y8.js} +13 -10
- package/dist/chunks/{request-tracing-bmqkn4ah.js → options-387sf4vs.js} +1 -1
- package/dist/chunks/{request-tracing-wz0qz28j.js → options-3c937re8.js} +2 -2
- package/dist/chunks/{request-tracing-rjpqaa8h.js → options-54sczv30.js} +7 -7
- package/dist/chunks/{request-tracing-qj9kjxn3.js → options-5fmydwgy.js} +1 -1
- package/dist/chunks/{request-tracing-v305azr7.js → options-5p62ed52.js} +7 -7
- package/dist/chunks/{request-tracing-5w24ch67.js → options-5w24ch67.js} +1 -1
- package/dist/chunks/{request-tracing-hr75rahr.js → options-62qjgyra.js} +2 -2
- package/dist/chunks/{request-tracing-np19kmxx.js → options-6sgwm4gr.js} +2 -2
- package/dist/chunks/{request-tracing-cs3kpd5s.js → options-7nkw7zmw.js} +3 -3
- package/dist/chunks/{request-tracing-6gkz39ey.js → options-acgs9zzk.js} +13 -6
- package/dist/chunks/{request-tracing-anm12x33.js → options-anm12x33.js} +1 -1
- package/dist/chunks/{request-tracing-3atyrqsp.js → options-aqzs83qc.js} +4 -4
- package/dist/chunks/{request-tracing-bkk2wfbz.js → options-bkk2wfbz.js} +1 -1
- package/dist/chunks/{request-tracing-v1emgcvb.js → options-bptmkrac.js} +2 -2
- package/dist/chunks/{request-tracing-bt9tc5rb.js → options-ccfecbt4.js} +1 -1
- package/dist/chunks/{request-tracing-5rwqcaw2.js → options-d00srfh1.js} +6 -5
- package/dist/chunks/{request-tracing-x5ncpjy3.js → options-da5stqtt.js} +2 -2
- package/dist/chunks/{request-tracing-y6ybxmgz.js → options-dvemjn3r.js} +11 -9
- package/dist/chunks/{request-tracing-v573ws0d.js → options-ep84ha6r.js} +3 -3
- package/dist/chunks/{request-tracing-b1rdg9nf.js → options-fsrvj92d.js} +2 -2
- package/dist/chunks/{request-tracing-fpwvrnjd.js → options-gdqqe6m4.js} +33 -33
- package/dist/chunks/{request-tracing-gtkdacvk.js → options-gtkdacvk.js} +1 -1
- package/dist/chunks/{request-tracing-e1j0tbav.js → options-j54drd5e.js} +1 -1
- package/dist/chunks/{request-tracing-96s6m0w3.js → options-jhsx8jtg.js} +2 -2
- package/dist/chunks/{request-tracing-6qwktr1g.js → options-jskw5q1g.js} +1 -1
- package/dist/chunks/{request-tracing-r2rnm758.js → options-k4rfktze.js} +3 -3
- package/dist/chunks/{request-tracing-byt4hbw9.js → options-kr61w04k.js} +7 -7
- package/dist/chunks/{request-tracing-hp5sxeae.js → options-m9wzfeff.js} +2 -2
- package/dist/chunks/{request-tracing-rjqbhscq.js → options-mpbfcr4e.js} +5 -2
- package/dist/chunks/{request-tracing-5bwq5cz2.js → options-n7kafg5g.js} +2 -2
- package/dist/chunks/options-nvmdgpqv.js +71 -0
- package/dist/chunks/{request-tracing-3kzx88w9.js → options-nxdx74sv.js} +5 -4
- package/dist/chunks/{request-tracing-t88f2hhf.js → options-pg3sqc69.js} +5 -4
- package/dist/chunks/{request-tracing-pme11y2y.js → options-q4y3mw2d.js} +2 -2
- package/dist/chunks/{request-tracing-ctscy0f5.js → options-qcy0p5fz.js} +2 -2
- package/dist/chunks/{request-tracing-7eckj7zq.js → options-srcrrwjk.js} +2 -2
- package/dist/chunks/{request-tracing-haswyr8z.js → options-swb5yrqf.js} +2 -2
- package/dist/chunks/{request-tracing-2s2j0nb0.js → options-vkrn1g9x.js} +16 -16
- package/dist/chunks/{request-tracing-140y8w7p.js → options-w8db1rkr.js} +2 -2
- package/dist/chunks/{request-tracing-mb9kfqxc.js → options-wzq8v6r1.js} +5 -5
- package/dist/chunks/{request-tracing-f8rap8f6.js → options-zhqf1t9m.js} +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.d.ts +2 -1
- package/dist/fetch.js +47 -47
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.js +6 -6
- 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 +6 -6
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/mcp.js +6 -6
- package/dist/handlers/message.js +6 -6
- 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.js +8 -8
- 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 +9 -9
- 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 +6 -6
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/vcs.d.ts +4 -1
- package/dist/handlers/vcs.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 +43 -43
- package/dist/location.d.ts +5 -3
- package/dist/location.js +6 -4
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/form-location.d.ts +3 -3
- package/dist/middleware/form-location.js +3 -3
- package/dist/middleware/schema-error.js +1 -1
- package/dist/middleware/session-location.d.ts +3 -3
- package/dist/middleware/session-location.js +3 -3
- package/dist/options.d.ts +1 -0
- package/dist/pairing.js +3 -3
- package/dist/process.d.ts +2 -1
- package/dist/process.js +49 -49
- package/dist/pty-environment.js +1 -1
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +2 -2
- package/dist/routes.js +46 -46
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +49 -48
- package/package.json +8 -8
- package/dist/chunks/request-tracing-zpz5afwq.js +0 -32
- /package/dist/chunks/{request-tracing-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{request-tracing-hezj1jdf.js → options-hezj1jdf.js} +0 -0
- /package/dist/chunks/{request-tracing-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{request-tracing-smaf4a18.js → options-smaf4a18.js} +0 -0
- /package/dist/chunks/{request-tracing-t8yzmczr.js → options-t8yzmczr.js} +0 -0
- /package/dist/chunks/{request-tracing-yc7nft6q.js → options-yc7nft6q.js} +0 -0
package/dist/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LocationMiddleware } from "./location";
|
|
2
2
|
import { FormLocationMiddleware } from "./middleware/form-location";
|
|
3
3
|
import { SessionLocationMiddleware } from "./middleware/session-location";
|
|
4
|
-
export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services,
|
|
4
|
+
export declare const Api: import("@opencode/protocol/api").Api<LocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, FormLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, SessionLocationMiddleware, import("effect/unstable/httpapi/HttpApiMiddleware").HttpApiMiddleware<import("@opencode/core/instance").Services, readonly [typeof import("@opencode/protocol/errors").InvalidRequestError, typeof import("@opencode/protocol/errors").SessionNotFoundError, typeof import("@opencode/protocol/errors").LocationNotFoundError], never>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"server.event", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"event.subscribe", "GET", "/api/event", never, never, never, never, import("effect/unstable/httpapi/HttpApiSchema").StreamSse<import("effect/unstable/httpapi/HttpApiSchema").SseEventFromData<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
5
5
|
readonly id: import("effect/Schema").brand<import("effect/Schema").String, "Event.ID"> & {
|
|
6
6
|
create: () => string & import("effect/Brand").Brand<"Event.ID">;
|
|
7
7
|
};
|
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/options-ep84ha6r.js";
|
|
4
|
+
import"./chunks/options-d00srfh1.js";
|
|
5
|
+
import"./chunks/options-nxdx74sv.js";
|
|
6
|
+
import"./chunks/options-acgs9zzk.js";
|
|
7
|
+
import"./chunks/options-smaf4a18.js";
|
|
8
8
|
export {
|
|
9
9
|
Api2 as Api
|
|
10
10
|
};
|
package/dist/auth.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-smaf4a18.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-ep84ha6r.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/message.ts
|
|
10
10
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/form.ts
|
|
9
9
|
import { Form } from "@opencode/core/form";
|
|
@@ -3,10 +3,13 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-smaf4a18.js";
|
|
7
|
+
import {
|
|
8
|
+
locationErrors2
|
|
9
|
+
} from "./options-acgs9zzk.js";
|
|
7
10
|
import {
|
|
8
11
|
Api2
|
|
9
|
-
} from "./
|
|
12
|
+
} from "./options-ep84ha6r.js";
|
|
10
13
|
|
|
11
14
|
// src/handlers/session.ts
|
|
12
15
|
import { Session } from "@opencode/core/session";
|
|
@@ -106,8 +109,8 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
106
109
|
model: ctx.payload.model,
|
|
107
110
|
metadata: ctx.payload.metadata,
|
|
108
111
|
permissions: ctx.payload.permissions,
|
|
109
|
-
location: ctx.payload.location ?? { directory: AbsolutePath.make(process.cwd()) }
|
|
110
|
-
}).pipe(Effect.
|
|
112
|
+
...ctx.payload.parentID === undefined ? { location: ctx.payload.location ?? { directory: AbsolutePath.make(process.cwd()) } } : { parentID: ctx.payload.parentID }
|
|
113
|
+
}).pipe(Effect.catchTag("Session.NotFoundError", missingSession2))
|
|
111
114
|
};
|
|
112
115
|
})).handle("session.import", Effect.fn(function* (ctx) {
|
|
113
116
|
return {
|
|
@@ -188,7 +191,7 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
188
191
|
}).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.PromptConflictError", (error) => Effect.fail(new ConflictError({
|
|
189
192
|
message: `Prompt message ID conflicts with an existing durable record: ${error.messageID}`,
|
|
190
193
|
resource: error.messageID
|
|
191
|
-
}))), Effect.catchTag("Session.AttachmentError", (error) => Effect.fail(new InvalidRequestError({ message: error.message, field: "files" }))), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new InvalidRequestError({ message: `Skill not found: ${error.skill}`, field: "skills" }))))
|
|
194
|
+
}))), Effect.catchTag("Session.AttachmentError", (error) => Effect.fail(new InvalidRequestError({ message: error.message, field: "files" }))), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new InvalidRequestError({ message: `Skill not found: ${error.skill}`, field: "skills" }))), locationErrors2)
|
|
192
195
|
};
|
|
193
196
|
})).handle("session.command", Effect.fn(function* (ctx) {
|
|
194
197
|
yield* session.command({
|
|
@@ -205,14 +208,14 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
205
208
|
}))), Effect.catchTag("Command.ExecutionError", (error) => Effect.fail(new CommandExecutionError({
|
|
206
209
|
command: error.command,
|
|
207
210
|
message: error.message
|
|
208
|
-
}))));
|
|
211
|
+
}))), locationErrors2);
|
|
209
212
|
return HttpApiSchema.NoContent.make();
|
|
210
213
|
})).handle("session.skill", Effect.fn(function* (ctx) {
|
|
211
214
|
yield* session.skill({
|
|
212
215
|
sessionID: ctx.params.sessionID,
|
|
213
216
|
skill: ctx.payload.id,
|
|
214
217
|
resume: ctx.payload.resume
|
|
215
|
-
}).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new SkillNotFoundError({ skill: error.skill, message: `Skill not found: ${error.skill}` }))));
|
|
218
|
+
}).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.SkillNotFoundError", (error) => Effect.fail(new SkillNotFoundError({ skill: error.skill, message: `Skill not found: ${error.skill}` }))), locationErrors2);
|
|
216
219
|
return HttpApiSchema.NoContent.make();
|
|
217
220
|
})).handle("session.synthetic", Effect.fn(function* (ctx) {
|
|
218
221
|
const data = yield* session.synthetic({
|
|
@@ -248,11 +251,11 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
248
251
|
files: ctx.payload.files
|
|
249
252
|
});
|
|
250
253
|
return {
|
|
251
|
-
data: yield* session.revert.stage({ ...ctx.params, ...ctx.payload }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("stage session revert", ctx.params.sessionID)))
|
|
254
|
+
data: yield* session.revert.stage({ ...ctx.params, ...ctx.payload }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("stage session revert", ctx.params.sessionID)), locationErrors2)
|
|
252
255
|
};
|
|
253
256
|
})).handle("session.revert.clear", Effect.fn(function* (ctx) {
|
|
254
257
|
yield* Effect.log("session.revert.clear", { sessionID: ctx.params.sessionID });
|
|
255
|
-
yield* session.revert.clear(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("clear session revert", ctx.params.sessionID)));
|
|
258
|
+
yield* session.revert.clear(ctx.params.sessionID).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.BusyError", busySession), Effect.catchTag("Snapshot.Error", failedSnapshot2("clear session revert", ctx.params.sessionID)), locationErrors2);
|
|
256
259
|
return HttpApiSchema.NoContent.make();
|
|
257
260
|
})).handle("session.revert.commit", Effect.fn(function* (ctx) {
|
|
258
261
|
yield* Effect.log("session.revert.commit", { sessionID: ctx.params.sessionID });
|
|
@@ -264,7 +267,7 @@ var SessionHandler2 = HttpApiBuilder.group(Api2, "server.session", (handlers) =>
|
|
|
264
267
|
};
|
|
265
268
|
})).handle("session.diff", Effect.fn(function* (ctx) {
|
|
266
269
|
return {
|
|
267
|
-
data: yield* session.diff({ sessionID: ctx.params.sessionID, ...ctx.query }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.TurnRangeError", (error) => new InvalidRequestError({ message: error.message, field: error.field })), Effect.catchTag("Snapshot.Error", failedSnapshot2("diff session turn", ctx.params.sessionID)))
|
|
270
|
+
data: yield* session.diff({ sessionID: ctx.params.sessionID, ...ctx.query }).pipe(Effect.catchTag("Session.NotFoundError", missingSession2), Effect.catchTag("Session.MessageNotFoundError", missingMessage2), Effect.catchTag("Session.TurnRangeError", (error) => new InvalidRequestError({ message: error.message, field: error.field })), Effect.catchTag("Snapshot.Error", failedSnapshot2("diff session turn", ctx.params.sessionID)), locationErrors2)
|
|
268
271
|
};
|
|
269
272
|
})).handle("session.inbox.list", Effect.fn(function* (ctx) {
|
|
270
273
|
return {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/mcp.ts
|
|
9
9
|
import { Mcp } from "@opencode/core/mcp/index";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/event-feed.ts
|
|
6
6
|
var exports_event_feed = {};
|
|
7
7
|
__export(exports_event_feed, {
|
|
8
8
|
EncodingError: () => EncodingError2,
|
|
9
9
|
EventFeed: () => exports_event_feed,
|
|
10
|
-
Service: () =>
|
|
10
|
+
Service: () => Service5,
|
|
11
11
|
SubscriberCapacity: () => SubscriberCapacity2,
|
|
12
12
|
SubscriberOverflowError: () => SubscriberOverflowError2,
|
|
13
13
|
frame: () => frame2,
|
|
14
|
-
layer: () =>
|
|
14
|
+
layer: () => layer5,
|
|
15
15
|
make: () => make4
|
|
16
16
|
});
|
|
17
17
|
import { Bus } from "@opencode/core/bus";
|
|
@@ -30,7 +30,7 @@ class EncodingError2 extends Schema.TaggedError()("EventFeed.EncodingError", {
|
|
|
30
30
|
}) {
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class Service5 extends Context.Service()("@opencode/server/EventFeed") {
|
|
34
34
|
}
|
|
35
35
|
function frame2(event) {
|
|
36
36
|
return `data: ${JSON.stringify(event)}
|
|
@@ -71,13 +71,13 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
|
71
71
|
});
|
|
72
72
|
const unsubscribe = yield* observe(publish);
|
|
73
73
|
yield* Effect.addFinalizer(() => unsubscribe);
|
|
74
|
-
return
|
|
74
|
+
return Service5.of({
|
|
75
75
|
subscribe: Effect.acquireRelease(Queue.dropping(capacity).pipe(Effect.tap((queue) => Effect.sync(() => subscribers.add(queue)))), (queue) => Effect.sync(() => subscribers.delete(queue)).pipe(Effect.andThen(Queue.shutdown(queue)), Effect.asVoid)).pipe(Effect.map(Stream.fromQueue))
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
|
-
var
|
|
78
|
+
var layer5 = Layer.effect(Service5, Effect.gen(function* () {
|
|
79
79
|
const bus = yield* Bus.Service;
|
|
80
80
|
return yield* make4(bus.listen);
|
|
81
81
|
}));
|
|
82
82
|
|
|
83
|
-
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2,
|
|
83
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service5, frame2, make4, layer5, exports_event_feed };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/server-info.ts
|
|
6
6
|
var exports_server_info = {};
|
|
7
7
|
__export(exports_server_info, {
|
|
8
8
|
ServerInfo: () => exports_server_info,
|
|
9
|
-
Service: () =>
|
|
9
|
+
Service: () => Service4,
|
|
10
10
|
connectionURLs: () => connectionURLs2,
|
|
11
|
-
layer: () =>
|
|
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 Service4 extends Context.Service()("@opencode/server/ServerInfo") {
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Layer.succeed(
|
|
18
|
+
function layer4(urls, tmp, app = {}) {
|
|
19
|
+
return Layer.succeed(Service4, Service4.of({ urls, app, paths: { tmp } }));
|
|
20
20
|
}
|
|
21
21
|
function connectionURLs2(value, requestedHostname) {
|
|
22
22
|
const url = new URL(value);
|
|
@@ -33,4 +33,4 @@ function connectionURLs2(value, requestedHostname) {
|
|
|
33
33
|
];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export {
|
|
36
|
+
export { Service4, layer4, connectionURLs2, exports_server_info };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/plugin.ts
|
|
9
9
|
import { Plugin } from "@opencode/core/plugin";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
createRoutes2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-vkrn1g9x.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./options-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/fetch.ts
|
|
12
12
|
var exports_fetch = {};
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-smaf4a18.js";
|
|
4
4
|
|
|
5
5
|
// src/location.ts
|
|
6
|
+
import { FileSystem } from "@opencode/core/filesystem";
|
|
6
7
|
import { Location } from "@opencode/core/location";
|
|
7
8
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
8
9
|
import { AbsolutePath } from "@opencode/core/schema";
|
|
9
10
|
import { Session } from "@opencode/core/session";
|
|
10
|
-
import { InvalidRequestError } from "@opencode/protocol/errors";
|
|
11
|
+
import { LocationNotFoundError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
11
12
|
import { Effect, Layer, Schema } from "effect";
|
|
12
13
|
import { HttpServerRequest } from "effect/unstable/http";
|
|
13
14
|
import { HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
14
|
-
class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation") {
|
|
15
|
+
class LocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiLocation", { error: [LocationNotFoundError] }) {
|
|
16
|
+
}
|
|
17
|
+
function locationErrors2(effect) {
|
|
18
|
+
return effect.pipe(Effect.catchIf((error) => error instanceof FileSystem.DirectoryNotFoundError, (error) => Effect.fail(new LocationNotFoundError({
|
|
19
|
+
location: { directory: error.directory },
|
|
20
|
+
message: `Location not found: ${error.directory}`
|
|
21
|
+
}))));
|
|
15
22
|
}
|
|
16
23
|
function response2(data) {
|
|
17
24
|
return Effect.gen(function* () {
|
|
@@ -44,12 +51,12 @@ function decode(input) {
|
|
|
44
51
|
return input;
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
|
-
var
|
|
54
|
+
var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
48
55
|
const locations = yield* LocationServiceMap.Service;
|
|
49
56
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
50
57
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
51
|
-
return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))));
|
|
58
|
+
return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))), locationErrors2);
|
|
52
59
|
}));
|
|
53
60
|
}));
|
|
54
61
|
|
|
55
|
-
export { LocationMiddleware2, response2, sessionInfo2, requestRef2,
|
|
62
|
+
export { LocationMiddleware2, locationErrors2, response2, sessionInfo2, requestRef2, layer3 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-ep84ha6r.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
Service5,
|
|
6
6
|
frame2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-54sczv30.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/event.ts
|
|
10
10
|
import { Event } from "@opencode/schema/event";
|
|
@@ -12,7 +12,7 @@ import { Effect, Stream } from "effect";
|
|
|
12
12
|
import { HttpServerResponse } from "effect/unstable/http";
|
|
13
13
|
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
14
14
|
var EventHandler2 = HttpApiBuilder.group(Api2, "server.event", (handlers) => Effect.gen(function* () {
|
|
15
|
-
const feed = yield*
|
|
15
|
+
const feed = yield* Service5;
|
|
16
16
|
return handlers.handleRaw("event.subscribe", () => Effect.gen(function* () {
|
|
17
17
|
const connected = {
|
|
18
18
|
id: Event.ID.create(),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/websearch.ts
|
|
9
9
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
+
locationErrors2,
|
|
2
3
|
sessionInfo2,
|
|
3
4
|
requestRef2
|
|
4
|
-
} from "./
|
|
5
|
+
} from "./options-acgs9zzk.js";
|
|
5
6
|
|
|
6
7
|
// src/middleware/form-location.ts
|
|
7
8
|
import { Instance } from "@opencode/core/instance/service";
|
|
8
9
|
import { LocationServiceMap } from "@opencode/core/location-services";
|
|
9
10
|
import { Session } from "@opencode/core/session";
|
|
10
|
-
import { InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
|
|
11
|
+
import { LocationNotFoundError, InvalidRequestError, SessionNotFoundError } from "@opencode/protocol/errors";
|
|
11
12
|
import { Effect, Layer } from "effect";
|
|
12
13
|
import { HttpRouter, HttpServerRequest } from "effect/unstable/http";
|
|
13
14
|
import { HttpApiMiddleware } from "effect/unstable/httpapi";
|
|
14
15
|
class FormLocationMiddleware2 extends HttpApiMiddleware.Service()("@opencode/HttpApiFormLocation", {
|
|
15
|
-
error: [InvalidRequestError, SessionNotFoundError]
|
|
16
|
+
error: [InvalidRequestError, SessionNotFoundError, LocationNotFoundError]
|
|
16
17
|
}) {
|
|
17
18
|
}
|
|
18
19
|
var formLocationLayer2 = Layer.effect(FormLocationMiddleware2, Effect.gen(function* () {
|
|
@@ -23,10 +24,10 @@ var formLocationLayer2 = Layer.effect(FormLocationMiddleware2, Effect.gen(functi
|
|
|
23
24
|
const route = yield* HttpRouter.RouteContext;
|
|
24
25
|
if (route.params.sessionID === "global") {
|
|
25
26
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
26
|
-
return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))));
|
|
27
|
+
return yield* effect.pipe(Effect.provide(locations.get(requestRef2(request))), locationErrors2);
|
|
27
28
|
}
|
|
28
29
|
const session = yield* sessionInfo2(sessions, route.params.sessionID);
|
|
29
|
-
return yield* effect.pipe(instances.provide(session));
|
|
30
|
+
return yield* effect.pipe(instances.provide(session), locationErrors2);
|
|
30
31
|
}));
|
|
31
32
|
}));
|
|
32
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-ep84ha6r.js";
|
|
4
4
|
|
|
5
5
|
// src/handlers/location.ts
|
|
6
6
|
import { Location } from "@opencode/core/location";
|
|
@@ -16,7 +16,7 @@ var LocationHandler2 = HttpApiBuilder.group(Api2, "server.location", (handlers)
|
|
|
16
16
|
directory: location.directory,
|
|
17
17
|
project: location.project
|
|
18
18
|
});
|
|
19
|
-
})).handle("location.reload", () => LocationServiceMap.reload().pipe(Effect.provideService(LocationServiceMap.Service, locations), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(cause) : Effect.fail(new ServiceUnavailableError({ message: Cause.pretty(cause), service: "location" })))));
|
|
19
|
+
})).handle("location.reload", () => LocationServiceMap.reload().pipe(Effect.provideService(LocationServiceMap.Service, locations), Effect.catchCause((cause) => Cause.hasInterruptsOnly(cause) ? Effect.failCause(Cause.fromReasons(cause.reasons.filter(Cause.isInterruptReason))) : Effect.fail(new ServiceUnavailableError({ message: Cause.pretty(cause), service: "location" })))));
|
|
20
20
|
}));
|
|
21
21
|
|
|
22
22
|
export { LocationHandler2 };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-ep84ha6r.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
10
|
-
import {
|
|
11
|
-
Service5
|
|
12
|
-
} from "./request-tracing-v305azr7.js";
|
|
9
|
+
} from "./options-anm12x33.js";
|
|
13
10
|
import {
|
|
14
11
|
Service4
|
|
15
|
-
} from "./
|
|
12
|
+
} from "./options-5p62ed52.js";
|
|
13
|
+
import {
|
|
14
|
+
Service3
|
|
15
|
+
} from "./options-kr61w04k.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { Duration, Effect } from "effect";
|
|
19
19
|
import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
20
20
|
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
21
|
+
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
21
22
|
import { UnauthorizedError } from "@opencode/protocol/errors";
|
|
22
23
|
var ServerHandler2 = HttpApiBuilder.group(Api2, "server.server", (handlers) => Effect.gen(function* () {
|
|
23
|
-
const pairing = yield*
|
|
24
|
+
const pairing = yield* Service3;
|
|
24
25
|
const auth = yield* Config2;
|
|
25
26
|
return handlers.handle("server.info", () => Effect.gen(function* () {
|
|
26
|
-
const info = yield*
|
|
27
|
+
const info = yield* Service4;
|
|
27
28
|
return {
|
|
28
29
|
version: info.app.version ?? "unknown",
|
|
29
30
|
pid: process.pid ?? 0,
|
|
30
31
|
urls: info.urls(),
|
|
31
|
-
paths: info.paths
|
|
32
|
+
paths: info.paths,
|
|
33
|
+
capabilities: { persistentPty: PersistentPty.available }
|
|
32
34
|
};
|
|
33
35
|
})).handle("server.pair", () => pairing.issue()).handle("server.connect", Effect.fn(function* (ctx) {
|
|
34
36
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LocationMiddleware2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
FormLocationMiddleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-d00srfh1.js";
|
|
7
7
|
import {
|
|
8
8
|
SessionLocationMiddleware2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./options-nxdx74sv.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
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-acgs9zzk.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-ep84ha6r.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/model.ts
|
|
9
9
|
import { Model } from "@opencode/core/model";
|