@usetheo/ui 0.23.0 → 0.27.0
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/dist/components/composites/annotation-input/annotation-input.d.ts +38 -0
- package/dist/components/composites/annotation-input/index.d.ts +4 -0
- package/dist/components/composites/annotation-input/types.d.ts +31 -0
- package/dist/components/composites/annotation-summary-group/annotation-summary-group.d.ts +28 -0
- package/dist/components/composites/annotation-summary-group/index.d.ts +1 -0
- package/dist/components/composites/chat-message-card/chat-message-card.d.ts +14 -0
- package/dist/components/composites/chat-message-card/index.d.ts +1 -0
- package/dist/components/composites/comment-thread/comment-thread.d.ts +24 -0
- package/dist/components/composites/comment-thread/index.d.ts +2 -0
- package/dist/components/composites/dataset-item-diff/dataset-item-diff.d.ts +19 -0
- package/dist/components/composites/dataset-item-diff/index.d.ts +4 -0
- package/dist/components/composites/dataset-item-diff/to-diff-text.d.ts +22 -0
- package/dist/components/composites/diff-view/diff-section.d.ts +19 -0
- package/dist/components/composites/diff-view/diff-view.d.ts +39 -0
- package/dist/components/composites/diff-view/index.d.ts +2 -0
- package/dist/components/composites/evaluator-form/evaluator-form.d.ts +25 -0
- package/dist/components/composites/evaluator-form/index.d.ts +3 -0
- package/dist/components/composites/evaluator-form/types.d.ts +41 -0
- package/dist/components/composites/histogram/histogram.d.ts +19 -0
- package/dist/components/composites/histogram/index.d.ts +2 -0
- package/dist/components/composites/message-branch-selector/index.d.ts +1 -0
- package/dist/components/composites/message-branch-selector/message-branch-selector.d.ts +27 -0
- package/dist/components/composites/percentile-chart/index.d.ts +2 -0
- package/dist/components/composites/percentile-chart/percentile-chart.d.ts +37 -0
- package/dist/components/composites/price-breakdown/index.d.ts +2 -0
- package/dist/components/composites/price-breakdown/price-breakdown.d.ts +21 -0
- package/dist/components/composites/prompt-template-editor/extract-vars.d.ts +1 -0
- package/dist/components/composites/prompt-template-editor/index.d.ts +2 -0
- package/dist/components/composites/prompt-template-editor/prompt-template-editor.d.ts +24 -0
- package/dist/components/composites/prompt-version-diff/index.d.ts +4 -0
- package/dist/components/composites/prompt-version-diff/prompt-version-diff.d.ts +20 -0
- package/dist/components/composites/prompt-version-diff/to-diff-text.d.ts +26 -0
- package/dist/components/composites/session-summary/index.d.ts +1 -0
- package/dist/components/composites/session-summary/session-summary.d.ts +18 -0
- package/dist/components/composites/session-timeline/index.d.ts +1 -0
- package/dist/components/composites/session-timeline/session-timeline.d.ts +22 -0
- package/dist/components/composites/severity-badge/index.d.ts +2 -0
- package/dist/components/composites/severity-badge/severity-badge.d.ts +33 -0
- package/dist/components/composites/tag-input/index.d.ts +2 -0
- package/dist/components/composites/tag-input/tag-input.d.ts +32 -0
- package/dist/components/composites/token-cost-breakdown/index.d.ts +2 -0
- package/dist/components/composites/token-cost-breakdown/token-cost-breakdown.d.ts +26 -0
- package/dist/index.d.ts +43 -6
- package/dist/index.js +1533 -1
- package/dist/lib/chart/histogram.d.ts +21 -0
- package/dist/lib/chart/index.d.ts +1 -0
- package/dist/lib/diff/diff-lines.d.ts +23 -0
- package/dist/lib/diff/index.d.ts +1 -0
- package/dist/lib/session/aggregate.d.ts +18 -0
- package/dist/lib/session/index.d.ts +2 -0
- package/dist/lib/session/types.d.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure histogram binning — distributes numeric values into `binCount`
|
|
3
|
+
* equal-width bins over [min, max] and counts how many fall in each.
|
|
4
|
+
*
|
|
5
|
+
* Zero-dependency, total, deterministic (M11 ADR D2 — binning is pure logic,
|
|
6
|
+
* distinct from the SVG scaling reused from TrendChart). Non-finite values
|
|
7
|
+
* (NaN / ±Infinity) are dropped, mirroring the trace-core `Number.isFinite`
|
|
8
|
+
* discipline. A degenerate range (all values equal) collapses to a single
|
|
9
|
+
* populated bin so no count is lost.
|
|
10
|
+
*/
|
|
11
|
+
/** One histogram bucket: half-open [lo, hi) except the final bin, which is [lo, hi] (max-inclusive). */
|
|
12
|
+
export interface HistogramBin {
|
|
13
|
+
lo: number;
|
|
14
|
+
hi: number;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Bin `values` into `binCount` equal-width buckets.
|
|
19
|
+
* Returns `[]` for an empty input or a non-positive `binCount`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function computeHistogram(values: number[], binCount: number): HistogramBin[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./histogram.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure line-level diff via Longest Common Subsequence (M14 ADR D1 — zero
|
|
3
|
+
* dependency, keeps the registry copy-pasteable; no `diff`/`@pierre/diffs`).
|
|
4
|
+
* Suitable for the design-system case (prompts / JSON, < ~500 lines);
|
|
5
|
+
* O(n·m) time. A row is `eq` (unchanged), `del` (only in old), or `add`
|
|
6
|
+
* (only in new). Line numbers are honest: `del` has no rightNo, `add` has no
|
|
7
|
+
* leftNo. Deterministic, total — never throws.
|
|
8
|
+
*/
|
|
9
|
+
export type DiffRowKind = "eq" | "del" | "add";
|
|
10
|
+
export interface DiffRow {
|
|
11
|
+
kind: DiffRowKind;
|
|
12
|
+
text: string;
|
|
13
|
+
/** 1-based line number in the old text (absent for `add`). */
|
|
14
|
+
leftNo?: number;
|
|
15
|
+
/** 1-based line number in the new text (absent for `del`). */
|
|
16
|
+
rightNo?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Diff `oldText` against `newText` at line granularity. Returns the aligned
|
|
20
|
+
* sequence of rows (eq / del / add) in reading order. `del` before `add` when a
|
|
21
|
+
* line is replaced.
|
|
22
|
+
*/
|
|
23
|
+
export declare function diffLines(oldText: string, newText: string): DiffRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./diff-lines.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, total session-metric aggregation. Never throws, never does I/O. Honest sums: absent
|
|
3
|
+
* cost/tokens count as 0 (never NaN); the window is max(end) − min(start) over parseable timestamps
|
|
4
|
+
* (an unparseable start is skipped from the window, never a crash).
|
|
5
|
+
*/
|
|
6
|
+
import type { SessionMetrics, SessionTraceItem } from "./types.js";
|
|
7
|
+
/**
|
|
8
|
+
* The session's wall-clock window in ns: [min start, max effective end] over the parseable
|
|
9
|
+
* timestamps. An unparseable start is skipped (never a crash); a clock-skewed/absent end falls back
|
|
10
|
+
* to its own start. A session with no parseable timestamps yields 0/0. This is the SINGLE definition
|
|
11
|
+
* of "a session's time window" — both `aggregateSession` (for `windowMs`) and `SessionTimeline` (for
|
|
12
|
+
* the per-trace bar denominator) consume it, so the window semantics live in one place.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sessionBounds(items: SessionTraceItem[]): {
|
|
15
|
+
startNs: bigint;
|
|
16
|
+
endNs: bigint;
|
|
17
|
+
};
|
|
18
|
+
export declare function aggregateSession(items: SessionTraceItem[]): SessionMetrics;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data contracts for the session-level components (M9). A session groups traces that share a
|
|
3
|
+
* `session.id`; `SessionTraceItem` is the trace-level shape both `SessionSummary` and
|
|
4
|
+
* `SessionTimeline` consume — the intersection of the theo-lens traces-list row and the peer
|
|
5
|
+
* session views (phoenix numTraces+latency+cost, langfuse timestamp+name+latency). Timestamps
|
|
6
|
+
* accept unix-ns (bigint | numeric string) or ISO — normalized by the trace-core `toNs`.
|
|
7
|
+
*/
|
|
8
|
+
export interface SessionTraceItem {
|
|
9
|
+
id: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
/** Unix ns (bigint | numeric string) or ISO-8601 string. */
|
|
12
|
+
startTime?: bigint | string;
|
|
13
|
+
/** Absent/null = in-flight (renders unbounded on the timeline). */
|
|
14
|
+
endTime?: bigint | string | null;
|
|
15
|
+
status?: "OK" | "ERROR";
|
|
16
|
+
model?: string;
|
|
17
|
+
costUsd?: number;
|
|
18
|
+
totalTokens?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Aggregate metrics over a session's traces. All numeric fields are 0 (never NaN) when absent. */
|
|
21
|
+
export interface SessionMetrics {
|
|
22
|
+
traceCount: number;
|
|
23
|
+
/** Session wall-clock window in ms: max(end) − min(start) across all traces. */
|
|
24
|
+
windowMs: number;
|
|
25
|
+
totalCostUsd: number;
|
|
26
|
+
totalTokens: number;
|
|
27
|
+
errorCount: number;
|
|
28
|
+
/** Distinct models seen, sorted. */
|
|
29
|
+
models: string[];
|
|
30
|
+
}
|
package/package.json
CHANGED