@vibefield/rosetta-room 0.1.1 → 0.1.3
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 +82 -4
- package/dist/HistoryRoom.d.ts +15 -2
- package/dist/HistoryRoom.js +84 -27
- package/dist/TranscriptReader.d.ts +7 -0
- package/dist/TranscriptReader.js +4 -4
- package/dist/components/ColdStart.js +1 -1
- package/dist/components/IngestStatus.d.ts +13 -0
- package/dist/components/IngestStatus.js +40 -3
- package/dist/components/IngestionControls.d.ts +6 -0
- package/dist/components/IngestionControls.js +75 -0
- package/dist/components/ListActivityNotice.d.ts +9 -1
- package/dist/components/ListActivityNotice.js +9 -2
- package/dist/components/SummaryPanels.d.ts +5 -0
- package/dist/components/SummaryPanels.js +16 -5
- package/dist/components/Transcript.d.ts +5 -0
- package/dist/components/Transcript.js +20 -5
- package/dist/components/artifacts/ArtifactLibrary.d.ts +14 -0
- package/dist/components/artifacts/ArtifactLibrary.js +156 -0
- package/dist/components/artifacts/content.d.ts +8 -0
- package/dist/components/artifacts/content.js +27 -0
- package/dist/components/artifacts/load-all.d.ts +5 -0
- package/dist/components/artifacts/load-all.js +31 -0
- package/dist/components/artifacts/preview.d.ts +4 -0
- package/dist/components/artifacts/preview.js +37 -0
- package/dist/components/artifacts/thumbnails.d.ts +13 -0
- package/dist/components/artifacts/thumbnails.js +43 -0
- package/dist/components/projects/ProjectList.d.ts +9 -3
- package/dist/components/projects/ProjectList.js +3 -3
- package/dist/components/projects/ProjectListItem.d.ts +9 -3
- package/dist/components/projects/ProjectListItem.js +18 -12
- package/dist/components/projects/ProjectsColumn.d.ts +4 -1
- package/dist/components/projects/ProjectsColumn.js +23 -9
- package/dist/components/search/SearchSheet.d.ts +39 -2
- package/dist/components/search/SearchSheet.js +82 -17
- package/dist/components/sessions/SessionList.d.ts +6 -1
- package/dist/components/sessions/SessionList.js +50 -20
- package/dist/components/sessions/SessionListItem.d.ts +3 -1
- package/dist/components/sessions/SessionListItem.js +17 -7
- package/dist/components/sessions/SessionsColumn.d.ts +3 -1
- package/dist/components/sessions/SessionsColumn.js +2 -2
- package/dist/components/sessions/session-display.d.ts +4 -1
- package/dist/components/sessions/session-display.js +13 -2
- package/dist/components/transcript/Attachments.js +6 -1
- package/dist/components/transcript/Document.d.ts +6 -1
- package/dist/components/transcript/Document.js +19 -6
- package/dist/components/transcript/ImportState.d.ts +35 -0
- package/dist/components/transcript/ImportState.js +86 -0
- package/dist/components/transcript/TranscriptLoading.js +15 -5
- package/dist/components/transcript/attachment-file-source.d.ts +2 -0
- package/dist/components/transcript/attachment-file-source.js +6 -6
- package/dist/components/transcript/attachment-gallery.d.ts +2 -1
- package/dist/components/transcript/attachment-gallery.js +2 -1
- package/dist/components/transcript/detail-parts.js +7 -6
- package/dist/components/transcript/timeline-meta-file-source.d.ts +2 -1
- package/dist/components/transcript/timeline-meta-file-source.js +45 -5
- package/dist/components/ui/EmptyState.d.ts +5 -1
- package/dist/components/ui/EmptyState.js +2 -2
- package/dist/components/ui/Meter.d.ts +8 -0
- package/dist/components/ui/Meter.js +9 -0
- package/dist/components/ui/SegmentedControl.d.ts +2 -0
- package/dist/components/ui/SegmentedControl.js +1 -1
- package/dist/components/ui/Veil.d.ts +2 -1
- package/dist/components/ui/Veil.js +9 -2
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/fixtures/cold-import-corpus.d.ts +76 -0
- package/dist/fixtures/cold-import-corpus.js +349 -0
- package/dist/fixtures/cold-import-daemon.d.ts +25 -0
- package/dist/fixtures/cold-import-daemon.js +82 -0
- package/dist/fixtures/cold-import-schedule.d.ts +74 -0
- package/dist/fixtures/cold-import-schedule.js +191 -0
- package/dist/fixtures/cold-import.d.ts +151 -0
- package/dist/fixtures/cold-import.js +786 -0
- package/dist/fixtures/index.d.ts +2 -0
- package/dist/fixtures/index.js +21 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -0
- package/dist/lib/activity-order.d.ts +15 -0
- package/dist/lib/activity-order.js +24 -1
- package/dist/lib/conversation-readiness.d.ts +48 -0
- package/dist/lib/conversation-readiness.js +149 -0
- package/dist/lib/figure-order.d.ts +35 -0
- package/dist/lib/figure-order.js +68 -0
- package/dist/lib/hooks.d.ts +32 -10
- package/dist/lib/hooks.js +122 -55
- package/dist/lib/image-media.d.ts +12 -2
- package/dist/lib/image-media.js +40 -6
- package/dist/lib/import-state.d.ts +98 -0
- package/dist/lib/import-state.js +129 -0
- package/dist/lib/ingest-activity.d.ts +52 -0
- package/dist/lib/ingest-activity.js +127 -12
- package/dist/lib/ingest.d.ts +3 -0
- package/dist/lib/ingest.js +10 -0
- package/dist/lib/model.d.ts +16 -0
- package/dist/lib/model.js +27 -1
- package/dist/lib/search-sheet.d.ts +43 -0
- package/dist/lib/search-sheet.js +56 -7
- package/dist/lib/session-activity.d.ts +4 -1
- package/dist/lib/session-activity.js +4 -1
- package/dist/lib/title-search.d.ts +82 -0
- package/dist/lib/title-search.js +194 -0
- package/dist/lib/transcript/images.js +2 -2
- package/dist/lib/use-deferred-list-order.d.ts +6 -0
- package/dist/lib/use-deferred-list-order.js +8 -1
- package/dist/lib/use-ingest-activity.d.ts +5 -1
- package/dist/lib/use-ingest-activity.js +56 -20
- package/dist/ports.d.ts +21 -2
- package/dist/room-context.d.ts +1 -0
- package/dist/room-context.js +3 -2
- package/dist/styles/artifacts.css +66 -0
- package/dist/styles/history-room.css +1 -0
- package/dist/styles/ingest.css +32 -3
- package/dist/styles/room.css +15 -0
- package/dist/styles/search.css +17 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useMemo } from "react";
|
|
10
10
|
import { useReadingSession, useRoom } from "../../room-context.js";
|
|
11
11
|
import { resolveKind } from "../file-viewer/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { isRecordedImageAsset } from "../../lib/image-media.js";
|
|
13
13
|
const EXTENSION_BY_MEDIA_TYPE = new Map([
|
|
14
14
|
["image/png", "png"],
|
|
15
15
|
["image/jpeg", "jpg"],
|
|
@@ -35,7 +35,7 @@ export function attachmentViewerName(fact) {
|
|
|
35
35
|
return extension === undefined ? base : `${base}.${extension}`;
|
|
36
36
|
}
|
|
37
37
|
/** One stored image as the viewer asks for it: by rendition, through the host. */
|
|
38
|
-
function imageOf(assets, asset, width, height) {
|
|
38
|
+
export function imageOf(assets, asset, width, height) {
|
|
39
39
|
return { key: asset.digest, url: (rendition) => assets.imageAssetUrl(asset, rendition), width, height };
|
|
40
40
|
}
|
|
41
41
|
export function createAttachmentReader(assets, readAsset) {
|
|
@@ -43,14 +43,14 @@ export function createAttachmentReader(assets, readAsset) {
|
|
|
43
43
|
const source = fact.ref?.source;
|
|
44
44
|
if (source === undefined || source === null || source.type !== "asset")
|
|
45
45
|
return null;
|
|
46
|
-
if (fact.kind === "image" && !
|
|
46
|
+
if (fact.kind === "image" && !isRecordedImageAsset(source.asset))
|
|
47
47
|
return null;
|
|
48
48
|
return assets.attachmentAssetUrl(source.asset);
|
|
49
49
|
}
|
|
50
50
|
function imageResource(fact) {
|
|
51
51
|
const source = fact.ref?.source;
|
|
52
52
|
const asset = source?.type === "asset" && assetUrl(fact) !== null ? source.asset : null;
|
|
53
|
-
if (!asset || !
|
|
53
|
+
if (!asset || !isRecordedImageAsset(asset))
|
|
54
54
|
return null;
|
|
55
55
|
return imageOf(assets, asset, fact.ref?.dimensions?.width, fact.ref?.dimensions?.height);
|
|
56
56
|
}
|
|
@@ -70,13 +70,13 @@ export function createAttachmentReader(assets, readAsset) {
|
|
|
70
70
|
const fileSource = {
|
|
71
71
|
image(handle) {
|
|
72
72
|
const asset = handle.ref;
|
|
73
|
-
if (!asset || !
|
|
73
|
+
if (!asset || !isRecordedImageAsset(asset))
|
|
74
74
|
return null;
|
|
75
75
|
return imageOf(assets, asset);
|
|
76
76
|
},
|
|
77
77
|
async read(handle, signal) {
|
|
78
78
|
const asset = handle.ref;
|
|
79
|
-
if (!asset || !
|
|
79
|
+
if (!asset || !isRecordedImageAsset(asset))
|
|
80
80
|
throw new Error("that attachment is no longer available");
|
|
81
81
|
return readAsset(asset, signal);
|
|
82
82
|
},
|
|
@@ -8,5 +8,6 @@ export declare function attachmentGallery(reader: AttachmentReader, fact: Attach
|
|
|
8
8
|
images: GalleryImage[];
|
|
9
9
|
initialKey: string;
|
|
10
10
|
};
|
|
11
|
-
/** Transcript galleries
|
|
11
|
+
/** Transcript galleries draw only recorded members' renditions (see
|
|
12
|
+
* `isRecordedImageAsset`); a byte read is the viewer's fallback, never a draw. */
|
|
12
13
|
export declare function createAttachmentGallerySource(reader: AttachmentReader): FileSource;
|
|
@@ -17,7 +17,8 @@ export function attachmentGallery(reader, fact, row = [fact]) {
|
|
|
17
17
|
});
|
|
18
18
|
return { images, initialKey: fact.key };
|
|
19
19
|
}
|
|
20
|
-
/** Transcript galleries
|
|
20
|
+
/** Transcript galleries draw only recorded members' renditions (see
|
|
21
|
+
* `isRecordedImageAsset`); a byte read is the viewer's fallback, never a draw. */
|
|
21
22
|
export function createAttachmentGallerySource(reader) {
|
|
22
23
|
return {
|
|
23
24
|
image(handle) { return reader.imageResource(handle.ref); },
|
|
@@ -15,6 +15,7 @@ import { canonicalText, commandDirectoryContext, commandPreviewText, diffstatTex
|
|
|
15
15
|
import { parseDiff } from "../file-viewer/diff/index.js";
|
|
16
16
|
import { highlight, languageFor, PLAIN_TEXT } from "../file-viewer/syntax/index.js";
|
|
17
17
|
import { useRoom } from "../../room-context.js";
|
|
18
|
+
import { commandFailureLabel } from "../../lib/import-state.js";
|
|
18
19
|
import { DirectoryGlyph } from "./glyphs.js";
|
|
19
20
|
/** Q5 A's cap: the hunk that matters, where you are reading. */
|
|
20
21
|
const DIFF_LINE_CAP = 12;
|
|
@@ -182,7 +183,7 @@ function CommandSource({ command, code }) {
|
|
|
182
183
|
const [full, setFull] = useState(null);
|
|
183
184
|
const [expanded, setExpanded] = useState(false);
|
|
184
185
|
const [loading, setLoading] = useState(false);
|
|
185
|
-
const [failed, setFailed] = useState(
|
|
186
|
+
const [failed, setFailed] = useState(null);
|
|
186
187
|
const expandable = command.sourceTruncated && command.sessionId !== null && command.timelineId !== null;
|
|
187
188
|
const disclose = async () => {
|
|
188
189
|
if (expanded) {
|
|
@@ -196,15 +197,15 @@ function CommandSource({ command, code }) {
|
|
|
196
197
|
return;
|
|
197
198
|
}
|
|
198
199
|
setLoading(true);
|
|
199
|
-
setFailed(
|
|
200
|
+
setFailed(null);
|
|
200
201
|
try {
|
|
201
202
|
const sessionId = command.sessionId;
|
|
202
203
|
const response = await sessions.run(sessionId, (client) => client.command(sessionId, command.timelineId));
|
|
203
204
|
setFull(response.command);
|
|
204
205
|
setExpanded(true);
|
|
205
206
|
}
|
|
206
|
-
catch {
|
|
207
|
-
setFailed(
|
|
207
|
+
catch (error) {
|
|
208
|
+
setFailed(commandFailureLabel(error));
|
|
208
209
|
}
|
|
209
210
|
finally {
|
|
210
211
|
setLoading(false);
|
|
@@ -216,8 +217,8 @@ function CommandSource({ command, code }) {
|
|
|
216
217
|
const body = _jsx(HighlightedCommand, { code: code, language: command.language, text: text });
|
|
217
218
|
const more = expandable ? (_jsx("button", { "aria-expanded": expanded, className: "tr-command__more", type: "button", onClick: disclose, disabled: loading, children: loading
|
|
218
219
|
? "loading full command…"
|
|
219
|
-
: failed
|
|
220
|
-
?
|
|
220
|
+
: failed !== null
|
|
221
|
+
? failed
|
|
221
222
|
: expanded
|
|
222
223
|
? "show preview"
|
|
223
224
|
: "show full command" })) : null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TimelineMetaArtifact, TimelineMetaPlan } from "@vibefield/rosetta-protocol";
|
|
2
2
|
import type { SessionLeases } from "../../lib/session-leases.js";
|
|
3
|
+
import type { AssetSource } from "../../ports.js";
|
|
3
4
|
import type { FileHandle, FileSource } from "../file-viewer/index.js";
|
|
4
5
|
export declare function handleForTimelineMetaPlan(sessions: SessionLeases, sessionId: string, plan: TimelineMetaPlan): Promise<FileHandle>;
|
|
5
|
-
export declare function handleForTimelineMetaArtifact(sessions: SessionLeases, sessionId: string, artifact: TimelineMetaArtifact): Promise<FileHandle>;
|
|
6
|
+
export declare function handleForTimelineMetaArtifact(sessions: SessionLeases, assets: AssetSource, sessionId: string, artifact: TimelineMetaArtifact): Promise<FileHandle>;
|
|
6
7
|
export declare const timelineMetaFileSource: FileSource;
|
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
// Lazy timeline_meta resources through the room's shared file viewer.
|
|
2
2
|
// The metadata frame carries only safe canonical references; bytes are read
|
|
3
3
|
// after the reader presses a plan or artifact row and then ride on the handle
|
|
4
|
-
// so the viewer never repeats a mutable filesystem read.
|
|
4
|
+
// so the viewer never repeats a mutable filesystem read. A recorded image
|
|
5
|
+
// member is the exception: it is drawn through the host's renditions, as a
|
|
6
|
+
// transcript image is, and its recorded bytes are never read for display.
|
|
7
|
+
import { isRecordedImageAsset, recordedImageExtension } from "../../lib/image-media.js";
|
|
5
8
|
import { resolveKind } from "../file-viewer/index.js";
|
|
9
|
+
import { imageOf } from "./attachment-file-source.js";
|
|
6
10
|
const EXTENSION_BY_MEDIA_TYPE = new Map([
|
|
7
11
|
["image/png", "png"],
|
|
8
12
|
["image/jpeg", "jpg"],
|
|
9
13
|
["image/gif", "gif"],
|
|
10
14
|
["image/webp", "webp"],
|
|
15
|
+
["image/bmp", "bmp"],
|
|
16
|
+
["image/x-icon", "ico"],
|
|
11
17
|
["image/avif", "avif"],
|
|
12
18
|
["image/svg+xml", "svg"],
|
|
13
19
|
["application/json", "json"],
|
|
14
20
|
["text/markdown", "md"],
|
|
15
21
|
["text/plain", "txt"],
|
|
22
|
+
["text/html", "html"],
|
|
16
23
|
]);
|
|
17
24
|
function nameWithType(name, mediaType) {
|
|
18
25
|
if (resolveKind(name).viewer.id !== "binary" || mediaType === null)
|
|
19
26
|
return name;
|
|
20
|
-
const extension = EXTENSION_BY_MEDIA_TYPE.get(mediaType.toLowerCase());
|
|
27
|
+
const extension = EXTENSION_BY_MEDIA_TYPE.get(mediaType.toLowerCase().split(";")[0].trim());
|
|
21
28
|
return extension === undefined ? name : `${name}.${extension}`;
|
|
22
29
|
}
|
|
23
30
|
function handle(key, name, path, bytes) {
|
|
@@ -33,16 +40,49 @@ export async function handleForTimelineMetaPlan(sessions, sessionId, plan) {
|
|
|
33
40
|
const bytes = await sessions.run(sessionId, (client) => client.readPlan(sessionId, plan.source));
|
|
34
41
|
return handle(`timeline-meta:plan:${sessionId}:${plan.id}`, plan.name, null, bytes);
|
|
35
42
|
}
|
|
36
|
-
|
|
43
|
+
/** A recorded image member by its renditions: the name carries the image's
|
|
44
|
+
* own extension so the viewer opens it as an image, and nothing is read. */
|
|
45
|
+
function imageHandle(key, name, asset, extension, assets) {
|
|
46
|
+
return {
|
|
47
|
+
key,
|
|
48
|
+
name: resolveKind(name).viewer.id === "image" ? name : `${name}.${extension}`,
|
|
49
|
+
path: null,
|
|
50
|
+
size: asset.byte_len,
|
|
51
|
+
ref: { type: "timeline-meta-image", image: imageOf(assets, asset) },
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export async function handleForTimelineMetaArtifact(sessions, assets, sessionId, artifact) {
|
|
37
55
|
const source = artifact.source;
|
|
56
|
+
if (source.type === "html_publication") {
|
|
57
|
+
if (source.availability !== "captured")
|
|
58
|
+
throw new Error("This artifact's HTML was not captured. Its publication remains in the session.");
|
|
59
|
+
const bytes = await sessions.run(sessionId, (client) => {
|
|
60
|
+
if (!client.readArtifact)
|
|
61
|
+
throw new Error("This host cannot read captured artifacts");
|
|
62
|
+
return client.readArtifact(sessionId, source.publication_id);
|
|
63
|
+
});
|
|
64
|
+
return handle(`html-artifact:${source.publication_id}`, source.filename, null, bytes);
|
|
65
|
+
}
|
|
38
66
|
if (source.type === "timeline_file") {
|
|
39
67
|
const bytes = await sessions.run(sessionId, (client) => client.readFileTarget(sessionId, source.timeline_id, source.target_index));
|
|
40
|
-
return handle(`timeline-meta:artifact:${sessionId}:${artifact.id}`, nameWithType(artifact.name, artifact.media_type), source.path, bytes);
|
|
68
|
+
return handle(`timeline-meta:artifact:${sessionId}:${artifact.id}`, source.path.split(/[\\/]/).at(-1) || nameWithType(artifact.name, artifact.media_type), source.path, bytes);
|
|
69
|
+
}
|
|
70
|
+
const key = `timeline-meta:artifact:${sessionId}:${artifact.id}`;
|
|
71
|
+
const extension = recordedImageExtension(source.asset.media_type);
|
|
72
|
+
if (extension !== undefined) {
|
|
73
|
+
// Recorded image bytes are opened or saved, never drawn.
|
|
74
|
+
if (!isRecordedImageAsset(source.asset))
|
|
75
|
+
throw new Error("This artifact's image is not a recorded member");
|
|
76
|
+
return imageHandle(key, artifact.name, source.asset, extension, assets);
|
|
41
77
|
}
|
|
42
78
|
const bytes = await sessions.run(sessionId, (client) => client.readAsset(source.asset));
|
|
43
|
-
return handle(
|
|
79
|
+
return handle(key, nameWithType(artifact.name, artifact.media_type ?? source.asset.media_type), null, bytes);
|
|
44
80
|
}
|
|
45
81
|
export const timelineMetaFileSource = {
|
|
82
|
+
image(file) {
|
|
83
|
+
const payload = file.ref;
|
|
84
|
+
return payload?.type === "timeline-meta-image" && payload.image ? payload.image : null;
|
|
85
|
+
},
|
|
46
86
|
async read(file, signal) {
|
|
47
87
|
if (signal.aborted)
|
|
48
88
|
throw new DOMException("the file open was cancelled", "AbortError");
|
|
@@ -5,6 +5,10 @@ export interface EmptyStateProps {
|
|
|
5
5
|
readonly children?: ReactNode;
|
|
6
6
|
readonly className?: string;
|
|
7
7
|
readonly style?: CSSProperties;
|
|
8
|
+
/** Inert hooks drawn on the root, such as the face it is
|
|
9
|
+
* (`data-face`, `data-import-face`); see the DOM contract in
|
|
10
|
+
* clients/app/test/dom-contract.test.mjs. */
|
|
11
|
+
readonly [data: `data-${string}`]: string | undefined;
|
|
8
12
|
}
|
|
9
13
|
/** Consistent empty-state copy and spacing for room columns and lists. */
|
|
10
|
-
export declare function EmptyState({ title, description, children, className, style, }: EmptyStateProps): import("react").JSX.Element;
|
|
14
|
+
export declare function EmptyState({ title, description, children, className, style, ...data }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/** Consistent empty-state copy and spacing for room columns and lists. */
|
|
3
|
-
export function EmptyState({ title, description, children, className, style, }) {
|
|
3
|
+
export function EmptyState({ title, description, children, className, style, ...data }) {
|
|
4
4
|
const classes = className ? `ah-empty ${className}` : "ah-empty";
|
|
5
|
-
return (_jsxs("div", { className: classes, style: style, children: [children, _jsx("strong", { children: title }), _jsx("p", { children: description })] }));
|
|
5
|
+
return (_jsxs("div", { className: classes, style: style, ...data, children: [children, _jsx("strong", { children: title }), _jsx("p", { children: description })] }));
|
|
6
6
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface MeterProps {
|
|
2
|
+
/** 0..1 fills the meter (a sliver stays visible); null sweeps. */
|
|
3
|
+
readonly fraction: number | null;
|
|
4
|
+
}
|
|
5
|
+
/** The width a known fraction draws: clamped, and never less than a sliver
|
|
6
|
+
* once something is known, so a started step is never drawn as empty. */
|
|
7
|
+
export declare function meterWidth(fraction: number): string;
|
|
8
|
+
export declare function Meter({ fraction }: MeterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** The width a known fraction draws: clamped, and never less than a sliver
|
|
3
|
+
* once something is known, so a started step is never drawn as empty. */
|
|
4
|
+
export function meterWidth(fraction) {
|
|
5
|
+
return `${Math.min(100, Math.max(2, fraction * 100)).toFixed(1)}%`;
|
|
6
|
+
}
|
|
7
|
+
export function Meter({ fraction }) {
|
|
8
|
+
return fraction === null ? (_jsx("div", { className: "ah-meter", "data-indeterminate": "", "aria-hidden": "true", children: _jsx("i", {}) })) : (_jsx("div", { className: "ah-meter", "aria-hidden": "true", children: _jsx("i", { style: { width: meterWidth(fraction) } }) }));
|
|
9
|
+
}
|
|
@@ -4,6 +4,8 @@ export interface SegmentedControlOption<Value extends string> {
|
|
|
4
4
|
readonly label: ReactNode;
|
|
5
5
|
readonly accessibleLabel?: string;
|
|
6
6
|
readonly disabled?: boolean;
|
|
7
|
+
/** Why a disabled option waits, as its tooltip. */
|
|
8
|
+
readonly title?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface SegmentedControlProps<Value extends string> {
|
|
9
11
|
readonly value: Value;
|
|
@@ -4,6 +4,6 @@ export function SegmentedControl({ value, options, accessibleLabel, onValueChang
|
|
|
4
4
|
const classes = className ? `ah-seg ${className}` : "ah-seg";
|
|
5
5
|
return (_jsx("div", { className: classes, role: "group", "aria-label": accessibleLabel, children: options.map((option) => {
|
|
6
6
|
const isSelected = option.value === value;
|
|
7
|
-
return (_jsx("button", { type: "button", className: isSelected ? "is-on" : "", "aria-label": option.accessibleLabel, "aria-pressed": isSelected, disabled: option.disabled, onClick: () => onValueChange(option.value), children: option.label }, option.value));
|
|
7
|
+
return (_jsx("button", { type: "button", className: isSelected ? "is-on" : "", "aria-label": option.accessibleLabel, "aria-pressed": isSelected, disabled: option.disabled, title: option.title, onClick: () => onValueChange(option.value), children: option.label }, option.value));
|
|
8
8
|
}) }));
|
|
9
9
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface VeilProps {
|
|
2
2
|
/** One label line, e.g. "preparing · 2,314 of 5,912 sessions". */
|
|
3
3
|
readonly label: string;
|
|
4
|
-
/** 0..1 fills the meter; null
|
|
4
|
+
/** 0..1 fills the meter; null sweeps it — an unknown amount is never
|
|
5
|
+
* drawn as a fixed sliver of progress. */
|
|
5
6
|
readonly progress: number | null;
|
|
6
7
|
}
|
|
7
8
|
export declare function Veil({ label, progress }: VeilProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The veil — what pending looks like. A section that cannot yet vouch for
|
|
3
|
+
// its content frosts over while the content keeps rendering and updating
|
|
4
|
+
// beneath: the motion under the frost IS the progress animation, and the
|
|
5
|
+
// meter is just the caption. Laws (design record, "The Cold Start"):
|
|
6
|
+
// readiness is data, never a timer; only the ready may claim emptiness; a
|
|
7
|
+
// veil overlays and never changes geometry (H-2); and a veil never descends
|
|
8
|
+
// on a scope that has already been ready.
|
|
9
|
+
import { Meter } from "./Meter.js";
|
|
2
10
|
export function Veil({ label, progress }) {
|
|
3
|
-
|
|
4
|
-
return (_jsxs("div", { className: "ah-veil", role: "status", "aria-label": label, children: [_jsx("div", { className: "ah-meter", children: _jsx("i", { style: { width } }) }), _jsx("span", { className: "ah-veil__label", children: label })] }));
|
|
11
|
+
return (_jsxs("div", { className: "ah-veil", role: "status", "aria-label": label, children: [_jsx(Meter, { fraction: progress }), _jsx("span", { className: "ah-veil__label", children: label })] }));
|
|
5
12
|
}
|
|
@@ -10,6 +10,8 @@ export { ListSummaryHeader } from "./ListSummaryHeader.js";
|
|
|
10
10
|
export type { ListSummaryHeaderProps } from "./ListSummaryHeader.js";
|
|
11
11
|
export { ListToolbar } from "./ListToolbar.js";
|
|
12
12
|
export type { ListToolbarProps } from "./ListToolbar.js";
|
|
13
|
+
export { Meter, meterWidth } from "./Meter.js";
|
|
14
|
+
export type { MeterProps } from "./Meter.js";
|
|
13
15
|
export { SummaryMetric } from "./SummaryMetric.js";
|
|
14
16
|
export type { SummaryMetricProps } from "./SummaryMetric.js";
|
|
15
17
|
export { ResultGroupHeader } from "./ResultGroupHeader.js";
|
|
@@ -4,6 +4,7 @@ export { DialogShell } from "./DialogShell.js";
|
|
|
4
4
|
export { EmptyState } from "./EmptyState.js";
|
|
5
5
|
export { ListSummaryHeader } from "./ListSummaryHeader.js";
|
|
6
6
|
export { ListToolbar } from "./ListToolbar.js";
|
|
7
|
+
export { Meter, meterWidth } from "./Meter.js";
|
|
7
8
|
export { SummaryMetric } from "./SummaryMetric.js";
|
|
8
9
|
export { ResultGroupHeader } from "./ResultGroupHeader.js";
|
|
9
10
|
export { SegmentedControl } from "./SegmentedControl.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ProjectRow, RuntimeRow, SessionActivity, SessionRow } from "@vibefield/rosetta-protocol";
|
|
2
|
+
/** A tree whose largest source is over this walks the big lane
|
|
3
|
+
* (crates/pipeline/src/closed/walk_order.rs:38). */
|
|
4
|
+
export declare const BIG_SOURCE_BYTES: number;
|
|
5
|
+
export interface ColdCorpusOptions {
|
|
6
|
+
/** The import clock's zero, epoch ms. Every source is older. */
|
|
7
|
+
readonly now: number;
|
|
8
|
+
/** 1 is the MacBook shape; a smaller scale keeps every kind of row. */
|
|
9
|
+
readonly scale?: number;
|
|
10
|
+
readonly seed?: number;
|
|
11
|
+
}
|
|
12
|
+
/** What a session is to the import. */
|
|
13
|
+
export type SessionKind =
|
|
14
|
+
/** A top-level conversation with a transcript: flips with its tree. */
|
|
15
|
+
"root"
|
|
16
|
+
/** A subagent transcript under a root: flips with its tree. */
|
|
17
|
+
| "child"
|
|
18
|
+
/** A metadata-only parent (meta.rs:776): Pending forever, with children. */
|
|
19
|
+
| "placeholder"
|
|
20
|
+
/** Metadata named it, but no streamable source ever rosters it. */
|
|
21
|
+
| "never-rostered-root" | "never-rostered-child";
|
|
22
|
+
/** One root tree as the walk plan sees it (crates/pipeline/src/closed/trees.rs). */
|
|
23
|
+
export interface ColdTree {
|
|
24
|
+
/** The tree's root session id, which is also its key. */
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly runtimeId: string;
|
|
27
|
+
/** The rostered sessions that flip together, root first (unless the root
|
|
28
|
+
* is a placeholder, which no tree flip touches). */
|
|
29
|
+
readonly members: readonly string[];
|
|
30
|
+
/** Streamable bytes, the walk's work. */
|
|
31
|
+
readonly bytes: number;
|
|
32
|
+
/** Its largest source exceeds BIG_SOURCE_BYTES: the big lane. */
|
|
33
|
+
readonly big: boolean;
|
|
34
|
+
/** The recency key: the newest member's mtime (trees.rs:193). */
|
|
35
|
+
readonly recency: number;
|
|
36
|
+
/** A bound or tainted tree: admitted at its producer's close, not on its
|
|
37
|
+
* own (CLAUDE.md, "Bound and tainted trees … are admitted at the
|
|
38
|
+
* producer's close"). */
|
|
39
|
+
readonly bound: boolean;
|
|
40
|
+
/** Its root's source was unclean at capture (missing, unstable or a
|
|
41
|
+
* malformed record): the flip makes the root Streaming, not Indexed
|
|
42
|
+
* (crates/pipeline/src/streamed/trees.rs:226-232, `stream_state(clean)`). */
|
|
43
|
+
readonly dirty: boolean;
|
|
44
|
+
readonly placeholderRoot: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface ColdCorpus {
|
|
47
|
+
readonly now: number;
|
|
48
|
+
readonly scale: number;
|
|
49
|
+
readonly seed: number;
|
|
50
|
+
/** Registry order: claude-code, then codex. */
|
|
51
|
+
readonly runtimes: readonly RuntimeRow[];
|
|
52
|
+
readonly projects: readonly ProjectRow[];
|
|
53
|
+
/** Identity rows as the metadata pass publishes them: Pending, no activity. */
|
|
54
|
+
readonly sessions: readonly SessionRow[];
|
|
55
|
+
readonly kind: ReadonlyMap<string, SessionKind>;
|
|
56
|
+
/** A rostered session's own recorded bounds, public once its tree flips. */
|
|
57
|
+
readonly own: ReadonlyMap<string, SessionActivity>;
|
|
58
|
+
/** Direct children by parent id. */
|
|
59
|
+
readonly children: ReadonlyMap<string, readonly string[]>;
|
|
60
|
+
/** Newest first. */
|
|
61
|
+
readonly trees: readonly ColdTree[];
|
|
62
|
+
/** Rostered session → its tree. */
|
|
63
|
+
readonly treeOf: ReadonlyMap<string, ColdTree>;
|
|
64
|
+
/** Each rostered session's share of its tree's bytes. */
|
|
65
|
+
readonly bytesOf: ReadonlyMap<string, number>;
|
|
66
|
+
/** The topic word every root title starts with. */
|
|
67
|
+
readonly topics: readonly string[];
|
|
68
|
+
}
|
|
69
|
+
/** A 64-hex id, the shape of a rosetta id (a blake3 digest): four rounds of
|
|
70
|
+
* a well-mixed 64-bit string hash (cyrb53's mixing). Like the daemon's
|
|
71
|
+
* digests, ordering by it is unrelated to recency or creation order. */
|
|
72
|
+
export declare function hexId(seed: string): string;
|
|
73
|
+
/** Build the archive. Deterministic in (now, scale, seed); `now` only
|
|
74
|
+
* anchors the times, so every id, count and order is the same in any
|
|
75
|
+
* timezone and on any day. */
|
|
76
|
+
export declare function createColdCorpus(options: ColdCorpusOptions): ColdCorpus;
|