Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
PRD-9735 Show a quiet notice when both versions were kept (#7116)
mike-inkeepb4c112b4bab0
diff --git a/.changeset/doc-change-notice.md b/.changeset/doc-change-notice.mdnew file mode 100644index 000000000..3cdb0723f--- /dev/null+++ b/.changeset/doc-change-notice.md@@ -0,0 +1,5 @@+---+'@inkeep/open-knowledge': patch+---++When OpenKnowledge keeps both versions of an edit, or saves an outside version to the timeline because it could not merge it, the document now shows a quiet notice saying so. Timeline entries for those cases now say which version they hold.diff --git a/docs/content/features/git/sync.mdx b/docs/content/features/git/sync.mdxindex 0c5a50959..82893fea7 100644--- a/docs/content/features/git/sync.mdx+++ b/docs/content/features/git/sync.mdx@@ -75,7 +75,7 @@ You can't edit a page with conflicts until they're resolved; the same applies to### Conflicts that don't come from Git-A conflict doesn't need a remote, though most changes on disk never raise one. When a file changes on disk while OpenKnowledge has it open, OpenKnowledge merges the two versions itself. Where both sides changed the same paragraph, both versions are kept, the OpenKnowledge version first and the outside version directly under it, and both earlier versions are saved to the [timeline](/docs/features/timeline-and-recovery). Where one side deleted a paragraph the other changed, the changed version stays. Where the two can't be merged safely, the OpenKnowledge version stays and the outside version is saved to the timeline. It raises a conflict when the file on disk holds Git conflict markers, when it can't save the outside version to the timeline, or when an agent write has no acknowledged version to merge against.+A conflict doesn't need a remote, though most changes on disk never raise one. When a file changes on disk while OpenKnowledge has it open, OpenKnowledge merges the two versions itself. Where both sides changed the same paragraph, both versions are kept, the OpenKnowledge version first and the outside version directly under it, and both earlier versions are saved to the [timeline](/docs/features/timeline-and-recovery). Where one side deleted a paragraph the other changed, the changed version stays. Where the two can't be merged safely, the OpenKnowledge version stays and the outside version is saved to the timeline. In each of these cases a notice on the document says what happened (see [Timeline and recovery](/docs/features/timeline-and-recovery) for how long it stays). It raises a conflict when the file on disk holds Git conflict markers, when it can't save the outside version to the timeline, or when an agent write has no acknowledged version to merge against.Another app can also save an exact older copy over an edit OpenKnowledge already acknowledged. In the diff view, **Current** is the protected OpenKnowledge version and **Incoming** is the rejected external save. Choose which to keep. An intentional exact revert can trigger the same confirmation. Both versions stay recoverable after a restart, and keeping current protects against repeated saves from the stale editor. That protection expires after 30 minutes, so update or close the other app rather than relying on that protection.diff --git a/docs/content/features/timeline-and-recovery.mdx b/docs/content/features/timeline-and-recovery.mdxindex 49feb73e2..fccecf352 100644--- a/docs/content/features/timeline-and-recovery.mdx+++ b/docs/content/features/timeline-and-recovery.mdx@@ -17,12 +17,16 @@ Timeline entries include:- **Agent and human edits** with contributor attribution and change summaries- **Upstream sync** entries from Git- **File system** changes made outside of OpenKnowledge-- **Recovered content** entries OpenKnowledge saves itself. They hold a version it could not merge into the document, such as the pre-change version when an external file change arrives with no acknowledged base. When an outside edit and yours change the same paragraph, two **Recovered content** rows appear, one per side: your version and the outside version as they were before both were kept. When an outside edit cannot be merged safely, one **Recovered content** row holds the outside version. Like every entry, they are listed newest first.+- **Recovered content** entries OpenKnowledge saves itself. They hold a version it could not merge into the document, such as the pre-change version when an external file change arrives with no acknowledged base.+- **Before an outside change was merged** entries, two per collision, when an outside edit and yours change the same paragraph: one holds your version (**Version in OpenKnowledge**), the other the outside version (**Outside version**), as they were before both were kept.+- **Not merged** entries when an outside edit cannot be merged safely. The entry holds the version that was set aside, labelled **Outside version** or **Version in OpenKnowledge**.Project-wide checkpoints saved by agents via the [`checkpoint` MCP tool](/docs/reference/mcp#tools) do not appear on the timeline; agents find and restore them with the `history` and `restore_version` tools.OpenKnowledge also saves recovery entries itself. When it detects an external file change on its own and has no acknowledged base to merge the change against, the disk version replaces the document and the pre-change version is preserved as a **Recovered content** entry, which you can restore like any other timeline entry. When an outside edit and the document's open version change the same paragraph, both versions stay in the document, the open version first and the outside version directly under it, nothing is asked, and both earlier versions are saved as entries. When one side deleted a paragraph the other changed, the changed version stays in the document, and both earlier versions are saved as entries. When the two cannot be merged safely, for example a very large file or a merge OpenKnowledge cannot verify, the open version stays and the outside version is saved as an entry. An agent write that meets an outside edit follows the same rules and lands. OpenKnowledge raises a conflict, and changes nothing until it is resolved, when the file on disk holds Git conflict markers, when it cannot save the outside version to the timeline, when an agent write has no acknowledged version to merge against, or when another app restores an exact older copy over an acknowledged edit (see [Conflicts that don't come from Git](/docs/features/git/sync#conflicts-that-dont-come-from-git)).+When both versions were kept, or a version was saved to the timeline instead of merged, a notice at the top of that document says what happened. It stays until you dismiss it, unless the document is renamed or deleted, the version it names leaves the timeline, or more than 200 newer notices push it out. Each branch keeps its own notices. Where the window has a timeline and entries were saved, **Open timeline** shows them. The notice never asks you to choose a version: restoring an entry is how you go back.+The timeline is not the editor's undo history. Each timeline entry is a snapshot of the whole document, while undo steps back through your own recent edits in the pane where you are working. Agent edits, human edits, and file-system changes are batched into an entry once activity settles. Upstream syncs get their own entry when the sync lands. For when source-mode undo starts fresh, see [Editor → Undo in source mode](/docs/features/editor#undo-in-source-mode).The timeline is per branch: it shows the branch's own edits, plus history from before the branch diverged from `main`. History is stored in a shadow git repo inside your project, so entries and attribution survive app restarts and agent sessions — see [Attribution and collaboration](/docs/reference/core-concepts#attribution-and-collaboration).diff --git a/docs/content/reference/what-open-knowledge-writes.mdx b/docs/content/reference/what-open-knowledge-writes.mdxindex 08be9381c..4588142a9 100644--- a/docs/content/reference/what-open-knowledge-writes.mdx+++ b/docs/content/reference/what-open-knowledge-writes.mdx@@ -153,6 +153,7 @@ The app runs a collaboration server for the open project. It writes runtime stat| `.ok/local/sync-state.json` | GitHub-sync engine state | In-project, gitignored || `.ok/local/conflicts.json` | Every conflict the app is holding a document for, including conflicts that involve no remote. A row for OpenKnowledge's own merge of the editor against disk embeds up to three full copies of the document body, so **keep this file while any conflict is open**. Deleting it loses those copies. If the app cannot read the file, it renames it to `conflicts.json.corrupt-<timestamp>` and leaves it in place | In-project, gitignored || `.ok/local/stale-external-writes.json` | Recovery snapshot for a rejected stale external save. It can hold the acknowledged, rejected, and retained document text. Protection expires after 30 minutes, but an unresolved snapshot stays until you resolve the conflict | In-project, gitignored |+| `.ok/local/doc-notices.json` | The notice a document shows after both versions of an edit were kept, or a version was saved to the timeline instead of merged: document names, times, and timeline entry ids, never document text. A notice is removed when you dismiss it, when its document is renamed or deleted, when the version it names leaves the timeline, or when more than 200 newer notices push it out, and each branch keeps its own. If the app cannot read the file, it starts with no notices | In-project, gitignored || `.ok/local/state.json`, `.ok/local/last-spawn-error.log` | State-schema manifest and the last detached-spawn error log | In-project, gitignored || `.ok/local/acp-agents.json` | Read, not written: your own list of [custom in-app agents](../features/editor.mdx#add-your-own-in-app-agent), re-read every time the agent catalog is built | In-project, gitignored || `.ok/local/acp-launch-failures.log` | In-app agent launches that failed: when, which agent, why, and the last lines the agent printed before it exited, so a bug report shows the cause without a re-run. Starts over once it passes 256 KB | In-project, gitignored |@@ -295,6 +296,7 @@ On Windows, Claude Desktop and OpenCode configs live under `%APPDATA%\Claude\` a| `.ok/local/sync-state.json` | GitHub-sync engine state | In-project, gitignored || `.ok/local/conflicts.json` | Every conflict the app is holding a document for, including conflicts that involve no remote. A row for OpenKnowledge's own merge of the editor against disk embeds up to three full copies of the document body, so **keep this file while any conflict is open**. Deleting it loses those copies. If the app cannot read the file, it renames it to `conflicts.json.corrupt-<timestamp>` and leaves it in place | In-project, gitignored || `.ok/local/stale-external-writes.json` | Recovery snapshot for a rejected stale external save. It can hold the acknowledged, rejected, and retained document text. Protection expires after 30 minutes, but an unresolved snapshot stays until you resolve the conflict | In-project, gitignored |+| `.ok/local/doc-notices.json` | The notice a document shows after both versions of an edit were kept, or a version was saved to the timeline instead of merged: document names, times, and timeline entry ids, never document text. A notice is removed when you dismiss it, when its document is renamed or deleted, when the version it names leaves the timeline, or when more than 200 newer notices push it out, and each branch keeps its own. If the app cannot read the file, it starts with no notices | In-project, gitignored || `.ok/local/state.json`, `.ok/local/last-spawn-error.log` | State-schema manifest and the last detached-spawn error log | In-project, gitignored || `.ok/local/acp-agents.json` | Read, not written: your own list of [custom in-app agents](../features/editor.mdx#add-your-own-in-app-agent), re-read every time the agent catalog is built | In-project, gitignored || `.ok/local/acp-launch-failures.log` | In-app agent launches that failed: when, which agent, why, and the last lines the agent printed before it exited, so a bug report shows the cause without a re-run. Starts over once it passes 256 KB | In-project, gitignored |diff --git a/packages/app/BUNDLE-SIZE.md b/packages/app/BUNDLE-SIZE.mdindex 71b0869f3..741fb22b0 100644--- a/packages/app/BUNDLE-SIZE.md+++ b/packages/app/BUNDLE-SIZE.md@@ -115,3 +115,5 @@ Combined-chunks 8.92->8.93 MB for the responsive single-pane workspace: one seleCombined-chunks stays at 9.15 MB after merging `feat/layout-redesign` into `main`. The three raises above (8.9->8.93 MB) were set on that integration branch while `main` raised the same ceiling to 9.15 MB for Polish, so the enforced limit is `main`'s and the 8.91, 8.92 and 8.93 MB ceilings never applied there; their headroom figures describe the branch, not the merged tree. A clean local build of the merged tree measured 9,144,866 B combined, 5,134 B under the 9,150,000 B ceiling, with the main app bundle at 477.79 kB against its 487 kB limit and CSS at 8.36 kB against 59 kB. CI's size job passed on the first merged head. No reclamation lever beyond the lazy-load levers above.Combined-chunks 9.15->9.16 MB for `@visimer/core` and `@visimer/dom` 1.x, which split the Mermaid edge picker into separate arrow, stroke, color, animation and curve pickers. CI measured the bump at 9,150,517 B, 517 B over the 9,150,000 B ceiling. Direct local `vite build` runs of `packages/app` measured 9,146,208 B with `0.1.0` and 9,149,900 B with `1.1.2`, so the bump adds 3,692 B. CI measures about 600 B more than a local build, so `main` sat about 3.2 kB under the old ceiling before this change. The main app bundle measured 478.46 kB against its 487 kB limit, and CSS stayed at 8.36 kB against 59 kB. The 10 kB ratchet leaves about 9.5 kB of headroom over the CI measurement. None of that headroom is reserved: the HTML preview frame page, web shell CSP and desktop file protocol changes that land after this one pass under 9.16 MB with no further raise. No reclamation lever beyond the lazy-load levers above.++Combined-chunks 9.16->9.17 MB for the quiet notice after a both-kept merge or a version moved to history (PRD-9735). Measured 9,157,371 B on main and 9,165,865 B with the notice, 8,494 B more: about 6.6 kB is its 14 new strings in each of the 13 locale catalogs, about 1.7 kB the notice strip, its data hook and the timeline row labels in the main bundle (481.29 kB against its 487 kB limit), and 0.15 kB the notice schema in the `schemas/api` chunk, which the app already imports through that narrow entry. No reclamation lever: the strings are the feature, and each reader downloads one catalog.diff --git a/packages/app/package.json b/packages/app/package.jsonindex 84b8ccecc..4986b8061 100644--- a/packages/app/package.json+++ b/packages/app/package.json@@ -68,7 +68,7 @@{"name": "all JS chunks combined (gzipped)","path": "dist/assets/*.js",- "limit": "9.16 MB",+ "limit": "9.17 MB","gzip": true,"running": false},diff --git a/packages/app/src/App.tsx b/packages/app/src/App.tsxindex 2949942da..f570f6e51 100644--- a/packages/app/src/App.tsx+++ b/packages/app/src/App.tsx@@ -57,6 +57,7 @@ import { parseEditorTabId, tabIdForNavigationTarget } from '@/editor/editor-tabsimport { previewOpenDisposition } from '@/editor/preview-open-disposition';import { StaleTabReloadPrompt } from '@/editor/StaleTabReloadPrompt';import { ConflictsProvider } from '@/hooks/use-conflicts';+import { DocNoticesProvider } from '@/hooks/use-doc-notices';import { useFolderConfig } from '@/hooks/use-folder-config';import { useInstalledClis } from '@/hooks/use-installed-clis';import { useReconcileSkillTabs } from '@/hooks/use-reconcile-skill-tabs';@@ -582,11 +583,13 @@ export function App() {<DocumentProvider><ConfigProviderHost><ConflictsProvider>- <PreviewTabsSettingsBridge>- <SingleFileModeProvider>- <AppBody />- </SingleFileModeProvider>- </PreviewTabsSettingsBridge>+ <DocNoticesProvider>+ <PreviewTabsSettingsBridge>+ <SingleFileModeProvider>+ <AppBody />+ </SingleFileModeProvider>+ </PreviewTabsSettingsBridge>+ </DocNoticesProvider></ConflictsProvider></ConfigProviderHost></DocumentProvider>diff --git a/packages/app/src/components/DocChangeNotice.dom.test.tsx b/packages/app/src/components/DocChangeNotice.dom.test.tsxnew file mode 100644index 000000000..70e09858e--- /dev/null+++ b/packages/app/src/components/DocChangeNotice.dom.test.tsx@@ -0,0 +1,283 @@+import type { DocNoticeWire } from '@inkeep/open-knowledge-core/schemas/api';+import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';+import { subscribeToDocPanelTabRequests } from '@/components/doc-panel-events';+import { DocNoticesProvider } from '@/hooks/use-doc-notices';+import { emitDocumentsChanged } from '@/lib/documents-events';+import { SingleFileModeProvider } from '@/lib/single-file-mode';+import { DocChangeNotice } from './DocChangeNotice';++const AT = '2026-10-20T12:00:00.000Z';+const NO_BLOCKS = { duplicated: 0, restoredDeletedHere: 0, restoredDeletedOutside: 0 };++const WRITTEN = ['b'.repeat(40), 'c'.repeat(40)];++function bothKept(+ id: string,+ docName: string,+ kept = { ...NO_BLOCKS, duplicated: 1 },+ entries: string[] = WRITTEN,+) {+ return {+ id,+ docName,+ file: `${docName}.md`,+ kind: 'both-kept',+ kept,+ firstAt: AT,+ lastAt: AT,+ events: 1,+ entries,+ } satisfies DocNoticeWire;+}++function moved(id: string, docName: string, side: 'ours' | 'theirs') {+ return {+ id,+ docName,+ file: `${docName}.md`,+ kind: 'moved-to-history',+ side,+ reason: 'check-failed',+ firstAt: AT,+ lastAt: AT,+ events: 1,+ entries: ['a'.repeat(40)],+ } satisfies DocNoticeWire;+}++let serverNotices: DocNoticeWire[] = [];+let dismissBodies: unknown[] = [];+let originalFetch: typeof globalThis.fetch;++beforeEach(() => {+ originalFetch = globalThis.fetch;+ serverNotices = [];+ dismissBodies = [];+ globalThis.fetch = vi.fn((input: RequestInfo | URL, init?: RequestInit) => {+ const url = typeof input === 'string' ? input : input.toString();+ if (url === '/api/doc-notices/dismiss') {+ const body = JSON.parse(String(init?.body)) as { id: string };+ dismissBodies.push(body);+ serverNotices = serverNotices.filter((notice) => notice.id !== body.id);+ return Promise.resolve(Response.json({ dismissed: true }));+ }+ if (url === '/api/doc-notices') {+ return Promise.resolve(Response.json({ notices: serverNotices }));+ }+ return Promise.resolve(new Response(null, { status: 404 }));+ }) as never;+});++afterEach(() => {+ globalThis.fetch = originalFetch;+ cleanup();+});++function renderNotice(docName: string, timelineAvailable = true) {+ return render(+ <SingleFileModeProvider>+ <DocNoticesProvider>+ <div data-editor-region="" tabIndex={-1} data-testid="editor-region">+ <DocChangeNotice docName={docName} timelineAvailable={timelineAvailable} />+ </div>+ </DocNoticesProvider>+ </SingleFileModeProvider>,+ );+}++async function findNotice(): Promise<HTMLElement> {+ return screen.findByRole('region', { name: 'File change notice' });+}++describe('DocChangeNotice', () => {+ test('a both-kept merge shows a notice naming the file, with no choice between versions', async () => {+ serverNotices = [bothKept('n-both', 'notes')];+ renderNotice('notes');++ const notice = await findNotice();+ expect(notice.textContent).toContain('Both versions were kept in notes.md.');+ expect(notice.textContent).toContain('the outside version is directly under this one');+ expect(+ within(notice)+ .getAllByRole('button')+ .map((button) => button.textContent || button.getAttribute('aria-label')),+ ).toEqual(['Open timeline', 'Dismiss notice']);+ });++ test('each case says what happened in its own words', async () => {+ const cases: Array<{ notice: DocNoticeWire; says: string }> = [+ {+ notice: bothKept('n-restored', 'folder/plan', { ...NO_BLOCKS, restoredDeletedHere: 1 }),+ says: 'A deletion in plan.md was undone because the same text was changed on the other side. The earlier versions are in the timeline.',+ },+ {+ notice: moved('n-theirs', 'folder/plan', 'theirs'),+ says: 'An outside change to plan.md could not be merged, so this version stayed. The outside version is in the timeline.',+ },+ {+ notice: moved('n-ours', 'folder/plan', 'ours'),+ says: "Edits to plan.md kept from the last time this branch was open could not be merged, so the file's version stayed.",+ },+ ];+ for (const { notice, says } of cases) {+ serverNotices = [notice];+ renderNotice('folder/plan');+ expect((await findNotice()).textContent).toContain(says);+ cleanup();+ }+ });++ test('a document with no notice shows nothing but keeps an empty status region ready', async () => {+ serverNotices = [bothKept('n-other', 'other')];+ renderNotice('notes');++ await waitFor(() => expect(globalThis.fetch).toHaveBeenCalled());+ expect(screen.queryByRole('region', { name: 'File change notice' })).toBeNull();+ expect(screen.getByRole('status').textContent).toBe('');+ });++ test('Dismiss removes the notice and tells the server which notice it was', async () => {+ serverNotices = [bothKept('n-dismiss', 'notes')];+ renderNotice('notes');++ fireEvent.click(within(await findNotice()).getByRole('button', { name: 'Dismiss notice' }));++ expect(screen.queryByRole('region', { name: 'File change notice' })).toBeNull();+ await waitFor(() => expect(dismissBodies).toEqual([{ docName: 'notes', id: 'n-dismiss' }]));+ });++ test('Escape inside the notice dismisses it and puts focus back on the editor, not the page', async () => {+ serverNotices = [bothKept('n-escape', 'notes')];+ renderNotice('notes');+ const dismiss = within(await findNotice()).getByRole('button', { name: 'Dismiss notice' });+ dismiss.focus();++ fireEvent.keyDown(dismiss, { key: 'Escape' });++ expect(screen.queryByRole('region', { name: 'File change notice' })).toBeNull();+ await waitFor(() => expect(document.activeElement).toBe(screen.getByTestId('editor-region')));+ });++ test('Open timeline asks the document panel for its timeline tab', async () => {+ serverNotices = [moved('n-open', 'notes', 'theirs')];+ const requests: unknown[] = [];+ const unsubscribe = subscribeToDocPanelTabRequests((tab, request) =>+ requests.push({ tab, focus: request.focus }),+ );+ renderNotice('notes');++ fireEvent.click(within(await findNotice()).getByRole('button', { name: 'Open timeline' }));++ expect(requests).toEqual([{ tab: 'timeline', focus: 'panel' }]);+ expect(screen.getByRole('region', { name: 'File change notice' })).toBeTruthy();+ unsubscribe();+ });++ test('where there is no timeline to open, the notice offers only Dismiss and does not send the person there', async () => {+ const expectNoTimeline = async (says: string) => {+ const notice = await findNotice();+ expect(within(notice).queryByRole('button', { name: 'Open timeline' })).toBeNull();+ expect(notice.textContent).toContain(says);+ expect(notice.textContent).not.toContain('timeline');+ await waitFor(() => expect(screen.getByRole('status').textContent).toContain(says));+ };+ serverNotices = [moved('n-no-timeline', 'notes', 'theirs')];+ renderNotice('notes', false);+ await expectNoTimeline("The outside version was saved to the document's history.");+ cleanup();++ serverNotices = [+ moved('n-single-file', 'notes', 'ours'),+ bothKept('n-single-both', 'plan', NO_BLOCKS),+ ];+ const desktop = window.okDesktop;+ window.okDesktop = { config: { singleFile: true } } as never;+ try {+ renderNotice('notes');+ await expectNoTimeline("Those edits were saved to the document's history.");+ cleanup();+ renderNotice('plan');+ await expectNoTimeline("The earlier versions were saved to the document's history.");+ } finally {+ window.okDesktop = desktop;+ }+ });++ test('when no history entry was written, the notice claims none and offers no Open timeline', async () => {+ serverNotices = [+ bothKept('n-unsaved-restored', 'notes', { ...NO_BLOCKS, restoredDeletedOutside: 1 }, []),+ bothKept('n-unsaved-both', 'plan', undefined, []),+ ];+ renderNotice('notes');+ const restored = await findNotice();+ expect(restored.textContent).toContain(+ 'A deletion in notes.md was undone because the same text was changed on the other side.',+ );+ expect(restored.textContent).not.toContain('timeline');+ expect(+ within(restored)+ .getAllByRole('button')+ .map((b) => b.getAttribute('aria-label')),+ ).toEqual(['Dismiss notice']);+ cleanup();++ renderNotice('plan');+ const both = await findNotice();+ expect(both.textContent).toContain('Both versions were kept in plan.md.');+ expect(within(both).queryByRole('button', { name: 'Open timeline' })).toBeNull();+ });++ test('a notice for an .mdx document names the .mdx file', async () => {+ serverNotices = [{ ...bothKept('n-mdx', 'guides/intro'), file: 'guides/intro.mdx' }];+ renderNotice('guides/intro');++ expect((await findNotice()).textContent).toContain('Both versions were kept in intro.mdx.');+ });++ test('a notice is announced once; an update to it is not announced again, a new notice is', async () => {+ serverNotices = [bothKept('n-announce', 'notes')];+ renderNotice('notes');+ const status = screen.getByRole('status');+ await waitFor(() =>+ expect(status.textContent).toContain('Both versions were kept in notes.md.'),+ );++ serverNotices = [{ ...moved('n-announce', 'notes', 'theirs'), events: 2 }];+ act(() => emitDocumentsChanged(['sync-status']));+ await waitFor(() =>+ expect(screen.getByRole('region', { name: 'File change notice' }).textContent).toContain(+ 'could not be merged',+ ),+ );+ expect(status.textContent).toContain('Both versions were kept in notes.md.');++ serverNotices = [moved('n-announce-next', 'notes', 'theirs')];+ act(() => emitDocumentsChanged(['sync-status']));+ await waitFor(() => expect(status.textContent).toContain('could not be merged'));+ });++ test('coming back to a document whose notice was already announced does not announce it again', async () => {+ serverNotices = [bothKept('n-first', 'notes'), moved('n-second', 'plan', 'theirs')];+ const view = render(+ <DocNoticesProvider>+ <DocChangeNotice docName="notes" timelineAvailable />+ </DocNoticesProvider>,+ );+ const status = screen.getByRole('status');+ await waitFor(() =>+ expect(status.textContent).toContain('Both versions were kept in notes.md.'),+ );++ for (const docName of ['plan', 'notes']) {+ view.rerender(+ <DocNoticesProvider>+ <DocChangeNotice docName={docName} timelineAvailable />+ </DocNoticesProvider>,+ );+ await findNotice();+ }++ expect(status.textContent).toContain('An outside change to plan.md could not be merged');+ });+});diff --git a/packages/app/src/components/DocChangeNotice.tsx b/packages/app/src/components/DocChangeNotice.tsxnew file mode 100644index 000000000..0b126a2d2--- /dev/null+++ b/packages/app/src/components/DocChangeNotice.tsx@@ -0,0 +1,176 @@+import type { DocNoticeWire } from '@inkeep/open-knowledge-core/schemas/api';+import { Trans, useLingui } from '@lingui/react/macro';+import { History, X } from 'lucide-react';+import { type KeyboardEvent, useEffect, useRef, useState } from 'react';+import { requestDocPanelTab } from '@/components/doc-panel-events';+import { SkillModeBanner } from '@/components/SkillModeBanner';+import { Button } from '@/components/ui/button';+import { useDocNotice } from '@/hooks/use-doc-notices';+import { useSingleFileMode } from '@/lib/single-file-mode';++const announcedNoticeIds = new Set<string>();++const EDITOR_FOCUS_TARGETS = ['[contenteditable="true"]', '.cm-content'] as const;++function NoticeMessage({+ notice,+ canOpenTimeline,+}: {+ notice: DocNoticeWire;+ canOpenTimeline: boolean;+}) {+ const fileName = (+ <span translate="no" className="font-medium text-foreground">+ {notice.file.split('/').pop() ?? notice.file}+ </span>+ );+ if (notice.kind === 'both-kept') {+ if (notice.kept.duplicated > 0) {+ return (+ <Trans>+ Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place+ as here, so the outside version is directly under this one.+ </Trans>+ );+ }+ if (notice.entries.length === 0) {+ return (+ <Trans>+ A deletion in {fileName} was undone because the same text was changed on the other side.+ </Trans>+ );+ }+ return canOpenTimeline ? (+ <Trans>+ A deletion in {fileName} was undone because the same text was changed on the other side. The+ earlier versions are in the timeline.+ </Trans>+ ) : (+ <Trans>+ A deletion in {fileName} was undone because the same text was changed on the other side. The+ earlier versions were saved to the document's history.+ </Trans>+ );+ }+ if (notice.side === 'theirs') {+ return canOpenTimeline ? (+ <Trans>+ An outside change to {fileName} could not be merged, so this version stayed. The outside+ version is in the timeline.+ </Trans>+ ) : (+ <Trans>+ An outside change to {fileName} could not be merged, so this version stayed. The outside+ version was saved to the document's history.+ </Trans>+ );+ }+ return canOpenTimeline ? (+ <Trans>+ Edits to {fileName} kept from the last time this branch was open could not be merged, so the+ file's version stayed. Those edits are in the timeline.+ </Trans>+ ) : (+ <Trans>+ Edits to {fileName} kept from the last time this branch was open could not be merged, so the+ file's version stayed. Those edits were saved to the document's history.+ </Trans>+ );+}++function focusEditorWithin(scope: HTMLElement | null): void {+ if (scope === null) return;+ for (const selector of EDITOR_FOCUS_TARGETS) {+ for (const target of scope.querySelectorAll<HTMLElement>(selector)) {+ target.focus();+ if (document.activeElement === target) return;+ }+ }+ scope.closest<HTMLElement>('[data-editor-region]')?.focus();+}++export function DocChangeNotice({+ docName,+ timelineAvailable,+}: {+ docName: string;+ timelineAvailable: boolean;+}) {+ const { t } = useLingui();+ const { notice, dismiss } = useDocNotice(docName);+ const singleFile = useSingleFileMode();+ const sectionRef = useRef<HTMLElement>(null);+ const messageRef = useRef<HTMLSpanElement>(null);+ const [announcement, setAnnouncement] = useState('');+ const canOpenTimeline = timelineAvailable && !singleFile;++ const noticeId = notice?.id ?? null;+ useEffect(() => {+ if (noticeId === null || announcedNoticeIds.has(noticeId)) return;+ announcedNoticeIds.add(noticeId);+ setAnnouncement(messageRef.current?.textContent ?? '');+ }, [noticeId]);++ function handleDismiss() {+ if (notice === null) return;+ const hadFocus = sectionRef.current?.contains(document.activeElement) ?? false;+ const scope = sectionRef.current?.parentElement ?? null;+ dismiss(notice);+ if (hadFocus) requestAnimationFrame(() => focusEditorWithin(scope));+ }++ function handleKeyDown(event: KeyboardEvent<HTMLElement>) {+ if (event.key !== 'Escape' || event.nativeEvent.isComposing) return;+ event.stopPropagation();+ handleDismiss();+ }++ return (+ <>+ <span role="status" className="sr-only">+ {announcement}+ </span>+ {notice === null ? null : (+ <section+ ref={sectionRef}+ aria-label={t`File change notice`}+ data-testid="doc-change-notice"+ onKeyDown={handleKeyDown}+ className="shrink-0"+ >+ <SkillModeBanner+ icon={<History className="size-4" aria-hidden />}+ clampLines={false}+ actions={+ <>+ {canOpenTimeline && notice.entries.length > 0 ? (+ <Button+ variant="link"+ size="sm"+ className="h-auto px-1"+ onClick={() => requestDocPanelTab('timeline', { focus: 'panel' })}+ >+ {t`Open timeline`}+ </Button>+ ) : null}+ <Button+ variant="ghost"+ size="icon"+ className="size-6 text-muted-foreground"+ aria-label={t`Dismiss notice`}+ onClick={handleDismiss}+ >+ <X className="size-3.5" aria-hidden />+ </Button>+ </>+ }+ >+ <span ref={messageRef}>+ <NoticeMessage notice={notice} canOpenTimeline={canOpenTimeline} />+ </span>+ </SkillModeBanner>+ </section>+ )}+ </>+ );+}diff --git a/packages/app/src/components/EditorArea.tsx b/packages/app/src/components/EditorArea.tsxindex 143bb38fb..5453001c9 100644--- a/packages/app/src/components/EditorArea.tsx+++ b/packages/app/src/components/EditorArea.tsx@@ -31,6 +31,7 @@ import { createPortal } from 'react-dom';import { useGroupRef, usePanelRef } from 'react-resizable-panels';import { toast } from 'sonner';import { AssetPreview } from '@/components/AssetPreview';+import { DocChangeNotice } from '@/components/DocChangeNotice';import { DocPanel, type PanelTab } from '@/components/DocPanel';import { DocPanelToggle } from '@/components/DocPanelToggle';import {@@ -2551,6 +2552,7 @@ function EditorAreaInner({<SkillEditBanner name={externalSkillEdit.name} /></Suspense>) : null}+ <DocChangeNotice docName={activeDocName} timelineAvailable={!noteWindow} /><div className="relative min-h-0 flex-1">{}<div className="relative h-full">diff --git a/packages/app/src/components/SkillModeBanner.tsx b/packages/app/src/components/SkillModeBanner.tsxindex 4bf61bef7..bbd8ac69a 100644--- a/packages/app/src/components/SkillModeBanner.tsx+++ b/packages/app/src/components/SkillModeBanner.tsx@@ -4,17 +4,19 @@ export function SkillModeBanner({icon,children,actions,+ clampLines = true,}: {icon: ReactNode;children: ReactNode;actions?: ReactNode;+ clampLines?: boolean;}) {return (<div className="flex shrink-0 items-center justify-between gap-3 border-b border-border bg-muted/35 px-3 py-2"><div className="flex min-w-0 items-start gap-1.5 text-muted-foreground text-sm"><span className="mt-0.5 shrink-0">{icon}</span>{}- <p className="line-clamp-2">{children}</p>+ <p className={clampLines ? 'line-clamp-2' : 'min-w-0 break-words'}>{children}</p></div>{actions ? (<div className="flex shrink-0 flex-wrap items-center justify-end gap-2">{actions}</div>diff --git a/packages/app/src/components/TimelinePanel.dom.test.tsx b/packages/app/src/components/TimelinePanel.dom.test.tsxindex 6559d53cc..cfe0d4090 100644--- a/packages/app/src/components/TimelinePanel.dom.test.tsx+++ b/packages/app/src/components/TimelinePanel.dom.test.tsx@@ -145,6 +145,48 @@ const SURFACED_KINDS: ParsedCheckpoint[] = [metadata: { side: 'theirs', reason: 'check-failed' },},];+const MERGE_VERSION_ROWS: Array<{ checkpoint: ParsedCheckpoint; title: string; side: string }> = [+ {+ checkpoint: {+ kind: 'external-change-both-kept',+ docName: 'notes',+ size: 12,+ metadata: { side: 'ours', keptBlocks: 1 },+ },+ title: 'Before an outside change was merged',+ side: 'Version in OpenKnowledge',+ },+ {+ checkpoint: {+ kind: 'external-change-both-kept',+ docName: 'notes',+ size: 12,+ metadata: { side: 'theirs', keptBlocks: 1 },+ },+ title: 'Before an outside change was merged',+ side: 'Outside version',+ },+ {+ checkpoint: {+ kind: 'external-change-kept-live',+ docName: 'notes',+ size: 12,+ metadata: { side: 'theirs', reason: 'check-failed' },+ },+ title: 'Not merged',+ side: 'Outside version',+ },+ {+ checkpoint: {+ kind: 'external-change-kept-live',+ docName: 'notes',+ size: 12,+ metadata: { side: 'ours', reason: 'too-large' },+ },+ title: 'Not merged',+ side: 'Version in OpenKnowledge',+ },+];const AUTO_CONSOLIDATION: ParsedCheckpoint = {kind: 'auto-consolidation',docName: 'notes',@@ -263,8 +305,9 @@ describe('TimelineContent — recovered-content checkpoints', () => {expect(covered).toEqual(registrySurfaced);});- test('every surfaced rescue kind renders under the same Recovered content label', async () => {- for (const checkpoint of SURFACED_KINDS) {+ test('every surfaced rescue kind other than a merge version renders under the same Recovered content label', async () => {+ const mergeVersionKinds = new Set(MERGE_VERSION_ROWS.map((row) => row.checkpoint.kind));+ for (const checkpoint of SURFACED_KINDS.filter((c) => !mergeVersionKinds.has(c.kind))) {mockHistory([recoveredCheckpointEntry('c'.repeat(40), checkpoint)]);renderTimeline();await waitFor(() => {@@ -275,6 +318,20 @@ describe('TimelineContent — recovered-content checkpoints', () => {}});+ test('a merge version row says what happened and which version it holds, and keeps its restore control', async () => {+ for (const { checkpoint, title, side } of MERGE_VERSION_ROWS) {+ mockHistory([recoveredCheckpointEntry('c'.repeat(40), checkpoint)]);+ renderTimeline();+ await waitFor(() => {+ expect(screen.getByText(title)).toBeTruthy();+ });+ expect(screen.getByText(side)).toBeTruthy();+ expect(screen.queryByText('Recovered content')).toBeNull();+ expect(screen.getAllByTestId('timeline-entry-restore')).toHaveLength(1);+ cleanup();+ }+ });+test('a registry-hidden kind (auto-consolidation) never renders', async () => {mockHistory([wipEntry('a'.repeat(40), 'Alice'),diff --git a/packages/app/src/components/TimelinePanel.tsx b/packages/app/src/components/TimelinePanel.tsxindex bf3a2532c..9434ef791 100644--- a/packages/app/src/components/TimelinePanel.tsx+++ b/packages/app/src/components/TimelinePanel.tsx@@ -147,10 +147,20 @@ type EntryDescriptor =| { kind: 'reconcile' }| { kind: 'upstream' }| { kind: 'recovered' }+ | { kind: 'merge-version'; side: 'ours' | 'theirs' }| { kind: 'edit' };function classifyEntry(entry: TimelineEntry): EntryDescriptor {- if (entry.type === 'checkpoint') return { kind: 'recovered' };+ if (entry.type === 'checkpoint') {+ const checkpoint = entry.checkpoint;+ if (+ checkpoint?.kind === 'external-change-both-kept' ||+ checkpoint?.kind === 'external-change-kept-live'+ ) {+ return { kind: 'merge-version', side: checkpoint.metadata.side };+ }+ return { kind: 'recovered' };+ }if (entry.type === 'upstream') return { kind: 'upstream' };const msg = entry.message;const rollback = /^rollback: .+ to ([0-9a-f]{7,40})$/.exec(msg);@@ -167,7 +177,13 @@ function docLeaf(path: string): string {}function displayAuthor(entry: TimelineEntry): string {- if (entry.type === 'checkpoint') return t`Recovered content`;+ if (entry.type === 'checkpoint') {+ if (entry.checkpoint?.kind === 'external-change-both-kept') {+ return t`Before an outside change was merged`;+ }+ if (entry.checkpoint?.kind === 'external-change-kept-live') return t`Not merged`;+ return t`Recovered content`;+ }if (entry.type === 'upstream') return t`Upstream sync`;if (entry.contributors.length === 1) return entry.contributors[0].name;if (entry.contributors.length > 1) return entry.contributors.map((c) => c.name).join(', ');@@ -348,6 +364,14 @@ function EntryDetail({if (descriptor.kind === 'recovered') return null;+ if (descriptor.kind === 'merge-version') {+ return (+ <p className="truncate text-xs text-muted-foreground">+ {descriptor.side === 'ours' ? t`Version in OpenKnowledge` : t`Outside version`}+ </p>+ );+ }+if (allDocs.length > 0) {return (<p className="truncate text-xs text-muted-foreground" title={allDocs.join(', ')}>diff --git a/packages/app/src/hooks/use-doc-notices.dom.test.tsx b/packages/app/src/hooks/use-doc-notices.dom.test.tsxnew file mode 100644index 000000000..b84b2de2a--- /dev/null+++ b/packages/app/src/hooks/use-doc-notices.dom.test.tsx@@ -0,0 +1,109 @@+import type { DocNoticeWire } from '@inkeep/open-knowledge-core/schemas/api';+import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';+import { emitBranchChanged, emitDocumentsChanged } from '@/lib/documents-events';+import { DocNoticesProvider, useDocNotice } from './use-doc-notices';++function notice(id: string, docName: string): DocNoticeWire {+ return {+ id,+ docName,+ file: `${docName}.md`,+ kind: 'both-kept',+ kept: { duplicated: 1, restoredDeletedHere: 0, restoredDeletedOutside: 0 },+ firstAt: '2026-10-20T12:00:00.000Z',+ lastAt: '2026-10-20T12:00:00.000Z',+ events: 1,+ entries: [],+ };+}++let serverNotices: DocNoticeWire[] = [];+let dismissStatus = 200;+let listCalls = 0;+let originalFetch: typeof globalThis.fetch;++beforeEach(() => {+ originalFetch = globalThis.fetch;+ serverNotices = [];+ dismissStatus = 200;+ listCalls = 0;+ globalThis.fetch = vi.fn((input: RequestInfo | URL) => {+ const url = typeof input === 'string' ? input : input.toString();+ if (url === '/api/doc-notices/dismiss') {+ return Promise.resolve(Response.json({ dismissed: true }, { status: dismissStatus }));+ }+ listCalls++;+ return Promise.resolve(Response.json({ notices: serverNotices }));+ }) as never;+});++afterEach(() => {+ globalThis.fetch = originalFetch;+ cleanup();+});++function Probe({ docName }: { docName: string }) {+ const { notice: current, dismiss } = useDocNotice(docName);+ return (+ <>+ <span data-testid={`notice-${docName}`}>{current?.id ?? 'none'}</span>+ <button type="button" onClick={() => current && dismiss(current)}>+ dismiss {docName}+ </button>+ </>+ );+}++function renderProbes() {+ return render(+ <DocNoticesProvider>+ <Probe docName="notes" />+ <Probe docName="plan" />+ </DocNoticesProvider>,+ );+}++describe('DocNoticesProvider', () => {+ test('reads the notices on mount and gives each document its own', async () => {+ serverNotices = [notice('n-notes', 'notes'), notice('n-plan', 'plan')];+ renderProbes();++ await waitFor(() => expect(screen.getByTestId('notice-notes').textContent).toBe('n-notes'));+ expect(screen.getByTestId('notice-plan').textContent).toBe('n-plan');+ });++ test('reads them again on a sync-status signal and on a branch change, not on other signals', async () => {+ renderProbes();+ await waitFor(() => expect(listCalls).toBe(1));++ serverNotices = [notice('n-notes', 'notes')];+ act(() => emitDocumentsChanged(['files']));+ expect(listCalls).toBe(1);++ act(() => emitDocumentsChanged(['sync-status']));+ await waitFor(() => expect(screen.getByTestId('notice-notes').textContent).toBe('n-notes'));++ serverNotices = [];+ act(() => emitBranchChanged('feature'));+ await waitFor(() => expect(screen.getByTestId('notice-notes').textContent).toBe('none'));+ });++ test('a dismissal hides only that document’s notice, and one the server refuses comes back', async () => {+ serverNotices = [notice('n-notes', 'notes'), notice('n-plan', 'plan')];+ renderProbes();+ await waitFor(() => expect(screen.getByTestId('notice-notes').textContent).toBe('n-notes'));++ dismissStatus = 500;+ fireEvent.click(screen.getByText('dismiss notes'));++ expect(screen.getByTestId('notice-notes').textContent).toBe('none');+ expect(screen.getByTestId('notice-plan').textContent).toBe('n-plan');+ await waitFor(() => expect(screen.getByTestId('notice-notes').textContent).toBe('n-notes'));+ });++ test('outside the provider a document simply has no notice', () => {+ render(<Probe docName="notes" />);+ expect(screen.getByTestId('notice-notes').textContent).toBe('none');+ });+});diff --git a/packages/app/src/hooks/use-doc-notices.tsx b/packages/app/src/hooks/use-doc-notices.tsxnew file mode 100644index 000000000..00fd77218--- /dev/null+++ b/packages/app/src/hooks/use-doc-notices.tsx@@ -0,0 +1,119 @@+import {+ DismissDocNoticeSuccessSchema,+ DocNoticesSuccessSchema,+ type DocNoticeWire,+} from '@inkeep/open-knowledge-core/schemas/api';+import { createContext, type ReactNode, use, useEffect, useRef, useState } from 'react';+import { subscribeToBranchChanged, subscribeToDocumentsChanged } from '@/lib/documents-events';++const DOC_NOTICES_REQUEST_TIMEOUT_MS = 5_000;++export async function fetchDocNotices(): Promise<DocNoticeWire[] | null> {+ try {+ const res = await fetch('/api/doc-notices', {+ signal: AbortSignal.timeout(DOC_NOTICES_REQUEST_TIMEOUT_MS),+ });+ const parsed = DocNoticesSuccessSchema.safeParse(await res.json().catch(() => null));+ if (!res.ok || !parsed.success) {+ console.warn(+ JSON.stringify({+ event: 'doc-notices-fetch-failed',+ status: res.status,+ detail: res.ok ? 'schema-drift' : undefined,+ }),+ );+ return null;+ }+ return parsed.data.notices;+ } catch (err) {+ console.warn(+ JSON.stringify({+ event: 'doc-notices-fetch-failed',+ status: null,+ detail: err instanceof Error ? err.message : String(err),+ }),+ );+ return null;+ }+}++export async function dismissDocNotice(docName: string, id: string): Promise<boolean> {+ try {+ const res = await fetch('/api/doc-notices/dismiss', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ docName, id }),+ signal: AbortSignal.timeout(DOC_NOTICES_REQUEST_TIMEOUT_MS),+ });+ const parsed = DismissDocNoticeSuccessSchema.safeParse(await res.json().catch(() => null));+ return res.ok && parsed.success;+ } catch (err) {+ console.warn(+ JSON.stringify({+ event: 'doc-notice-dismiss-failed',+ detail: err instanceof Error ? err.message : String(err),+ }),+ );+ return false;+ }+}++interface DocNoticesContextValue {+ byDocName: ReadonlyMap<string, DocNoticeWire>;+ dismiss: (notice: DocNoticeWire) => void;+}++const DocNoticesContext = createContext<DocNoticesContextValue | null>(null);++function indexByDocName(notices: readonly DocNoticeWire[]): ReadonlyMap<string, DocNoticeWire> {+ return new Map(notices.map((notice) => [notice.docName, notice]));+}++export function DocNoticesProvider({ children }: { children: ReactNode }) {+ const [byDocName, setByDocName] = useState<ReadonlyMap<string, DocNoticeWire>>(() => new Map());+ const latestRequestId = useRef(0);++ function refresh() {+ const requestId = ++latestRequestId.current;+ void fetchDocNotices().then((notices) => {+ if (notices === null || requestId !== latestRequestId.current) return;+ setByDocName(indexByDocName(notices));+ });+ }++ function dismiss(notice: DocNoticeWire) {+ latestRequestId.current++;+ setByDocName((previous) => {+ const next = new Map(previous);+ if (next.get(notice.docName)?.id === notice.id) next.delete(notice.docName);+ return next;+ });+ void dismissDocNotice(notice.docName, notice.id).then((dismissed) => {+ if (!dismissed) refresh();+ });+ }++ // biome-ignore lint/correctness/useExhaustiveDependencies: refresh is intentionally stable (defined in hook scope)+ useEffect(() => {+ refresh();+ const unsubscribeChannels = subscribeToDocumentsChanged((channels) => {+ if (channels.includes('sync-status')) refresh();+ });+ const unsubscribeBranch = subscribeToBranchChanged(() => refresh());+ return () => {+ unsubscribeChannels();+ unsubscribeBranch();+ };+ }, []);++ return <DocNoticesContext value={{ byDocName, dismiss }}>{children}</DocNoticesContext>;+}++export function useDocNotice(docName: string | null): {+ notice: DocNoticeWire | null;+ dismiss: (notice: DocNoticeWire) => void;+} {+ const value = use(DocNoticesContext);+ if (value === null || docName === null) return { notice: null, dismiss: () => {} };+ return { notice: value.byDocName.get(docName) ?? null, dismiss: value.dismiss };+}diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.poindex e1270da03..df42a8199 100644--- a/packages/app/src/locales/ar/messages.po+++ b/packages/app/src/locales/ar/messages.po@@ -952,6 +952,15 @@ msgstr "قد تبقى نسخة في {scopeLabel} من: {names}. لا تحذف أmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "تم الاحتفاظ بنسخة من “{name}” في {scopeLabel} عن قصد. لا تحذفها قبل مقارنتها بالنسخة الأصلية: فقد تحتوي على النسخة الوحيدة من الملفات التي حذفها النقل الفاشل بالفعل."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "تم التراجع عن حذف في {fileName} لأن الجهة الأخرى غيّرت النص نفسه."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "تم التراجع عن حذف في {fileName} لأن الجهة الأخرى غيّرت النص نفسه. النسخ السابقة موجودة في الخط الزمني."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "تم التراجع عن حذف في {fileName} لأن الجهة الأخرى غيّرت النص نفسه. حُفظت النسخ السابقة في سجل المستند."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "توجد مهارة مختلفة بالاسم نفسه في {0} — ذلك المجلد ليس هذه المهارة. أعد تسمية إحداهما أو احذفها للحل."@@ -1451,6 +1460,12 @@ msgstr "يجري بالفعل بدء محادثة مع هذا الوكيل —msgid "Always included"msgstr "مُدرج دائمًا"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "تعذّر دمج تغيير خارجي في {fileName}، لذا بقيت هذه النسخة. النسخة الخارجية موجودة في الخط الزمني."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "تعذّر دمج تغيير خارجي في {fileName}، لذا بقيت هذه النسخة. حُفظت النسخة الخارجية في سجل المستند."+msgid "An unexpected error occurred."msgstr "حدث خطأ غير متوقع."@@ -1786,6 +1801,9 @@ msgstr "يصبح محتوى المستند عندما ينشئ أحدهم مستmsgid "Before"msgstr "قبل"+msgid "Before an outside change was merged"+msgstr "قبل دمج تغيير خارجي"+msgid "Before syncing, set your identity for git commits:"msgstr "قبل المزامنة، اضبط هويتك لإيداعات git:"@@ -1850,6 +1868,9 @@ msgstr "سيقرأ الوكيلان في النهاية كل ما في {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "النسختان متطابقتان. اختيار قبول الحالي يُبقي حماية OpenKnowledge مفعّلة، لذا سيُرفض مجددًا أي حفظ آخر للنسخة الأقدم. اختيار قبول الوارد يوقف تلك الحماية."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "تم الاحتفاظ بالنسختين في {fileName}. تغيّر الملف خارج OpenKnowledge في المكان نفسه الذي تغيّر فيه هنا، لذا تظهر النسخة الخارجية أسفل هذه النسخة مباشرة."+msgid "Branch"msgstr "فرع"@@ -3986,6 +4007,12 @@ msgstr "تُطبّق التعديلات مباشرة. تحدد السمة الوmsgid "Edits at the source land here — no copy-paste drift."msgstr "تصل التعديلات من المصدر إلى هنا — بلا انحراف نسخ ولصق."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "تعذّر دمج التعديلات على {fileName} المحفوظة منذ آخر مرة كان فيها هذا الفرع مفتوحًا، لذا بقيت نسخة الملف. هذه التعديلات موجودة في الخط الزمني."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "تعذّر دمج التعديلات على {fileName} المحفوظة منذ آخر مرة كان فيها هذا الفرع مفتوحًا، لذا بقيت نسخة الملف. حُفظت هذه التعديلات في سجل المستند."+msgid "Element fields"msgstr "حقول العنصر"@@ -4594,6 +4621,9 @@ msgstr "الملف {identity}. انتقل إلى المرجع."msgid "File already exists"msgstr "الملف موجود بالفعل"+msgid "File change notice"+msgstr "إشعار تغيير الملف"+msgid "File drop zone"msgstr "منطقة إفلات الملفات"@@ -6969,6 +6999,9 @@ msgstr "غير مثبَّت · ملفات OpenKnowledge موجودة"msgid "Not installed in this project yet."msgstr "لم تُثبَّت في هذا المشروع بعد."+msgid "Not merged"+msgstr "لم يُدمج"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "ليس الآن"@@ -7347,6 +7380,9 @@ msgstr "افتح هذا الرابط في تبويب جديد واطوِ الرmsgid "Open this settings dialog."msgstr "افتح حوار الإعدادات هذا."+msgid "Open timeline"+msgstr "فتح الخط الزمني"+msgid "Open visual-editor find with replace controls expanded."msgstr "افتح بحث المحرر المرئي مع توسيع عناصر الاستبدال."@@ -7654,6 +7690,9 @@ msgstr "خارج أي كتلة"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "خارج مجلد أشجار العمل الخاص بـ OpenKnowledge في هذا المستودع"+msgid "Outside version"+msgstr "النسخة الخارجية"+msgid "Outside what Open Knowledge commits."msgstr "خارج نطاق ما يودعه Open Knowledge."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "الإصدار"+msgid "Version in OpenKnowledge"+msgstr "النسخة في OpenKnowledge"+msgid "via {viaTags}"msgstr "عبر {viaTags}"diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.poindex 81b79e1f6..053a4b19a 100644--- a/packages/app/src/locales/bn/messages.po+++ b/packages/app/src/locales/bn/messages.po@@ -948,6 +948,15 @@ msgstr "{scopeLabel}-এ এগুলোর একটি কপি থেকেmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "{scopeLabel}-এ “{name}”-এর একটি কপি ইচ্ছে করেই রাখা হয়েছে। মুছে ফেলার আগে সেটি মূলটির সঙ্গে মিলিয়ে দেখুন: ব্যর্থ সরানোর সময় যে ফাইলগুলো ইতিমধ্যে মুছে গেছে, তার একমাত্র কপি এতে থাকতে পারে।"+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "{fileName}-এ একটি মুছে ফেলা অংশ ফিরিয়ে আনা হয়েছে, কারণ অন্য দিকে একই লেখা বদলানো হয়েছিল।"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "{fileName}-এ একটি মুছে ফেলা অংশ ফিরিয়ে আনা হয়েছে, কারণ অন্য দিকে একই লেখা বদলানো হয়েছিল। আগের সংস্করণগুলো কালানুক্রমে আছে।"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "{fileName}-এ একটি মুছে ফেলা অংশ ফিরিয়ে আনা হয়েছে, কারণ অন্য দিকে একই লেখা বদলানো হয়েছিল। আগের সংস্করণগুলো নথির ইতিহাসে সংরক্ষিত হয়েছে।"+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "এর মতো নামের একটি ভিন্ন স্কিল {0}-এ আছে — ওই ফোল্ডারটি এই স্কিল নয়। মীমাংসার জন্য দুটির একটির নাম বদলান বা মুছে দিন।"@@ -1447,6 +1456,12 @@ msgstr "এই এজেন্টের সাথে ইতিমধ্যেইmsgid "Always included"msgstr "সবসময় অন্তর্ভুক্ত"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName}-এ বাইরের একটি পরিবর্তন মার্জ করা যায়নি, তাই এই সংস্করণটি রয়ে গেছে। বাইরের সংস্করণটি কালানুক্রমে আছে।"++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName}-এ বাইরের একটি পরিবর্তন মার্জ করা যায়নি, তাই এই সংস্করণটি রয়ে গেছে। বাইরের সংস্করণটি নথির ইতিহাসে সংরক্ষিত হয়েছে।"+msgid "An unexpected error occurred."msgstr "একটি অপ্রত্যাশিত ত্রুটি ঘটেছে।"@@ -1782,6 +1797,9 @@ msgstr "কেউ এই টেমপ্লেট থেকে নথি তৈmsgid "Before"msgstr "আগে"+msgid "Before an outside change was merged"+msgstr "বাইরের পরিবর্তন মার্জ হওয়ার আগে"+msgid "Before syncing, set your identity for git commits:"msgstr "সিঙ্ক করার আগে git কমিটের জন্য আপনার পরিচয় নির্ধারণ করুন:"@@ -1846,6 +1864,9 @@ msgstr "শেষমেশ দুই এজেন্টই {keep}-এর সবmsgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "দুটি সংস্করণ অভিন্ন। বর্তমানটি গ্রহণ করুন বেছে নিলে OpenKnowledge-এর সুরক্ষা চালু থাকে, ফলে পুরোনো সংস্করণের আরেকটি সেভ আবার প্রত্যাখ্যান করা হবে। আগতটি গ্রহণ করুন বেছে নিলে সেই সুরক্ষা বন্ধ হয়ে যায়।"+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName}-এ দুটি সংস্করণই রাখা হয়েছে। ফাইলটি OpenKnowledge-এর বাইরে ঠিক সেই জায়গায় বদলেছে যেখানে এখানেও বদল হয়েছিল, তাই বাইরের সংস্করণটি ঠিক এর নিচে আছে।"+msgid "Branch"msgstr "ব্রাঞ্চ"@@ -3982,6 +4003,12 @@ msgstr "সম্পাদনাগুলি সঙ্গে সঙ্গে পmsgid "Edits at the source land here — no copy-paste drift."msgstr "উৎসে করা সম্পাদনা এখানে এসে পড়ে — কপি-পেস্টের কোনো বিচ্যুতি নেই।"+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "শেষবার এই ব্রাঞ্চ খোলা থাকার সময় {fileName}-এ রাখা সম্পাদনাগুলো মার্জ করা যায়নি, তাই ফাইলের সংস্করণটি রয়ে গেছে। সেই সম্পাদনাগুলো কালানুক্রমে আছে।"++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "শেষবার এই ব্রাঞ্চ খোলা থাকার সময় {fileName}-এ রাখা সম্পাদনাগুলো মার্জ করা যায়নি, তাই ফাইলের সংস্করণটি রয়ে গেছে। সেই সম্পাদনাগুলো নথির ইতিহাসে সংরক্ষিত হয়েছে।"+msgid "Element fields"msgstr "উপাদান ফিল্ড"@@ -4590,6 +4617,9 @@ msgstr "ফাইল {identity}। রেফারেন্সে যান।"msgid "File already exists"msgstr "ফাইলটি আগে থেকেই আছে"+msgid "File change notice"+msgstr "ফাইল পরিবর্তনের বিজ্ঞপ্তি"+msgid "File drop zone"msgstr "ফাইল ফেলার জায়গা"@@ -6965,6 +6995,9 @@ msgstr "ইনস্টল করা নেই · OpenKnowledge ফাইল রmsgid "Not installed in this project yet."msgstr "এই প্রকল্পে এখনো ইনস্টল হয়নি।"+msgid "Not merged"+msgstr "মার্জ হয়নি"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "এখন নয়"@@ -7343,6 +7376,9 @@ msgstr "এই লিংকটি নতুন ট্যাবে খুলুmsgid "Open this settings dialog."msgstr "এই সেটিং সংলাপটি খুলুন।"+msgid "Open timeline"+msgstr "কালানুক্রম খুলুন"+msgid "Open visual-editor find with replace controls expanded."msgstr "দৃশ্য-সম্পাদকের খোঁজা বদলানোর নিয়ন্ত্রণ মেলে ধরা অবস্থায় খুলুন।"@@ -7650,6 +7686,9 @@ msgstr "সব ব্লকের বাইরে"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "এই রিপোজিটরির OpenKnowledge ওয়ার্কট্রি ফোল্ডারের বাইরে"+msgid "Outside version"+msgstr "বাইরের সংস্করণ"+msgid "Outside what Open Knowledge commits."msgstr "Open Knowledge যা কমিট করে তার বাইরে।"@@ -11663,6 +11702,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "সংস্করণ"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge-এর সংস্করণ"+msgid "via {viaTags}"msgstr "{viaTags}-এর মাধ্যমে"diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex cb1658a8f..039980efd 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -952,6 +952,15 @@ msgstr "A copy may remain in {scopeLabel} for: {names}. Don't delete anything thmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "A deletion in {fileName} was undone because the same text was changed on the other side."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."@@ -1451,6 +1460,12 @@ msgstr "Already starting a chat with this agent — try again in a moment."msgid "Always included"msgstr "Always included"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgid "An unexpected error occurred."msgstr "An unexpected error occurred."@@ -1786,6 +1801,9 @@ msgstr "Becomes the document's content when someone creates a doc from this tempmsgid "Before"msgstr "Before"+msgid "Before an outside change was merged"+msgstr "Before an outside change was merged"+msgid "Before syncing, set your identity for git commits:"msgstr "Before syncing, set your identity for git commits:"@@ -1850,6 +1868,9 @@ msgstr "Both agents end up reading everything in {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgid "Branch"msgstr "Branch"@@ -3986,6 +4007,12 @@ msgstr "Edits apply live. Light or dark comes from the theme."msgid "Edits at the source land here — no copy-paste drift."msgstr "Edits at the source land here — no copy-paste drift."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgid "Element fields"msgstr "Element fields"@@ -4594,6 +4621,9 @@ msgstr "File {identity}. Go to reference."msgid "File already exists"msgstr "File already exists"+msgid "File change notice"+msgstr "File change notice"+msgid "File drop zone"msgstr "File drop zone"@@ -6969,6 +6999,9 @@ msgstr "Not installed · OpenKnowledge files present"msgid "Not installed in this project yet."msgstr "Not installed in this project yet."+msgid "Not merged"+msgstr "Not merged"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Not now"@@ -7347,6 +7380,9 @@ msgstr "Open this link in a new tab and collapse the graph."msgid "Open this settings dialog."msgstr "Open this settings dialog."+msgid "Open timeline"+msgstr "Open timeline"+msgid "Open visual-editor find with replace controls expanded."msgstr "Open visual-editor find with replace controls expanded."@@ -7654,6 +7690,9 @@ msgstr "Outside any block"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Outside this repository's OpenKnowledge worktrees folder"+msgid "Outside version"+msgstr "Outside version"+msgid "Outside what Open Knowledge commits."msgstr "Outside what Open Knowledge commits."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "version"+msgid "Version in OpenKnowledge"+msgstr "Version in OpenKnowledge"+msgid "via {viaTags}"msgstr "via {viaTags}"diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.poindex e624ddc52..618c51c65 100644--- a/packages/app/src/locales/es/messages.po+++ b/packages/app/src/locales/es/messages.po@@ -952,6 +952,15 @@ msgstr "Puede quedar una copia en {scopeLabel} de: {names}. No elimines nada demsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "Se conservó a propósito una copia de «{name}» en {scopeLabel}. No la elimines antes de compararla con el original: puede contener la única copia de los archivos que el movimiento fallido ya eliminó."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "Se deshizo una eliminación en {fileName} porque el mismo texto se cambió en el otro lado."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "Se deshizo una eliminación en {fileName} porque el mismo texto se cambió en el otro lado. Las versiones anteriores están en la cronología."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "Se deshizo una eliminación en {fileName} porque el mismo texto se cambió en el otro lado. Las versiones anteriores se guardaron en el historial del documento."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "En {0} vive una habilidad DISTINTA con un nombre parecido a esta; esa carpeta no es esta habilidad. Cambia el nombre o elimina una de las dos para resolverlo."@@ -1451,6 +1460,12 @@ msgstr "Ya se está iniciando un chat con este agente; inténtalo de nuevo en unmsgid "Always included"msgstr "Siempre incluido"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "Un cambio externo en {fileName} no se pudo combinar, así que se mantuvo esta versión. La versión externa está en la cronología."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "Un cambio externo en {fileName} no se pudo combinar, así que se mantuvo esta versión. La versión externa se guardó en el historial del documento."+msgid "An unexpected error occurred."msgstr "Se produjo un error inesperado."@@ -1786,6 +1801,9 @@ msgstr "Se convierte en el contenido del documento cuando alguien crea uno a parmsgid "Before"msgstr "Antes"+msgid "Before an outside change was merged"+msgstr "Antes de combinar un cambio externo"+msgid "Before syncing, set your identity for git commits:"msgstr "Antes de sincronizar, define tu identidad para los commits de git:"@@ -1850,6 +1868,9 @@ msgstr "Ambos agentes acaban leyendo todo lo que hay en {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "Las dos versiones son idénticas. Elegir Aceptar actual mantiene activa la protección de OpenKnowledge, así que otro guardado de la versión anterior se rechazará de nuevo. Elegir Aceptar entrante desactiva esa protección."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "Se conservaron las dos versiones en {fileName}. El archivo cambió fuera de OpenKnowledge en el mismo lugar que aquí, así que la versión externa está justo debajo de esta."+msgid "Branch"msgstr "Rama"@@ -3986,6 +4007,12 @@ msgstr "Los cambios se aplican al instante. El tema determina si es claro u oscumsgid "Edits at the source land here — no copy-paste drift."msgstr "Las ediciones hechas en el origen llegan aquí: sin desviaciones por copiar y pegar."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "Las ediciones de {fileName} guardadas desde la última vez que esta rama estuvo abierta no se pudieron combinar, así que se mantuvo la versión del archivo. Esas ediciones están en la cronología."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "Las ediciones de {fileName} guardadas desde la última vez que esta rama estuvo abierta no se pudieron combinar, así que se mantuvo la versión del archivo. Esas ediciones se guardaron en el historial del documento."+msgid "Element fields"msgstr "Campos del elemento"@@ -4594,6 +4621,9 @@ msgstr "Archivo {identity}. Ir a la referencia."msgid "File already exists"msgstr "El archivo ya existe"+msgid "File change notice"+msgstr "Aviso de cambio en el archivo"+msgid "File drop zone"msgstr "Zona para soltar archivos"@@ -6969,6 +6999,9 @@ msgstr "No instalado · Archivos de OpenKnowledge presentes"msgid "Not installed in this project yet."msgstr "Aún no está instalada en este proyecto."+msgid "Not merged"+msgstr "Sin combinar"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Ahora no"@@ -7347,6 +7380,9 @@ msgstr "Abre este enlace en una pestaña nueva y contrae el grafo."msgid "Open this settings dialog."msgstr "Abre este diálogo de ajustes."+msgid "Open timeline"+msgstr "Abrir la cronología"+msgid "Open visual-editor find with replace controls expanded."msgstr "Abre la búsqueda del editor visual con los controles de reemplazo desplegados."@@ -7654,6 +7690,9 @@ msgstr "Fuera de cualquier bloque"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Fuera de la carpeta de árboles de trabajo de OpenKnowledge de este repositorio"+msgid "Outside version"+msgstr "Versión externa"+msgid "Outside what Open Knowledge commits."msgstr "Fuera de lo que confirma Open Knowledge."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "versión"+msgid "Version in OpenKnowledge"+msgstr "Versión en OpenKnowledge"+msgid "via {viaTags}"msgstr "vía {viaTags}"diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.poindex 2d0d30bd8..0a8673fff 100644--- a/packages/app/src/locales/fr/messages.po+++ b/packages/app/src/locales/fr/messages.po@@ -952,6 +952,15 @@ msgstr "Une copie peut subsister dans {scopeLabel} pour : {names}. Ne supprimezmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "Une copie de « {name} » a été conservée dans {scopeLabel} de façon délibérée. Ne la supprimez pas avant de l'avoir comparée à l'original : elle peut contenir la seule copie des fichiers que le déplacement échoué a déjà supprimés."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "Une suppression dans {fileName} a été annulée, car le même texte a été modifié de l'autre côté."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "Une suppression dans {fileName} a été annulée, car le même texte a été modifié de l'autre côté. Les versions précédentes se trouvent dans la chronologie."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "Une suppression dans {fileName} a été annulée, car le même texte a été modifié de l'autre côté. Les versions précédentes ont été enregistrées dans l'historique du document."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "Une compétence DIFFÉRENTE portant un nom semblable se trouve dans {0} — ce dossier n'est pas cette compétence. Renommez ou supprimez l'une des deux pour résoudre le problème."@@ -1451,6 +1460,12 @@ msgstr "Un chat avec cet agent est déjà en cours de démarrage — réessayezmsgid "Always included"msgstr "Toujours inclus"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "Une modification externe de {fileName} n'a pas pu être fusionnée, donc cette version a été conservée. La version externe se trouve dans la chronologie."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "Une modification externe de {fileName} n'a pas pu être fusionnée, donc cette version a été conservée. La version externe a été enregistrée dans l'historique du document."+msgid "An unexpected error occurred."msgstr "Une erreur inattendue s'est produite."@@ -1786,6 +1801,9 @@ msgstr "Devient le contenu du document lorsque quelqu'un en crée un à partir dmsgid "Before"msgstr "Avant"+msgid "Before an outside change was merged"+msgstr "Avant la fusion d'une modification externe"+msgid "Before syncing, set your identity for git commits:"msgstr "Avant de synchroniser, définissez votre identité pour les commits git :"@@ -1850,6 +1868,9 @@ msgstr "Les deux agents liront tout ce qui se trouve dans {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "Les deux versions sont identiques. Choisir Accepter l’actuel laisse la protection d’OpenKnowledge activée : un nouvel enregistrement de la version antérieure sera de nouveau refusé. Choisir Accepter l’entrant désactive cette protection."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "Les deux versions ont été conservées dans {fileName}. Le fichier a été modifié en dehors d'OpenKnowledge au même endroit qu'ici, donc la version externe se trouve juste en dessous de celle-ci."+msgid "Branch"msgstr "Branche"@@ -3986,6 +4007,12 @@ msgstr "Les modifications s’appliquent immédiatement. Le thème détermine lemsgid "Edits at the source land here — no copy-paste drift."msgstr "Les modifications faites à la source arrivent ici — aucune dérive due au copier-coller."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "Les modifications de {fileName} conservées depuis la dernière ouverture de cette branche n'ont pas pu être fusionnées, donc la version du fichier a été conservée. Ces modifications se trouvent dans la chronologie."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "Les modifications de {fileName} conservées depuis la dernière ouverture de cette branche n'ont pas pu être fusionnées, donc la version du fichier a été conservée. Ces modifications ont été enregistrées dans l'historique du document."+msgid "Element fields"msgstr "Champs d'élément"@@ -4594,6 +4621,9 @@ msgstr "Fichier {identity}. Accéder à la référence."msgid "File already exists"msgstr "Le fichier existe déjà"+msgid "File change notice"+msgstr "Avis de modification du fichier"+msgid "File drop zone"msgstr "Zone de dépôt de fichiers"@@ -6969,6 +6999,9 @@ msgstr "Non installé · Fichiers OpenKnowledge présents"msgid "Not installed in this project yet."msgstr "Pas encore installée dans ce projet."+msgid "Not merged"+msgstr "Non fusionné"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Pas maintenant"@@ -7347,6 +7380,9 @@ msgstr "Ouvre ce lien dans un nouvel onglet et réduit le graphe."msgid "Open this settings dialog."msgstr "Ouvre cette boîte de dialogue des paramètres."+msgid "Open timeline"+msgstr "Ouvrir la chronologie"+msgid "Open visual-editor find with replace controls expanded."msgstr "Ouvre la recherche de l'éditeur visuel avec les contrôles de remplacement dépliés."@@ -7654,6 +7690,9 @@ msgstr "En dehors de tout bloc"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Hors du dossier des arbres de travail OpenKnowledge de ce dépôt"+msgid "Outside version"+msgstr "Version externe"+msgid "Outside what Open Knowledge commits."msgstr "En dehors de ce que valide Open Knowledge."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "version"+msgid "Version in OpenKnowledge"+msgstr "Version dans OpenKnowledge"+msgid "via {viaTags}"msgstr "via {viaTags}"diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.poindex 4fe989d36..9927fc0fe 100644--- a/packages/app/src/locales/hi/messages.po+++ b/packages/app/src/locales/hi/messages.po@@ -948,6 +948,15 @@ msgstr "{scopeLabel} में इनकी एक कॉपी बची रहmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "“{name}” की एक कॉपी {scopeLabel} में जान-बूझकर रखी गई है। इसे मिटाने से पहले मूल से मिलाकर देखें: इसमें उन फ़ाइलों की इकलौती कॉपी हो सकती है जिन्हें असफल मूव पहले ही हटा चुका है।"+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "{fileName} में एक हटाया गया हिस्सा वापस लाया गया, क्योंकि दूसरी ओर उसी पाठ को बदला गया था।"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "{fileName} में एक हटाया गया हिस्सा वापस लाया गया, क्योंकि दूसरी ओर उसी पाठ को बदला गया था। पिछले संस्करण समयरेखा में हैं।"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "{fileName} में एक हटाया गया हिस्सा वापस लाया गया, क्योंकि दूसरी ओर उसी पाठ को बदला गया था। पिछले संस्करण दस्तावेज़ के इतिहास में सहेजे गए हैं।"+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "इस जैसे नाम वाली एक अलग स्किल {0} पर रहती है — वह फ़ोल्डर यह स्किल नहीं है। सुलझाने के लिए दोनों में से एक का नाम बदलें या हटाएँ।"@@ -1447,6 +1456,12 @@ msgstr "इस एजेंट के साथ पहले से ही एmsgid "Always included"msgstr "हमेशा शामिल"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName} में बाहर से किया गया बदलाव मर्ज नहीं किया जा सका, इसलिए यह संस्करण बना रहा। बाहरी संस्करण समयरेखा में है।"++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName} में बाहर से किया गया बदलाव मर्ज नहीं किया जा सका, इसलिए यह संस्करण बना रहा। बाहरी संस्करण दस्तावेज़ के इतिहास में सहेजा गया है।"+msgid "An unexpected error occurred."msgstr "एक अप्रत्याशित त्रुटि हुई।"@@ -1782,6 +1797,9 @@ msgstr "जब कोई इस टेम्पलेट से दस्ताmsgid "Before"msgstr "पहले"+msgid "Before an outside change was merged"+msgstr "बाहरी बदलाव मर्ज होने से पहले"+msgid "Before syncing, set your identity for git commits:"msgstr "सिंक करने से पहले, git कमिट के लिए अपनी पहचान सेट करें:"@@ -1846,6 +1864,9 @@ msgstr "दोनों एजेंट अंत में {keep} की हरmsgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "दोनों संस्करण एक जैसे हैं। वर्तमान स्वीकारें चुनने पर OpenKnowledge की सुरक्षा चालू रहती है, इसलिए पुराने संस्करण का एक और सेव फिर से अस्वीकार कर दिया जाएगा। आने वाला स्वीकारें चुनने पर वह सुरक्षा बंद हो जाती है।"+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName} में दोनों संस्करण रखे गए। यह फ़ाइल OpenKnowledge के बाहर उसी जगह बदली गई जहाँ यहाँ बदलाव हुआ था, इसलिए बाहरी संस्करण ठीक इसके नीचे है।"+msgid "Branch"msgstr "ब्रांच"@@ -3982,6 +4003,12 @@ msgstr "संपादन तुरंत लागू होते हैंmsgid "Edits at the source land here — no copy-paste drift."msgstr "स्रोत पर किए गए संपादन यहाँ आते हैं — कॉपी-पेस्ट का कोई बिखराव नहीं।"+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "पिछली बार यह ब्रांच खुली होने पर {fileName} में रखे गए संपादन मर्ज नहीं किए जा सके, इसलिए फ़ाइल का संस्करण बना रहा। वे संपादन समयरेखा में हैं।"++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "पिछली बार यह ब्रांच खुली होने पर {fileName} में रखे गए संपादन मर्ज नहीं किए जा सके, इसलिए फ़ाइल का संस्करण बना रहा। वे संपादन दस्तावेज़ के इतिहास में सहेजे गए हैं।"+msgid "Element fields"msgstr "तत्व फ़ील्ड"@@ -4590,6 +4617,9 @@ msgstr "फ़ाइल {identity}। संदर्भ पर जाएँ।"msgid "File already exists"msgstr "फ़ाइल पहले से मौजूद है"+msgid "File change notice"+msgstr "फ़ाइल बदलाव की सूचना"+msgid "File drop zone"msgstr "फ़ाइल छोड़ने का क्षेत्र"@@ -6965,6 +6995,9 @@ msgstr "इंस्टॉल नहीं है · OpenKnowledge फ़ाइmsgid "Not installed in this project yet."msgstr "इस प्रोजेक्ट में अभी इंस्टॉल नहीं है।"+msgid "Not merged"+msgstr "मर्ज नहीं हुआ"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "अभी नहीं"@@ -7343,6 +7376,9 @@ msgstr "इस लिंक को नए टैब में खोलेंmsgid "Open this settings dialog."msgstr "यह सेटिंग संवाद खोलें।"+msgid "Open timeline"+msgstr "समयरेखा खोलें"+msgid "Open visual-editor find with replace controls expanded."msgstr "दृश्य-संपादक की खोज फैले हुए बदलें-नियंत्रणों के साथ खोलें।"@@ -7650,6 +7686,9 @@ msgstr "किसी भी ब्लॉक के बाहर"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "इस रिपॉज़िटरी के OpenKnowledge वर्कट्री फ़ोल्डर के बाहर"+msgid "Outside version"+msgstr "बाहरी संस्करण"+msgid "Outside what Open Knowledge commits."msgstr "Open Knowledge जो कमिट करता है उसके दायरे से बाहर।"@@ -11663,6 +11702,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "संस्करण"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge में संस्करण"+msgid "via {viaTags}"msgstr "{viaTags} के ज़रिए"diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.poindex 453c5b1e0..e3fc4c813 100644--- a/packages/app/src/locales/id/messages.po+++ b/packages/app/src/locales/id/messages.po@@ -948,6 +948,15 @@ msgstr "Sebuah salinan mungkin masih ada di {scopeLabel} untuk: {names}. Janganmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "Sebuah salinan “{name}” sengaja disimpan di {scopeLabel}. Jangan hapus salinan itu sebelum dibandingkan dengan aslinya: salinan itu mungkin menyimpan satu-satunya salinan berkas yang sudah dihapus oleh pemindahan yang gagal."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "Penghapusan di {fileName} dibatalkan karena teks yang sama diubah di sisi lain."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "Penghapusan di {fileName} dibatalkan karena teks yang sama diubah di sisi lain. Versi sebelumnya ada di lini masa."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "Penghapusan di {fileName} dibatalkan karena teks yang sama diubah di sisi lain. Versi sebelumnya disimpan di riwayat dokumen."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "Keterampilan BERBEDA dengan nama mirip ini ada di {0} — folder itu bukan keterampilan ini. Ganti nama atau hapus salah satu dari keduanya untuk menyelesaikannya."@@ -1447,6 +1456,12 @@ msgstr "Obrolan dengan agen ini sudah mulai dibuka — coba lagi sebentar lagi."msgid "Always included"msgstr "Selalu disertakan"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "Perubahan dari luar pada {fileName} tidak bisa digabungkan, jadi versi ini tetap dipakai. Versi dari luar ada di lini masa."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "Perubahan dari luar pada {fileName} tidak bisa digabungkan, jadi versi ini tetap dipakai. Versi dari luar disimpan di riwayat dokumen."+msgid "An unexpected error occurred."msgstr "Terjadi galat yang tidak terduga."@@ -1782,6 +1797,9 @@ msgstr "Menjadi isi dokumen ketika seseorang membuat dokumen dari templat ini. Kmsgid "Before"msgstr "Sebelum"+msgid "Before an outside change was merged"+msgstr "Sebelum perubahan dari luar digabungkan"+msgid "Before syncing, set your identity for git commits:"msgstr "Sebelum menyinkronkan, setel identitas Anda untuk commit git:"@@ -1846,6 +1864,9 @@ msgstr "Kedua agen akhirnya membaca semua yang ada di {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "Kedua versi identik. Memilih Terima yang sekarang membuat perlindungan OpenKnowledge tetap aktif, sehingga penyimpanan versi lama berikutnya akan ditolak lagi. Memilih Terima yang masuk menonaktifkan perlindungan tersebut."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "Kedua versi disimpan di {fileName}. File ini diubah di luar OpenKnowledge di tempat yang sama dengan di sini, jadi versi dari luar ada tepat di bawah versi ini."+msgid "Branch"msgstr "Cabang"@@ -3982,6 +4003,12 @@ msgstr "Suntingan langsung diterapkan. Tema menentukan mode terang atau gelap."msgid "Edits at the source land here — no copy-paste drift."msgstr "Suntingan di sumbernya sampai ke sini — tanpa penyimpangan salin-tempel."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "Suntingan pada {fileName} yang disimpan sejak terakhir kali cabang ini dibuka tidak bisa digabungkan, jadi versi file tetap dipakai. Suntingan tersebut ada di lini masa."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "Suntingan pada {fileName} yang disimpan sejak terakhir kali cabang ini dibuka tidak bisa digabungkan, jadi versi file tetap dipakai. Suntingan tersebut disimpan di riwayat dokumen."+msgid "Element fields"msgstr "Bidang elemen"@@ -4590,6 +4617,9 @@ msgstr "File {identity}. Buka referensi."msgid "File already exists"msgstr "Berkas sudah ada"+msgid "File change notice"+msgstr "Pemberitahuan perubahan file"+msgid "File drop zone"msgstr "Area jatuhkan berkas"@@ -6965,6 +6995,9 @@ msgstr "Belum terpasang · File OpenKnowledge ada"msgid "Not installed in this project yet."msgstr "Belum terpasang di proyek ini."+msgid "Not merged"+msgstr "Tidak digabungkan"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Nanti saja"@@ -7343,6 +7376,9 @@ msgstr "Membuka tautan ini di tab baru dan menciutkan graf."msgid "Open this settings dialog."msgstr "Membuka dialog pengaturan ini."+msgid "Open timeline"+msgstr "Buka lini masa"+msgid "Open visual-editor find with replace controls expanded."msgstr "Membuka pencarian penyunting visual dengan kendali penggantian terbentang."@@ -7650,6 +7686,9 @@ msgstr "Di luar blok mana pun"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Di luar folder worktree OpenKnowledge repositori ini"+msgid "Outside version"+msgstr "Versi dari luar"+msgid "Outside what Open Knowledge commits."msgstr "Di luar cakupan commit Open Knowledge."@@ -11663,6 +11702,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "versi"+msgid "Version in OpenKnowledge"+msgstr "Versi di OpenKnowledge"+msgid "via {viaTags}"msgstr "via {viaTags}"diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.poindex 943c06e90..7b4d2ad22 100644--- a/packages/app/src/locales/ko/messages.po+++ b/packages/app/src/locales/ko/messages.po@@ -952,6 +952,15 @@ msgstr "{scopeLabel}에 다음 스킬의 사본이 남아 있을 수 있습니msgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "“{name}”의 사본을 {scopeLabel}에 일부러 남겨 두었습니다. 원본과 비교하기 전에는 삭제하지 마세요. 실패한 이동이 이미 지운 파일의 유일한 사본일 수 있습니다."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "다른 쪽에서 같은 텍스트를 변경했기 때문에 {fileName}의 삭제가 취소되었습니다."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "다른 쪽에서 같은 텍스트를 변경했기 때문에 {fileName}의 삭제가 취소되었습니다. 이전 버전은 타임라인에 있습니다."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "다른 쪽에서 같은 텍스트를 변경했기 때문에 {fileName}의 삭제가 취소되었습니다. 이전 버전은 문서 기록에 저장되었습니다."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "이 스킬과 같은 이름의 다른 스킬이 {0}에 있습니다. 해당 폴더는 이 스킬이 아닙니다. 둘 중 하나를 이름 변경하거나 삭제해 해결하세요."@@ -1451,6 +1460,12 @@ msgstr "이 에이전트와의 채팅을 이미 시작하는 중입니다. 잠msgid "Always included"msgstr "항상 포함"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName}의 외부 변경을 병합할 수 없어 이 버전이 유지되었습니다. 외부 버전은 타임라인에 있습니다."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName}의 외부 변경을 병합할 수 없어 이 버전이 유지되었습니다. 외부 버전은 문서 기록에 저장되었습니다."+msgid "An unexpected error occurred."msgstr "예기치 않은 오류가 발생했습니다."@@ -1786,6 +1801,9 @@ msgstr "누군가 이 템플릿으로 문서를 만들면 문서 내용이 됩msgid "Before"msgstr "이전"+msgid "Before an outside change was merged"+msgstr "외부 변경을 병합하기 전"+msgid "Before syncing, set your identity for git commits:"msgstr "동기화하기 전에 git 커밋에 사용할 사용자 정보를 설정하세요:"@@ -1850,6 +1868,9 @@ msgstr "두 에이전트 모두 결국 {keep}의 모든 항목을 읽게 됩니msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "두 버전이 동일합니다. 현재 항목 적용을 선택하면 OpenKnowledge의 보호가 켜진 상태로 유지되어 이전 버전의 또 다른 저장이 다시 거부됩니다. 수신 항목 적용을 선택하면 그 보호가 해제됩니다."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName}에 두 버전이 모두 유지되었습니다. 이 파일이 OpenKnowledge 밖에서 여기와 같은 위치가 변경되어, 외부 버전이 이 버전 바로 아래에 있습니다."+msgid "Branch"msgstr "브랜치"@@ -3986,6 +4007,12 @@ msgstr "편집 내용이 실시간으로 적용됩니다. 밝은 테마와 어msgid "Edits at the source land here — no copy-paste drift."msgstr "소스에서 편집한 내용이 여기에 반영됩니다. 복사하여 붙여넣을 때 내용이 어긋나지 않습니다."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "이 브랜치를 마지막으로 열었을 때부터 보관된 {fileName}의 편집 내용을 병합할 수 없어 파일의 버전이 유지되었습니다. 해당 편집 내용은 타임라인에 있습니다."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "이 브랜치를 마지막으로 열었을 때부터 보관된 {fileName}의 편집 내용을 병합할 수 없어 파일의 버전이 유지되었습니다. 해당 편집 내용은 문서 기록에 저장되었습니다."+msgid "Element fields"msgstr "요소 필드"@@ -4594,6 +4621,9 @@ msgstr "파일 {identity}. 참조로 이동합니다."msgid "File already exists"msgstr "파일이 이미 있습니다"+msgid "File change notice"+msgstr "파일 변경 알림"+msgid "File drop zone"msgstr "파일 놓기 영역"@@ -6969,6 +6999,9 @@ msgstr "설치되지 않음 · OpenKnowledge 파일 있음"msgid "Not installed in this project yet."msgstr "아직 이 프로젝트에 설치되지 않았습니다."+msgid "Not merged"+msgstr "병합되지 않음"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "나중에"@@ -7347,6 +7380,9 @@ msgstr "이 링크를 새 탭에서 열고 그래프를 접습니다."msgid "Open this settings dialog."msgstr "이 설정 대화 상자를 엽니다."+msgid "Open timeline"+msgstr "타임라인 열기"+msgid "Open visual-editor find with replace controls expanded."msgstr "교체 컨트롤을 확장한 상태로 비주얼 편집기 찾기를 엽니다."@@ -7654,6 +7690,9 @@ msgstr "블록 밖"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "이 저장소의 OpenKnowledge 워크트리 폴더 외부"+msgid "Outside version"+msgstr "외부 버전"+msgid "Outside what Open Knowledge commits."msgstr "Open Knowledge가 커밋하는 범위 밖입니다."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "버전"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge의 버전"+msgid "via {viaTags}"msgstr "{viaTags} 경유"diff --git a/packages/app/src/locales/pl/messages.po b/packages/app/src/locales/pl/messages.poindex 6fcde5f2b..46e00a540 100644--- a/packages/app/src/locales/pl/messages.po+++ b/packages/app/src/locales/pl/messages.po@@ -952,6 +952,15 @@ msgstr "Kopia może pozostać w {scopeLabel} dla: {names}. Nie usuwaj tam niczegmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "Kopia \"{name}\" została celowo zachowana w {scopeLabel}. Nie usuwaj jej przed porównaniem z oryginałem: może zawierać jedyną kopię plików, które nieudane przeniesienie już usunęło."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "Usunięcie w {fileName} zostało cofnięte, ponieważ ten sam tekst został zmieniony po drugiej stronie."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "Usunięcie w {fileName} zostało cofnięte, ponieważ ten sam tekst został zmieniony po drugiej stronie. Wcześniejsze wersje są na osi czasu."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "Usunięcie w {fileName} zostało cofnięte, ponieważ ten sam tekst został zmieniony po drugiej stronie. Wcześniejsze wersje zapisano w historii dokumentu."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "W {0} znajduje się INNA umiejętność o takiej samej nazwie — ten folder nie jest tą umiejętnością. Zmień nazwę jednej z nich lub usuń ją, aby rozwiązać problem."@@ -1451,6 +1460,12 @@ msgstr "Rozpoczynasz już czat z tym agentem — spróbuj ponownie za chwilę."msgid "Always included"msgstr "Zawsze dołączane"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "Zewnętrznej zmiany w {fileName} nie udało się scalić, więc ta wersja została zachowana. Wersja zewnętrzna jest na osi czasu."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "Zewnętrznej zmiany w {fileName} nie udało się scalić, więc ta wersja została zachowana. Wersję zewnętrzną zapisano w historii dokumentu."+msgid "An unexpected error occurred."msgstr "Wystąpił nieoczekiwany błąd."@@ -1786,6 +1801,9 @@ msgstr "Staje się zawartością dokumentu, gdy ktoś utworzy dokument z tego szmsgid "Before"msgstr "Przed"+msgid "Before an outside change was merged"+msgstr "Przed scaleniem zmiany zewnętrznej"+msgid "Before syncing, set your identity for git commits:"msgstr "Przed synchronizacją ustaw swoją tożsamość dla commitów git:"@@ -1850,6 +1868,9 @@ msgstr "Oba agenty ostatecznie czytają wszystko w {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "Obie wersje są identyczne. Wybranie „Akceptuj bieżącą” pozostawia ochronę OpenKnowledge włączoną, więc kolejne zapisanie starszej wersji zostanie ponownie odrzucone. Wybranie „Akceptuj przychodzącą” wyłącza tę ochronę."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "Zachowano obie wersje w {fileName}. Plik zmienił się poza OpenKnowledge w tym samym miejscu co tutaj, więc wersja zewnętrzna znajduje się tuż pod tą."+msgid "Branch"msgstr "Gałąź"@@ -3986,6 +4007,12 @@ msgstr "Zmiany są widoczne na żywo. Jasny lub ciemny wariant pochodzi z motywumsgid "Edits at the source land here — no copy-paste drift."msgstr "Edycje w źródle trafiają tutaj — bez rozjazdów kopiuj-wklej."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "Edycji w {fileName} zachowanych od ostatniego otwarcia tej gałęzi nie udało się scalić, więc została wersja z pliku. Te edycje są na osi czasu."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "Edycji w {fileName} zachowanych od ostatniego otwarcia tej gałęzi nie udało się scalić, więc została wersja z pliku. Te edycje zapisano w historii dokumentu."+msgid "Element fields"msgstr "Pola elementu"@@ -4594,6 +4621,9 @@ msgstr "Plik {identity}. Przejdź do odwołania."msgid "File already exists"msgstr "Plik już istnieje"+msgid "File change notice"+msgstr "Powiadomienie o zmianie pliku"+msgid "File drop zone"msgstr "Strefa upuszczania plików"@@ -6969,6 +6999,9 @@ msgstr "Nie zainstalowano · pliki OpenKnowledge obecne"msgid "Not installed in this project yet."msgstr "Jeszcze nie zainstalowano w tym projekcie."+msgid "Not merged"+msgstr "Nie scalono"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Nie teraz"@@ -7347,6 +7380,9 @@ msgstr "Otwórz ten link w nowej karcie i zwij graf."msgid "Open this settings dialog."msgstr "Otwórz to okno ustawień."+msgid "Open timeline"+msgstr "Otwórz oś czasu"+msgid "Open visual-editor find with replace controls expanded."msgstr "Otwórz wyszukiwanie w edytorze wizualnym z rozwiniętymi opcjami zastępowania."@@ -7654,6 +7690,9 @@ msgstr "Poza jakimkolwiek blokiem"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Poza folderem worktrees projektów OpenKnowledge tego repozytorium"+msgid "Outside version"+msgstr "Wersja zewnętrzna"+msgid "Outside what Open Knowledge commits."msgstr "Poza zakresem, który Open Knowledge zapisuje w commitach."@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "wersja"+msgid "Version in OpenKnowledge"+msgstr "Wersja w OpenKnowledge"+msgid "via {viaTags}"msgstr "przez {viaTags}"diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.poindex 4bc27fc29..0387182e2 100644--- a/packages/app/src/locales/pt-BR/messages.po+++ b/packages/app/src/locales/pt-BR/messages.po@@ -948,6 +948,15 @@ msgstr "Pode ter ficado uma cópia em {scopeLabel} de: {names}. Não apague nadamsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "Uma cópia de “{name}” foi mantida em {scopeLabel} de propósito. Não apague essa cópia antes de comparar com o original: ela pode ter a única cópia dos arquivos que a movimentação com falha já removeu."+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "Uma exclusão em {fileName} foi desfeita porque o mesmo texto foi alterado do outro lado."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "Uma exclusão em {fileName} foi desfeita porque o mesmo texto foi alterado do outro lado. As versões anteriores estão na linha do tempo."++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "Uma exclusão em {fileName} foi desfeita porque o mesmo texto foi alterado do outro lado. As versões anteriores foram salvas no histórico do documento."+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "Uma habilidade DIFERENTE com nome parecido com esta fica em {0} — essa pasta não é esta habilidade. Renomeie ou exclua uma das duas para resolver."@@ -1447,6 +1456,12 @@ msgstr "Já está sendo iniciado um chat com este agente; tente de novo em um inmsgid "Always included"msgstr "Sempre incluído"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "Uma alteração externa em {fileName} não pôde ser mesclada, então esta versão foi mantida. A versão externa está na linha do tempo."++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "Uma alteração externa em {fileName} não pôde ser mesclada, então esta versão foi mantida. A versão externa foi salva no histórico do documento."+msgid "An unexpected error occurred."msgstr "Ocorreu um erro inesperado."@@ -1782,6 +1797,9 @@ msgstr "Vira o conteúdo do documento quando alguém cria um documento a partirmsgid "Before"msgstr "Antes"+msgid "Before an outside change was merged"+msgstr "Antes de mesclar uma alteração externa"+msgid "Before syncing, set your identity for git commits:"msgstr "Antes de sincronizar, defina sua identidade para os commits do git:"@@ -1846,6 +1864,9 @@ msgstr "Os dois agentes passam a ler tudo o que está em {keep}."msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "As duas versões são idênticas. Escolher Aceitar atual mantém a proteção do OpenKnowledge ativada, então outro salvamento da versão mais antiga será recusado novamente. Escolher Aceitar recebido desativa essa proteção."+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "As duas versões foram mantidas em {fileName}. O arquivo mudou fora do OpenKnowledge no mesmo lugar que aqui, então a versão externa está logo abaixo desta."+msgid "Branch"msgstr "Ramo"@@ -3982,6 +4003,12 @@ msgstr "As alterações são aplicadas imediatamente. O tema define se o modo émsgid "Edits at the source land here — no copy-paste drift."msgstr "As edições feitas na fonte chegam aqui — sem desvio por copiar e colar."+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "As edições em {fileName} guardadas da última vez que este ramo esteve aberto não puderam ser mescladas, então a versão do arquivo foi mantida. Essas edições estão na linha do tempo."++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "As edições em {fileName} guardadas da última vez que este ramo esteve aberto não puderam ser mescladas, então a versão do arquivo foi mantida. Essas edições foram salvas no histórico do documento."+msgid "Element fields"msgstr "Campos do elemento"@@ -4590,6 +4617,9 @@ msgstr "Arquivo {identity}. Ir para a referência."msgid "File already exists"msgstr "O arquivo já existe"+msgid "File change notice"+msgstr "Aviso de alteração no arquivo"+msgid "File drop zone"msgstr "Área para soltar arquivos"@@ -6965,6 +6995,9 @@ msgstr "Não instalado · Arquivos do OpenKnowledge presentes"msgid "Not installed in this project yet."msgstr "Ainda não instalada neste projeto."+msgid "Not merged"+msgstr "Não mesclado"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "Agora não"@@ -7343,6 +7376,9 @@ msgstr "Abre este link em uma nova aba e recolhe o grafo."msgid "Open this settings dialog."msgstr "Abre este diálogo de configurações."+msgid "Open timeline"+msgstr "Abrir linha do tempo"+msgid "Open visual-editor find with replace controls expanded."msgstr "Abre a busca do editor visual com os controles de substituição expandidos."@@ -7650,6 +7686,9 @@ msgstr "Fora de qualquer bloco"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "Fora da pasta de árvores de trabalho do OpenKnowledge deste repositório"+msgid "Outside version"+msgstr "Versão externa"+msgid "Outside what Open Knowledge commits."msgstr "Fora do que o Open Knowledge faz commit."@@ -11663,6 +11702,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "versão"+msgid "Version in OpenKnowledge"+msgstr "Versão no OpenKnowledge"+msgid "via {viaTags}"msgstr "via {viaTags}"diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.poindex 32ef4b9fe..6ee4e9c89 100644--- a/packages/app/src/locales/ur/messages.po+++ b/packages/app/src/locales/ur/messages.po@@ -952,6 +952,15 @@ msgstr "{scopeLabel} میں اِن کی ایک کاپی باقی رہ سکتیmsgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "“{name}” کی ایک کاپی {scopeLabel} میں جان بوجھ کر رکھی گئی ہے۔ اسے حذف کرنے سے پہلے اصل سے موازنہ کریں: اس میں اُن فائلوں کی واحد کاپی ہو سکتی ہے جو ناکام منتقلی پہلے ہی حذف کر چکی ہے۔"+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "{fileName} میں ایک حذف واپس لے لیا گیا کیونکہ دوسری طرف وہی متن بدلا گیا تھا۔"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "{fileName} میں ایک حذف واپس لے لیا گیا کیونکہ دوسری طرف وہی متن بدلا گیا تھا۔ پچھلے ورژن ٹائم لائن میں ہیں۔"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "{fileName} میں ایک حذف واپس لے لیا گیا کیونکہ دوسری طرف وہی متن بدلا گیا تھا۔ پچھلے ورژن دستاویز کی تاریخ میں محفوظ کر دیے گئے ہیں۔"+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "اس جیسے نام کی ایک مختلف مہارت {0} پر موجود ہے — وہ فولڈر یہ مہارت نہیں ہے۔ حل کے لیے دونوں میں سے کسی ایک کا نام بدلیں یا اسے حذف کریں۔"@@ -1451,6 +1460,12 @@ msgstr "اس ایجنٹ کے ساتھ پہلے ہی چیٹ شروع ہو رہیmsgid "Always included"msgstr "ہمیشہ شامل"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName} میں باہر سے کی گئی تبدیلی مرج نہیں ہو سکی، اس لیے یہی ورژن رہا۔ باہر والا ورژن ٹائم لائن میں ہے۔"++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName} میں باہر سے کی گئی تبدیلی مرج نہیں ہو سکی، اس لیے یہی ورژن رہا۔ باہر والا ورژن دستاویز کی تاریخ میں محفوظ کر دیا گیا ہے۔"+msgid "An unexpected error occurred."msgstr "ایک غیر متوقع خرابی پیش آئی۔"@@ -1786,6 +1801,9 @@ msgstr "جب کوئی اس ٹیمپلیٹ سے دستاویز بناتا ہے تmsgid "Before"msgstr "پہلے"+msgid "Before an outside change was merged"+msgstr "باہر کی تبدیلی مرج ہونے سے پہلے"+msgid "Before syncing, set your identity for git commits:"msgstr "مطابقت پذیری سے پہلے، git کمٹس کے لیے اپنی شناخت مقرر کریں:"@@ -1850,6 +1868,9 @@ msgstr "دونوں ایجنٹس بالآخر {keep} کی ہر چیز پڑھیںmsgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "دونوں ورژن یکساں ہیں۔ موجودہ قبول کریں منتخب کرنے سے OpenKnowledge کا تحفظ فعال رہتا ہے، اس لیے پرانے ورژن کا ایک اور سیو دوبارہ مسترد کر دیا جائے گا۔ آنے والا قبول کریں منتخب کرنے سے وہ تحفظ بند ہو جاتا ہے۔"+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName} میں دونوں ورژن رکھے گئے۔ فائل OpenKnowledge کے باہر اسی جگہ بدلی جہاں یہاں بھی تبدیلی ہوئی تھی، اس لیے باہر والا ورژن عین اس کے نیچے ہے۔"+msgid "Branch"msgstr "برانچ"@@ -3986,6 +4007,12 @@ msgstr "ترامیم فوراً لاگو ہوتی ہیں۔ روشن یا تارmsgid "Edits at the source land here — no copy-paste drift."msgstr "ماخذ پر ہونے والی ترامیم یہاں پہنچتی ہیں — نقل و چسپاں کا کوئی فرق نہیں۔"+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "پچھلی بار یہ برانچ کھلی ہونے کے وقت سے {fileName} میں رکھی گئی ترامیم مرج نہیں ہو سکیں، اس لیے فائل کا ورژن رہا۔ وہ ترامیم ٹائم لائن میں ہیں۔"++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "پچھلی بار یہ برانچ کھلی ہونے کے وقت سے {fileName} میں رکھی گئی ترامیم مرج نہیں ہو سکیں، اس لیے فائل کا ورژن رہا۔ وہ ترامیم دستاویز کی تاریخ میں محفوظ کر دی گئی ہیں۔"+msgid "Element fields"msgstr "عنصر کے فیلڈز"@@ -4594,6 +4621,9 @@ msgstr "فائل {identity}۔ حوالہ پر جائیں۔"msgid "File already exists"msgstr "فائل پہلے سے موجود ہے"+msgid "File change notice"+msgstr "فائل میں تبدیلی کی اطلاع"+msgid "File drop zone"msgstr "فائل ڈراپ زون"@@ -6969,6 +6999,9 @@ msgstr "نصب نہیں · OpenKnowledge فائلیں موجود ہیں"msgid "Not installed in this project yet."msgstr "اس پروجیکٹ میں ابھی نصب نہیں ہے۔"+msgid "Not merged"+msgstr "مرج نہیں ہوا"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "ابھی نہیں"@@ -7347,6 +7380,9 @@ msgstr "یہ لنک نئے ٹیب میں کھولیں اور گراف سکیڑmsgid "Open this settings dialog."msgstr "یہ ترتیبات کا ڈائیلاگ کھولیں۔"+msgid "Open timeline"+msgstr "ٹائم لائن کھولیں"+msgid "Open visual-editor find with replace controls expanded."msgstr "بصری ایڈیٹر کی تلاش تبدیلی کے کنٹرولز کھلے ہوئے کھولیں۔"@@ -7654,6 +7690,9 @@ msgstr "کسی بھی بلاک سے باہر"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "اس ریپوزٹری کے OpenKnowledge ورک ٹریز فولڈر کے باہر"+msgid "Outside version"+msgstr "باہر والا ورژن"+msgid "Outside what Open Knowledge commits."msgstr "اس دائرے سے باہر جسے Open Knowledge کمٹ کرتا ہے۔"@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "ورژن"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge میں ورژن"+msgid "via {viaTags}"msgstr "{viaTags} کے ذریعے"diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.poindex dc95c4278..619192502 100644--- a/packages/app/src/locales/zh-Hans/messages.po+++ b/packages/app/src/locales/zh-Hans/messages.po@@ -952,6 +952,15 @@ msgstr "{scopeLabel}中可能残留以下技能的副本:{names}。请先与msgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "已在{scopeLabel}中有意保留了“{name}”的一份副本。请先与原件比对再删除:它可能保存着失败的移动已经删掉的文件的唯一副本。"+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "{fileName} 中的一处删除已被撤销,因为另一方修改了同一段文字。"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "{fileName} 中的一处删除已被撤销,因为另一方修改了同一段文字。之前的版本在时间线中。"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "{fileName} 中的一处删除已被撤销,因为另一方修改了同一段文字。之前的版本已保存到文档的历史记录中。"+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "{0} 处有一个名字相近但完全不同的技能——那个文件夹不是这个技能。请重命名或删除其中之一以解决冲突。"@@ -1451,6 +1460,12 @@ msgstr "已经在与该智能体开启对话了,请稍后再试。"msgid "Always included"msgstr "始终包含"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName} 的外部更改无法合并,因此保留了当前版本。外部版本在时间线中。"++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName} 的外部更改无法合并,因此保留了当前版本。外部版本已保存到文档的历史记录中。"+msgid "An unexpected error occurred."msgstr "发生了意外错误。"@@ -1786,6 +1801,9 @@ msgstr "当有人用这个模板创建文档时,这会成为该文档的内容msgid "Before"msgstr "之前"+msgid "Before an outside change was merged"+msgstr "合并外部更改之前"+msgid "Before syncing, set your identity for git commits:"msgstr "同步之前,请设置你用于 git 提交的身份:"@@ -1850,6 +1868,9 @@ msgstr "两个智能体最终都会读取 {keep} 中的全部内容。"msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "两个版本完全相同。选择“采用当前”会让 OpenKnowledge 的保护保持开启,因此再次保存较旧的版本仍会被拒绝。选择“采用传入”会关闭该保护。"+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName} 的两个版本都已保留。它在 OpenKnowledge 之外被修改的位置与这里相同,因此外部版本紧接在此版本下方。"+msgid "Branch"msgstr "分支"@@ -3986,6 +4007,12 @@ msgstr "编辑会实时生效。浅色或深色由主题决定。"msgid "Edits at the source land here — no copy-paste drift."msgstr "在来源处的编辑会同步到这里——不会因复制粘贴而产生偏差。"+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "{fileName} 中上次打开此分支时保留的编辑无法合并,因此保留了文件中的版本。这些编辑在时间线中。"++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "{fileName} 中上次打开此分支时保留的编辑无法合并,因此保留了文件中的版本。这些编辑已保存到文档的历史记录中。"+msgid "Element fields"msgstr "元素字段"@@ -4594,6 +4621,9 @@ msgstr "文件 {identity}。转到引用位置。"msgid "File already exists"msgstr "文件已存在"+msgid "File change notice"+msgstr "文件更改通知"+msgid "File drop zone"msgstr "文件拖放区"@@ -6969,6 +6999,9 @@ msgstr "未安装 · 存在 OpenKnowledge 文件"msgid "Not installed in this project yet."msgstr "尚未安装到此项目。"+msgid "Not merged"+msgstr "未合并"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "暂时不用"@@ -7347,6 +7380,9 @@ msgstr "在新标签页中打开这个链接并折叠关系图。"msgid "Open this settings dialog."msgstr "打开这个设置对话框。"+msgid "Open timeline"+msgstr "打开时间线"+msgid "Open visual-editor find with replace controls expanded."msgstr "打开可视化编辑器的查找,并展开替换控件。"@@ -7654,6 +7690,9 @@ msgstr "不在任何块内"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "位于此仓库的 OpenKnowledge 工作树文件夹外"+msgid "Outside version"+msgstr "外部版本"+msgid "Outside what Open Knowledge commits."msgstr "不在 Open Knowledge 的提交范围内。"@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "版本"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge 中的版本"+msgid "via {viaTags}"msgstr "通过 {viaTags}"diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.poindex be5df2be6..f19a18c3f 100644--- a/packages/app/src/locales/zh-Hant/messages.po+++ b/packages/app/src/locales/zh-Hant/messages.po@@ -952,6 +952,15 @@ msgstr "{scopeLabel}中可能殘留以下技能的副本:{names}。請先與msgid "A copy of \"{name}\" was kept in {scopeLabel} on purpose. Don't delete it before comparing it with the original: it may hold the only copy of files the failed move already removed."msgstr "已在{scopeLabel}中刻意保留了「{name}」的一份副本。請先與原件比對再刪除:它可能保存著失敗的移動已經刪除的檔案的唯一副本。"+msgid "A deletion in {fileName} was undone because the same text was changed on the other side."+msgstr "{fileName} 中的一處刪除已被復原,因為另一方修改了同一段文字。"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions are in the timeline."+msgstr "{fileName} 中的一處刪除已被復原,因為另一方修改了同一段文字。先前的版本在時間軸中。"++msgid "A deletion in {fileName} was undone because the same text was changed on the other side. The earlier versions were saved to the document's history."+msgstr "{fileName} 中的一處刪除已被復原,因為另一方修改了同一段文字。先前的版本已儲存到文件的記錄中。"+msgid "A DIFFERENT skill named like this one lives at {0} — that folder is not this skill. Rename or delete one of the two to resolve."msgstr "{0} 有一個名稱相近但完全不同的技能——那個資料夾不是這個技能。請重新命名或刪除其中之一來解決。"@@ -1451,6 +1460,12 @@ msgstr "已經在與該代理開啟對話了,請稍後再試。"msgid "Always included"msgstr "一律包含"+msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version is in the timeline."+msgstr "{fileName} 的外部變更無法合併,因此保留了目前的版本。外部版本在時間軸中。"++msgid "An outside change to {fileName} could not be merged, so this version stayed. The outside version was saved to the document's history."+msgstr "{fileName} 的外部變更無法合併,因此保留了目前的版本。外部版本已儲存到文件的記錄中。"+msgid "An unexpected error occurred."msgstr "發生了非預期的錯誤。"@@ -1786,6 +1801,9 @@ msgstr "當有人用這個範本建立文件時,這會成為那份文件的內msgid "Before"msgstr "之前"+msgid "Before an outside change was merged"+msgstr "合併外部變更之前"+msgid "Before syncing, set your identity for git commits:"msgstr "同步之前,請先設定你用於 git 提交的身分:"@@ -1850,6 +1868,9 @@ msgstr "兩個代理最後都會讀到 {keep} 裡的全部內容。"msgid "Both versions are identical. Choosing Accept current leaves OpenKnowledge's protection on, so another save of the older version is refused again. Choosing Accept incoming turns that protection off."msgstr "兩個版本完全相同。選擇「採用目前」會讓 OpenKnowledge 的保護保持開啟,因此再次儲存較舊的版本仍會被拒絕。選擇「採用傳入」會關閉該保護。"+msgid "Both versions were kept in {fileName}. It changed outside OpenKnowledge in the same place as here, so the outside version is directly under this one."+msgstr "{fileName} 的兩個版本都已保留。它在 OpenKnowledge 之外被修改的位置與這裡相同,因此外部版本緊接在此版本下方。"+msgid "Branch"msgstr "分支"@@ -3986,6 +4007,12 @@ msgstr "編輯會即時套用。淺色或深色由主題決定。"msgid "Edits at the source land here — no copy-paste drift."msgstr "在來源處的編輯會同步到這裡——不會因為複製貼上而產生偏差。"+msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits are in the timeline."+msgstr "{fileName} 中上次開啟此分支時保留的編輯無法合併,因此保留了檔案中的版本。這些編輯在時間軸中。"++msgid "Edits to {fileName} kept from the last time this branch was open could not be merged, so the file's version stayed. Those edits were saved to the document's history."+msgstr "{fileName} 中上次開啟此分支時保留的編輯無法合併,因此保留了檔案中的版本。這些編輯已儲存到文件的記錄中。"+msgid "Element fields"msgstr "元素欄位"@@ -4594,6 +4621,9 @@ msgstr "檔案 {identity}。前往引用位置。"msgid "File already exists"msgstr "檔案已存在"+msgid "File change notice"+msgstr "檔案變更通知"+msgid "File drop zone"msgstr "檔案拖放區"@@ -6969,6 +6999,9 @@ msgstr "未安裝 · 存在 OpenKnowledge 檔案"msgid "Not installed in this project yet."msgstr "尚未安裝到此專案。"+msgid "Not merged"+msgstr "未合併"+#. Declines the first-visit skill offer; the row on the page keeps it availablemsgid "Not now"msgstr "現在不用"@@ -7347,6 +7380,9 @@ msgstr "在新分頁中開啟這個連結並摺疊關係圖。"msgid "Open this settings dialog."msgstr "開啟這個設定對話方塊。"+msgid "Open timeline"+msgstr "開啟時間軸"+msgid "Open visual-editor find with replace controls expanded."msgstr "開啟視覺化編輯器的尋找,並展開取代控制項。"@@ -7654,6 +7690,9 @@ msgstr "不在任何區塊內"msgid "Outside this repository's OpenKnowledge worktrees folder"msgstr "位於此儲存庫的 OpenKnowledge 工作樹資料夾外"+msgid "Outside version"+msgstr "外部版本"+msgid "Outside what Open Knowledge commits."msgstr "不在 Open Knowledge 的提交範圍內。"@@ -11667,6 +11706,9 @@ msgctxt "settings search keyword"msgid "version"msgstr "版本"+msgid "Version in OpenKnowledge"+msgstr "OpenKnowledge 中的版本"+msgid "via {viaTags}"msgstr "透過 {viaTags}"diff --git a/packages/app/tests/integration/api-error-envelope/doc-notice-dismiss.test.ts b/packages/app/tests/integration/api-error-envelope/doc-notice-dismiss.test.tsnew file mode 100644index 000000000..4a9dd1d7f--- /dev/null+++ b/packages/app/tests/integration/api-error-envelope/doc-notice-dismiss.test.ts@@ -0,0 +1,61 @@+import { DismissDocNoticeSuccessSchema, ProblemDetailsSchema } from '@inkeep/open-knowledge-core';+import { afterAll, beforeAll, describe, expect, test } from 'vitest';+import { HARNESS_BOOT_TIMEOUT_MS } from '../harness-boot-timeout';+import { createTestServer, type TestServer } from '../test-harness';++let server: TestServer;++beforeAll(async () => {+ server = await createTestServer();+}, HARNESS_BOOT_TIMEOUT_MS);++afterAll(async () => {+ await server.cleanup();+});++function dismiss(body: unknown, method = 'POST'): Promise<Response> {+ return fetch(`http://127.0.0.1:${server.port}/api/doc-notices/dismiss`, {+ method,+ headers: { 'Content-Type': 'application/json' },+ ...(method === 'POST' ? { body: JSON.stringify(body) } : {}),+ });+}++describe('doc-notice-dismiss envelope (RFC 9457)', () => {+ test('dismissing a notice that does not exist is a flat success that dismissed nothing', async () => {+ const res = await dismiss({ docName: 'notes', id: 'no-such-notice' });+ expect(res.status).toBe(200);+ expect(res.headers.get('content-type')).toBe('application/json');++ const body = await res.json();+ const parsed = DismissDocNoticeSuccessSchema.safeParse(body);+ expect(parsed.success).toBe(true);+ if (parsed.success) {+ expect(parsed.data.dismissed).toBe(false);+ }+ expect((body as Record<string, unknown>).ok).toBeUndefined();+ });++ test('a body without an id is rejected with invalid-request', async () => {+ const res = await dismiss({ docName: 'notes' });+ expect(res.status).toBe(400);++ const parsed = ProblemDetailsSchema.safeParse(await res.json());+ expect(parsed.success).toBe(true);+ if (parsed.success) {+ expect(parsed.data.type).toBe('urn:ok:error:invalid-request');+ }+ });++ test('method-not-allowed on GET emits problem+json with Allow: POST', async () => {+ const res = await dismiss(undefined, 'GET');+ expect(res.status).toBe(405);+ expect(res.headers.get('allow')).toBe('POST');++ const parsed = ProblemDetailsSchema.safeParse(await res.json());+ expect(parsed.success).toBe(true);+ if (parsed.success) {+ expect(parsed.data.type).toBe('urn:ok:error:method-not-allowed');+ }+ });+});diff --git a/packages/app/tests/integration/api-error-envelope/doc-notices.test.ts b/packages/app/tests/integration/api-error-envelope/doc-notices.test.tsnew file mode 100644index 000000000..6ec382b7a--- /dev/null+++ b/packages/app/tests/integration/api-error-envelope/doc-notices.test.ts@@ -0,0 +1,44 @@+import { DocNoticesSuccessSchema, ProblemDetailsSchema } from '@inkeep/open-knowledge-core';+import { afterAll, beforeAll, describe, expect, test } from 'vitest';+import { HARNESS_BOOT_TIMEOUT_MS } from '../harness-boot-timeout';+import { createTestServer, type TestServer } from '../test-harness';++let server: TestServer;++beforeAll(async () => {+ server = await createTestServer();+}, HARNESS_BOOT_TIMEOUT_MS);++afterAll(async () => {+ await server.cleanup();+});++describe('doc-notices envelope (RFC 9457)', () => {+ test('happy path emits a flat empty notice list', async () => {+ const res = await fetch(`http://127.0.0.1:${server.port}/api/doc-notices`);+ expect(res.status).toBe(200);+ expect(res.headers.get('content-type')).toBe('application/json');++ const body = await res.json();+ const parsed = DocNoticesSuccessSchema.safeParse(body);+ expect(parsed.success).toBe(true);+ if (parsed.success) {+ expect(parsed.data.notices).toEqual([]);+ }+ expect((body as Record<string, unknown>).ok).toBeUndefined();+ });++ test('method-not-allowed on POST emits problem+json with Allow: GET', async () => {+ const res = await fetch(`http://127.0.0.1:${server.port}/api/doc-notices`, {+ method: 'POST',+ });+ expect(res.status).toBe(405);+ expect(res.headers.get('allow')).toBe('GET');++ const parsed = ProblemDetailsSchema.safeParse(await res.json());+ expect(parsed.success).toBe(true);+ if (parsed.success) {+ expect(parsed.data.type).toBe('urn:ok:error:method-not-allowed');+ }+ });+});diff --git a/packages/app/tests/integration/attribution-sweep-coverage.test.ts b/packages/app/tests/integration/attribution-sweep-coverage.test.tsindex 2a179f63b..eb80fc256 100644--- a/packages/app/tests/integration/attribution-sweep-coverage.test.ts+++ b/packages/app/tests/integration/attribution-sweep-coverage.test.ts@@ -116,6 +116,8 @@ const EXEMPT_HANDLERS = new Set(['handleRescueList','handleSyncStatus','handleSyncConflicts',+ 'handleDocNotices',+ 'handleDismissDocNotice','handleSyncConflictContent','handleSyncTrigger','handleSyncResolveConflict',diff --git a/packages/app/tests/integration/conflict-gate-coverage.test.ts b/packages/app/tests/integration/conflict-gate-coverage.test.tsindex 37ae5122c..21832b489 100644--- a/packages/app/tests/integration/conflict-gate-coverage.test.ts+++ b/packages/app/tests/integration/conflict-gate-coverage.test.ts@@ -101,6 +101,8 @@ const EXEMPT_HANDLERS = new Set(['handleRescueList','handleSyncStatus','handleSyncConflicts',+ 'handleDocNotices',+ 'handleDismissDocNotice','handleSyncConflictContent','handleSyncTrigger','handleSyncResolveConflict',diff --git a/packages/app/tests/integration/doc-notice.test.ts b/packages/app/tests/integration/doc-notice.test.tsnew file mode 100644index 000000000..67cee5ddb--- /dev/null+++ b/packages/app/tests/integration/doc-notice.test.ts@@ -0,0 +1,211 @@+import { randomUUID } from 'node:crypto';+import { existsSync, readFileSync, writeFileSync } from 'node:fs';+import { join } from 'node:path';+import { HocuspocusProvider } from '@hocuspocus/provider';+import { getMetrics } from '@inkeep/open-knowledge-server';+import { afterEach, describe, expect, test } from 'vitest';+import * as Y from 'yjs';+import { createWatcherDouble } from '../../../server/src/watcher-double.test-helper';+import { dismissDocNotice, fetchDocNotices } from '../../src/hooks/use-doc-notices';+import { dispatchCC1Stateless, SYSTEM_DOC_NAME } from '../../src/lib/cc1';+import {+ agentWriteMd,+ createTestClient,+ createTestServer,+ pollUntil,+ type TestClient,+ type TestServer,+} from './test-harness';++const cleanups: Array<() => Promise<void> | void> = [];+const realFetch = globalThis.fetch;++afterEach(async () => {+ globalThis.fetch = realFetch;+ for (const cleanup of cleanups.splice(0).reverse()) await cleanup();+});++function liveText(s: TestServer, docName: string): string {+ return s.instance.hocuspocus.documents.get(docName)?.getText('source').toString() ?? '';+}++function edit(c: TestClient, find: string, replace: string): void {+ c.doc.transact(() => {+ const at = c.ytext.toString().indexOf(find);+ c.ytext.delete(at, find.length);+ c.ytext.insert(at, replace);+ });+}++async function serverWithOpenDoc(docName: string, saved: string) {+ const s = await createTestServer({+ gitEnabled: true,+ watcherBackend: createWatcherDouble().backend,+ debounce: 300_000,+ maxDebounce: 600_000,+ });+ cleanups.push(() => s.cleanup());+ globalThis.fetch = (input, init) =>+ realFetch(+ typeof input === 'string' && input.startsWith('/')+ ? `http://127.0.0.1:${s.port}${input}`+ : input,+ init,+ );+ const file = join(s.contentDir, `${docName}.md`);+ await agentWriteMd(s.port, saved, { docName, position: 'replace' });+ await pollUntil(+ () => existsSync(file) && readFileSync(file, 'utf-8') === saved,+ 10_000,+ 25,+ 'the seeded document to reach disk',+ );+ const c = await createTestClient(s.port, docName);+ cleanups.push(() => c.cleanup());+ await pollUntil(() => c.ytext.toString() === saved);+ return { s, c, file };+}++function watchSyncStatus(port: number): { count: () => number } {+ const doc = new Y.Doc();+ let signals = 0;+ const provider = new HocuspocusProvider({+ url: `ws://127.0.0.1:${port}/collab`,+ name: SYSTEM_DOC_NAME,+ document: doc,+ onStateless: ({ payload }) => {+ dispatchCC1Stateless(payload, {+ onDerivedView: (signal) => {+ if (signal.ch === 'sync-status') signals++;+ },+ });+ },+ });+ cleanups.push(() => {+ provider.destroy();+ doc.destroy();+ });+ return { count: () => signals };+}++async function noticesFor(docName: string) {+ const notices = await fetchDocNotices();+ if (notices === null) throw new Error('the app could not read the notices');+ return notices.filter((notice) => notice.docName === docName);+}++async function checkpointShas(s: TestServer, docName: string, kind: string): Promise<string[]> {+ const res = await realFetch(+ `http://127.0.0.1:${s.port}/api/history?docName=${encodeURIComponent(docName)}&limit=100`,+ );+ const body = (await res.json()) as {+ entries?: Array<{ sha: string; checkpoint?: { kind?: string } }>;+ };+ return (body.entries ?? [])+ .filter((entry) => entry.checkpoint?.kind === kind)+ .map((entry) => entry.sha);+}++const SAVED = '# Doc\n\nShared paragraph.\n\nTail.\n';++describe('the notice on a document after an outside edit', () => {+ test('a both-kept merge reaches the app as one notice pointing at both history entries; a second collision updates it and dismissal clears it', async () => {+ const docName = `notice-both-${randomUUID()}`;+ const { s, c, file } = await serverWithOpenDoc(docName, SAVED);+ const syncStatus = watchSyncStatus(s.port);+ edit(c, 'Shared paragraph.', 'Shared paragraph, edited here.');+ await pollUntil(() => liveText(s, docName).includes('edited here'));+ expect(await noticesFor(docName)).toEqual([]);+ const signalsBefore = syncStatus.count();++ writeFileSync(file, '# Doc\n\nShared paragraph, edited outside.\n\nTail.\n');+ await s.instance.recheckDisk();+ await pollUntil(() => liveText(s, docName).includes('edited outside'), 10_000, 25, 'both kept');+ await pollUntil(() => syncStatus.count() > signalsBefore, 10_000, 25, 'a sync-status signal');++ let shas: string[] = [];+ await pollUntil(+ async () => {+ shas = await checkpointShas(s, docName, 'external-change-both-kept');+ const [notice] = await noticesFor(docName);+ return shas.length === 2 && notice?.entries.length === 2;+ },+ 10_000,+ 50,+ 'the notice to point at both history entries',+ );+ const [first] = await noticesFor(docName);+ expect(first).toMatchObject({+ kind: 'both-kept',+ kept: { duplicated: 1, restoredDeletedHere: 0, restoredDeletedOutside: 0 },+ events: 1,+ });+ expect([...(first?.entries ?? [])].sort()).toEqual([...shas].sort());++ edit(c, 'Tail.', 'Tail, edited here.');+ await pollUntil(() => liveText(s, docName).includes('Tail, edited here.'));+ writeFileSync(file, '# Doc\n\nShared paragraph, edited outside.\n\nTail, edited outside.\n');+ await s.instance.recheckDisk();+ await pollUntil(+ async () => (await noticesFor(docName))[0]?.events === 2,+ 10_000,+ 50,+ 'the second collision to update the notice',+ );+ const updated = await noticesFor(docName);+ expect(updated).toHaveLength(1);+ expect(updated[0]?.id).toBe(first?.id);++ const signalsBeforeDismiss = syncStatus.count();+ expect(await dismissDocNotice(docName, first?.id ?? '')).toBe(true);+ expect(await noticesFor(docName)).toEqual([]);+ await pollUntil(() => syncStatus.count() > signalsBeforeDismiss, 10_000, 25, 'a signal');+ const stored = readFileSync(join(s.contentDir, '.ok', 'local', 'doc-notices.json'), 'utf-8');+ expect(stored).not.toContain(docName);+ }, 60_000);++ test('an outside edit that fails the merge check reaches the app as a notice that the outside version is in history', async () => {+ const docName = `notice-moved-${randomUUID()}`;+ const { s, c, file } = await serverWithOpenDoc(docName, '# Doc\n\nA\n\nB\n\nC\n');+ edit(c, 'B\n\nC', 'X\n\nB edited\n\nC');+ await pollUntil(() => liveText(s, docName).includes('B edited'));+ const keptLiveBefore = getMetrics().reconcileKeptLive;++ writeFileSync(file, '# Doc\n\nA\n\nX\n\nB\n\nC\n');+ await s.instance.recheckDisk();+ await pollUntil(() => getMetrics().reconcileKeptLive > keptLiveBefore, 10_000, 25, 'kept live');++ const shas = await checkpointShas(s, docName, 'external-change-kept-live');+ expect(shas).toHaveLength(1);+ expect(await noticesFor(docName)).toEqual([+ expect.objectContaining({+ kind: 'moved-to-history',+ side: 'theirs',+ reason: 'check-failed',+ entries: shas,+ }),+ ]);+ }, 60_000);++ test('an agent write that lands on both kept versions raises the same notice', async () => {+ const docName = `notice-agent-${randomUUID()}`;+ const { s, c, file } = await serverWithOpenDoc(docName, SAVED);+ edit(c, 'Shared paragraph.', 'Shared paragraph, edited here.');+ await pollUntil(() => liveText(s, docName).includes('edited here'));+ writeFileSync(file, '# Doc\n\nShared paragraph, edited outside.\n\nTail.\n');++ const res = await realFetch(`http://127.0.0.1:${s.port}/api/agent-write-md`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ docName, markdown: 'Agent line.\n', position: 'append' }),+ });+ expect(res.status).toBe(200);++ expect(await noticesFor(docName)).toEqual([+ expect.objectContaining({+ kind: 'both-kept',+ kept: expect.objectContaining({ duplicated: 1 }),+ }),+ ]);+ }, 60_000);+});diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex c1e90ce96..63b0fba52 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -1328,8 +1328,13 @@ export {DeleteSuccessSchema,type DiskEditReconciledWarning,DiskEditReconciledWarningSchema,+ DismissDocNoticeRequestSchema,+ DismissDocNoticeSuccessSchema,type DispatchPayload,DispatchPayloadSchema,+ DocNoticesSuccessSchema,+ type DocNoticeWire,+ DocNoticeWireSchema,type DocumentListEntry,DocumentListEntrySchema,type DocumentListSuccess,diff --git a/packages/core/src/schemas/api/doc-notices.ts b/packages/core/src/schemas/api/doc-notices.tsnew file mode 100644index 000000000..3e14b5cc3--- /dev/null+++ b/packages/core/src/schemas/api/doc-notices.ts@@ -0,0 +1,59 @@+import type { StandardSchemaV1 } from '@standard-schema/spec';+import { z } from 'zod';++const DOC_NOTICE_SIDES = ['ours', 'theirs'] as const;+const DOC_NOTICE_MOVE_REASONS = ['check-failed', 'too-large'] as const;++const DocNoticeKeptBlocksSchema = z.object({+ duplicated: z.number().int().nonnegative(),+ restoredDeletedHere: z.number().int().nonnegative(),+ restoredDeletedOutside: z.number().int().nonnegative(),+});++const docNoticeCommon = {+ id: z.string().min(1),+ docName: z.string().min(1),+ file: z.string().min(1),+ firstAt: z.string().min(1),+ lastAt: z.string().min(1),+ events: z.number().int().positive(),+ entries: z.array(z.string().min(1)),+};++export const DocNoticeWireSchema = z.discriminatedUnion('kind', [+ z+ .object({+ ...docNoticeCommon,+ kind: z.literal('both-kept'),+ kept: DocNoticeKeptBlocksSchema,+ })+ .loose(),+ z+ .object({+ ...docNoticeCommon,+ kind: z.literal('moved-to-history'),+ side: z.enum(DOC_NOTICE_SIDES),+ reason: z.enum(DOC_NOTICE_MOVE_REASONS),+ })+ .loose(),+]) satisfies StandardSchemaV1;+export type DocNoticeWire = z.infer<typeof DocNoticeWireSchema>;++export const DocNoticesSuccessSchema = z+ .object({+ notices: z.array(DocNoticeWireSchema),+ })+ .loose() satisfies StandardSchemaV1;++export const DismissDocNoticeRequestSchema = z+ .object({+ docName: z.string().min(1),+ id: z.string().min(1),+ })+ .loose() satisfies StandardSchemaV1;++export const DismissDocNoticeSuccessSchema = z+ .object({+ dismissed: z.boolean(),+ })+ .loose() satisfies StandardSchemaV1;diff --git a/packages/core/src/schemas/api/index.ts b/packages/core/src/schemas/api/index.tsindex 75f1de644..14b0d41a4 100644--- a/packages/core/src/schemas/api/index.ts+++ b/packages/core/src/schemas/api/index.ts@@ -3,6 +3,7 @@ export * from './agent-integrations.ts';export * from './agent-write.ts';export * from './client-logs.ts';export * from './comments.ts';+export * from './doc-notices.ts';export * from './document-read.ts';export * from './embed-detect.ts';export * from './git-worktree-status.ts';diff --git a/packages/server/src/api-extension.ts b/packages/server/src/api-extension.tsindex 07ddf0b97..53d62fa81 100644--- a/packages/server/src/api-extension.ts+++ b/packages/server/src/api-extension.ts@@ -223,6 +223,7 @@ import {SUPPORTED_DOC_EXTENSIONS,stripDocExtension,} from './doc-extensions.ts';+import type { DocNoticeLedger } from './doc-notices.ts';import {assertNeverDeferredStoreWait,type DocumentDurabilityState,@@ -269,6 +270,7 @@ import { type ApiRouteTable, createApiRequestPipeline } from './http/api-pipelinimport { createAssetRoutes } from './http/asset-routes.ts';import { createCommentRoutes } from './http/comment-routes.ts';import { createConfigSystemRoutes } from './http/config-system-routes.ts';+import { createDocNoticeRoutes } from './http/doc-notice-routes.ts';import { createDocumentRoutes } from './http/document-routes.ts';import {type ErrorExtensions,@@ -1341,6 +1343,7 @@ interface ApiExtensionBaseOptions {resolveEmbed?: (basename: string, sourcePath: string) => string | null;getBridgeLossReporter?: () => BridgeDeriveLossReporter | undefined;mergeHistoryWriter?: MergeHistoryWriter;+ docNotices?: DocNoticeLedger;getPrincipal?: () => Principal | null;homeDirOverride?: string;resetSettingsForTest?: () => void;@@ -2012,6 +2015,7 @@ export function createApiExtension(options: ApiExtensionOptions): Extension & {contentRoot: contentRoot ?? '',getBranch: () => getCurrentBranch?.() ?? null,writeCheckpoint: options.mergeHistoryWriter,+ notices: options.docNotices,});/**@@ -5299,6 +5303,11 @@ export function createApiExtension(options: ApiExtensionOptions): Extension & {getPrincipal,signalChannel,});+ const docNoticeRoutes = createDocNoticeRoutes({+ docNotices: options.docNotices ?? null,+ getBranch: () => getCurrentBranch?.() ?? 'main',+ checkLocalOpSecurity,+ });const syncRoutes = createSyncRoutes({projectDir,contentDir,@@ -5576,6 +5585,7 @@ export function createApiExtension(options: ApiExtensionOptions): Extension & {workspaceToolsRoutes,commentRoutes,syncRoutes,+ docNoticeRoutes,shareRoutes,gitRoutes,localOpRoutes,diff --git a/packages/server/src/doc-notices.test.ts b/packages/server/src/doc-notices.test.tsnew file mode 100644index 000000000..19fd23fc6--- /dev/null+++ b/packages/server/src/doc-notices.test.ts@@ -0,0 +1,256 @@+import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { dirname, join } from 'node:path';+import { CONFIG_DOC_NAMES } from '@inkeep/open-knowledge-core';+import simpleGit from 'simple-git';+import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';+import { configureTestGitRepository } from '../../../test-support/configure-git-fixture.test-helper.ts';+import { _resetDocExtensionsForTests, registerDocExtension } from './doc-extensions.ts';+import { DocNoticeLedger, docNoticesPath } from './doc-notices.ts';+import { createMergeHistoryRecorder } from './merge-history.ts';+import {+ DEFAULT_CHECKPOINT_RETENTION,+ gcCheckpointRefs,+ initShadowRepo,+ type ShadowHandle,+} from './shadow-repo.ts';++const KEPT_ONE = { duplicated: 1, restoredDeletedHere: 0, restoredDeletedOutside: 0 };++describe('DocNoticeLedger', () => {+ let projectDir: string;+ let signal: ReturnType<typeof vi.fn<() => void>>;++ beforeEach(() => {+ projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-doc-notices-')));+ signal = vi.fn<() => void>();+ });++ afterEach(() => {+ rmSync(projectDir, { recursive: true, force: true });+ _resetDocExtensionsForTests();+ });++ function seedDoc(docName: string, extension = '.md'): void {+ const file = join(projectDir, `${docName}${extension}`);+ mkdirSync(dirname(file), { recursive: true });+ writeFileSync(file, '# Doc\n');+ }++ function ledger(options: { shadow?: ShadowHandle; ready?: boolean } = {}): DocNoticeLedger {+ return new DocNoticeLedger({+ projectDir,+ contentDir: projectDir,+ getShadow: () => options.shadow,+ isReady: () => options.ready ?? true,+ signal,+ });+ }++ test('a both-kept merge raises one notice for that document, on its own branch only', async () => {+ seedDoc('notes');+ const notices = ledger();++ const id = notices.record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });++ expect(await notices.list('main')).toEqual([+ expect.objectContaining({+ id,+ docName: 'notes',+ file: 'notes.md',+ kind: 'both-kept',+ kept: KEPT_ONE,+ events: 1,+ }),+ ]);+ expect(await notices.list('feature')).toEqual([]);+ });++ test('a second event on the same document updates its notice instead of stacking another', async () => {+ seedDoc('notes');+ const notices = ledger();++ const first = notices.record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ const second = notices.record('notes', 'main', {+ kind: 'moved-to-history',+ side: 'theirs',+ reason: 'check-failed',+ entry: 'a'.repeat(40),+ });++ expect(second).toBe(first);+ const listed = await notices.list('main');+ expect(listed).toHaveLength(1);+ expect(listed[0]).toMatchObject({+ id: first,+ kind: 'moved-to-history',+ side: 'theirs',+ events: 2,+ entries: ['a'.repeat(40)],+ });+ });++ test('a notice survives a restart, dismissal removes it for good, and a later merge raises a fresh one', async () => {+ seedDoc('notes');+ const id = ledger().record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ expect(id).not.toBeNull();++ const reopened = ledger();+ expect((await reopened.list('main')).map((notice) => notice.id)).toEqual([id]);++ expect(reopened.dismiss('notes', id ?? '')).toBe(true);+ expect(reopened.dismiss('notes', id ?? '')).toBe(false);+ expect(await ledger().list('main')).toEqual([]);++ const fresh = ledger().record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ expect(fresh).not.toBe(id);+ });++ test('a notice file from another version, or one it cannot parse, is dropped and the project still opens', async () => {+ seedDoc('notes');+ ledger().record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ const path = docNoticesPath(projectDir);+ const valid = JSON.parse(readFileSync(path, 'utf-8')) as { version: number };+ expect((await ledger().list('main')).map((notice) => notice.docName)).toEqual(['notes']);++ for (const unreadable of ['{not json', JSON.stringify({ ...valid, version: 99 })]) {+ writeFileSync(path, unreadable);+ const notices = ledger();+ expect(await notices.list('main')).toEqual([]);+ notices.record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ expect(JSON.parse(readFileSync(path, 'utf-8'))).toMatchObject({ version: 1 });+ }+ });++ test('the system document and config documents never get a notice', async () => {+ const notices = ledger();++ expect(notices.record('__system__', 'main', { kind: 'both-kept', kept: KEPT_ONE })).toBeNull();+ for (const configDoc of CONFIG_DOC_NAMES) {+ expect(notices.record(configDoc, 'main', { kind: 'both-kept', kept: KEPT_ONE })).toBeNull();+ }+ expect(signal).not.toHaveBeenCalled();+ });++ test('a notice for a document whose file is gone is withdrawn', async () => {+ seedDoc('notes');+ seedDoc('folder/kept');+ const notices = ledger();+ notices.record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ notices.record('folder/kept', 'main', { kind: 'both-kept', kept: KEPT_ONE });++ rmSync(join(projectDir, 'notes.md'));++ expect((await notices.list('main')).map((notice) => notice.docName)).toEqual(['folder/kept']);+ expect((await ledger().list('main')).map((notice) => notice.docName)).toEqual(['folder/kept']);+ });++ test('a notice for an .mdx document keeps its file name and survives a restart before the extensions are known again', async () => {+ seedDoc('guide', '.mdx');+ registerDocExtension('guide', '.mdx');+ ledger().record('guide', 'main', { kind: 'both-kept', kept: KEPT_ONE });++ _resetDocExtensionsForTests();+ const reopened = ledger();++ expect(await reopened.list('main')).toEqual([+ expect.objectContaining({ docName: 'guide', file: 'guide.mdx' }),+ ]);+ expect((await ledger().list('main')).map((notice) => notice.file)).toEqual(['guide.mdx']);+ });++ test('nothing is withdrawn before the server is ready', async () => {+ seedDoc('notes');+ ledger().record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ rmSync(join(projectDir, 'notes.md'));++ expect((await ledger({ ready: false }).list('main')).map((n) => n.docName)).toEqual(['notes']);+ expect((await ledger().list('main')).map((n) => n.docName)).toEqual([]);+ });++ test('every change tells the app to refetch, and a read that changes nothing does not', async () => {+ seedDoc('notes');+ const notices = ledger();++ const id = notices.record('notes', 'main', { kind: 'both-kept', kept: KEPT_ONE }) ?? '';+ notices.attachEntry('notes', id, 'b'.repeat(40));+ await notices.list('main');+ notices.dismiss('notes', id);++ expect(signal).toHaveBeenCalledTimes(3);+ });++ test('past the cap the notice touched longest ago is dropped', async () => {+ const notices = ledger();+ for (let i = 0; i <= 200; i++) {+ seedDoc(`doc-${i}`);+ notices.record(`doc-${i}`, 'main', { kind: 'both-kept', kept: KEPT_ONE });+ }++ const docNames = (await notices.list('main')).map((notice) => notice.docName);+ expect(docNames).toHaveLength(200);+ expect(docNames).not.toContain('doc-0');+ expect(docNames[0]).toBe('doc-200');+ });++ describe('with a real history', () => {+ async function realShadow(): Promise<ShadowHandle> {+ await simpleGit(projectDir).init();+ configureTestGitRepository(projectDir);+ return initShadowRepo(projectDir);+ }++ async function movedNoticeWhoseVersionLeftHistory(docName: string) {+ seedDoc(docName);+ const shadow = await realShadow();+ const notices = ledger({ shadow });+ const history = createMergeHistoryRecorder({+ getShadow: () => shadow,+ contentRoot: '',+ getBranch: () => 'main',+ notices,+ });+ await expect(+ history.keptLive(docName, { side: 'theirs', bytes: 'outside\n' }, 'too-large'),+ ).resolves.toBe(true);+ await gcCheckpointRefs(shadow, 'main', {+ ...DEFAULT_CHECKPOINT_RETENTION,+ maxExternalChangeKeptLivePerDocument: 0,+ });+ return notices;+ }++ test('a moved-to-history notice is withdrawn once its version leaves history; a both-kept notice stays until dismissed', async () => {+ seedDoc('kept');+ const notices = await movedNoticeWhoseVersionLeftHistory('moved');+ notices.record('kept', 'main', { kind: 'both-kept', kept: KEPT_ONE });++ expect((await notices.list('main')).map((notice) => notice.docName)).toEqual(['kept']);+ });++ test('a notice recorded while a read is checking history is not withdrawn by that read', async () => {+ const notices = await movedNoticeWhoseVersionLeftHistory('moved');++ const reading = notices.list('main');+ const id = notices.record('moved', 'main', { kind: 'both-kept', kept: KEPT_ONE });+ await reading;++ expect(await notices.list('main')).toEqual([+ expect.objectContaining({ id, docName: 'moved', kind: 'both-kept', events: 2 }),+ ]);+ });++ test('with no history to consult, a moved-to-history notice is kept', async () => {+ seedDoc('moved');+ const notices = ledger();+ notices.record('moved', 'main', {+ kind: 'moved-to-history',+ side: 'theirs',+ reason: 'check-failed',+ entry: 'c'.repeat(40),+ });++ expect((await notices.list('main')).map((notice) => notice.docName)).toEqual(['moved']);+ });+ });+});diff --git a/packages/server/src/doc-notices.ts b/packages/server/src/doc-notices.tsnew file mode 100644index 000000000..5842e43c5--- /dev/null+++ b/packages/server/src/doc-notices.ts@@ -0,0 +1,230 @@+import { randomUUID } from 'node:crypto';+import { existsSync, readFileSync } from 'node:fs';+import { dirname, join } from 'node:path';+import { type DocNoticeWire, DocNoticeWireSchema } from '@inkeep/open-knowledge-core';+import { z } from 'zod';+import { isConfigDoc, isSystemDoc } from './cc1-broadcast.ts';+import { getLocalDir } from './config/paths.ts';+import { docNameToRelativePath } from './doc-extensions.ts';+import { tracedMkdirSync, tracedRenameSync, tracedWriteFileSync } from './fs-traced.ts';+import { getLogger } from './logger.ts';+import { type ShadowHandle, shadowGit } from './shadow-repo.ts';++const log = getLogger('doc-notices');++const DOC_NOTICES_FILENAME = 'doc-notices.json';+const DOC_NOTICES_VERSION = 1;+const MAX_NOTICES = 200;+const MAX_ENTRIES_PER_NOTICE = 8;++type BothKeptNotice = Extract<DocNoticeWire, { kind: 'both-kept' }>;+type MovedNotice = Extract<DocNoticeWire, { kind: 'moved-to-history' }>;++export type DocNoticeEvent =+ | { kind: 'both-kept'; kept: BothKeptNotice['kept'] }+ | {+ kind: 'moved-to-history';+ side: MovedNotice['side'];+ reason: MovedNotice['reason'];+ entry: string;+ };++export interface DocNoticeSink {+ record(docName: string, branch: string, event: DocNoticeEvent): string | null;+ attachEntry(docName: string, id: string, entry: string): void;+}++export interface DocNoticeLedgerOptions {+ projectDir: string;+ contentDir: string;+ getShadow: () => ShadowHandle | null | undefined;+ isReady: () => boolean;+ signal: () => void;+}++const StoredNoticeSchema = z.object({+ branch: z.string().min(1),+ notice: DocNoticeWireSchema,+});+type StoredNotice = z.infer<typeof StoredNoticeSchema>;++const StoredFileSchema = z.object({+ version: z.literal(DOC_NOTICES_VERSION),+ notices: z.array(z.unknown()),+});++function keyOf(branch: string, docName: string): string {+ return `${branch}\u0000${docName}`;+}++function isNoticeDoc(docName: string): boolean {+ return !isSystemDoc(docName) && !isConfigDoc(docName);+}++export function docNoticesPath(projectDir: string): string {+ return join(getLocalDir(projectDir), DOC_NOTICES_FILENAME);+}++export class DocNoticeLedger implements DocNoticeSink {+ private readonly options: DocNoticeLedgerOptions;+ private readonly storePath: string;+ private readonly byKey = new Map<string, StoredNotice>();++ constructor(options: DocNoticeLedgerOptions) {+ this.options = options;+ this.storePath = docNoticesPath(options.projectDir);+ this.load();+ }++ record(docName: string, branch: string, event: DocNoticeEvent): string | null {+ if (!isNoticeDoc(docName)) return null;+ const key = keyOf(branch, docName);+ const existing = this.byKey.get(key)?.notice;+ const at = new Date().toISOString();+ const entry = event.kind === 'moved-to-history' ? event.entry : undefined;+ const common = {+ id: existing?.id ?? randomUUID(),+ docName,+ file: docNameToRelativePath(docName),+ firstAt: existing?.firstAt ?? at,+ lastAt: at,+ events: (existing?.events ?? 0) + 1,+ entries: [...(existing?.entries ?? []), ...(entry === undefined ? [] : [entry])].slice(+ -MAX_ENTRIES_PER_NOTICE,+ ),+ };+ const notice: DocNoticeWire =+ event.kind === 'both-kept'+ ? { ...common, kind: 'both-kept', kept: event.kept }+ : { ...common, kind: 'moved-to-history', side: event.side, reason: event.reason };+ this.byKey.delete(key);+ this.byKey.set(key, { branch, notice });+ for (const oldest of this.byKey.keys()) {+ if (this.byKey.size <= MAX_NOTICES) break;+ this.byKey.delete(oldest);+ }+ log.info(+ { docName, branch, kind: notice.kind, events: notice.events },+ `[doc-notices] notice ${notice.events === 1 ? 'raised' : 'updated'} (${notice.kind}): ${docName}`,+ );+ this.commit();+ return notice.id;+ }++ attachEntry(docName: string, id: string, entry: string): void {+ for (const [key, stored] of this.byKey) {+ if (stored.notice.docName !== docName || stored.notice.id !== id) continue;+ if (stored.notice.entries.includes(entry)) return;+ const entries = [...stored.notice.entries, entry].slice(-MAX_ENTRIES_PER_NOTICE);+ this.byKey.set(key, { ...stored, notice: { ...stored.notice, entries } });+ this.commit();+ return;+ }+ }++ async list(branch: string): Promise<DocNoticeWire[]> {+ if (this.options.isReady()) await this.withdrawStale(branch);+ return [...this.byKey.values()]+ .filter((stored) => stored.branch === branch)+ .map((stored) => stored.notice)+ .reverse();+ }++ private async withdrawStale(branch: string): Promise<void> {+ const onBranch = [...this.byKey].filter(([, stored]) => stored.branch === branch);+ const gone = onBranch.filter(([, stored]) => !this.fileExists(stored.notice.file));+ const left = await this.versionsLeftHistory(+ branch,+ onBranch.filter(([key]) => !gone.some(([goneKey]) => goneKey === key)),+ );+ const removed = [...gone, ...left].filter(([key, stored]) => this.byKey.get(key) === stored);+ for (const [key, stored] of removed) {+ this.byKey.delete(key);+ log.info(+ { docName: stored.notice.docName, branch },+ `[doc-notices] notice withdrawn: ${stored.notice.docName}`,+ );+ }+ if (removed.length > 0) this.commit();+ }++ dismiss(docName: string, id: string): boolean {+ if (!isNoticeDoc(docName)) return false;+ for (const [key, stored] of this.byKey) {+ if (stored.notice.docName !== docName || stored.notice.id !== id) continue;+ this.byKey.delete(key);+ log.info({ docName }, `[doc-notices] notice dismissed: ${docName}`);+ this.commit();+ return true;+ }+ return false;+ }++ private fileExists(file: string): boolean {+ return existsSync(join(this.options.contentDir, file));+ }++ private async versionsLeftHistory(+ branch: string,+ candidates: ReadonlyArray<[string, StoredNotice]>,+ ): Promise<Array<[string, StoredNotice]>> {+ const moved = candidates.filter(+ ([, stored]) => stored.notice.kind === 'moved-to-history' && stored.notice.entries.length > 0,+ );+ if (moved.length === 0) return [];+ const shadow = this.options.getShadow();+ if (!shadow) return [];+ let inHistory: Set<string>;+ try {+ const listing = await shadowGit(shadow).raw(+ 'for-each-ref',+ '--format=%(objectname)',+ `refs/checkpoints/${branch}/`,+ );+ inHistory = new Set(listing.split('\n').filter((line) => line.length > 0));+ } catch (err) {+ log.warn({ err, branch }, '[doc-notices] could not list history entries; notices kept');+ return [];+ }+ return moved.filter(([, stored]) =>+ stored.notice.entries.every((entry) => !inHistory.has(entry)),+ );+ }++ private load(): void {+ if (!existsSync(this.storePath)) return;+ let file: z.infer<typeof StoredFileSchema>;+ try {+ const parsed = StoredFileSchema.safeParse(JSON.parse(readFileSync(this.storePath, 'utf-8')));+ if (!parsed.success) {+ log.warn({ path: this.storePath }, '[doc-notices] unrecognized notice file; dropped');+ return;+ }+ file = parsed.data;+ } catch (err) {+ log.warn({ err, path: this.storePath }, '[doc-notices] unreadable notice file; dropped');+ return;+ }+ for (const row of file.notices) {+ const stored = StoredNoticeSchema.safeParse(row);+ if (!stored.success || !isNoticeDoc(stored.data.notice.docName)) continue;+ this.byKey.set(keyOf(stored.data.branch, stored.data.notice.docName), stored.data);+ }+ }++ private commit(): void {+ const tmpPath = `${this.storePath}.tmp`;+ try {+ tracedMkdirSync(dirname(this.storePath), { recursive: true });+ tracedWriteFileSync(+ tmpPath,+ JSON.stringify({ version: DOC_NOTICES_VERSION, notices: [...this.byKey.values()] }),+ 'utf-8',+ );+ tracedRenameSync(tmpPath, this.storePath);+ } catch (err) {+ log.error({ err }, '[doc-notices] failed to write the notice file; notices kept in memory');+ }+ this.options.signal();+ }+}diff --git a/packages/server/src/external-change.ts b/packages/server/src/external-change.tsindex 63068c02d..eeebd3511 100644--- a/packages/server/src/external-change.ts+++ b/packages/server/src/external-change.ts@@ -633,7 +633,7 @@ export async function reconcileDiskBeforeAgentWrite(}if (outcome.kind !== 'both-kept') return reconciledResult(outcome.kind);const keptBlocks = countKeptBlocks(outcome.kept);- history.bothKept(docName, { ours, theirs: diskContent }, keptBlocks.duplicated);+ history.bothKept(docName, { ours, theirs: diskContent }, outcome.kept);reportReconcileBothKept(docName, outcome.kept, 'agent-write');return reconciledResult('both-kept', keptBlocks);}diff --git a/packages/server/src/http/doc-notice-routes.ts b/packages/server/src/http/doc-notice-routes.tsnew file mode 100644index 000000000..cc98c4f03--- /dev/null+++ b/packages/server/src/http/doc-notice-routes.ts@@ -0,0 +1,78 @@+import type { IncomingMessage, ServerResponse } from 'node:http';+import {+ DismissDocNoticeRequestSchema,+ DismissDocNoticeSuccessSchema,+ DocNoticesSuccessSchema,+} from '@inkeep/open-knowledge-core';+import type { DocNoticeLedger } from '../doc-notices.ts';+import { type ApiRouteGroup, type ApiRouteRecord, createApiRouteGroup } from './api-pipeline.ts';+import { errorResponse } from './error-response.ts';+import { withValidation } from './request-validation.ts';+import { successResponse } from './success-response.ts';++export interface DocNoticeRouteDeps {+ docNotices: Pick<DocNoticeLedger, 'list' | 'dismiss'> | null;+ getBranch: () => string;+ checkLocalOpSecurity: (+ req: IncomingMessage,+ res: ServerResponse,+ opts: { handler: string },+ ) => boolean;+}++export function createDocNoticeRoutes(deps: DocNoticeRouteDeps): ApiRouteGroup {+ const { docNotices, getBranch, checkLocalOpSecurity } = deps;++ async function handleDocNotices(req: IncomingMessage, res: ServerResponse): Promise<void> {+ if (!checkLocalOpSecurity(req, res, { handler: 'doc-notices' })) return;+ if (req.method !== 'GET') {+ errorResponse(res, 405, 'urn:ok:error:method-not-allowed', 'Method not allowed.', {+ handler: 'doc-notices',+ extraHeaders: { Allow: 'GET' },+ });+ return;+ }+ try {+ const notices = docNotices === null ? [] : await docNotices.list(getBranch());+ successResponse(res, 200, DocNoticesSuccessSchema, { notices }, { handler: 'doc-notices' });+ } catch (e) {+ errorResponse(res, 500, 'urn:ok:error:internal-server-error', 'Internal server error.', {+ handler: 'doc-notices',+ cause: e,+ });+ }+ }++ const handleDismissDocNotice = withValidation(+ DismissDocNoticeRequestSchema,+ async (_req, res, body) => {+ try {+ const dismissed = docNotices?.dismiss(body.docName, body.id) ?? false;+ successResponse(+ res,+ 200,+ DismissDocNoticeSuccessSchema,+ { dismissed },+ { handler: 'doc-notice-dismiss' },+ );+ } catch (e) {+ errorResponse(res, 500, 'urn:ok:error:internal-server-error', 'Internal server error.', {+ handler: 'doc-notice-dismiss',+ cause: e,+ });+ }+ },+ {+ handler: 'doc-notice-dismiss',+ method: 'POST',+ preBodyGate: (req, res) => checkLocalOpSecurity(req, res, { handler: 'doc-notice-dismiss' }),+ },+ );++ const routes = {+ '/api/doc-notices': handleDocNotices,+ '/api/doc-notices/dismiss': handleDismissDocNotice,+ } satisfies ApiRouteRecord;++ return createApiRouteGroup(routes, { mutating: ['/api/doc-notices/dismiss'] });+}diff --git a/packages/server/src/merge-history.test.ts b/packages/server/src/merge-history.test.tsindex 5fbde9744..8b48ca7f8 100644--- a/packages/server/src/merge-history.test.ts+++ b/packages/server/src/merge-history.test.ts@@ -1,14 +1,31 @@-import { mkdirSync, mkdtempSync, realpathSync, rmSync } from 'node:fs';+import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';import { parseCheckpoint } from '@inkeep/open-knowledge-core/shadow-repo-layout';import simpleGit from 'simple-git';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import { configureTestGitRepository } from '../../../test-support/configure-git-fixture.test-helper.ts';+import { DocNoticeLedger } from './doc-notices.ts';import { createMergeHistoryRecorder } from './merge-history.ts';import { getMetrics, resetMetrics } from './metrics.ts';+import type { KeptBlockPair } from './reconciliation.ts';import { initShadowRepo, type ShadowHandle, shadowGit } from './shadow-repo.ts';+const KEPT_TWICE: KeptBlockPair = {+ blockIndex: 1,+ base: 'Shared.',+ ours: 'Shared, here.',+ theirs: 'Shared, outside.',+ landed: 'both',+};+const RESTORED: KeptBlockPair = {+ blockIndex: 2,+ base: 'Gone.',+ ours: '',+ theirs: 'Gone, changed outside.',+ landed: 'theirs',+};+describe('createMergeHistoryRecorder', () => {let tmpDir: string;@@ -35,7 +52,7 @@ describe('createMergeHistoryRecorder', () => {await expect(history.keptLive('doc', { side: 'theirs', bytes: 'outside\n' }, 'too-large'),).resolves.toBe(false);- history.bothKept('doc', { ours: 'here\n', theirs: 'outside\n' }, 1);+ history.bothKept('doc', { ours: 'here\n', theirs: 'outside\n' }, [KEPT_TWICE]);expect(getMetrics().mergeHistoryUnavailable).toBe(2);expect(getMetrics().mergeHistoryCheckpointFailures).toBe(0);@@ -67,7 +84,7 @@ describe('createMergeHistoryRecorder', () => {await expect(history.keptLive('doc', { side: 'theirs', bytes: outside }, 'check-failed'),).resolves.toBe(true);- history.bothKept('doc', { ours: 'here\n', theirs: outside }, 1);+ history.bothKept('doc', { ours: 'here\n', theirs: outside }, [KEPT_TWICE]);await vi.waitFor(() => expect(getMetrics().mergeHistoryCheckpointCreated).toBe(3));const sg = shadowGit(shadow);@@ -95,4 +112,108 @@ describe('createMergeHistoryRecorder', () => {]);expect(getMetrics().mergeHistoryCheckpointFailures).toBe(0);});++ describe('the notice on the document', () => {+ function noticesIn(dir: string): DocNoticeLedger {+ writeFileSync(join(dir, 'doc.md'), '# Doc\n');+ return new DocNoticeLedger({+ projectDir: dir,+ contentDir: dir,+ getShadow: () => undefined,+ isReady: () => true,+ signal: () => {},+ });+ }++ test('a both-kept merge raises its notice with the block counts even when no history can be written', async () => {+ const notices = noticesIn(tmpDir);+ const history = createMergeHistoryRecorder({+ getShadow: () => undefined,+ contentRoot: '',+ getBranch: () => 'main',+ notices,+ });++ history.bothKept('doc', { ours: 'here\n', theirs: 'outside\n' }, [KEPT_TWICE, RESTORED]);++ expect(await notices.list('main')).toEqual([+ expect.objectContaining({+ docName: 'doc',+ kind: 'both-kept',+ kept: { duplicated: 1, restoredDeletedHere: 1, restoredDeletedOutside: 0 },+ entries: [],+ }),+ ]);+ });++ test('a both-kept notice points at the two history entries once they are written', async () => {+ const projectRoot = join(tmpDir, 'project');+ mkdirSync(projectRoot, { recursive: true });+ await simpleGit(projectRoot).init();+ configureTestGitRepository(projectRoot);+ const shadow = await initShadowRepo(projectRoot);+ const notices = noticesIn(projectRoot);+ const history = createMergeHistoryRecorder({+ getShadow: () => shadow,+ contentRoot: '',+ getBranch: () => 'main',+ notices,+ });++ history.bothKept('doc', { ours: 'here\n', theirs: 'outside\n' }, [KEPT_TWICE]);+ await vi.waitFor(() => expect(getMetrics().mergeHistoryCheckpointCreated).toBe(2));++ const shas = (+ await shadowGit(shadow).raw(+ 'for-each-ref',+ '--format=%(objectname)',+ 'refs/checkpoints/main/',+ )+ )+ .trim()+ .split('\n');+ const [notice] = await notices.list('main');+ expect([...(notice?.entries ?? [])].sort()).toEqual([...shas].sort());+ });++ test('a kept-live refusal raises its notice only when the outside version reached history', async () => {+ const failing = noticesIn(tmpDir);+ await createMergeHistoryRecorder({+ getShadow: () => ({ gitDir: join(tmpDir, 'missing-git-dir'), workTree: tmpDir }),+ contentRoot: '',+ getBranch: () => 'main',+ notices: failing,+ }).keptLive('doc', { side: 'theirs', bytes: 'outside\n' }, 'check-failed');+ expect(await failing.list('main')).toEqual([]);++ const projectRoot = join(tmpDir, 'project');+ mkdirSync(projectRoot, { recursive: true });+ await simpleGit(projectRoot).init();+ configureTestGitRepository(projectRoot);+ const shadow = await initShadowRepo(projectRoot);+ const notices = noticesIn(projectRoot);+ await createMergeHistoryRecorder({+ getShadow: () => shadow,+ contentRoot: '',+ getBranch: () => 'main',+ notices,+ }).keptLive('doc', { side: 'ours', bytes: 'parked\n' }, 'too-large');++ const sha = (+ await shadowGit(shadow).raw(+ 'for-each-ref',+ '--format=%(objectname)',+ 'refs/checkpoints/main/',+ )+ ).trim();+ expect(await notices.list('main')).toEqual([+ expect.objectContaining({+ kind: 'moved-to-history',+ side: 'ours',+ reason: 'too-large',+ entries: [sha],+ }),+ ]);+ });+ });});diff --git a/packages/server/src/merge-history.ts b/packages/server/src/merge-history.tsindex e874bdc47..b7c64d992 100644--- a/packages/server/src/merge-history.ts+++ b/packages/server/src/merge-history.ts@@ -1,10 +1,12 @@import type { ParsedCheckpoint } from '@inkeep/open-knowledge-core/shadow-repo-layout';+import type { DocNoticeSink } from './doc-notices.ts';import { getLogger } from './logger.ts';import {incrementMergeHistoryCheckpointCreated,incrementMergeHistoryCheckpointFailures,incrementMergeHistoryUnavailable,} from './metrics.ts';+import { countKeptBlocks, type KeptBlockPair } from './reconciliation.ts';import {type InMemoryCheckpointParams,type ShadowHandle,@@ -27,7 +29,7 @@ export interface MergeHistoryRecorder {bothKept(docName: string,versions: Readonly<Record<MergeSide, string>>,- keptBlocks: number,+ kept: readonly KeptBlockPair[],): void;keptLive(docName: string,@@ -43,6 +45,7 @@ export interface MergeHistoryRecorderOptions {contentRoot: string;getBranch: () => string | null;writeCheckpoint?: MergeHistoryWriter;+ notices?: DocNoticeSink;}const log = getLogger('reconcile');@@ -56,7 +59,7 @@ export function createMergeHistoryRecorder(options: MergeHistoryRecorderOptions,): MergeHistoryRecorder {const writeCheckpoint = options.writeCheckpoint ?? saveInMemoryCheckpoint;- const write = (shadow: ShadowHandle, params: MergeHistoryParams): Promise<boolean> =>+ const write = (shadow: ShadowHandle, params: MergeHistoryParams): Promise<string | null> =>writeCheckpoint(shadow, options.contentRoot, params).then((sha) => {incrementMergeHistoryCheckpointCreated();@@ -64,7 +67,7 @@ export function createMergeHistoryRecorder({ docName: params.docName, kind: params.kind, side: params.metadata.side, sha },`[reconcile] history entry saved (${params.kind}, ${params.metadata.side}): ${params.docName}`,);- return true;+ return sha;},(err: unknown) => {incrementMergeHistoryCheckpointFailures();@@ -72,7 +75,7 @@ export function createMergeHistoryRecorder({ err, docName: params.docName, kind: params.kind, side: params.metadata.side },`[reconcile] history entry write failed (${params.kind}, ${params.metadata.side}): ${params.docName}`,);- return false;+ return null;},);@@ -85,13 +88,16 @@ export function createMergeHistoryRecorder(};return {- bothKept(docName, versions, keptBlocks) {+ bothKept(docName, versions, kept) {+ const counts = countKeptBlocks(kept);+ const branch = options.getBranch() ?? 'main';+ const noticeId =+ options.notices?.record(docName, branch, { kind: 'both-kept', kept: counts }) ?? null;const shadow = options.getShadow();if (!shadow) {unavailable(docName, 'external-change-both-kept');return;}- const branch = options.getBranch() ?? 'main';const at = new Date().toISOString();for (const side of ['ours', 'theirs'] as const) {const params: MergeHistoryParams = {@@ -100,28 +106,41 @@ export function createMergeHistoryRecorder(contents: versions[side],label: `${SIDE_LABEL[side]} before both versions were kept @ ${at}`,branch,- metadata: { side, keptBlocks },+ metadata: { side, keptBlocks: counts.duplicated },};queueMicrotask(() => {- void write(shadow, params);+ void write(shadow, params).then((sha) => {+ if (sha !== null && noticeId !== null) {+ options.notices?.attachEntry(docName, noticeId, sha);+ }+ });});}},- keptLive(docName, displaced, reason) {+ async keptLive(docName, displaced, reason) {const shadow = options.getShadow();if (!shadow) {unavailable(docName, 'external-change-kept-live');- return Promise.resolve(false);+ return false;}- return write(shadow, {+ const branch = options.getBranch() ?? 'main';+ const sha = await write(shadow, {kind: 'external-change-kept-live',docName,contents: displaced.bytes,label: `${SIDE_LABEL[displaced.side]} moved to history (${reason}) @ ${new Date().toISOString()}`,- branch: options.getBranch() ?? 'main',+ branch,metadata: { side: displaced.side, reason },});+ if (sha === null) return false;+ options.notices?.record(docName, branch, {+ kind: 'moved-to-history',+ side: displaced.side,+ reason,+ entry: sha,+ });+ return true;},};}diff --git a/packages/server/src/reconciliation.fidelity.test.ts b/packages/server/src/reconciliation.fidelity.test.tsindex 5a058bf69..511ff3e4f 100644--- a/packages/server/src/reconciliation.fidelity.test.ts+++ b/packages/server/src/reconciliation.fidelity.test.ts@@ -2,8 +2,8 @@ import { MarkdownManager, sharedExtensions } from '@inkeep/open-knowledge-core';import { describe, expect, test } from 'vitest';import { getMetrics } from './metrics';import {- blocksKeptTwice,checkMergeOutput,+ countKeptBlocks,MAX_CONSTRUCT_CHECK_BYTES,MAX_LCS_CELLS,reconcile,@@ -448,7 +448,7 @@ describe('a block both sides changed keeps both versions, ours first', () => {});if (outcome.kind !== 'both-kept') return;expect(outcome.kept.map((pair) => pair.landed)).toEqual(['both', 'theirs']);- expect(blocksKeptTwice(outcome.kept)).toBe(1);+ expect(countKeptBlocks(outcome.kept).duplicated).toBe(1);});test("the check accepts both versions and refuses an output that drops or alters theirs' version", () => {diff --git a/packages/server/src/reconciliation.ts b/packages/server/src/reconciliation.tsindex 1cdba876b..630c273f6 100644--- a/packages/server/src/reconciliation.ts+++ b/packages/server/src/reconciliation.ts@@ -43,10 +43,6 @@ export function countKeptBlocks(kept: readonly KeptBlockPair[]): KeptBlockCountsreturn { duplicated, restoredDeletedHere, restoredDeletedOutside };}-export function blocksKeptTwice(kept: readonly KeptBlockPair[]): number {- return countKeptBlocks(kept).duplicated;-}-export type ReconcileRefusalReason = 'conflict-markers' | 'no-base' | 'too-large' | 'check-failed';type MergeSide = 'ours' | 'theirs';diff --git a/packages/server/src/server-factory.ts b/packages/server/src/server-factory.tsindex b2c9fa06a..0882cd70d 100644--- a/packages/server/src/server-factory.ts+++ b/packages/server/src/server-factory.ts@@ -131,6 +131,7 @@ import {stripDocExtension,} from './doc-extensions.ts';import { runDocLineageGuard } from './doc-lineage-guard.ts';+import { DocNoticeLedger } from './doc-notices.ts';import {DocumentDurabilityState,type StaleExternalWriteConflict,@@ -261,7 +262,7 @@ import {} from './persistence-staleness-watchdog.ts';import { loadPrincipal } from './principal.ts';import { RecentlyRemovedDocs } from './recently-removed-docs.ts';-import { blocksKeptTwice, type ReconcileOutcome, reconcile } from './reconciliation.ts';+import { type ReconcileOutcome, reconcile } from './reconciliation.ts';import { reconcileRecoveredFileTarget } from './recovered-file-target.ts';import { runRemovalRedirectGuard } from './removal-redirect-guard.ts';import { loadRemovedDocsJournal, saveRemovedDocsJournal } from './removed-docs-journal.ts';@@ -1239,6 +1240,20 @@ export function createServer(options: ServerOptions): ServerInstance {resolveReady = res;rejectReady = rej;});+ let readyForNotices = false;+ void ready.then(+ () => {+ readyForNotices = true;+ },+ () => {},+ );+ const docNotices = new DocNoticeLedger({+ projectDir,+ contentDir,+ getShadow: () => shadowRef?.current,+ isReady: () => readyForNotices,+ signal: () => cc1Broadcaster?.signal('sync-status'),+ });const offlineRemovalsReconciled = Promise.withResolvers<void>();let resolveBranchScopeAligned!: () => void;@@ -2534,6 +2549,7 @@ export function createServer(options: ServerOptions): ServerInstance {const apiExtension = createApiExtension({mergeHistoryWriter: options.mergeHistoryWriter,+ docNotices,declaredGitHubHosts,resolveSyncCredentialConfig,hocuspocus,@@ -2882,6 +2898,7 @@ export function createServer(options: ServerOptions): ServerInstance {contentRoot: contentRoot ?? '',getBranch: getStorageBranch,writeCheckpoint: options.mergeHistoryWriter,+ notices: docNotices,});const CHECKPOINT_KIND_BY_MINT_SITE = {@@ -3231,7 +3248,7 @@ export function createServer(options: ServerOptions): ServerInstance {});break;}- mergeHistory.bothKept(docName, { ours, theirs }, blocksKeptTwice(result.kept));+ mergeHistory.bothKept(docName, { ours, theirs }, result.kept);setReconciledBase(docName, theirs);incrementReconcile();reportReconcileBothKept(docName, result.kept, 'watcher');@@ -5041,7 +5058,7 @@ export function createServer(options: ServerOptions): ServerInstance {mergeHistory.bothKept(docName,{ ours: parked.markdown, theirs: currentDisk },- blocksKeptTwice(outcome.kept),+ outcome.kept,);reportReconcileBothKept(docName, outcome.kept, 'branch-switch');restoredCount++;