Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

fix(ok): bound terminal dock rehydration so the panel always mounts (#4097)

Nick Gomez76a499551c9c
diff --git a/.changeset/terminal-dock-mount-stall.md b/.changeset/terminal-dock-mount-stall.md
new file mode 100644
index 000000000..13af82172
--- /dev/null
+++ b/.changeset/terminal-dock-mount-stall.md
@@ -0,0 +1,13 @@
+---
+"@inkeep/open-knowledge": patch
+---
+
+Opening the terminal on a cold start no longer risks an empty dock that never fills in.
+
+The dock waits for your saved terminal tabs to be read back before it shows anything, and that read had no time limit. If it stalled, the dock opened and then stayed empty forever: no terminal, no message, and no way out short of reloading the window. A dock that was open when you last quit could stay empty even after the read finished, because nothing started a terminal once the restore was given up on.
+
+The read is now bounded. If it does not come back in time, comes back empty, or errors outright, the dock starts a fresh terminal instead of waiting, so you get a working shell rather than an empty panel. One case is different: if the check for shells that survived the restart fails, a dock being restored stays empty rather than opening a second shell on top of one that may still be running. Any shells that were still running are left running rather than being closed, and the timeout and any shells left behind are written to the log.
+
+The tradeoff worth knowing: whenever the restore does not complete, whether it timed out, the saved state could not be read, the surviving-shell check failed, or the restore errored, that window stops saving tab changes entirely, so your previous tabs survive to the next launch untouched. Opening, closing, renaming and reordering tabs still work for the rest of that window, they just are not remembered. That is deliberate, because a window that never learned what you had saved should not overwrite it with less. A line is written to the log the first time a save is skipped.
+
+The "Starting terminal…" spinner also explains itself now. If startup runs long, it adds a line saying so and offers a Reload button, while continuing to wait, so a slow start still finishes on its own.
diff --git a/knip.config.ts b/knip.config.ts
index a0ba1bf42..68adb81cc 100644
--- a/knip.config.ts
+++ b/knip.config.ts
@@ -127,7 +127,9 @@ export default {
'packages/server': {
entry: ['src/**/*.test.ts', 'src/parse-worker.ts'],
project: 'src/**',
- ignoreDependencies: ['@types/shell-quote'],
+ ignoreDependencies: [
+ '@types/shell-quote',
+ ],
},
'packages/cli': {
entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],
diff --git a/packages/app/src/components/SessionsHost.terminal-rehydration.dom.test.tsx b/packages/app/src/components/SessionsHost.terminal-rehydration.dom.test.tsx
new file mode 100644
index 000000000..53a1c84a6
--- /dev/null
+++ b/packages/app/src/components/SessionsHost.terminal-rehydration.dom.test.tsx
@@ -0,0 +1,324 @@
+// @vitest-environment jsdom
+import { act, cleanup, render, screen } from '@testing-library/react';
+import { useEffect, useState } from 'react';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import { TooltipProvider } from '@/components/ui/tooltip';
+import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
+
+vi.doMock('@/lib/acp/thread-client', () => ({
+ useOpenAgentThreadTabs: () => [],
+ useArchivedAgentThreads: () => [],
+ useAgentThreadConnection: () => 'open',
+ useAgentThreadUnread: () => false,
+ getAgentThreadClient: () => ({
+ closeThread: vi.fn(),
+ renameThread: vi.fn(),
+ openArchivedThread: vi.fn(),
+ deleteThread: vi.fn(),
+ markThreadViewed: vi.fn(),
+ }),
+}));
+
+vi.doMock('@/lib/acp/registered-agents', () => ({
+ useRegisteredAgents: () => [],
+ useDefaultRegisteredAgent: () => null,
+ getDefaultRegisteredAgent: () => null,
+ registerAgent: vi.fn(),
+ pickEffectiveDefaultAgent: () => null,
+ hydrateRegisteredAgentMeta: () => {},
+}));
+
+vi.doMock('@/lib/acp/launch-agent-thread', () => ({
+ launchAgentThread: vi.fn(async () => 'started'),
+ hasInflightThreadLaunch: () => false,
+}));
+
+vi.doMock('sonner', () => ({
+ toast: { error: vi.fn(), info: vi.fn(), success: vi.fn(), warning: vi.fn(), message: vi.fn() },
+}));
+
+vi.doMock('@tanstack/react-query', () => ({
+ useQuery: () => ({ data: undefined, isLoading: false, isError: false }),
+}));
+
+vi.doMock('./TerminalGate', () => ({
+ TerminalGate: ({
+ adoptPtyId,
+ onPtyId,
+ }: {
+ adoptPtyId?: string | null;
+ onPtyId?: (ptyId: string | null) => void;
+ }) => {
+ useEffect(() => {
+ onPtyId?.(adoptPtyId ?? 'pty-fresh');
+ }, [adoptPtyId, onPtyId]);
+ return <div data-testid="terminal-gate" data-adopt={adoptPtyId ?? ''} />;
+ },
+}));
+
+const { SessionsHost } = await import('./SessionsHost');
+
+const NEVER = () => new Promise<never>(() => {});
+
+function makeBridge(overrides: Record<string, unknown>): OkDesktopBridge {
+ return {
+ platform: 'darwin',
+ terminal: {
+ create: vi.fn(async () => ({ ptyId: 'pty-1' })),
+ kill: vi.fn(),
+ input: vi.fn(),
+ list: vi.fn(async () => []),
+ ...overrides,
+ },
+ editor: { notifyViewMenuStateChanged: vi.fn() },
+ } as unknown as OkDesktopBridge;
+}
+
+function Harness({
+ bridge,
+ restoreNonce = 0,
+ startVisible = false,
+ bumpRestoreAfterMount = false,
+}: {
+ bridge: OkDesktopBridge;
+ restoreNonce?: number;
+ startVisible?: boolean;
+ bumpRestoreAfterMount?: boolean;
+}) {
+ const [container, setContainer] = useState<HTMLDivElement | null>(null);
+ const [visible, setVisible] = useState(startVisible);
+ const [nonce, setNonce] = useState(restoreNonce);
+ useEffect(() => {
+ if (container == null || startVisible) return;
+ const id = window.setTimeout(() => {
+ if (bumpRestoreAfterMount) setNonce((n) => n + 1);
+ setVisible(true);
+ }, 0);
+ return () => window.clearTimeout(id);
+ }, [container, startVisible, bumpRestoreAfterMount]);
+ return (
+ <TooltipProvider>
+ <div ref={setContainer} data-testid="dock-container" />
+ <SessionsHost
+ surface="terminal-dock"
+ bridge={bridge}
+ terminalCapable
+ visible={visible}
+ terminalRestoreRevealNonce={nonce}
+ onVisibleChange={setVisible}
+ installedClis={{}}
+ container={container}
+ isShowing={visible && container != null}
+ onRequestEditorFocus={() => {}}
+ />
+ </TooltipProvider>
+ );
+}
+
+async function revealAndSettle(ms: number) {
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(ms);
+ });
+}
+
+describe('SessionsHost — terminal dock rehydration must always settle', () => {
+ beforeEach(() => {
+ vi.useFakeTimers();
+ });
+ afterEach(() => {
+ cleanup();
+ vi.useRealTimers();
+ });
+
+ test('a getDockState() that never settles still seeds a terminal on reveal', async () => {
+ render(<Harness bridge={makeBridge({ getDockState: NEVER })} />);
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a terminal.list() that never settles still seeds a terminal on reveal', async () => {
+ render(<Harness bridge={makeBridge({ list: NEVER })} />);
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a healthy bridge still adopts surviving PTYs rather than cold-seeding', async () => {
+ const list = vi.fn(async () => [{ ptyId: 'pty-live', customLabel: null, ordinal: 1 }]);
+ render(<Harness bridge={makeBridge({ list })} />);
+ await revealAndSettle(1_000);
+ expect(list).toHaveBeenCalled();
+ const adopted = screen
+ .getAllByTestId('terminal-gate')
+ .map((el) => el.getAttribute('data-adopt'));
+ expect(adopted).toContain('pty-live');
+ });
+
+ test('a healthy restore does persist the dock state', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminal: { order: ['pty-saved'], activeKey: 'pty-saved' },
+ terminalSnapshot: { tabs: [{ ordinal: 1, customLabel: 'saved' }], activeOrdinal: 1 },
+ }));
+ render(<Harness bridge={makeBridge({ getDockState, setDockState })} />);
+ await revealAndSettle(1_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ expect(setDockState).toHaveBeenCalled();
+ });
+
+ test('an abandoned restore does not overwrite the saved tab set it failed to read', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ render(
+ <Harness
+ bridge={makeBridge({ getDockState: NEVER, setDockState })}
+ restoreNonce={1}
+ startVisible
+ />,
+ );
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ expect(screen.getAllByTestId('terminal-gate').length).toBeGreaterThan(0);
+ expect(setDockState).not.toHaveBeenCalled();
+ });
+
+ test('a rejecting getDockState does not overwrite the saved tab set either', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ const getDockState = vi.fn(async () => {
+ throw new Error('ipc exploded');
+ });
+ render(<Harness bridge={makeBridge({ getDockState, setDockState })} />);
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ expect(setDockState).not.toHaveBeenCalled();
+ });
+
+ test('a rejecting getDockState still seeds on a restore reveal when no PTY survived', async () => {
+ const getDockState = vi.fn(async () => {
+ throw new Error('dock state transport failed');
+ });
+ render(<Harness bridge={makeBridge({ getDockState })} bumpRestoreAfterMount />);
+ await revealAndSettle(1_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a dock visible at mount also seeds when no PTY survived, not just on a later reveal', async () => {
+ const getDockState = vi.fn(async () => {
+ throw new Error('dock state transport failed');
+ });
+ render(<Harness bridge={makeBridge({ getDockState })} restoreNonce={1} startVisible />);
+ await revealAndSettle(1_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a healthy read that has nothing saved still seeds one terminal', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ }));
+ render(
+ <Harness bridge={makeBridge({ getDockState, setDockState })} restoreNonce={1} startVisible />,
+ );
+ await revealAndSettle(1_000);
+ expect(getDockState).toHaveBeenCalled();
+ expect(document.querySelectorAll('[data-terminal-session]')).toHaveLength(1);
+ expect(setDockState.mock.calls.at(-1)?.[0]?.order).toHaveLength(1);
+ });
+
+ test('a rejecting terminal.list does not overwrite the saved tab set either', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminal: { order: ['pty-a', 'pty-b'], activeKey: 'pty-b' },
+ terminalSnapshot: {
+ tabs: [
+ { ordinal: 1, customLabel: 'build' },
+ { ordinal: 2, customLabel: 'server' },
+ ],
+ activeOrdinal: 2,
+ },
+ }));
+ const list = vi.fn(async () => {
+ throw new Error('pty list exploded');
+ });
+ render(<Harness bridge={makeBridge({ getDockState, list, setDockState })} />);
+ await revealAndSettle(10_000);
+ expect(getDockState).toHaveBeenCalled();
+ expect(document.querySelectorAll('[data-terminal-session]')).toHaveLength(1);
+ expect(setDockState).not.toHaveBeenCalled();
+ });
+
+ test('a malformed restart snapshot from the bridge still cold-starts rather than wedging', async () => {
+ const setDockState = vi.fn(async () => ({ ok: true }));
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminalSnapshot: { activeOrdinal: 1 },
+ }));
+ render(
+ <Harness bridge={makeBridge({ getDockState, setDockState })} restoreNonce={1} startVisible />,
+ );
+ await revealAndSettle(1_000);
+ expect(document.querySelectorAll('[data-terminal-session]')).toHaveLength(1);
+ expect(setDockState).not.toHaveBeenCalled();
+ });
+
+ test('a dock visible at mount does not cold-seed when list() left survivors unknown', async () => {
+ const create = vi.fn(async () => ({ ptyId: 'should-not-happen' }));
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminal: { order: ['pty-a'], activeKey: 'pty-a' },
+ terminalSnapshot: { tabs: [{ ordinal: 1, customLabel: 'build' }], activeOrdinal: 1 },
+ }));
+ const list = vi.fn(async () => {
+ throw new Error('inventory transport failed');
+ });
+ render(
+ <Harness bridge={makeBridge({ create, getDockState, list })} restoreNonce={1} startVisible />,
+ );
+ await revealAndSettle(10_000);
+ expect(document.querySelectorAll('[data-terminal-session]')).toHaveLength(0);
+ expect(create).not.toHaveBeenCalled();
+ });
+
+ test('a dock restored open at quit still seeds when the restore read never settles', async () => {
+ render(<Harness bridge={makeBridge({ getDockState: NEVER })} restoreNonce={1} startVisible />);
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a restore-triggered reveal still seeds once the restore is abandoned', async () => {
+ render(<Harness bridge={makeBridge({ getDockState: NEVER })} bumpRestoreAfterMount />);
+ await revealAndSettle(10_000);
+ expect(document.querySelector('[data-terminal-session]')).not.toBeNull();
+ });
+
+ test('a restore resolving after the deadline neither replaces nor duplicates the seeded session', async () => {
+ let resolveList: ((v: unknown[]) => void) | undefined;
+ const list = vi.fn(
+ () =>
+ new Promise((r) => {
+ resolveList = r as (v: unknown[]) => void;
+ }),
+ );
+ render(<Harness bridge={makeBridge({ list })} />);
+ await revealAndSettle(10_000);
+ const before = document.querySelectorAll('[data-terminal-session]').length;
+ expect(before).toBeGreaterThan(0);
+ const adoptedBefore = screen
+ .getAllByTestId('terminal-gate')
+ .map((el) => el.getAttribute('data-adopt'));
+ resolveList?.([{ ptyId: 'pty-late', customLabel: null, ordinal: 1 }]);
+ await revealAndSettle(100);
+ expect(document.querySelectorAll('[data-terminal-session]').length).toBe(before);
+ const adoptedAfter = screen
+ .getAllByTestId('terminal-gate')
+ .map((el) => el.getAttribute('data-adopt'));
+ expect(adoptedAfter).toEqual(adoptedBefore);
+ expect(adoptedAfter).not.toContain('pty-late');
+ });
+});
diff --git a/packages/app/src/components/SessionsHost.tsx b/packages/app/src/components/SessionsHost.tsx
index 1ac35743f..59fb8741a 100644
--- a/packages/app/src/components/SessionsHost.tsx
+++ b/packages/app/src/components/SessionsHost.tsx
@@ -247,6 +247,8 @@ interface SessionsHostProps {
readonly onRequestEditorFocus: () => void;
}
+const TERMINAL_RESTORE_TIMEOUT_MS = 5_000;
+
const TERMINAL_DOCK_KINDS: Record<Exclude<LauncherSelection['kind'], 'thread' | 'none'>, true> = {
cli: true,
terminal: true,
@@ -341,6 +343,10 @@ export function SessionsHost({
const lastHandledThreadNonceRef = useRef<number | null>(null);
const settingsShownForNonceRef = useRef<number | null>(null);
const seedOwedRef = useRef(false);
+ const restoreAbandonedRef = useRef(false);
+ const restoreUnreadRef = useRef(false);
+ const persistDeclineLoggedRef = useRef(false);
+ const persistSuppressedRef = useRef<() => boolean>(() => false);
const lastHandledCommandNonceRef = useRef<number | null>(null);
const prevVisibleRef = useRef(isWindow ? false : visible);
const consumedRestoreRevealNonceRef = useRef(terminalRestoreRevealNonce);
@@ -369,9 +375,23 @@ export function SessionsHost({
getAgentThreadClient().openArchivedThread(threadId);
}
+ function dockPersistSuppressed(): boolean {
+ if (!persistsOrder) return true;
+ if (canRehydrate && !rehydrationSettled) return true;
+ if (restoreUnreadRef.current) {
+ if (!persistDeclineLoggedRef.current) {
+ persistDeclineLoggedRef.current = true;
+ console.warn(
+ '[terminal] dock persistence suppressed for this window: the restore did not complete, so the saved tab set is left untouched',
+ );
+ }
+ return true;
+ }
+ return false;
+ }
+
function persistDockOrderNow() {
- if (!persistsOrder) return;
- if (canRehydrate && !rehydrationSettled) return;
+ if (dockPersistSuppressed()) return;
const ptyMap = ptyIdBySessionRef.current;
const order = sessionsRef.current
.map((session) => computePersistKey(session, ptyMap))
@@ -745,6 +765,7 @@ export function SessionsHost({
const closeActiveRef = useRef(() => {});
useEffect(() => {
+ persistSuppressedRef.current = dockPersistSuppressed;
openSessionRef.current = openSession;
seedOnRevealRef.current = seedOnReveal;
dispatchAskAiRef.current = dispatchAskAi;
@@ -767,6 +788,7 @@ export function SessionsHost({
useEffect(() => {
if (!persistsOrder) return;
if (!rehydrationSettled) return;
+ if (persistSuppressedRef.current()) return;
const ptyMap = ptyIdBySessionRef.current;
const order = sessions
.map((session) => computePersistKey(session, ptyMap))
@@ -897,7 +919,7 @@ export function SessionsHost({
!threadLaunchPending &&
!(hostThreads && hasInflightThreadLaunch())
) {
- if (restoredVisibility) return;
+ if (restoredVisibility && !restoreAbandonedRef.current) return;
seedOwedRef.current = !seedOnRevealRef.current();
return;
}
@@ -906,7 +928,7 @@ export function SessionsHost({
seedOwedRef.current = false;
return;
}
- if (effectiveDefaultAgent === null) return;
+ if (hostThreads && effectiveDefaultAgent === null) return;
if (seedOnRevealRef.current()) seedOwedRef.current = false;
}, [
visible,
@@ -957,77 +979,141 @@ export function SessionsHost({
if (rehydratedRef.current) return;
rehydratedRef.current = true;
let cancelled = false;
+ let abandoned = false;
+ const settle = () => {
+ if (!cancelled) setRehydrationSettled(true);
+ };
+ const restoreDeadline = window.setTimeout(() => {
+ abandoned = true;
+ console.warn(
+ `[terminal] dock restore exceeded its ${TERMINAL_RESTORE_TIMEOUT_MS}ms bound; cold-starting instead of waiting`,
+ );
+ restoreAbandonedRef.current = true;
+ restoreUnreadRef.current = true;
+ seedOwedRef.current = true;
+ settle();
+ }, TERMINAL_RESTORE_TIMEOUT_MS);
+ const finish = () => {
+ window.clearTimeout(restoreDeadline);
+ if (!abandoned) settle();
+ };
void (async () => {
- const { sessionOrder: persisted, terminalSnapshot: restartSnapshot } =
- await readDockRestoreState(bridge, persistSurface);
- if (!cancelled && persisted != null) {
- reloadOrderRef.current = persisted.order;
- pendingActiveKeyRef.current = persisted.activeKey;
- }
- let survivors:
- | readonly {
- ptyId: string;
- customLabel: string | null;
- ordinal: number | null;
- }[]
- | null = null;
try {
- survivors = (await bridge.terminal.list()) ?? [];
- } catch (err) {
- console.error('[terminal] reload session list() failed; preserving restart snapshot:', err);
- }
- if (cancelled) return;
- if (survivors != null && survivors.length > 0) {
- const order = reloadOrderRef.current;
- const rankOf = (ptyId: string) => {
- const i = order.indexOf(ptyId);
- return i === -1 ? Number.POSITIVE_INFINITY : i;
- };
- const recovered: TerminalSessionDescriptor[] = survivors
- .map((entry, index) => ({
+ const {
+ sessionOrder: persisted,
+ terminalSnapshot: restartSnapshot,
+ failed: restoreReadFailed,
+ } = await readDockRestoreState(bridge, persistSurface);
+ if (cancelled || abandoned) return;
+ if (restoreReadFailed) restoreUnreadRef.current = true;
+ if (persisted != null) {
+ reloadOrderRef.current = persisted.order;
+ pendingActiveKeyRef.current = persisted.activeKey;
+ }
+ let survivors:
+ | readonly {
+ ptyId: string;
+ customLabel: string | null;
+ ordinal: number | null;
+ }[]
+ | null = null;
+ try {
+ survivors = (await bridge.terminal.list()) ?? [];
+ } catch (err) {
+ restoreUnreadRef.current = true;
+ console.error(
+ `[terminal] reload session list() failed; the surviving shells are unknown: ${String(err)}`,
+ );
+ }
+ if (cancelled) return;
+ if (abandoned) {
+ const stranded = (survivors ?? []).map((entry) => entry.ptyId);
+ if (stranded.length > 0) {
+ console.warn(
+ `[terminal] dock restore was abandoned before list() resolved; these PTYs stay running unadopted: ${stranded.join(', ')}`,
+ );
+ }
+ return;
+ }
+ if (survivors != null && survivors.length > 0) {
+ const order = reloadOrderRef.current;
+ const rankOf = (ptyId: string) => {
+ const i = order.indexOf(ptyId);
+ return i === -1 ? Number.POSITIVE_INFINITY : i;
+ };
+ const recovered: TerminalSessionDescriptor[] = survivors
+ .map((entry, index) => ({
+ kind: 'terminal' as const,
+ commandId: null,
+ id: makeSessionId(index + 1),
+ launch: null,
+ title: null,
+ customLabel: entry.customLabel ?? null,
+ ordinal: entry.ordinal ?? index + 1,
+ adoptPtyId: entry.ptyId,
+ }))
+ .sort((a, b) => {
+ const ra = rankOf(a.adoptPtyId);
+ const rb = rankOf(b.adoptPtyId);
+ return ra === rb ? 0 : ra - rb;
+ });
+ sessionCounterRef.current = Math.max(
+ recovered.length,
+ ...recovered.map((r) => r.ordinal),
+ );
+ setSessions(recovered);
+ } else if (
+ survivors != null &&
+ restartSnapshot != null &&
+ restartSnapshot.tabs.length > 0
+ ) {
+ const recovered = restartSnapshot.tabs.map((entry, index) => ({
kind: 'terminal' as const,
commandId: null,
id: makeSessionId(index + 1),
launch: null,
title: null,
- customLabel: entry.customLabel ?? null,
- ordinal: entry.ordinal ?? index + 1,
- adoptPtyId: entry.ptyId,
- }))
- .sort((a, b) => {
- const ra = rankOf(a.adoptPtyId);
- const rb = rankOf(b.adoptPtyId);
- return ra === rb ? 0 : ra - rb;
- });
- sessionCounterRef.current = Math.max(recovered.length, ...recovered.map((r) => r.ordinal));
- setSessions(recovered);
- } else if (survivors != null && restartSnapshot != null && restartSnapshot.tabs.length > 0) {
- const recovered = restartSnapshot.tabs.map((entry, index) => ({
- kind: 'terminal' as const,
- commandId: null,
- id: makeSessionId(index + 1),
- launch: null,
- title: null,
- customLabel: entry.customLabel,
- ordinal: entry.ordinal,
- adoptPtyId: null,
- }));
- sessionCounterRef.current = Math.max(recovered.length, ...recovered.map((r) => r.ordinal));
- pendingActiveKeyRef.current = null;
- setSessions(recovered);
- const active = recovered.find(
- (session) => session.ordinal === restartSnapshot?.activeOrdinal,
+ customLabel: entry.customLabel,
+ ordinal: entry.ordinal,
+ adoptPtyId: null,
+ }));
+ sessionCounterRef.current = Math.max(
+ recovered.length,
+ ...recovered.map((r) => r.ordinal),
+ );
+ pendingActiveKeyRef.current = null;
+ setSessions(recovered);
+ const active = recovered.find(
+ (session) => session.ordinal === restartSnapshot?.activeOrdinal,
+ );
+ if (active != null) setActiveSessionId(active.id);
+ } else if (survivors != null) {
+ restoreAbandonedRef.current = true;
+ seedOwedRef.current = true;
+ }
+ window.setTimeout(() => {
+ if (!cancelled) pendingActiveKeyRef.current = null;
+ }, 9_000);
+ finish();
+ } catch (err) {
+ restoreUnreadRef.current = true;
+ restoreAbandonedRef.current = true;
+ seedOwedRef.current = true;
+ console.error(
+ `[terminal] dock rehydration failed; cold-starting: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`,
);
- if (active != null) setActiveSessionId(active.id);
+ finish();
}
- setRehydrationSettled(true);
- window.setTimeout(() => {
- if (!cancelled) pendingActiveKeyRef.current = null;
- }, 9_000);
})();
return () => {
cancelled = true;
+ abandoned = true;
+ window.clearTimeout(restoreDeadline);
rehydratedRef.current = false;
+ restoreAbandonedRef.current = false;
+ restoreUnreadRef.current = false;
+ seedOwedRef.current = false;
+ persistDeclineLoggedRef.current = false;
};
}, [bridge, hostTerminals, persistSurface]);
diff --git a/packages/app/src/components/TerminalPanel.dom.test.tsx b/packages/app/src/components/TerminalPanel.dom.test.tsx
index 728bc5e4e..3d5a90ca7 100644
--- a/packages/app/src/components/TerminalPanel.dom.test.tsx
+++ b/packages/app/src/components/TerminalPanel.dom.test.tsx
@@ -654,6 +654,24 @@ describe('TerminalPanel', () => {
expect(screen.queryByTestId('terminal-starting-notice')).toBeNull();
});
+ test('the starting notice keeps its Reload clickable under the click-through overlay', async () => {
+ vi.useFakeTimers();
+ try {
+ const { bridge } = makeBridge({ ok: true, ptyId: 'pty-1' });
+ render(<TerminalPanel bridge={bridge} />);
+ const notice = await vi.waitFor(() => screen.getByTestId('terminal-starting-notice'));
+ expect(notice.className).toContain('pointer-events-none');
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(8_000);
+ });
+ const reload = screen.getByRole('button', { name: 'Reload' });
+ expect(notice.contains(reload)).toBe(true);
+ expect(reload.className).toContain('pointer-events-auto');
+ } finally {
+ vi.useRealTimers();
+ }
+ });
+
test('forwards user keystrokes to the PTY via input', async () => {
const { bridge, terminal } = makeBridge({ ok: true, ptyId: 'pty-1' });
render(<TerminalPanel bridge={bridge} />);
diff --git a/packages/app/src/components/TerminalStartingNotice.dom.test.tsx b/packages/app/src/components/TerminalStartingNotice.dom.test.tsx
new file mode 100644
index 000000000..5091a3b7e
--- /dev/null
+++ b/packages/app/src/components/TerminalStartingNotice.dom.test.tsx
@@ -0,0 +1,53 @@
+// @vitest-environment jsdom
+import { act, cleanup, render, screen } from '@testing-library/react';
+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
+import { TerminalStartingNotice } from './TerminalStartingNotice';
+
+describe('TerminalStartingNotice', () => {
+ beforeEach(() => {
+ vi.useFakeTimers();
+ });
+ afterEach(() => {
+ cleanup();
+ vi.useRealTimers();
+ });
+
+ test('shows only the spinner label while the wait is still normal', () => {
+ render(<TerminalStartingNotice />);
+ expect(screen.getByTestId('terminal-starting-notice').getAttribute('data-slow')).toBeNull();
+ expect(screen.queryByRole('button')).toBeNull();
+ });
+
+ test('explains itself and offers recovery once the wait becomes abnormal', async () => {
+ render(<TerminalStartingNotice />);
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(8_000);
+ });
+ expect(screen.getByTestId('terminal-starting-notice').getAttribute('data-slow')).toBe('true');
+ expect(screen.getByRole('button')).toBeTruthy();
+ });
+
+ test('escalates inside the region that already existed, minting no new one', async () => {
+ const { container } = render(<TerminalStartingNotice />);
+ const regionsBefore = [...container.querySelectorAll('[role="status"]')];
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(8_000);
+ });
+ const regions = [...container.querySelectorAll('[role="status"]')];
+ expect(regions.length).toBe(regionsBefore.length);
+ for (const [index, region] of regions.entries()) {
+ expect(region).toBe(regionsBefore[index]);
+ }
+ const escalation = screen.getByText(/taking longer than usual/);
+ expect(regions.some((region) => region.contains(escalation))).toBe(true);
+ expect(regions.some((region) => region.contains(screen.getByRole('button')))).toBe(false);
+ });
+
+ test('keeps waiting rather than replacing the panel with a dead end', async () => {
+ render(<TerminalStartingNotice />);
+ await act(async () => {
+ await vi.advanceTimersByTimeAsync(60_000);
+ });
+ expect(screen.getByTestId('terminal-starting-notice')).toBeTruthy();
+ });
+});
diff --git a/packages/app/src/components/TerminalStartingNotice.tsx b/packages/app/src/components/TerminalStartingNotice.tsx
index 722b8d1d0..1805de2cd 100644
--- a/packages/app/src/components/TerminalStartingNotice.tsx
+++ b/packages/app/src/components/TerminalStartingNotice.tsx
@@ -1,25 +1,48 @@
import { useLingui } from '@lingui/react/macro';
+import { useEffect, useState } from 'react';
+import { Button } from '@/components/ui/button';
import { Spinner } from '@/components/ui/spinner';
import { cn } from '@/lib/utils';
+const TERMINAL_SLOW_NOTICE_MS = 8_000;
+
interface TerminalStartingNoticeProps {
readonly className?: string;
}
export function TerminalStartingNotice({ className }: TerminalStartingNoticeProps) {
const { t } = useLingui();
+ const [slow, setSlow] = useState(false);
+ useEffect(() => {
+ const timer = window.setTimeout(() => setSlow(true), TERMINAL_SLOW_NOTICE_MS);
+ return () => window.clearTimeout(timer);
+ }, []);
return (
<div
- role="status"
data-testid="terminal-starting-notice"
+ data-slow={slow ? 'true' : undefined}
className={cn(
- 'flex h-full w-full items-center justify-center gap-2.5 bg-background px-6 text-center text-muted-foreground text-sm',
+ 'flex h-full w-full flex-col items-center justify-center gap-3 overflow-y-auto bg-background px-6 text-center text-muted-foreground text-sm',
'fade-in-0 animate-in duration-200 [animation-delay:400ms] [animation-fill-mode:backwards] motion-reduce:duration-0',
className,
)}
>
- <Spinner aria-hidden="true" />
- {t`Starting terminal…`}
+ <div role="status" className="flex flex-col items-center gap-3">
+ <span className="flex items-center gap-2.5">
+ <Spinner aria-hidden="true" />
+ {t`Starting terminal…`}
+ </span>
+ {slow ? (
+ <p className="max-w-sm">
+ {t`This is taking longer than usual. Reloading the window usually clears it.`}
+ </p>
+ ) : null}
+ </div>
+ {slow ? (
+ <Button className="pointer-events-auto" onClick={() => window.location.reload()}>
+ {t`Reload`}
+ </Button>
+ ) : null}
</div>
);
}
diff --git a/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx b/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx
index 9e043d02b..3a15d1233 100644
--- a/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx
+++ b/packages/app/src/editor/extensions/source-dirty-fold-atomicity.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { sharedExtensions as coreExtensions, MarkdownManager } from '@inkeep/open-knowledge-core';
import { type ObserverDispatchKind, setupServerObservers } from '@inkeep/open-knowledge-server';
import { cleanup } from '@testing-library/react';
diff --git a/packages/app/src/lib/dock-session-persistence.test.ts b/packages/app/src/lib/dock-session-persistence.test.ts
index 95831da30..fed543d90 100644
--- a/packages/app/src/lib/dock-session-persistence.test.ts
+++ b/packages/app/src/lib/dock-session-persistence.test.ts
@@ -130,6 +130,7 @@ describe('desktop backend (bridge)', () => {
await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
sessionOrder: { order: ['pty-1'], activeKey: 'pty-1' },
+ failed: false,
terminalSnapshot: {
tabs: [{ ordinal: 1, customLabel: 'deploy' }],
activeOrdinal: 1,
@@ -212,6 +213,22 @@ describe('desktop backend (bridge)', () => {
await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
sessionOrder: null,
terminalSnapshot: undefined,
+ failed: true,
+ });
+ });
+
+ test('an absent sub-record is a successful read, not a failed one', async () => {
+ const bridge = {
+ terminal: {
+ list: async () => [],
+ getDockState: async () => ({ terminalSnapshot: { tabs: [], activeOrdinal: null } }),
+ },
+ } as unknown as OkDesktopBridge;
+
+ await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
+ sessionOrder: null,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ failed: false,
});
});
@@ -222,6 +239,7 @@ describe('desktop backend (bridge)', () => {
await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
sessionOrder: null,
terminalSnapshot: undefined,
+ failed: false,
});
writeDockSessionOrder(bridge, 'terminal', { order: ['desktop-pty'], activeKey: null });
diff --git a/packages/app/src/lib/dock-session-persistence.ts b/packages/app/src/lib/dock-session-persistence.ts
index 53d17ec1a..b40d0a3cd 100644
--- a/packages/app/src/lib/dock-session-persistence.ts
+++ b/packages/app/src/lib/dock-session-persistence.ts
@@ -10,6 +10,7 @@ export interface DockSessionOrder {
export interface DockRestoreState {
readonly sessionOrder: DockSessionOrder | null;
readonly terminalSnapshot: OkTerminalRestartSnapshot | undefined;
+ readonly failed: boolean;
}
const WEB_STORAGE_KEYS: Record<DockSurface, string> = {
@@ -52,20 +53,21 @@ export async function readDockRestoreState(
const state = await bridge.terminal.getDockState();
const record = state[surface];
if (record == null) {
- return { sessionOrder: null, terminalSnapshot: state.terminalSnapshot };
+ return { sessionOrder: null, terminalSnapshot: state.terminalSnapshot, failed: false };
}
const { order, activeKey } = coerceOrder(record);
const sessionOrder = order.length === 0 && activeKey === null ? null : { order, activeKey };
- return { sessionOrder, terminalSnapshot: state.terminalSnapshot };
+ return { sessionOrder, terminalSnapshot: state.terminalSnapshot, failed: false };
} catch (err) {
- console.warn('[dock-session-persistence] getDockState failed; cold-starting:', err);
- return { sessionOrder: null, terminalSnapshot: undefined };
+ console.warn(`[dock-session-persistence] getDockState failed; cold-starting: ${String(err)}`);
+ return { sessionOrder: null, terminalSnapshot: undefined, failed: true };
}
}
return {
sessionOrder: bridge?.terminal == null ? readWebDockSessionOrder(surface) : null,
terminalSnapshot: undefined,
+ failed: false,
};
}
@@ -97,12 +99,14 @@ export function writeDockSessionOrder(
if (result.reason === 'ipc-unavailable') {
console.warn('[dock-session-persistence] setDockState skipped during window teardown');
} else {
- console.error('[dock-session-persistence] setDockState failed:', result.reason);
+ console.error(`[dock-session-persistence] setDockState failed: ${result.reason}`);
}
}
})
.catch((err: unknown) => {
- console.error('[dock-session-persistence] setDockState rejected:', err);
+ console.error(
+ `[dock-session-persistence] setDockState rejected: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}`,
+ );
});
return;
}
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index 4844a3bae..564ad2db5 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -3858,6 +3858,7 @@
"gHSAWT": ["إنشاء شجرة عمل <0>“<1>", ["typedName"], "</1>”</0>"],
"gHb5bB": ["إظهار التعليقات المحلولة (", ["0"], ")"],
"gITz7o": ["حرّك المؤشر أو وسّع التحديد عبر خريطة مفاتيح التنقل القياسية لمحرر مصدر CodeMirror."],
+ "gJ5Yso": ["يستغرق هذا وقتًا أطول من المعتاد. عادةً ما تؤدي إعادة تحميل النافذة إلى حل المشكلة."],
"gJR87V": ["تعذّر إنشاء مجلد المشروع. اختر مجلدًا مختلفًا."],
"gKi-a_": ["مشروع جديد"],
"gLCE2c": [
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index f899767be..fce67425f 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -10691,6 +10691,7 @@ msgstr "الصلة"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "هذه معاينة لـ {boldName}، اكتُشفت في {boldHarness}
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "هذه معاينة لـ {boldName}. ثبّتها في وكلائك."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "يستغرق هذا وقتًا أطول من المعتاد. عادةً ما تؤدي إعادة تحميل النافذة إلى حل المشكلة."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "هذا ليس ملف سمة عاديًا"
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index bf7770059..3ccc83a75 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -3278,6 +3278,7 @@
"gHSAWT": ["ওয়ার্কট্রি <0>“<1>", ["typedName"], "</1>”</0> তৈরি করুন"],
"gHb5bB": ["সমাধান হওয়া মন্তব্য দেখান (", ["0"], ")"],
"gITz7o": ["CodeMirror-এর আদর্শ সোর্স-সম্পাদক নেভিগেশন কীম্যাপ দিয়ে কার্সর সরান বা নির্বাচন বাড়ান।"],
+ "gJ5Yso": ["এটি স্বাভাবিকের চেয়ে বেশি সময় নিচ্ছে। উইন্ডোটি আবার লোড করলে সাধারণত এটি ঠিক হয়ে যায়।"],
"gJR87V": ["প্রকল্পের ফোল্ডার তৈরি করা যায়নি। অন্য ফোল্ডার বাছুন।"],
"gKi-a_": ["নতুন প্রকল্প"],
"gLCE2c": [
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index ce1b3d739..7152d4e5d 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -10687,6 +10687,7 @@ msgstr "প্রাসঙ্গিকতা"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13760,6 +13761,10 @@ msgstr "এটি {boldName}-এর একটি প্রাকদর্শন,
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "এটি {boldName}-এর একটি প্রাকদর্শন। এটি আপনার এজেন্টগুলোতে ইনস্টল করুন।"
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "এটি স্বাভাবিকের চেয়ে বেশি সময় নিচ্ছে। উইন্ডোটি আবার লোড করলে সাধারণত এটি ঠিক হয়ে যায়।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "এটি একটি সাধারণ থিম ফাইল নয়"
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index 618906ca5..5cf9e73c4 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -3372,6 +3372,7 @@
"gITz7o": [
"Move the cursor or extend selection through CodeMirror's standard source-editor navigation keymap."
],
+ "gJ5Yso": ["This is taking longer than usual. Reloading the window usually clears it."],
"gJR87V": ["Could not create the project folder. Pick a different folder."],
"gKi-a_": ["New project"],
"gLCE2c": [
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index 71e351fff..5ac979d7a 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -10691,6 +10691,7 @@ msgstr "Relevance"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "This is a preview of {boldName}, detected in {boldHarness} at the {boldL
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "This is a preview of {boldName}. Install it into your agents."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "This is taking longer than usual. Reloading the window usually clears it."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "This isn’t a regular theme file"
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index dde9d0541..1e7168890 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -3939,6 +3939,7 @@
"gITz7o": [
"Mueve el cursor o amplía la selección con el mapa de teclas estándar de navegación del editor de código de CodeMirror."
],
+ "gJ5Yso": ["Esto está tardando más de lo habitual. Recargar la ventana suele solucionarlo."],
"gJR87V": ["No se pudo crear la carpeta del proyecto. Elige otra carpeta."],
"gKi-a_": ["Proyecto nuevo"],
"gLCE2c": [
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index 0a6b23c40..9bab493c7 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -10691,6 +10691,7 @@ msgstr "Relevancia"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "Esto es una vista previa de {boldName}, detectada en {boldHarness} en el
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "Esto es una vista previa de {boldName}. Instálala en tus agentes."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "Esto está tardando más de lo habitual. Recargar la ventana suele solucionarlo."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "Este no es un archivo de tema normal"
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index 59412d3f3..6944f5d1b 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -3967,6 +3967,9 @@
"gITz7o": [
"Déplace le curseur ou étend la sélection via le mappage clavier de navigation standard de l'éditeur de source CodeMirror."
],
+ "gJ5Yso": [
+ "Cela prend plus de temps que d'habitude. Recharger la fenêtre suffit généralement à résoudre le problème."
+ ],
"gJR87V": ["Impossible de créer le dossier du projet. Choisissez un autre dossier."],
"gKi-a_": ["Nouveau projet"],
"gLCE2c": [
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index 52ba115d1..cd81e3c82 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -10691,6 +10691,7 @@ msgstr "Pertinence"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "Ceci est un aperçu de {boldName}, détectée dans {boldHarness} au nive
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "Ceci est un aperçu de {boldName}. Installez-la dans vos agents."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "Cela prend plus de temps que d'habitude. Recharger la fenêtre suffit généralement à résoudre le problème."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "Ce fichier n’est pas un fichier de thème standard"
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index 4e2ea74ff..99e110fe5 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -3273,6 +3273,9 @@
"gHSAWT": ["वर्कट्री <0>“<1>", ["typedName"], "</1>”</0> बनाएँ"],
"gHb5bB": ["हल की गई टिप्पणियाँ दिखाएँ (", ["0"], ")"],
"gITz7o": ["CodeMirror के मानक स्रोत-संपादक नेविगेशन कीमैप से कर्सर हिलाएँ या चयन बढ़ाएँ।"],
+ "gJ5Yso": [
+ "इसमें सामान्य से अधिक समय लग रहा है। विंडो को फिर से लोड करने से आमतौर पर यह ठीक हो जाता है।"
+ ],
"gJR87V": ["प्रोजेक्ट फ़ोल्डर नहीं बनाया जा सका। कोई दूसरा फ़ोल्डर चुनें।"],
"gKi-a_": ["नया प्रोजेक्ट"],
"gLCE2c": [
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index b5e659d07..21bfdc5eb 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -10687,6 +10687,7 @@ msgstr "प्रासंगिकता"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13760,6 +13761,10 @@ msgstr "यह {boldName} का पूर्वावलोकन है, ज
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "यह {boldName} का पूर्वावलोकन है। इसे अपने एजेंट में इंस्टॉल करें।"
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "इसमें सामान्य से अधिक समय लग रहा है। विंडो को फिर से लोड करने से आमतौर पर यह ठीक हो जाता है।"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "यह सामान्य थीम फ़ाइल नहीं है"
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index 8d9f9fe45..38f055212 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -3395,6 +3395,9 @@
"gITz7o": [
"Memindahkan kursor atau memperluas pilihan lewat peta tombol navigasi penyunting sumber standar CodeMirror."
],
+ "gJ5Yso": [
+ "Ini memakan waktu lebih lama dari biasanya. Memuat ulang jendela biasanya mengatasinya."
+ ],
"gJR87V": ["Folder proyek tidak dapat dibuat. Pilih folder lain."],
"gKi-a_": ["Proyek baru"],
"gLCE2c": [
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index e3e89e383..e9f4c5315 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -10687,6 +10687,7 @@ msgstr "Relevansi"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13760,6 +13761,10 @@ msgstr "Ini pratinjau {boldName}, terdeteksi di {boldHarness} pada tingkat {bold
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "Ini pratinjau {boldName}. Pasang ke agen Anda."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "Ini memakan waktu lebih lama dari biasanya. Memuat ulang jendela biasanya mengatasinya."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "Ini bukan berkas tema biasa"
diff --git a/packages/app/src/locales/ko/messages.json b/packages/app/src/locales/ko/messages.json
index 5eaf91150..a487bae28 100644
--- a/packages/app/src/locales/ko/messages.json
+++ b/packages/app/src/locales/ko/messages.json
@@ -3264,6 +3264,7 @@
"gITz7o": [
"CodeMirror 표준 소스 편집기 탐색 키맵을 사용해 커서를 이동하거나 선택 영역을 확장합니다."
],
+ "gJ5Yso": ["평소보다 오래 걸리고 있습니다. 창을 새로 고치면 대개 해결됩니다."],
"gJR87V": ["프로젝트 폴더를 만들지 못했습니다. 다른 폴더를 선택하세요."],
"gKi-a_": ["새 프로젝트"],
"gLCE2c": [
diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.po
index 18454c536..04afd1ac8 100644
--- a/packages/app/src/locales/ko/messages.po
+++ b/packages/app/src/locales/ko/messages.po
@@ -10691,6 +10691,7 @@ msgstr "관련성"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "이것은 {boldName}의 미리보기입니다. {boldHarness}의 {boldLev
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "이것은 {boldName}의 미리보기입니다. 에이전트에 설치하세요."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "평소보다 오래 걸리고 있습니다. 창을 새로 고치면 대개 해결됩니다."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "일반 테마 파일이 아닙니다"
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index a2ab7cc42..0c1acaf63 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -3372,6 +3372,7 @@
"gITz7o": [
"Ḿōvē ţĥē ćũŕśōŕ ōŕ ēxţēńď śēĺēćţĩōń ţĥŕōũĝĥ ĆōďēḾĩŕŕōŕ'ś śţàńďàŕď śōũŕćē-ēďĩţōŕ ńàvĩĝàţĩōń ķēŷḿàƥ."
],
+ "gJ5Yso": ["Ţĥĩś ĩś ţàķĩńĝ ĺōńĝēŕ ţĥàń ũśũàĺ. Ŕēĺōàďĩńĝ ţĥē ŵĩńďōŵ ũśũàĺĺŷ ćĺēàŕś ĩţ."],
"gJR87V": ["Ćōũĺď ńōţ ćŕēàţē ţĥē ƥŕōĴēćţ ƒōĺďēŕ. Ƥĩćķ à ďĩƒƒēŕēńţ ƒōĺďēŕ."],
"gKi-a_": ["Ńēŵ ƥŕōĴēćţ"],
"gLCE2c": [
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index 8648a13ca..1a31296ca 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -10687,6 +10687,7 @@ msgstr ""
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13760,6 +13761,10 @@ msgstr ""
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr ""
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr ""
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr ""
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index d98e3221f..9cfdf8aa2 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -3851,6 +3851,7 @@
"gITz7o": [
"Move o cursor ou estende a seleção pelo mapa de teclas padrão de navegação do editor de código do CodeMirror."
],
+ "gJ5Yso": ["Isto está demorando mais que o normal. Recarregar a janela costuma resolver."],
"gJR87V": ["Não foi possível criar a pasta do projeto. Escolha outra pasta."],
"gKi-a_": ["Novo projeto"],
"gLCE2c": [
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 246645489..c1efb8c90 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -10687,6 +10687,7 @@ msgstr "Relevância"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13760,6 +13761,10 @@ msgstr "Isto é uma pré-visualização de {boldName}, detectada em {boldHarness
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "Isto é uma pré-visualização de {boldName}. Instale-a nos seus agentes."
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "Isto está demorando mais que o normal. Recarregar a janela costuma resolver."
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "Este não é um arquivo de tema comum"
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index 29bc3ba64..fd02820c5 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -3452,6 +3452,9 @@
"gITz7o": [
"CodeMirror کے معیاری سورس ایڈیٹر نیویگیشن کی میپ کے ذریعے کرسر ہلائیں یا انتخاب بڑھائیں۔"
],
+ "gJ5Yso": [
+ "اس میں معمول سے زیادہ وقت لگ رہا ہے۔ ونڈو کو دوبارہ لوڈ کرنے سے عام طور پر یہ ٹھیک ہو جاتا ہے۔"
+ ],
"gJR87V": ["پروجیکٹ کا فولڈر نہیں بنایا جا سکا۔ کوئی مختلف فولڈر منتخب کریں۔"],
"gKi-a_": ["نیا پروجیکٹ"],
"gLCE2c": [
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 7211863e1..c9ab0154b 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -10691,6 +10691,7 @@ msgstr "مطابقت"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "یہ {boldName} کا پیش منظر ہے، جو {boldHarness} میں {b
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "یہ {boldName} کا پیش منظر ہے۔ اسے اپنے ایجنٹس میں نصب کریں۔"
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "اس میں معمول سے زیادہ وقت لگ رہا ہے۔ ونڈو کو دوبارہ لوڈ کرنے سے عام طور پر یہ ٹھیک ہو جاتا ہے۔"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "یہ عام تھیم فائل نہیں ہے"
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index b67b1cbc5..4580111cc 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -2975,6 +2975,7 @@
"gHSAWT": ["创建 worktree <0>“<1>", ["typedName"], "</1>”</0>"],
"gHb5bB": ["显示已解决的评论(", ["0"], ")"],
"gITz7o": ["通过 CodeMirror 标准的源码编辑器导航按键映射移动光标或扩展选区。"],
+ "gJ5Yso": ["这比平常花的时间更长。重新加载窗口通常可以解决此问题。"],
"gJR87V": ["无法创建项目文件夹。请换一个文件夹。"],
"gKi-a_": ["新建项目"],
"gLCE2c": ["GitHub 拒绝了该请求。你可能需要在浏览器中为 ", ["owner"], " 授权 OpenKnowledge。"],
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 976716c54..5d2afc7c4 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -10691,6 +10691,7 @@ msgstr "相关度"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "这是 {boldName} 的预览,在 {boldHarness} 的 {boldLevel} 级别
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "这是 {boldName} 的预览。把它安装到你的智能体中。"
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "这比平常花的时间更长。重新加载窗口通常可以解决此问题。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "这不是常规主题文件"
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index 71fc1571e..1dcb26b21 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -2999,6 +2999,7 @@
"gHSAWT": ["建立 worktree <0>「<1>", ["typedName"], "</1>」</0>"],
"gHb5bB": ["顯示已解決的註解(", ["0"], ")"],
"gITz7o": ["透過 CodeMirror 標準的原始碼編輯器導覽按鍵對應來移動游標或延伸選取範圍。"],
+ "gJ5Yso": ["這比平常花的時間更長。重新載入視窗通常可以解決此問題。"],
"gJR87V": ["無法建立專案資料夾。請換一個資料夾。"],
"gKi-a_": ["新增專案"],
"gLCE2c": [
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index 9b448c96d..fba307fd3 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -10691,6 +10691,7 @@ msgstr "相關度"
#: src/components/EditorActivityPool.tsx
#: src/components/settings/SettingsDialogErrorBoundary.tsx
#: src/components/TerminalGate.tsx
+#: src/components/TerminalStartingNotice.tsx
#: src/lib/locale-load-failure-notice.ts
#: src/lib/native-menu-catalog.ts
msgid "Reload"
@@ -13764,6 +13765,10 @@ msgstr "這是 {boldName} 的預覽,在 {boldHarness} 的 {boldLevel} 層級
msgid "This is a preview of {boldName}. Install it into your agents."
msgstr "這是 {boldName} 的預覽。把它安裝到你的代理中。"
+#: src/components/TerminalStartingNotice.tsx
+msgid "This is taking longer than usual. Reloading the window usually clears it."
+msgstr "這比平常花的時間更長。重新載入視窗通常可以解決此問題。"
+
#: src/components/settings/SavedThemesTiles.tsx
msgid "This isn’t a regular theme file"
msgstr "這不是一般的主題檔案"
diff --git a/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx b/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx
index f81d64a77..65162a22f 100644
--- a/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx
+++ b/packages/app/tests/dom/input-rule-atom-ranges.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { cleanup } from '@testing-library/react';
import { Editor, getSchema } from '@tiptap/core';
import type { MarkType, Node as PMNode } from '@tiptap/pm/model';
diff --git a/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx b/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx
index c4c510031..c5b8ad023 100644
--- a/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx
+++ b/packages/app/tests/dom/jsx-interior-input-rule-suppression.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { cleanup } from '@testing-library/react';
import { Editor, type JSONContent } from '@tiptap/core';
import type { Node as PMNode } from '@tiptap/pm/model';
diff --git a/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx b/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx
index 931aaa880..65b32f4b3 100644
--- a/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx
+++ b/packages/app/tests/dom/plain-text-clipboard.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { cleanup } from '@testing-library/react';
import { Editor } from '@tiptap/core';
import type { Node as PMNode } from '@tiptap/pm/model';
diff --git a/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx b/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx
index c9744993d..2ab40357a 100644
--- a/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx
+++ b/packages/app/tests/dom/serializer-seam-rederive.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { MarkdownManager, stripFrontmatter } from '@inkeep/open-knowledge-core';
import { cleanup } from '@testing-library/react';
import { Editor, type JSONContent } from '@tiptap/core';
diff --git a/packages/app/tests/dom/task-list-input-rule.dom.test.tsx b/packages/app/tests/dom/task-list-input-rule.dom.test.tsx
index e01856aac..1db8b25a9 100644
--- a/packages/app/tests/dom/task-list-input-rule.dom.test.tsx
+++ b/packages/app/tests/dom/task-list-input-rule.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { cleanup } from '@testing-library/react';
import type { Editor } from '@tiptap/core';
import type { Node as PMNode } from '@tiptap/pm/model';
diff --git a/packages/app/tests/dom/underline-round-trip.dom.test.tsx b/packages/app/tests/dom/underline-round-trip.dom.test.tsx
index f0bea3f33..652d75f43 100644
--- a/packages/app/tests/dom/underline-round-trip.dom.test.tsx
+++ b/packages/app/tests/dom/underline-round-trip.dom.test.tsx
@@ -1,3 +1,4 @@
+
import { MarkdownManager, sharedExtensions, stripFrontmatter } from '@inkeep/open-knowledge-core';
import { cleanup } from '@testing-library/react';
import { Editor, getSchema, type JSONContent } from '@tiptap/core';
diff --git a/packages/app/tests/integration/api-error-envelope/create-folder.test.ts b/packages/app/tests/integration/api-error-envelope/create-folder.test.ts
index 49257d365..079b42e9a 100644
--- a/packages/app/tests/integration/api-error-envelope/create-folder.test.ts
+++ b/packages/app/tests/integration/api-error-envelope/create-folder.test.ts
@@ -1,3 +1,4 @@
+
import { CreateFolderSuccessSchema, ProblemDetailsSchema } from '@inkeep/open-knowledge-core';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
import { HARNESS_BOOT_TIMEOUT_MS } from '../harness-boot-timeout';
diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
index 8a60e5826..a28cc2b18 100644
--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts
@@ -1,3 +1,4 @@
+
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
index 6fcdc23f2..4fc2c11f9 100644
--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { normalizeBridge } from '@inkeep/open-knowledge-core';
import { updateYFragment } from '@tiptap/y-tiptap';
diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.ts
index 40b5cdfd6..9f2f6feb6 100644
--- a/packages/app/tests/integration/interior-edit-freshness.test.ts
+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
index 93666af70..2a085742b 100644
--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.ts
index 867598d34..878d5196b 100644
--- a/packages/app/tests/integration/producer-guard-wiring.test.ts
+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts
@@ -1,3 +1,4 @@
+
import { setTimeout as wait } from 'node:timers/promises';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
index 0970ac12f..4ada3cf26 100644
--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterEach, describe, expect, test } from 'vitest';
import { agentWriteMd, createTestServer, type TestServer } from './test-harness';
diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
index b632185e1..cbe2b705f 100644
--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts
@@ -1,3 +1,4 @@
+
import { execFileSync } from 'node:child_process';
import { randomUUID } from 'node:crypto';
import { join } from 'node:path';
diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
index c530ce4ba..89bc9b4d9 100644
--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts
@@ -1,3 +1,4 @@
+
import { randomUUID } from 'node:crypto';
import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';
import type * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.ts
index d3767adc9..a78aeb0e4 100644
--- a/packages/app/tests/integration/undo-after-rollback.test.ts
+++ b/packages/app/tests/integration/undo-after-rollback.test.ts
@@ -1,3 +1,4 @@
+
import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';
import { afterAll, beforeAll, describe, expect, test } from 'vitest';
import * as Y from 'yjs';
diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.ts
index be1a29fbc..39e64a221 100644
--- a/packages/app/tests/integration/undo-recycle-reset.test.ts
+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts
@@ -1,3 +1,4 @@
+
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import { setTimeout as wait } from 'node:timers/promises';
diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.ts
index 7935e35f8..9ddcd0730 100644
--- a/packages/app/tests/integration/undo-rederive-survival.test.ts
+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter } from '@inkeep/open-knowledge-core';
import { Plugin, PluginKey } from '@tiptap/pm/state';
import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';
diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.ts
index f4cc8a286..2a597ec3d 100644
--- a/packages/core/src/bridge/compose.ts
+++ b/packages/core/src/bridge/compose.ts
@@ -1,3 +1,4 @@
+
import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';
export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';
diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.ts
index 8fb428b90..01ef76a9f 100644
--- a/packages/core/src/bridge/doc-boundary-space.ts
+++ b/packages/core/src/bridge/doc-boundary-space.ts
@@ -1,3 +1,4 @@
+
import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';
import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';
diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.ts
index bfbd5a2e8..20a68d2a1 100644
--- a/packages/core/src/markdown/comment-promoter.ts
+++ b/packages/core/src/markdown/comment-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/fixtures/index.ts b/packages/core/src/markdown/fixtures/index.ts
index 00f5771ee..6931623c7 100644
--- a/packages/core/src/markdown/fixtures/index.ts
+++ b/packages/core/src/markdown/fixtures/index.ts
@@ -1,3 +1,4 @@
+
import { readFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -8,6 +9,7 @@ function fixturePath(...segments: string[]): string {
return resolve(FIXTURES_DIR, ...segments);
}
+
interface GfmExample {
section: string;
markdown: string;
@@ -17,6 +19,7 @@ export function loadGfmExamples(): GfmExample[] {
return JSON.parse(readFileSync(fixturePath('gfm', 'examples.json'), 'utf8')) as GfmExample[];
}
+
interface MdxCrashEntry {
id: string;
input: string;
@@ -68,6 +71,7 @@ export function loadLargeEmbedFixtures(): LargeEmbedFixture[] {
) as LargeEmbedFixture[];
}
+
export function loadPrd6955Before(): string {
return readFileSync(fixturePath('regression', 'prd-6955-before.md'), 'utf8');
}
@@ -76,6 +80,7 @@ export function loadPrd6955CorruptedTriplicated(): string {
return readFileSync(fixturePath('regression', 'prd-6955-corrupted-triplicated.md'), 'utf8');
}
+
export interface NgPinnedCase {
id: string;
name: string;
@@ -92,6 +97,7 @@ export function loadNgPinnedCases(): NgPinnedCase[] {
) as NgPinnedCase[];
}
+
export function loadLargeRealistic(): string {
return readFileSync(fixturePath('perf', 'large-realistic.md'), 'utf8');
}
diff --git a/packages/core/src/markdown/fixtures/perf/generate.ts b/packages/core/src/markdown/fixtures/perf/generate.ts
index 8b1eb8519..daa3ef82b 100644
--- a/packages/core/src/markdown/fixtures/perf/generate.ts
+++ b/packages/core/src/markdown/fixtures/perf/generate.ts
@@ -1,3 +1,4 @@
+
import { writeFileSync } from 'node:fs';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
@@ -10,6 +11,7 @@ const BASELINE_ONLY_COUNTS = [500, 2500] as const;
const SEED = 0xf1de1117;
+
function mulberry32(seed: number): () => number {
let a = seed >>> 0;
return () => {
@@ -36,6 +38,7 @@ function pickWeighted<T>(rand: () => number, items: readonly [T, number][]): T {
return items[items.length - 1][0];
}
+
const WORDS = [
'lorem',
'ipsum',
@@ -153,6 +156,7 @@ function mdxBlock(rand: () => number): string {
return `<${name}>\n\n${sentence(rand)}\n\n</${name}>`;
}
+
type BlockKind = 'paragraph' | 'heading' | 'list' | 'code' | 'table' | 'mdx';
const MIX: readonly [BlockKind, number][] = [
@@ -191,6 +195,7 @@ function generateDocument(blockCount: number, seed: number): string {
return `${blocks.join('\n\n')}\n`;
}
+
function main(): void {
for (const count of [...BLOCK_COUNTS, ...BASELINE_ONLY_COUNTS]) {
const doc = generateDocument(count, SEED);
diff --git a/packages/core/src/markdown/image-promoter.ts b/packages/core/src/markdown/image-promoter.ts
index 706fa9afb..994eb6917 100644
--- a/packages/core/src/markdown/image-promoter.ts
+++ b/packages/core/src/markdown/image-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Image, Paragraph, Root } from 'mdast';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
import { visit } from 'unist-util-visit';
diff --git a/packages/core/src/markdown/math-promoter.ts b/packages/core/src/markdown/math-promoter.ts
index a5b511f25..bd79424c7 100644
--- a/packages/core/src/markdown/math-promoter.ts
+++ b/packages/core/src/markdown/math-promoter.ts
@@ -1,3 +1,4 @@
+
import type { Code, Root } from 'mdast';
import type { Math as MdastMath } from 'mdast-util-math';
import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';
diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.ts
index bfd7e3109..fa3cfcd86 100644
--- a/packages/core/src/markdown/merged-walker.ts
+++ b/packages/core/src/markdown/merged-walker.ts
@@ -1,3 +1,4 @@
+
import type { Nodes, Parent, Root } from 'mdast';
import { SKIP, visit } from 'unist-util-visit';
import type { VFile } from 'vfile';
diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.ts
index 4d3250d3a..8be632ba4 100644
--- a/packages/core/src/markdown/safe-url.ts
+++ b/packages/core/src/markdown/safe-url.ts
@@ -1,3 +1,4 @@
+
export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;
const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');
diff --git a/packages/server/src/checkpoint-retention-tie.test.ts b/packages/server/src/checkpoint-retention-tie.test.ts
index 8a5d82998..0a43a2773 100644
--- a/packages/server/src/checkpoint-retention-tie.test.ts
+++ b/packages/server/src/checkpoint-retention-tie.test.ts
@@ -1,3 +1,4 @@
+
import { execFileSync } from 'node:child_process';
import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
diff --git a/packages/server/src/qa-degradation-matrix.test.ts b/packages/server/src/qa-degradation-matrix.test.ts
index 84e3e5297..00bb6efe7 100644
--- a/packages/server/src/qa-degradation-matrix.test.ts
+++ b/packages/server/src/qa-degradation-matrix.test.ts
@@ -1,3 +1,4 @@
+
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import type * as Y from 'yjs';
import { createBridgeDeriveLossReporter } from './bridge-loss-detector.ts';
diff --git a/packages/server/src/qa-gc-budget-isolation.test.ts b/packages/server/src/qa-gc-budget-isolation.test.ts
index a800ca9f3..b65c4693e 100644
--- a/packages/server/src/qa-gc-budget-isolation.test.ts
+++ b/packages/server/src/qa-gc-budget-isolation.test.ts
@@ -1,3 +1,4 @@
+
import { mkdirSync, mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
diff --git a/packages/server/src/qa-watcher-intake-lens.test.ts b/packages/server/src/qa-watcher-intake-lens.test.ts
index 2337e6c3c..4669d1b98 100644
--- a/packages/server/src/qa-watcher-intake-lens.test.ts
+++ b/packages/server/src/qa-watcher-intake-lens.test.ts
@@ -1,3 +1,4 @@
+
import { Hocuspocus } from '@hocuspocus/server';
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import * as Y from 'yjs';