@theoremjs/react 0.0.0-stage → 0.3.1
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/LICENSE +21 -0
- package/README.md +772 -2
- package/client/attachment-hover-preview.d.ts +11 -0
- package/client/attachment-hover-preview.js +36 -0
- package/client/audio-level.d.ts +5 -0
- package/client/audio-level.js +24 -0
- package/client/composer-attachments.d.ts +30 -0
- package/client/composer-attachments.js +33 -0
- package/client/composer-drawer.d.ts +19 -0
- package/client/composer-drawer.js +15 -0
- package/client/composer-hints.d.ts +25 -0
- package/client/composer-hints.js +20 -0
- package/client/composer-primary.d.ts +16 -0
- package/client/composer-primary.js +25 -0
- package/client/decision-images.d.ts +76 -0
- package/client/decision-images.js +139 -0
- package/client/decision-transport.d.ts +70 -0
- package/client/decision-transport.js +175 -0
- package/client/decode-composer-draft.d.ts +11 -0
- package/client/decode-composer-draft.js +12 -0
- package/client/embedding-input.d.ts +84 -0
- package/client/embedding-input.js +194 -0
- package/client/embedding-space.d.ts +82 -0
- package/client/embedding-space.js +389 -0
- package/client/embedding-transport.d.ts +40 -0
- package/client/embedding-transport.js +71 -0
- package/client/encode-composer-draft.d.ts +9 -0
- package/client/encode-composer-draft.js +34 -0
- package/client/encode-files.d.ts +18 -0
- package/client/encode-files.js +54 -0
- package/client/failure.d.ts +29 -0
- package/client/failure.js +34 -0
- package/client/generation-selection.d.ts +15 -0
- package/client/generation-selection.js +24 -0
- package/client/host-call.d.ts +51 -0
- package/client/host-call.js +47 -0
- package/client/host-transport.d.ts +70 -0
- package/client/host-transport.js +75 -0
- package/client/image-output.d.ts +6 -0
- package/client/image-output.js +13 -0
- package/client/index.d.ts +28 -0
- package/client/index.js +22 -0
- package/client/ink-waveform.d.ts +17 -0
- package/client/ink-waveform.js +68 -0
- package/client/live/apply-live-turn-tool-event.d.ts +14 -0
- package/client/live/apply-live-turn-tool-event.js +39 -0
- package/client/live/live-captions.d.ts +53 -0
- package/client/live/live-captions.js +174 -0
- package/client/live/live-mic-forward.d.ts +30 -0
- package/client/live/live-mic-forward.js +46 -0
- package/client/live/live-page-tool.d.ts +34 -0
- package/client/live/live-page-tool.js +11 -0
- package/client/live/live-state.d.ts +13 -0
- package/client/live/live-state.js +22 -0
- package/client/live/live-tool.d.ts +11 -0
- package/client/live/live-tool.js +1 -0
- package/client/live/live-video.d.ts +10 -0
- package/client/live/live-video.js +71 -0
- package/client/live/run-live-tool-call.d.ts +22 -0
- package/client/live/run-live-tool-call.js +70 -0
- package/client/live/use-live-caption-log.d.ts +17 -0
- package/client/live/use-live-caption-log.js +51 -0
- package/client/live-client.d.ts +189 -0
- package/client/live-client.js +829 -0
- package/client/live-errors.d.ts +2 -0
- package/client/live-errors.js +9 -0
- package/client/live-messages.d.ts +148 -0
- package/client/live-messages.js +100 -0
- package/client/mic-capture.d.ts +4 -0
- package/client/mic-capture.js +6 -0
- package/client/oauth-popup.d.ts +26 -0
- package/client/oauth-popup.js +30 -0
- package/client/page-dispatch.d.ts +15 -0
- package/client/page-dispatch.js +63 -0
- package/client/pcm-downsample.d.ts +4 -0
- package/client/pcm-downsample.js +45 -0
- package/client/run-commit.d.ts +34 -0
- package/client/run-commit.js +49 -0
- package/client/run-session.d.ts +79 -0
- package/client/run-session.js +207 -0
- package/client/schema-fields.d.ts +63 -0
- package/client/schema-fields.js +199 -0
- package/client/shaped-data.d.ts +118 -0
- package/client/shaped-data.js +343 -0
- package/client/source-citations.d.ts +13 -0
- package/client/source-citations.js +56 -0
- package/client/space-geometry.d.ts +39 -0
- package/client/space-geometry.js +183 -0
- package/client/state-fields.d.ts +16 -0
- package/client/state-fields.js +44 -0
- package/client/tool-result.d.ts +78 -0
- package/client/tool-result.js +293 -0
- package/client/tool-resume.d.ts +50 -0
- package/client/tool-resume.js +14 -0
- package/client/trace-feed.d.ts +13 -0
- package/client/trace-feed.js +18 -0
- package/client/trace-story.d.ts +163 -0
- package/client/trace-story.js +440 -0
- package/client/trace-view.d.ts +130 -0
- package/client/trace-view.js +333 -0
- package/client/transcript-groups.d.ts +140 -0
- package/client/transcript-groups.js +217 -0
- package/client/transcript-schema.d.ts +10 -0
- package/client/transcript-schema.js +120 -0
- package/client/transcript-scroll.d.ts +7 -0
- package/client/transcript-scroll.js +6 -0
- package/client/transport.d.ts +264 -0
- package/client/transport.js +330 -0
- package/client/turn-client.d.ts +44 -0
- package/client/turn-client.js +88 -0
- package/client/voice-label.d.ts +2 -0
- package/client/voice-label.js +15 -0
- package/client/voice-recorder.d.ts +27 -0
- package/client/voice-recorder.js +162 -0
- package/client/wire-line.d.ts +56 -0
- package/client/wire-line.js +90 -0
- package/client/worklets/mic-capture.js +16 -0
- package/components/InkWaveform.d.ts +21 -0
- package/components/InkWaveform.js +131 -0
- package/components/live/use-live-runner-controls.d.ts +47 -0
- package/components/live/use-live-runner-controls.js +96 -0
- package/components/live/use-live-runner-model.d.ts +49 -0
- package/components/live/use-live-runner-model.js +190 -0
- package/components/live/use-live-runner-ui.d.ts +67 -0
- package/components/live/use-live-runner-ui.js +167 -0
- package/components/live/use-live-session-client.d.ts +41 -0
- package/components/live/use-live-session-client.js +126 -0
- package/components/use-composer-voice.d.ts +28 -0
- package/components/use-composer-voice.js +90 -0
- package/components/use-editor-selection.d.ts +3 -0
- package/components/use-editor-selection.js +19 -0
- package/components/use-voice-playback.d.ts +17 -0
- package/components/use-voice-playback.js +68 -0
- package/hooks/use-described.d.ts +12 -0
- package/hooks/use-described.js +25 -0
- package/hooks/use-embedding-index.d.ts +27 -0
- package/hooks/use-embedding-index.js +43 -0
- package/hooks/use-one-call.d.ts +31 -0
- package/hooks/use-one-call.js +76 -0
- package/hooks/use-page-tool-warnings.d.ts +6 -0
- package/hooks/use-page-tool-warnings.js +25 -0
- package/hooks/use-second-ticker.d.ts +2 -0
- package/hooks/use-second-ticker.js +13 -0
- package/hooks/use-theorem-chat-actions.d.ts +79 -0
- package/hooks/use-theorem-chat-actions.js +287 -0
- package/hooks/use-theorem-chat-state.d.ts +66 -0
- package/hooks/use-theorem-chat-state.js +122 -0
- package/hooks/use-theorem-chat.d.ts +97 -0
- package/hooks/use-theorem-chat.js +528 -0
- package/hooks/use-theorem-decision.d.ts +18 -0
- package/hooks/use-theorem-decision.js +12 -0
- package/hooks/use-theorem-embedding.d.ts +18 -0
- package/hooks/use-theorem-embedding.js +12 -0
- package/hooks/use-theorem-host.d.ts +45 -0
- package/hooks/use-theorem-host.js +135 -0
- package/hooks/use-theorem-interface.d.ts +22 -0
- package/hooks/use-theorem-interface.js +15 -0
- package/hooks/use-trace-records.d.ts +4 -0
- package/hooks/use-trace-records.js +7 -0
- package/index.d.ts +17 -0
- package/index.js +17 -0
- package/live.d.ts +9 -0
- package/live.js +10 -0
- package/package.json +74 -4
- package/server/checkpoint-ownership.d.ts +6 -0
- package/server/checkpoint-ownership.js +42 -0
- package/server/conversation-store.d.ts +92 -0
- package/server/conversation-store.js +131 -0
- package/server/conversation.d.ts +193 -0
- package/server/conversation.js +552 -0
- package/server/credential-store.d.ts +24 -0
- package/server/credential-store.js +14 -0
- package/server/decision-handler.d.ts +42 -0
- package/server/decision-handler.js +46 -0
- package/server/embedding-handler.d.ts +33 -0
- package/server/embedding-handler.js +45 -0
- package/server/handler.d.ts +152 -0
- package/server/handler.js +771 -0
- package/server/json-response.d.ts +2 -0
- package/server/json-response.js +7 -0
- package/server/mod.d.ts +25 -0
- package/server/mod.js +23 -0
- package/server/page-dispatch.d.ts +22 -0
- package/server/page-dispatch.js +127 -0
- package/server/request-body.d.ts +2 -0
- package/server/request-body.js +42 -0
- package/server/request-check.d.ts +21 -0
- package/server/request-check.js +49 -0
- package/server/session-authority.d.ts +8 -0
- package/server/session-authority.js +78 -0
- package/server/session-boundary.d.ts +26 -0
- package/server/session-boundary.js +64 -0
- package/server/session-identity.d.ts +16 -0
- package/server/session-identity.js +41 -0
- package/server/session-limits.d.ts +12 -0
- package/server/session-limits.js +59 -0
- package/server/session-store.d.ts +123 -0
- package/server/session-store.js +264 -0
- package/server/single-action.d.ts +21 -0
- package/server/single-action.js +30 -0
- package/server/steer-inbox.d.ts +35 -0
- package/server/steer-inbox.js +52 -0
- package/server/tool-operations.d.ts +6 -0
- package/server/tool-operations.js +132 -0
- package/server/turn-input.d.ts +10 -0
- package/server/turn-input.js +29 -0
- package/styles/ink-controls.css +134 -0
- package/ui/CardWall.d.ts +10 -0
- package/ui/CardWall.js +61 -0
- package/ui/ChatComposerBar.d.ts +62 -0
- package/ui/ChatComposerBar.js +306 -0
- package/ui/ChatTranscript.d.ts +43 -0
- package/ui/ChatTranscript.js +527 -0
- package/ui/ConsoleFrame.d.ts +104 -0
- package/ui/ConsoleFrame.js +146 -0
- package/ui/DecisionAnswers.d.ts +53 -0
- package/ui/DecisionAnswers.js +233 -0
- package/ui/DecisionImages.d.ts +16 -0
- package/ui/DecisionImages.js +46 -0
- package/ui/EmbeddingDocuments.d.ts +78 -0
- package/ui/EmbeddingDocuments.js +278 -0
- package/ui/EmbeddingQuery.d.ts +27 -0
- package/ui/EmbeddingQuery.js +95 -0
- package/ui/EmbeddingResults.d.ts +41 -0
- package/ui/EmbeddingResults.js +165 -0
- package/ui/EmbeddingSpace.d.ts +26 -0
- package/ui/EmbeddingSpace.js +106 -0
- package/ui/LiveCaptionsPanel.d.ts +22 -0
- package/ui/LiveCaptionsPanel.js +27 -0
- package/ui/LiveRunner.d.ts +30 -0
- package/ui/LiveRunner.js +180 -0
- package/ui/PaneState.d.ts +33 -0
- package/ui/PaneState.js +50 -0
- package/ui/SchemaFields.d.ts +10 -0
- package/ui/SchemaFields.js +150 -0
- package/ui/ShapedData.d.ts +11 -0
- package/ui/ShapedData.js +196 -0
- package/ui/SidePanel.d.ts +126 -0
- package/ui/SidePanel.js +123 -0
- package/ui/StateFields.d.ts +44 -0
- package/ui/StateFields.js +139 -0
- package/ui/TheoremChat.d.ts +122 -0
- package/ui/TheoremChat.js +134 -0
- package/ui/TheoremDecision.d.ts +30 -0
- package/ui/TheoremDecision.js +130 -0
- package/ui/TheoremEmbedding.d.ts +27 -0
- package/ui/TheoremEmbedding.js +122 -0
- package/ui/TheoremHost.d.ts +55 -0
- package/ui/TheoremHost.js +240 -0
- package/ui/ToolGateCard.d.ts +32 -0
- package/ui/ToolGateCard.js +107 -0
- package/ui/ToolResult.d.ts +10 -0
- package/ui/ToolResult.js +62 -0
- package/ui/ToolResultCharts.d.ts +5 -0
- package/ui/ToolResultCharts.js +103 -0
- package/ui/TraceCharts.d.ts +13 -0
- package/ui/TraceCharts.js +266 -0
- package/ui/TraceGuardrails.d.ts +11 -0
- package/ui/TraceGuardrails.js +74 -0
- package/ui/TraceInspector.d.ts +16 -0
- package/ui/TraceInspector.js +206 -0
- package/ui/TraceInspectorPanel.d.ts +46 -0
- package/ui/TraceInspectorPanel.js +95 -0
- package/ui/TraceOverview.d.ts +38 -0
- package/ui/TraceOverview.js +126 -0
- package/ui/TraceSpanDetail.d.ts +10 -0
- package/ui/TraceSpanDetail.js +190 -0
- package/ui/TraceStory.d.ts +20 -0
- package/ui/TraceStory.js +108 -0
- package/ui/TraceValues.d.ts +36 -0
- package/ui/TraceValues.js +123 -0
- package/ui/TraceWaterfall.d.ts +13 -0
- package/ui/TraceWaterfall.js +135 -0
- package/ui/VoiceNote.d.ts +12 -0
- package/ui/VoiceNote.js +28 -0
- package/ui/approval-heading.d.ts +4 -0
- package/ui/approval-heading.js +9 -0
- package/ui/arrive.d.ts +18 -0
- package/ui/arrive.js +46 -0
- package/ui/built/theme.css +792 -0
- package/ui/built/theme.css.d.ts +9 -0
- package/ui/built/theorem.d.ts +13 -0
- package/ui/built/theorem.js +660 -0
- package/ui/built/theorem.variants.d.ts +22 -0
- package/ui/code-language.d.ts +12 -0
- package/ui/code-language.js +50 -0
- package/ui/disclosure-motion.d.ts +6 -0
- package/ui/disclosure-motion.js +207 -0
- package/ui/embedding-space-gl.d.ts +37 -0
- package/ui/embedding-space-gl.js +663 -0
- package/ui/embedding-space-view.d.ts +8 -0
- package/ui/embedding-space-view.js +8 -0
- package/ui/glide.d.ts +7 -0
- package/ui/glide.js +44 -0
- package/ui/icons.d.ts +4 -0
- package/ui/icons.js +38 -0
- package/ui/index.d.ts +36 -0
- package/ui/index.js +39 -0
- package/ui/labels-provider.d.ts +16 -0
- package/ui/labels-provider.js +64 -0
- package/ui/labels.d.ts +1442 -0
- package/ui/labels.js +1443 -0
- package/ui/markdown-plugins.d.ts +9 -0
- package/ui/markdown-plugins.js +13 -0
- package/ui/mcp-icon.d.ts +6 -0
- package/ui/mcp-icon.js +8 -0
- package/ui/row-keys.d.ts +19 -0
- package/ui/row-keys.js +33 -0
- package/ui/theme.d.ts +10 -0
- package/ui/theme.js +13 -0
- package/ui/theorem-theme.d.ts +10 -0
- package/ui/theorem-theme.js +105 -0
- package/ui/trace-palette.d.ts +10 -0
- package/ui/trace-palette.js +10 -0
- package/ui/trace-patterns.d.ts +40 -0
- package/ui/trace-patterns.js +57 -0
- package/ui/transcript-copy-text.d.ts +4 -0
- package/ui/transcript-copy-text.js +40 -0
- package/ui/wall-columns.d.ts +8 -0
- package/ui/wall-columns.js +19 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One reply, run against the conversation its host stores: the history goes
|
|
3
|
+
* to the model from the store, never from the browser, and what the reply
|
|
4
|
+
* leaves (its transcript, its history, a paused reply) is written back.
|
|
5
|
+
*
|
|
6
|
+
* Every host runs replies through here: `createTheoremHandler` with the
|
|
7
|
+
* kernel's `runTurn`, the studio with its own scope. Each run streams its
|
|
8
|
+
* events, then one `conversation` line with the ref the store issued, then
|
|
9
|
+
* the run's error when it failed.
|
|
10
|
+
*
|
|
11
|
+
* The conversation owns the transcript, the history, and the paused reply's
|
|
12
|
+
* events. Which paused calls may run, and with what input, stays the host's
|
|
13
|
+
* session store's: a call is answered there first, and its events settle it here.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import { type GateReference, type LabelOverrides, type Profile, type ProviderCheckpoint, TheoremError, type TurnEvent, type TurnHistoryMessage, type TurnInput } from '@theoremjs/agents';
|
|
18
|
+
import { type ClientTurnOptions } from '@theoremjs/agents/host';
|
|
19
|
+
import { type ComposerProfileInterface, streamThoughtsEnabled, type TranscriptBlock, type UserTurnDraft, type UserTurnHistoryMedia } from '@theoremjs/agents/interface';
|
|
20
|
+
import type { ConversationLine, ConversationView, TheoremTurnInput } from '../client/transport.ts';
|
|
21
|
+
import { type StoredConversation, type TheoremConversationStore } from './conversation-store.ts';
|
|
22
|
+
/** One walked-away call: its id, and the run that settles it (`invokeTool` with the abandoned resume). */
|
|
23
|
+
export type WalkedAwayCall = {
|
|
24
|
+
callId: string;
|
|
25
|
+
events: AsyncIterable<TurnEvent>;
|
|
26
|
+
};
|
|
27
|
+
/** A walked-away call as the session issued it: the operation names the one call, since a model reuses call ids. */
|
|
28
|
+
export type IssuedWalkAway = WalkedAwayCall & GateReference;
|
|
29
|
+
/** A turn's failure, as a run ends on it. */
|
|
30
|
+
export type ErrorEvent = Extract<TurnEvent, {
|
|
31
|
+
type: 'error';
|
|
32
|
+
}>;
|
|
33
|
+
/** What a run needs from the host that runs it. */
|
|
34
|
+
export type ConversationHost = {
|
|
35
|
+
sessionId: string;
|
|
36
|
+
store: TheoremConversationStore;
|
|
37
|
+
/** Whether the profile shows the model's thoughts (`streamThoughtsEnabled`). */
|
|
38
|
+
showThoughts: boolean;
|
|
39
|
+
/** An event as the host's reader may have it (`forClient`). */
|
|
40
|
+
forReader(event: TurnEvent): TurnEvent;
|
|
41
|
+
/** A failure as the host's reader reads it: the profile's wording, by `forClient`'s rule. */
|
|
42
|
+
failureText(failure: ErrorEvent): string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The conversation host for a profile as `forClient` shows it to `clientEvents`:
|
|
46
|
+
* its thoughts as its outputs allow, its failures in its own wording.
|
|
47
|
+
*/
|
|
48
|
+
export declare function readerConversationHost(args: {
|
|
49
|
+
sessionId: string;
|
|
50
|
+
store: TheoremConversationStore;
|
|
51
|
+
profile: {
|
|
52
|
+
outputs?: Parameters<typeof streamThoughtsEnabled>[0];
|
|
53
|
+
labels?: LabelOverrides;
|
|
54
|
+
};
|
|
55
|
+
clientEvents: ClientTurnOptions | undefined;
|
|
56
|
+
}): ConversationHost;
|
|
57
|
+
/** A conversation read for a request: its ref and revision, or neither for a new one. */
|
|
58
|
+
export type OpenedConversation = {
|
|
59
|
+
ref: string | null;
|
|
60
|
+
revision: string | null;
|
|
61
|
+
conversation: StoredConversation;
|
|
62
|
+
/** What the guardrails decided reading a restored transcript, for the reply to stream first. */
|
|
63
|
+
events?: TurnEvent[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* What a request opens a conversation for, checked as it opens, before the host starts any run:
|
|
67
|
+
* - `read`: to draw it (`conversationView`).
|
|
68
|
+
* - `message`: to post a message (`messageReply`). A reply that waits on gates must be walked
|
|
69
|
+
* away from: `abandon` names exactly the calls it waits on.
|
|
70
|
+
* - `answer`: to answer `call`, one the reply waits on (`answerReply`).
|
|
71
|
+
* - `rewind`: to cut it after transcript block `at`, which it must hold; -1 empties it
|
|
72
|
+
* (`rewindConversation`).
|
|
73
|
+
*/
|
|
74
|
+
export type ConversationUse = {
|
|
75
|
+
kind: 'read';
|
|
76
|
+
} | {
|
|
77
|
+
kind: 'message';
|
|
78
|
+
abandon?: readonly GateReference[];
|
|
79
|
+
} | {
|
|
80
|
+
kind: 'answer';
|
|
81
|
+
call: GateReference;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'rewind';
|
|
84
|
+
at: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* The conversation under `ref`, or a new one when the browser has none, refused when it does not
|
|
88
|
+
* allow `use`.
|
|
89
|
+
*/
|
|
90
|
+
export declare function openConversation(host: ConversationHost, ref: string | undefined, use: ConversationUse, restore?: ConversationRestore): Promise<OpenedConversation>;
|
|
91
|
+
/**
|
|
92
|
+
* The page's own transcript, for a conversation the host can no longer open (its key changed, or
|
|
93
|
+
* its store forgot it): the message goes on from it rather than failing. The host's copy is the
|
|
94
|
+
* truth while it opens; this is read only when it does not.
|
|
95
|
+
*/
|
|
96
|
+
export type ConversationRestore = {
|
|
97
|
+
profile: Profile;
|
|
98
|
+
blocks: readonly TranscriptBlock[];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Starts a conversation from blocks the host wrote, not ran: a chat that opens on an exchange
|
|
102
|
+
* already under way. The model reads them as history on the next turn, read first by the
|
|
103
|
+
* profile's guardrails at the `history` boundary, as every turn's history is. A match set to
|
|
104
|
+
* `block` refuses them, and nothing is stored. Returns the new conversation's ref, its view for
|
|
105
|
+
* the chat's `conversationView`, and the guardrail events for what matched.
|
|
106
|
+
*/
|
|
107
|
+
export declare function startConversation(host: Pick<ConversationHost, 'sessionId' | 'store'>, profile: Profile, blocks: readonly TranscriptBlock[]): Promise<{
|
|
108
|
+
ref: string;
|
|
109
|
+
view: ConversationView;
|
|
110
|
+
events: TurnEvent[];
|
|
111
|
+
}>;
|
|
112
|
+
/** The conversation as the browser draws it. */
|
|
113
|
+
export declare function conversationView(host: ConversationHost, conversation: StoredConversation): ConversationView;
|
|
114
|
+
/** One model run of a reply: the kernel's turn input, the checkpoint it continues, and the generation. */
|
|
115
|
+
export type ReplyTurn = {
|
|
116
|
+
input: TurnInput;
|
|
117
|
+
providerState?: ProviderCheckpoint;
|
|
118
|
+
model?: string;
|
|
119
|
+
effort?: string;
|
|
120
|
+
};
|
|
121
|
+
/** What a reply's model run takes from the host. */
|
|
122
|
+
export type ReplyRunner = {
|
|
123
|
+
/** The reply's events for one run (`runTurn` with the host's own options). */
|
|
124
|
+
run(turn: ReplyTurn): AsyncIterable<TurnEvent>;
|
|
125
|
+
/**
|
|
126
|
+
* Compacts history the profile says is due for it after a reply
|
|
127
|
+
* (`done.compaction.needed`): the compacted history, or undefined to keep it.
|
|
128
|
+
*/
|
|
129
|
+
compact(history: TurnHistoryMessage[], tokens: number, model: string | undefined): Promise<TurnHistoryMessage[] | undefined>;
|
|
130
|
+
model?: string;
|
|
131
|
+
effort?: string;
|
|
132
|
+
signal: AbortSignal;
|
|
133
|
+
};
|
|
134
|
+
/** A line of a reply's stream: an event, or the ref of what the store wrote. */
|
|
135
|
+
export type ReplyLine = TurnEvent | ConversationLine;
|
|
136
|
+
/** The person's new message, as the host checked it: its blocks, its media, and the kernel's input. */
|
|
137
|
+
export type PostedMessage = {
|
|
138
|
+
draft: UserTurnDraft;
|
|
139
|
+
/** The message's blocks (`prepareUserTurn`), with their media inline. */
|
|
140
|
+
blocks: TranscriptBlock[];
|
|
141
|
+
media: UserTurnHistoryMedia;
|
|
142
|
+
/** The kernel input without history: the message's text as the transcript shows it, its media, slots, and context. */
|
|
143
|
+
input: TurnInput;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The person's message as the profile accepts it: refused when its files break the profile's
|
|
147
|
+
* limits. `server` is the host's own context for the run (the handler's `context` option).
|
|
148
|
+
*/
|
|
149
|
+
export declare function postedMessage(iface: ComposerProfileInterface, input: TheoremTurnInput, server?: unknown): PostedMessage;
|
|
150
|
+
/**
|
|
151
|
+
* The person sends a message. A reply that waits on gates is walked away
|
|
152
|
+
* from first: each call settles cancelled and the paused reply commits; then
|
|
153
|
+
* the message posts and its reply runs.
|
|
154
|
+
*/
|
|
155
|
+
export declare function messageReply(args: {
|
|
156
|
+
host: ConversationHost;
|
|
157
|
+
opened: OpenedConversation;
|
|
158
|
+
message: PostedMessage;
|
|
159
|
+
/** The paused reply's calls, each with the run that settles it: exactly the calls it waits on. */
|
|
160
|
+
walkAway?: readonly IssuedWalkAway[];
|
|
161
|
+
runner: ReplyRunner;
|
|
162
|
+
}): AsyncGenerator<ReplyLine>;
|
|
163
|
+
/**
|
|
164
|
+
* The person answers one call the reply waits on. `settling` streams the
|
|
165
|
+
* call's events; once no call waits, the reply goes on in the same stream.
|
|
166
|
+
*/
|
|
167
|
+
export declare function answerReply(args: {
|
|
168
|
+
host: ConversationHost;
|
|
169
|
+
opened: OpenedConversation;
|
|
170
|
+
/** The call answered, as the session issued it. */
|
|
171
|
+
call: GateReference;
|
|
172
|
+
settling: AsyncIterable<TurnEvent>;
|
|
173
|
+
runner: ReplyRunner;
|
|
174
|
+
}): AsyncGenerator<ReplyLine>;
|
|
175
|
+
/**
|
|
176
|
+
* The conversation cut after transcript block `at` (-1 empties it): the
|
|
177
|
+
* history is rebuilt from what is kept, and the model's checkpoint and meters
|
|
178
|
+
* start over. A paused reply is walked away from first, and commits before the cut.
|
|
179
|
+
*/
|
|
180
|
+
export declare function rewindConversation(args: {
|
|
181
|
+
host: ConversationHost;
|
|
182
|
+
opened: OpenedConversation;
|
|
183
|
+
at: number;
|
|
184
|
+
walkAway?: readonly IssuedWalkAway[];
|
|
185
|
+
}): Promise<OpenedConversation>;
|
|
186
|
+
/** A paused call's operation: every call a session issued carries one. */
|
|
187
|
+
export declare function requiredOperationId(call: {
|
|
188
|
+
operationId?: string;
|
|
189
|
+
}): string;
|
|
190
|
+
/** The calls a paused reply waits on: the ones a message or a rewind walks away from. */
|
|
191
|
+
export declare function waitingCalls(conversation: StoredConversation): GateReference[];
|
|
192
|
+
/** Refuses what only a kept conversation answers, for a profile that keeps none. */
|
|
193
|
+
export declare function statelessRefusal(what: string): TheoremError;
|