@nyte-ai/sdk 0.0.18 → 0.0.21
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/THIRD-PARTY-NOTICES.md +66 -0
- package/dist/chunks/{capability-591c8vr1.js → capability-agj3gwwv.js} +2 -2
- package/dist/chunks/{capability-8hmez9nw.js → capability-ctnsbfx9.js} +9 -5
- package/dist/chunks/{capability-cdz2rz6h.js → capability-ec663cyt.js} +5 -5
- package/dist/chunks/{capability-2wk9ktc5.js → capability-ke5yk1as.js} +5 -1
- package/dist/chunks/capability-swbs68d8.js +32 -0
- package/dist/chunks/capability-t9k5jy3d.js +96 -0
- package/dist/chunks/{capability-y1amted3.js → capability-xavf3m2f.js} +27 -14
- package/dist/src/client.d.ts +0 -1
- package/dist/src/client.js +4 -4
- package/dist/src/connect.js +5 -5
- package/dist/src/history.d.ts +3 -3
- package/dist/src/history.js +2 -2
- package/dist/src/index.client.js +7 -7
- package/dist/src/index.js +7 -7
- package/dist/src/index.web.js +7 -7
- package/dist/src/journal.js +1 -1
- package/dist/src/paint-spans.js +1 -1
- package/dist/src/rows.d.ts +1 -1
- package/dist/src/surface.d.ts +2 -2
- package/dist/src/surface.js +3 -3
- package/dist/src/watch.d.ts +2 -6
- package/dist/src/watch.js +1 -1
- package/dist/src/workspace.js +1 -1
- package/package.json +6 -6
- package/dist/chunks/capability-3qe1hz8t.js +0 -78
- package/dist/chunks/capability-esdwn315.js +0 -26
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -91,6 +91,9 @@ SOFTWARE.
|
|
|
91
91
|
- Transcript reconciliation, checkpoint instruction snapshots, provider system
|
|
92
92
|
updates, and cache warming are ported from the 1.0.0 release commit
|
|
93
93
|
`a13d35a742c6ef8462812a28fbe1d8c8b7431c32`.
|
|
94
|
+
- Fitting images to model limits (`packages/core/src/agent/images.ts` and
|
|
95
|
+
`packages/host/src/images`) is ported from `@earendil-works/pi-durable`'s
|
|
96
|
+
images at commit `73f8de80bc87021375f8b525292ac07492253002`.
|
|
94
97
|
|
|
95
98
|
License: MIT, with the following notice:
|
|
96
99
|
|
|
@@ -148,6 +151,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
148
151
|
THE SOFTWARE.
|
|
149
152
|
```
|
|
150
153
|
|
|
154
|
+
## Photon (`silvia-odwyer/photon`)
|
|
155
|
+
|
|
156
|
+
- Repository: https://github.com/silvia-odwyer/photon
|
|
157
|
+
- Package: `@silvia-odwyer/photon` 0.3.3
|
|
158
|
+
- What: the host decodes, orients, scales and re-encodes images for the model
|
|
159
|
+
with Photon's WebAssembly build.
|
|
160
|
+
|
|
161
|
+
License: Apache License 2.0, reproduced in the appendix below. Copyright 2023
|
|
162
|
+
Silvia O'Dwyer.
|
|
163
|
+
|
|
151
164
|
## Pierre
|
|
152
165
|
|
|
153
166
|
- Repository: https://github.com/pierrecomputer/pierre
|
|
@@ -561,6 +574,59 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
561
574
|
SOFTWARE.
|
|
562
575
|
```
|
|
563
576
|
|
|
577
|
+
## snapcn (`snapcndev/snapcn`)
|
|
578
|
+
|
|
579
|
+
- Repository: https://github.com/snapcndev/snapcn
|
|
580
|
+
- What: the launch film's Logo Flicker and Check Cycle scenes
|
|
581
|
+
(`packages/lab/video/src/snap-cn/`) are adapted from snapcn's registry
|
|
582
|
+
components at commit `47ee435f17d85f74abf48b095b40d64fc9616fb0`.
|
|
583
|
+
|
|
584
|
+
License: MIT, with the following notice:
|
|
585
|
+
|
|
586
|
+
```text
|
|
587
|
+
MIT License
|
|
588
|
+
|
|
589
|
+
Copyright (c) 2026 Sri Nath (snap-cn)
|
|
590
|
+
|
|
591
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
592
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
593
|
+
in the Software without restriction, including without limitation the rights
|
|
594
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
595
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
596
|
+
furnished to do so, subject to the following conditions:
|
|
597
|
+
|
|
598
|
+
The above copyright notice and this permission notice shall be included in all
|
|
599
|
+
copies or substantial portions of the Software.
|
|
600
|
+
|
|
601
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
602
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
603
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
604
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
605
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
606
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
607
|
+
SOFTWARE.
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
## Naybr, "Copyright Free Gameplay (No Commentary) - Minecraft Survival"
|
|
611
|
+
|
|
612
|
+
- Source: https://www.youtube.com/watch?v=GPsGyv5zTlM, by Naybr (youtube.com/@Naybr)
|
|
613
|
+
- What: the launch film opens on four shots from 0:30 to 2:30 of this video
|
|
614
|
+
(`clip` in `packages/lab/video/src/film/media.ts`). The footage is not in
|
|
615
|
+
the repository; `packages/lab/video/README.md` says how to fetch it.
|
|
616
|
+
|
|
617
|
+
License: Creative Commons Attribution, as published on YouTube. The author
|
|
618
|
+
allows use, modification, redistribution and monetisation, with this credit
|
|
619
|
+
wherever the gameplay is used: "Gameplay – youtube.com/@Naybr".
|
|
620
|
+
|
|
621
|
+
## Photographs in the launch film
|
|
622
|
+
|
|
623
|
+
- Source: Wikimedia Commons; each file's author and source page are listed in
|
|
624
|
+
`photos` in `packages/lab/video/src/film/media.ts`.
|
|
625
|
+
- What: eleven photographs the launch film cuts between. They are not in the
|
|
626
|
+
repository.
|
|
627
|
+
|
|
628
|
+
License: every one is public domain or CC0. None requires attribution.
|
|
629
|
+
|
|
564
630
|
## Design references
|
|
565
631
|
|
|
566
632
|
These credits record design sources. They do not grant a license to the
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSendJournal2
|
|
3
|
-
} from "./capability-
|
|
3
|
+
} from "./capability-ke5yk1as.js";
|
|
4
4
|
import {
|
|
5
5
|
parsed2
|
|
6
6
|
} from "./capability-2q3s96kg.js";
|
|
7
7
|
import {
|
|
8
8
|
createClient2
|
|
9
|
-
} from "./capability-
|
|
9
|
+
} from "./capability-ec663cyt.js";
|
|
10
10
|
|
|
11
11
|
// src/connect.ts
|
|
12
12
|
import { IdentityChallengeSchema, isJson, SdkError } from "@nyte-ai/schema";
|
|
@@ -68,8 +68,7 @@ function watchHead2(views, journal, input) {
|
|
|
68
68
|
if (view === null)
|
|
69
69
|
return;
|
|
70
70
|
journal.landed(session, head, view);
|
|
71
|
-
const
|
|
72
|
-
const next = withUnsent2(view, journal.unsent(session, head), (id) => ids.has(id));
|
|
71
|
+
const next = withUnsent2(view, journal.unsent(session, head));
|
|
73
72
|
if (next === shown)
|
|
74
73
|
return;
|
|
75
74
|
shown = next;
|
|
@@ -120,9 +119,14 @@ function watchHost2(rows, opened) {
|
|
|
120
119
|
};
|
|
121
120
|
}));
|
|
122
121
|
}
|
|
123
|
-
function withUnsent2(view, unsent
|
|
124
|
-
const
|
|
125
|
-
const
|
|
122
|
+
function withUnsent2(view, unsent) {
|
|
123
|
+
const lead = view.leadingPrompt?.id;
|
|
124
|
+
const held = unsent.filter((message) => message.id !== lead);
|
|
125
|
+
if (held.length === 0)
|
|
126
|
+
return view;
|
|
127
|
+
const over = new Map(held.map((message) => [message.id, message]));
|
|
128
|
+
const known = new Set(view.messages.map((message) => message.id));
|
|
129
|
+
const missing = held.filter((message) => !known.has(message.id));
|
|
126
130
|
if (missing.length === 0 && !view.messages.some((message) => over.has(message.id)))
|
|
127
131
|
return view;
|
|
128
132
|
const messages = view.messages.map((message) => over.get(message.id) ?? message);
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
watchHead2,
|
|
4
4
|
watchHost2,
|
|
5
5
|
withUnsent2
|
|
6
|
-
} from "./capability-
|
|
6
|
+
} from "./capability-ctnsbfx9.js";
|
|
7
7
|
import {
|
|
8
8
|
createLink2,
|
|
9
9
|
createRows2
|
|
10
10
|
} from "./capability-artgq59v.js";
|
|
11
11
|
import {
|
|
12
12
|
journalLoop2
|
|
13
|
-
} from "./capability-
|
|
13
|
+
} from "./capability-ke5yk1as.js";
|
|
14
14
|
import {
|
|
15
15
|
partHandle2
|
|
16
16
|
} from "./capability-9747w1b1.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
} from "./capability-nh422cp0.js";
|
|
26
26
|
import {
|
|
27
27
|
workspaceHandle2
|
|
28
|
-
} from "./capability-
|
|
28
|
+
} from "./capability-xavf3m2f.js";
|
|
29
29
|
|
|
30
30
|
// src/client.ts
|
|
31
31
|
import { asId, isJson, SdkError } from "@nyte-ai/schema";
|
|
@@ -87,6 +87,7 @@ function createClient2(transport, context) {
|
|
|
87
87
|
await rows.call("models.refresh", { provider });
|
|
88
88
|
},
|
|
89
89
|
setDefault: (ref) => rows.call("models.setDefault", { ref }),
|
|
90
|
+
setListing: (refs, listing) => rows.call("models.setListing", { refs, listing }),
|
|
90
91
|
verify: (provider) => rows.call("models.verify", { provider }),
|
|
91
92
|
login: (input) => loginHandle2(rows, async () => {
|
|
92
93
|
await rows.call("models.login", input);
|
|
@@ -176,8 +177,7 @@ function headHandle(bound, session, head) {
|
|
|
176
177
|
async view(options) {
|
|
177
178
|
const view = await rows.call("head.view", { session, head, options });
|
|
178
179
|
journal.landed(session, head, view);
|
|
179
|
-
|
|
180
|
-
return withUnsent2(view, journal.unsent(session, head), (id) => ids.has(id));
|
|
180
|
+
return withUnsent2(view, journal.unsent(session, head));
|
|
181
181
|
},
|
|
182
182
|
watch: (options) => watchHead2(bound.views, journal, { session, head, options }),
|
|
183
183
|
...watchStore(() => watchHead2(bound.views, journal, { session, head })),
|
|
@@ -125,8 +125,12 @@ function journalLoop2(rows, journal) {
|
|
|
125
125
|
},
|
|
126
126
|
landed(session, head, view) {
|
|
127
127
|
const key = JSON.stringify([session, head]);
|
|
128
|
-
const ids = new Set(view.messages.map((message) => message.id));
|
|
129
128
|
shown.set(key, Math.max(shown.get(key) ?? 0, view.seq));
|
|
129
|
+
if (held.size === 0)
|
|
130
|
+
return;
|
|
131
|
+
const ids = new Set(view.messages.map((message) => message.id));
|
|
132
|
+
if (view.leadingPrompt !== null)
|
|
133
|
+
ids.add(view.leadingPrompt.id);
|
|
130
134
|
for (const [receipt, current] of held) {
|
|
131
135
|
const { answered, answeredAfter, entry } = current;
|
|
132
136
|
if (answered === null || entry.session !== session || entry.head !== head || !ids.has(answered) && answeredAfter !== null && view.seq <= answeredAfter)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/paint-spans.ts
|
|
2
|
+
import { followedTrace, startSpan, tracing } from "@nyte-ai/core";
|
|
3
|
+
import { mapped } from "@nyte-ai/protocol";
|
|
4
|
+
function tracePaints2(views, session, painted) {
|
|
5
|
+
if (!tracing.enabled)
|
|
6
|
+
return views;
|
|
7
|
+
return {
|
|
8
|
+
[Symbol.asyncIterator]() {
|
|
9
|
+
let shown = null;
|
|
10
|
+
return mapped(views, (view) => {
|
|
11
|
+
if (view.messages === shown)
|
|
12
|
+
return view;
|
|
13
|
+
const known = shown === null ? null : new Set(shown.map((message) => message.id));
|
|
14
|
+
const followed = followedTrace(session);
|
|
15
|
+
for (const message of view.messages) {
|
|
16
|
+
if (known === null ? message.id !== followed : known.has(message.id))
|
|
17
|
+
continue;
|
|
18
|
+
const user = message.kind === "user";
|
|
19
|
+
const ended = startSpan("client.paint", user ? message.id : followed, {
|
|
20
|
+
session,
|
|
21
|
+
kind: user ? "user" : message.partKind
|
|
22
|
+
});
|
|
23
|
+
painted().then(() => ended());
|
|
24
|
+
}
|
|
25
|
+
shown = view.messages;
|
|
26
|
+
return view;
|
|
27
|
+
})[Symbol.asyncIterator]();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { tracePaints2 };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pushed2
|
|
3
|
+
} from "./capability-ctnsbfx9.js";
|
|
4
|
+
|
|
5
|
+
// src/history.ts
|
|
6
|
+
function pagedViews2(head, options) {
|
|
7
|
+
let pages = [];
|
|
8
|
+
let turns = [];
|
|
9
|
+
let leadingPrompt = null;
|
|
10
|
+
let latest = null;
|
|
11
|
+
let shown = null;
|
|
12
|
+
let push = null;
|
|
13
|
+
let loading = null;
|
|
14
|
+
let exhausted = null;
|
|
15
|
+
const show = (view) => {
|
|
16
|
+
const first = view.messages[0];
|
|
17
|
+
const moved = first === undefined || first.id !== latest?.messages[0]?.id;
|
|
18
|
+
const previous = moved || latest === null || shown === null ? null : { view: latest, shown };
|
|
19
|
+
if (moved) {
|
|
20
|
+
const before = shown?.messages ?? [];
|
|
21
|
+
const kept = first === undefined ? -1 : before.findIndex((message) => message.id === first.id);
|
|
22
|
+
pages = kept < 0 ? [] : before.slice(0, kept);
|
|
23
|
+
leadingPrompt = shown?.leadingPrompt ?? null;
|
|
24
|
+
const paged = new Set(pages.map((message) => message.turn));
|
|
25
|
+
turns = (shown?.turns ?? []).filter((turn) => paged.has(turn.id));
|
|
26
|
+
}
|
|
27
|
+
if (view.leadingPrompt !== null && view.leadingPrompt.id === leadingPrompt?.id)
|
|
28
|
+
leadingPrompt = view.leadingPrompt;
|
|
29
|
+
latest = view;
|
|
30
|
+
shown = pages.length === 0 ? view : withPages(view, { pages, turns, leadingPrompt }, previous);
|
|
31
|
+
push?.(shown);
|
|
32
|
+
};
|
|
33
|
+
const load = async (limit) => {
|
|
34
|
+
const oldest = shown?.messages[0];
|
|
35
|
+
if (oldest === undefined || oldest.id === exhausted)
|
|
36
|
+
return 0;
|
|
37
|
+
const page = await head.history({ before: oldest.id, limit });
|
|
38
|
+
const current = latest;
|
|
39
|
+
if (page.messages.length === 0) {
|
|
40
|
+
exhausted = oldest.id;
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
if (current === null || shown?.messages[0]?.id !== oldest.id)
|
|
44
|
+
return 0;
|
|
45
|
+
const known = new Set(turns.map((turn) => turn.id));
|
|
46
|
+
pages = [...page.messages, ...pages];
|
|
47
|
+
turns = [...page.turns.filter((turn) => !known.has(turn.id)), ...turns];
|
|
48
|
+
leadingPrompt = page.leadingPrompt;
|
|
49
|
+
shown = withPages(current, { pages, turns, leadingPrompt }, null);
|
|
50
|
+
push?.(shown);
|
|
51
|
+
return page.messages.length;
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
[Symbol.asyncIterator]: () => pushed2((sink) => {
|
|
55
|
+
const views = head.watch(options)[Symbol.asyncIterator]();
|
|
56
|
+
push = (view) => sink.next(view);
|
|
57
|
+
(async () => {
|
|
58
|
+
try {
|
|
59
|
+
for (;; ) {
|
|
60
|
+
const next = await views.next();
|
|
61
|
+
if (next.done === true)
|
|
62
|
+
break;
|
|
63
|
+
show(next.value);
|
|
64
|
+
}
|
|
65
|
+
sink.end();
|
|
66
|
+
} catch (error) {
|
|
67
|
+
sink.fail(error instanceof Error ? error : new Error(String(error)));
|
|
68
|
+
}
|
|
69
|
+
})();
|
|
70
|
+
return () => {
|
|
71
|
+
push = null;
|
|
72
|
+
views.return?.();
|
|
73
|
+
};
|
|
74
|
+
})[Symbol.asyncIterator](),
|
|
75
|
+
earlier(limit) {
|
|
76
|
+
loading ??= load(limit).finally(() => {
|
|
77
|
+
loading = null;
|
|
78
|
+
});
|
|
79
|
+
return loading;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function withPages(view, paged, previous) {
|
|
84
|
+
return {
|
|
85
|
+
...view,
|
|
86
|
+
messages: previous?.view.messages === view.messages ? previous.shown.messages : [...paged.pages, ...view.messages],
|
|
87
|
+
leadingPrompt: paged.leadingPrompt,
|
|
88
|
+
turns: previous?.view.turns === view.turns ? previous.shown.turns : pagedTurns(paged.turns, view.turns)
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function pagedTurns(paged, own) {
|
|
92
|
+
const ids = new Set(own.map((turn) => turn.id));
|
|
93
|
+
return [...paged.filter((turn) => !ids.has(turn.id)), ...own];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { pagedViews2 };
|
|
@@ -34,8 +34,8 @@ function workspaceHandle2(rows, workspace) {
|
|
|
34
34
|
reload: () => rows.call("workspace.reload", { workspace }),
|
|
35
35
|
jobs: jobsApi(rows, workspace),
|
|
36
36
|
job: (id) => jobHandle(rows, workspace, id, null),
|
|
37
|
-
changes: (
|
|
38
|
-
patches: (
|
|
37
|
+
changes: (source) => rows.call("workspace.changes", { workspace, source }),
|
|
38
|
+
patches: (source, paths, options) => mapped(rows.frames("workspace.patches", { workspace, source, paths, options }), patchSet),
|
|
39
39
|
files: async () => resolveCapability2(await rows.call("workspace.files", { workspace }), () => filesApi(rows, workspace)),
|
|
40
40
|
git: async () => resolveCapability2(await rows.call("workspace.git", { workspace }), () => gitApi(rows, workspace)),
|
|
41
41
|
github: async () => resolveCapability2(await rows.call("workspace.github", { workspace }), () => githubApi(rows, workspace)),
|
|
@@ -43,7 +43,7 @@ function workspaceHandle2(rows, workspace) {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function filesApi(rows, workspace) {
|
|
46
|
-
const upload = (source) => rows.upload("files.upload", { workspace },
|
|
46
|
+
const upload = async (source) => rows.upload("files.upload", { workspace }, await collectBytes(source, rows.link.signal));
|
|
47
47
|
const plan = (pending) => ({
|
|
48
48
|
put: (input) => plan([...pending, { kind: "put", ...input }]),
|
|
49
49
|
remove: (input) => plan([...pending, { kind: "remove", ...input }]),
|
|
@@ -208,20 +208,33 @@ function mapped(source, map) {
|
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
async function collectBytes(source, signal) {
|
|
212
|
+
signal.throwIfAborted();
|
|
212
213
|
const iterator = source[Symbol.asyncIterator]();
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
const closed = Promise.withResolvers();
|
|
215
|
+
const abort = () => {
|
|
216
|
+
closed.reject(signal.reason);
|
|
217
|
+
iterator.return?.();
|
|
218
|
+
};
|
|
219
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
220
|
+
const chunks = [];
|
|
221
|
+
try {
|
|
222
|
+
for (;; ) {
|
|
223
|
+
const next = await Promise.race([iterator.next(), closed.promise]);
|
|
216
224
|
if (next.done === true)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
controller.enqueue(next.value);
|
|
220
|
-
},
|
|
221
|
-
async cancel() {
|
|
222
|
-
await iterator.return?.();
|
|
225
|
+
break;
|
|
226
|
+
chunks.push(next.value);
|
|
223
227
|
}
|
|
224
|
-
}
|
|
228
|
+
} finally {
|
|
229
|
+
signal.removeEventListener("abort", abort);
|
|
230
|
+
}
|
|
231
|
+
const joined = new Uint8Array(chunks.reduce((size, chunk) => size + chunk.byteLength, 0));
|
|
232
|
+
let offset = 0;
|
|
233
|
+
for (const chunk of chunks) {
|
|
234
|
+
joined.set(chunk, offset);
|
|
235
|
+
offset += chunk.byteLength;
|
|
236
|
+
}
|
|
237
|
+
return joined;
|
|
225
238
|
}
|
|
226
239
|
async function* once(bytes) {
|
|
227
240
|
yield bytes;
|
package/dist/src/client.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ type ClientContext = {
|
|
|
7
7
|
readonly credential: CredentialSource;
|
|
8
8
|
readonly journal: RequestJournal;
|
|
9
9
|
readonly journaled: readonly JournalEntry[];
|
|
10
|
-
/** The `connection.watch` that connecting read the host's first view from, left open for the first host watch to continue. */
|
|
11
10
|
readonly hostFrames?: AsyncIterator<Json>;
|
|
12
11
|
};
|
|
13
12
|
export declare function createClient(transport: Transport, context: ClientContext): Connection;
|
package/dist/src/client.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient2
|
|
3
|
-
} from "../chunks/capability-
|
|
3
|
+
} from "../chunks/capability-ec663cyt.js";
|
|
4
4
|
import"../chunks/capability-9747w1b1.js";
|
|
5
|
-
import"../chunks/capability-
|
|
5
|
+
import"../chunks/capability-xavf3m2f.js";
|
|
6
6
|
import"../chunks/capability-nh422cp0.js";
|
|
7
7
|
import"../chunks/capability-2q3s96kg.js";
|
|
8
8
|
import"../chunks/capability-mr5m2wn2.js";
|
|
9
|
-
import"../chunks/capability-
|
|
10
|
-
import"../chunks/capability-
|
|
9
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
10
|
+
import"../chunks/capability-ke5yk1as.js";
|
|
11
11
|
import"../chunks/capability-artgq59v.js";
|
|
12
12
|
export {
|
|
13
13
|
createClient2 as createClient
|
package/dist/src/connect.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect2
|
|
3
|
-
} from "../chunks/capability-
|
|
4
|
-
import"../chunks/capability-
|
|
3
|
+
} from "../chunks/capability-agj3gwwv.js";
|
|
4
|
+
import"../chunks/capability-ec663cyt.js";
|
|
5
5
|
import"../chunks/capability-9747w1b1.js";
|
|
6
|
-
import"../chunks/capability-
|
|
6
|
+
import"../chunks/capability-xavf3m2f.js";
|
|
7
7
|
import"../chunks/capability-nh422cp0.js";
|
|
8
8
|
import"../chunks/capability-2q3s96kg.js";
|
|
9
9
|
import"../chunks/capability-mr5m2wn2.js";
|
|
10
|
-
import"../chunks/capability-
|
|
11
|
-
import"../chunks/capability-
|
|
10
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
11
|
+
import"../chunks/capability-ke5yk1as.js";
|
|
12
12
|
import"../chunks/capability-artgq59v.js";
|
|
13
13
|
export {
|
|
14
14
|
connect2 as connect
|
package/dist/src/history.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { SessionView, ViewOptions } from "@nyte-ai/schema";
|
|
2
2
|
import type { Head } from "@nyte-ai/core";
|
|
3
|
-
/** A head's views with its older messages paged in on demand: each view's `messages` are the pages `earlier` loaded, then the messages the watch carries,
|
|
3
|
+
/** A head's views with its older messages paged in on demand: each view's `messages` are the pages `earlier` loaded, then the messages the watch carries, its `turns` the pages' turns before the watch's, and its `leadingPrompt` the prompt of the turn its first message belongs to when that prompt is not among its messages. A view whose messages and turns are the ones the view before it carried keeps that view's arrays. Iterate it once. */
|
|
4
4
|
export interface PagedViews extends AsyncIterable<SessionView> {
|
|
5
|
-
/** Loads up to `limit` messages before the oldest one shown into the views, and resolves how many came: 0 once the head's first message is shown. A call while one loads waits for that one. */
|
|
5
|
+
/** Loads up to `limit` messages before the oldest one shown into the views, and resolves how many came: 0 once the head's first message is shown, asking the host only the first time. A call while one loads waits for that one. */
|
|
6
6
|
earlier(limit: number): Promise<number>;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
@@ -11,4 +11,4 @@ export interface PagedViews extends AsyncIterable<SessionView> {
|
|
|
11
11
|
* leave the watch's window stay; a view whose first message was never shown
|
|
12
12
|
* (the head moved, or the window jumped past the pages) drops the pages.
|
|
13
13
|
*/
|
|
14
|
-
export declare function pagedViews(head: Head, options?: ViewOptions): PagedViews;
|
|
14
|
+
export declare function pagedViews(head: Pick<Head, "watch" | "history">, options?: ViewOptions): PagedViews;
|
package/dist/src/history.js
CHANGED
package/dist/src/index.client.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import"../chunks/capability-
|
|
1
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
2
2
|
import"../chunks/capability-artgq59v.js";
|
|
3
3
|
import {
|
|
4
4
|
createSendJournal2
|
|
5
|
-
} from "../chunks/capability-
|
|
5
|
+
} from "../chunks/capability-ke5yk1as.js";
|
|
6
6
|
import"../chunks/capability-9747w1b1.js";
|
|
7
7
|
import"../chunks/capability-2q3s96kg.js";
|
|
8
8
|
import"../chunks/capability-nh422cp0.js";
|
|
9
9
|
import"../chunks/capability-mr5m2wn2.js";
|
|
10
|
-
import"../chunks/capability-
|
|
11
|
-
import"../chunks/capability-
|
|
10
|
+
import"../chunks/capability-xavf3m2f.js";
|
|
11
|
+
import"../chunks/capability-ec663cyt.js";
|
|
12
12
|
import {
|
|
13
13
|
connect2
|
|
14
|
-
} from "../chunks/capability-
|
|
14
|
+
} from "../chunks/capability-agj3gwwv.js";
|
|
15
15
|
import {
|
|
16
16
|
pagedViews2
|
|
17
|
-
} from "../chunks/capability-
|
|
17
|
+
} from "../chunks/capability-t9k5jy3d.js";
|
|
18
18
|
import {
|
|
19
19
|
tracePaints2
|
|
20
|
-
} from "../chunks/capability-
|
|
20
|
+
} from "../chunks/capability-swbs68d8.js";
|
|
21
21
|
import {
|
|
22
22
|
dev2,
|
|
23
23
|
watchStore2,
|
package/dist/src/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import"../chunks/capability-
|
|
1
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
2
2
|
import"../chunks/capability-artgq59v.js";
|
|
3
3
|
import {
|
|
4
4
|
createSendJournal2
|
|
5
|
-
} from "../chunks/capability-
|
|
5
|
+
} from "../chunks/capability-ke5yk1as.js";
|
|
6
6
|
import"../chunks/capability-9747w1b1.js";
|
|
7
7
|
import"../chunks/capability-2q3s96kg.js";
|
|
8
8
|
import"../chunks/capability-nh422cp0.js";
|
|
9
9
|
import"../chunks/capability-mr5m2wn2.js";
|
|
10
|
-
import"../chunks/capability-
|
|
11
|
-
import"../chunks/capability-
|
|
10
|
+
import"../chunks/capability-xavf3m2f.js";
|
|
11
|
+
import"../chunks/capability-ec663cyt.js";
|
|
12
12
|
import {
|
|
13
13
|
connect2
|
|
14
|
-
} from "../chunks/capability-
|
|
14
|
+
} from "../chunks/capability-agj3gwwv.js";
|
|
15
15
|
import {
|
|
16
16
|
pagedViews2
|
|
17
|
-
} from "../chunks/capability-
|
|
17
|
+
} from "../chunks/capability-t9k5jy3d.js";
|
|
18
18
|
import {
|
|
19
19
|
tracePaints2
|
|
20
|
-
} from "../chunks/capability-
|
|
20
|
+
} from "../chunks/capability-swbs68d8.js";
|
|
21
21
|
import {
|
|
22
22
|
dev2,
|
|
23
23
|
watchStore2,
|
package/dist/src/index.web.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import"../chunks/capability-
|
|
1
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
2
2
|
import"../chunks/capability-artgq59v.js";
|
|
3
3
|
import {
|
|
4
4
|
createSendJournal2
|
|
5
|
-
} from "../chunks/capability-
|
|
5
|
+
} from "../chunks/capability-ke5yk1as.js";
|
|
6
6
|
import"../chunks/capability-9747w1b1.js";
|
|
7
7
|
import"../chunks/capability-2q3s96kg.js";
|
|
8
8
|
import"../chunks/capability-nh422cp0.js";
|
|
9
9
|
import"../chunks/capability-mr5m2wn2.js";
|
|
10
|
-
import"../chunks/capability-
|
|
11
|
-
import"../chunks/capability-
|
|
10
|
+
import"../chunks/capability-xavf3m2f.js";
|
|
11
|
+
import"../chunks/capability-ec663cyt.js";
|
|
12
12
|
import {
|
|
13
13
|
connect2
|
|
14
|
-
} from "../chunks/capability-
|
|
14
|
+
} from "../chunks/capability-agj3gwwv.js";
|
|
15
15
|
import {
|
|
16
16
|
pagedViews2
|
|
17
|
-
} from "../chunks/capability-
|
|
17
|
+
} from "../chunks/capability-t9k5jy3d.js";
|
|
18
18
|
import {
|
|
19
19
|
tracePaints2
|
|
20
|
-
} from "../chunks/capability-
|
|
20
|
+
} from "../chunks/capability-swbs68d8.js";
|
|
21
21
|
import {
|
|
22
22
|
dev2,
|
|
23
23
|
watchStore2,
|
package/dist/src/journal.js
CHANGED
package/dist/src/paint-spans.js
CHANGED
package/dist/src/rows.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export interface Rows {
|
|
|
23
23
|
operations(): string | null;
|
|
24
24
|
call<N extends CallName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<OperationOutput<N>>;
|
|
25
25
|
wait<N extends RetryName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<OperationOutput<N>>;
|
|
26
|
-
upload<N extends CallName>(name: N, input: OperationInput<N>, body: Uint8Array
|
|
26
|
+
upload<N extends CallName>(name: N, input: OperationInput<N>, body: Uint8Array): Promise<OperationOutput<N>>;
|
|
27
27
|
bytes<N extends ByteName>(name: N, input: OperationInput<N>, options?: RequestOptions): Promise<ByteReader>;
|
|
28
28
|
frames<N extends FrameName>(name: N, input: OperationInput<N>): AsyncIterable<OperationOutput<N>>;
|
|
29
29
|
/** Frames that resume across link losses; `opened` is a stream of this watch already open, read before any is opened. */
|
package/dist/src/surface.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { ActionContext, ActionOutput, ActionSchemas, Agent, Available, BrowserApi, ClientApi, Command, ConnectOptions, Connection, ContributionTable, Decide, Declared, Durable, EnvironmentProvider, EnvironmentWrap, ExecutionEnv, FileBatch, FilesApi, GitApi, GitHubAccountApi, GitHubApi, Head, HookEntry, HookHandler, HookName, HookTable, Host, Job, Jobs, Keybinding, ListenOptions, Listener, Login, McpApi, ModelContextPolicy, ModelsApi, ObjectStore, Observe, OpenOptions, Page, Part, PartActions, PartDefinition, PartState, Plugin, PluginApi, PluginFile, PluginsApi, PluginStorage, PrincipalsApi, PromptSection, Receipt, RefStore, Registries, Registry, RegistryDraft, Renderer, RequestJournal, Resources, Row, Run, SendReceipt, Session, Sessions, Setting, SettingDefinition, SettingsApi, Side, SideTable, Skill, SnapshotsApi, Store, StoreConnection, ToolDefinition, ToolInvocation, Transform, Workspace, Workspaces, } from "@nyte-ai/core";
|
|
2
|
-
export type { ActOutcome, Activation, AddOutcome, AdvanceReport, AgentInfo, Authority, Availability, Awaitable, BackgroundItem, BatchOutcome, BlameView, BlobId, ByteReader, CallId, Capability, CatalogGeneration, ChangeSet, CommandCompletion, CommandInfo, CommandOutcome, CommitBody, CommitId, CompactionPlan, Configuration, ConfigurationPatch, ConfigureOutcome, ConsoleEntry, ContextView, CreateHeadOutcome, CredentialSource, Cursor, Decision, Declaration, DecodedObjectView, Delivery, DiffOptions, Disposer, DocumentRevision, DurableEvent, EndReason, EnvironmentIdentity, ExcerptSource, Execution, Failure, ExecutionCoverage, FileDocument, FileEntryView, FileEvent, FileStatus, FileVersion, ForgetOutcome, FormatOutcome, GitCommitId, GitOutcome, GitRefsView, GitRevision, GitScope, GitStatus, GitWrite, GitHubAccount, GitHubAccountState, GitHubCheck, GitHubDeviceCode, GitHubPullRequest, GitHubPullRequestContext, GitHubPullRequestInput, GitHubPullRequestOutcome, GitHubRepository, GitHubState, HeadInfo, HeadName, HostDescription, HostId, HostView, Hunk, Id, IdentityChallenge, Infer, IntegrityReport, JobEnd, JobId, JobKey, JobState, JobView, JournalEntry, Json, LineStat, LoginMethod, McpChange, McpExposure, McpExposureName, McpOAuthConfig, McpScope, McpServerConfig, McpServerState, McpServerView, McpToolView, McpView, MergeOutcome, Message, MessageId, MessageSource, ModelAccount, ModelCatalogView, ModelInfo, ModelRef, ModelRequest, ModelRequestInput, ModelRequestOutcome, MoveOptions, MoveOutcome, ObjectId, OutputFrame, Owned, PageId, PageOutcome, PageSnapshot, PageView, Paged, ParentFilter, PartId, PartStatus, PartView, PatchEntry, PatchEvent, PatchSet, Placement, PluginCheckReport, PluginLoadOutcome, PluginReplacementReport, Position, PrincipalId, PrincipalView, PromptOverride, ProviderUsage, ReceiptId, Ref, RefUpdate, RemoveHeadOutcome, RemoveSessionOutcome, RepairPage, RequestOptions, Revision, RunEnd, RunId, RunView, ScanFrame, Schedule, SdkErrorCode, Schema, SearchFrame, SearchInput, SendOptions, Seq, SessionCatalogView, SessionEvent, SessionId, SessionInfo, SessionView, SetOutcome, SettingInfo, SettingOutcome, SkillInfo, SnapshotId, StopOutcome, Submission, SubmitDraft, Thinking, ToolCall, ToolClass, ToolContent, ToolInfo, ToolOutcome, ToolPartState, ToolProgress, ToolResult, Transcript, TreeNode, TreeView, TurnId, TurnInfo, UpdateOutcome, Usage, UserContent, UserStatus, ValidationIssue, ViewOptions, WaitOutcome, WaitTarget, WorkspaceCatalogView, WorkspaceCommandOutcome, WorkspaceId, WorkspaceInfo, WorkspaceInspection, WorkspaceTarget, WriteOutcome, } from "@nyte-ai/schema";
|
|
1
|
+
export type { ActionContext, ActionOutput, ActionSchemas, Agent, Available, BrowserApi, ClientApi, Command, ConnectOptions, Connection, ContributionTable, Decide, Declared, Durable, EnvironmentProvider, EnvironmentWrap, ExecutionEnv, FileBatch, FilesApi, ForegroundJobs, GitApi, GitHubAccountApi, GitHubApi, Head, HookEntry, HookHandler, HookName, HookTable, Host, Job, Jobs, Keybinding, ListenOptions, Listener, Login, McpApi, ModelContextPolicy, ModelsApi, ObjectStore, Observe, OpenOptions, Page, Part, PartActions, PartDefinition, PartState, Plugin, PluginApi, PluginFile, PluginsApi, PluginStorage, PrincipalsApi, PromptSection, Receipt, RefStore, Registries, Registry, RegistryDraft, Renderer, RequestJournal, Resources, Row, Run, SendReceipt, Session, Sessions, Setting, SettingDefinition, SettingsApi, Side, SideTable, Skill, SnapshotsApi, Store, StoreConnection, ToolDefinition, ToolInvocation, Transform, Workspace, Workspaces, } from "@nyte-ai/core";
|
|
2
|
+
export type { ActOutcome, Activation, AddOutcome, AdvanceReport, AgentInfo, Authority, Availability, Awaitable, BackgroundItem, BatchOutcome, BlameView, BlobId, ByteReader, CallId, Capability, CatalogGeneration, ChangeSet, ChangeSource, CommandCompletion, CommandInfo, CommandOutcome, CommitBody, CommitId, CompactionPlan, Configuration, ConfigurationPatch, ConfigureOutcome, ConsoleEntry, ContextView, CreateHeadOutcome, CredentialSource, Cursor, Decision, Declaration, DecodedObjectView, Delivery, DiffOptions, Disposer, DocumentRevision, DurableEvent, EndReason, EnvironmentIdentity, ExcerptSource, Execution, Failure, ExecutionCoverage, FileDocument, FileEntryView, FileEvent, FileStatus, FileVersion, ForgetOutcome, FormatOutcome, GitCommitId, GitOutcome, GitRefsView, GitRevision, GitScope, GitStatus, GitWrite, GitHubAccount, GitHubAccountState, GitHubCheck, GitHubDeviceCode, GitHubPullRequest, GitHubPullRequestContext, GitHubPullRequestInput, GitHubPullRequestOutcome, GitHubRepository, GitHubState, HeadInfo, HeadName, HostDescription, HostId, HostView, Hunk, Id, IdentityChallenge, Infer, IntegrityReport, JobEnd, JobId, JobKey, JobState, JobView, JournalEntry, Json, LineStat, LoginMethod, McpChange, McpExposure, McpExposureName, McpOAuthConfig, McpScope, McpServerConfig, McpServerState, McpServerView, McpToolView, McpView, MergeOutcome, Message, MessageId, MessageSource, ModelAccount, ModelCatalogView, ModelInfo, ModelListing, ModelRef, ModelRequest, ModelRequestInput, ModelRequestOutcome, MoveOptions, MoveOutcome, ObjectId, OutputFrame, Owned, PageId, PageOutcome, PageSnapshot, PageView, Paged, ParentFilter, PartId, PartStatus, PartView, PatchEntry, PatchEvent, PatchSet, Placement, PluginCheckReport, PluginLoadOutcome, PluginReplacementReport, Position, PrincipalId, PrincipalView, PromptOverride, ProviderUsage, ReceiptId, Ref, RefUpdate, RemoveHeadOutcome, RemoveSessionOutcome, RepairPage, RequestOptions, Revision, RunEnd, RunId, RunView, ScanFrame, Schedule, SdkErrorCode, Schema, SearchFrame, SearchInput, SendOptions, Seq, SessionCatalogView, SessionEvent, SessionId, SessionInfo, SessionView, SetOutcome, SettingInfo, SettingOutcome, SkillInfo, SnapshotId, StopOutcome, Submission, SubmitDraft, Thinking, ToolCall, ToolClass, ToolContent, ToolInfo, ToolOutcome, ToolPartState, ToolProgress, ToolResult, Transcript, TreeNode, TreeView, TurnId, TurnInfo, UpdateOutcome, Usage, UserContent, UserStatus, ValidationIssue, ViewOptions, WaitOutcome, WaitTarget, WorkspaceCatalogView, WorkspaceCommandOutcome, WorkspaceId, WorkspaceInfo, WorkspaceInspection, WorkspaceTarget, WriteOutcome, } from "@nyte-ai/schema";
|
|
3
3
|
export { dev, watchStore } from "@nyte-ai/core";
|
|
4
4
|
export type { WatchStore } from "@nyte-ai/core";
|
|
5
5
|
export { clearSpans, enableTracing, followTrace, followedTrace, readSpans, SPAN_NAMES, startSpan, traced, tracing, } from "@nyte-ai/core";
|
package/dist/src/surface.js
CHANGED
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
} from "../chunks/capability-b52hty54.js";
|
|
16
16
|
import {
|
|
17
17
|
tracePaints2
|
|
18
|
-
} from "../chunks/capability-
|
|
18
|
+
} from "../chunks/capability-swbs68d8.js";
|
|
19
19
|
import {
|
|
20
20
|
pagedViews2
|
|
21
|
-
} from "../chunks/capability-
|
|
22
|
-
import"../chunks/capability-
|
|
21
|
+
} from "../chunks/capability-t9k5jy3d.js";
|
|
22
|
+
import"../chunks/capability-ctnsbfx9.js";
|
|
23
23
|
export {
|
|
24
24
|
SPAN_NAMES2 as SPAN_NAMES,
|
|
25
25
|
SdkError2 as SdkError,
|
package/dist/src/watch.d.ts
CHANGED
|
@@ -10,21 +10,17 @@ interface ViewHold {
|
|
|
10
10
|
view(): SessionView | null;
|
|
11
11
|
subscribe(sink: Sink<SessionView>): Disposer;
|
|
12
12
|
}
|
|
13
|
-
/** Returns the client's open `head.watch`es, one per head and tail, each closed when its last watcher leaves. */
|
|
14
13
|
export interface HeadViews {
|
|
15
14
|
acquire(session: SessionId, head: HeadName, options?: ViewOptions): ViewHold;
|
|
16
15
|
}
|
|
17
|
-
/** Returns the head watches of one client over `rows`: a hold applies the host's frames in order, a reconnect starting again from the whole view the host sends. */
|
|
18
16
|
export declare function createHeadViews(rows: Rows): HeadViews;
|
|
19
|
-
/** Returns a head's views from its shared hold, each with the journal's unsent messages for the head merged in. */
|
|
20
17
|
export declare function watchHead(views: HeadViews, journal: JournalLoop, input: {
|
|
21
18
|
readonly session: SessionId;
|
|
22
19
|
readonly head: HeadName;
|
|
23
20
|
readonly options?: ViewOptions;
|
|
24
21
|
}): AsyncIterable<SessionView>;
|
|
25
|
-
/** Returns the host's views, continuing `opened` when connecting left its `connection.watch` open. */
|
|
26
22
|
export declare function watchHost(rows: Rows, opened?: AsyncIterator<Json>): AsyncIterable<HostView>;
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
/** Returns `view` with the sends the journal still holds: one the view carries replaces its message there, one it does not carry joins its messages, and one that is the view's `leadingPrompt` is left to it. */
|
|
24
|
+
export declare function withUnsent(view: SessionView, unsent: readonly Message[]): SessionView;
|
|
29
25
|
export declare function pushed<T>(start: (sink: Sink<T>) => () => void): AsyncIterable<T>;
|
|
30
26
|
export {};
|
package/dist/src/watch.js
CHANGED
package/dist/src/workspace.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyte-ai/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"provenance": true
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@nyte-ai/core": "0.0.
|
|
43
|
-
"@nyte-ai/host": "0.0.
|
|
44
|
-
"@nyte-ai/protocol": "0.0.
|
|
45
|
-
"@nyte-ai/schema": "0.0.
|
|
42
|
+
"@nyte-ai/core": "0.0.21",
|
|
43
|
+
"@nyte-ai/host": "0.0.21",
|
|
44
|
+
"@nyte-ai/protocol": "0.0.21",
|
|
45
|
+
"@nyte-ai/schema": "0.0.21"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@nyte-ai/bench": "0.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"clean": "rm -rf node_modules .turbo",
|
|
58
|
-
"typecheck": "
|
|
58
|
+
"typecheck": "tsrs --noEmit && tsrs --noEmit -p tsconfig.web.json",
|
|
59
59
|
"test": "vitest --run",
|
|
60
60
|
"build:package": "bun ../../scripts/sdk-packages.mjs build sdk"
|
|
61
61
|
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
pushed2
|
|
3
|
-
} from "./capability-8hmez9nw.js";
|
|
4
|
-
|
|
5
|
-
// src/history.ts
|
|
6
|
-
function pagedViews2(head, options) {
|
|
7
|
-
let pages = [];
|
|
8
|
-
let turns = [];
|
|
9
|
-
let latest = null;
|
|
10
|
-
let shown = null;
|
|
11
|
-
let push = null;
|
|
12
|
-
let loading = null;
|
|
13
|
-
const show = (view) => {
|
|
14
|
-
const first = view.messages[0];
|
|
15
|
-
const before = shown?.messages ?? [];
|
|
16
|
-
const kept = first === undefined ? -1 : before.findIndex((message) => message.id === first.id);
|
|
17
|
-
pages = kept < 0 ? [] : before.slice(0, kept);
|
|
18
|
-
const paged = new Set(pages.map((message) => message.turn));
|
|
19
|
-
turns = (shown?.turns ?? []).filter((turn) => paged.has(turn.id));
|
|
20
|
-
latest = view;
|
|
21
|
-
shown = pages.length === 0 ? view : withPages(view, pages, turns);
|
|
22
|
-
push?.(shown);
|
|
23
|
-
};
|
|
24
|
-
const load = async (limit) => {
|
|
25
|
-
const oldest = shown?.messages[0];
|
|
26
|
-
if (oldest === undefined)
|
|
27
|
-
return 0;
|
|
28
|
-
const page = await head.history({ before: oldest.id, limit });
|
|
29
|
-
const current = latest;
|
|
30
|
-
if (page.messages.length === 0 || current === null || shown?.messages[0]?.id !== oldest.id)
|
|
31
|
-
return 0;
|
|
32
|
-
const known = new Set(turns.map((turn) => turn.id));
|
|
33
|
-
pages = [...page.messages, ...pages];
|
|
34
|
-
turns = [...page.turns.filter((turn) => !known.has(turn.id)), ...turns];
|
|
35
|
-
shown = withPages(current, pages, turns);
|
|
36
|
-
push?.(shown);
|
|
37
|
-
return page.messages.length;
|
|
38
|
-
};
|
|
39
|
-
return {
|
|
40
|
-
[Symbol.asyncIterator]: () => pushed2((sink) => {
|
|
41
|
-
const views = head.watch(options)[Symbol.asyncIterator]();
|
|
42
|
-
push = (view) => sink.next(view);
|
|
43
|
-
(async () => {
|
|
44
|
-
try {
|
|
45
|
-
for (;; ) {
|
|
46
|
-
const next = await views.next();
|
|
47
|
-
if (next.done === true)
|
|
48
|
-
break;
|
|
49
|
-
show(next.value);
|
|
50
|
-
}
|
|
51
|
-
sink.end();
|
|
52
|
-
} catch (error) {
|
|
53
|
-
sink.fail(error instanceof Error ? error : new Error(String(error)));
|
|
54
|
-
}
|
|
55
|
-
})();
|
|
56
|
-
return () => {
|
|
57
|
-
push = null;
|
|
58
|
-
views.return?.();
|
|
59
|
-
};
|
|
60
|
-
})[Symbol.asyncIterator](),
|
|
61
|
-
earlier(limit) {
|
|
62
|
-
loading ??= load(limit).finally(() => {
|
|
63
|
-
loading = null;
|
|
64
|
-
});
|
|
65
|
-
return loading;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function withPages(view, pages, turns) {
|
|
70
|
-
const own = new Set(view.turns.map((turn) => turn.id));
|
|
71
|
-
return {
|
|
72
|
-
...view,
|
|
73
|
-
messages: [...pages, ...view.messages],
|
|
74
|
-
turns: [...turns.filter((turn) => !own.has(turn.id)), ...view.turns]
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export { pagedViews2 };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// src/paint-spans.ts
|
|
2
|
-
import { followedTrace, startSpan, tracing } from "@nyte-ai/core";
|
|
3
|
-
function tracePaints2(views, session, painted) {
|
|
4
|
-
return tracing.enabled ? timed(views, session, painted) : views;
|
|
5
|
-
}
|
|
6
|
-
async function* timed(views, session, painted) {
|
|
7
|
-
let shown = null;
|
|
8
|
-
for await (const view of views) {
|
|
9
|
-
const ids = new Set(view.messages.map((message) => message.id));
|
|
10
|
-
const followed = followedTrace(session);
|
|
11
|
-
for (const message of view.messages) {
|
|
12
|
-
if (shown === null ? message.id !== followed : shown.has(message.id))
|
|
13
|
-
continue;
|
|
14
|
-
const user = message.kind === "user";
|
|
15
|
-
const ended = startSpan("client.paint", user ? message.id : followed, {
|
|
16
|
-
session,
|
|
17
|
-
kind: user ? "user" : message.partKind
|
|
18
|
-
});
|
|
19
|
-
painted().then(() => ended());
|
|
20
|
-
}
|
|
21
|
-
shown = ids;
|
|
22
|
-
yield view;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { tracePaints2 };
|