@opencode/server 0.0.0-dev-368 → 0.0.0-dev-377
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 +175 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{cors-059rbh9c.js → options-059rbh9c.js} +1 -1
- package/dist/chunks/{cors-dk68ymtv.js → options-05c5061t.js} +1 -1
- package/dist/chunks/{cors-9c4eyh8m.js → options-0e81et3m.js} +3 -3
- package/dist/chunks/{cors-r6vmgwff.js → options-0ey2b45p.js} +2 -2
- package/dist/chunks/{cors-prdak4hd.js → options-0fggwqem.js} +2 -2
- package/dist/chunks/options-0fv515j7.js +144 -0
- package/dist/chunks/{cors-c6sjpm0r.js → options-0j6zxxn8.js} +2 -2
- package/dist/chunks/{cors-2xcc0x05.js → options-0n4tjm17.js} +1 -1
- package/dist/chunks/{cors-e6e4kz0w.js → options-0q7s66m2.js} +4 -4
- package/dist/chunks/{cors-b5vdqx3g.js → options-2wexxjwf.js} +2 -2
- package/dist/chunks/{cors-b1prsepx.js → options-3te71694.js} +4 -4
- package/dist/chunks/{cors-r6xthn22.js → options-3vkp0p8t.js} +17 -15
- package/dist/chunks/{cors-0a5jm2na.js → options-4p2y0qs3.js} +2 -2
- package/dist/chunks/{cors-gqq6kfhc.js → options-50bbk3b2.js} +3 -3
- package/dist/chunks/{cors-7b9xm1qg.js → options-7b9xm1qg.js} +1 -1
- package/dist/chunks/{cors-j9gxd9me.js → options-89egwzf3.js} +2 -2
- package/dist/chunks/{cors-hax1v4bv.js → options-9grnt8dc.js} +2 -2
- package/dist/chunks/{cors-xm1s9q2w.js → options-abb7amja.js} +3 -3
- package/dist/chunks/{cors-zgt2tacv.js → options-ap1t95t8.js} +3 -3
- package/dist/chunks/{cors-yet0vexm.js → options-b3bmdkga.js} +1 -1
- package/dist/chunks/{cors-z59gyc0x.js → options-b4mqtccx.js} +2 -2
- package/dist/chunks/{cors-e46y0tfd.js → options-dx89xydc.js} +2 -2
- package/dist/chunks/{cors-fvpjvjpp.js → options-e0ppd0jy.js} +5 -5
- package/dist/chunks/{cors-wxj3d9av.js → options-et00mhwf.js} +2 -2
- package/dist/chunks/{cors-rztv1fyf.js → options-f2m3ds36.js} +4 -4
- package/dist/chunks/{cors-22wspztn.js → options-f8r9p2vr.js} +2 -2
- package/dist/chunks/{cors-x8dgc261.js → options-h1thjy6x.js} +2 -2
- package/dist/chunks/{cors-gk0yxcp6.js → options-htyf2qs7.js} +1 -1
- package/dist/chunks/{cors-b2k9041j.js → options-hx8bsq9d.js} +1 -1
- package/dist/chunks/{cors-j4at0y5c.js → options-j4at0y5c.js} +1 -1
- package/dist/chunks/{cors-kffvskmv.js → options-jydxnq20.js} +4 -4
- package/dist/chunks/{cors-ppma8fcc.js → options-kg0ybx4v.js} +3 -3
- package/dist/chunks/{cors-mzs0n5xz.js → options-mzs0n5xz.js} +1 -1
- package/dist/chunks/{cors-zrprg5z5.js → options-n1zdbfv7.js} +2 -2
- package/dist/chunks/{cors-xe9t9xr4.js → options-nz17qv97.js} +2 -2
- package/dist/chunks/{cors-6vs5sqy6.js → options-q44yktpv.js} +2 -2
- package/dist/chunks/{cors-h9rcwvg0.js → options-r6xkfcdx.js} +1 -1
- package/dist/chunks/{cors-hnheq3hv.js → options-s62wjkvx.js} +2 -2
- package/dist/chunks/{cors-yr4wsvrw.js → options-s9tkswmw.js} +2 -2
- package/dist/chunks/{cors-ckkpcd9y.js → options-t7vhq1fh.js} +4 -4
- package/dist/chunks/{cors-m5rae7m4.js → options-v8aqacn3.js} +2 -2
- package/dist/chunks/{cors-qn8kkfq6.js → options-vbgqk0mr.js} +2 -2
- package/dist/chunks/{cors-gsyfxrkq.js → options-x2df6xnx.js} +27 -9
- package/dist/chunks/{cors-1je14sn4.js → options-x4b2rtcb.js} +1 -1
- package/dist/chunks/{cors-5hx85a1p.js → options-z2dy5af2.js} +4 -4
- package/dist/chunks/{cors-mfe5g848.js → options-z4ww4dje.js} +33 -33
- package/dist/chunks/{cors-h072q2hm.js → options-zbe9jfhy.js} +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +3 -3
- package/dist/fetch.js +52 -51
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.d.ts +62 -0
- package/dist/handlers/artifact.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 +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 +8 -8
- package/dist/handlers/media.js +1 -1
- 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 +11 -10
- 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 +48 -47
- package/dist/location.js +4 -4
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- 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 +57 -56
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +3 -2
- package/dist/routes.js +51 -50
- package/dist/server-info.js +3 -3
- package/dist/service-status.js +3 -3
- package/dist/workerd.js +53 -52
- package/package.json +9 -9
- /package/dist/chunks/{cors-9rqn6x4v.js → options-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{cors-bd8755ek.js → options-bd8755ek.js} +0 -0
- /package/dist/chunks/{cors-h6rt5k9s.js → options-h6rt5k9s.js} +0 -0
- /package/dist/chunks/{cors-n321d8vm.js → options-n321d8vm.js} +0 -0
- /package/dist/chunks/{cors-q4bn6dy8.js → options-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{cors-smaf4a18.js → options-smaf4a18.js} +0 -0
- /package/dist/chunks/{cors-xthc02cw.js → options-xthc02cw.js} +0 -0
- /package/dist/chunks/{cors-yc7nft6q.js → options-yc7nft6q.js} +0 -0
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
layer4
|
|
3
|
+
} from "./options-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
formLocationLayer2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-htyf2qs7.js";
|
|
7
7
|
import {
|
|
8
8
|
sessionLocationLayer2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./options-b3bmdkga.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./options-0e81et3m.js";
|
|
13
13
|
import {
|
|
14
14
|
Config2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./options-j4at0y5c.js";
|
|
16
16
|
import {
|
|
17
17
|
CorsConfig2
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./options-q4bn6dy8.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./
|
|
20
|
+
layer3
|
|
21
|
+
} from "./options-3te71694.js";
|
|
22
22
|
import {
|
|
23
23
|
node2
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./options-mzs0n5xz.js";
|
|
25
25
|
import {
|
|
26
26
|
handlers2
|
|
27
|
-
} from "./
|
|
27
|
+
} from "./options-z4ww4dje.js";
|
|
28
28
|
import {
|
|
29
29
|
authorizationLayer2
|
|
30
|
-
} from "./
|
|
30
|
+
} from "./options-7b9xm1qg.js";
|
|
31
31
|
import {
|
|
32
32
|
schemaErrorLayer2
|
|
33
|
-
} from "./
|
|
33
|
+
} from "./options-bd8755ek.js";
|
|
34
34
|
|
|
35
35
|
// src/routes.ts
|
|
36
36
|
import { Database } from "@opencode/core/database/database";
|
|
@@ -55,6 +55,7 @@ import { SessionTransfer } from "@opencode/core/session/transfer";
|
|
|
55
55
|
import { InstructionEntry } from "@opencode/core/session/instruction-entry";
|
|
56
56
|
import { ShellSelect } from "@opencode/core/shell/select";
|
|
57
57
|
import { Job } from "@opencode/core/job";
|
|
58
|
+
import { KV } from "@opencode/core/kv";
|
|
58
59
|
import { Mcp } from "@opencode/core/mcp/index";
|
|
59
60
|
import { Global } from "@opencode/util/global";
|
|
60
61
|
import { FSUtil } from "@opencode/util/fs-util";
|
|
@@ -77,6 +78,7 @@ var applicationServiceNodes = [
|
|
|
77
78
|
Global.node,
|
|
78
79
|
FSUtil.node,
|
|
79
80
|
Database.node,
|
|
81
|
+
KV.node,
|
|
80
82
|
Bus.node,
|
|
81
83
|
EventLogger.node,
|
|
82
84
|
httpClient,
|
|
@@ -151,8 +153,8 @@ function makeRoutes(auth, options, serviceURLs, overrides, instances) {
|
|
|
151
153
|
})) : build(overrides);
|
|
152
154
|
return serviceLayer.pipe(Layer.flatMap((context) => {
|
|
153
155
|
const services = Layer.succeedContext(context);
|
|
154
|
-
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)),
|
|
155
|
-
const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(
|
|
156
|
+
const requestServices = Layer.merge(Layer.succeedContext(Context.pick(Database.Service, Credential.Service, PermissionSaved.Service, PluginUpdate.Service, Project.Service, WellKnown.Service)(context)), layer3(serviceURLs, Context.get(context, Global.Service).tmp, options.app));
|
|
157
|
+
const api = HttpApiBuilder.layer(Api2, { openapiPath: "/openapi.json" }).pipe(Layer.provide(handlers2.pipe(Layer.provide(services), Layer.provide(Layer.succeed(CorsConfig2, options)))), Layer.provide(formLocationLayer2), Layer.provide(sessionLocationLayer2), Layer.provide(layer4), Layer.provide(authorizationLayer2), Layer.provide(schemaErrorLayer2), Layer.provide(auth), HttpRouter.provideRequest(requestServices), Layer.provideMerge(services), Layer.provideMerge(HttpRouter.layer));
|
|
156
158
|
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)));
|
|
157
159
|
}));
|
|
158
160
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/model.ts
|
|
10
10
|
import { Model } from "@opencode/core/model";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-smaf4a18.js";
|
|
4
4
|
|
|
5
5
|
// src/location.ts
|
|
6
6
|
import { FileSystem } from "@opencode/core/filesystem";
|
|
@@ -59,7 +59,7 @@ function decode(input) {
|
|
|
59
59
|
return input;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
var
|
|
62
|
+
var layer4 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
63
63
|
const locations = yield* LocationServiceMap.Service;
|
|
64
64
|
return LocationMiddleware2.of((effect) => Effect.gen(function* () {
|
|
65
65
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
@@ -67,4 +67,4 @@ var layer3 = Layer.effect(LocationMiddleware2, Effect.gen(function* () {
|
|
|
67
67
|
}));
|
|
68
68
|
}));
|
|
69
69
|
|
|
70
|
-
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2,
|
|
70
|
+
export { LocationMiddleware2, locationErrors2, awaitPlugins2, response2, sessionInfo2, requestRef2, layer4 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/usage.ts
|
|
10
10
|
import { UsageLimits } from "@opencode/core/usage-limits";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/provider.ts
|
|
10
10
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -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-3vkp0p8t.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,13 +1,13 @@
|
|
|
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-0e81et3m.js";
|
|
8
8
|
import {
|
|
9
9
|
wantsMediaRefs2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./options-xthc02cw.js";
|
|
11
11
|
|
|
12
12
|
// src/handlers/message.ts
|
|
13
13
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/websearch.ts
|
|
10
10
|
import { WebSearch } from "@opencode/core/websearch";
|
|
@@ -1,6 +1,6 @@
|
|
|
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 = {};
|
|
@@ -12,7 +12,7 @@ __export(exports_event_feed, {
|
|
|
12
12
|
SubscriberOverflowError: () => SubscriberOverflowError2,
|
|
13
13
|
frame: () => frame2,
|
|
14
14
|
layer: () => layer2,
|
|
15
|
-
make: () =>
|
|
15
|
+
make: () => make3
|
|
16
16
|
});
|
|
17
17
|
import { Bus } from "@opencode/core/bus";
|
|
18
18
|
import { Event } from "@opencode/schema/event";
|
|
@@ -37,7 +37,7 @@ function frame2(event) {
|
|
|
37
37
|
|
|
38
38
|
`;
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var make3 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
41
41
|
const capacity = options?.capacity ?? SubscriberCapacity2;
|
|
42
42
|
const render = options?.encode ?? frame2;
|
|
43
43
|
const subscribers = new Map;
|
|
@@ -78,7 +78,7 @@ var make4 = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
|
78
78
|
});
|
|
79
79
|
var layer2 = Layer.effect(Service2, Effect.gen(function* () {
|
|
80
80
|
const bus = yield* Bus.Service;
|
|
81
|
-
return yield*
|
|
81
|
+
return yield* make3(bus.listen);
|
|
82
82
|
}));
|
|
83
83
|
|
|
84
|
-
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2,
|
|
84
|
+
export { SubscriberCapacity2, SubscriberOverflowError2, EncodingError2, Service2, frame2, make3, layer2, exports_event_feed };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
locationErrors2,
|
|
3
3
|
awaitPlugins2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/voice.ts
|
|
10
10
|
import { Location } from "@opencode/core/location";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./options-50bbk3b2.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./options-0e81et3m.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./options-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./options-h6rt5k9s.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/mcp.ts
|
|
18
18
|
import { Location } from "@opencode/core/location";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requestRef2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/debug.ts
|
|
9
9
|
import { LocationServiceMap } from "@opencode/core/location-service-map";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
missingMessage2,
|
|
4
4
|
failedMessageDecode2,
|
|
5
5
|
failedSnapshot2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-smaf4a18.js";
|
|
7
7
|
import {
|
|
8
8
|
locationErrors2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./options-50bbk3b2.js";
|
|
10
10
|
import {
|
|
11
11
|
Api2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./options-0e81et3m.js";
|
|
13
13
|
import {
|
|
14
14
|
wantsMediaRefs2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./options-xthc02cw.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/session.ts
|
|
18
18
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-smaf4a18.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./options-50bbk3b2.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./options-0e81et3m.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-50bbk3b2.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./options-0e81et3m.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/integration.ts
|
|
9
9
|
import { Integration } from "@opencode/core/integration";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
awaitPlugins2,
|
|
3
3
|
response2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./options-50bbk3b2.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-0e81et3m.js";
|
|
8
8
|
|
|
9
9
|
// src/handlers/agent.ts
|
|
10
10
|
import { Agent } from "@opencode/core/agent";
|
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
locationErrors2,
|
|
3
3
|
response2,
|
|
4
4
|
requestRef2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./options-50bbk3b2.js";
|
|
6
6
|
import {
|
|
7
7
|
Api2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./options-0e81et3m.js";
|
|
9
9
|
import {
|
|
10
10
|
CorsConfig2,
|
|
11
11
|
isAllowedRequestOrigin2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./options-q4bn6dy8.js";
|
|
13
13
|
import {
|
|
14
14
|
runPtySocket2
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./options-h6rt5k9s.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/pty.ts
|
|
18
18
|
import { Pty } from "@opencode/core/pty";
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./options-q4bn6dy8.js";
|
|
8
|
+
import {
|
|
9
|
+
makeArtifact2
|
|
10
|
+
} from "./options-0fv515j7.js";
|
|
8
11
|
import {
|
|
9
12
|
makeMediaGet2
|
|
10
|
-
} from "./
|
|
13
|
+
} from "./options-n321d8vm.js";
|
|
11
14
|
import {
|
|
12
15
|
runPtySocket2
|
|
13
|
-
} from "./
|
|
16
|
+
} from "./options-h6rt5k9s.js";
|
|
14
17
|
import {
|
|
15
18
|
makeSchedule2
|
|
16
|
-
} from "./
|
|
19
|
+
} from "./options-059rbh9c.js";
|
|
17
20
|
|
|
18
21
|
// src/handlers/persistent-pty.ts
|
|
19
22
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -21,6 +24,7 @@ import { PtyTicket } from "@opencode/core/pty/ticket";
|
|
|
21
24
|
import {
|
|
22
25
|
ForbiddenError,
|
|
23
26
|
InvalidRequestError,
|
|
27
|
+
PtyFeatureUnsupportedError,
|
|
24
28
|
PtyNotFoundError,
|
|
25
29
|
ServiceUnavailableError
|
|
26
30
|
} from "@opencode/protocol/errors";
|
|
@@ -37,9 +41,10 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
37
41
|
const tickets = yield* PtyTicket.Service;
|
|
38
42
|
const cors = yield* CorsConfig2;
|
|
39
43
|
const pty = yield* PersistentPty.Service;
|
|
44
|
+
const artifact = yield* makeArtifact2;
|
|
40
45
|
const mediaGet = yield* makeMediaGet2;
|
|
41
46
|
const schedule = yield* makeSchedule2;
|
|
42
|
-
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, 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) {
|
|
47
|
+
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).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) {
|
|
43
48
|
return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
|
|
44
49
|
})).handle("persistentPty.list", Effect.fn(function* (ctx) {
|
|
45
50
|
return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
|
|
@@ -66,8 +71,20 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
66
71
|
})).handle("persistentPty.get", Effect.fn(function* (ctx) {
|
|
67
72
|
return { data: yield* pty.get(ctx.params.ptyID).pipe(mapTerminalError) };
|
|
68
73
|
})).handle("persistentPty.update", Effect.fn(function* (ctx) {
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
if (ctx.payload.size)
|
|
75
|
+
yield* pty.resize(ctx.params.ptyID, ctx.payload.size.cols, ctx.payload.size.rows, ctx.payload.attachmentID).pipe(mapTerminalError);
|
|
76
|
+
if (ctx.payload.title === undefined)
|
|
77
|
+
return { data: yield* pty.get(ctx.params.ptyID).pipe(mapTerminalError) };
|
|
78
|
+
return {
|
|
79
|
+
data: yield* pty.rename(ctx.params.ptyID, ctx.payload.title).pipe(Effect.catchTags({
|
|
80
|
+
"PersistentPty.NotFoundError": notFound,
|
|
81
|
+
"PersistentPty.UnsupportedError": (error) => new PtyFeatureUnsupportedError({
|
|
82
|
+
feature: error.feature,
|
|
83
|
+
message: "Terminal renaming will be available after OpenCode's terminal service restarts"
|
|
84
|
+
}),
|
|
85
|
+
"PersistentPty.UnavailableError": unavailable
|
|
86
|
+
}))
|
|
87
|
+
};
|
|
71
88
|
})).handle("persistentPty.snapshot", Effect.fn(function* (ctx) {
|
|
72
89
|
return { data: yield* pty.snapshot(ctx.params.ptyID).pipe(mapTerminalError) };
|
|
73
90
|
})).handle("persistentPty.remove", Effect.fn(function* (ctx) {
|
|
@@ -166,9 +183,10 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
166
183
|
}));
|
|
167
184
|
var mapUnavailable = (effect) => effect.pipe(Effect.catchTag("PersistentPty.UnavailableError", unavailable));
|
|
168
185
|
var mapTerminalError = (effect) => effect.pipe(Effect.catchTags({
|
|
169
|
-
"PersistentPty.NotFoundError":
|
|
186
|
+
"PersistentPty.NotFoundError": notFound,
|
|
170
187
|
"PersistentPty.UnavailableError": unavailable
|
|
171
188
|
}));
|
|
189
|
+
var notFound = (error) => new PtyNotFoundError({ ptyID: error.ptyID, message: `PTY session not found: ${error.ptyID}` });
|
|
172
190
|
var unavailable = (error) => new ServiceUnavailableError({ message: error.message, service: "opencode-pty" });
|
|
173
191
|
|
|
174
192
|
export { PersistentPtyHandler2 };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./options-0e81et3m.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_TTL_SECONDS2,
|
|
6
6
|
Config2,
|
|
7
7
|
issueSession2,
|
|
8
8
|
sessionCookieName2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./options-j4at0y5c.js";
|
|
10
10
|
import {
|
|
11
11
|
Service3
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./options-3te71694.js";
|
|
13
13
|
import {
|
|
14
14
|
Service4
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./options-mzs0n5xz.js";
|
|
16
16
|
|
|
17
17
|
// src/handlers/server.ts
|
|
18
18
|
import { hostname } from "node:os";
|