@theoremjs/web 0.3.4-next.711.g78e504a → 0.3.4-next.715.geef22fd
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/package.json +2 -2
- package/server/conversation.d.ts +5 -5
- package/server/conversation.js +3 -3
- package/server/handler.js +1 -1
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.715.geef22fd",
|
|
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.715.geef22fd"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/server/conversation.d.ts
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @module
|
|
16
16
|
*/
|
|
17
|
-
import { type GateReference, type LabelOverrides, type Profile, type ProviderCheckpoint, TheoremError, type
|
|
17
|
+
import { type GateReference, type LabelOverrides, type Profile, type ProviderCheckpoint, TheoremError, type TurnEvent, type TurnHistoryMessage, type TurnInput } from '@theoremjs/agents';
|
|
18
18
|
import { type ClientTurnOptions } from '@theoremjs/agents/host';
|
|
19
|
-
import { type ComposerProfileInterface, streamThoughtsEnabled, type TranscriptBlock, type UserTurnDraft, type UserTurnHistoryMedia } from '@theoremjs/agents/interface';
|
|
19
|
+
import { type ComposerProfileInterface, type ReplyCarried, streamThoughtsEnabled, type TranscriptBlock, type UserTurnDraft, type UserTurnHistoryMedia } from '@theoremjs/agents/interface';
|
|
20
20
|
import type { ConversationLine, ConversationView, StatedTurn, TheoremTurnInput } from '../client/transport.ts';
|
|
21
21
|
import { type StoredConversation, type TheoremConversationStore } from './conversation-store.ts';
|
|
22
22
|
/** One walked-away call: its id, and the run that settles it (`invokeTool` with the abandoned resume). */
|
|
@@ -120,8 +120,8 @@ export type ReplyTurn = {
|
|
|
120
120
|
model?: string;
|
|
121
121
|
effort?: string;
|
|
122
122
|
stated?: StatedTurn;
|
|
123
|
-
/** The tools the reply had when it paused, for a reply that goes on. */
|
|
124
|
-
|
|
123
|
+
/** The tools and steps the reply had when it paused, for a reply that goes on. */
|
|
124
|
+
carried?: ReplyCarried;
|
|
125
125
|
};
|
|
126
126
|
/** What a reply's model run takes from the host. */
|
|
127
127
|
export type ReplyRunner = {
|
|
@@ -135,7 +135,7 @@ export type ReplyRunner = {
|
|
|
135
135
|
model?: string;
|
|
136
136
|
effort?: string;
|
|
137
137
|
stated?: StatedTurn;
|
|
138
|
-
|
|
138
|
+
carried?: ReplyCarried;
|
|
139
139
|
signal: AbortSignal;
|
|
140
140
|
};
|
|
141
141
|
/** A line of a reply's stream: an event, or the ref of what the store wrote. */
|
package/server/conversation.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { attachmentsRefused, labelText, TheoremError, toErrorEvent, } from '@theoremjs/agents';
|
|
18
18
|
import { sanitizeTurnRequestWithEvents, withPublicLabels } from '@theoremjs/agents/guardrails';
|
|
19
19
|
import { forClient } from '@theoremjs/agents/host';
|
|
20
|
-
import { appendAssistantEventsToHistory, appendUserDraftToHistory, applyTurnEventsToSession, emptyInterfaceTurnSession, foldTurnEvents, gatedToolsFromEvents, historyFromTranscriptBlocks, prepareUserTurn,
|
|
20
|
+
import { appendAssistantEventsToHistory, appendUserDraftToHistory, applyTurnEventsToSession, emptyInterfaceTurnSession, foldTurnEvents, gatedToolsFromEvents, historyFromTranscriptBlocks, prepareUserTurn, replyCarriedFromEvents, settlesToolCall, streamThoughtsEnabled, } from '@theoremjs/agents/interface';
|
|
21
21
|
import { base64ToBytes } from '@theoremjs/agents/kernel';
|
|
22
22
|
import { stampWorked, stoppedReply } from "../client/run-commit.js";
|
|
23
23
|
import { emptyConversation, unknownConversation, } from "./conversation-store.js";
|
|
@@ -236,7 +236,7 @@ async function* runReply(host, opened, reply, runner, input, withMessage) {
|
|
|
236
236
|
model: runner.model,
|
|
237
237
|
effort: runner.effort,
|
|
238
238
|
...(runner.stated ? { stated: runner.stated } : {}),
|
|
239
|
-
...(runner.
|
|
239
|
+
...(runner.carried ? { carried: runner.carried } : {}),
|
|
240
240
|
});
|
|
241
241
|
for await (const event of events) {
|
|
242
242
|
reply.events.push(event);
|
|
@@ -493,7 +493,7 @@ export async function* answerReply(args) {
|
|
|
493
493
|
model: runner.model ?? paused.model,
|
|
494
494
|
effort: runner.effort ?? paused.effort,
|
|
495
495
|
...(paused.stated ? { stated: paused.stated } : {}),
|
|
496
|
-
|
|
496
|
+
carried: replyCarriedFromEvents(reply.events),
|
|
497
497
|
}, {
|
|
498
498
|
history: replyHistory(reply),
|
|
499
499
|
...(waiting.inputTokens === undefined ? {} : { inputTokens: waiting.inputTokens }),
|
package/server/handler.js
CHANGED
|
@@ -426,7 +426,7 @@ async function* chatTurn(ctx, request, session, turn, key, stop) {
|
|
|
426
426
|
host,
|
|
427
427
|
...(turn.model ? { model: turn.model } : {}),
|
|
428
428
|
...(turn.effort ? { effort: turn.effort } : {}),
|
|
429
|
-
...
|
|
429
|
+
...turn.carried,
|
|
430
430
|
...turn.stated,
|
|
431
431
|
}, {
|
|
432
432
|
credentials: sessionCredentials(ctx, session.id),
|