@theoremjs/web 0.3.4-next.542.g59bcbcf → 0.3.4-next.548.gbb156b2
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/client/chat.d.ts +9 -1
- package/client/chat.js +3 -2
- package/client/index.d.ts +2 -2
- package/client/index.js +1 -1
- package/client/source-citations.js +1 -1
- package/client/trace-feed.d.ts +2 -0
- package/client/trace-feed.js +7 -0
- package/package.json +2 -2
package/client/chat.d.ts
CHANGED
|
@@ -59,9 +59,17 @@ export type ChatOptions = {
|
|
|
59
59
|
* (`sent`), reached the model (`delivered`), answered (`read`).
|
|
60
60
|
*/
|
|
61
61
|
export type MessageDelivery = 'sending' | 'sent' | 'delivered' | 'read';
|
|
62
|
+
/** One declared slot as the composer shows it (group label + choices with optional blurbs). */
|
|
63
|
+
export type ChatSlotDecl = {
|
|
64
|
+
label?: string;
|
|
65
|
+
choices: readonly {
|
|
66
|
+
value: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
}[];
|
|
69
|
+
};
|
|
62
70
|
/** The slots the profile declares, and the value of each: the page's, else the picked one, else the first allowed. */
|
|
63
71
|
export type ChatSlots = {
|
|
64
|
-
declared: Record<string,
|
|
72
|
+
declared: Record<string, ChatSlotDecl>;
|
|
65
73
|
values: Record<string, string>;
|
|
66
74
|
};
|
|
67
75
|
/** Everything a chat shows. A new object on each change, the same one between changes. */
|
package/client/chat.js
CHANGED
|
@@ -48,8 +48,9 @@ function withTurnError(blocks, error) {
|
|
|
48
48
|
function slotsOf(iface, fixed, picked) {
|
|
49
49
|
const declared = iface?.inputs.slots ?? {};
|
|
50
50
|
const values = { ...fixed };
|
|
51
|
-
for (const [name,
|
|
52
|
-
const
|
|
51
|
+
for (const [name, decl] of Object.entries(declared)) {
|
|
52
|
+
const first = decl.choices[0]?.value;
|
|
53
|
+
const value = fixed?.[name] ?? picked[name] ?? first;
|
|
53
54
|
if (value !== undefined)
|
|
54
55
|
values[name] = value;
|
|
55
56
|
}
|
package/client/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { float32Rms, float32RmsToLevel, INPUT_LEVEL_GAIN, timeDomainBytesToLevel, } from './audio-level.ts';
|
|
2
|
-
export { type ChatController, type ChatOptions, type ChatSlots, type ChatState, type ChatUpdate, createChatController, type MessageDelivery, type SentTurn, } from './chat.ts';
|
|
2
|
+
export { type ChatController, type ChatOptions, type ChatSlotDecl, type ChatSlots, type ChatState, type ChatUpdate, createChatController, type MessageDelivery, type SentTurn, } from './chat.ts';
|
|
3
3
|
export { type ComposerDrawerKind, type ComposerDrawerSummary, composerDrawerSummary, } from './composer-drawer.ts';
|
|
4
4
|
export { type ComposerHint, isStashShortcut, resolveComposerHint, STASH_SHORTCUT, } from './composer-hints.ts';
|
|
5
5
|
export { type ComposerActionState, composerActionState, composerHasPayload, } from './composer-primary.ts';
|
|
@@ -32,6 +32,6 @@ export { DOT_FLOATS, FRAME_SLOT, queryGeometry, SEGMENT_FLOATS, type SpaceGeomet
|
|
|
32
32
|
export { hasLead, layoutResult, type ResultChart, type ResultFigure, type ResultImage, type ResultLayout, type ResultMedia, returnedMedia, timeFormats, } from './tool-result.ts';
|
|
33
33
|
export type { AnsweringGate, ToolDecisionAction, ToolGateResolution, } from './tool-resume.ts';
|
|
34
34
|
export { continueGatedToolInvocation, type PersonGateResolution } from './tool-resume.ts';
|
|
35
|
-
export { createTraceFeed, type TraceFeed } from './trace-feed.ts';
|
|
35
|
+
export { createTraceFeed, recordedFeed, type TraceFeed } from './trace-feed.ts';
|
|
36
36
|
export { CHAT_LINES, type ChatLine, type ChatLineSink, type ClientTurnEvent, type ConversationLine, type ConversationView, createHttpTransport, fetchConversation, fetchRewound, fetchStarted, type HostErrorBody, type HttpOptions, type HttpTransportOptions, hostError, isTheoremStreamError, type MalformedEvent, postJson, postNdjson, readNdjsonStream, type TheoremConversationRequest, type TheoremInvokeRequest, type TheoremReplay, type TheoremRewindRequest, type TheoremRewound, type TheoremStartRequest, type TheoremSteerRequest, type TheoremStopRequest, TheoremStreamError, type TheoremTransport, type TheoremTurnInput, type TheoremTurnRequest, type TurnEventSink, type UnsupportedEvent, type WireLines, } from './transport.ts';
|
|
37
37
|
export { buildInvokeRequest, buildTurnRequest, foldAssistantTurn, issuedOperationId, type RunScope, type WalkAway, } from './turn-client.ts';
|
package/client/index.js
CHANGED
|
@@ -26,6 +26,6 @@ export { citationsFromBlock, } from "./source-citations.js";
|
|
|
26
26
|
export { DOT_FLOATS, FRAME_SLOT, queryGeometry, SEGMENT_FLOATS, spaceGeometry, } from "./space-geometry.js";
|
|
27
27
|
export { hasLead, layoutResult, returnedMedia, timeFormats, } from "./tool-result.js";
|
|
28
28
|
export { continueGatedToolInvocation } from "./tool-resume.js";
|
|
29
|
-
export { createTraceFeed } from "./trace-feed.js";
|
|
29
|
+
export { createTraceFeed, recordedFeed } from "./trace-feed.js";
|
|
30
30
|
export { CHAT_LINES, createHttpTransport, fetchConversation, fetchRewound, fetchStarted, hostError, isTheoremStreamError, postJson, postNdjson, readNdjsonStream, TheoremStreamError, } from "./transport.js";
|
|
31
31
|
export { buildInvokeRequest, buildTurnRequest, foldAssistantTurn, issuedOperationId, } from "./turn-client.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
const GROUNDING_REDIRECT_HOST = 'vertexaisearch.cloud.google.com';
|
|
6
6
|
/** A citation's sources, in the order they were cited. */
|
|
7
7
|
export function citationsFromBlock(block) {
|
|
8
|
-
return block.sources.map((source, i) => citationFromSource(source,
|
|
8
|
+
return block.sources.map((source, i) => citationFromSource(source, `${block.id}-c-${String(i)}`));
|
|
9
9
|
}
|
|
10
10
|
function citationFromSource(source, key) {
|
|
11
11
|
const url = webUrl(source.uri);
|
package/client/trace-feed.d.ts
CHANGED
|
@@ -11,3 +11,5 @@ export interface TraceFeed {
|
|
|
11
11
|
subscribe(listener: () => void): () => void;
|
|
12
12
|
}
|
|
13
13
|
export declare function createTraceFeed(): TraceFeed;
|
|
14
|
+
/** A feed already holding `records` — a recording opened for View Trace. */
|
|
15
|
+
export declare function recordedFeed(records: readonly TraceRecord[]): TraceFeed;
|
package/client/trace-feed.js
CHANGED
|
@@ -16,3 +16,10 @@ export function createTraceFeed() {
|
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
/** A feed already holding `records` — a recording opened for View Trace. */
|
|
20
|
+
export function recordedFeed(records) {
|
|
21
|
+
const feed = createTraceFeed();
|
|
22
|
+
for (const record of records)
|
|
23
|
+
feed.push(record);
|
|
24
|
+
return feed;
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/web",
|
|
3
|
-
"version": "0.3.4-next.
|
|
3
|
+
"version": "0.3.4-next.548.gbb156b2",
|
|
4
4
|
"description": "Theorem on the web platform, with no UI framework: Web-standard server handlers that serve a profile, and the browser client that talks to them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"zod": "^4.6.5",
|
|
28
|
-
"@theoremjs/agents": "^0.3.4-next.
|
|
28
|
+
"@theoremjs/agents": "^0.3.4-next.548.gbb156b2"
|
|
29
29
|
}
|
|
30
30
|
}
|