@opencode/server 0.0.0-dev-1361 → 0.0.0-dev-1362
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 +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/{cors-ca564221.js → service-status-0dfmev2z.js} +1 -1
- package/dist/chunks/{cors-hb1ty1t1.js → service-status-10r1zt22.js} +4 -4
- package/dist/chunks/{cors-29nx48hm.js → service-status-29nx48hm.js} +1 -1
- package/dist/chunks/{cors-10sj2tcf.js → service-status-2h3x7256.js} +1 -1
- package/dist/chunks/{cors-rgbnpstw.js → service-status-341zm3rs.js} +2 -2
- package/dist/chunks/{cors-nvb61mgq.js → service-status-4gs63nyp.js} +4 -4
- package/dist/chunks/{cors-fa6nnfxm.js → service-status-4gt38746.js} +37 -37
- package/dist/chunks/{cors-6cmsxt3d.js → service-status-4rg1tmcj.js} +6 -6
- package/dist/chunks/{cors-enx9e1dz.js → service-status-4th25279.js} +4 -4
- package/dist/chunks/{cors-g23ffrnz.js → service-status-50kbksvb.js} +2 -2
- package/dist/chunks/{cors-3cx4ac5j.js → service-status-5h6n6h4q.js} +20 -23
- package/dist/chunks/{cors-5pdfedjd.js → service-status-5pdfedjd.js} +1 -1
- package/dist/chunks/{cors-v9t81kwn.js → service-status-69weg9qz.js} +7 -7
- package/dist/chunks/{cors-6pm6ek88.js → service-status-6pm6ek88.js} +1 -1
- package/dist/chunks/{cors-br4x4prt.js → service-status-72bf7qt9.js} +3 -3
- package/dist/chunks/{cors-z5c20bjd.js → service-status-7p3x8m34.js} +7 -7
- package/dist/chunks/{cors-n2zyxnzr.js → service-status-7tv8nec1.js} +1 -1
- package/dist/chunks/{cors-wsvmph03.js → service-status-844nmnmk.js} +2 -2
- package/dist/chunks/{cors-8sb6qqpn.js → service-status-8sb6qqpn.js} +1 -1
- package/dist/chunks/{cors-whvq72as.js → service-status-8y4d9f30.js} +3 -3
- package/dist/chunks/{cors-1z9qd4y2.js → service-status-9vfv9n1y.js} +4 -4
- package/dist/chunks/{cors-csnx1nj3.js → service-status-bcs2rr9e.js} +2 -2
- package/dist/chunks/{cors-rjhxbsc4.js → service-status-cgcw2b0e.js} +2 -2
- package/dist/chunks/{cors-djr0jy89.js → service-status-djr0jy89.js} +1 -1
- package/dist/chunks/{cors-e6e4kz0w.js → service-status-e6e4kz0w.js} +1 -1
- package/dist/chunks/{cors-g4964mny.js → service-status-evw6vf0s.js} +3 -3
- package/dist/chunks/{cors-7dkb5ks8.js → service-status-fcw485c9.js} +2 -2
- package/dist/chunks/{cors-am27j67f.js → service-status-fegnxd42.js} +1 -1
- package/dist/chunks/{cors-ehyp3zqd.js → service-status-fsvp99pe.js} +1 -1
- package/dist/chunks/{cors-k74zefsg.js → service-status-ggw25rqf.js} +1 -1
- package/dist/chunks/{cors-em7ed65n.js → service-status-gqstb6bx.js} +2 -2
- package/dist/chunks/{cors-j4at0y5c.js → service-status-j4at0y5c.js} +1 -1
- package/dist/chunks/{cors-8xdajgpr.js → service-status-j605n900.js} +2 -2
- package/dist/chunks/{cors-javgytnb.js → service-status-j6y32kmq.js} +2 -2
- package/dist/chunks/{cors-8nezxn08.js → service-status-k12h8tw9.js} +1 -1
- package/dist/chunks/{cors-f3gr6hfv.js → service-status-kc553r92.js} +2 -2
- package/dist/chunks/{cors-w6xb5z15.js → service-status-mj1ewmp1.js} +83 -60
- package/dist/chunks/{cors-myqk22k5.js → service-status-myqk22k5.js} +2 -2
- package/dist/chunks/{cors-p3bbq7g3.js → service-status-ntf3tw9k.js} +1 -1
- package/dist/chunks/{cors-qssmdh31.js → service-status-pp5985xb.js} +4 -4
- package/dist/chunks/{cors-8qsq6tbs.js → service-status-qcnb494j.js} +2 -2
- package/dist/chunks/{cors-yc92za0p.js → service-status-qgjb3f4w.js} +2 -2
- package/dist/chunks/{cors-msvebcy2.js → service-status-qw2j92v5.js} +5 -5
- package/dist/chunks/{cors-0wjm8gvs.js → service-status-r5yb7twv.js} +2 -2
- package/dist/chunks/{cors-3xkwxcke.js → service-status-r9w3a44p.js} +2 -2
- package/dist/chunks/{cors-s0zgx365.js → service-status-sn8sqewc.js} +2 -2
- package/dist/chunks/{cors-t32e1bbt.js → service-status-t32e1bbt.js} +1 -1
- package/dist/chunks/{cors-exwy1kbj.js → service-status-tktas153.js} +2 -2
- package/dist/chunks/{cors-ka2mtp6f.js → service-status-vyjhrbg0.js} +2 -2
- package/dist/chunks/{cors-sv3a4xc1.js → service-status-w7n3bfa8.js} +13 -13
- package/dist/chunks/{cors-kmwr1xw9.js → service-status-ws2ckpmb.js} +3 -3
- package/dist/chunks/{cors-x2qy7jg1.js → service-status-x2qy7jg1.js} +1 -1
- package/dist/chunks/{cors-5fn432p6.js → service-status-xw05m515.js} +17 -12
- package/dist/chunks/{cors-2tmcamrc.js → service-status-yvy5qft7.js} +2 -2
- package/dist/chunks/{cors-9hynp6rm.js → service-status-z564cb4b.js} +2 -2
- package/dist/chunks/{cors-prwd5gwt.js → service-status-zmrq0y42.js} +2 -2
- package/dist/chunks/{cors-qq3f8fnn.js → service-status-zs3a96ke.js} +2 -2
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +65 -65
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.js +2 -2
- package/dist/handlers/blob.js +3 -3
- 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/experimental/browser-tunnel.js +4 -4
- package/dist/handlers/flag.js +6 -6
- package/dist/handlers/form.js +6 -6
- package/dist/handlers/fs.js +8 -8
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/machine.js +1 -1
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +2 -2
- 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 +20 -20
- 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/push.js +1 -1
- 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 +7 -7
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/space.d.ts +35 -25
- package/dist/handlers/space.js +2 -2
- 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.js +58 -58
- package/dist/location.js +4 -4
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/defect-response.js +1 -1
- 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 +3 -3
- package/dist/process.js +66 -66
- package/dist/range.js +1 -1
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +1 -1
- package/dist/routes.js +62 -62
- package/dist/server-info.js +1 -1
- package/dist/service-status.js +1 -1
- package/dist/space-store.d.ts +22 -9
- package/dist/space-store.js +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +67 -67
- package/package.json +8 -8
- /package/dist/chunks/{cors-017ycvbx.js → service-status-017ycvbx.js} +0 -0
- /package/dist/chunks/{cors-9rqn6x4v.js → service-status-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{cors-bd8755ek.js → service-status-bd8755ek.js} +0 -0
- /package/dist/chunks/{cors-n26yr6pw.js → service-status-n26yr6pw.js} +0 -0
- /package/dist/chunks/{cors-q187pxxd.js → service-status-q187pxxd.js} +0 -0
- /package/dist/chunks/{cors-q4bn6dy8.js → service-status-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{cors-qpnw2qd1.js → service-status-qpnw2qd1.js} +0 -0
- /package/dist/chunks/{cors-rqgv9x42.js → service-status-rqgv9x42.js} +0 -0
- /package/dist/chunks/{cors-xthc02cw.js → service-status-xthc02cw.js} +0 -0
- /package/dist/chunks/{cors-yc7nft6q.js → service-status-yc7nft6q.js} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2,
|
|
3
3
|
failedMessageDecode2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./service-status-rqgv9x42.js";
|
|
5
5
|
import {
|
|
6
6
|
Api2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-8y4d9f30.js";
|
|
8
8
|
import {
|
|
9
9
|
wantsMediaRefs2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./service-status-xthc02cw.js";
|
|
11
11
|
|
|
12
12
|
// src/handlers/message.ts
|
|
13
13
|
import { SessionMessage } from "@opencode/core/session/message";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/reference.ts
|
|
9
9
|
import { Reference } from "@opencode/core/reference";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.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
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-8y4d9f30.js";
|
|
4
4
|
import {
|
|
5
5
|
requireConnectable2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-yvy5qft7.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/credential.ts
|
|
9
9
|
import { Credential } from "@opencode/core/credential";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-rqgv9x42.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-72bf7qt9.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/artifact.ts
|
|
11
11
|
import { Artifact } from "@opencode/core/artifact";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/space-store.ts
|
|
6
6
|
var exports_space_store = {};
|
|
@@ -30,20 +30,14 @@ var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
|
30
30
|
const listeners = new Array;
|
|
31
31
|
const locks = KeyedMutex.makeUnsafe();
|
|
32
32
|
const deletes = new Map;
|
|
33
|
-
const tombstoned = (space) => Effect.suspend(() => {
|
|
34
|
-
|
|
33
|
+
const tombstoned = (space, count) => Effect.suspend(() => {
|
|
34
|
+
if (count === 0)
|
|
35
|
+
return Effect.void;
|
|
36
|
+
const since = (deletes.get(space) ?? PurgeInterval2 - 1) + count;
|
|
35
37
|
if (since < PurgeInterval2)
|
|
36
38
|
return Effect.sync(() => deletes.set(space, since));
|
|
37
39
|
return SpaceRows.purge(db, space).pipe(Effect.andThen(Effect.sync(() => deletes.set(space, 0))), Effect.catchCause((cause) => Effect.logWarning("Could not purge space tombstones", { space, cause })));
|
|
38
40
|
});
|
|
39
|
-
const commit = (space, write) => locks.withLock(space)(Effect.uninterruptible(Effect.gen(function* () {
|
|
40
|
-
const data = yield* write;
|
|
41
|
-
if (!data)
|
|
42
|
-
return;
|
|
43
|
-
const committed = change(data, yield* Clock.currentTimeMillis);
|
|
44
|
-
yield* Effect.forEach(listeners, (listener) => listener(committed), { discard: true });
|
|
45
|
-
yield* Effect.forEach(streams.values(), (stream) => deliver(stream, committed), { discard: true });
|
|
46
|
-
})));
|
|
47
41
|
const streams = new Map;
|
|
48
42
|
const deliver = (stream, change) => Effect.suspend(() => {
|
|
49
43
|
const subscription = stream.spaces.get(change.data.space);
|
|
@@ -55,57 +49,73 @@ var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
|
55
49
|
}
|
|
56
50
|
return change.data.revision > subscription.covered ? stream.send(change) : Effect.void;
|
|
57
51
|
});
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
const page = (space, cursor, limit) => Effect.gen(function* () {
|
|
53
|
+
const position = cursor === undefined ? undefined : parse(epoch, cursor);
|
|
54
|
+
const from = position?.head === undefined ? position ? { type: "delta", since: position.since, snapshot: true } : { type: "snapshot", since: 0 } : position.since > position.head ? { type: "snapshot", since: 0 } : { type: "snapshot", since: position.since, until: position.head };
|
|
55
|
+
const read = yield* SpaceRows.read(db, space, from, limit + 1);
|
|
56
|
+
const more = read.rows.length > limit;
|
|
57
|
+
const kept = read.rows.slice(0, limit);
|
|
58
|
+
if (read.continued && from.type === "delta") {
|
|
59
|
+
const revision = kept.at(-1)?.revision ?? from.since;
|
|
60
|
+
const delta = {
|
|
61
|
+
type: "delta",
|
|
62
|
+
space,
|
|
63
|
+
epoch,
|
|
64
|
+
revision,
|
|
65
|
+
entries: entries(kept),
|
|
66
|
+
deleted: deleted(kept),
|
|
67
|
+
cursor: `${epoch}.${revision}`,
|
|
68
|
+
next: more ? `${epoch}.${revision}` : undefined
|
|
69
|
+
};
|
|
70
|
+
return delta;
|
|
71
|
+
}
|
|
72
|
+
const since = read.continued ? from.since : 0;
|
|
73
|
+
const until = read.continued && from.type === "snapshot" ? from.until ?? read.head : read.head;
|
|
74
|
+
const revision = more ? kept.at(-1)?.revision ?? since : until;
|
|
75
|
+
const snapshot = {
|
|
76
|
+
type: "snapshot",
|
|
76
77
|
space,
|
|
77
78
|
epoch,
|
|
78
79
|
revision,
|
|
79
80
|
entries: entries(kept),
|
|
80
|
-
deleted: deleted(kept),
|
|
81
81
|
cursor: `${epoch}.${revision}`,
|
|
82
|
-
next:
|
|
82
|
+
next: more ? `${epoch}.${revision}.${until}` : read.head > until ? `${epoch}.${until}` : undefined
|
|
83
83
|
};
|
|
84
|
-
return
|
|
84
|
+
return snapshot;
|
|
85
85
|
});
|
|
86
|
-
const catchUp = (space, cursor) => Effect.gen(function* () {
|
|
86
|
+
const catchUp = (space, cursor, budget) => Effect.gen(function* () {
|
|
87
87
|
const position = parse(epoch, cursor);
|
|
88
88
|
const created = yield* Clock.currentTimeMillis;
|
|
89
|
-
const resync = {
|
|
89
|
+
const resync = (read) => ({
|
|
90
90
|
covered: 0,
|
|
91
|
+
read,
|
|
91
92
|
events: [{ id: Event.ID.create(), created, type: Space.Event.Resync.type, data: { space } }]
|
|
92
|
-
};
|
|
93
|
-
if (!position || position.head !== undefined
|
|
94
|
-
return resync;
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
return resync;
|
|
93
|
+
});
|
|
94
|
+
if (budget === 0 || !position || position.head !== undefined)
|
|
95
|
+
return resync(0);
|
|
96
|
+
const read = yield* SpaceRows.read(db, space, { type: "delta", since: position.since, snapshot: false }, budget + 1);
|
|
97
|
+
if (!read.continued || read.rows.length > budget)
|
|
98
|
+
return resync(read.rows.length);
|
|
98
99
|
return {
|
|
99
|
-
covered: rows.at(-1)?.revision ?? position.since,
|
|
100
|
-
|
|
100
|
+
covered: read.rows.at(-1)?.revision ?? position.since,
|
|
101
|
+
read: read.rows.length,
|
|
102
|
+
events: read.rows.map((row) => change(space, row, created))
|
|
101
103
|
};
|
|
102
104
|
});
|
|
103
105
|
return Service2.of({
|
|
104
|
-
|
|
105
|
-
yield*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
write: Effect.fn("SpaceStore.write")(function* (changes) {
|
|
107
|
+
return yield* [...new Set(changes.map((change) => change.space))].toSorted().reduceRight((effect, space) => locks.withLock(space)(effect), Effect.uninterruptible(Effect.gen(function* () {
|
|
108
|
+
const result = yield* SpaceRows.write(db, changes);
|
|
109
|
+
const tombstones = Map.groupBy(result.written.filter((row) => row.value === null), (row) => row.space);
|
|
110
|
+
yield* Effect.forEach(tombstones, ([space, rows]) => tombstoned(space, rows.length), { discard: true });
|
|
111
|
+
const created = yield* Clock.currentTimeMillis;
|
|
112
|
+
for (const row of result.written) {
|
|
113
|
+
const committed = change(row.space, row, created);
|
|
114
|
+
yield* Effect.forEach(listeners, (listener) => listener(committed), { discard: true });
|
|
115
|
+
yield* Effect.forEach(streams.values(), (stream) => deliver(stream, committed), { discard: true });
|
|
116
|
+
}
|
|
117
|
+
return result.heads.map((head) => ({ ...head, cursor: `${epoch}.${head.revision}` }));
|
|
118
|
+
})));
|
|
109
119
|
}),
|
|
110
120
|
get epoch() {
|
|
111
121
|
return epoch;
|
|
@@ -113,16 +123,17 @@ var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
|
113
123
|
resetEpoch: Effect.fn("SpaceStore.resetEpoch")(function* () {
|
|
114
124
|
epoch = yield* SpaceRows.resetEpoch(db);
|
|
115
125
|
})(),
|
|
116
|
-
sync: Effect.fn("SpaceStore.sync")(function* (
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
sync: Effect.fn("SpaceStore.sync")(function* (requests) {
|
|
127
|
+
const pages = new Array;
|
|
128
|
+
let budget = BatchSize2;
|
|
129
|
+
for (const request of requests) {
|
|
130
|
+
if (budget === 0)
|
|
131
|
+
break;
|
|
132
|
+
const next = yield* page(request.space, request.cursor, budget);
|
|
133
|
+
budget -= next.entries.length + (next.type === "delta" ? next.deleted.length : 0);
|
|
134
|
+
pages.push(next);
|
|
135
|
+
}
|
|
136
|
+
return pages;
|
|
126
137
|
}),
|
|
127
138
|
attach: (id, send) => Effect.acquireRelease(Effect.sync(() => streams.set(id, { send, spaces: new Map })), () => Effect.sync(() => streams.delete(id))).pipe(Effect.asVoid),
|
|
128
139
|
subscribe: Effect.fn("SpaceStore.subscribe")(function* (id, requests) {
|
|
@@ -134,9 +145,11 @@ var layer = Layer.effect(Service2, Effect.gen(function* () {
|
|
|
134
145
|
stream.spaces.set(request.space, subscription);
|
|
135
146
|
return { request, subscription };
|
|
136
147
|
});
|
|
148
|
+
let budget = BatchSize2;
|
|
137
149
|
yield* Effect.forEach(subscriptions, ({ request, subscription }) => Effect.gen(function* () {
|
|
138
150
|
const current = () => stream.spaces.get(request.space) === subscription;
|
|
139
|
-
const first = yield* catchUp(request.space, request.cursor);
|
|
151
|
+
const first = yield* catchUp(request.space, request.cursor, budget);
|
|
152
|
+
budget = Math.max(0, budget - first.read);
|
|
140
153
|
if (!subscription.pending)
|
|
141
154
|
return;
|
|
142
155
|
subscription.covered = first.covered;
|
|
@@ -175,8 +188,18 @@ var extension2 = Effect.gen(function* () {
|
|
|
175
188
|
const store = yield* Service2;
|
|
176
189
|
return { open: (stream, send) => store.attach(stream, send) };
|
|
177
190
|
});
|
|
178
|
-
function change(
|
|
179
|
-
return
|
|
191
|
+
function change(space, row, created) {
|
|
192
|
+
return row.value === null ? {
|
|
193
|
+
id: Event.ID.create(),
|
|
194
|
+
created,
|
|
195
|
+
type: Space.Event.Deleted.type,
|
|
196
|
+
data: { space, key: row.key, revision: row.revision }
|
|
197
|
+
} : {
|
|
198
|
+
id: Event.ID.create(),
|
|
199
|
+
created,
|
|
200
|
+
type: Space.Event.Updated.type,
|
|
201
|
+
data: { space, key: row.key, value: row.value, revision: row.revision }
|
|
202
|
+
};
|
|
180
203
|
}
|
|
181
204
|
function entries(rows) {
|
|
182
205
|
return rows.flatMap((row) => row.value === null ? [] : [{ key: row.key, value: row.value }]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedRequestOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/request-site.ts
|
|
9
9
|
var exports_request_site = {};
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
missingMessage2,
|
|
5
5
|
failedMessageDecode2,
|
|
6
6
|
failedSnapshot2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-rqgv9x42.js";
|
|
8
8
|
import {
|
|
9
9
|
locationErrors2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./service-status-72bf7qt9.js";
|
|
11
11
|
import {
|
|
12
12
|
Api2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./service-status-8y4d9f30.js";
|
|
14
14
|
import {
|
|
15
15
|
wantsMediaRefs2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-status-xthc02cw.js";
|
|
17
17
|
|
|
18
18
|
// src/handlers/session.ts
|
|
19
19
|
import { Instance } from "@opencode/core/instance/service";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
response2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-72bf7qt9.js";
|
|
4
4
|
import {
|
|
5
5
|
Api2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-8y4d9f30.js";
|
|
7
7
|
|
|
8
8
|
// src/handlers/provider.ts
|
|
9
9
|
import { Provider } from "@opencode/core/provider";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isAllowedCorsOrigin2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-q4bn6dy8.js";
|
|
4
4
|
import {
|
|
5
5
|
middleware2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-status-myqk22k5.js";
|
|
7
7
|
import {
|
|
8
8
|
withoutParentSpan2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-status-yc7nft6q.js";
|
|
10
10
|
import {
|
|
11
11
|
createRoutes2
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./service-status-5h6n6h4q.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
|
-
} from "./
|
|
15
|
+
} from "./service-status-9rqn6x4v.js";
|
|
16
16
|
|
|
17
17
|
// src/fetch.ts
|
|
18
18
|
var exports_fetch = {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CorsConfig2,
|
|
3
3
|
isAllowedRequestOrigin2
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./service-status-q4bn6dy8.js";
|
|
5
5
|
import {
|
|
6
6
|
locationErrors2,
|
|
7
7
|
requestRef2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-72bf7qt9.js";
|
|
9
9
|
|
|
10
10
|
// src/handlers/experimental/browser-tunnel.ts
|
|
11
11
|
import { NodeHttpServerRequest } from "@effect/platform-node";
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Api2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-8y4d9f30.js";
|
|
4
4
|
import {
|
|
5
5
|
CorsConfig2,
|
|
6
6
|
isAllowedRequestOrigin2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./service-status-q4bn6dy8.js";
|
|
8
8
|
import {
|
|
9
9
|
makeArtifact2
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./service-status-j6y32kmq.js";
|
|
11
11
|
import {
|
|
12
12
|
makeBlobGet2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./service-status-50kbksvb.js";
|
|
14
14
|
import {
|
|
15
15
|
makeBrowserTunnel2
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-status-vyjhrbg0.js";
|
|
17
17
|
import {
|
|
18
18
|
makeAutomation2
|
|
19
|
-
} from "./
|
|
19
|
+
} from "./service-status-6pm6ek88.js";
|
|
20
20
|
import {
|
|
21
21
|
makeJob2
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./service-status-x2qy7jg1.js";
|
|
23
23
|
import {
|
|
24
24
|
makeMachineLink2,
|
|
25
25
|
makeMachine2
|
|
26
|
-
} from "./
|
|
26
|
+
} from "./service-status-017ycvbx.js";
|
|
27
27
|
import {
|
|
28
28
|
makeMediaGet2
|
|
29
|
-
} from "./
|
|
29
|
+
} from "./service-status-djr0jy89.js";
|
|
30
30
|
import {
|
|
31
31
|
makePush2
|
|
32
|
-
} from "./
|
|
32
|
+
} from "./service-status-qpnw2qd1.js";
|
|
33
33
|
import {
|
|
34
34
|
makeSpace2
|
|
35
|
-
} from "./
|
|
35
|
+
} from "./service-status-xw05m515.js";
|
|
36
36
|
import {
|
|
37
37
|
runPtySocket2
|
|
38
|
-
} from "./
|
|
38
|
+
} from "./service-status-q187pxxd.js";
|
|
39
39
|
|
|
40
40
|
// src/handlers/persistent-pty.ts
|
|
41
41
|
import { PersistentPty } from "@opencode/core/persistent-pty";
|
|
@@ -69,7 +69,7 @@ var PersistentPtyHandler2 = HttpApiBuilder.group(Api2, "server.experimental", (h
|
|
|
69
69
|
const machineLink = yield* makeMachineLink2;
|
|
70
70
|
const browserTunnel = yield* makeBrowserTunnel2;
|
|
71
71
|
const push = yield* makePush2;
|
|
72
|
-
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handleRaw("browser.tunnel", (ctx) => browserTunnel(ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("push.get", () => push.get()).handle("push.device.register", (ctx) => push.register(ctx.params.deviceID, ctx.payload)).handle("push.device.remove", (ctx) => push.remove(ctx.params.deviceID)).handle("push.device.update", (ctx) => push.update(ctx.params.deviceID, ctx.payload)).handle("push.device.session.set", (ctx) => push.setDeviceBell(ctx.params.deviceID, ctx.params.sessionID, ctx.payload)).handle("push.device.session.remove", (ctx) => push.removeDeviceBell(ctx.params.deviceID, ctx.params.sessionID)).handle("push.session.set", (ctx) => push.setSessionBell(ctx.params.sessionID, ctx.payload)).handle("push.session.remove", (ctx) => push.removeSessionBell(ctx.params.sessionID)).handle("push.settings.set", (ctx) => push.setSettings(ctx.payload)).handle("space.
|
|
72
|
+
return handlers.handleRaw("media.get", (ctx) => mediaGet(ctx.params.hash, ctx.request)).handleRaw("blob.get", (ctx) => blobGet(ctx.params.id, ctx.request)).handleRaw("browser.tunnel", (ctx) => browserTunnel(ctx.request)).handle("job.list", (ctx) => job.list(ctx.query)).handle("job.cancel", (ctx) => job.cancel(ctx.params.id)).handleRaw("machine.link", (ctx) => machineLink(ctx.request)).handle("machine.list", () => machine.list()).handle("machine.add", (ctx) => machine.add(ctx.payload)).handle("machine.remove", (ctx) => machine.remove(ctx.params.name)).handle("push.get", () => push.get()).handle("push.device.register", (ctx) => push.register(ctx.params.deviceID, ctx.payload)).handle("push.device.remove", (ctx) => push.remove(ctx.params.deviceID)).handle("push.device.update", (ctx) => push.update(ctx.params.deviceID, ctx.payload)).handle("push.device.session.set", (ctx) => push.setDeviceBell(ctx.params.deviceID, ctx.params.sessionID, ctx.payload)).handle("push.device.session.remove", (ctx) => push.removeDeviceBell(ctx.params.deviceID, ctx.params.sessionID)).handle("push.session.set", (ctx) => push.setSessionBell(ctx.params.sessionID, ctx.payload)).handle("push.session.remove", (ctx) => push.removeSessionBell(ctx.params.sessionID)).handle("push.settings.set", (ctx) => push.setSettings(ctx.payload)).handle("space.write", (ctx) => space.write(ctx.payload.changes)).handle("space.sync", (ctx) => space.sync(ctx.payload.spaces)).handle("space.subscribe", (ctx) => space.subscribe(ctx.payload)).handle("space.unsubscribe", (ctx) => space.unsubscribe(ctx.payload)).handle("space.reset", () => space.reset()).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("automation.create", (ctx) => automation.create(ctx.payload)).handle("automation.list", (ctx) => automation.list(ctx.query)).handle("automation.get", (ctx) => automation.get(ctx.params.automationID)).handle("automation.pause", (ctx) => automation.pause(ctx.params.automationID)).handle("automation.resume", (ctx) => automation.resume(ctx.params.automationID)).handle("automation.delete", (ctx) => automation.remove(ctx.params.automationID)).handle("persistentPty.read", Effect.fn(function* (ctx) {
|
|
73
73
|
return { data: yield* pty.read(ctx.params.sessionID, ctx.query.lines).pipe(mapUnavailable) };
|
|
74
74
|
})).handle("persistentPty.list", Effect.fn(function* (ctx) {
|
|
75
75
|
return { data: yield* pty.list(ctx.params.sessionID).pipe(mapUnavailable) };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
missingSession2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-status-rqgv9x42.js";
|
|
4
4
|
import {
|
|
5
5
|
locationErrors2,
|
|
6
6
|
response2,
|
|
7
7
|
sessionInfo2
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./service-status-72bf7qt9.js";
|
|
9
9
|
import {
|
|
10
10
|
Api2
|
|
11
|
-
} from "./
|
|
11
|
+
} from "./service-status-8y4d9f30.js";
|
|
12
12
|
|
|
13
13
|
// src/handlers/permission.ts
|
|
14
14
|
import { Instance } from "@opencode/core/instance/service";
|