@opencode/server 0.0.0-dev-19795 → 0.0.0-dev-19812
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 +10 -9
- package/dist/auth.js +12 -17
- package/dist/chunks/process-172x6jgf.js +139 -0
- package/dist/chunks/process-18k6g42r.js +36 -0
- package/dist/chunks/process-1crq7hen.js +13 -0
- package/dist/chunks/process-27edjygf.js +33 -0
- package/dist/chunks/process-3esm6t0a.js +156 -0
- package/dist/chunks/process-3ra48t04.js +26 -0
- package/dist/chunks/process-8j6eh3dh.js +55 -0
- package/dist/chunks/process-910kejdj.js +37 -0
- package/dist/chunks/process-9rqn6x4v.js +16 -0
- package/dist/chunks/process-b0dj656z.js +13 -0
- package/dist/chunks/process-b4s3wxap.js +23 -0
- package/dist/chunks/process-c23ng5tp.js +17 -0
- package/dist/chunks/process-d0efjmp3.js +83 -0
- package/dist/chunks/process-d5nhwenp.js +22 -0
- package/dist/chunks/process-dhcrxjg3.js +163 -0
- package/dist/chunks/process-fa3dg36p.js +15 -0
- package/dist/chunks/process-gw2hwgqh.js +20 -0
- package/dist/chunks/process-h965rd83.js +25 -0
- package/dist/chunks/process-hezj1jdf.js +7 -0
- package/dist/chunks/process-j26nh0zz.js +40 -0
- package/dist/chunks/process-ja6yvede.js +22 -0
- package/dist/chunks/process-k319q0y1.js +39 -0
- package/dist/chunks/process-k8tgqrb7.js +61 -0
- package/dist/chunks/process-kadtbwy3.js +77 -0
- package/dist/chunks/process-kb9735wh.js +26 -0
- package/dist/chunks/process-kgbwhj3q.js +149 -0
- package/dist/chunks/process-kheky2r0.js +35 -0
- package/dist/chunks/process-knez9aqv.js +13 -0
- package/dist/chunks/process-ks9pc2xc.js +19 -0
- package/dist/chunks/process-m5dqr0xs.js +21 -0
- package/dist/chunks/process-m6wvgbfq.js +60 -0
- package/dist/chunks/process-m8y6333k.js +346 -0
- package/dist/chunks/process-mx2h5aqn.js +59 -0
- package/dist/chunks/process-prrj1pgd.js +42 -0
- package/dist/chunks/process-q4bn6dy8.js +39 -0
- package/dist/chunks/process-qc2xtz00.js +34 -0
- package/dist/chunks/process-qswqf30g.js +25 -0
- package/dist/chunks/process-rkdaz036.js +32 -0
- package/dist/chunks/process-smaf4a18.js +28 -0
- package/dist/chunks/process-t7k3q1ah.js +23 -0
- package/dist/chunks/process-t8yzmczr.js +18 -0
- package/dist/chunks/process-tp6dn9dc.js +99 -0
- package/dist/chunks/process-w0mvbrhx.js +22 -0
- package/dist/chunks/process-wt4btb09.js +13 -0
- package/dist/chunks/process-xettb16v.js +22 -0
- package/dist/chunks/process-xn1y01ws.js +29 -0
- package/dist/chunks/process-xsrtpxyd.js +23 -0
- package/dist/chunks/process-yc7nft6q.js +5 -0
- package/dist/chunks/process-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.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.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
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
|
+
layer4,
|
|
9
|
+
exports_event_feed
|
|
10
|
+
} from "./chunks/process-d0efjmp3.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
|
+
layer4 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/process-3ra48t04.js";
|
|
5
|
+
import"./chunks/process-kgbwhj3q.js";
|
|
6
|
+
import"./chunks/process-t8yzmczr.js";
|
|
7
|
+
import"./chunks/process-tp6dn9dc.js";
|
|
8
|
+
import"./chunks/process-b0dj656z.js";
|
|
9
|
+
import"./chunks/process-k319q0y1.js";
|
|
10
|
+
import"./chunks/process-wt4btb09.js";
|
|
11
|
+
import"./chunks/process-h965rd83.js";
|
|
12
|
+
import"./chunks/process-kadtbwy3.js";
|
|
13
|
+
import"./chunks/process-ja6yvede.js";
|
|
14
|
+
import"./chunks/process-xettb16v.js";
|
|
15
|
+
import"./chunks/process-910kejdj.js";
|
|
16
|
+
import"./chunks/process-kheky2r0.js";
|
|
17
|
+
import"./chunks/process-xn1y01ws.js";
|
|
18
|
+
import"./chunks/process-fa3dg36p.js";
|
|
19
|
+
import"./chunks/process-mx2h5aqn.js";
|
|
20
|
+
import"./chunks/process-1crq7hen.js";
|
|
21
|
+
import"./chunks/process-qc2xtz00.js";
|
|
22
|
+
import"./chunks/process-j26nh0zz.js";
|
|
23
|
+
import"./chunks/process-gw2hwgqh.js";
|
|
24
|
+
import"./chunks/process-172x6jgf.js";
|
|
25
|
+
import"./chunks/process-m8y6333k.js";
|
|
26
|
+
import"./chunks/process-3esm6t0a.js";
|
|
27
|
+
import"./chunks/process-dhcrxjg3.js";
|
|
28
|
+
import"./chunks/process-hezj1jdf.js";
|
|
29
|
+
import"./chunks/process-rkdaz036.js";
|
|
30
|
+
import"./chunks/process-m5dqr0xs.js";
|
|
31
|
+
import"./chunks/process-w0mvbrhx.js";
|
|
32
|
+
import"./chunks/process-knez9aqv.js";
|
|
33
|
+
import"./chunks/process-k8tgqrb7.js";
|
|
34
|
+
import"./chunks/process-d5nhwenp.js";
|
|
35
|
+
import"./chunks/process-prrj1pgd.js";
|
|
36
|
+
import"./chunks/process-qswqf30g.js";
|
|
37
|
+
import"./chunks/process-c23ng5tp.js";
|
|
38
|
+
import"./chunks/process-b4s3wxap.js";
|
|
39
|
+
import"./chunks/process-ks9pc2xc.js";
|
|
40
|
+
import"./chunks/process-kb9735wh.js";
|
|
41
|
+
import"./chunks/process-27edjygf.js";
|
|
42
|
+
import"./chunks/process-8j6eh3dh.js";
|
|
43
|
+
import"./chunks/process-smaf4a18.js";
|
|
44
|
+
import"./chunks/process-t7k3q1ah.js";
|
|
45
|
+
import"./chunks/process-m6wvgbfq.js";
|
|
46
|
+
import"./chunks/process-zyv89x5n.js";
|
|
47
|
+
import"./chunks/process-d0efjmp3.js";
|
|
48
|
+
import"./chunks/process-18k6g42r.js";
|
|
49
|
+
import"./chunks/process-q4bn6dy8.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/process-qswqf30g.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-1crq7hen.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-w0mvbrhx.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-b4s3wxap.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-gw2hwgqh.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-910kejdj.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-smaf4a18.js";
|
|
9
|
+
import"../chunks/process-d0efjmp3.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/process-c23ng5tp.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-qc2xtz00.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-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/process-h965rd83.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
GenerateHandler2 as GenerateHandler
|
|
11
|
+
};
|
|
@@ -1,143 +1,11 @@
|
|
|
1
|
-
import { Integration } from "@opencode/core/integration";
|
|
2
|
-
import { Plugin } from "@opencode/core/plugin";
|
|
3
|
-
import { Effect } from "effect";
|
|
4
|
-
import { HttpApiBuilder, HttpApiSchema } from "effect/unstable/httpapi";
|
|
5
|
-
import { Api } from "../api";
|
|
6
1
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})));
|
|
18
|
-
export const IntegrationHandler = HttpApiBuilder.group(Api, "server.integration", (handlers) => Effect.gen(function* () {
|
|
19
|
-
return handlers.handle("integration.list", Effect.fn(function* () {
|
|
20
|
-
yield* Plugin.awaitActivation;
|
|
21
|
-
const service = yield* Integration.Service;
|
|
22
|
-
return yield* response(service.list());
|
|
23
|
-
})).handle("integration.get", Effect.fn(function* (ctx) {
|
|
24
|
-
const integration = yield* (yield* Integration.Service).get(ctx.params.integrationID);
|
|
25
|
-
if (!integration)
|
|
26
|
-
return yield* new IntegrationNotFoundError({
|
|
27
|
-
integrationID: ctx.params.integrationID,
|
|
28
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
29
|
-
});
|
|
30
|
-
return yield* response(Effect.succeed(integration));
|
|
31
|
-
})).handle("integration.wellknown.add", Effect.fn(function* (ctx) {
|
|
32
|
-
const wellknown = yield* WellKnown.Service, integration = yield* Integration.Service;
|
|
33
|
-
yield* wellknown.add(ctx.payload.url).pipe(Effect.mapError((error) => new InvalidRequestError({ message: error.message, kind: "well_known_discovery" })));
|
|
34
|
-
yield* integration.reload();
|
|
35
|
-
return HttpApiSchema.NoContent.make();
|
|
36
|
-
})).handle("integration.connect.key", Effect.fn(function* (ctx) {
|
|
37
|
-
const service = yield* Integration.Service;
|
|
38
|
-
if (!(yield* service.get(ctx.params.integrationID)))
|
|
39
|
-
return yield* new IntegrationNotFoundError({
|
|
40
|
-
integrationID: ctx.params.integrationID,
|
|
41
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
42
|
-
});
|
|
43
|
-
yield* authorize(service.connection.key({
|
|
44
|
-
integrationID: ctx.params.integrationID,
|
|
45
|
-
key: ctx.payload.key,
|
|
46
|
-
answer: ctx.payload.answer,
|
|
47
|
-
label: ctx.payload.label
|
|
48
|
-
}));
|
|
49
|
-
return HttpApiSchema.NoContent.make();
|
|
50
|
-
})).handle("integration.oauth.connect", Effect.fn(function* (ctx) {
|
|
51
|
-
const service = yield* Integration.Service;
|
|
52
|
-
return yield* response(authorize(service.oauth.connect({
|
|
53
|
-
integrationID: ctx.params.integrationID,
|
|
54
|
-
methodID: ctx.payload.methodID,
|
|
55
|
-
answer: ctx.payload.answer,
|
|
56
|
-
label: ctx.payload.label
|
|
57
|
-
})));
|
|
58
|
-
})).handle("integration.oauth.status", Effect.fn(function* (ctx) {
|
|
59
|
-
const service = yield* Integration.Service;
|
|
60
|
-
if (!(yield* service.get(ctx.params.integrationID)))
|
|
61
|
-
return yield* new IntegrationNotFoundError({
|
|
62
|
-
integrationID: ctx.params.integrationID,
|
|
63
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
64
|
-
});
|
|
65
|
-
return yield* response(service.oauth.status({
|
|
66
|
-
integrationID: ctx.params.integrationID,
|
|
67
|
-
attemptID: ctx.params.attemptID
|
|
68
|
-
}).pipe(Effect.mapError((error) => new IntegrationAttemptNotFoundError({
|
|
69
|
-
integrationID: error.integrationID,
|
|
70
|
-
attemptID: error.attemptID,
|
|
71
|
-
message: `OAuth attempt not found: ${error.attemptID}`
|
|
72
|
-
}))));
|
|
73
|
-
})).handle("integration.oauth.complete", Effect.fn(function* (ctx) {
|
|
74
|
-
const service = yield* Integration.Service;
|
|
75
|
-
if (!(yield* service.get(ctx.params.integrationID)))
|
|
76
|
-
return yield* new IntegrationNotFoundError({
|
|
77
|
-
integrationID: ctx.params.integrationID,
|
|
78
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
79
|
-
});
|
|
80
|
-
yield* service.oauth.complete({
|
|
81
|
-
integrationID: ctx.params.integrationID,
|
|
82
|
-
attemptID: ctx.params.attemptID,
|
|
83
|
-
code: ctx.payload.code
|
|
84
|
-
}).pipe(Effect.mapError((error) => {
|
|
85
|
-
if (error._tag === "Integration.AttemptNotFound")
|
|
86
|
-
return new IntegrationAttemptNotFoundError({
|
|
87
|
-
integrationID: error.integrationID,
|
|
88
|
-
attemptID: error.attemptID,
|
|
89
|
-
message: `OAuth attempt not found: ${error.attemptID}`
|
|
90
|
-
});
|
|
91
|
-
return new InvalidRequestError({
|
|
92
|
-
message: error._tag === "Integration.CodeRequired" ? "Authorization code is required" : "Authentication failed",
|
|
93
|
-
kind: error._tag === "Integration.CodeRequired" ? "integration_code_required" : "integration_authorization"
|
|
94
|
-
});
|
|
95
|
-
}));
|
|
96
|
-
return HttpApiSchema.NoContent.make();
|
|
97
|
-
})).handle("integration.oauth.cancel", Effect.fn(function* (ctx) {
|
|
98
|
-
yield* (yield* Integration.Service).oauth.cancel({
|
|
99
|
-
integrationID: ctx.params.integrationID,
|
|
100
|
-
attemptID: ctx.params.attemptID
|
|
101
|
-
});
|
|
102
|
-
return HttpApiSchema.NoContent.make();
|
|
103
|
-
})).handle("integration.command.connect", Effect.fn(function* (ctx) {
|
|
104
|
-
const service = yield* Integration.Service, integration = yield* service.get(ctx.params.integrationID);
|
|
105
|
-
if (!integration)
|
|
106
|
-
return yield* new IntegrationNotFoundError({
|
|
107
|
-
integrationID: ctx.params.integrationID,
|
|
108
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
109
|
-
});
|
|
110
|
-
if (!integration.methods.some((method) => method.type === "command" && method.id === ctx.payload.methodID))
|
|
111
|
-
return yield* new IntegrationMethodNotFoundError({
|
|
112
|
-
integrationID: ctx.params.integrationID,
|
|
113
|
-
methodID: ctx.payload.methodID,
|
|
114
|
-
message: `Integration method not found: ${ctx.payload.methodID}`
|
|
115
|
-
});
|
|
116
|
-
return yield* response(authorize(service.command.connect({
|
|
117
|
-
integrationID: ctx.params.integrationID,
|
|
118
|
-
methodID: ctx.payload.methodID,
|
|
119
|
-
label: ctx.payload.label
|
|
120
|
-
})));
|
|
121
|
-
})).handle("integration.command.status", Effect.fn(function* (ctx) {
|
|
122
|
-
const service = yield* Integration.Service;
|
|
123
|
-
if (!(yield* service.get(ctx.params.integrationID)))
|
|
124
|
-
return yield* new IntegrationNotFoundError({
|
|
125
|
-
integrationID: ctx.params.integrationID,
|
|
126
|
-
message: `Integration not found: ${ctx.params.integrationID}`
|
|
127
|
-
});
|
|
128
|
-
return yield* response(service.command.status({
|
|
129
|
-
integrationID: ctx.params.integrationID,
|
|
130
|
-
attemptID: ctx.params.attemptID
|
|
131
|
-
}).pipe(Effect.mapError((error) => new IntegrationAttemptNotFoundError({
|
|
132
|
-
integrationID: error.integrationID,
|
|
133
|
-
attemptID: error.attemptID,
|
|
134
|
-
message: `Command attempt not found: ${error.attemptID}`
|
|
135
|
-
}))));
|
|
136
|
-
})).handle("integration.command.cancel", Effect.fn(function* (ctx) {
|
|
137
|
-
yield* (yield* Integration.Service).command.cancel({
|
|
138
|
-
integrationID: ctx.params.integrationID,
|
|
139
|
-
attemptID: ctx.params.attemptID
|
|
140
|
-
});
|
|
141
|
-
return HttpApiSchema.NoContent.make();
|
|
142
|
-
}));
|
|
143
|
-
}));
|
|
2
|
+
IntegrationHandler2
|
|
3
|
+
} from "../chunks/process-3esm6t0a.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
IntegrationHandler2 as IntegrationHandler
|
|
11
|
+
};
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
directory: location.directory,
|
|
13
|
-
project: location.project
|
|
14
|
-
});
|
|
15
|
-
})).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" })))));
|
|
16
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
LocationHandler2
|
|
3
|
+
} from "../chunks/process-ja6yvede.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
LocationHandler2 as LocationHandler
|
|
11
|
+
};
|
package/dist/handlers/mcp.js
CHANGED
|
@@ -1,31 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})).handle("mcp.add", Effect.fn(function* (ctx) {
|
|
13
|
-
yield* (yield* Mcp.Service).add(ctx.params.server, ctx.payload.config);
|
|
14
|
-
return HttpApiSchema.NoContent.make();
|
|
15
|
-
})).handle("mcp.remove", Effect.fn(function* (ctx) {
|
|
16
|
-
const service = yield* Mcp.Service;
|
|
17
|
-
yield* notFound(service.remove(ctx.params.server));
|
|
18
|
-
return HttpApiSchema.NoContent.make();
|
|
19
|
-
})).handle("mcp.connect", Effect.fn(function* (ctx) {
|
|
20
|
-
const service = yield* Mcp.Service;
|
|
21
|
-
yield* notFound(service.connect(ctx.params.server));
|
|
22
|
-
return HttpApiSchema.NoContent.make();
|
|
23
|
-
})).handle("mcp.disconnect", Effect.fn(function* (ctx) {
|
|
24
|
-
const service = yield* Mcp.Service;
|
|
25
|
-
yield* notFound(service.disconnect(ctx.params.server));
|
|
26
|
-
return HttpApiSchema.NoContent.make();
|
|
27
|
-
})).handle("mcp.resource.catalog", Effect.fn(function* () {
|
|
28
|
-
const service = yield* Mcp.Service;
|
|
29
|
-
return yield* response(service.resourceCatalog());
|
|
30
|
-
}));
|
|
31
|
-
}));
|
|
1
|
+
import {
|
|
2
|
+
McpHandler2
|
|
3
|
+
} from "../chunks/process-j26nh0zz.js";
|
|
4
|
+
import"../chunks/process-ks9pc2xc.js";
|
|
5
|
+
import"../chunks/process-kb9735wh.js";
|
|
6
|
+
import"../chunks/process-27edjygf.js";
|
|
7
|
+
import"../chunks/process-8j6eh3dh.js";
|
|
8
|
+
import"../chunks/process-smaf4a18.js";
|
|
9
|
+
export {
|
|
10
|
+
McpHandler2 as McpHandler
|
|
11
|
+
};
|