@opencode/server 2.0.8 → 2.0.10
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 +4 -4
- package/dist/api.js +10 -9
- package/dist/auth.js +12 -17
- package/dist/chunks/auth-0ar9gf7q.js +55 -0
- package/dist/chunks/auth-0qzy9yxk.js +163 -0
- package/dist/chunks/auth-1wj0ectp.js +22 -0
- package/dist/chunks/auth-23w8t84j.js +26 -0
- package/dist/chunks/auth-34e6wr3b.js +13 -0
- package/dist/chunks/auth-3582t7j8.js +139 -0
- package/dist/chunks/auth-40g8rvw4.js +59 -0
- package/dist/chunks/auth-5p62ed52.js +36 -0
- package/dist/chunks/auth-6aya8ky6.js +39 -0
- package/dist/chunks/auth-760vtqy2.js +29 -0
- package/dist/chunks/auth-7bj707s9.js +99 -0
- package/dist/chunks/auth-7qtja2kq.js +15 -0
- package/dist/chunks/auth-8e21y1bd.js +20 -0
- package/dist/chunks/auth-8nbs1vvt.js +34 -0
- package/dist/chunks/auth-8ygjd1s8.js +40 -0
- package/dist/chunks/auth-9rqn6x4v.js +16 -0
- package/dist/chunks/auth-b4atwt7w.js +37 -0
- package/dist/chunks/auth-bgzrbsek.js +13 -0
- package/dist/chunks/auth-bkb1xk38.js +42 -0
- package/dist/chunks/auth-bkk2wfbz.js +23 -0
- package/dist/chunks/auth-byzd2nk7.js +21 -0
- package/dist/chunks/auth-cm8xmqjn.js +13 -0
- package/dist/chunks/auth-d2g7egyw.js +25 -0
- package/dist/chunks/auth-e09mshwt.js +23 -0
- package/dist/chunks/auth-erwrh284.js +156 -0
- package/dist/chunks/auth-frv6gfy7.js +33 -0
- package/dist/chunks/auth-fyjxk8m3.js +22 -0
- package/dist/chunks/auth-gsks0nj8.js +149 -0
- package/dist/chunks/auth-hezj1jdf.js +7 -0
- package/dist/chunks/auth-kv6ycdgm.js +77 -0
- package/dist/chunks/auth-m6wvgbfq.js +60 -0
- package/dist/chunks/auth-p5hgn93y.js +26 -0
- package/dist/chunks/auth-pd1pbg0v.js +17 -0
- package/dist/chunks/auth-q4bn6dy8.js +39 -0
- package/dist/chunks/auth-r4dhhtgz.js +346 -0
- package/dist/chunks/auth-rjpqaa8h.js +83 -0
- package/dist/chunks/auth-smaf4a18.js +28 -0
- package/dist/chunks/auth-t8yzmczr.js +18 -0
- package/dist/chunks/auth-tk6nqkmh.js +22 -0
- package/dist/chunks/auth-txhx6f1m.js +13 -0
- package/dist/chunks/auth-vgxn80m1.js +61 -0
- package/dist/chunks/auth-xpxp1sqb.js +22 -0
- package/dist/chunks/auth-xsrtpxyd.js +23 -0
- package/dist/chunks/auth-yc7nft6q.js +5 -0
- package/dist/chunks/auth-z3nth2hg.js +35 -0
- package/dist/chunks/auth-z6kg9h7e.js +19 -0
- package/dist/chunks/auth-zw9j8b8g.js +32 -0
- package/dist/chunks/auth-zxvt7wd3.js +25 -0
- package/dist/chunks/auth-zyv89x5n.js +30 -0
- package/dist/cors.js +10 -36
- package/dist/event-feed.js +20 -60
- package/dist/fetch.js +53 -11
- package/dist/handlers/agent.js +11 -17
- package/dist/handlers/command.js +11 -5
- package/dist/handlers/config.js +11 -16
- package/dist/handlers/credential.js +11 -14
- package/dist/handlers/debug.js +11 -11
- package/dist/handlers/event.js +12 -27
- package/dist/handlers/form.js +11 -9
- package/dist/handlers/fs.js +11 -22
- package/dist/handlers/generate.js +11 -15
- package/dist/handlers/integration.js +10 -142
- package/dist/handlers/location.js +11 -16
- package/dist/handlers/mcp.js +11 -31
- package/dist/handlers/message.js +10 -42
- package/dist/handlers/migration.js +11 -7
- package/dist/handlers/model.js +11 -14
- package/dist/handlers/permission.js +11 -57
- package/dist/handlers/persistent-pty.js +12 -135
- package/dist/handlers/plugin.js +11 -47
- package/dist/handlers/project.js +11 -9
- package/dist/handlers/provider.js +11 -20
- package/dist/handlers/pty-socket.js +6 -4
- package/dist/handlers/pty.js +13 -107
- package/dist/handlers/reference.js +11 -5
- package/dist/handlers/rpc.js +11 -15
- package/dist/handlers/server.js +12 -13
- package/dist/handlers/session-error.js +12 -26
- package/dist/handlers/session.js +10 -311
- package/dist/handlers/shell.js +11 -25
- package/dist/handlers/skill.js +11 -5
- package/dist/handlers/vcs.js +11 -19
- package/dist/handlers/websearch.js +11 -31
- package/dist/handlers/worktree.js +11 -37
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +46 -33
- package/dist/location.js +15 -49
- package/dist/middleware/authorization.js +11 -49
- package/dist/middleware/form-location.js +10 -25
- package/dist/middleware/schema-error.js +8 -15
- package/dist/middleware/session-location.js +10 -19
- package/dist/options.js +5 -1
- package/dist/process.js +108 -28
- package/dist/pty-environment.js +12 -9
- package/dist/request-tracing.js +6 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.js +52 -118
- package/dist/server-info.js +12 -22
- package/dist/service-status.js +8 -11
- package/dist/workerd.js +80 -12
- package/package.json +8 -8
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
response2
|
|
3
|
+
} from "./auth-0ar9gf7q.js";
|
|
4
|
+
import {
|
|
5
|
+
Api2
|
|
6
|
+
} from "./auth-z6kg9h7e.js";
|
|
7
|
+
|
|
8
|
+
// src/handlers/shell.ts
|
|
9
|
+
import { Shell } from "@opencode/core/shell";
|
|
10
|
+
import { Location } from "@opencode/core/location";
|
|
11
|
+
import { Effect } from "effect";
|
|
12
|
+
import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
|
|
13
|
+
import { ShellNotFoundError } from "@opencode/protocol/errors";
|
|
14
|
+
var ShellHandler2 = HttpApiBuilder.group(Api2, "server.shell", (handlers) => Effect.gen(function* () {
|
|
15
|
+
return handlers.handle("shell.list", Effect.fn(function* () {
|
|
16
|
+
const shell = yield* Shell.Service;
|
|
17
|
+
return yield* response2(shell.list());
|
|
18
|
+
})).handle("shell.create", Effect.fn(function* (ctx) {
|
|
19
|
+
const shell = yield* Shell.Service;
|
|
20
|
+
const location = yield* Location.Service;
|
|
21
|
+
return yield* response2(shell.create({ ...ctx.payload, cwd: ctx.payload.cwd || location.directory }).pipe(Effect.orDie));
|
|
22
|
+
})).handle("shell.get", Effect.fn(function* (ctx) {
|
|
23
|
+
const shell = yield* Shell.Service;
|
|
24
|
+
return yield* response2(shell.get(ctx.params.id).pipe(Effect.catchTag("Shell.NotFoundError", () => new ShellNotFoundError({ id: ctx.params.id, message: `Shell command not found: ${ctx.params.id}` }))));
|
|
25
|
+
})).handle("shell.output", Effect.fn(function* (ctx) {
|
|
26
|
+
const shell = yield* Shell.Service;
|
|
27
|
+
return yield* response2(shell.output(ctx.params.id, { cursor: ctx.query.cursor, limit: ctx.query.limit }).pipe(Effect.catchTag("Shell.NotFoundError", () => new ShellNotFoundError({ id: ctx.params.id, message: `Shell command not found: ${ctx.params.id}` }))));
|
|
28
|
+
})).handle("shell.remove", Effect.fn(function* (ctx) {
|
|
29
|
+
const shell = yield* Shell.Service;
|
|
30
|
+
yield* shell.remove(ctx.params.id).pipe(Effect.catchTag("Shell.NotFoundError", () => Effect.void));
|
|
31
|
+
return HttpApiSchema.NoContent.make();
|
|
32
|
+
}));
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
export { ShellHandler2 };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LocationMiddleware2
|
|
3
|
+
} from "./auth-0ar9gf7q.js";
|
|
4
|
+
import {
|
|
5
|
+
FormLocationMiddleware2
|
|
6
|
+
} from "./auth-frv6gfy7.js";
|
|
7
|
+
import {
|
|
8
|
+
SessionLocationMiddleware2
|
|
9
|
+
} from "./auth-23w8t84j.js";
|
|
10
|
+
|
|
11
|
+
// src/api.ts
|
|
12
|
+
import { makeDefaultApi } from "@opencode/protocol/api";
|
|
13
|
+
var Api2 = makeDefaultApi({
|
|
14
|
+
locationMiddleware: LocationMiddleware2,
|
|
15
|
+
formLocationMiddleware: FormLocationMiddleware2,
|
|
16
|
+
sessionLocationMiddleware: SessionLocationMiddleware2
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { Api2 };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
response2
|
|
3
|
+
} from "./auth-0ar9gf7q.js";
|
|
4
|
+
import {
|
|
5
|
+
Api2
|
|
6
|
+
} from "./auth-z6kg9h7e.js";
|
|
7
|
+
|
|
8
|
+
// src/handlers/vcs.ts
|
|
9
|
+
import { Vcs } from "@opencode/core/vcs";
|
|
10
|
+
import { ServiceUnavailableError } from "@opencode/protocol/errors";
|
|
11
|
+
import { Effect } from "effect";
|
|
12
|
+
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
13
|
+
var VcsHandler2 = HttpApiBuilder.group(Api2, "server.vcs", (handlers) => Effect.gen(function* () {
|
|
14
|
+
return handlers.handle("vcs.get", () => response2(Effect.gen(function* () {
|
|
15
|
+
const vcs = yield* Vcs.Service;
|
|
16
|
+
return yield* vcs.info();
|
|
17
|
+
}))).handle("vcs.base", () => response2(Effect.gen(function* () {
|
|
18
|
+
const vcs = yield* Vcs.Service;
|
|
19
|
+
return yield* vcs.base().pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
|
|
20
|
+
}))).handle("vcs.status", () => response2(Effect.gen(function* () {
|
|
21
|
+
const vcs = yield* Vcs.Service;
|
|
22
|
+
return yield* vcs.status();
|
|
23
|
+
}))).handle("vcs.branch.list", (ctx) => response2(Effect.gen(function* () {
|
|
24
|
+
const vcs = yield* Vcs.Service;
|
|
25
|
+
return yield* vcs.branches({ search: ctx.query.search, limit: Math.min(ctx.query.limit ?? 50, 100) });
|
|
26
|
+
}))).handle("vcs.diff", (ctx) => response2(Effect.gen(function* () {
|
|
27
|
+
const vcs = yield* Vcs.Service;
|
|
28
|
+
return yield* vcs.diff(ctx.query.mode, { context: ctx.query.context, base: ctx.query.base }).pipe(Effect.mapError((error) => new ServiceUnavailableError({ service: "vcs", message: error.message })));
|
|
29
|
+
})));
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
export { VcsHandler2 };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
response2
|
|
3
|
+
} from "./auth-0ar9gf7q.js";
|
|
4
|
+
import {
|
|
5
|
+
Api2
|
|
6
|
+
} from "./auth-z6kg9h7e.js";
|
|
7
|
+
|
|
8
|
+
// src/handlers/agent.ts
|
|
9
|
+
import { Agent } from "@opencode/core/agent";
|
|
10
|
+
import { Effect } from "effect";
|
|
11
|
+
import { HttpApiBuilder } from "effect/unstable/httpapi";
|
|
12
|
+
import { AgentNotFoundError } from "@opencode/protocol/errors";
|
|
13
|
+
var AgentHandler2 = HttpApiBuilder.group(Api2, "server.agent", (handlers) => handlers.handle("agent.list", () => Effect.gen(function* () {
|
|
14
|
+
return yield* response2(Agent.Service.use((agent) => agent.list()));
|
|
15
|
+
})).handle("agent.get", Effect.fn(function* (ctx) {
|
|
16
|
+
const agent = yield* Agent.Service.use((service) => service.get(ctx.params.agentID));
|
|
17
|
+
if (!agent)
|
|
18
|
+
return yield* new AgentNotFoundError({
|
|
19
|
+
agentID: ctx.params.agentID,
|
|
20
|
+
message: `Agent not found: ${ctx.params.agentID}`
|
|
21
|
+
});
|
|
22
|
+
return yield* response2(Effect.succeed(agent));
|
|
23
|
+
})));
|
|
24
|
+
|
|
25
|
+
export { AgentHandler2 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export
|
|
3
|
+
} from "./auth-9rqn6x4v.js";
|
|
4
|
+
|
|
5
|
+
// src/auth.ts
|
|
6
|
+
var exports_auth = {};
|
|
7
|
+
__export(exports_auth, {
|
|
8
|
+
Config: () => Config2,
|
|
9
|
+
ServerAuth: () => exports_auth,
|
|
10
|
+
authorized: () => authorized2,
|
|
11
|
+
required: () => required2
|
|
12
|
+
});
|
|
13
|
+
import { Context, Layer, Option, Redacted } from "effect";
|
|
14
|
+
|
|
15
|
+
class Config2 extends Context.Service()("@opencode/ServerAuthConfig") {
|
|
16
|
+
static configLayer(input) {
|
|
17
|
+
return Layer.succeed(this, this.of({ ...input, username: "opencode" }));
|
|
18
|
+
}
|
|
19
|
+
static get layer() {
|
|
20
|
+
return this.configLayer({ password: Option.none() });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function required2(config) {
|
|
24
|
+
return Option.isSome(config.password) && config.password.value !== "";
|
|
25
|
+
}
|
|
26
|
+
function authorized2(credentials, config) {
|
|
27
|
+
return Option.isSome(config.password) && credentials.username === config.username && Redacted.value(credentials.password) === config.password.value;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { Config2, required2, authorized2, exports_auth };
|
package/dist/cors.js
CHANGED
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (input.startsWith("http://localhost:"))
|
|
12
|
-
return !0;
|
|
13
|
-
if (input.startsWith("http://127.0.0.1:"))
|
|
14
|
-
return !0;
|
|
15
|
-
if (input.startsWith("oc://renderer"))
|
|
16
|
-
return !0;
|
|
17
|
-
if (input === "tauri://localhost" || input === "http://tauri.localhost" || input === "https://tauri.localhost")
|
|
18
|
-
return !0;
|
|
19
|
-
if (opencodeOrigin.test(input))
|
|
20
|
-
return !0;
|
|
21
|
-
return opts?.cors?.includes(input) ?? !1;
|
|
22
|
-
}
|
|
23
|
-
export function isAllowedRequestOrigin(input, host, opts) {
|
|
24
|
-
if (!input)
|
|
25
|
-
return !0;
|
|
26
|
-
if (host && sameHost(input, host))
|
|
27
|
-
return !0;
|
|
28
|
-
return isAllowedCorsOrigin(input, opts);
|
|
29
|
-
}
|
|
30
|
-
function sameHost(origin, host) {
|
|
31
|
-
try {
|
|
32
|
-
return new URL(origin).host === host;
|
|
33
|
-
} catch {
|
|
34
|
-
return !1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
CorsConfig2,
|
|
3
|
+
isAllowedCorsOrigin2,
|
|
4
|
+
isAllowedRequestOrigin2
|
|
5
|
+
} from "./chunks/auth-q4bn6dy8.js";
|
|
6
|
+
export {
|
|
7
|
+
CorsConfig2 as CorsConfig,
|
|
8
|
+
isAllowedCorsOrigin2 as isAllowedCorsOrigin,
|
|
9
|
+
isAllowedRequestOrigin2 as isAllowedRequestOrigin
|
|
10
|
+
};
|
package/dist/event-feed.js
CHANGED
|
@@ -1,60 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return `data: ${JSON.stringify(event)}
|
|
22
|
-
|
|
23
|
-
`;
|
|
24
|
-
}
|
|
25
|
-
export const make = Effect.fn("EventFeed.make")(function* (observe, options) {
|
|
26
|
-
const capacity = options?.capacity ?? SubscriberCapacity, render = options?.encode ?? frame, subscribers = new Set, fail = (error) => Effect.sync(() => {
|
|
27
|
-
const current = Array.from(subscribers);
|
|
28
|
-
subscribers.clear();
|
|
29
|
-
for (const subscriber of current)
|
|
30
|
-
Queue.failCauseUnsafe(subscriber, Cause.fail(error));
|
|
31
|
-
}), publish = Effect.fnUntraced(function* (event) {
|
|
32
|
-
if (!isOpenCodeEvent(event))
|
|
33
|
-
return;
|
|
34
|
-
if (subscribers.size === 0)
|
|
35
|
-
return;
|
|
36
|
-
const encoded = yield* Effect.try({
|
|
37
|
-
try: () => render(event),
|
|
38
|
-
catch: (cause) => new EncodingError({ eventID: event.id, eventType: event.type, cause })
|
|
39
|
-
}).pipe(Effect.catch((error) => Effect.logError("Failed to encode public event", {
|
|
40
|
-
eventID: error.eventID,
|
|
41
|
-
eventType: error.eventType,
|
|
42
|
-
cause: error.cause
|
|
43
|
-
}).pipe(Effect.andThen(fail(error)), Effect.as(void 0))));
|
|
44
|
-
if (encoded === void 0)
|
|
45
|
-
return;
|
|
46
|
-
for (const subscriber of subscribers) {
|
|
47
|
-
if (Queue.offerUnsafe(subscriber, encoded))
|
|
48
|
-
continue;
|
|
49
|
-
subscribers.delete(subscriber);
|
|
50
|
-
Queue.failCauseUnsafe(subscriber, Cause.fail(new SubscriberOverflowError({ capacity })));
|
|
51
|
-
}
|
|
52
|
-
}), unsubscribe = yield* observe(publish);
|
|
53
|
-
yield* Effect.addFinalizer(() => unsubscribe);
|
|
54
|
-
return Service.of({
|
|
55
|
-
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))
|
|
56
|
-
});
|
|
57
|
-
}), layer = Layer.effect(Service, Effect.gen(function* () {
|
|
58
|
-
const bus = yield* Bus.Service;
|
|
59
|
-
return yield* make(bus.listen);
|
|
60
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
SubscriberCapacity2,
|
|
3
|
+
SubscriberOverflowError2,
|
|
4
|
+
EncodingError2,
|
|
5
|
+
Service3,
|
|
6
|
+
frame2,
|
|
7
|
+
make4,
|
|
8
|
+
layer3,
|
|
9
|
+
exports_event_feed
|
|
10
|
+
} from "./chunks/auth-rjpqaa8h.js";
|
|
11
|
+
export {
|
|
12
|
+
EncodingError2 as EncodingError,
|
|
13
|
+
exports_event_feed as EventFeed,
|
|
14
|
+
Service3 as Service,
|
|
15
|
+
SubscriberCapacity2 as SubscriberCapacity,
|
|
16
|
+
SubscriberOverflowError2 as SubscriberOverflowError,
|
|
17
|
+
frame2 as frame,
|
|
18
|
+
layer3 as layer,
|
|
19
|
+
make4 as make
|
|
20
|
+
};
|
package/dist/fetch.js
CHANGED
|
@@ -1,11 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import {
|
|
2
|
+
make3,
|
|
3
|
+
exports_fetch
|
|
4
|
+
} from "./chunks/auth-p5hgn93y.js";
|
|
5
|
+
import"./chunks/auth-gsks0nj8.js";
|
|
6
|
+
import"./chunks/auth-t8yzmczr.js";
|
|
7
|
+
import"./chunks/auth-m6wvgbfq.js";
|
|
8
|
+
import"./chunks/auth-7bj707s9.js";
|
|
9
|
+
import"./chunks/auth-pd1pbg0v.js";
|
|
10
|
+
import"./chunks/auth-tk6nqkmh.js";
|
|
11
|
+
import"./chunks/auth-8nbs1vvt.js";
|
|
12
|
+
import"./chunks/auth-cm8xmqjn.js";
|
|
13
|
+
import"./chunks/auth-1wj0ectp.js";
|
|
14
|
+
import"./chunks/auth-bkb1xk38.js";
|
|
15
|
+
import"./chunks/auth-z3nth2hg.js";
|
|
16
|
+
import"./chunks/auth-6aya8ky6.js";
|
|
17
|
+
import"./chunks/auth-d2g7egyw.js";
|
|
18
|
+
import"./chunks/auth-b4atwt7w.js";
|
|
19
|
+
import"./chunks/auth-0qzy9yxk.js";
|
|
20
|
+
import"./chunks/auth-zw9j8b8g.js";
|
|
21
|
+
import"./chunks/auth-byzd2nk7.js";
|
|
22
|
+
import"./chunks/auth-zxvt7wd3.js";
|
|
23
|
+
import"./chunks/auth-fyjxk8m3.js";
|
|
24
|
+
import"./chunks/auth-bgzrbsek.js";
|
|
25
|
+
import"./chunks/auth-8e21y1bd.js";
|
|
26
|
+
import"./chunks/auth-3582t7j8.js";
|
|
27
|
+
import"./chunks/auth-34e6wr3b.js";
|
|
28
|
+
import"./chunks/auth-erwrh284.js";
|
|
29
|
+
import"./chunks/auth-40g8rvw4.js";
|
|
30
|
+
import"./chunks/auth-e09mshwt.js";
|
|
31
|
+
import"./chunks/auth-txhx6f1m.js";
|
|
32
|
+
import"./chunks/auth-xpxp1sqb.js";
|
|
33
|
+
import"./chunks/auth-7qtja2kq.js";
|
|
34
|
+
import"./chunks/auth-vgxn80m1.js";
|
|
35
|
+
import"./chunks/auth-hezj1jdf.js";
|
|
36
|
+
import"./chunks/auth-760vtqy2.js";
|
|
37
|
+
import"./chunks/auth-r4dhhtgz.js";
|
|
38
|
+
import"./chunks/auth-8ygjd1s8.js";
|
|
39
|
+
import"./chunks/auth-kv6ycdgm.js";
|
|
40
|
+
import"./chunks/auth-zyv89x5n.js";
|
|
41
|
+
import"./chunks/auth-bkk2wfbz.js";
|
|
42
|
+
import"./chunks/auth-q4bn6dy8.js";
|
|
43
|
+
import"./chunks/auth-rjpqaa8h.js";
|
|
44
|
+
import"./chunks/auth-5p62ed52.js";
|
|
45
|
+
import"./chunks/auth-z6kg9h7e.js";
|
|
46
|
+
import"./chunks/auth-23w8t84j.js";
|
|
47
|
+
import"./chunks/auth-frv6gfy7.js";
|
|
48
|
+
import"./chunks/auth-0ar9gf7q.js";
|
|
49
|
+
import"./chunks/auth-smaf4a18.js";
|
|
50
|
+
export {
|
|
51
|
+
exports_fetch as ServerFetch,
|
|
52
|
+
make3 as make
|
|
53
|
+
};
|
package/dist/handlers/agent.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return yield* new AgentNotFoundError({
|
|
13
|
-
agentID: ctx.params.agentID,
|
|
14
|
-
message: `Agent not found: ${ctx.params.agentID}`
|
|
15
|
-
});
|
|
16
|
-
return yield* response(Effect.succeed(agent));
|
|
17
|
-
})));
|
|
1
|
+
import {
|
|
2
|
+
AgentHandler2
|
|
3
|
+
} from "../chunks/auth-zxvt7wd3.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
AgentHandler2 as AgentHandler
|
|
11
|
+
};
|
package/dist/handlers/command.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import {
|
|
2
|
+
CommandHandler2
|
|
3
|
+
} from "../chunks/auth-bgzrbsek.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
CommandHandler2 as CommandHandler
|
|
11
|
+
};
|
package/dist/handlers/config.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
const shell = yield* ShellSelect.Service;
|
|
13
|
-
if (!shell.list)
|
|
14
|
-
return yield* Effect.die(Error("Shell discovery is unavailable"));
|
|
15
|
-
return yield* shell.list();
|
|
16
|
-
})));
|
|
1
|
+
import {
|
|
2
|
+
ConfigHandler2
|
|
3
|
+
} from "../chunks/auth-xpxp1sqb.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
ConfigHandler2 as ConfigHandler
|
|
11
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
yield* (yield* Credential.Service).remove(ctx.params.credentialID);
|
|
13
|
-
return HttpApiSchema.NoContent.make();
|
|
14
|
-
})));
|
|
1
|
+
import {
|
|
2
|
+
CredentialHandler2
|
|
3
|
+
} from "../chunks/auth-e09mshwt.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
CredentialHandler2 as CredentialHandler
|
|
11
|
+
};
|
package/dist/handlers/debug.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
DebugHandler2
|
|
3
|
+
} from "../chunks/auth-8e21y1bd.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
DebugHandler2 as DebugHandler
|
|
11
|
+
};
|
package/dist/handlers/event.js
CHANGED
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: "server.connected",
|
|
14
|
-
data: {}
|
|
15
|
-
}, output = Stream.unwrap(feed.subscribe.pipe(Effect.map((live) => Stream.make(EventFeed.frame(connected)).pipe(Stream.concat(live))))), heartbeat = Stream.tick("15 seconds").pipe(Stream.map(() => `: heartbeat
|
|
16
|
-
|
|
17
|
-
`));
|
|
18
|
-
return HttpServerResponse.stream(output.pipe(Stream.merge(heartbeat, { haltStrategy: "left" }), Stream.encodeText), {
|
|
19
|
-
contentType: "text/event-stream",
|
|
20
|
-
headers: {
|
|
21
|
-
"Cache-Control": "no-cache, no-transform",
|
|
22
|
-
"X-Accel-Buffering": "no",
|
|
23
|
-
"X-Content-Type-Options": "nosniff"
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}));
|
|
27
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
EventHandler2
|
|
3
|
+
} from "../chunks/auth-b4atwt7w.js";
|
|
4
|
+
import"../chunks/auth-rjpqaa8h.js";
|
|
5
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
6
|
+
import"../chunks/auth-23w8t84j.js";
|
|
7
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
8
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
9
|
+
import"../chunks/auth-smaf4a18.js";
|
|
10
|
+
export {
|
|
11
|
+
EventHandler2 as EventHandler
|
|
12
|
+
};
|
package/dist/handlers/form.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import {
|
|
2
|
+
FormHandler2
|
|
3
|
+
} from "../chunks/auth-pd1pbg0v.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
FormHandler2 as FormHandler
|
|
11
|
+
};
|
package/dist/handlers/fs.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
path: RelativePath.make(decodeURIComponent(new URL(ctx.request.url, "http://localhost").pathname.slice(13)))
|
|
13
|
-
}).pipe(Effect.mapError((error) => new FileNotFoundError({ path: error.path, message: `File not found: ${error.path}` })));
|
|
14
|
-
return HttpServerResponse.uint8Array(file.content, { contentType: file.mime });
|
|
15
|
-
})).handle("fs.list", (ctx) => response(Effect.gen(function* () {
|
|
16
|
-
return yield* (yield* FileSystem.Service).list(ctx.query);
|
|
17
|
-
}))).handle("fs.find", (ctx) => response(Effect.gen(function* () {
|
|
18
|
-
return yield* (yield* FileSystem.Service).find(ctx.query);
|
|
19
|
-
}))).handle("fs.write", (ctx) => response(Effect.gen(function* () {
|
|
20
|
-
return yield* (yield* FileSystem.Service).write({ path: ctx.query.path, data: ctx.payload });
|
|
21
|
-
})));
|
|
22
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
FileSystemHandler2
|
|
3
|
+
} from "../chunks/auth-8nbs1vvt.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
FileSystemHandler2 as FileSystemHandler
|
|
11
|
+
};
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return handlers.handle("generate.text", Effect.fn("server.generate.text")(function* (request) {
|
|
13
|
-
return { data: { text: yield* (yield* Generate.Service).text(request.payload).pipe(Effect.mapError((error) => error._tag === "Generate.ModelSelectionError" ? new InvalidRequestError({ message: error.message }) : new ServiceUnavailableError({ message: error.message, service: error.service }))) } };
|
|
14
|
-
}, Effect.provide(services)));
|
|
15
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
GenerateHandler2
|
|
3
|
+
} from "../chunks/auth-d2g7egyw.js";
|
|
4
|
+
import"../chunks/auth-z6kg9h7e.js";
|
|
5
|
+
import"../chunks/auth-23w8t84j.js";
|
|
6
|
+
import"../chunks/auth-frv6gfy7.js";
|
|
7
|
+
import"../chunks/auth-0ar9gf7q.js";
|
|
8
|
+
import"../chunks/auth-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
GenerateHandler2 as GenerateHandler
|
|
11
|
+
};
|