@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.
Files changed (115) hide show
  1. package/README.md +82 -4
  2. package/dist/HistoryRoom.d.ts +15 -2
  3. package/dist/HistoryRoom.js +84 -27
  4. package/dist/TranscriptReader.d.ts +7 -0
  5. package/dist/TranscriptReader.js +4 -4
  6. package/dist/components/ColdStart.js +1 -1
  7. package/dist/components/IngestStatus.d.ts +13 -0
  8. package/dist/components/IngestStatus.js +40 -3
  9. package/dist/components/IngestionControls.d.ts +6 -0
  10. package/dist/components/IngestionControls.js +75 -0
  11. package/dist/components/ListActivityNotice.d.ts +9 -1
  12. package/dist/components/ListActivityNotice.js +9 -2
  13. package/dist/components/SummaryPanels.d.ts +5 -0
  14. package/dist/components/SummaryPanels.js +16 -5
  15. package/dist/components/Transcript.d.ts +5 -0
  16. package/dist/components/Transcript.js +20 -5
  17. package/dist/components/artifacts/ArtifactLibrary.d.ts +14 -0
  18. package/dist/components/artifacts/ArtifactLibrary.js +156 -0
  19. package/dist/components/artifacts/content.d.ts +8 -0
  20. package/dist/components/artifacts/content.js +27 -0
  21. package/dist/components/artifacts/load-all.d.ts +5 -0
  22. package/dist/components/artifacts/load-all.js +31 -0
  23. package/dist/components/artifacts/preview.d.ts +4 -0
  24. package/dist/components/artifacts/preview.js +37 -0
  25. package/dist/components/artifacts/thumbnails.d.ts +13 -0
  26. package/dist/components/artifacts/thumbnails.js +43 -0
  27. package/dist/components/projects/ProjectList.d.ts +9 -3
  28. package/dist/components/projects/ProjectList.js +3 -3
  29. package/dist/components/projects/ProjectListItem.d.ts +9 -3
  30. package/dist/components/projects/ProjectListItem.js +18 -12
  31. package/dist/components/projects/ProjectsColumn.d.ts +4 -1
  32. package/dist/components/projects/ProjectsColumn.js +23 -9
  33. package/dist/components/search/SearchSheet.d.ts +39 -2
  34. package/dist/components/search/SearchSheet.js +82 -17
  35. package/dist/components/sessions/SessionList.d.ts +6 -1
  36. package/dist/components/sessions/SessionList.js +50 -20
  37. package/dist/components/sessions/SessionListItem.d.ts +3 -1
  38. package/dist/components/sessions/SessionListItem.js +17 -7
  39. package/dist/components/sessions/SessionsColumn.d.ts +3 -1
  40. package/dist/components/sessions/SessionsColumn.js +2 -2
  41. package/dist/components/sessions/session-display.d.ts +4 -1
  42. package/dist/components/sessions/session-display.js +13 -2
  43. package/dist/components/transcript/Attachments.js +6 -1
  44. package/dist/components/transcript/Document.d.ts +6 -1
  45. package/dist/components/transcript/Document.js +19 -6
  46. package/dist/components/transcript/ImportState.d.ts +35 -0
  47. package/dist/components/transcript/ImportState.js +86 -0
  48. package/dist/components/transcript/TranscriptLoading.js +15 -5
  49. package/dist/components/transcript/attachment-file-source.d.ts +2 -0
  50. package/dist/components/transcript/attachment-file-source.js +6 -6
  51. package/dist/components/transcript/attachment-gallery.d.ts +2 -1
  52. package/dist/components/transcript/attachment-gallery.js +2 -1
  53. package/dist/components/transcript/detail-parts.js +7 -6
  54. package/dist/components/transcript/timeline-meta-file-source.d.ts +2 -1
  55. package/dist/components/transcript/timeline-meta-file-source.js +45 -5
  56. package/dist/components/ui/EmptyState.d.ts +5 -1
  57. package/dist/components/ui/EmptyState.js +2 -2
  58. package/dist/components/ui/Meter.d.ts +8 -0
  59. package/dist/components/ui/Meter.js +9 -0
  60. package/dist/components/ui/SegmentedControl.d.ts +2 -0
  61. package/dist/components/ui/SegmentedControl.js +1 -1
  62. package/dist/components/ui/Veil.d.ts +2 -1
  63. package/dist/components/ui/Veil.js +9 -2
  64. package/dist/components/ui/index.d.ts +2 -0
  65. package/dist/components/ui/index.js +1 -0
  66. package/dist/fixtures/cold-import-corpus.d.ts +76 -0
  67. package/dist/fixtures/cold-import-corpus.js +349 -0
  68. package/dist/fixtures/cold-import-daemon.d.ts +25 -0
  69. package/dist/fixtures/cold-import-daemon.js +82 -0
  70. package/dist/fixtures/cold-import-schedule.d.ts +74 -0
  71. package/dist/fixtures/cold-import-schedule.js +191 -0
  72. package/dist/fixtures/cold-import.d.ts +151 -0
  73. package/dist/fixtures/cold-import.js +786 -0
  74. package/dist/fixtures/index.d.ts +2 -0
  75. package/dist/fixtures/index.js +21 -2
  76. package/dist/index.d.ts +1 -1
  77. package/dist/index.js +5 -0
  78. package/dist/lib/activity-order.d.ts +15 -0
  79. package/dist/lib/activity-order.js +24 -1
  80. package/dist/lib/conversation-readiness.d.ts +48 -0
  81. package/dist/lib/conversation-readiness.js +149 -0
  82. package/dist/lib/figure-order.d.ts +35 -0
  83. package/dist/lib/figure-order.js +68 -0
  84. package/dist/lib/hooks.d.ts +32 -10
  85. package/dist/lib/hooks.js +122 -55
  86. package/dist/lib/image-media.d.ts +12 -2
  87. package/dist/lib/image-media.js +40 -6
  88. package/dist/lib/import-state.d.ts +98 -0
  89. package/dist/lib/import-state.js +129 -0
  90. package/dist/lib/ingest-activity.d.ts +52 -0
  91. package/dist/lib/ingest-activity.js +127 -12
  92. package/dist/lib/ingest.d.ts +3 -0
  93. package/dist/lib/ingest.js +10 -0
  94. package/dist/lib/model.d.ts +16 -0
  95. package/dist/lib/model.js +27 -1
  96. package/dist/lib/search-sheet.d.ts +43 -0
  97. package/dist/lib/search-sheet.js +56 -7
  98. package/dist/lib/session-activity.d.ts +4 -1
  99. package/dist/lib/session-activity.js +4 -1
  100. package/dist/lib/title-search.d.ts +82 -0
  101. package/dist/lib/title-search.js +194 -0
  102. package/dist/lib/transcript/images.js +2 -2
  103. package/dist/lib/use-deferred-list-order.d.ts +6 -0
  104. package/dist/lib/use-deferred-list-order.js +8 -1
  105. package/dist/lib/use-ingest-activity.d.ts +5 -1
  106. package/dist/lib/use-ingest-activity.js +56 -20
  107. package/dist/ports.d.ts +21 -2
  108. package/dist/room-context.d.ts +1 -0
  109. package/dist/room-context.js +3 -2
  110. package/dist/styles/artifacts.css +66 -0
  111. package/dist/styles/history-room.css +1 -0
  112. package/dist/styles/ingest.css +32 -3
  113. package/dist/styles/room.css +15 -0
  114. package/dist/styles/search.css +17 -0
  115. package/package.json +2 -2
