@nyte-ai/sdk 0.0.0-stage → 0.0.18

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.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD-PARTY-NOTICES.md +800 -0
  3. package/dist/chunks/capability-2q3s96kg.js +57 -0
  4. package/dist/chunks/capability-2wk9ktc5.js +161 -0
  5. package/dist/chunks/capability-3qe1hz8t.js +78 -0
  6. package/dist/chunks/capability-591c8vr1.js +134 -0
  7. package/dist/chunks/capability-8hmez9nw.js +199 -0
  8. package/dist/chunks/capability-9747w1b1.js +55 -0
  9. package/dist/chunks/capability-artgq59v.js +232 -0
  10. package/dist/chunks/capability-b52hty54.js +17 -0
  11. package/dist/chunks/capability-cdz2rz6h.js +208 -0
  12. package/dist/chunks/capability-esdwn315.js +26 -0
  13. package/dist/chunks/capability-mr5m2wn2.js +6 -0
  14. package/dist/chunks/capability-nh422cp0.js +35 -0
  15. package/dist/chunks/capability-y1amted3.js +230 -0
  16. package/dist/src/capability.d.ts +2 -0
  17. package/dist/src/capability.js +6 -0
  18. package/dist/src/client.d.ts +14 -0
  19. package/dist/src/client.js +14 -0
  20. package/dist/src/connect.d.ts +2 -0
  21. package/dist/src/connect.js +15 -0
  22. package/dist/src/history.d.ts +14 -0
  23. package/dist/src/history.js +7 -0
  24. package/dist/src/index.client.d.ts +10 -0
  25. package/dist/src/index.client.js +57 -0
  26. package/dist/src/index.d.ts +9 -0
  27. package/dist/src/index.js +58 -0
  28. package/dist/src/index.web.d.ts +8 -0
  29. package/dist/src/index.web.js +63 -0
  30. package/dist/src/journal.d.ts +15 -0
  31. package/dist/src/journal.js +9 -0
  32. package/dist/src/login.d.ts +8 -0
  33. package/dist/src/login.js +6 -0
  34. package/dist/src/paint-spans.d.ts +11 -0
  35. package/dist/src/paint-spans.js +6 -0
  36. package/dist/src/part.d.ts +4 -0
  37. package/dist/src/part.js +6 -0
  38. package/dist/src/receipts.d.ts +9 -0
  39. package/dist/src/receipts.js +16 -0
  40. package/dist/src/rows.d.ts +37 -0
  41. package/dist/src/rows.js +12 -0
  42. package/dist/src/surface.d.ts +12 -0
  43. package/dist/src/surface.js +39 -0
  44. package/dist/src/watch.d.ts +30 -0
  45. package/dist/src/watch.js +14 -0
  46. package/dist/src/workspace.d.ts +4 -0
  47. package/dist/src/workspace.js +9 -0
  48. package/package.json +59 -3
  49. package/README.md +0 -3
