@vibefield/rosetta-room 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/HistoryRoom.js +21 -5
- package/dist/components/ColdStart.d.ts +15 -0
- package/dist/components/ColdStart.js +27 -0
- package/dist/components/IngestStatus.js +43 -6
- package/dist/components/transcript/TranscriptLoading.js +9 -0
- package/dist/components/ui/Hold.d.ts +25 -0
- package/dist/components/ui/Hold.js +44 -0
- package/dist/components/ui/Meter.d.ts +1 -1
- package/dist/components/ui/Meter.js +10 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/host-inputs.d.ts +25 -0
- package/dist/host-inputs.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/ingest-activity.d.ts +6 -0
- package/dist/lib/ingest-activity.js +6 -0
- package/dist/lib/use-standing-hold.d.ts +17 -0
- package/dist/lib/use-standing-hold.js +70 -0
- package/dist/styles/hold.css +47 -0
- package/dist/styles/ingest.css +14 -0
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Yong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -248,6 +248,30 @@ The callbacks are called while the room renders, so a host keeps them cheap.
|
|
|
248
248
|
a checked row. The room's own search sheet keeps its native selects.
|
|
249
249
|
- **`repositoryUrl(projectId)`** — the address ②'s repository act opens.
|
|
250
250
|
Undefined: the room's own reading of `git_repo`; null: no act.
|
|
251
|
+
- **`waitMark`** → `RoomWaitMark` — the host's mark for the room's
|
|
252
|
+
waits: `mark(place, { resting })` draws it for a place (`"view"`,
|
|
253
|
+
`"column"`, `"card"`), at rest while the work it stands for is paused, and
|
|
254
|
+
`carried` says the host's own hold already stands where the room's first
|
|
255
|
+
one comes. With it:
|
|
256
|
+
- **the view's waits are one hold** — reaching the index, then the cold
|
|
257
|
+
start before its first project: the mark at the centre of the room's box,
|
|
258
|
+
one line 26 under it (`connectingTitle`, or the step's own title with the
|
|
259
|
+
ellipsis of work under way) and its count 4 under that ("1,333 files
|
|
260
|
+
checked"). It is late (nothing for 120ms), stands 800ms once it has shown,
|
|
261
|
+
fades over 280ms (120ms under reduced motion), and what comes next waits
|
|
262
|
+
for it; a new line crossfades in place. An index that has stopped
|
|
263
|
+
answering keeps the room's face: a failure is no wait.
|
|
264
|
+
- **the import card wears the mark** where IMPORTING HISTORY stood, the step
|
|
265
|
+
beside it; its words keep to the step's title and its count, a fraction
|
|
266
|
+
the step knows is a colourless 2px hairline (none for one it does not),
|
|
267
|
+
and the detail, the amount, the connection and the timer fold under Agent
|
|
268
|
+
details. Paused updates stand the mark at rest.
|
|
269
|
+
- **a conversation's wait is a hold in its column**, its sketch and sweep
|
|
270
|
+
gone; a load that failed keeps its own face and Try again.
|
|
271
|
+
- **nothing sweeps beside the mark**: a meter that knows no amount draws
|
|
272
|
+
nothing (a veil keeps its words), and one that knows still fills.
|
|
273
|
+
|
|
274
|
+
Absent: every wait is the room's own, as rosetta's app shows it.
|
|
251
275
|
|
|
252
276
|
## The reader (`TranscriptReader`)
|
|
253
277
|
|
package/dist/HistoryRoom.js
CHANGED
|
@@ -13,17 +13,18 @@ import { HostInputsProvider, hostInputsOf, useHostInputs } from "./host-inputs.j
|
|
|
13
13
|
import { tildePath } from "./lib/format.js";
|
|
14
14
|
import { MenuLayerProvider } from "./components/HostMenu.js";
|
|
15
15
|
import { RoomProvider, useRoom, useRoomOverlayOpen } from "./room-context.js";
|
|
16
|
-
import { ColdStartPanel } from "./components/ColdStart.js";
|
|
16
|
+
import { ColdStartPanel, coldStartHold } from "./components/ColdStart.js";
|
|
17
17
|
import { ProjectsColumn } from "./components/projects/index.js";
|
|
18
18
|
import { SearchLauncher, SearchSheet, emptyTranscriptPrompt, searchKeyLegend } from "./components/search/index.js";
|
|
19
19
|
import { ArtifactGlyph, ArtifactLibrary } from "./components/artifacts/ArtifactLibrary.js";
|
|
20
20
|
import { SessionsColumn } from "./components/sessions/index.js";
|
|
21
21
|
import { TranscriptColumn } from "./components/Transcript.js";
|
|
22
|
-
import { EmptyState, Meter } from "./components/ui/index.js";
|
|
22
|
+
import { EmptyState, Hold, Meter } from "./components/ui/index.js";
|
|
23
23
|
import { sessionFilePaths } from "./components/git/index.js";
|
|
24
24
|
import { useWorktreeGuest, WorktreeColumn } from "./components/worktree/index.js";
|
|
25
25
|
import { useDaemonStatus, useMeta, useProjectStats, useProjectUsage, useSearch, useTimeline, } from "./lib/hooks.js";
|
|
26
26
|
import { useIngestActivity } from "./lib/use-ingest-activity.js";
|
|
27
|
+
import { useStandingHold } from "./lib/use-standing-hold.js";
|
|
27
28
|
import { ConversationFold } from "./lib/conversation-readiness.js";
|
|
28
29
|
import { isAwaitingConsent, isIngestActive } from "./lib/ingest.js";
|
|
29
30
|
import { UNASSIGNED_PROJECT_ID, buildProjectViewModelFromSessions, getActivityGridStartTimestamp, indexSessionsByProject, projectKey, rootSessionsOfProject, sessionsOfProject, unassignedProject, } from "./lib/model.js";
|
|
@@ -102,7 +103,7 @@ export const HistoryRoom = forwardRef(function HistoryRoom(props, ref) {
|
|
|
102
103
|
});
|
|
103
104
|
function RoomBody({ handle, surface, search: searchOption, unavailable, unavailableTitle, connectingTitle, consent, emptyPrompt, onSelect, frameStyle, }) {
|
|
104
105
|
const { catalog, sessions, host, storage, tints } = useRoom();
|
|
105
|
-
const { projectTint: hostTint, sessionRow: hostSessionRow, projectActs: hostProjectActs, projectCard: hostProjectCard, sessionActs: hostSessionActs, folders: hostFoldersOf, } = useHostInputs();
|
|
106
|
+
const { projectTint: hostTint, sessionRow: hostSessionRow, projectActs: hostProjectActs, projectCard: hostProjectCard, sessionActs: hostSessionActs, folders: hostFoldersOf, waitMark, } = useHostInputs();
|
|
106
107
|
const overlayOpen = useRoomOverlayOpen();
|
|
107
108
|
// The room's root, where a host's menus are drawn over every column.
|
|
108
109
|
const [frameElement, setFrameElement] = useState(null);
|
|
@@ -487,11 +488,26 @@ function RoomBody({ handle, surface, search: searchOption, unavailable, unavaila
|
|
|
487
488
|
// meters move, but there is not yet a canonical project to render. Once
|
|
488
489
|
// RAM metadata arrives the ordinary room takes over progressively.
|
|
489
490
|
const coldStarting = projectRows.length === 0 && ingestActive && ingest !== null && !awaitingConsent;
|
|
490
|
-
|
|
491
|
+
// R10 — with the host's mark, the view's waits are ONE hold: reaching the
|
|
492
|
+
// index, then the cold start before its first project, in the room's own
|
|
493
|
+
// words. A failure is no wait (a closed feed works on nothing), so it keeps
|
|
494
|
+
// the room's face. The hold keeps its floor and its leave, and what comes
|
|
495
|
+
// next waits for it (`useStandingHold`).
|
|
496
|
+
const viewHold = waitMark === undefined ? null
|
|
497
|
+
: disconnected && !coldStarting
|
|
498
|
+
? metaStatus === "closed" ? null : {
|
|
499
|
+
face: "connecting",
|
|
500
|
+
words: { key: "connecting", line: connectingTitle, sub: connectionError ?? unavailable },
|
|
501
|
+
resting: false,
|
|
502
|
+
}
|
|
503
|
+
: coldStarting ? { face: "cold-start", ...coldStartHold(activity) }
|
|
504
|
+
: null;
|
|
505
|
+
const standingHold = useStandingHold(viewHold, waitMark?.carried === true);
|
|
506
|
+
return (_jsx("div", { className: "ah-frame is-tall", "data-ah-surface": surface, "data-ah-overlay": overlayOpen ? "" : undefined, style: frameStyle, ref: setFrameElement, children: _jsxs(MenuLayerProvider, { value: frameElement, children: [_jsxs("div", { className: "ah-room", ref: roomRef, children: [searchOption !== null && (_jsxs("div", { className: "ah-searchbar", children: [_jsx(SearchLauncher, { query: search.query, placeholder: launcherPlaceholder, shortcut: searchKey, onOpen: () => setSheetOpen(true), onClear: clearSearch }), catalog.artifacts && _jsxs("button", { ref: artifactLauncherRef, type: "button", className: "ah-artifacts-launcher", onClick: () => setArtifactsOpen(true), "aria-label": "Open artifacts", "aria-haspopup": "dialog", "aria-expanded": artifactsOpen, children: [_jsx(ArtifactGlyph, {}), "Artifacts"] }), searchOption.accessory] })), standingHold !== null ? null : disconnected && !coldStarting ? (_jsx(EmptyState, { style: { flex: 1 }, title: metaStatus === "closed" ? unavailableTitle : connectingTitle, description: connectionError ?? unavailable, "data-face": metaStatus === "closed" ? "not-answering" : "connecting", children: metaStatus !== "closed" && _jsx(Meter, { fraction: null }) })) : awaitingConsent ? (consent ?? (_jsx(EmptyState, { style: { flex: 1 }, title: "Waiting for consent", description: "The index has found agents on this machine and reads nothing until it is told which ones to read.", "data-face": "consent" }))) : coldStarting ? (_jsx(ColdStartPanel, { activity: activity })) : (_jsxs("div", { className: "ah-cols", "data-rail": worktree.visible ? "on" : "off", children: [_jsx(ProjectsColumn, { projects: projectViewModels, activityOrder: activityOrder, selectedProjectId: projectId, sort: sort, onSortChange: setSort, homeDirectory: home, currentTimestamp: nowMs, ingest: ingest, activity: activity, conversations: conversations, onProjectSelect: (id) => {
|
|
491
507
|
setProjectId(id);
|
|
492
508
|
setSessionId(null);
|
|
493
509
|
setInspectedThread(null);
|
|
494
|
-
} }), _jsx(SessionsColumn, { project: projectId ? (projectById.get(projectId) ?? null) : null, sessions: projectSessions, factsBySessionId: facts, getRuntimeKind: kindOf, selectedSessionId: sessionId, usage: usage, activityGridStartTimestamp: getActivityGridStartTimestamp(nowMs), currentTimestamp: nowMs, ingest: ingest, isWorktreeVisible: worktree.available && projectRoot !== null ? worktree.visible : null, onToggleWorktree: worktree.toggle, onSessionSelect: (selectedSession) => { setSessionId(selectedSession.id); setInspectedThread(null); }, parentIds: sessionParents, hostActs: projectId === null ? null : (hostProjectActs?.(projectId, { folder: shownFolderKey }) ?? null), hostCard: projectId === null || hostProjectCard === undefined ? null : hostProjectCard(projectId) }), _jsx(WorktreeColumn, { projectRoot: worktreeRoot, folders: folderMenu === null ? null : { menu: folderMenu, shown: shownFolder }, tint: projectId ? (projectById.get(projectId)?.tint ?? null) : null, homeDirectory: home, sessionPaths: sessionPaths, currentTimestamp: nowMs, onReceipt: showReceipt, requestError: worktree.error, onRetry: worktree.retry }), _jsx(TranscriptColumn, { session: session, duringBackfill: ingestActive, importCourse: importCourse(ingest, session?.runtime_id ?? null, activity?.feed.resumed === true), importAgent: session === null ? undefined : agentLabel(kindOf(session.runtime_id)), sessions: meta?.sessions ?? [], project: session ? (projectById.get(projectKey(session)) ?? null) : null, feed: feed, focus: focus, onFocusConsumed: () => setFocus(null), onReceipt: showReceipt, emptyPrompt: emptyPrompt === undefined ? emptyTranscriptPrompt(searchKey) : emptyPrompt, stepper: stepperState, onStepMatch: stepMatch, onDismissStepper: () => setStepper(null), getRuntimeKind: kindOf, homeDirectory: home, onOpenThread: openThread, onBackToParent: session?.parent_session_id == null ? null : () => openThread(session.parent_session_id), headActs: session === null ? null : (hostSessionActs?.(session) ?? null) })] }))] }), searchOption !== null && _jsx(SearchSheet, { open: sheetOpen, onClose: () => setSheetOpen(false), query: query, onQuery: setQuery, filters: filters, onFilters: setFilters, feed: search, results: searchResults, readiness: readiness, progress: searchProgress, canonicalReady: canonicalReady, ingestPaused: ingest?.phase === "metadata_ready" || ingest?.run?.state === "paused" || ingest?.run?.state === "failed", duringBackfill: ingestActive, agentKinds: kinds, currentProject: projectId !== null && projectId !== UNASSIGNED_PROJECT_ID
|
|
510
|
+
} }), _jsx(SessionsColumn, { project: projectId ? (projectById.get(projectId) ?? null) : null, sessions: projectSessions, factsBySessionId: facts, getRuntimeKind: kindOf, selectedSessionId: sessionId, usage: usage, activityGridStartTimestamp: getActivityGridStartTimestamp(nowMs), currentTimestamp: nowMs, ingest: ingest, isWorktreeVisible: worktree.available && projectRoot !== null ? worktree.visible : null, onToggleWorktree: worktree.toggle, onSessionSelect: (selectedSession) => { setSessionId(selectedSession.id); setInspectedThread(null); }, parentIds: sessionParents, hostActs: projectId === null ? null : (hostProjectActs?.(projectId, { folder: shownFolderKey }) ?? null), hostCard: projectId === null || hostProjectCard === undefined ? null : hostProjectCard(projectId) }), _jsx(WorktreeColumn, { projectRoot: worktreeRoot, folders: folderMenu === null ? null : { menu: folderMenu, shown: shownFolder }, tint: projectId ? (projectById.get(projectId)?.tint ?? null) : null, homeDirectory: home, sessionPaths: sessionPaths, currentTimestamp: nowMs, onReceipt: showReceipt, requestError: worktree.error, onRetry: worktree.retry }), _jsx(TranscriptColumn, { session: session, duringBackfill: ingestActive, importCourse: importCourse(ingest, session?.runtime_id ?? null, activity?.feed.resumed === true), importAgent: session === null ? undefined : agentLabel(kindOf(session.runtime_id)), sessions: meta?.sessions ?? [], project: session ? (projectById.get(projectKey(session)) ?? null) : null, feed: feed, focus: focus, onFocusConsumed: () => setFocus(null), onReceipt: showReceipt, emptyPrompt: emptyPrompt === undefined ? emptyTranscriptPrompt(searchKey) : emptyPrompt, stepper: stepperState, onStepMatch: stepMatch, onDismissStepper: () => setStepper(null), getRuntimeKind: kindOf, homeDirectory: home, onOpenThread: openThread, onBackToParent: session?.parent_session_id == null ? null : () => openThread(session.parent_session_id), headActs: session === null ? null : (hostSessionActs?.(session) ?? null) })] })), standingHold !== null && (_jsx(Hold, { place: "view", face: standingHold.hold.face, words: standingHold.hold.words, resting: standingHold.hold.resting, carried: standingHold.carried, leaving: standingHold.leaving }))] }), searchOption !== null && _jsx(SearchSheet, { open: sheetOpen, onClose: () => setSheetOpen(false), query: query, onQuery: setQuery, filters: filters, onFilters: setFilters, feed: search, results: searchResults, readiness: readiness, progress: searchProgress, canonicalReady: canonicalReady, ingestPaused: ingest?.phase === "metadata_ready" || ingest?.run?.state === "paused" || ingest?.run?.state === "failed", duringBackfill: ingestActive, agentKinds: kinds, currentProject: projectId !== null && projectId !== UNASSIGNED_PROJECT_ID
|
|
495
511
|
? (projectById.get(projectId) ?? null)
|
|
496
512
|
: null, homeDirectory: home, nowMs: nowMs, getRuntimeKind: kindOf, onOpenHit: openHit, titles: titleMatches, onOpenSession: openSession }), receipt !== null && _jsx("div", { className: "ah-receipt", children: receipt }), catalog.artifacts && _jsx(ArtifactLibrary, { open: artifactsOpen, onClose: () => setArtifactsOpen(false), returnFocus: () => artifactLauncherRef.current?.focus(), agents: kinds, projects: meta?.projects ?? [], canonicalReady: canonicalReady === true, onOpenSession: (sessionId, timelineId) => setPendingOpen({ sessionId, timelineId }) })] }) }));
|
|
497
513
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { IngestActivity } from "../lib/ingest-activity.js";
|
|
2
|
+
import type { HoldWords } from "./ui/Hold.js";
|
|
2
3
|
export declare function ColdStartPanel({ activity }: {
|
|
3
4
|
readonly activity: IngestActivity | null;
|
|
4
5
|
}): import("react").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* The cold start as a hold (R10): before the first project the room's own
|
|
8
|
+
* words for the step stand under the host's mark — the step's title, with the
|
|
9
|
+
* ellipsis of work under way, over its amount ("Discovering conversations…"
|
|
10
|
+
* over "1,333 files checked"; "History import paused" over "80 sessions
|
|
11
|
+
* found"). The first step's title stands alone: its amount ("Looking for
|
|
12
|
+
* conversations…") counts nothing and says the same wait again. Paused updates
|
|
13
|
+
* say the card's words, the mark at rest; a paused import its own title, at
|
|
14
|
+
* rest too.
|
|
15
|
+
*/
|
|
16
|
+
export declare function coldStartHold(activity: IngestActivity | null): {
|
|
17
|
+
readonly words: HoldWords;
|
|
18
|
+
readonly resting: boolean;
|
|
19
|
+
};
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PAUSED_UPDATES } from "../lib/ingest-activity.js";
|
|
2
3
|
import { IngestStatus } from "./IngestStatus.js";
|
|
3
4
|
export function ColdStartPanel({ activity }) {
|
|
4
5
|
return (_jsxs("div", { className: "ah-empty ah-cold-start", "data-face": "cold-start", children: [_jsx("strong", { children: "Bringing your history together" }), _jsx("p", { children: "Your projects will appear here as we discover your conversations." }), _jsx(IngestStatus, { activity: activity })] }));
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The cold start as a hold (R10): before the first project the room's own
|
|
9
|
+
* words for the step stand under the host's mark — the step's title, with the
|
|
10
|
+
* ellipsis of work under way, over its amount ("Discovering conversations…"
|
|
11
|
+
* over "1,333 files checked"; "History import paused" over "80 sessions
|
|
12
|
+
* found"). The first step's title stands alone: its amount ("Looking for
|
|
13
|
+
* conversations…") counts nothing and says the same wait again. Paused updates
|
|
14
|
+
* say the card's words, the mark at rest; a paused import its own title, at
|
|
15
|
+
* rest too.
|
|
16
|
+
*/
|
|
17
|
+
export function coldStartHold(activity) {
|
|
18
|
+
if (activity === null)
|
|
19
|
+
return { words: { key: "discovering", line: "Finding your history…" }, resting: false };
|
|
20
|
+
const { phase, feed } = activity;
|
|
21
|
+
if (feed.connectionError !== null) {
|
|
22
|
+
return { words: { key: "paused-updates", line: PAUSED_UPDATES.title, sub: PAUSED_UPDATES.detail }, resting: true };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
words: {
|
|
26
|
+
key: phase.key,
|
|
27
|
+
line: phase.active ? `${phase.title}…` : phase.title,
|
|
28
|
+
sub: phase.key === "discovering" ? null : phase.amount,
|
|
29
|
+
},
|
|
30
|
+
resting: !phase.active,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId, useLayoutEffect, useRef } from "react";
|
|
3
|
+
import { useHostInputs } from "../host-inputs.js";
|
|
3
4
|
import { AgentMark, agentLabel } from "../lib/agents.js";
|
|
4
|
-
import { phaseHeading, readyConversations, runtimeActivity } from "../lib/ingest-activity.js";
|
|
5
|
+
import { PAUSED_UPDATES, phaseHeading, readableText, readyConversations, runtimeActivity, } from "../lib/ingest-activity.js";
|
|
5
6
|
import { IngestionControls } from "./IngestionControls.js";
|
|
6
7
|
function ProgressMeter({ value, label, paused = false }) {
|
|
7
8
|
return _jsx("div", { className: "ah-ingest-meter", role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": value === null ? undefined : Math.floor(value * 100), "data-indeterminate": value === null ? "" : undefined, "data-paused": paused ? "" : undefined, children: _jsx("i", { style: value === null ? undefined : { width: `${value * 100}%` } }) });
|
|
8
9
|
}
|
|
9
10
|
export function IngestStatus({ activity }) {
|
|
10
11
|
const titleId = useId();
|
|
12
|
+
const { waitMark } = useHostInputs();
|
|
11
13
|
if (!activity)
|
|
12
14
|
return null;
|
|
13
15
|
const { phase, feed, footer, elapsed } = activity;
|
|
@@ -19,13 +21,48 @@ export function IngestStatus({ activity }) {
|
|
|
19
21
|
// The end collapses in place to one line, which the column then folds away.
|
|
20
22
|
if (ready && !interrupted)
|
|
21
23
|
return (_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": "complete", "data-compact": "", "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: phase.title }), _jsxs("h3", { id: titleId, children: [phase.title, " ", _jsx("span", { "aria-hidden": "true", children: "\u2713" })] })] }));
|
|
24
|
+
if (waitMark !== undefined)
|
|
25
|
+
return _jsx(MarkedIngestStatus, { activity: activity, waitMark: waitMark, titleId: titleId });
|
|
22
26
|
return (
|
|
23
27
|
// `data-ready-count` / `data-ready-total` are the readable conversations
|
|
24
28
|
// and their total, carried (inert) even where the copy leaves them out.
|
|
25
|
-
_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": interrupted ? "disconnected" : ready ? "complete" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { children: ready ? "ALL SET" : "IMPORTING HISTORY" }), _jsx("span", { children: ready ? "✓" : `Step ${phase.step} of 4` })] }), _jsx(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": interrupted ? "disconnected" : ready ? "complete" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { children: ready ? "ALL SET" : "IMPORTING HISTORY" }), _jsx("span", { children: ready ? "✓" : `Step ${phase.step} of 4` })] }), _jsx(StatusLive, { phase: phase, interrupted: interrupted }), _jsxs("h3", { id: titleId, children: [interrupted ? PAUSED_UPDATES.title : phase.title, !interrupted && phase.count ? _jsx("span", { className: "ah-ingest-status__count", children: phase.count }) : null] }), _jsx("p", { className: "ah-ingest-status__detail", children: interrupted ? PAUSED_UPDATES.detail : phase.detail }), _jsxs("div", { className: "ah-ingest-status__amount", children: [_jsx("span", { children: phase.amount }), phase.fraction !== null && !ready && _jsxs("b", { children: [Math.floor(phase.fraction * 100), "%"] })] }), _jsx(ProgressMeter, { value: phase.fraction, label: phaseHeading(phase), paused: paused }, phase.key), horizon && _jsx("p", { className: "ah-ingest-status__horizon", "aria-hidden": "true", children: horizon.line }), _jsx(StatusFooter, { feed: feed, footer: footer, elapsed: elapsed }), _jsx(IngestionControls, { run: feed.ingest?.run }), phase.step < 4 && (feed.ingest?.runtimes.length ?? 0) > 0 && _jsxs("details", { className: "ah-ingest-status__agents", children: [_jsxs("summary", { children: ["Agent details ", _jsx("span", { "aria-hidden": "true", children: "\u2304" })] }), _jsx(AgentList, { feed: feed, paused: paused })] })] }));
|
|
30
|
+
}
|
|
31
|
+
/** The counts move with every tree the import opens: drawn, never announced.
|
|
32
|
+
* The live regions say the step and each recency span reached, nothing else. */
|
|
33
|
+
function StatusLive({ phase, interrupted }) {
|
|
34
|
+
return _jsxs(_Fragment, { children: [_jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: interrupted ? PAUSED_UPDATES.title : phase.spoken ?? phase.title }), _jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: phase.horizon?.reached ?? "" })] });
|
|
35
|
+
}
|
|
36
|
+
/** The connection and the timer. */
|
|
37
|
+
function StatusFooter({ feed, footer, elapsed }) {
|
|
38
|
+
return _jsxs("div", { className: "ah-ingest-status__footer", children: [_jsx("span", { title: feed.connectionError ?? (footer.includes("No new") ? "The service is connected; its work counters have not changed." : undefined), children: footer }), _jsx("span", { children: elapsed })] });
|
|
39
|
+
}
|
|
40
|
+
/** Each agent's own step, under Agent details. */
|
|
41
|
+
function AgentList({ feed, paused }) {
|
|
42
|
+
return _jsx("ul", { children: feed.ingest?.runtimes.map((runtime) => {
|
|
43
|
+
const status = runtimeActivity(runtime, feed.ingest?.phase === "restoring");
|
|
44
|
+
return _jsxs("li", { children: [_jsx(AgentMark, { kind: runtime.kind }), _jsxs("div", { children: [_jsxs("div", { className: "ah-ingest-status__agent-name", children: [_jsx("strong", { children: agentLabel(runtime.kind) }), runtime.state === "done" && _jsx("span", { "aria-label": "Ready to browse", children: "\u2713" })] }), _jsx("span", { className: "ah-ingest-status__agent-caption", children: status.label }), runtime.state !== "done" && _jsx(ProgressMeter, { value: status.fraction, label: `${agentLabel(runtime.kind)}: ${status.label}`, paused: paused || runtime.state === "queued" })] })] }, runtime.kind);
|
|
45
|
+
}) });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The card in the host's mark (R10): it keeps its place at the head of the
|
|
49
|
+
* first column and wears the mark where IMPORTING HISTORY stood, the step
|
|
50
|
+
* beside it. Its words keep to the step's title and its count; a fraction the
|
|
51
|
+
* step knows is a colourless hairline, and a step that knows none draws no
|
|
52
|
+
* bar, the mark being the sign of working. The detail, the amount, the
|
|
53
|
+
* recency line, the connection and the timer fold under Agent details, which
|
|
54
|
+
* stand through search as well. Paused updates stand the mark at rest.
|
|
55
|
+
*/
|
|
56
|
+
function MarkedIngestStatus({ activity, waitMark, titleId }) {
|
|
57
|
+
const { phase, feed, footer, elapsed } = activity;
|
|
58
|
+
const interrupted = feed.connectionError !== null;
|
|
59
|
+
const paused = interrupted || !phase.active;
|
|
60
|
+
const count = readyConversations(feed);
|
|
61
|
+
const horizon = interrupted ? null : phase.horizon ?? null;
|
|
62
|
+
const runtimes = phase.step < 4 ? (feed.ingest?.runtimes.length ?? 0) : 0;
|
|
63
|
+
const sub = interrupted ? PAUSED_UPDATES.detail
|
|
64
|
+
: phase.count ? readableText(count) : phase.amount;
|
|
65
|
+
return (_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-marked": "", "data-state": interrupted ? "disconnected" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { className: "ah-ingest-status__mark", children: waitMark.mark("card", { resting: paused }) }), _jsx("span", { children: `Step ${phase.step} of 4` })] }), _jsx(StatusLive, { phase: phase, interrupted: interrupted }), _jsx("h3", { id: titleId, children: interrupted ? PAUSED_UPDATES.title : phase.title }), _jsx("p", { className: "ah-ingest-status__sub", children: sub }), phase.fraction !== null && (_jsx(ProgressMeter, { value: phase.fraction, label: phaseHeading(phase), paused: paused }, phase.key)), _jsxs("details", { className: "ah-ingest-status__agents", children: [_jsxs("summary", { children: ["Agent details ", _jsx("span", { "aria-hidden": "true", children: "\u2304" })] }), !interrupted && _jsx("p", { className: "ah-ingest-status__detail", children: phase.detail }), _jsxs("div", { className: "ah-ingest-status__amount", children: [_jsx("span", { children: phase.amount }), phase.fraction !== null && _jsxs("b", { children: [Math.floor(phase.fraction * 100), "%"] })] }), horizon && _jsx("p", { className: "ah-ingest-status__horizon", "aria-hidden": "true", children: horizon.line }), _jsx(StatusFooter, { feed: feed, footer: footer, elapsed: elapsed }), _jsx(IngestionControls, { run: feed.ingest?.run }), runtimes > 0 && _jsx(AgentList, { feed: feed, paused: paused })] })] }));
|
|
29
66
|
}
|
|
30
67
|
/**
|
|
31
68
|
* The card's place in the projects column, whose height follows the card's
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useHostInputs } from "../../host-inputs.js";
|
|
3
|
+
import { Hold } from "../ui/Hold.js";
|
|
2
4
|
import "../../styles/transcript-loading.css";
|
|
3
5
|
/** Which wait the loader shows: its words, keyed by the inert
|
|
4
6
|
* `data-loading-label` the DOM contract reads instead of the copy. */
|
|
@@ -15,6 +17,13 @@ export function TranscriptLoading({ error, waitingForTeam, seeking, canContinue,
|
|
|
15
17
|
: seeking ? "seeking"
|
|
16
18
|
: indexing ? "preparing" : "loading";
|
|
17
19
|
const label = LOADING_LABELS[shown];
|
|
20
|
+
const { waitMark } = useHostInputs();
|
|
21
|
+
// R10 — in the host's mark, a conversation's wait is a hold in its column:
|
|
22
|
+
// the mark and its words, no sketch and no sweep. A load that failed is no
|
|
23
|
+
// wait, so it keeps the loader's own face with Try again.
|
|
24
|
+
if (waitMark !== undefined && error === null) {
|
|
25
|
+
return _jsx("div", { className: "tr-loading", "data-loading-label": shown, "data-marked": "", children: _jsx(Hold, { place: "column", face: "transcript-loading", words: { key: shown, line: label }, act: canContinue ? _jsx("button", { type: "button", onClick: onContinue, children: "Read available messages" }) : null }) });
|
|
26
|
+
}
|
|
18
27
|
return _jsx("div", { className: "tr-loading", "data-error": error !== null || undefined, "data-loading-label": shown, children: _jsxs("div", { className: "tr-loading__body", children: [_jsxs("div", { className: "tr-loading__sketch", "aria-hidden": "true", children: [_jsxs("div", { className: "tr-loading__prompt", children: [_jsx("i", {}), _jsx("i", {})] }), _jsxs("div", { className: "tr-loading__reply", children: [_jsxs("div", { className: "tr-loading__byline", children: [_jsx("b", {}), _jsx("i", {})] }), _jsx("i", {}), _jsx("i", {}), _jsx("i", {})] }), _jsxs("div", { className: "tr-loading__fold", children: [_jsx("b", { children: "\u203A" }), _jsx("i", {})] })] }), _jsxs("div", { className: "tr-loading__status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: [error === null && _jsx("div", { className: "tr-loading__meter", "aria-hidden": "true", children: _jsx("i", {}) }), _jsx("strong", { children: label }), error !== null && _jsx("p", { children: error })] }), error !== null ? _jsx("button", { type: "button", onClick: onRetry, children: "Try again" })
|
|
19
28
|
: canContinue && _jsx("button", { type: "button", onClick: onContinue, children: "Read available messages" })] }) });
|
|
20
29
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { RoomWaitPlace } from "../../host-inputs.js";
|
|
3
|
+
import "../../styles/hold.css";
|
|
4
|
+
/** A hold's words: its line, and the count under it. */
|
|
5
|
+
export interface HoldWords {
|
|
6
|
+
/** What makes a new line, and so its crossfade: the words' identity, never
|
|
7
|
+
* their render (a count under the same line only counts). */
|
|
8
|
+
readonly key: string;
|
|
9
|
+
readonly line: ReactNode;
|
|
10
|
+
readonly sub?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function Hold({ place, words, resting, carried, leaving, face, act }: {
|
|
13
|
+
readonly place: Exclude<RoomWaitPlace, "card">;
|
|
14
|
+
readonly words: HoldWords;
|
|
15
|
+
/** Its work is paused: the mark stands at rest. */
|
|
16
|
+
readonly resting?: boolean;
|
|
17
|
+
/** The host's own hold stood here as this one came: at once, no fade. */
|
|
18
|
+
readonly carried?: boolean;
|
|
19
|
+
/** Its wait is over and it fades away (280ms) before what comes next. */
|
|
20
|
+
readonly leaving?: boolean;
|
|
21
|
+
/** The face it stands for, as the room's other faces name theirs. */
|
|
22
|
+
readonly face: string;
|
|
23
|
+
/** An act under its words, where the wait offers one. */
|
|
24
|
+
readonly act?: ReactNode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// The hold — a wait that fills a place, in the host's mark (R10,
|
|
3
|
+
// `RoomWaitMark`). The mark at the centre of its place, one line 26 under it
|
|
4
|
+
// and its count 4 under that, so a host's own load and the room's read as one
|
|
5
|
+
// look (VibeField holds its Setup Assistant's loads so). Late, as the veil is:
|
|
6
|
+
// nothing for 120ms, then the words over 180ms and the mark over 400ms — at
|
|
7
|
+
// once when the host's own hold already stands there (`carried`). A new line
|
|
8
|
+
// crossfades in place, 140ms out and then 240ms in; a new count under the same
|
|
9
|
+
// line only counts. The mark only ever fades: it never moves or scales, and it
|
|
10
|
+
// stands at rest while its work is paused. Drawn only while the host gives a
|
|
11
|
+
// mark: without one the room's own waits stand, as rosetta's app shows them.
|
|
12
|
+
import { useEffect, useRef, useState } from "react";
|
|
13
|
+
import { useHostInputs } from "../../host-inputs.js";
|
|
14
|
+
import "../../styles/hold.css";
|
|
15
|
+
/** The words' leaving, before a new line comes in. */
|
|
16
|
+
const LINE_OUT_MS = 140;
|
|
17
|
+
/** The line as it shows: the old words while they leave, then the new. Words
|
|
18
|
+
* that come back while their line is leaving come in again at once. */
|
|
19
|
+
function useCrossfade(words) {
|
|
20
|
+
const [shown, setShown] = useState({ words, phase: "first" });
|
|
21
|
+
const latest = useRef(words);
|
|
22
|
+
latest.current = words;
|
|
23
|
+
const changed = words.key !== shown.words.key;
|
|
24
|
+
const leaving = shown.phase === "out";
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!changed) {
|
|
27
|
+
if (leaving)
|
|
28
|
+
setShown({ words: latest.current, phase: "in" });
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
if (!leaving) {
|
|
32
|
+
setShown((now) => ({ words: now.words, phase: "out" }));
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const timer = setTimeout(() => setShown({ words: latest.current, phase: "in" }), LINE_OUT_MS);
|
|
36
|
+
return () => clearTimeout(timer);
|
|
37
|
+
}, [changed, leaving, words.key]);
|
|
38
|
+
return changed ? shown : { words, phase: shown.phase };
|
|
39
|
+
}
|
|
40
|
+
export function Hold({ place, words, resting = false, carried = false, leaving = false, face, act }) {
|
|
41
|
+
const { waitMark } = useHostInputs();
|
|
42
|
+
const shown = useCrossfade(words);
|
|
43
|
+
return (_jsxs("div", { className: "ah-hold", "data-place": place, "data-face": face, "data-carried": carried ? "" : undefined, "data-leaving": leaving ? "" : undefined, role: "status", "aria-live": "polite", "aria-atomic": "true", children: [_jsx("div", { className: "ah-hold__mark", "aria-hidden": "true", children: waitMark?.mark(place, { resting }) }), _jsxs("div", { className: "ah-hold__words", "data-line": shown.phase, children: [_jsx("p", { className: "ah-hold__line", children: shown.words.line }), _jsx("p", { className: "ah-hold__sub", children: shown.words.sub }), act !== undefined && act !== null && _jsx("div", { className: "ah-hold__act", children: act })] })] }));
|
|
44
|
+
}
|
|
@@ -5,4 +5,4 @@ export interface MeterProps {
|
|
|
5
5
|
/** The width a known fraction draws: clamped, and never less than a sliver
|
|
6
6
|
* once something is known, so a started step is never drawn as empty. */
|
|
7
7
|
export declare function meterWidth(fraction: number): string;
|
|
8
|
-
export declare function Meter({ fraction }: MeterProps): import("react").JSX.Element;
|
|
8
|
+
export declare function Meter({ fraction }: MeterProps): import("react").JSX.Element | null;
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The room's colourless meter. A real fraction fills it; an amount nobody
|
|
3
|
+
// knows sweeps instead (`data-indeterminate`, styled in ingest.css). A fixed
|
|
4
|
+
// sliver is a claim of progress that was never measured, so the room does
|
|
5
|
+
// not draw one: readiness is data, never a timer. Beside a host's mark (R10)
|
|
6
|
+
// nothing sweeps — the mark is the sign of working — so an amount nobody knows
|
|
7
|
+
// draws no meter at all; a real fraction still fills.
|
|
8
|
+
import { useHostInputs } from "../../host-inputs.js";
|
|
2
9
|
/** The width a known fraction draws: clamped, and never less than a sliver
|
|
3
10
|
* once something is known, so a started step is never drawn as empty. */
|
|
4
11
|
export function meterWidth(fraction) {
|
|
5
12
|
return `${Math.min(100, Math.max(2, fraction * 100)).toFixed(1)}%`;
|
|
6
13
|
}
|
|
7
14
|
export function Meter({ fraction }) {
|
|
15
|
+
const { waitMark } = useHostInputs();
|
|
16
|
+
if (fraction === null && waitMark !== undefined)
|
|
17
|
+
return null;
|
|
8
18
|
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
19
|
}
|
|
@@ -6,6 +6,8 @@ export { DialogShell } from "./DialogShell.js";
|
|
|
6
6
|
export type { DialogShellProps } from "./DialogShell.js";
|
|
7
7
|
export { EmptyState } from "./EmptyState.js";
|
|
8
8
|
export type { EmptyStateProps } from "./EmptyState.js";
|
|
9
|
+
export { Hold } from "./Hold.js";
|
|
10
|
+
export type { HoldWords } from "./Hold.js";
|
|
9
11
|
export { ListSummaryHeader } from "./ListSummaryHeader.js";
|
|
10
12
|
export type { ListSummaryHeaderProps } from "./ListSummaryHeader.js";
|
|
11
13
|
export { ListToolbar } from "./ListToolbar.js";
|
|
@@ -2,6 +2,7 @@ export { ColumnHeading } from "./ColumnHeading.js";
|
|
|
2
2
|
export { ConfirmDialog } from "./ConfirmDialog.js";
|
|
3
3
|
export { DialogShell } from "./DialogShell.js";
|
|
4
4
|
export { EmptyState } from "./EmptyState.js";
|
|
5
|
+
export { Hold } from "./Hold.js";
|
|
5
6
|
export { ListSummaryHeader } from "./ListSummaryHeader.js";
|
|
6
7
|
export { ListToolbar } from "./ListToolbar.js";
|
|
7
8
|
export { Meter, meterWidth } from "./Meter.js";
|
package/dist/host-inputs.d.ts
CHANGED
|
@@ -193,6 +193,29 @@ export interface RoomRename {
|
|
|
193
193
|
/** The name's accessible name and tooltip as a control. Default: "Rename". */
|
|
194
194
|
readonly label?: string | undefined;
|
|
195
195
|
}
|
|
196
|
+
/** Where the room waits with a host's mark: the view (its hold while it
|
|
197
|
+
* reaches the index, and through the cold start before the first project),
|
|
198
|
+
* the transcript's column (a conversation opening) and the import card's head. */
|
|
199
|
+
export type RoomWaitPlace = "view" | "column" | "card";
|
|
200
|
+
/** R10 — the host's mark for the room's waits (VibeField's living mark). With
|
|
201
|
+
* one, a wait that fills a place is a HOLD — the mark, one line under it, and
|
|
202
|
+
* its count under that — and the import card wears the mark at its head, its
|
|
203
|
+
* words kept to the step's title and its count, a fraction it knows drawn as
|
|
204
|
+
* a colourless hairline. The room's meters sweep no more beside the mark (the
|
|
205
|
+
* mark is the sign of working); a fraction the room knows still fills. The
|
|
206
|
+
* room draws the mark where it is put and never reaches into it. Absent: the
|
|
207
|
+
* room's own waits, exactly as rosetta's app shows them. */
|
|
208
|
+
export interface RoomWaitMark {
|
|
209
|
+
/** The mark for one place, at rest while the work it stands for is paused
|
|
210
|
+
* (a mark moves only while its work does). */
|
|
211
|
+
readonly mark: (place: RoomWaitPlace, state: {
|
|
212
|
+
readonly resting: boolean;
|
|
213
|
+
}) => ReactNode;
|
|
214
|
+
/** The host already shows its own hold where the room's first one stands
|
|
215
|
+
* (its load before the room's): the room's first hold stands at once, so
|
|
216
|
+
* the mark is carried, never faded out and shown again. */
|
|
217
|
+
readonly carried?: boolean | undefined;
|
|
218
|
+
}
|
|
196
219
|
export interface RoomHostInputs {
|
|
197
220
|
/** R1 — a project's colour (any CSS colour). Absent, or null for a
|
|
198
221
|
* project: the room's own dealt tint. */
|
|
@@ -223,6 +246,8 @@ export interface RoomHostInputs {
|
|
|
223
246
|
/** R9 — the address ②'s repository act opens. Absent, or undefined for a
|
|
224
247
|
* project: the room's own reading of `git_repo`; null: no act. */
|
|
225
248
|
readonly repositoryUrl?: ((projectId: string) => string | null | undefined) | undefined;
|
|
249
|
+
/** R10 — the mark the room's waits wear (`RoomWaitMark`). */
|
|
250
|
+
readonly waitMark?: RoomWaitMark | undefined;
|
|
226
251
|
}
|
|
227
252
|
/** Only the host's inputs, picked out of the room's props. */
|
|
228
253
|
export declare function hostInputsOf(props: RoomHostInputs): RoomHostInputs;
|
package/dist/host-inputs.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { HistoryRoom } from "./HistoryRoom.js";
|
|
2
2
|
export type { HistoryRoomHandle, HistoryRoomProps, HistoryRoomSearch, RoomInset, RoomSelection, RoomTarget, } from "./HistoryRoom.js";
|
|
3
3
|
/** What a host may hand the room beyond its ports (all optional). */
|
|
4
|
-
export type { RoomAct, RoomFilter, RoomFolder, RoomFolderGroup, RoomFolders, RoomHeadActs, RoomHostInputs, RoomMenu, RoomMenuGroup, RoomMenuItem, RoomProjectContext, RoomProjectRow, RoomRename, RoomSection, RoomSessionRow, } from "./host-inputs.js";
|
|
4
|
+
export type { RoomAct, RoomFilter, RoomFolder, RoomFolderGroup, RoomFolders, RoomHeadActs, RoomHostInputs, RoomMenu, RoomMenuGroup, RoomMenuItem, RoomProjectContext, RoomProjectRow, RoomRename, RoomSection, RoomSessionRow, RoomWaitMark, RoomWaitPlace, } from "./host-inputs.js";
|
|
5
5
|
/** The reader (PK3): one session's transcript, read-only, at a line. */
|
|
6
6
|
export { TranscriptReader } from "./TranscriptReader.js";
|
|
7
7
|
export type { ReaderAddress, TranscriptReaderProps } from "./TranscriptReader.js";
|
|
@@ -73,6 +73,12 @@ export declare function phaseHeading(phase: ActivityPhase): string;
|
|
|
73
73
|
* that names no course is known resumed once its run is seen restoring; a
|
|
74
74
|
* room that opens after that phase cannot tell, and reads the fresh copy. */
|
|
75
75
|
export declare function resumedRun(previous: string | null, feed: ActivityFeed): string | null;
|
|
76
|
+
/** What the card says while the service does not answer: its title, and the
|
|
77
|
+
* line under it (the hold says the same under a host's mark, R10). */
|
|
78
|
+
export declare const PAUSED_UPDATES: {
|
|
79
|
+
readonly title: "Progress updates paused";
|
|
80
|
+
readonly detail: "Waiting for the background service. Reconnecting automatically…";
|
|
81
|
+
};
|
|
76
82
|
/** Percentages describe the named step, never an invented overall ETA. */
|
|
77
83
|
export declare function activityPhase(feed: ActivityFeed): ActivityPhase | null;
|
|
78
84
|
export declare function runtimeActivity(row: RuntimeBackfill, restoring?: boolean): {
|
|
@@ -73,6 +73,12 @@ export function resumedRun(previous, feed) {
|
|
|
73
73
|
}
|
|
74
74
|
const BORN_DURING_IMPORT = "Conversations you start now appear when the import finishes.";
|
|
75
75
|
const ARCHIVE_PAUSE = "Conversations may pause for a few seconds while the archive is saved.";
|
|
76
|
+
/** What the card says while the service does not answer: its title, and the
|
|
77
|
+
* line under it (the hold says the same under a host's mark, R10). */
|
|
78
|
+
export const PAUSED_UPDATES = {
|
|
79
|
+
title: "Progress updates paused",
|
|
80
|
+
detail: "Waiting for the background service. Reconnecting automatically…",
|
|
81
|
+
};
|
|
76
82
|
/** Percentages describe the named step, never an invented overall ETA. */
|
|
77
83
|
export function activityPhase(feed) {
|
|
78
84
|
const ingest = feed.ingest;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const HOLD_LATE_MS = 120;
|
|
2
|
+
export declare const HOLD_FLOOR_MS = 800;
|
|
3
|
+
export declare const HOLD_LEAVE_MS = 280;
|
|
4
|
+
export declare const HOLD_LEAVE_REDUCED_MS = 120;
|
|
5
|
+
/** What a hold does when its wait is over at `now`: a hold that never began
|
|
6
|
+
* to show is gone at once; one that has stands out its floor; past its floor
|
|
7
|
+
* it leaves. */
|
|
8
|
+
export declare function afterWait(now: number, shownAt: number): "gone" | "floor" | "leave";
|
|
9
|
+
/** The hold that stands now — the one asked for, or the last one while its
|
|
10
|
+
* floor and its leave run — whether it is leaving, and whether it is carried
|
|
11
|
+
* (only the room's first hold can be: one that comes back after it went is
|
|
12
|
+
* late again); null when none stands. */
|
|
13
|
+
export declare function useStandingHold<T>(hold: T | null, carried: boolean): {
|
|
14
|
+
readonly hold: T;
|
|
15
|
+
readonly leaving: boolean;
|
|
16
|
+
readonly carried: boolean;
|
|
17
|
+
} | null;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// How long a hold stands (R10): it is late (nothing for 120ms, so a wait
|
|
2
|
+
// answered at once shows no hold at all), and a hold that has begun to show
|
|
3
|
+
// stands at least 800ms — its mark's 400 in, then a beat to read the line —
|
|
4
|
+
// before it fades away over 280ms (120ms under reduced motion, as hold.css
|
|
5
|
+
// fades it). What comes next waits for it, so the room's next face never draws
|
|
6
|
+
// under a hold that is still there. A carried hold (the host's own stood where
|
|
7
|
+
// it stands) is shown from its first frame.
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { REDUCED_MOTION_QUERY } from "./motion.js";
|
|
10
|
+
export const HOLD_LATE_MS = 120;
|
|
11
|
+
export const HOLD_FLOOR_MS = 800;
|
|
12
|
+
export const HOLD_LEAVE_MS = 280;
|
|
13
|
+
export const HOLD_LEAVE_REDUCED_MS = 120;
|
|
14
|
+
/** The leave as hold.css draws it: one short fade under reduced motion. */
|
|
15
|
+
function leaveMs() {
|
|
16
|
+
const reduced = typeof window !== "undefined" && window.matchMedia?.(REDUCED_MOTION_QUERY).matches === true;
|
|
17
|
+
return reduced ? HOLD_LEAVE_REDUCED_MS : HOLD_LEAVE_MS;
|
|
18
|
+
}
|
|
19
|
+
/** What a hold does when its wait is over at `now`: a hold that never began
|
|
20
|
+
* to show is gone at once; one that has stands out its floor; past its floor
|
|
21
|
+
* it leaves. */
|
|
22
|
+
export function afterWait(now, shownAt) {
|
|
23
|
+
if (now < shownAt)
|
|
24
|
+
return "gone";
|
|
25
|
+
return now < shownAt + HOLD_FLOOR_MS ? "floor" : "leave";
|
|
26
|
+
}
|
|
27
|
+
/** The hold that stands now — the one asked for, or the last one while its
|
|
28
|
+
* floor and its leave run — whether it is leaving, and whether it is carried
|
|
29
|
+
* (only the room's first hold can be: one that comes back after it went is
|
|
30
|
+
* late again); null when none stands. */
|
|
31
|
+
export function useStandingHold(hold, carried) {
|
|
32
|
+
const last = useRef(hold);
|
|
33
|
+
if (hold !== null)
|
|
34
|
+
last.current = hold;
|
|
35
|
+
const shownOnce = useRef(false);
|
|
36
|
+
const wentAway = useRef(false);
|
|
37
|
+
const asked = hold !== null;
|
|
38
|
+
const [standing, setStanding] = useState(() => ({
|
|
39
|
+
phase: asked ? "hold" : "gone",
|
|
40
|
+
shownAt: Date.now() + (carried ? 0 : HOLD_LATE_MS),
|
|
41
|
+
}));
|
|
42
|
+
if (asked && standing.phase !== "hold") {
|
|
43
|
+
// a wait (again): a hold that was gone is late again; one still standing keeps its clock
|
|
44
|
+
setStanding({
|
|
45
|
+
phase: "hold",
|
|
46
|
+
shownAt: standing.phase === "gone" ? Date.now() + HOLD_LATE_MS : standing.shownAt,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
else if (!asked && standing.phase === "hold") {
|
|
50
|
+
setStanding({ phase: afterWait(Date.now(), standing.shownAt), shownAt: standing.shownAt });
|
|
51
|
+
}
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (standing.phase === "floor") {
|
|
54
|
+
const timer = setTimeout(() => setStanding((now) => (now.phase === "floor" ? { ...now, phase: "leave" } : now)), Math.max(0, standing.shownAt + HOLD_FLOOR_MS - Date.now()));
|
|
55
|
+
return () => clearTimeout(timer);
|
|
56
|
+
}
|
|
57
|
+
if (standing.phase === "leave") {
|
|
58
|
+
const timer = setTimeout(() => setStanding((now) => (now.phase === "leave" ? { ...now, phase: "gone" } : now)), leaveMs());
|
|
59
|
+
return () => clearTimeout(timer);
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}, [standing.phase, standing.shownAt]);
|
|
63
|
+
if (standing.phase === "gone" || last.current === null) {
|
|
64
|
+
if (shownOnce.current)
|
|
65
|
+
wentAway.current = true;
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
shownOnce.current = true;
|
|
69
|
+
return { hold: last.current, leaving: standing.phase === "leave", carried: carried && !wentAway.current };
|
|
70
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* The hold (R10, `components/ui/Hold.tsx`): a wait that fills a place, in the
|
|
2
|
+
host's mark. Rows `1fr | the mark | 1fr`: the mark at the place's centre and
|
|
3
|
+
its words 26 under it — the line 14/1.4 in the ramp's second ink, its count
|
|
4
|
+
4 under that, 12/1.4 in the third, its 17 kept so a count arriving moves
|
|
5
|
+
nothing — in tabular figures. Late, as the veil is (120ms, then the words
|
|
6
|
+
over 180ms and the mark over 400ms); carried, at once. The mark only fades.
|
|
7
|
+
Loading is colourless: the mark's own lights are the hold's only hue. */
|
|
8
|
+
.ah-hold {
|
|
9
|
+
position: absolute; inset: 0; z-index: 6;
|
|
10
|
+
display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); justify-items: center;
|
|
11
|
+
padding: 0 24px; text-align: center; pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
.ah-hold__mark {
|
|
14
|
+
grid-row: 2; display: flex; align-items: center; justify-content: center; min-height: 44px;
|
|
15
|
+
animation: ah-hold-in 400ms ease 120ms both;
|
|
16
|
+
}
|
|
17
|
+
.ah-hold__words {
|
|
18
|
+
grid-row: 3; display: flex; flex-direction: column; align-items: center; padding-top: 26px;
|
|
19
|
+
animation: ah-hold-in 180ms ease 120ms both;
|
|
20
|
+
}
|
|
21
|
+
.ah-hold__line {
|
|
22
|
+
margin: 0; color: var(--vf-text-secondary);
|
|
23
|
+
font-size: 14px; font-weight: 400; line-height: 1.4; font-variant-numeric: tabular-nums;
|
|
24
|
+
}
|
|
25
|
+
.ah-hold__sub {
|
|
26
|
+
margin: 4px 0 0; min-height: 17px; color: var(--vf-text-tertiary);
|
|
27
|
+
font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums;
|
|
28
|
+
}
|
|
29
|
+
.ah-hold__act { margin-top: 18px; pointer-events: auto; }
|
|
30
|
+
.ah-hold[data-carried] .ah-hold__mark,
|
|
31
|
+
.ah-hold[data-carried] .ah-hold__words { animation: none; }
|
|
32
|
+
/* A new line: the words leave (140ms), then the new ones come in (240ms). */
|
|
33
|
+
.ah-hold__words[data-line="out"] { animation: ah-hold-out 140ms ease both; }
|
|
34
|
+
.ah-hold__words[data-line="in"] { animation: ah-hold-in 240ms ease both; }
|
|
35
|
+
/* The wait is over: the hold fades (280ms) before what comes next. */
|
|
36
|
+
.ah-hold[data-leaving] .ah-hold__mark,
|
|
37
|
+
.ah-hold[data-leaving] .ah-hold__words { animation: ah-hold-out 280ms ease both; }
|
|
38
|
+
@keyframes ah-hold-in { from { opacity: 0; } }
|
|
39
|
+
@keyframes ah-hold-out { to { opacity: 0; } }
|
|
40
|
+
@media (prefers-reduced-motion: reduce) {
|
|
41
|
+
.ah-hold__mark { animation-duration: 160ms; }
|
|
42
|
+
.ah-hold__words { animation-duration: 120ms; }
|
|
43
|
+
.ah-hold__words[data-line="out"] { animation-duration: 60ms; }
|
|
44
|
+
.ah-hold__words[data-line="in"] { animation-duration: 120ms; }
|
|
45
|
+
.ah-hold[data-leaving] .ah-hold__mark,
|
|
46
|
+
.ah-hold[data-leaving] .ah-hold__words { animation-duration: 120ms; }
|
|
47
|
+
}
|
package/dist/styles/ingest.css
CHANGED
|
@@ -36,6 +36,20 @@
|
|
|
36
36
|
.ah-ingest-status[data-state="complete"] .ah-ingest-meter i { background: var(--vf-green); }
|
|
37
37
|
.ah-ingest-status[data-state="disconnected"] .ah-ingest-meter i,
|
|
38
38
|
.ah-ingest-status[data-state="search_failed"] .ah-ingest-meter i { background: var(--vf-orange); }
|
|
39
|
+
/* R10 — the card in the host's mark: the mark where IMPORTING HISTORY stood,
|
|
40
|
+
the step beside it; the step's title, its count under it; a colourless 2px
|
|
41
|
+
hairline for a fraction the step knows, none for one it does not, and no
|
|
42
|
+
meter in it sweeps (the mark is the sign of working). The rest is under
|
|
43
|
+
Agent details. Loading is colourless: no step's colour fills it. */
|
|
44
|
+
.ah-ingest-status[data-marked] .ah-ingest-status__eyebrow { font-size: 10px; font-weight: 500; letter-spacing: 0; color: var(--vf-text-tertiary); }
|
|
45
|
+
.ah-ingest-status__mark { display: flex; align-items: center; min-height: 18px; }
|
|
46
|
+
.ah-ingest-status[data-marked] h3 { margin: 10px 0 0; font-size: 13px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }
|
|
47
|
+
.ah-ingest-status__sub { margin: 3px 0 0; color: var(--vf-text-secondary); font-size: 11px; line-height: 1.45; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
|
|
48
|
+
.ah-ingest-status[data-marked] .ah-ingest-meter { height: 2px; margin-top: 11px; background: var(--vf-hairline-strong); }
|
|
49
|
+
.ah-ingest-status[data-marked][data-state] .ah-ingest-meter i { background: var(--vf-text-secondary); }
|
|
50
|
+
.ah-ingest-status[data-marked] .ah-ingest-meter[data-indeterminate] { display: none; }
|
|
51
|
+
.ah-ingest-status[data-marked] .ah-ingest-status__agents { margin-top: 10px; }
|
|
52
|
+
.ah-ingest-status[data-marked] .ah-ingest-status__agents > .ah-ingest-status__detail { margin: 6px 0 8px; }
|
|
39
53
|
.ah-cold-start { flex: 1; }
|
|
40
54
|
.ah-cold-start > .ah-ingest-status { width: min(100%, 340px); box-sizing: border-box; margin: 22px auto 0; padding: 18px 20px 10px; }
|
|
41
55
|
.ah-cold-start .ah-ingest-status h3 { font-size: 15px; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibefield/rosetta-room",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "rosetta's History room as a package: the projects, sessions and worktree columns, the panels and charts, and the transcript, behind injected ports. It dials nothing.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@radix-ui/react-context-menu": "^2.3.7",
|
|
36
36
|
"@radix-ui/react-dialog": "^1.1.23",
|
|
37
37
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
38
|
-
"@vibefield/rosetta-protocol": "^0.1.
|
|
38
|
+
"@vibefield/rosetta-protocol": "^0.1.6",
|
|
39
39
|
"@tanstack/react-virtual": "^3.14.10",
|
|
40
40
|
"@vibecook/mille": "^0.3.4",
|
|
41
41
|
"@vibecook/mille-ui": "^0.3.4"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"files": [
|
|
51
51
|
"dist"
|
|
52
52
|
],
|
|
53
|
-
"license": "
|
|
53
|
+
"license": "MIT",
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
|
56
56
|
"url": "git+https://github.com/vibefield/rosetta.git",
|