@@ -0,0 +1,191 @@
1
+ /** The hub's per-subscriber queue (crates/server/src/hub.rs:44). */
2
+ export const SUBSCRIBER_QUEUE = 1_024;
3
+ const FLIP_INTERVAL_MS = 100;
4
+ const FLIP_MAX_TREES = 64;
5
+ const FLIP_MAX_SESSIONS = 512;
6
+ const FLIP_MAX_TAIL_BYTES = 16 * 1024 * 1024;
7
+ const TAIL_SHARE = 0.025;
8
+ /** The sole writer returns to the flip loop between apply transactions;
9
+ * this grid gives about the trace's cadence (178 batches over ~106 s). */
10
+ const WRITER_RETURN_MS = 600;
11
+ /** Before consent the daemon's first walk is still discovering. */
12
+ export const DISCOVERY_MS = 300;
13
+ /** A fresh build: offsets from consent, ms. Two entries: claude-code, codex. */
14
+ const FRESH = {
15
+ register: 40, skimStart: 80,
16
+ metaPublic: [2_400, 2_480], captureLatency: 2_200,
17
+ readEnd: [108_900, 32_700], applying: [110_400, 33_200], close: [110_900, 33_500],
18
+ publishing: 133_000, canonical: 139_200, reveal: 139_290, live: 139_350,
19
+ search: { indexing: 139_600, optimizing: 144_600, validating: 144_800, publishing: 145_000, ready: 145_300 },
20
+ };
21
+ /** A resume: each runtime's stages in turn (ms each), then the end, as
22
+ * offsets from the last runtime's close. */
23
+ const RESUMED = {
24
+ runtimes: [
25
+ { replay: 2_400, skim: 300, catchUp: 21_000, prepare: 500 },
26
+ { replay: 800, skim: 150, catchUp: 3_500, prepare: 300 },
27
+ ],
28
+ finalizing: 5, publishing: 8_705, canonical: 12_705, reveal: 12_745, live: 12_805,
29
+ search: { indexing: 13_005, optimizing: 16_005, validating: 16_205, publishing: 16_505, ready: 16_705 },
30
+ };
31
+ /** Walk one lane newest first (recency, then tree id) at a constant rate
32
+ * over [start, end]: a tree is ready once its last byte is read. */
33
+ function walkLane(trees, start, end) {
34
+ const ordered = [...trees].sort((a, b) => b.recency - a.recency || a.id.localeCompare(b.id));
35
+ let at = 0;
36
+ const spans = ordered.map((tree) => {
37
+ const from = at;
38
+ at += tree.bytes;
39
+ return { tree, from, to: at };
40
+ });
41
+ return { start, end, bytes: at, spans };
42
+ }
43
+ const tailOf = (tree) => Math.round(tree.bytes * TAIL_SHARE);
44
+ /** D9: the first ready batch at once, then at most one per 100 ms, taken
45
+ * when the writer comes back, capped by trees, sessions and tail bytes; a
46
+ * batch's first tree is always taken. */
47
+ function batchFlips(runtimeId, ready) {
48
+ const queue = [...ready].sort((a, b) => a.at - b.at || a.tree.id.localeCompare(b.tree.id));
49
+ const batches = [];
50
+ let last = null;
51
+ let next = 0;
52
+ while (next < queue.length) {
53
+ const head = queue[next].at;
54
+ let at = last === null ? head : Math.max(head, last + FLIP_INTERVAL_MS);
55
+ if (last !== null)
56
+ at = Math.ceil(at / WRITER_RETURN_MS) * WRITER_RETURN_MS;
57
+ const trees = [];
58
+ let sessions = 0;
59
+ let tails = 0;
60
+ while (next < queue.length && queue[next].at <= at && trees.length < FLIP_MAX_TREES) {
61
+ const tree = queue[next].tree;
62
+ if (trees.length > 0 && (sessions + tree.members.length > FLIP_MAX_SESSIONS || tails + tailOf(tree) > FLIP_MAX_TAIL_BYTES))
63
+ break;
64
+ trees.push(tree);
65
+ sessions += tree.members.length;
66
+ tails += tailOf(tree);
67
+ next += 1;
68
+ }
69
+ batches.push({ at, runtimeId, trees, sessions: trees.flatMap((tree) => tree.members), kind: "tree" });
70
+ last = at;
71
+ }
72
+ return batches;
73
+ }
74
+ const filesOf = (trees) => Math.round(trees.reduce((sum, tree) => sum + tree.members.length, 0) * 1.72);
75
+ const bytesOf = (trees) => trees.reduce((sum, tree) => sum + tree.bytes, 0);
76
+ function planFresh(corpus, enrolled, consentAt, whole) {
77
+ const runtimes = [];
78
+ const batches = [];
79
+ for (const runtime of enrolled) {
80
+ const slot = corpus.runtimes.indexOf(runtime);
81
+ const trees = corpus.trees.filter((tree) => tree.runtimeId === runtime.id);
82
+ const metaPublic = consentAt + FRESH.metaPublic[slot];
83
+ const laneStart = metaPublic + FRESH.captureLatency;
84
+ const readEnd = consentAt + FRESH.readEnd[slot];
85
+ const lanes = [walkLane(trees.filter((t) => !t.big), laneStart, readEnd), walkLane(trees.filter((t) => t.big), laneStart, readEnd)];
86
+ const times = {
87
+ runtime, register: consentAt + FRESH.register, replay: null, skimStart: consentAt + FRESH.skimStart,
88
+ metaPublic, streamStart: metaPublic, readEnd,
89
+ applying: consentAt + FRESH.applying[slot], close: consentAt + FRESH.close[slot],
90
+ lanes, trees, bytes: bytesOf(trees), files: filesOf(trees),
91
+ sessions: corpus.sessions.filter((row) => row.runtime_id === runtime.id).length,
92
+ };
93
+ runtimes.push(times);
94
+ const perTree = !whole.has(runtime.id);
95
+ const ready = !perTree ? [] : lanes.flatMap((lane) => lane.spans.filter((span) => !span.tree.bound).map((span) => ({
96
+ tree: span.tree, at: Math.round(lane.start + ((lane.end - lane.start) * span.to) / Math.max(1, lane.bytes)),
97
+ })));
98
+ batches.push(...batchFlips(runtime.id, ready));
99
+ const bound = trees.filter((tree) => tree.bound || !perTree);
100
+ if (bound.length > 0) {
101
+ batches.push({ at: times.close, runtimeId: runtime.id, trees: bound, sessions: bound.flatMap((t) => t.members), kind: "close" });
102
+ }
103
+ }
104
+ return { runtimes, batches };
105
+ }
106
+ function planResumed(corpus, enrolled, consentAt) {
107
+ const runtimes = [];
108
+ let at = consentAt;
109
+ for (const runtime of enrolled) {
110
+ const slot = corpus.runtimes.indexOf(runtime);
111
+ const stages = RESUMED.runtimes[slot];
112
+ const trees = corpus.trees.filter((tree) => tree.runtimeId === runtime.id);
113
+ // The interrupted build walked newest first: its ledger holds the newer
114
+ // half, which the replay restores; the catch-up reads the rest.
115
+ const byRecency = [...trees].sort((a, b) => b.recency - a.recency || a.id.localeCompare(b.id));
116
+ const restored = byRecency.slice(0, Math.ceil(byRecency.length / 2));
117
+ const unread = byRecency.slice(restored.length);
118
+ const replayEnd = at + stages.replay;
119
+ const metaPublic = replayEnd + stages.skim;
120
+ const readEnd = metaPublic + stages.catchUp;
121
+ const close = readEnd + stages.prepare;
122
+ runtimes.push({
123
+ runtime, register: consentAt, replay: { start: at, end: replayEnd, bytes: bytesOf(restored) },
124
+ skimStart: replayEnd, metaPublic, streamStart: metaPublic, readEnd, applying: null, close,
125
+ lanes: [walkLane(unread, metaPublic, readEnd)], trees, bytes: bytesOf(trees), files: filesOf(trees),
126
+ sessions: corpus.sessions.filter((row) => row.runtime_id === runtime.id).length,
127
+ });
128
+ at = close;
129
+ }
130
+ return { runtimes, lastClose: at };
131
+ }
132
+ export function planSchedule(corpus, enrolled, consentAt, course, whole = new Set()) {
133
+ const phases = new Map([["consent", consentAt]]);
134
+ let runtimes;
135
+ let batches;
136
+ let end;
137
+ let commitAt = null;
138
+ if (course === "fresh") {
139
+ ({ runtimes, batches } = planFresh(corpus, enrolled, consentAt, whole));
140
+ const lastClose = Math.max(...runtimes.map((r) => r.close));
141
+ const from = (offset) => consentAt + offset;
142
+ end = {
143
+ finalizing: lastClose + 5, publishing: from(FRESH.publishing), canonical: from(FRESH.canonical),
144
+ reveal: from(FRESH.reveal), live: from(FRESH.live),
145
+ search: {
146
+ indexing: from(FRESH.search.indexing), optimizing: from(FRESH.search.optimizing), validating: from(FRESH.search.validating),
147
+ publishing: from(FRESH.search.publishing), ready: from(FRESH.search.ready),
148
+ },
149
+ };
150
+ }
151
+ else {
152
+ const planned = planResumed(corpus, enrolled, consentAt);
153
+ runtimes = planned.runtimes;
154
+ const from = (offset) => planned.lastClose + offset;
155
+ end = {
156
+ finalizing: from(RESUMED.finalizing), publishing: from(RESUMED.publishing), canonical: from(RESUMED.canonical),
157
+ reveal: from(RESUMED.reveal), live: from(RESUMED.live),
158
+ search: {
159
+ indexing: from(RESUMED.search.indexing), optimizing: from(RESUMED.search.optimizing), validating: from(RESUMED.search.validating),
160
+ publishing: from(RESUMED.search.publishing), ready: from(RESUMED.search.ready),
161
+ },
162
+ };
163
+ // Withheld until publication: one commit, public at the reveal.
164
+ const trees = runtimes.flatMap((r) => r.trees);
165
+ batches = [{ at: end.reveal, runtimeId: "", trees, sessions: trees.flatMap((t) => t.members), kind: "publication" }];
166
+ commitAt = end.publishing;
167
+ phases.set("restoring", consentAt);
168
+ }
169
+ batches.sort((a, b) => a.at - b.at || a.runtimeId.localeCompare(b.runtimeId));
170
+ const flipAt = new Map();
171
+ for (const batch of batches)
172
+ for (const tree of batch.trees)
173
+ if (!flipAt.has(tree.id))
174
+ flipAt.set(tree.id, batch.at);
175
+ phases.set("metadata", Math.max(...runtimes.map((r) => r.metaPublic)));
176
+ if (course === "fresh" && batches[0] !== undefined)
177
+ phases.set("first-flip", batches[0].at);
178
+ const giant = corpus.trees[0];
179
+ if (course === "fresh" && giant !== undefined && flipAt.has(giant.id))
180
+ phases.set("newest-giant", flipAt.get(giant.id));
181
+ phases.set("reading-done", Math.max(...runtimes.map((r) => r.readEnd)));
182
+ phases.set("runtime-close", Math.max(...runtimes.map((r) => r.close)));
183
+ for (const name of ["finalizing", "publishing", "canonical", "reveal", "live"])
184
+ phases.set(name, end[name]);
185
+ phases.set("search-indexing", end.search.indexing);
186
+ phases.set("search-optimizing", end.search.optimizing);
187
+ phases.set("search-validating", end.search.validating);
188
+ phases.set("search-publishing", end.search.publishing);
189
+ phases.set("search-ready", end.search.ready);
190
+ return { course, whole: course === "fresh" ? whole : new Set(), consentAt, runtimes, batches, flipAt, phases, commitAt };
191
+ }
@@ -0,0 +1,151 @@
1
+ import type { IngestPhase, IngestionState, MetaState, MetaSubscriptionHandlers, RosettaClient, SessionRow, StatusResponse } from "@vibefield/rosetta-protocol";
2
+ import type { CatalogStatus, Closable, RoomPorts } from "../ports.js";
3
+ import type { ColdCorpus, ColdCorpusOptions, ColdTree, SessionKind } from "./cold-import-corpus.js";
4
+ import type { ColdPhase, FlipBatch, RuntimeTimes } from "./cold-import-schedule.js";
5
+ export type { ColdCorpus, ColdCorpusOptions, ColdTree, SessionKind } from "./cold-import-corpus.js";
6
+ export type { ColdPhase, FlipBatch, FlipKind, RuntimeTimes } from "./cold-import-schedule.js";
7
+ export interface ColdImportOptions extends ColdCorpusOptions {
8
+ /** `fresh` (default): a first import. `resumed`: a cross-launch resume. */
9
+ readonly course?: "fresh" | "resumed";
10
+ /** `awaiting` (default for fresh): the app's roll call grants consent.
11
+ * `granted`: consent was given before (a resume always has it). */
12
+ readonly consent?: "awaiting" | "granted";
13
+ /** Agent kinds a fresh build admits whole, as a runtime-admission adapter
14
+ * or the kill switch has it: each of their sessions opens at its runtime's
15
+ * close. Default none: claude-code and codex admit per tree. */
16
+ readonly wholeRuntimes?: readonly string[];
17
+ }
18
+ /** One entry of the trail: every status ask and its fate, the grant, every
19
+ * metadata delivery and resync, and what a host marks (a connection change
20
+ * reaching the room), in one order. */
21
+ export interface ColdTrailEntry {
22
+ readonly seq: number;
23
+ /** Simulated ms. */
24
+ readonly at: number;
25
+ readonly what: string;
26
+ readonly detail: string | null;
27
+ }
28
+ /** What the room asked and heard, in order, with the simulated time. */
29
+ export interface ColdImportLog {
30
+ readonly status: number[];
31
+ readonly projectStats: {
32
+ readonly projectId: string;
33
+ readonly at: number;
34
+ }[];
35
+ readonly usage: number[];
36
+ readonly dayUsage: number[];
37
+ readonly search: {
38
+ readonly q: string;
39
+ readonly at: number;
40
+ }[];
41
+ readonly boosts: {
42
+ readonly sessionId: string;
43
+ readonly at: number;
44
+ }[];
45
+ readonly opened: string[];
46
+ readonly closed: string[];
47
+ readonly subscribed: {
48
+ readonly sessionId: string;
49
+ readonly at: number;
50
+ }[];
51
+ readonly enabled: {
52
+ readonly kinds: readonly string[];
53
+ readonly at: number;
54
+ }[];
55
+ /** Every metadata delivery: a snapshot (after a resync) or mutations. */
56
+ readonly meta: {
57
+ readonly seq: number;
58
+ readonly at: number;
59
+ readonly source: "snapshot" | "mutation";
60
+ readonly rows: number;
61
+ readonly why: string;
62
+ }[];
63
+ readonly resyncs: {
64
+ readonly seq: number;
65
+ readonly sessionId: string;
66
+ readonly at: number;
67
+ readonly delivered: boolean;
68
+ }[];
69
+ readonly trail: ColdTrailEntry[];
70
+ }
71
+ /** How a barrier reaches an open transcript. `immediate`: its socket resyncs
72
+ * at once (a flip's resync lands before its metadata,
73
+ * crates/rosettad/src/cold_stream/flips.rs:9-11).
74
+ * `manual`: held until `deliverResyncs()`. `drop`: the subscription raced
75
+ * the barrier and hears nothing. */
76
+ export type ResyncMode = "immediate" | "manual" | "drop";
77
+ export interface ColdImportController {
78
+ readonly corpus: ColdCorpus;
79
+ /** Epoch ms of the import clock's zero (the daemon's start). */
80
+ readonly now: number;
81
+ /** Simulated ms since the daemon started. */
82
+ readonly clock: number;
83
+ readonly course: "fresh" | "resumed";
84
+ readonly log: ColdImportLog;
85
+ resyncMode: ResyncMode;
86
+ /** When a phase happens, in simulated ms; null before consent places it
87
+ * (or for a phase this course has not). */
88
+ phaseAt(phase: ColdPhase): number | null;
89
+ /** A runtime's stages (by runtime id); null before consent. */
90
+ runtimeAt(runtimeId: string): RuntimeTimes | null;
91
+ /** When a tree (by its root id, or any rostered member) leaves Pending in
92
+ * the catalog; null when it never does or consent has not placed it yet. */
93
+ flipAt(sessionId: string): number | null;
94
+ kindOf(sessionId: string): SessionKind | null;
95
+ treeOf(sessionId: string): ColdTree | null;
96
+ /** The flip batches, in order, once consent placed them. */
97
+ batches(): readonly FlipBatch[];
98
+ /** Deliver everything up to `ms`, in order, then rest there. */
99
+ advanceTo(ms: number): void;
100
+ advanceToPhase(phase: ColdPhase): void;
101
+ /** The metadata the hub publishes now. */
102
+ meta(): MetaState;
103
+ /** One session's published stream state; null while it is not public. */
104
+ streamState(sessionId: string): SessionRow["stream_state"] | null;
105
+ /** What `/api/status` answers now, as the room reads it. */
106
+ status(): CatalogStatus;
107
+ /** The same, as the wire says it. */
108
+ statusResponse(): StatusResponse;
109
+ /** Just its phase, cheaply. */
110
+ phase(): IngestPhase;
111
+ /** Hold every status answer until `releaseStatus()` (answered then, at the
112
+ * simulated time of the release), so a test can see whether the room asks. */
113
+ holdStatus(): void;
114
+ releaseStatus(): number;
115
+ /** Status asks waiting on a hold. */
116
+ heldStatus(): number;
117
+ /** Deliver the resyncs `manual` mode held; returns how many. */
118
+ deliverResyncs(): number;
119
+ /** Refuse the next subscription's first snapshot as the shared-cache lock
120
+ * does during the build: the SDK hears the `not_ready` error frame and
121
+ * reconnects, which `retryRefused()` completes. */
122
+ refuseNextSnapshot(): void;
123
+ /** The refused subscriptions' reconnect: their snapshots; returns how many. */
124
+ retryRefused(): number;
125
+ /** The run's control state as the wire says it (`run.state`). Only the
126
+ * wire changes: a test that pauses does not advance until it resumes. */
127
+ setRunState(state: IngestionState): void;
128
+ /** Fire what a host fires when its route to the daemon changes, to every
129
+ * listener of `ports.catalog.onConnectionChange`; returns how many. */
130
+ connectionChange(): number;
131
+ /** Put a host-side event on the trail, in order with the daemon's. */
132
+ mark(what: string, detail?: string): void;
133
+ /** Make one project's figures fail (a 500, as a daemon mid-restart
134
+ * answers) until called with `false`; the ask is still logged. */
135
+ failFigures(projectId: string, failing: boolean): void;
136
+ }
137
+ export interface ColdImport {
138
+ readonly ports: RoomPorts;
139
+ /** The app's roll call client (`RollCallPanel`'s); granting consent
140
+ * places the schedule. */
141
+ readonly consent: Pick<RosettaClient, "discoveries" | "enableRuntimes">;
142
+ /** The same daemon for a host that builds its ports over a RosettaClient:
143
+ * its REST routes as a `fetchFn`, and /ws/meta, which a fixture has no
144
+ * socket for. Every ask goes through the same simulator and its log. */
145
+ readonly daemon: {
146
+ readonly fetch: typeof fetch;
147
+ subscribeMeta(handlers: MetaSubscriptionHandlers): Closable;
148
+ };
149
+ readonly controller: ColdImportController;
150
+ }
151
+ export declare function createColdImport(options: ColdImportOptions): ColdImport;