@@ -0,0 +1,230 @@
1
+ import {
2
+ resolveCapability2
3
+ } from "./capability-mr5m2wn2.js";
4
+ import {
5
+ loginHandle2
6
+ } from "./capability-nh422cp0.js";
7
+ import {
8
+ receiptHandle2,
9
+ batchOutcome2
10
+ } from "./capability-2q3s96kg.js";
11
+
12
+ // src/workspace.ts
13
+ import { asId, foldJobChange } from "@nyte-ai/schema";
14
+ import { closable } from "@nyte-ai/core";
15
+ var encoder = new TextEncoder;
16
+ function workspaceHandle2(rows, workspace) {
17
+ return {
18
+ id: workspace,
19
+ info: () => rows.call("workspace.info", { workspace }),
20
+ watch: () => rows.watch("workspace.watch", { workspace }),
21
+ catalog: () => rows.call("workspace.catalog", { workspace }),
22
+ command: (name, text) => rows.call("workspace.command", { workspace, name, text }),
23
+ completeCommand: (name, prefix) => rows.call("workspace.completeCommand", { workspace, name, prefix }),
24
+ mcp: {
25
+ watch: () => rows.watch("mcp.watch", { workspace }),
26
+ reconnect: (server) => rows.call("mcp.reconnect", { workspace, server }),
27
+ setEnabled: (server, enabled) => rows.call("mcp.setEnabled", { workspace, server, enabled }),
28
+ login: (server) => loginHandle2(rows, async () => (await rows.call("mcp.login", { workspace, server })).login, null),
29
+ logout: (server) => rows.call("mcp.logout", { workspace, server }),
30
+ add: (server, config, scope) => rows.call("mcp.add", { workspace, server, config, scope }),
31
+ remove: (server, scope) => rows.call("mcp.remove", { workspace, server, scope })
32
+ },
33
+ update: (patch) => rows.call("workspace.update", { workspace, patch }),
34
+ reload: () => rows.call("workspace.reload", { workspace }),
35
+ jobs: jobsApi(rows, workspace),
36
+ job: (id) => jobHandle(rows, workspace, id, null),
37
+ changes: (run) => rows.call("workspace.changes", { workspace, run }),
38
+ patches: (run, paths, options) => mapped(rows.frames("workspace.patches", { workspace, run, paths, options }), patchSet),
39
+ files: async () => resolveCapability2(await rows.call("workspace.files", { workspace }), () => filesApi(rows, workspace)),
40
+ git: async () => resolveCapability2(await rows.call("workspace.git", { workspace }), () => gitApi(rows, workspace)),
41
+ github: async () => resolveCapability2(await rows.call("workspace.github", { workspace }), () => githubApi(rows, workspace)),
42
+ browser: async () => resolveCapability2(await rows.call("workspace.browser", { workspace }), () => browserApi(rows, workspace))
43
+ };
44
+ }
45
+ function filesApi(rows, workspace) {
46
+ const upload = (source) => rows.upload("files.upload", { workspace }, streamBytes(source));
47
+ const plan = (pending) => ({
48
+ put: (input) => plan([...pending, { kind: "put", ...input }]),
49
+ remove: (input) => plan([...pending, { kind: "remove", ...input }]),
50
+ async apply() {
51
+ const entries = await Promise.all(pending.map(async (entry) => {
52
+ if (entry.kind === "remove")
53
+ return entry;
54
+ const { contents, ...rest } = entry;
55
+ return {
56
+ ...rest,
57
+ contents: typeof contents === "string" || !(contents instanceof Uint8Array) ? contents : { blob: await upload(once(contents)) }
58
+ };
59
+ }));
60
+ const { receipt } = await rows.call("files.batch", {
61
+ workspace,
62
+ entries,
63
+ id: asId(crypto.randomUUID())
64
+ });
65
+ return receiptHandle2(rows, null, receipt, batchOutcome2);
66
+ }
67
+ });
68
+ return {
69
+ read: (path) => rows.call("files.read", { workspace, path }),
70
+ bytes: (path) => rows.bytes("files.bytes", { workspace, path }),
71
+ stat: (path) => rows.call("files.stat", { workspace, path }),
72
+ write: (path, contents, options) => rows.upload("files.write", { workspace, path, options }, typeof contents === "string" ? encoder.encode(contents) : contents),
73
+ remove: (path, options) => rows.call("files.remove", { workspace, path, options }),
74
+ batch: () => plan([]),
75
+ format: (path, contents) => rows.call("files.format", { workspace, path, contents }),
76
+ scan: (input) => rows.frames("files.scan", { workspace, ...input }),
77
+ find: (input) => rows.call("files.find", { workspace, ...input }),
78
+ search: (input) => rows.frames("files.search", { workspace, ...input }),
79
+ watch: (input) => rows.watch("files.watch", { workspace, ...input }),
80
+ upload
81
+ };
82
+ }
83
+ function githubApi(rows, workspace) {
84
+ return {
85
+ state: () => rows.call("github.state", { workspace }),
86
+ createPullRequest: (input) => rows.call("github.createPullRequest", { workspace, input })
87
+ };
88
+ }
89
+ function gitApi(rows, workspace) {
90
+ return {
91
+ status: () => rows.call("git.status", { workspace }),
92
+ watch: () => rows.watch("git.watch", { workspace }),
93
+ changes: (scope, options) => rows.call("git.changes", { workspace, scope, options }),
94
+ watchChanges: (scope, options) => rows.watch("git.watchChanges", { workspace, scope, options }),
95
+ patches: (scope, paths, options) => mapped(rows.frames("git.patches", { workspace, scope, paths, options }), patchSet),
96
+ contents: (path, scope) => rows.call("git.contents", { workspace, path, scope }),
97
+ log: (input) => rows.call("git.log", { workspace, ...input }),
98
+ refs: () => rows.call("git.refs", { workspace }),
99
+ blame: (path) => rows.call("git.blame", { workspace, path }),
100
+ stage: (paths, options) => rows.call("git.stage", { workspace, paths, options }),
101
+ unstage: (paths, options) => rows.call("git.unstage", { workspace, paths, options }),
102
+ discard: (paths, options) => rows.call("git.discard", { workspace, paths, options }),
103
+ commit: (input, options) => rows.call("git.commit", { workspace, input, options }),
104
+ branch: (input, options) => rows.call("git.branch", { workspace, input, options }),
105
+ push: (input, options) => rows.call("git.push", { workspace, input, options })
106
+ };
107
+ }
108
+ function browserApi(rows, workspace) {
109
+ return {
110
+ open: async ({ url }) => pageHandle(rows, workspace, (await rows.call("browser.open", { workspace, url, id: crypto.randomUUID() })).id),
111
+ adopt: async (id) => pageHandle(rows, workspace, (await rows.call("browser.adopt", { workspace, id })).id),
112
+ list: () => rows.call("browser.list", { workspace }),
113
+ watch: () => rows.watch("browser.watch", { workspace })
114
+ };
115
+ }
116
+ function pageHandle(rows, workspace, page) {
117
+ const close = async () => {
118
+ await rows.call("page.close", { workspace, page });
119
+ };
120
+ return {
121
+ id: page,
122
+ view: () => rows.call("page.view", { workspace, page }),
123
+ watch: () => rows.watch("page.watch", { workspace, page }),
124
+ snapshot: (input) => rows.call("page.snapshot", { workspace, page, ...input }),
125
+ navigate: (url) => rows.call("page.navigate", { workspace, page, url }),
126
+ back: () => rows.call("page.back", { workspace, page }),
127
+ forward: () => rows.call("page.forward", { workspace, page }),
128
+ reload: () => rows.call("page.reload", { workspace, page }),
129
+ stopLoading: () => rows.call("page.stopLoading", { workspace, page }),
130
+ click: (input) => rows.call("page.click", { workspace, page, ...input }),
131
+ type: (input) => rows.call("page.type", { workspace, page, ...input }),
132
+ press: (input) => rows.call("page.press", { workspace, page, ...input }),
133
+ scroll: (input) => rows.call("page.scroll", { workspace, page, ...input }),
134
+ wait: (condition) => rows.call("page.wait", { workspace, page, condition }),
135
+ console: (input) => rows.call("page.console", { workspace, page, ...input }),
136
+ capture: () => rows.bytes("page.capture", { workspace, page }),
137
+ evaluate: (expression, options) => rows.call("page.evaluate", { workspace, page, expression, options }),
138
+ close,
139
+ [Symbol.asyncDispose]: close
140
+ };
141
+ }
142
+ function jobsApi(rows, workspace) {
143
+ return {
144
+ async start(input) {
145
+ const view = await rows.call("jobs.start", { workspace, ...input });
146
+ return jobHandle(rows, workspace, view.id, view.key);
147
+ },
148
+ async recover(key) {
149
+ const recovered = await rows.call("jobs.recover", { workspace, key });
150
+ return "id" in recovered ? jobHandle(rows, workspace, recovered.id, recovered.key) : recovered;
151
+ },
152
+ list: () => rows.call("jobs.list", { workspace }),
153
+ watch: () => foldJobs(rows.watch("jobs.watch", { workspace }))
154
+ };
155
+ }
156
+ async function* foldJobs(changes) {
157
+ let jobs = [];
158
+ for await (const change of changes) {
159
+ jobs = foldJobChange(jobs, change);
160
+ yield jobs;
161
+ }
162
+ }
163
+ function jobHandle(rows, workspace, job, key) {
164
+ const readers = new Set;
165
+ const close = async () => {
166
+ await Promise.all([...readers].map((detach) => detach()));
167
+ };
168
+ return {
169
+ id: job,
170
+ key,
171
+ async write(bytes) {
172
+ await rows.upload("job.write", { workspace, job }, bytes);
173
+ },
174
+ output: () => closable(() => {
175
+ const frames = rows.output({ workspace, job })[Symbol.asyncIterator]();
176
+ const detach = async () => {
177
+ readers.delete(detach);
178
+ await frames.return?.();
179
+ };
180
+ readers.add(detach);
181
+ return { pull: () => frames.next(), close: detach };
182
+ }),
183
+ resize: (size) => rows.call("job.resize", { workspace, job, size }),
184
+ idle: () => rows.call("job.idle", { workspace, job }),
185
+ stop: () => rows.call("job.stop", { workspace, job }),
186
+ settled: (options) => rows.wait("job.settled", { workspace, job }, options),
187
+ close,
188
+ [Symbol.asyncDispose]: close
189
+ };
190
+ }
191
+ function patchSet(wire) {
192
+ return { revision: wire.revision, entries: new Map(Object.entries(wire.entries)) };
193
+ }
194
+ function mapped(source, map) {
195
+ return {
196
+ [Symbol.asyncIterator]() {
197
+ const iterator = source[Symbol.asyncIterator]();
198
+ return {
199
+ async next() {
200
+ const next = await iterator.next();
201
+ return next.done === true ? { done: true, value: undefined } : { done: false, value: map(next.value) };
202
+ },
203
+ async return() {
204
+ await iterator.return?.();
205
+ return { done: true, value: undefined };
206
+ }
207
+ };
208
+ }
209
+ };
210
+ }
211
+ function streamBytes(source) {
212
+ const iterator = source[Symbol.asyncIterator]();
213
+ return new ReadableStream({
214
+ async pull(controller) {
215
+ const next = await iterator.next();
216
+ if (next.done === true)
217
+ controller.close();
218
+ else
219
+ controller.enqueue(next.value);
220
+ },
221
+ async cancel() {
222
+ await iterator.return?.();
223
+ }
224
+ });
225
+ }
226
+ async function* once(bytes) {
227
+ yield bytes;
228
+ }
229
+
230
+ export { workspaceHandle2 };
@@ -0,0 +1,2 @@
1
+ import type { Capability, CapabilityWire } from "@nyte-ai/schema";
2
+ export declare function resolveCapability<T>(wire: CapabilityWire, bind: () => T): Capability<T>;
@@ -0,0 +1,6 @@
1
+ import {
2
+ resolveCapability2
3
+ } from "../chunks/capability-mr5m2wn2.js";
4
+ export {
5
+ resolveCapability2 as resolveCapability
6
+ };
@@ -0,0 +1,14 @@
1
+ import type { CredentialSource, HostId, JournalEntry, Json, PrincipalId } from "@nyte-ai/schema";
2
+ import type { Connection, RequestJournal } from "@nyte-ai/core";
3
+ import type { Transport } from "@nyte-ai/protocol";
4
+ type ClientContext = {
5
+ readonly hostId: HostId;
6
+ readonly principal: PrincipalId;
7
+ readonly credential: CredentialSource;
8
+ readonly journal: RequestJournal;
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
+ readonly hostFrames?: AsyncIterator<Json>;
12
+ };
13
+ export declare function createClient(transport: Transport, context: ClientContext): Connection;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import {
2
+ createClient2
3
+ } from "../chunks/capability-cdz2rz6h.js";
4
+ import"../chunks/capability-9747w1b1.js";
5
+ import"../chunks/capability-y1amted3.js";
6
+ import"../chunks/capability-nh422cp0.js";
7
+ import"../chunks/capability-2q3s96kg.js";
8
+ import"../chunks/capability-mr5m2wn2.js";
9
+ import"../chunks/capability-8hmez9nw.js";
10
+ import"../chunks/capability-2wk9ktc5.js";
11
+ import"../chunks/capability-artgq59v.js";
12
+ export {
13
+ createClient2 as createClient
14
+ };
@@ -0,0 +1,2 @@
1
+ import type { ConnectOptions, Connection } from "@nyte-ai/core";
2
+ export declare function connect(options: ConnectOptions): Promise<Connection>;
@@ -0,0 +1,15 @@
1
+ import {
2
+ connect2
3
+ } from "../chunks/capability-591c8vr1.js";
4
+ import"../chunks/capability-cdz2rz6h.js";
5
+ import"../chunks/capability-9747w1b1.js";
6
+ import"../chunks/capability-y1amted3.js";
7
+ import"../chunks/capability-nh422cp0.js";
8
+ import"../chunks/capability-2q3s96kg.js";
9
+ import"../chunks/capability-mr5m2wn2.js";
10
+ import"../chunks/capability-8hmez9nw.js";
11
+ import"../chunks/capability-2wk9ktc5.js";
12
+ import"../chunks/capability-artgq59v.js";
13
+ export {
14
+ connect2 as connect
15
+ };
@@ -0,0 +1,14 @@
1
+ import type { SessionView, ViewOptions } from "@nyte-ai/schema";
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, and its `turns` the pages' turns before the watch's. Iterate it once. */
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. */
6
+ earlier(limit: number): Promise<number>;
7
+ }
8
+ /**
9
+ * Returns `head`'s views, older messages paged in through `head.history`. A
10
+ * view keeps every message shown before its own first one, so messages that
11
+ * leave the watch's window stay; a view whose first message was never shown
12
+ * (the head moved, or the window jumped past the pages) drops the pages.
13
+ */
14
+ export declare function pagedViews(head: Head, options?: ViewOptions): PagedViews;
@@ -0,0 +1,7 @@
1
+ import {
2
+ pagedViews2
3
+ } from "../chunks/capability-3qe1hz8t.js";
4
+ import"../chunks/capability-8hmez9nw.js";
5
+ export {
6
+ pagedViews2 as pagedViews
7
+ };
@@ -0,0 +1,10 @@
1
+ import { connect } from "./connect.ts";
2
+ export { createSendJournal } from "./journal.ts";
3
+ export * from "./surface.ts";
4
+ /**
5
+ * The SDK for a client of a host in another process: `connect` without `open`, so
6
+ * importing it never loads the host, its models or its store.
7
+ */
8
+ export declare const sdk: {
9
+ connect: typeof connect;
10
+ };
@@ -0,0 +1,57 @@
1
+ import"../chunks/capability-8hmez9nw.js";
2
+ import"../chunks/capability-artgq59v.js";
3
+ import {
4
+ createSendJournal2
5
+ } from "../chunks/capability-2wk9ktc5.js";
6
+ import"../chunks/capability-9747w1b1.js";
7
+ import"../chunks/capability-2q3s96kg.js";
8
+ import"../chunks/capability-nh422cp0.js";
9
+ import"../chunks/capability-mr5m2wn2.js";
10
+ import"../chunks/capability-y1amted3.js";
11
+ import"../chunks/capability-cdz2rz6h.js";
12
+ import {
13
+ connect2
14
+ } from "../chunks/capability-591c8vr1.js";
15
+ import {
16
+ pagedViews2
17
+ } from "../chunks/capability-3qe1hz8t.js";
18
+ import {
19
+ tracePaints2
20
+ } from "../chunks/capability-esdwn315.js";
21
+ import {
22
+ dev2,
23
+ watchStore2,
24
+ clearSpans2,
25
+ enableTracing2,
26
+ followTrace2,
27
+ followedTrace2,
28
+ readSpans2,
29
+ SPAN_NAMES2,
30
+ startSpan2,
31
+ traced2,
32
+ tracing2,
33
+ SdkError2,
34
+ operationsDigest2
35
+ } from "../chunks/capability-b52hty54.js";
36
+
37
+ // src/index.client.ts
38
+ var sdk = { connect: connect2 };
39
+ export {
40
+ SPAN_NAMES2 as SPAN_NAMES,
41
+ SdkError2 as SdkError,
42
+ clearSpans2 as clearSpans,
43
+ createSendJournal2 as createSendJournal,
44
+ dev2 as dev,
45
+ enableTracing2 as enableTracing,
46
+ followTrace2 as followTrace,
47
+ followedTrace2 as followedTrace,
48
+ operationsDigest2 as operationsDigest,
49
+ pagedViews2 as pagedViews,
50
+ readSpans2 as readSpans,
51
+ sdk,
52
+ startSpan2 as startSpan,
53
+ tracePaints2 as tracePaints,
54
+ traced2 as traced,
55
+ tracing2 as tracing,
56
+ watchStore2 as watchStore
57
+ };
@@ -0,0 +1,9 @@
1
+ import { openHost } from "@nyte-ai/host";
2
+ import { connect } from "./connect.ts";
3
+ export type { OpenHostOptions } from "@nyte-ai/host";
4
+ export { createSendJournal } from "./journal.ts";
5
+ export * from "./surface.ts";
6
+ export declare const sdk: {
7
+ open: typeof openHost;
8
+ connect: typeof connect;
9
+ };
@@ -0,0 +1,58 @@
1
+ import"../chunks/capability-8hmez9nw.js";
2
+ import"../chunks/capability-artgq59v.js";
3
+ import {
4
+ createSendJournal2
5
+ } from "../chunks/capability-2wk9ktc5.js";
6
+ import"../chunks/capability-9747w1b1.js";
7
+ import"../chunks/capability-2q3s96kg.js";
8
+ import"../chunks/capability-nh422cp0.js";
9
+ import"../chunks/capability-mr5m2wn2.js";
10
+ import"../chunks/capability-y1amted3.js";
11
+ import"../chunks/capability-cdz2rz6h.js";
12
+ import {
13
+ connect2
14
+ } from "../chunks/capability-591c8vr1.js";
15
+ import {
16
+ pagedViews2
17
+ } from "../chunks/capability-3qe1hz8t.js";
18
+ import {
19
+ tracePaints2
20
+ } from "../chunks/capability-esdwn315.js";
21
+ import {
22
+ dev2,
23
+ watchStore2,
24
+ clearSpans2,
25
+ enableTracing2,
26
+ followTrace2,
27
+ followedTrace2,
28
+ readSpans2,
29
+ SPAN_NAMES2,
30
+ startSpan2,
31
+ traced2,
32
+ tracing2,
33
+ SdkError2,
34
+ operationsDigest2
35
+ } from "../chunks/capability-b52hty54.js";
36
+
37
+ // src/index.ts
38
+ import { openHost } from "@nyte-ai/host";
39
+ var sdk = { open: openHost, connect: connect2 };
40
+ export {
41
+ SPAN_NAMES2 as SPAN_NAMES,
42
+ SdkError2 as SdkError,
43
+ clearSpans2 as clearSpans,
44
+ createSendJournal2 as createSendJournal,
45
+ dev2 as dev,
46
+ enableTracing2 as enableTracing,
47
+ followTrace2 as followTrace,
48
+ followedTrace2 as followedTrace,
49
+ operationsDigest2 as operationsDigest,
50
+ pagedViews2 as pagedViews,
51
+ readSpans2 as readSpans,
52
+ sdk,
53
+ startSpan2 as startSpan,
54
+ tracePaints2 as tracePaints,
55
+ traced2 as traced,
56
+ tracing2 as tracing,
57
+ watchStore2 as watchStore
58
+ };
@@ -0,0 +1,8 @@
1
+ import type { Host, OpenOptions } from "@nyte-ai/core";
2
+ import { connect } from "./connect.ts";
3
+ export { createSendJournal } from "./journal.ts";
4
+ export * from "./surface.ts";
5
+ export declare const sdk: {
6
+ open: (_options: OpenOptions) => Promise<Host>;
7
+ connect: typeof connect;
8
+ };
@@ -0,0 +1,63 @@
1
+ import"../chunks/capability-8hmez9nw.js";
2
+ import"../chunks/capability-artgq59v.js";
3
+ import {
4
+ createSendJournal2
5
+ } from "../chunks/capability-2wk9ktc5.js";
6
+ import"../chunks/capability-9747w1b1.js";
7
+ import"../chunks/capability-2q3s96kg.js";
8
+ import"../chunks/capability-nh422cp0.js";
9
+ import"../chunks/capability-mr5m2wn2.js";
10
+ import"../chunks/capability-y1amted3.js";
11
+ import"../chunks/capability-cdz2rz6h.js";
12
+ import {
13
+ connect2
14
+ } from "../chunks/capability-591c8vr1.js";
15
+ import {
16
+ pagedViews2
17
+ } from "../chunks/capability-3qe1hz8t.js";
18
+ import {
19
+ tracePaints2
20
+ } from "../chunks/capability-esdwn315.js";
21
+ import {
22
+ dev2,
23
+ watchStore2,
24
+ clearSpans2,
25
+ enableTracing2,
26
+ followTrace2,
27
+ followedTrace2,
28
+ readSpans2,
29
+ SPAN_NAMES2,
30
+ startSpan2,
31
+ traced2,
32
+ tracing2,
33
+ SdkError2,
34
+ operationsDigest2
35
+ } from "../chunks/capability-b52hty54.js";
36
+
37
+ // src/index.web.ts
38
+ import { SdkError } from "@nyte-ai/schema";
39
+ var sdk = {
40
+ open: async (_options) => {
41
+ throw new SdkError("unavailable", "open needs a Node host.");
42
+ },
43
+ connect: connect2
44
+ };
45
+ export {
46
+ SPAN_NAMES2 as SPAN_NAMES,
47
+ SdkError2 as SdkError,
48
+ clearSpans2 as clearSpans,
49
+ createSendJournal2 as createSendJournal,
50
+ dev2 as dev,
51
+ enableTracing2 as enableTracing,
52
+ followTrace2 as followTrace,
53
+ followedTrace2 as followedTrace,
54
+ operationsDigest2 as operationsDigest,
55
+ pagedViews2 as pagedViews,
56
+ readSpans2 as readSpans,
57
+ sdk,
58
+ startSpan2 as startSpan,
59
+ tracePaints2 as tracePaints,
60
+ traced2 as traced,
61
+ tracing2 as tracing,
62
+ watchStore2 as watchStore
63
+ };
@@ -0,0 +1,15 @@
1
+ import type { Disposer, HeadName, JournalEntry, Message, SessionId, SessionView } from "@nyte-ai/schema";
2
+ import type { RequestJournal } from "@nyte-ai/core";
3
+ import type { OperationOutput } from "@nyte-ai/protocol";
4
+ import type { Rows } from "./rows.ts";
5
+ export interface JournalLoop {
6
+ send(entry: JournalEntry): Promise<Sent>;
7
+ replay(entries: readonly JournalEntry[]): void;
8
+ unsent(session: SessionId, head: HeadName): readonly Message[];
9
+ landed(session: SessionId, head: HeadName, view: SessionView): void;
10
+ subscribe(listener: () => void): Disposer;
11
+ }
12
+ type Sent = OperationOutput<"head.send">;
13
+ export declare function createSendJournal(): RequestJournal;
14
+ export declare function journalLoop(rows: Rows, journal: RequestJournal): JournalLoop;
15
+ export {};
@@ -0,0 +1,9 @@
1
+ import {
2
+ createSendJournal2,
3
+ journalLoop2
4
+ } from "../chunks/capability-2wk9ktc5.js";
5
+ import"../chunks/capability-artgq59v.js";
6
+ export {
7
+ createSendJournal2 as createSendJournal,
8
+ journalLoop2 as journalLoop
9
+ };
@@ -0,0 +1,8 @@
1
+ import type { Login } from "@nyte-ai/core";
2
+ import type { Rows } from "./rows.ts";
3
+ /**
4
+ * A login streamed over `login.steps`: `begin` starts it on the host and
5
+ * answers the key its steps and answers go by; `known` is that key when the
6
+ * caller knows it before starting.
7
+ */
8
+ export declare function loginHandle(rows: Rows, begin: () => Promise<string>, known: string | null): Login;
@@ -0,0 +1,6 @@
1
+ import {
2
+ loginHandle2
3
+ } from "../chunks/capability-nh422cp0.js";
4
+ export {
5
+ loginHandle2 as loginHandle
6
+ };
@@ -0,0 +1,11 @@
1
+ import type { SessionId, SessionView } from "@nyte-ai/schema";
2
+ /**
3
+ * Returns `views`, each message that arrives after the first view timed as a
4
+ * `client.paint` span from the view that brought it until `painted` resolves:
5
+ * the client's next painted frame. The first view's message that is the
6
+ * submit the session follows, a chat's first message started by this client,
7
+ * is timed too. A user message is its own submit's trace (its id is the
8
+ * receipt id); a part joins the submit the session last followed. With
9
+ * tracing off when called, returns `views` as they are.
10
+ */
11
+ export declare function tracePaints(views: AsyncIterable<SessionView>, session: SessionId, painted: () => Promise<void>): AsyncIterable<SessionView>;
@@ -0,0 +1,6 @@
1
+ import {
2
+ tracePaints2
3
+ } from "../chunks/capability-esdwn315.js";
4
+ export {
5
+ tracePaints2 as tracePaints
6
+ };
@@ -0,0 +1,4 @@
1
+ import type { PartId, SessionId } from "@nyte-ai/schema";
2
+ import type { Part, PartDefinition } from "@nyte-ai/core";
3
+ import type { Rows } from "./rows.ts";
4
+ export declare function partHandle<K extends PartDefinition>(rows: Rows, session: SessionId, id: PartId, kind: K | null): Part<K>;
@@ -0,0 +1,6 @@
1
+ import {
2
+ partHandle2
3
+ } from "../chunks/capability-9747w1b1.js";
4
+ export {
5
+ partHandle2 as partHandle
6
+ };
@@ -0,0 +1,9 @@
1
+ import type { BatchOutcome, Json, MessageId, MoveOutcome, ReceiptId, RunId, Schema, SessionId } from "@nyte-ai/schema";
2
+ import type { Receipt, Run, SendReceipt } from "@nyte-ai/core";
3
+ import type { Rows } from "./rows.ts";
4
+ export declare function receiptHandle<O>(rows: Rows, session: SessionId | null, id: ReceiptId, outcome: (value: Json) => O): Receipt<O>;
5
+ export declare function sendReceipt(rows: Rows, session: SessionId, id: ReceiptId, message: MessageId): SendReceipt;
6
+ export declare function runHandle(rows: Rows, session: SessionId, id: RunId): Run;
7
+ export declare function moveOutcome(value: Json): MoveOutcome;
8
+ export declare function batchOutcome(value: Json): BatchOutcome;
9
+ export declare function parsed<T>(schema: Schema<T>, value: unknown): T | null;
@@ -0,0 +1,16 @@
1
+ import {
2
+ receiptHandle2,
3
+ sendReceipt2,
4
+ runHandle2,
5
+ moveOutcome2,
6
+ batchOutcome2,
7
+ parsed2
8
+ } from "../chunks/capability-2q3s96kg.js";
9
+ export {
10
+ batchOutcome2 as batchOutcome,
11
+ moveOutcome2 as moveOutcome,
12
+ parsed2 as parsed,
13
+ receiptHandle2 as receiptHandle,
14
+ runHandle2 as runHandle,
15
+ sendReceipt2 as sendReceipt
16
+ };