@opencode/client 0.0.0-beta-19398 → 0.0.0-beta-19419
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/solid/data.d.ts +2 -0
- package/dist/solid/data.js +10 -4
- package/package.json +4 -4
package/dist/solid/data.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ type OpenCodeEventMap = {
|
|
|
9
9
|
export type CreateDataInput = {
|
|
10
10
|
readonly api: () => OpenCodeClient;
|
|
11
11
|
readonly directory: string;
|
|
12
|
+
/** Raw-message window used for an initial transcript read. Older pages retain their normal size. */
|
|
13
|
+
readonly initialMessageLimit?: () => number;
|
|
12
14
|
readonly event: {
|
|
13
15
|
readonly on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: OpenCodeEventMap[Type]) => void) => () => void;
|
|
14
16
|
readonly listen: (handler: (event: {
|
package/dist/solid/data.js
CHANGED
|
@@ -1426,7 +1426,11 @@ export function createData(config) {
|
|
|
1426
1426
|
},
|
|
1427
1427
|
sync(sessionID) {
|
|
1428
1428
|
return sync.run(`session.message:${sessionID}`, async () => {
|
|
1429
|
-
const response = await api().message.list({
|
|
1429
|
+
const response = await api().message.list({
|
|
1430
|
+
sessionID,
|
|
1431
|
+
limit: config.initialMessageLimit?.() ?? messagePageLimit,
|
|
1432
|
+
order: "desc",
|
|
1433
|
+
});
|
|
1430
1434
|
const fetched = response.data.toReversed();
|
|
1431
1435
|
// Same protection as the pending sync: a re-fetch racing an
|
|
1432
1436
|
// admission must not wipe its local transcript row.
|
|
@@ -1434,9 +1438,11 @@ export function createData(config) {
|
|
|
1434
1438
|
const admitted = new Set((store.session.pending[sessionID] ?? []).flatMap((item) => item.type === "user" || item.type === "synthetic" ? [item.id] : []));
|
|
1435
1439
|
const local = (store.session.message[sessionID] ?? []).filter((item) => !ids.has(item.id) && (outbox.has(item.id) || admitted.has(item.id)));
|
|
1436
1440
|
const messages = local.length === 0 ? fetched : [...fetched, ...local];
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1441
|
+
batch(() => {
|
|
1442
|
+
messageIndex.set(sessionID, new Map(messages.map((message, index) => [message.id, index])));
|
|
1443
|
+
setStore("session", "message", sessionID, reconcile(messages));
|
|
1444
|
+
setStore("session", "messageCursor", sessionID, response.cursor.next ?? undefined);
|
|
1445
|
+
});
|
|
1440
1446
|
});
|
|
1441
1447
|
},
|
|
1442
1448
|
more(sessionID) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/client",
|
|
4
|
-
"version": "0.0.0-beta-
|
|
4
|
+
"version": "0.0.0-beta-19419",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"typecheck": "tsgo --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@opencode/schema": "0.0.0-beta-
|
|
61
|
-
"@opencode/protocol": "0.0.0-beta-
|
|
60
|
+
"@opencode/schema": "0.0.0-beta-19419",
|
|
61
|
+
"@opencode/protocol": "0.0.0-beta-19419"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"effect": "4.0.0-rc.112",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
77
|
-
"@opencode/httpapi-codegen": "0.0.0-beta-
|
|
77
|
+
"@opencode/httpapi-codegen": "0.0.0-beta-19419",
|
|
78
78
|
"@tsconfig/bun": "1.0.9",
|
|
79
79
|
"@types/bun": "1.4.0",
|
|
80
80
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|