@theoremjs/react 0.3.5-next.979.g76aac35 → 0.3.5-next.981.gf4729de
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/README.md +3 -1
- package/client/live/use-live-caption-log.d.ts +1 -1
- package/client/trace-story.d.ts +1 -1
- package/components/InkWaveform.d.ts +1 -1
- package/components/live/use-live-call.d.ts +3 -3
- package/components/live/use-live-runner-controls.d.ts +2 -2
- package/components/live/use-live-runner-ui.d.ts +3 -3
- package/components/live/use-live-session-client.d.ts +2 -2
- package/components/use-composer-voice.d.ts +1 -1
- package/components/use-voice-playback.d.ts +1 -1
- package/hooks/use-embedding-index.d.ts +1 -1
- package/hooks/use-theorem-chat.d.ts +34 -49
- package/hooks/use-theorem-chat.js +1 -9
- package/hooks/use-theorem-decision.d.ts +1 -1
- package/hooks/use-theorem-embedding.d.ts +1 -1
- package/hooks/use-theorem-host.d.ts +1 -1
- package/hooks/use-turn-clock.d.ts +1 -1
- package/index.d.ts +8 -8
- package/live.d.ts +4 -4
- package/package.json +3 -3
- package/ui/ChatComposerBar.d.ts +2 -2
- package/ui/ChatComposerBar.js +10 -2
- package/ui/ChatComposerRow.d.ts +1 -1
- package/ui/ChatTranscript.d.ts +4 -4
- package/ui/ConsoleFrame.d.ts +2 -2
- package/ui/DecisionAnswers.d.ts +1 -1
- package/ui/DecisionImages.d.ts +4 -3
- package/ui/EmbeddingDocuments.d.ts +2 -2
- package/ui/EmbeddingQuery.d.ts +2 -2
- package/ui/EmbeddingResults.d.ts +3 -3
- package/ui/LiveCallTile.d.ts +2 -2
- package/ui/LiveCaptionsPanel.d.ts +1 -1
- package/ui/LiveRunner.d.ts +3 -3
- package/ui/LiveToolGateDialog.d.ts +1 -1
- package/ui/LiveVideoPreview.d.ts +1 -1
- package/ui/RadialCharts.d.ts +2 -2
- package/ui/RankedBars.d.ts +1 -1
- package/ui/SchemaFields.d.ts +1 -1
- package/ui/StateFields.d.ts +1 -1
- package/ui/TheoremChat.d.ts +6 -6
- package/ui/TheoremDecision.d.ts +3 -3
- package/ui/TheoremEmbedding.d.ts +2 -2
- package/ui/TheoremHost.d.ts +2 -2
- package/ui/TheoremSurface.d.ts +2 -2
- package/ui/TraceCharts.d.ts +2 -2
- package/ui/TraceGuardrails.d.ts +2 -2
- package/ui/TraceInspectorPanel.d.ts +1 -1
- package/ui/TraceOverview.d.ts +2 -2
- package/ui/TraceSpanDetail.d.ts +1 -1
- package/ui/TraceStory.d.ts +2 -2
- package/ui/TraceValues.d.ts +2 -2
- package/ui/TraceWaterfall.d.ts +1 -1
- package/ui/approval-heading.d.ts +1 -1
- package/ui/embedding-space-view.d.ts +1 -1
- package/ui/index.d.ts +31 -31
- package/ui/labels-provider.d.ts +1 -1
- package/ui/labels.d.ts +10 -2
- package/ui/labels.js +8 -0
- package/ui/tool-media.d.ts +2 -2
- package/ui/trace-patterns.d.ts +1 -1
- package/ui/transcript-copy-text.d.ts +1 -1
package/README.md
CHANGED
|
@@ -539,12 +539,14 @@ function MyChat() {
|
|
|
539
539
|
}
|
|
540
540
|
```
|
|
541
541
|
|
|
542
|
-
`chat.phase` is `'idle'`, `'streaming'`, or `'gated'`. The actions are `handleSubmit`, `handleStop`, `handleSendNow`, and `handleToolDecision`.
|
|
542
|
+
`chat.phase` is `'idle'`, `'streaming'`, or `'gated'`. `chat.waitingGate` is the gate that waits for the person, and `null` when none waits. A page gate is never one, because the page answers it. The actions are `handleSubmit`, `handleStop`, `handleSendNow`, and `handleToolDecision`.
|
|
543
543
|
|
|
544
544
|
`chat.backgroundJobs` lists the tool calls that still run in the background, each as `{ callId, label }`. A call leaves the list when its late result lands. `backgroundJobs(blocks)` gives the same list from a transcript. `ChatComposerBar` takes `layout` and `backgroundJobs`, as `TheoremChat` takes `composerLayout`.
|
|
545
545
|
|
|
546
546
|
`handlePendingMove(id, direction)` moves a pending message among those of its kind. `ChatComposerBar` draws a move only when `composerPendingMoves` from `@theoremjs/agents/interface` says the message can go that way: a message alone in its kind has none.
|
|
547
547
|
|
|
548
|
+
A pending message with `saved` set is one the host saved itself (`intake` on `createTheoremHandler`). `ChatComposerBar` draws it with the label `@theorem.composer.pending.saved`, "Sent", and no actions, because the page cannot change it. It leaves the list when a reply reads it.
|
|
549
|
+
|
|
548
550
|
### Place the pieces yourself
|
|
549
551
|
|
|
550
552
|
`TheoremChat` is built from two pieces in `/ui` that you can place apart: `TheoremChatComposer` and `TheoremChatTranscript`. Each takes the `chat` from `useTheoremChat` (its type is `TheoremChatState`) and the `iface` from `useTheoremInterface`. You decide where each one sits and when each one shows. Theorem moves neither of them.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TurnEvent } from '@theoremjs/agents';
|
|
2
|
-
import { type LiveCaptionState, type LiveCaptionTurn } from './live-captions.
|
|
2
|
+
import { type LiveCaptionState, type LiveCaptionTurn } from './live-captions.js';
|
|
3
3
|
/**
|
|
4
4
|
* The captions a live call shows: this call's lines, and earlier calls kept
|
|
5
5
|
* when it is started again. Speech arrives through `applyTranscript`, and the
|
package/client/trace-story.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TraceNode, type TraceTotals } from './trace-view.
|
|
1
|
+
import { type TraceNode, type TraceTotals } from './trace-view.js';
|
|
2
2
|
/**
|
|
3
3
|
* The trace panel's story of a turn: who acted, in what order, and where the
|
|
4
4
|
* time went, read from the span tree. The words still come from the trace
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
|
-
import { type InkWaveStatus } from '../client/ink-waveform.
|
|
2
|
+
import { type InkWaveStatus } from '../client/ink-waveform.js';
|
|
3
3
|
/** Mic and speaker levels. A host on the audio clock writes this; the bars read it each frame. */
|
|
4
4
|
export type InkWaveLevels = {
|
|
5
5
|
input: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LiveProfileInterface } from '@theoremjs/agents/interface';
|
|
2
2
|
import type { LiveCallOptions, LiveConnection } from '@theoremjs/web/client';
|
|
3
|
-
import { type LiveCaptionState, type LiveCaptionTurn } from '../../client/live/live-captions.
|
|
3
|
+
import { type LiveCaptionState, type LiveCaptionTurn } from '../../client/live/live-captions.js';
|
|
4
4
|
/** What `useLiveCall` takes: the profile, what the call opens, and the host's part in the call. */
|
|
5
5
|
export type LiveCallInput = {
|
|
6
6
|
iface: LiveProfileInterface;
|
|
@@ -35,13 +35,13 @@ export declare function useLiveCall({ iface, connection, ...options }: LiveCallI
|
|
|
35
35
|
isVideoOn: boolean;
|
|
36
36
|
sessionActive: boolean;
|
|
37
37
|
liveState: import("@theoremjs/web/client").LiveState;
|
|
38
|
-
activeTool: import("../../client/live/apply-live-turn-tool-event.
|
|
38
|
+
activeTool: import("../../client/live/apply-live-turn-tool-event.js").LiveActiveTool | null;
|
|
39
39
|
status: import("@theoremjs/web/client").LiveSessionStatus;
|
|
40
40
|
textAvailable: boolean;
|
|
41
41
|
textDraft: string;
|
|
42
42
|
toolActive: boolean;
|
|
43
43
|
videoAvailable: boolean;
|
|
44
|
-
videoFacingMode: import("../../client/live/live-video.
|
|
44
|
+
videoFacingMode: import("../../client/live/live-video.js").LiveFacingMode;
|
|
45
45
|
videoPreview: HTMLVideoElement | null;
|
|
46
46
|
voiceAvailable: boolean;
|
|
47
47
|
canRestart: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LiveConnection, LiveConnectPhase, LiveSessionClient, LiveSessionStatus } from '@theoremjs/web/client';
|
|
2
2
|
import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
|
|
3
|
-
import { type LiveCaptionState } from '../../client/live/live-captions.
|
|
4
|
-
import { type LiveFacingMode, type LiveVideoCapture } from '../../client/live/live-video.
|
|
3
|
+
import { type LiveCaptionState } from '../../client/live/live-captions.js';
|
|
4
|
+
import { type LiveFacingMode, type LiveVideoCapture } from '../../client/live/live-video.js';
|
|
5
5
|
/** Media + session lifecycle handlers for LiveRunner. */
|
|
6
6
|
export declare function useLiveRunnerControls(args: {
|
|
7
7
|
clientRef: MutableRefObject<LiveSessionClient | null>;
|
|
@@ -2,9 +2,9 @@ import { type LabelOverrides, type SessionEventOf } from '@theoremjs/agents';
|
|
|
2
2
|
import type { LiveConnectPhase, LiveGateAnswer, LiveSessionStatus, LiveToolGatePrompt, ToolGateResolution } from '@theoremjs/web/client';
|
|
3
3
|
import { type ClientFailure } from '@theoremjs/web/client';
|
|
4
4
|
import { type Dispatch, type SetStateAction } from 'react';
|
|
5
|
-
import { applyLiveTurnToolEvent, type LiveActiveTool } from '../../client/live/apply-live-turn-tool-event.
|
|
6
|
-
import { type LiveCaptionState } from '../../client/live/live-captions.
|
|
7
|
-
import type { LiveFacingMode, LiveVideoCapture } from '../../client/live/live-video.
|
|
5
|
+
import { applyLiveTurnToolEvent, type LiveActiveTool } from '../../client/live/apply-live-turn-tool-event.js';
|
|
6
|
+
import { type LiveCaptionState } from '../../client/live/live-captions.js';
|
|
7
|
+
import type { LiveFacingMode, LiveVideoCapture } from '../../client/live/live-video.js';
|
|
8
8
|
/** UI + media state bag for the live runner. `labels` is the interface's: the profile's wording. */
|
|
9
9
|
export declare function useLiveRunnerUiState(labels: LabelOverrides): {
|
|
10
10
|
status: LiveSessionStatus;
|
|
@@ -2,8 +2,8 @@ import type { SessionEventOf, TurnEvent } from '@theoremjs/agents';
|
|
|
2
2
|
import type { LiveCallOptions, LiveConnectPhase, LiveGateAnswer, LiveSessionStatus, LiveToolGatePrompt, TraceFeed } from '@theoremjs/web/client';
|
|
3
3
|
import { type LiveConnection, LiveSessionClient } from '@theoremjs/web/client';
|
|
4
4
|
import { type Dispatch, type MutableRefObject, type SetStateAction } from 'react';
|
|
5
|
-
import { type LiveCaptionState } from '../../client/live/live-captions.
|
|
6
|
-
import type { LiveFacingMode, LiveVideoCapture } from '../../client/live/live-video.
|
|
5
|
+
import { type LiveCaptionState } from '../../client/live/live-captions.js';
|
|
6
|
+
import type { LiveFacingMode, LiveVideoCapture } from '../../client/live/live-video.js';
|
|
7
7
|
export type LiveClientBindings = LiveCallOptions & {
|
|
8
8
|
voiceAvailable: boolean;
|
|
9
9
|
/** Where the session's trace records go, when the relay delivers them. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LabelOverrides } from '@theoremjs/agents';
|
|
2
2
|
import type { ProfileInputsInterface } from '@theoremjs/agents/interface';
|
|
3
|
-
import { type VoiceRecorderFailureCode } from '../client/voice-recorder.
|
|
3
|
+
import { type VoiceRecorderFailureCode } from '../client/voice-recorder.js';
|
|
4
4
|
/** A voice note that could not be recorded or staged. */
|
|
5
5
|
export type VoiceFailure = {
|
|
6
6
|
/** A recorder failure, or `too_many_files` when the message is already full. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmbeddingInput, EmbeddingUsage } from '@theoremjs/agents';
|
|
2
2
|
import type { EmbeddingInterface, EmbeddingTransport } from '@theoremjs/web/client';
|
|
3
|
-
import { type OneCallState } from './use-one-call.
|
|
3
|
+
import { type OneCallState } from './use-one-call.js';
|
|
4
4
|
/** Documents embedded for search: each one's vector, in the order given. */
|
|
5
5
|
export type EmbeddingIndex = {
|
|
6
6
|
inputs: readonly EmbeddingInput[];
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { TranscriptBlock } from '@theoremjs/agents/interface';
|
|
2
|
+
import { type ChatController, type ChatOptionPicks, type ChatOptions, type ChatState, type SendTextOptions, type SentTurn, type ToolDecisionAction } from '@theoremjs/web/client';
|
|
3
|
+
import { type BackgroundJob } from '../client/transcript-groups.js';
|
|
4
|
+
import { type TurnClock } from './use-turn-clock.js';
|
|
2
5
|
export type { SendTextOptions, SentTurn };
|
|
3
6
|
export type UseTheoremChatOptions = ChatOptions;
|
|
4
7
|
/**
|
|
@@ -7,61 +10,43 @@ export type UseTheoremChatOptions = ChatOptions;
|
|
|
7
10
|
* your own components. A React binding of `createChatController` from
|
|
8
11
|
* `@theoremjs/web/client`, which works with no framework.
|
|
9
12
|
*/
|
|
10
|
-
export declare function useTheoremChat(options: UseTheoremChatOptions):
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export declare function useTheoremChat(options: UseTheoremChatOptions): TheoremChatState;
|
|
14
|
+
/** What `useTheoremChat` returns: the chat's state and its actions. */
|
|
15
|
+
export type TheoremChatState = ChatState & {
|
|
16
|
+
/** The profile's options with their values, and the setter; `undefined` when it declares none. */
|
|
17
|
+
optionChoices: (ChatOptionPicks & {
|
|
18
|
+
onChange: ChatController['pickOption'];
|
|
19
|
+
}) | undefined;
|
|
16
20
|
/** What the transcript shows: the committed blocks, then the reply streaming in. */
|
|
17
|
-
shownBlocks:
|
|
21
|
+
shownBlocks: TranscriptBlock[];
|
|
18
22
|
/**
|
|
19
23
|
* When each turn started and how long it waited on approvals. Pass it to `ChatTranscript`'s
|
|
20
24
|
* `clock` so its times agree with the composer's working pill.
|
|
21
25
|
*/
|
|
22
|
-
turnClock:
|
|
26
|
+
turnClock: TurnClock;
|
|
23
27
|
/** When the reply in progress started, its approval waits skipped; `undefined` when none runs. */
|
|
24
28
|
workingSince: number | undefined;
|
|
25
29
|
/** The tool calls still running in the background, oldest first, until their results land. */
|
|
26
|
-
backgroundJobs:
|
|
27
|
-
setDraftText:
|
|
28
|
-
setPendingFiles:
|
|
29
|
-
setPendingVoice:
|
|
30
|
-
setPendingMessages:
|
|
31
|
-
setIssues:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
sendText: (text: string, options?: SendTextOptions) => Promise<SentTurn | null>;
|
|
30
|
+
backgroundJobs: BackgroundJob[];
|
|
31
|
+
setDraftText: ChatController['setDraftText'];
|
|
32
|
+
setPendingFiles: ChatController['setPendingFiles'];
|
|
33
|
+
setPendingVoice: ChatController['setPendingVoice'];
|
|
34
|
+
setPendingMessages: ChatController['setPendingMessages'];
|
|
35
|
+
setIssues: ChatController['setIssues'];
|
|
36
|
+
/** Answers the sign-in gate; the index is the gate's place in the transcript. */
|
|
37
|
+
handleAuthenticated: (index: number, secret?: string) => Promise<void>;
|
|
38
|
+
handleBranch: ChatController['branch'];
|
|
39
|
+
handleSubmit: ChatController['submit'];
|
|
40
|
+
handleStop: ChatController['stop'];
|
|
41
|
+
handleMenuAction: ChatController['menuAction'];
|
|
42
|
+
handlePendingQueue: ChatController['queuePending'];
|
|
43
|
+
handlePendingMove: ChatController['movePending'];
|
|
44
|
+
handlePendingRestore: ChatController['restorePending'];
|
|
45
|
+
handleSendNow: ChatController['sendNow'];
|
|
46
|
+
/** Answers the approval gate; the index is the gate's place in the transcript. */
|
|
47
|
+
handleToolDecision: (index: number, action: ToolDecisionAction) => Promise<void>;
|
|
48
|
+
handleGenerationChange: ChatController['setGeneration'];
|
|
49
|
+
sendText: ChatController['sendText'];
|
|
47
50
|
/** The controller under it all, for a host that drives the chat from outside. */
|
|
48
|
-
controller:
|
|
49
|
-
iface: import("../../../src/interface/types.ts").ComposerProfileInterface | null;
|
|
50
|
-
blocks: import("../../../src/interface/types.ts").TranscriptBlock[];
|
|
51
|
-
streamBlocks: import("../../../src/interface/types.ts").TranscriptBlock[];
|
|
52
|
-
chatStarted: boolean;
|
|
53
|
-
draftText: string;
|
|
54
|
-
pendingFiles: File[];
|
|
55
|
-
pendingVoice: File[];
|
|
56
|
-
pendingMessages: import("../../../src/interface/pending.ts").ComposerPendingMessage[];
|
|
57
|
-
issues: import("../../../mod.ts").AttachmentValidationIssue[];
|
|
58
|
-
failure: import("@theoremjs/web/client").ClientFailure | null;
|
|
59
|
-
answering: import("@theoremjs/web/client").AnsweringGate | null;
|
|
60
|
-
phase: import("../../../src/interface/composer-actions.ts").ComposerRunPhase;
|
|
61
|
-
session: import("../../../src/interface/session.ts").InterfaceTurnSession;
|
|
62
|
-
delivery: import("@theoremjs/web/client").MessageDelivery | null;
|
|
63
|
-
streaming: boolean;
|
|
64
|
-
options: import("@theoremjs/web/client").ChatOptionPicks | undefined;
|
|
51
|
+
controller: ChatController;
|
|
65
52
|
};
|
|
66
|
-
/** What `useTheoremChat` returns: the chat's state and its actions. */
|
|
67
|
-
export type TheoremChatState = ReturnType<typeof useTheoremChat>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createChatController, } from '@theoremjs/web/client';
|
|
2
2
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useState, useSyncExternalStore, } from 'react';
|
|
3
|
-
import { backgroundJobs, groupTranscriptBlocks } from "../client/transcript-groups.js";
|
|
3
|
+
import { backgroundJobs, groupTranscriptBlocks, } from "../client/transcript-groups.js";
|
|
4
4
|
import { liveTurnStart, useTurnClock } from "./use-turn-clock.js";
|
|
5
5
|
// why: Options reach the chat before the browser paints, and before a line can arrive; a server render runs no effects.
|
|
6
6
|
const useOptionsEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
@@ -25,16 +25,9 @@ export function useTheoremChat(options) {
|
|
|
25
25
|
return {
|
|
26
26
|
...state,
|
|
27
27
|
optionChoices,
|
|
28
|
-
/** What the transcript shows: the committed blocks, then the reply streaming in. */
|
|
29
28
|
shownBlocks,
|
|
30
|
-
/**
|
|
31
|
-
* When each turn started and how long it waited on approvals. Pass it to `ChatTranscript`'s
|
|
32
|
-
* `clock` so its times agree with the composer's working pill.
|
|
33
|
-
*/
|
|
34
29
|
turnClock,
|
|
35
|
-
/** When the reply in progress started, its approval waits skipped; `undefined` when none runs. */
|
|
36
30
|
workingSince: liveTurnStart(groups, turnClock, state.streaming),
|
|
37
|
-
/** The tool calls still running in the background, oldest first, until their results land. */
|
|
38
31
|
backgroundJobs: jobs,
|
|
39
32
|
setDraftText: chat.setDraftText,
|
|
40
33
|
setPendingFiles: chat.setPendingFiles,
|
|
@@ -53,7 +46,6 @@ export function useTheoremChat(options) {
|
|
|
53
46
|
handleToolDecision,
|
|
54
47
|
handleGenerationChange: chat.setGeneration,
|
|
55
48
|
sendText: chat.sendText,
|
|
56
|
-
/** The controller under it all, for a host that drives the chat from outside. */
|
|
57
49
|
controller: chat,
|
|
58
50
|
};
|
|
59
51
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DecisionAsset, DecisionJson } from '@theoremjs/agents';
|
|
2
2
|
import type { ClientFailure, DecisionInterface, DecisionReplyResult, DecisionTransport } from '@theoremjs/web/client';
|
|
3
|
-
import { type OneCallState } from './use-one-call.
|
|
3
|
+
import { type OneCallState } from './use-one-call.js';
|
|
4
4
|
export type TheoremDecisionState = {
|
|
5
5
|
/** The profile as the page sees it; null until the host describes it. */
|
|
6
6
|
iface: DecisionInterface | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmbeddingInput, EmbeddingResult } from '@theoremjs/agents';
|
|
2
2
|
import type { ClientFailure, EmbeddingInterface, EmbeddingTransport, EmbedOptions } from '@theoremjs/web/client';
|
|
3
|
-
import { type OneCallState } from './use-one-call.
|
|
3
|
+
import { type OneCallState } from './use-one-call.js';
|
|
4
4
|
export type TheoremEmbeddingState = {
|
|
5
5
|
/** The profile as the page sees it; null until the host describes it. */
|
|
6
6
|
iface: EmbeddingInterface | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TurnEvent } from '@theoremjs/agents';
|
|
2
2
|
import type { HostInterface, HostTransport, PageTools } from '@theoremjs/web/client';
|
|
3
3
|
import { type ClientFailure, type PersonGateResolution } from '@theoremjs/web/client';
|
|
4
|
-
import type { ToolCall } from '../client/host-call.
|
|
4
|
+
import type { ToolCall } from '../client/host-call.js';
|
|
5
5
|
export type { ToolCall };
|
|
6
6
|
/** One call of one of the host's tools, as it streams. */
|
|
7
7
|
export type TheoremHostCall = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TranscriptTurnGroup } from '../client/transcript-groups.
|
|
1
|
+
import { type TranscriptTurnGroup } from '../client/transcript-groups.js';
|
|
2
2
|
/**
|
|
3
3
|
* When each turn was first seen, and how long each sat paused on approvals.
|
|
4
4
|
* invariant: One clock per chat: the transcript's status line and the composer's working pill
|
package/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
export * from '@theoremjs/web/client';
|
|
11
|
-
export { type BackgroundJob, backgroundJobs } from './client/transcript-groups.
|
|
12
|
-
export { type EmbeddingIndex, type IndexProgress, useEmbeddingIndex, } from './hooks/use-embedding-index.
|
|
13
|
-
export { type SendTextOptions, type SentTurn, type TheoremChatState, type UseTheoremChatOptions, useTheoremChat, } from './hooks/use-theorem-chat.
|
|
14
|
-
export { type TheoremDecisionState, useTheoremDecision } from './hooks/use-theorem-decision.
|
|
15
|
-
export { type TheoremEmbeddingState, useTheoremEmbedding, } from './hooks/use-theorem-embedding.
|
|
16
|
-
export { type TheoremHostCall, type TheoremHostState, useTheoremHost, } from './hooks/use-theorem-host.
|
|
17
|
-
export { type TheoremInterfaceState, useTheoremInterface } from './hooks/use-theorem-interface.
|
|
18
|
-
export type { TurnClock } from './hooks/use-turn-clock.
|
|
11
|
+
export { type BackgroundJob, backgroundJobs } from './client/transcript-groups.js';
|
|
12
|
+
export { type EmbeddingIndex, type IndexProgress, useEmbeddingIndex, } from './hooks/use-embedding-index.js';
|
|
13
|
+
export { type SendTextOptions, type SentTurn, type TheoremChatState, type UseTheoremChatOptions, useTheoremChat, } from './hooks/use-theorem-chat.js';
|
|
14
|
+
export { type TheoremDecisionState, useTheoremDecision } from './hooks/use-theorem-decision.js';
|
|
15
|
+
export { type TheoremEmbeddingState, useTheoremEmbedding, } from './hooks/use-theorem-embedding.js';
|
|
16
|
+
export { type TheoremHostCall, type TheoremHostState, useTheoremHost, } from './hooks/use-theorem-host.js';
|
|
17
|
+
export { type TheoremInterfaceState, useTheoremInterface } from './hooks/use-theorem-interface.js';
|
|
18
|
+
export type { TurnClock } from './hooks/use-turn-clock.js';
|
package/live.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
export type { LiveCallOptions, LiveConnection, PageTool, PageToolAnswer, PageTools, } from '@theoremjs/web/client';
|
|
7
|
-
export { type LiveCall, type LiveCallInput, useLiveCall, } from './components/live/use-live-call.
|
|
8
|
-
export { LiveCallTile, type LiveCallTileProps } from './ui/LiveCallTile.
|
|
9
|
-
export type { LiveRunnerProps } from './ui/LiveRunner.
|
|
10
|
-
export { LiveRunner } from './ui/LiveRunner.
|
|
7
|
+
export { type LiveCall, type LiveCallInput, useLiveCall, } from './components/live/use-live-call.js';
|
|
8
|
+
export { LiveCallTile, type LiveCallTileProps } from './ui/LiveCallTile.js';
|
|
9
|
+
export type { LiveRunnerProps } from './ui/LiveRunner.js';
|
|
10
|
+
export { LiveRunner } from './ui/LiveRunner.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theoremjs/react",
|
|
3
|
-
"version": "0.3.5-next.
|
|
3
|
+
"version": "0.3.5-next.981.gf4729de",
|
|
4
4
|
"description": "React bindings for Theorem: headless hooks + transport, an Astryx chat UI, and a Web-standard server handler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@stylexjs/stylex": "0.19.0",
|
|
61
61
|
"react": "^19.0.0",
|
|
62
62
|
"react-dom": "^19.0.0",
|
|
63
|
-
"@theoremjs/agents": "^0.3.5-next.
|
|
64
|
-
"@theoremjs/web": "^0.3.5-next.
|
|
63
|
+
"@theoremjs/agents": "^0.3.5-next.981.gf4729de",
|
|
64
|
+
"@theoremjs/web": "^0.3.5-next.981.gf4729de"
|
|
65
65
|
},
|
|
66
66
|
"peerDependenciesMeta": {
|
|
67
67
|
"@astryxdesign/core": {
|
package/ui/ChatComposerBar.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { type ChatComposerInputHandle } from '@astryxdesign/core/Chat';
|
|
|
2
2
|
import { type AttachmentValidationIssue, type ComposerMenuAction, type ComposerPendingMessage, type ComposerProfileInterface, type ComposerRunPhase, type LiveProfileInterface } from '@theoremjs/agents/interface';
|
|
3
3
|
import type { ClientFailure } from '@theoremjs/web/client';
|
|
4
4
|
import { type ReactNode } from 'react';
|
|
5
|
-
import type { BackgroundJob } from '../client/transcript-groups.
|
|
6
|
-
import { type ComposerRowIcons } from './ChatComposerRow.
|
|
5
|
+
import type { BackgroundJob } from '../client/transcript-groups.js';
|
|
6
|
+
import { type ComposerRowIcons } from './ChatComposerRow.js';
|
|
7
7
|
/** An option the profile declares: its allowed values, the one chosen, and how to choose another. */
|
|
8
8
|
/** The effort selector's icon. The studio's Agents list shows the same one. */
|
|
9
9
|
export declare const EFFORT_ICON: import("react").ForwardRefExoticComponent<import("@tabler/icons-react").IconProps & import("react").RefAttributes<SVGSVGElement>>;
|
package/ui/ChatComposerBar.js
CHANGED
|
@@ -58,6 +58,15 @@ const SEND_ICON = {
|
|
|
58
58
|
stash: IconArchive,
|
|
59
59
|
};
|
|
60
60
|
function PendingRow(props) {
|
|
61
|
+
const { message } = props;
|
|
62
|
+
const t = useLabels();
|
|
63
|
+
// why: The host saved the message, so the page has no action left on it.
|
|
64
|
+
const state = message.saved ? 'saved' : message.kind;
|
|
65
|
+
const Kind = message.saved ? IconSend : SEND_ICON[message.kind];
|
|
66
|
+
return (_jsxs(HStack, { gap: 1, align: "center", width: "100%", children: [_jsx(HoverTip, { content: t(`@theorem.composer.pending.${state}.description`), children: _jsx(Token, { label: t(`@theorem.composer.pending.${state}`), isLabelHidden: true, color: message.kind === 'steer' ? 'blue' : 'default', icon: _jsx(Kind, { size: 14 }) }) }), _jsx(StackItem, { size: "fill", style: { width: 0 }, children: _jsx(Text, { size: "sm", maxLines: 1, hasTruncateTooltip: true, children: composerPendingPreview(message) }) }), message.saved ? null : _jsx(PendingActions, { ...props })] }));
|
|
67
|
+
}
|
|
68
|
+
/** A waiting message's actions. A message the host saved has none. */
|
|
69
|
+
function PendingActions(props) {
|
|
61
70
|
const { message } = props;
|
|
62
71
|
const t = useLabels();
|
|
63
72
|
const icon = (Glyph) => _jsx(Glyph, { size: 14 });
|
|
@@ -67,8 +76,7 @@ function PendingRow(props) {
|
|
|
67
76
|
const moveUp = t('@theorem.composer.pending.move_up');
|
|
68
77
|
const moveDown = t('@theorem.composer.pending.move_down');
|
|
69
78
|
const remove = t('@theorem.composer.pending.remove');
|
|
70
|
-
|
|
71
|
-
return (_jsxs(HStack, { gap: 1, align: "center", width: "100%", children: [_jsx(HoverTip, { content: t(`@theorem.composer.pending.${message.kind}.description`), children: _jsx(Token, { label: t(`@theorem.composer.pending.${message.kind}`), isLabelHidden: true, color: message.kind === 'steer' ? 'blue' : 'default', icon: _jsx(Kind, { size: 14 }) }) }), _jsx(StackItem, { size: "fill", style: { width: 0 }, children: _jsx(Text, { size: "sm", maxLines: 1, hasTruncateTooltip: true, children: composerPendingPreview(message) }) }), _jsxs(HStack, { gap: 0.5, children: [_jsx(IconButton, { label: edit, tooltip: edit, size: "sm", variant: "ghost", icon: icon(IconPencil), onClick: () => props.onRestore(message.id) }), message.kind === 'stash' ? (_jsx(IconButton, { label: queue, tooltip: queue, size: "sm", variant: "ghost", icon: icon(IconCornerDownLeft), onClick: () => props.onQueue(message.id) })) : null, _jsx(IconButton, { label: sendNow, tooltip: sendNow, size: "sm", variant: "ghost", icon: icon(IconSend), onClick: () => props.onSendNow(message.id) }), props.moves.up ? (_jsx(IconButton, { label: moveUp, tooltip: moveUp, size: "sm", variant: "ghost", icon: icon(IconArrowUp), onClick: () => props.onMove(message.id, 'up') })) : null, props.moves.down ? (_jsx(IconButton, { label: moveDown, tooltip: moveDown, size: "sm", variant: "ghost", icon: icon(IconArrowDown), onClick: () => props.onMove(message.id, 'down') })) : null, _jsx(IconButton, { label: remove, tooltip: remove, size: "sm", variant: "ghost", icon: icon(IconX), onClick: () => props.onRemove(message.id) })] })] }));
|
|
79
|
+
return (_jsxs(HStack, { gap: 0.5, children: [_jsx(IconButton, { label: edit, tooltip: edit, size: "sm", variant: "ghost", icon: icon(IconPencil), onClick: () => props.onRestore(message.id) }), message.kind === 'stash' ? (_jsx(IconButton, { label: queue, tooltip: queue, size: "sm", variant: "ghost", icon: icon(IconCornerDownLeft), onClick: () => props.onQueue(message.id) })) : null, _jsx(IconButton, { label: sendNow, tooltip: sendNow, size: "sm", variant: "ghost", icon: icon(IconSend), onClick: () => props.onSendNow(message.id) }), props.moves.up ? (_jsx(IconButton, { label: moveUp, tooltip: moveUp, size: "sm", variant: "ghost", icon: icon(IconArrowUp), onClick: () => props.onMove(message.id, 'up') })) : null, props.moves.down ? (_jsx(IconButton, { label: moveDown, tooltip: moveDown, size: "sm", variant: "ghost", icon: icon(IconArrowDown), onClick: () => props.onMove(message.id, 'down') })) : null, _jsx(IconButton, { label: remove, tooltip: remove, size: "sm", variant: "ghost", icon: icon(IconX), onClick: () => props.onRemove(message.id) })] }));
|
|
72
80
|
}
|
|
73
81
|
/** The model and effort choices this profile offers; efforts only for a chosen model. */
|
|
74
82
|
export function generationOptions(iface, selectedModel) {
|
package/ui/ChatComposerRow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatComposerStatus } from '@astryxdesign/core/Chat';
|
|
2
2
|
import { type ReactNode, type RefObject } from 'react';
|
|
3
|
-
import type { BackgroundJob } from '../client/transcript-groups.
|
|
3
|
+
import type { BackgroundJob } from '../client/transcript-groups.js';
|
|
4
4
|
/**
|
|
5
5
|
* The glyphs the row composer draws. Each one left out keeps Theorem's.
|
|
6
6
|
* Text is in the labels (`@theorem.composer.pill.*`, `@theorem.composer.tray.*`); sizes, colours,
|
package/ui/ChatTranscript.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import type { LabelOverrides } from '@theoremjs/agents';
|
|
|
3
3
|
import { type TranscriptBlock } from '@theoremjs/agents/interface';
|
|
4
4
|
import type { AnsweringGate } from '@theoremjs/web/client';
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
-
import { type ComposeAssistantTurnOptions } from '../client/transcript-groups.
|
|
7
|
-
import { type TurnClock } from '../hooks/use-turn-clock.
|
|
8
|
-
import { type ToolDecision } from './ToolGateCard.
|
|
9
|
-
import { type MediaReference } from './tool-media.
|
|
6
|
+
import { type ComposeAssistantTurnOptions } from '../client/transcript-groups.js';
|
|
7
|
+
import { type TurnClock } from '../hooks/use-turn-clock.js';
|
|
8
|
+
import { type ToolDecision } from './ToolGateCard.js';
|
|
9
|
+
import { type MediaReference } from './tool-media.js';
|
|
10
10
|
export type ChatTranscriptProps = {
|
|
11
11
|
blocks: readonly TranscriptBlock[];
|
|
12
12
|
/** Assistant display name (profile handle). */
|
package/ui/ConsoleFrame.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
2
2
|
import type { HttpOptions } from '@theoremjs/web/client';
|
|
3
3
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
4
|
-
import type { TheoremLabels } from './labels.
|
|
5
|
-
import { type TraceInspector } from './TraceInspectorPanel.
|
|
4
|
+
import type { TheoremLabels } from './labels.js';
|
|
5
|
+
import { type TraceInspector } from './TraceInspectorPanel.js';
|
|
6
6
|
/** The props a one-call console page shares: its look, its wording, its trace, and its layout. */
|
|
7
7
|
export type ConsolePageProps = {
|
|
8
8
|
/** Extra fetch options for the default HTTP transport (auth headers, custom fetch). */
|
package/ui/DecisionAnswers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DecisionJson, DecisionResult } from '@theoremjs/agents';
|
|
2
2
|
import type { DecisionInterface } from '@theoremjs/web/client';
|
|
3
3
|
import { type ReactNode } from 'react';
|
|
4
|
-
import { type DecisionImages } from '../client/decision-images.
|
|
4
|
+
import { type DecisionImages } from '../client/decision-images.js';
|
|
5
5
|
export type TheoremDecisionAnswersProps = {
|
|
6
6
|
iface: DecisionInterface;
|
|
7
7
|
result: DecisionResult;
|
package/ui/DecisionImages.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DecisionAsset } from '@theoremjs/agents';
|
|
2
|
+
import { type DecisionImages } from '../client/decision-images.js';
|
|
2
3
|
/**
|
|
3
4
|
* Reads each file as an image and hands over the ones that are, with the name of the first that
|
|
4
5
|
* is not as the refusal to show.
|
|
5
6
|
*/
|
|
6
7
|
export declare function useImageReader(): {
|
|
7
|
-
read: (files: File | File[] | null) => Promise<[File,
|
|
8
|
+
read: (files: File | File[] | null) => Promise<[File, DecisionAsset][]>;
|
|
8
9
|
status: {
|
|
9
|
-
type:
|
|
10
|
+
type: 'error';
|
|
10
11
|
message: string;
|
|
11
12
|
} | undefined;
|
|
12
13
|
};
|
|
@@ -2,8 +2,8 @@ import { type EmbeddingInput } from '@theoremjs/agents';
|
|
|
2
2
|
import type { EmbeddingInterface } from '@theoremjs/web/client';
|
|
3
3
|
import { type EmbeddingInputCheck, type EmbeddingMediaPart } from '@theoremjs/web/client';
|
|
4
4
|
import { type ReactNode } from 'react';
|
|
5
|
-
import { type ConsoleView } from './ConsoleFrame.
|
|
6
|
-
import type { LabelText } from './labels.
|
|
5
|
+
import { type ConsoleView } from './ConsoleFrame.js';
|
|
6
|
+
import type { LabelText } from './labels.js';
|
|
7
7
|
/** The profile's `inputs`, which every request is held to. */
|
|
8
8
|
export type Rules = EmbeddingInterface['inputs'];
|
|
9
9
|
/** A document as the list shows it: what it sends, and the file it came from. */
|
package/ui/EmbeddingQuery.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EmbeddingInput } from '@theoremjs/agents';
|
|
2
2
|
import { type EmbeddingFields } from '@theoremjs/web/client';
|
|
3
|
-
import { type ConsoleView } from './ConsoleFrame.
|
|
4
|
-
import { type Rules } from './EmbeddingDocuments.
|
|
3
|
+
import { type ConsoleView } from './ConsoleFrame.js';
|
|
4
|
+
import { type Rules } from './EmbeddingDocuments.js';
|
|
5
5
|
/** Where the embedded documents stand for a search: as embedded, or changed since. */
|
|
6
6
|
export type IndexState = 'fresh' | 'stale' | 'model';
|
|
7
7
|
/** The query, held as the JSON of the one input it sends, and the view it is edited in. */
|
package/ui/EmbeddingResults.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EmbeddingResult } from '@theoremjs/agents';
|
|
2
2
|
import type { EmbeddingMatch } from '@theoremjs/web/client';
|
|
3
|
-
import type { EmbeddingIndex, IndexProgress } from '../hooks/use-embedding-index.
|
|
4
|
-
import type { OneCallState } from '../hooks/use-one-call.
|
|
5
|
-
import { type EmbeddingDocument } from './EmbeddingDocuments.
|
|
3
|
+
import type { EmbeddingIndex, IndexProgress } from '../hooks/use-embedding-index.js';
|
|
4
|
+
import type { OneCallState } from '../hooks/use-one-call.js';
|
|
5
|
+
import { type EmbeddingDocument } from './EmbeddingDocuments.js';
|
|
6
6
|
/** Which document the space and the matches both point at, and how either changes it. */
|
|
7
7
|
export type Pointing = {
|
|
8
8
|
hovered: number | null;
|
package/ui/LiveCallTile.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
2
|
-
import type { LiveCall } from '../components/live/use-live-call.
|
|
3
|
-
import { type TheoremLabels } from './labels.
|
|
2
|
+
import type { LiveCall } from '../components/live/use-live-call.js';
|
|
3
|
+
import { type TheoremLabels } from './labels.js';
|
|
4
4
|
export type LiveCallTileProps = {
|
|
5
5
|
/** The call to draw, from `useLiveCall`: the same call `LiveRunner` draws. */
|
|
6
6
|
call: LiveCall;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import { type LiveCaptionState, type LiveCaptionTurn } from '../client/live/live-captions.
|
|
2
|
+
import { type LiveCaptionState, type LiveCaptionTurn } from '../client/live/live-captions.js';
|
|
3
3
|
export type LiveCaptionsPanelProps = {
|
|
4
4
|
/** Profile handle. The transcript shows it as the agent's name. */
|
|
5
5
|
handle: string;
|
package/ui/LiveRunner.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
2
|
-
import type { LiveCall } from '../components/live/use-live-call.
|
|
3
|
-
import { type TheoremLabels } from './labels.
|
|
4
|
-
import { type TheoremChatProps } from './TheoremChat.
|
|
2
|
+
import type { LiveCall } from '../components/live/use-live-call.js';
|
|
3
|
+
import { type TheoremLabels } from './labels.js';
|
|
4
|
+
import { type TheoremChatProps } from './TheoremChat.js';
|
|
5
5
|
/** `media` and `resolveMedia` are the chat's: the captions show a tool's media as the chat does. */
|
|
6
6
|
export type LiveRunnerProps = Pick<TheoremChatProps, 'media' | 'resolveMedia'> & {
|
|
7
7
|
/** The call to draw, from `useLiveCall`. The call outlives the runner: it ends when its owner unmounts. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LiveCall } from '../components/live/use-live-call.
|
|
1
|
+
import type { LiveCall } from '../components/live/use-live-call.js';
|
|
2
2
|
/**
|
|
3
3
|
* Tool approvals and credential prompts, as a dialog that must be answered. It shows the card
|
|
4
4
|
* chat shows inline and nothing else, and closes on the answer. `LiveRunner` and
|
package/ui/LiveVideoPreview.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LiveFacingMode } from '../client/live/live-video.
|
|
1
|
+
import type { LiveFacingMode } from '../client/live/live-video.js';
|
|
2
2
|
/**
|
|
3
3
|
* The camera preview: atop the call's captions, or in its tile. The capture element comes
|
|
4
4
|
* from the session client, so it is mounted imperatively; it sits one level
|
package/ui/RadialCharts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type RankedBar } from './RankedBars.
|
|
2
|
-
import { type TraceFill } from './trace-patterns.
|
|
1
|
+
import { type RankedBar } from './RankedBars.js';
|
|
2
|
+
import { type TraceFill } from './trace-patterns.js';
|
|
3
3
|
/**
|
|
4
4
|
* One ring per row, the first outermost, each drawn round its track as far as its value goes, with
|
|
5
5
|
* a key beside it in the same order. `max` fixes the scale, for figures such as rates that share one.
|
package/ui/RankedBars.d.ts
CHANGED
package/ui/SchemaFields.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JsonSchema } from '@theoremjs/web/client';
|
|
2
|
-
import { type Edit as StateEdit } from './StateFields.
|
|
2
|
+
import { type Edit as StateEdit } from './StateFields.js';
|
|
3
3
|
/**
|
|
4
4
|
* A tool's request as a form drawn from its input schema: each field the
|
|
5
5
|
* input its type asks for, labelled by its title or key and described by its
|
package/ui/StateFields.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DecisionJson } from '@theoremjs/agents';
|
|
2
|
-
import { type DecisionImages } from '../client/decision-images.
|
|
2
|
+
import { type DecisionImages } from '../client/decision-images.js';
|
|
3
3
|
export type Edit<T = DecisionJson> = {
|
|
4
4
|
value: T;
|
|
5
5
|
onChange: (next: T) => void;
|
package/ui/TheoremChat.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { type ComposerPendingMessage, type ComposerProfileInterface } from '@the
|
|
|
4
4
|
import type { ChatController, PageTools, StatedTurn } from '@theoremjs/web/client';
|
|
5
5
|
import { type ConversationView, type HttpTransportOptions, type TheoremTransport } from '@theoremjs/web/client';
|
|
6
6
|
import { type ReactNode, type Ref } from 'react';
|
|
7
|
-
import { type SendTextOptions, type SentTurn, type TheoremChatState, type UseTheoremChatOptions } from '../hooks/use-theorem-chat.
|
|
8
|
-
import { type ComposerLayout } from './ChatComposerBar.
|
|
9
|
-
import type { ComposerRowIcons } from './ChatComposerRow.
|
|
10
|
-
import { type ChatTranscriptProps } from './ChatTranscript.
|
|
11
|
-
import type { TheoremLabels } from './labels.
|
|
12
|
-
import type { ResolveMedia, ToolMediaShown } from './tool-media.
|
|
7
|
+
import { type SendTextOptions, type SentTurn, type TheoremChatState, type UseTheoremChatOptions } from '../hooks/use-theorem-chat.js';
|
|
8
|
+
import { type ComposerLayout } from './ChatComposerBar.js';
|
|
9
|
+
import type { ComposerRowIcons } from './ChatComposerRow.js';
|
|
10
|
+
import { type ChatTranscriptProps } from './ChatTranscript.js';
|
|
11
|
+
import type { TheoremLabels } from './labels.js';
|
|
12
|
+
import type { ResolveMedia, ToolMediaShown } from './tool-media.js';
|
|
13
13
|
export type TheoremChatProps = {
|
|
14
14
|
/** Where `createTheoremHandler` is mounted. Default `/api/theorem`. Ignored when `transport` is set. */
|
|
15
15
|
endpoint?: string;
|
package/ui/TheoremDecision.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DecisionTransport } from '@theoremjs/web/client';
|
|
2
|
-
import { type DecisionImages } from '../client/decision-images.
|
|
3
|
-
import { type ConsolePageProps } from './ConsoleFrame.
|
|
4
|
-
import { type TheoremDecisionAnswersProps } from './DecisionAnswers.
|
|
2
|
+
import { type DecisionImages } from '../client/decision-images.js';
|
|
3
|
+
import { type ConsolePageProps } from './ConsoleFrame.js';
|
|
4
|
+
import { type TheoremDecisionAnswersProps } from './DecisionAnswers.js';
|
|
5
5
|
export type TheoremDecisionProps = ConsolePageProps & {
|
|
6
6
|
/** Where `createTheoremDecisionHandler` is mounted. Default `/api/decision`. Ignored when `transport` is set. */
|
|
7
7
|
endpoint?: string;
|
package/ui/TheoremEmbedding.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EmbeddingTransport } from '@theoremjs/web/client';
|
|
2
|
-
import { type ConsolePageProps } from './ConsoleFrame.
|
|
3
|
-
import { type EmbeddingDocument } from './EmbeddingDocuments.
|
|
2
|
+
import { type ConsolePageProps } from './ConsoleFrame.js';
|
|
3
|
+
import { type EmbeddingDocument } from './EmbeddingDocuments.js';
|
|
4
4
|
export type TheoremEmbeddingProps = ConsolePageProps & {
|
|
5
5
|
/** Where `createTheoremEmbeddingHandler` is mounted. Default `/api/embedding`. Ignored when `transport` is set. */
|
|
6
6
|
endpoint?: string;
|
package/ui/TheoremHost.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
|
2
2
|
import type { HttpOptions, PageTools } from '@theoremjs/web/client';
|
|
3
3
|
import { type HostTransport } from '@theoremjs/web/client';
|
|
4
4
|
import { type CSSProperties } from 'react';
|
|
5
|
-
import { type TheoremLabels } from './labels.
|
|
6
|
-
import type { ResolveMedia } from './tool-media.
|
|
5
|
+
import { type TheoremLabels } from './labels.js';
|
|
6
|
+
import type { ResolveMedia } from './tool-media.js';
|
|
7
7
|
export type TheoremHostProps = {
|
|
8
8
|
/** Where `createTheoremHostHandler` is mounted. Default `/api/host`. Ignored when `transport` is set. */
|
|
9
9
|
endpoint?: string;
|
package/ui/TheoremSurface.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DefinedTheme } from '@astryxdesign/core/theme';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
-
import type { TheoremLabels } from './labels.
|
|
4
|
-
import { type ResolveMedia, type ToolMediaShown } from './tool-media.
|
|
3
|
+
import type { TheoremLabels } from './labels.js';
|
|
4
|
+
import { type ResolveMedia, type ToolMediaShown } from './tool-media.js';
|
|
5
5
|
/** What `TheoremSurface` takes: each is the `TheoremChat` prop of the same name. */
|
|
6
6
|
export type TheoremSurfaceProps = {
|
|
7
7
|
theme?: DefinedTheme;
|
package/ui/TraceCharts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TraceTimeSplit, type TraceTurn } from '../client/trace-story.
|
|
2
|
-
import { type TraceNode } from '../client/trace-view.
|
|
1
|
+
import { type TraceTimeSplit, type TraceTurn } from '../client/trace-story.js';
|
|
2
|
+
import { type TraceNode } from '../client/trace-view.js';
|
|
3
3
|
/** Where a turn's time, tokens, and slowest steps went. A bar opens its span. */
|
|
4
4
|
export declare function TraceCharts({ root, split, onSelect, }: {
|
|
5
5
|
root: TraceNode;
|
package/ui/TraceGuardrails.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TraceGuardrailCheck } from '../client/trace-story.
|
|
2
|
-
import type { TraceNode } from '../client/trace-view.
|
|
1
|
+
import type { TraceGuardrailCheck } from '../client/trace-story.js';
|
|
2
|
+
import type { TraceNode } from '../client/trace-view.js';
|
|
3
3
|
/**
|
|
4
4
|
* Every guardrail check of the turn. The ones that acted lead, each with the
|
|
5
5
|
* rules it matched and why; the passes follow on one quiet line.
|
|
@@ -2,7 +2,7 @@ import type { TraceRecord } from '@theoremjs/agents';
|
|
|
2
2
|
import type { ProfileObservabilityView } from '@theoremjs/agents/interface';
|
|
3
3
|
import type { TraceFeed } from '@theoremjs/web/client';
|
|
4
4
|
import { type ReactNode } from 'react';
|
|
5
|
-
import { type SidePanelLabels } from './SidePanel.
|
|
5
|
+
import { type SidePanelLabels } from './SidePanel.js';
|
|
6
6
|
export type TraceInspector = {
|
|
7
7
|
/** The header toggle; null when the host drives the trace or the profile records none. */
|
|
8
8
|
toggle: ReactNode;
|
package/ui/TraceOverview.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type TraceLatency, type TraceTurn } from '../client/trace-story.
|
|
3
|
-
import type { TraceTotals } from '../client/trace-view.
|
|
2
|
+
import { type TraceLatency, type TraceTurn } from '../client/trace-story.js';
|
|
3
|
+
import type { TraceTotals } from '../client/trace-view.js';
|
|
4
4
|
/** Width a chart draws at before it has measured its column: the panel's narrowest. */
|
|
5
5
|
export declare const FIRST_WIDTH_PX = 280;
|
|
6
6
|
/**
|
package/ui/TraceSpanDetail.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TraceNode } from '../client/trace-view.
|
|
1
|
+
import { type TraceNode } from '../client/trace-view.js';
|
|
2
2
|
/** One span in full: who acted and how it ended, what went in and came out, its tokens, then every detail it recorded. */
|
|
3
3
|
export declare function TraceSpanDetail({ node, turnStartMs, isClose, onBack, onOpen, }: {
|
|
4
4
|
node: TraceNode;
|
package/ui/TraceStory.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconUser } from '@tabler/icons-react';
|
|
2
|
-
import { type TraceActor, type TraceStep } from '../client/trace-story.
|
|
3
|
-
import type { TraceNode } from '../client/trace-view.
|
|
2
|
+
import { type TraceActor, type TraceStep } from '../client/trace-story.js';
|
|
3
|
+
import type { TraceNode } from '../client/trace-view.js';
|
|
4
4
|
/** An actor's icon, in the text's own colour. */
|
|
5
5
|
export declare function ActorMark({ actor, icon }: {
|
|
6
6
|
actor: TraceActor;
|
package/ui/TraceValues.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TraceAttributeGroup, type TraceAttributeMeta, type TraceRecord } from '@theoremjs/agents';
|
|
2
|
-
import { type TraceSum, type TraceTokenSum } from '../client/trace-view.
|
|
3
|
-
import { type LabelText } from './labels.
|
|
2
|
+
import { type TraceSum, type TraceTokenSum } from '../client/trace-view.js';
|
|
3
|
+
import { type LabelText } from './labels.js';
|
|
4
4
|
/** Width of every label column in the panel's lists, so they line up. */
|
|
5
5
|
export declare const TRACE_LABEL_PX = 120;
|
|
6
6
|
export type AttributeSection = {
|
package/ui/TraceWaterfall.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TraceNode } from '../client/trace-view.
|
|
1
|
+
import type { TraceNode } from '../client/trace-view.js';
|
|
2
2
|
/**
|
|
3
3
|
* Every span of the turn on one time axis, nested by depth and coloured by
|
|
4
4
|
* who acted. Above it, how busy the model and tools were over the turn; drag
|
package/ui/approval-heading.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ToolGate } from '@theoremjs/agents/kernel';
|
|
2
|
-
import type { LabelText } from './labels.
|
|
2
|
+
import type { LabelText } from './labels.js';
|
|
3
3
|
/** "@concierge wants to check the weather": the tool's `labels.request`, else its name in words. */
|
|
4
4
|
export declare function approvalHeading(t: LabelText, gate: ToolGate, toolName: string, agent?: string): string;
|
package/ui/index.d.ts
CHANGED
|
@@ -9,35 +9,35 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
export type { LiveCallOptions, PageTool, PageToolAnswer, PageTools, } from '@theoremjs/web/client';
|
|
12
|
-
export type { InkWaveStatus } from '../client/ink-waveform.
|
|
13
|
-
export { useLiveCaptionLog } from '../client/live/use-live-caption-log.
|
|
14
|
-
export { InkWaveform, type InkWaveformProps, type InkWaveLevels, } from '../components/InkWaveform.
|
|
15
|
-
export { type LiveCall, type LiveCallInput, useLiveCall, } from '../components/live/use-live-call.
|
|
12
|
+
export type { InkWaveStatus } from '../client/ink-waveform.js';
|
|
13
|
+
export { useLiveCaptionLog } from '../client/live/use-live-caption-log.js';
|
|
14
|
+
export { InkWaveform, type InkWaveformProps, type InkWaveLevels, } from '../components/InkWaveform.js';
|
|
15
|
+
export { type LiveCall, type LiveCallInput, useLiveCall, } from '../components/live/use-live-call.js';
|
|
16
16
|
export { theoremTheme } from './built/theorem.js';
|
|
17
|
-
export { ChatComposerBar, type ChatComposerBarProps, type ComposerLayout, EFFORT_ICON, generationOptions, type LiveComposerBarProps, } from './ChatComposerBar.
|
|
18
|
-
export type { ComposerRowIcons } from './ChatComposerRow.
|
|
19
|
-
export { ChatTranscript, type ChatTranscriptProps } from './ChatTranscript.
|
|
20
|
-
export { ConsoleFrame, type ConsoleFrameProps, type ConsolePageProps, RequestCard, ResponseColumn, RunBar, useBytes, } from './ConsoleFrame.
|
|
21
|
-
export { TheoremDecisionAnswers, type TheoremDecisionAnswersProps } from './DecisionAnswers.
|
|
22
|
-
export { useDisclosureMotion } from './disclosure-motion.
|
|
23
|
-
export { EmbeddingSpaceView, type EmbeddingSpaceViewProps } from './EmbeddingSpace.
|
|
24
|
-
export { tablerIcons } from './icons.
|
|
25
|
-
export { LiveCaptionsPanel, type LiveCaptionsPanelProps } from './LiveCaptionsPanel.
|
|
26
|
-
export { composerDrawerLabel, type LabelText, liveStateLabel, THEOREM_UI_CATALOG, type TheoremLabelKey, type TheoremLabelOverrides, type TheoremLabels, type TheoremLabelValues, type TheoremUiCatalog, voiceNoteName, workStatusLabel, } from './labels.
|
|
27
|
-
export { TheoremLabelsProvider, type TheoremLabelsProviderProps, useLabels, } from './labels-provider.
|
|
28
|
-
export { PaneFailure, PaneLoading, PaneState } from './PaneState.
|
|
29
|
-
export { RadialBars, Sunburst, type SunburstNode } from './RadialCharts.
|
|
30
|
-
export { type RankedBar, RankedBars } from './RankedBars.
|
|
31
|
-
export { InPlace, PaneLayout, PanePanel, Prose, RaisedPane } from './SidePanel.
|
|
32
|
-
export { DEFAULT_CHAT_MAX_WIDTH, TheoremChat, TheoremChatComposer, type TheoremChatComposerProps, type TheoremChatHandle, type TheoremChatProps, TheoremChatTranscript, type TheoremChatTranscriptProps, } from './TheoremChat.
|
|
33
|
-
export { TheoremDecision, type TheoremDecisionProps } from './TheoremDecision.
|
|
34
|
-
export { TheoremEmbedding, type TheoremEmbeddingProps } from './TheoremEmbedding.
|
|
35
|
-
export { TheoremHost, type TheoremHostProps } from './TheoremHost.
|
|
36
|
-
export { TheoremSurface, type TheoremSurfaceProps } from './TheoremSurface.
|
|
37
|
-
export { ApprovalCard, type ApprovalCardProps, AuthChallengeCard, type AuthChallengeCardProps, type ToolDecision, } from './ToolGateCard.
|
|
38
|
-
export { ToolResult } from './ToolResult.
|
|
39
|
-
export { TraceGuardrailsView, TracePlacement, useTraceInspector } from './TraceInspectorPanel.
|
|
40
|
-
export { ChartStat } from './TraceOverview.
|
|
41
|
-
export { TheoremThemeProvider, type TheoremThemeProviderProps } from './theme.
|
|
42
|
-
export { type MediaReference, type ResolveMedia, ToolMediaProvider, type ToolMediaShown, } from './tool-media.
|
|
43
|
-
export { ChartCard, type TraceFill } from './trace-patterns.
|
|
17
|
+
export { ChatComposerBar, type ChatComposerBarProps, type ComposerLayout, EFFORT_ICON, generationOptions, type LiveComposerBarProps, } from './ChatComposerBar.js';
|
|
18
|
+
export type { ComposerRowIcons } from './ChatComposerRow.js';
|
|
19
|
+
export { ChatTranscript, type ChatTranscriptProps } from './ChatTranscript.js';
|
|
20
|
+
export { ConsoleFrame, type ConsoleFrameProps, type ConsolePageProps, RequestCard, ResponseColumn, RunBar, useBytes, } from './ConsoleFrame.js';
|
|
21
|
+
export { TheoremDecisionAnswers, type TheoremDecisionAnswersProps } from './DecisionAnswers.js';
|
|
22
|
+
export { useDisclosureMotion } from './disclosure-motion.js';
|
|
23
|
+
export { EmbeddingSpaceView, type EmbeddingSpaceViewProps } from './EmbeddingSpace.js';
|
|
24
|
+
export { tablerIcons } from './icons.js';
|
|
25
|
+
export { LiveCaptionsPanel, type LiveCaptionsPanelProps } from './LiveCaptionsPanel.js';
|
|
26
|
+
export { composerDrawerLabel, type LabelText, liveStateLabel, THEOREM_UI_CATALOG, type TheoremLabelKey, type TheoremLabelOverrides, type TheoremLabels, type TheoremLabelValues, type TheoremUiCatalog, voiceNoteName, workStatusLabel, } from './labels.js';
|
|
27
|
+
export { TheoremLabelsProvider, type TheoremLabelsProviderProps, useLabels, } from './labels-provider.js';
|
|
28
|
+
export { PaneFailure, PaneLoading, PaneState } from './PaneState.js';
|
|
29
|
+
export { RadialBars, Sunburst, type SunburstNode } from './RadialCharts.js';
|
|
30
|
+
export { type RankedBar, RankedBars } from './RankedBars.js';
|
|
31
|
+
export { InPlace, PaneLayout, PanePanel, Prose, RaisedPane } from './SidePanel.js';
|
|
32
|
+
export { DEFAULT_CHAT_MAX_WIDTH, TheoremChat, TheoremChatComposer, type TheoremChatComposerProps, type TheoremChatHandle, type TheoremChatProps, TheoremChatTranscript, type TheoremChatTranscriptProps, } from './TheoremChat.js';
|
|
33
|
+
export { TheoremDecision, type TheoremDecisionProps } from './TheoremDecision.js';
|
|
34
|
+
export { TheoremEmbedding, type TheoremEmbeddingProps } from './TheoremEmbedding.js';
|
|
35
|
+
export { TheoremHost, type TheoremHostProps } from './TheoremHost.js';
|
|
36
|
+
export { TheoremSurface, type TheoremSurfaceProps } from './TheoremSurface.js';
|
|
37
|
+
export { ApprovalCard, type ApprovalCardProps, AuthChallengeCard, type AuthChallengeCardProps, type ToolDecision, } from './ToolGateCard.js';
|
|
38
|
+
export { ToolResult } from './ToolResult.js';
|
|
39
|
+
export { TraceGuardrailsView, TracePlacement, useTraceInspector } from './TraceInspectorPanel.js';
|
|
40
|
+
export { ChartStat } from './TraceOverview.js';
|
|
41
|
+
export { TheoremThemeProvider, type TheoremThemeProviderProps } from './theme.js';
|
|
42
|
+
export { type MediaReference, type ResolveMedia, ToolMediaProvider, type ToolMediaShown, } from './tool-media.js';
|
|
43
|
+
export { ChartCard, type TraceFill } from './trace-patterns.js';
|
package/ui/labels-provider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import { type LabelText, type TheoremLabels } from './labels.
|
|
2
|
+
import { type LabelText, type TheoremLabels } from './labels.js';
|
|
3
3
|
export type TheoremLabelsProviderProps = {
|
|
4
4
|
/** Replacements by locale for any `@theorem.*` or `@astryx.*` line; checked on mount. */
|
|
5
5
|
labels?: TheoremLabels;
|
package/ui/labels.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
import { type ComposerDrawerSummary, type LiveState } from '@theoremjs/web/client';
|
|
11
|
-
import type { LiveActiveTool } from '../client/live/apply-live-turn-tool-event.
|
|
12
|
-
import type { TurnUsage, WorkStatus } from '../client/transcript-groups.
|
|
11
|
+
import type { LiveActiveTool } from '../client/live/apply-live-turn-tool-event.js';
|
|
12
|
+
import type { TurnUsage, WorkStatus } from '../client/transcript-groups.js';
|
|
13
13
|
export declare const THEOREM_UI_CATALOG: {
|
|
14
14
|
readonly '@theorem.agent.handle': {
|
|
15
15
|
readonly defaultMessage: "@{handle}";
|
|
@@ -184,6 +184,14 @@ export declare const THEOREM_UI_CATALOG: {
|
|
|
184
184
|
readonly defaultMessage: "Steering: the agent reads it at its next step.";
|
|
185
185
|
readonly description: "Tooltip on a waiting steering message.";
|
|
186
186
|
};
|
|
187
|
+
readonly '@theorem.composer.pending.saved': {
|
|
188
|
+
readonly defaultMessage: "Sent";
|
|
189
|
+
readonly description: "Name of a waiting message the host has saved, read by screen readers on its icon.";
|
|
190
|
+
};
|
|
191
|
+
readonly '@theorem.composer.pending.saved.description': {
|
|
192
|
+
readonly defaultMessage: "Sent: the agent reads it with its next reply.";
|
|
193
|
+
readonly description: "Tooltip on a waiting message the host has saved.";
|
|
194
|
+
};
|
|
187
195
|
readonly '@theorem.composer.pending.queue': {
|
|
188
196
|
readonly defaultMessage: "Queued";
|
|
189
197
|
readonly description: "Name of a waiting queued message, read by screen readers on its icon.";
|
package/ui/labels.js
CHANGED
|
@@ -171,6 +171,14 @@ export const THEOREM_UI_CATALOG = {
|
|
|
171
171
|
defaultMessage: 'Steering: the agent reads it at its next step.',
|
|
172
172
|
description: 'Tooltip on a waiting steering message.',
|
|
173
173
|
},
|
|
174
|
+
'@theorem.composer.pending.saved': {
|
|
175
|
+
defaultMessage: 'Sent',
|
|
176
|
+
description: 'Name of a waiting message the host has saved, read by screen readers on its icon.',
|
|
177
|
+
},
|
|
178
|
+
'@theorem.composer.pending.saved.description': {
|
|
179
|
+
defaultMessage: 'Sent: the agent reads it with its next reply.',
|
|
180
|
+
description: 'Tooltip on a waiting message the host has saved.',
|
|
181
|
+
},
|
|
174
182
|
'@theorem.composer.pending.queue': {
|
|
175
183
|
defaultMessage: 'Queued',
|
|
176
184
|
description: 'Name of a waiting queued message, read by screen readers on its icon.',
|
package/ui/tool-media.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ToolOutputRefPart } from '@theoremjs/agents';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import { type ToolMediaShown } from './tool-media-shown.
|
|
4
|
-
export { type ToolMediaShown, toolMediaShows } from './tool-media-shown.
|
|
3
|
+
import { type ToolMediaShown } from './tool-media-shown.js';
|
|
4
|
+
export { type ToolMediaShown, toolMediaShows } from './tool-media-shown.js';
|
|
5
5
|
/** A reference a tool returned, with the tool's own `metadata`: the person is shown it, the model never read it. */
|
|
6
6
|
export type MediaReference = ToolOutputRefPart;
|
|
7
7
|
/**
|
package/ui/trace-patterns.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import type { TraceActor } from '../client/trace-story.
|
|
2
|
+
import type { TraceActor } from '../client/trace-story.js';
|
|
3
3
|
/**
|
|
4
4
|
* The trace charts' fills, one per series in order: the first is clear (a
|
|
5
5
|
* solid), the second a fine hatch, and the rest shades of deep navy (#0D1E37).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TranscriptBlock } from '@theoremjs/agents/interface';
|
|
2
|
-
import type { LabelText } from './labels.
|
|
2
|
+
import type { LabelText } from './labels.js';
|
|
3
3
|
/** Plain text copied from a transcript block. */
|
|
4
4
|
export declare function transcriptBlockCopyText(t: LabelText, block: TranscriptBlock): string;
|