Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
fix(ok): make the sent doc chip open the doc (PRD-8010) (#4460)
Abraham07086c3fee77
diff --git a/.changeset/sent-doc-chip-opens-the-doc.md b/.changeset/sent-doc-chip-opens-the-doc.mdnew file mode 100644index 000000000..4e16b8f9f--- /dev/null+++ b/.changeset/sent-doc-chip-opens-the-doc.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++An `@doc` chip in a sent message now opens the doc it names, and looks like a link before you hover it. Chips for folders, non-docs, and docs no longer in the project stay inert.diff --git a/docs/content/features/editor.mdx b/docs/content/features/editor.mdxindex 827e3ff29..aacb8d937 100644--- a/docs/content/features/editor.mdx+++ b/docs/content/features/editor.mdx@@ -124,7 +124,7 @@ An **Ask AI** composer is docked at the bottom of the editor — in the desktopIt's the primary in-editor way to hand work to an agent, and the freetext companion to the menu-driven [Open with AI](#open-with-ai) (whole file / folder / project). Submitting dispatches the typed prompt to your **default agent**, scoped to the current doc (or, in a folder view, the folder), which the agent receives as an `@`-mention. Until you pick something else, that default is an **In app** agent, so the conversation stays inside OpenKnowledge; it falls back to a **Terminal** CLI — preferring one detected on this machine — and then to an **External app**, when no higher option is available here. The agent picker beside the field overrides the default per send, listing In app agents first, then the [Terminal](#open-with-ai) CLIs available on this machine, then the external agent apps detected here. Whatever you pick is remembered on that machine and stays your default until you change it or turn it off in **Agent connections**. Success and failure use the same handoff toast as Open with AI.-The field also takes attachments when an **In app** agent is selected: drop a file on it, paste a screenshot into it, or use the attach button beside the field. Each one appears as a removable chip above the input and travels with the prompt into the new conversation. Images can come from anywhere; other files are sent as a path reference, so they have to live inside the project. Images must be PNG, JPEG, GIF, or WebP, and all attachments on one message are capped at 700 KB combined. That budget is tight for screenshots — a full-screen Retina capture is usually several megabytes and will be refused, so crop the capture or resize it first. Pick a **Terminal** CLI or an **External app** instead and the composer refuses the drop with the reason — those targets have no attachment channel — and if you attach first and switch afterwards, the send is blocked with the same explanation rather than silently dropping the file. Attachments aren't available in note windows yet, and whether an in-app agent can actually read an image is up to that agent: if it can't, OpenKnowledge shows a notification saying so once the agent's capabilities are known. The empty-state create composer on a fresh project takes attachments the same way — drop, paste, or the attach button while an **In app** agent is picked — and refuses them with the reason for **Terminal** and **External apps** targets.+The field also takes attachments when an **In app** agent is selected: drop a file on it, paste a screenshot into it, or use the attach button beside the field. Each one appears as a removable chip above the input and travels with the prompt into the new conversation. Once the prompt is sent, the chip for a doc that's still in the project opens that doc. Images can come from anywhere; other files are sent as a path reference, so they have to live inside the project. Images must be PNG, JPEG, GIF, or WebP, and all attachments on one message are capped at 700 KB combined. That budget is tight for screenshots — a full-screen Retina capture is usually several megabytes and will be refused, so crop the capture or resize it first. Pick a **Terminal** CLI or an **External app** instead and the composer refuses the drop with the reason — those targets have no attachment channel — and if you attach first and switch afterwards, the send is blocked with the same explanation rather than silently dropping the file. Attachments aren't available in note windows yet, and whether an in-app agent can actually read an image is up to that agent: if it can't, OpenKnowledge shows a notification saying so once the agent's capabilities are known. The empty-state create composer on a fresh project takes attachments the same way — drop, paste, or the attach button while an **In app** agent is picked — and refuses them with the reason for **Terminal** and **External apps** targets.The composer stays out of the way where it doesn't belong: it's hidden inside an AI editor's embedded view, while the [docked terminal](#terminal) is open (the terminal is its own AI entry point), and when no doc or folder is open (the empty state's create composer offers the same handoff, attachments included). It's also dismissible — an **Ask AI** badge in the status bar brings it back.diff --git a/knip.config.ts b/knip.config.tsindex dd620604a..e902b1013 100644--- a/knip.config.ts+++ b/knip.config.ts@@ -142,11 +142,15 @@ export default {'packages/server': {entry: ['src/**/*.test.ts', 'src/parse-worker.ts'],project: 'src/**',- ignoreDependencies: ['@types/shell-quote'],+ ignoreDependencies: [+ '@types/shell-quote',+ ],},'packages/cli': {entry: ['src/**/*.test.ts', 'scripts/*.ts', 'tests/**/*.ts', 'src/parse-worker.ts'],- ignoreDependencies: ['yjs'],+ ignoreDependencies: [+ 'yjs',+ ],},'packages/desktop': {entry: [diff --git a/packages/app/src/components/acp/ThreadView.tsx b/packages/app/src/components/acp/ThreadView.tsxindex 39fc77fc2..71cc05938 100644--- a/packages/app/src/components/acp/ThreadView.tsx+++ b/packages/app/src/components/acp/ThreadView.tsx@@ -146,7 +146,7 @@ import {} from '@/lib/acp/thread-event-model';import { describeToolCall, type ToolCallGlyph } from '@/lib/acp/tool-call-display';import { toolFailureHint } from '@/lib/acp/tool-failure-hint';-import { docNameFromHash, hashFromDocName } from '@/lib/doc-hash';+import { docNameFromHash, filePathToDocName, hashFromDocName } from '@/lib/doc-hash';import { dispatchExternalLinkClick } from '@/lib/external-link';import { isOverlayLayerOpen } from '@/lib/overlay-layers';import { scheduleClipboardWrite } from '@/lib/share/clipboard-adapter';@@ -2476,7 +2476,9 @@ function UserMessageAttachments({}: {attachments: readonly AttachmentPart[];}): ReactNode {+ const { t } = useLingui();const openPreview = use(ImagePreviewContext);+ const pages = useOptionalPageList()?.pages ?? null;return (<divclassName="mt-1.5 flex flex-wrap justify-end gap-1.5"@@ -2519,6 +2521,21 @@ function UserMessageAttachments({</span>);}+ const label = `@${attachment.name || attachment.path}`;+ const docName = attachment.kind === 'file' ? filePathToDocName(attachment.path) : null;+ if (docName !== null && docName !== attachment.path && pages?.has(docName) === true) {+ return (+ <a+ key={key}+ href={hashFromDocName(docName)}+ className="composer-mention-chip text-primary! underline decoration-primary/40 underline-offset-2 hover:decoration-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"+ title={t`Open ${docName}`}+ data-attachment-kind={attachment.kind}+ >+ <span className="composer-mention-label">{label}</span>+ </a>+ );+ }return (<spankey={key}@@ -2526,7 +2543,7 @@ function UserMessageAttachments({title={attachment.path}data-attachment-kind={attachment.kind}>- <span className="composer-mention-label">@{attachment.name || attachment.path}</span>+ <span className="composer-mention-label">{label}</span></span>);})}diff --git a/packages/app/src/components/acp/ThreadView.user-message-actions.dom.test.tsx b/packages/app/src/components/acp/ThreadView.user-message-actions.dom.test.tsxindex 0dd7f5587..b29b5b9a7 100644--- a/packages/app/src/components/acp/ThreadView.user-message-actions.dom.test.tsx+++ b/packages/app/src/components/acp/ThreadView.user-message-actions.dom.test.tsx@@ -4,6 +4,7 @@ import userEvent from '@testing-library/user-event';import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';import { TooltipProvider } from '@/components/ui/tooltip';import type { RenderedItem, ThreadRenderModel } from '@/lib/acp/thread-event-model';+import type { Workspace } from '@/lib/workspace-paths';import { MockComposerMentionInput } from './composer-mention-input.test-helper';const render = (ui: Parameters<typeof rtlRender>[0]) => rtlRender(ui, { wrapper: TooltipProvider });@@ -96,8 +97,16 @@ vi.doMock('@/editor/DocumentContext', () => ({useDocumentContext: () => ({ systemProvider: null }),}));+let workspace: Workspace | null = null;+let pageList: { pages: ReadonlySet<string>; loading: boolean } | null = null;+vi.doMock('@/lib/use-workspace', () => ({- useWorkspace: () => null,+ useWorkspace: () => workspace,+}));++vi.doMock('@/components/PageListContext', async (importOriginal) => ({+ ...(await importOriginal<typeof import('@/components/PageListContext')>()),+ useOptionalPageList: () => pageList,}));vi.doMock('@/components/acp/AgentMarkdown', () => ({@@ -174,6 +183,8 @@ afterEach(() => {resumeThread.mockClear();createThread.mockClear();model = null;+ workspace = null;+ pageList = null;});describe('sent-message actions', () => {@@ -567,3 +578,94 @@ describe('discoverability of the newest turn', () => {expect(rows[1]?.className).not.toContain('opacity-0');});});++describe('a sent attachment chip', () => {+ const projectWorkspace: Workspace = { contentDir: '/Users/me/docs', pathSeparator: '/' };++ function attachmentRow(): HTMLElement {+ return screen.getByTestId('agent-thread-user-message-attachments');+ }++ test('a chip for a doc in the project opens that doc', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['guides/setup']), loading: false };+ mountWith([+ userMessage({ attachments: [{ kind: 'file', path: 'guides/setup.md', name: 'Setup' }] }),+ ]);+ expect(screen.getByRole('link', { name: '@Setup' }).getAttribute('href')).toBe(+ '#/guides/setup',+ );+ });++ test('a chip opens its doc before the workspace location is known', () => {+ pageList = { pages: new Set(['guides/setup']), loading: false };+ mountWith([+ userMessage({ attachments: [{ kind: 'file', path: 'guides/setup.md', name: 'Setup' }] }),+ ]);+ expect(screen.getByRole('link', { name: '@Setup' }).getAttribute('href')).toBe(+ '#/guides/setup',+ );+ });++ test('a chip opens the doc that was picked, not a same-named doc at the project root', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['intro', 'docs/intro']), loading: false };+ mountWith([+ userMessage({ attachments: [{ kind: 'file', path: 'docs/intro.md', name: 'Intro' }] }),+ ]);+ expect(screen.getByRole('link', { name: '@Intro' }).getAttribute('href')).toBe('#/docs/intro');+ });++ test('a dropped .mdx file opens its doc', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['guides/intro']), loading: false };+ mountWith([+ userMessage({+ attachments: [{ kind: 'file', path: 'guides/intro.mdx', name: 'intro.mdx' }],+ }),+ ]);+ expect(screen.getByRole('link', { name: '@intro.mdx' }).getAttribute('href')).toBe(+ '#/guides/intro',+ );+ });++ test('a chip whose doc is gone is not a link, even when another folder has a doc of that name', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['archive/notes']), loading: false };+ mountWith([+ userMessage({ attachments: [{ kind: 'file', path: 'notes.md', name: 'notes.md' }] }),+ ]);+ expect(within(attachmentRow()).getByText('@notes.md')).toBeDefined();+ expect(within(attachmentRow()).queryByRole('link')).toBeNull();+ });++ test('a chip for a file that is not a doc is not a link, even beside a doc of the same name', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['images/diagram']), loading: false };+ mountWith([+ userMessage({+ attachments: [{ kind: 'file', path: 'images/diagram.png', name: 'diagram.png' }],+ }),+ ]);+ expect(within(attachmentRow()).getByText('@diagram.png')).toBeDefined();+ expect(within(attachmentRow()).queryByRole('link')).toBeNull();+ });++ test('a folder chip is not a link', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(['guides/setup']), loading: false };+ mountWith([userMessage({ attachments: [{ kind: 'folder', path: 'guides', name: 'guides' }] })]);+ expect(within(attachmentRow()).getByText('@guides')).toBeDefined();+ expect(within(attachmentRow()).queryByRole('link')).toBeNull();+ });++ test('no chip is a link before the page list has loaded', () => {+ workspace = projectWorkspace;+ pageList = { pages: new Set(), loading: true };+ mountWith([+ userMessage({ attachments: [{ kind: 'file', path: 'guides/setup.md', name: 'Setup' }] }),+ ]);+ expect(within(attachmentRow()).getByText('@Setup')).toBeDefined();+ expect(within(attachmentRow()).queryByRole('link')).toBeNull();+ });+});diff --git a/packages/app/src/lib/doc-hash.test.ts b/packages/app/src/lib/doc-hash.test.tsindex c54917fc0..daa8e625d 100644--- a/packages/app/src/lib/doc-hash.test.ts+++ b/packages/app/src/lib/doc-hash.test.ts@@ -6,6 +6,7 @@ import {docNameFromHash,encodeShareTargetForHash,encodeSkillPreviewSegments,+ filePathToDocName,hashFromAssetPath,hashFromDocName,hashFromFolderPath,@@ -673,3 +674,24 @@ describe('skill-preview hash', () => {expect(docNameFromHash(hash)).toBeNull();});});++describe('filePathToDocName', () => {+ test('strips a markdown extension', () => {+ expect(filePathToDocName('notes.md')).toBe('notes');+ expect(filePathToDocName('guide.mdx')).toBe('guide');+ expect(filePathToDocName('docs/nested/intro.md')).toBe('docs/nested/intro');+ });++ test('strips an uppercase extension and leaves the stem case alone', () => {+ expect(filePathToDocName('NOTES.MD')).toBe('NOTES');+ expect(filePathToDocName('docs/Guide.MDX')).toBe('docs/Guide');+ expect(filePathToDocName('ReadMe.Md')).toBe('ReadMe');+ });++ test('leaves a path it does not own unchanged', () => {+ expect(filePathToDocName('diagram.png')).toBe('diagram.png');+ expect(filePathToDocName('notes.markdown')).toBe('notes.markdown');+ expect(filePathToDocName('mdx')).toBe('mdx');+ expect(filePathToDocName('')).toBe('');+ });+});diff --git a/packages/app/src/lib/doc-hash.ts b/packages/app/src/lib/doc-hash.tsindex 2394d6b2e..513ee4cd5 100644--- a/packages/app/src/lib/doc-hash.ts+++ b/packages/app/src/lib/doc-hash.ts@@ -104,8 +104,9 @@ export function pushHashWithoutNavigation(hash: string): void {}export function filePathToDocName(filePath: string): string {- if (filePath.endsWith('.mdx')) return filePath.slice(0, -4);- if (filePath.endsWith('.md')) return filePath.slice(0, -3);+ const lower = filePath.toLowerCase();+ if (lower.endsWith('.mdx')) return filePath.slice(0, -4);+ if (lower.endsWith('.md')) return filePath.slice(0, -3);return filePath;}diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.poindex 9884795f6..f168a3984 100644--- a/packages/app/src/locales/ar/messages.po+++ b/packages/app/src/locales/ar/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "فتح {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "فتح {docName}"diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.poindex 64b5e2454..09138bdfa 100644--- a/packages/app/src/locales/bn/messages.po+++ b/packages/app/src/locales/bn/messages.po@@ -9583,6 +9583,7 @@ msgid "Open {displayName} Desktop"msgstr "{displayName} Desktop খুলুন"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "{docName} খুলুন"diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex ccd086eb1..805a39e73 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "Open {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "Open {docName}"diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.poindex f6a356398..ad57e3a78 100644--- a/packages/app/src/locales/es/messages.po+++ b/packages/app/src/locales/es/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "Abrir {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "Abrir {docName}"diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.poindex dee0cd1bd..f970d1f57 100644--- a/packages/app/src/locales/fr/messages.po+++ b/packages/app/src/locales/fr/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "Ouvrir {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "Ouvrir {docName}"diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.poindex d29de40c9..04da7ae0d 100644--- a/packages/app/src/locales/hi/messages.po+++ b/packages/app/src/locales/hi/messages.po@@ -9583,6 +9583,7 @@ msgid "Open {displayName} Desktop"msgstr "{displayName} Desktop खोलें"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "{docName} खोलें"diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.poindex 3357b1346..af24976d8 100644--- a/packages/app/src/locales/id/messages.po+++ b/packages/app/src/locales/id/messages.po@@ -9583,6 +9583,7 @@ msgid "Open {displayName} Desktop"msgstr "Buka {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "Buka {docName}"diff --git a/packages/app/src/locales/ko/messages.po b/packages/app/src/locales/ko/messages.poindex 6faf21190..2cb7ccfe6 100644--- a/packages/app/src/locales/ko/messages.po+++ b/packages/app/src/locales/ko/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "{displayName} Desktop 열기"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "{docName} 열기"diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex 6b7ed57e3..20abc01d7 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -9583,6 +9583,7 @@ msgid "Open {displayName} Desktop"msgstr ""#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr ""diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.poindex 4a5afa9d7..cc29a86df 100644--- a/packages/app/src/locales/pt-BR/messages.po+++ b/packages/app/src/locales/pt-BR/messages.po@@ -9583,6 +9583,7 @@ msgid "Open {displayName} Desktop"msgstr "Abrir {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "Abrir {docName}"diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.poindex cb2428943..b1f92fa54 100644--- a/packages/app/src/locales/ur/messages.po+++ b/packages/app/src/locales/ur/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "{displayName} Desktop کھولیں"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "{docName} کھولیں"diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.poindex ca5da30a9..13d5ffdd4 100644--- a/packages/app/src/locales/zh-Hans/messages.po+++ b/packages/app/src/locales/zh-Hans/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "打开 {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "打开 {docName}"diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.poindex 16555fe2a..20315d69a 100644--- a/packages/app/src/locales/zh-Hant/messages.po+++ b/packages/app/src/locales/zh-Hant/messages.po@@ -9587,6 +9587,7 @@ msgid "Open {displayName} Desktop"msgstr "開啟 {displayName} Desktop"#: src/components/acp/AgentMarkdown.tsx+#: src/components/acp/ThreadView.tsxmsgid "Open {docName}"msgstr "開啟 {docName}"diff --git a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts b/packages/app/tests/integration/bug3-source-mode-writeback.test.tsindex 8a60e5826..a28cc2b18 100644--- a/packages/app/tests/integration/bug3-source-mode-writeback.test.ts+++ b/packages/app/tests/integration/bug3-source-mode-writeback.test.ts@@ -1,3 +1,4 @@+import { readFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts b/packages/app/tests/integration/indented-jsx-byte-sacred.test.tsindex 6fcdc23f2..4fc2c11f9 100644--- a/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts+++ b/packages/app/tests/integration/indented-jsx-byte-sacred.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { normalizeBridge } from '@inkeep/open-knowledge-core';import { updateYFragment } from '@tiptap/y-tiptap';diff --git a/packages/app/tests/integration/interior-edit-freshness.test.ts b/packages/app/tests/integration/interior-edit-freshness.test.tsindex 40b5cdfd6..9f2f6feb6 100644--- a/packages/app/tests/integration/interior-edit-freshness.test.ts+++ b/packages/app/tests/integration/interior-edit-freshness.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts b/packages/app/tests/integration/keystroke-cadence-danger-space.test.tsindex 93666af70..2a085742b 100644--- a/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts+++ b/packages/app/tests/integration/keystroke-cadence-danger-space.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/producer-guard-wiring.test.ts b/packages/app/tests/integration/producer-guard-wiring.test.tsindex 867598d34..878d5196b 100644--- a/packages/app/tests/integration/producer-guard-wiring.test.ts+++ b/packages/app/tests/integration/producer-guard-wiring.test.ts@@ -1,3 +1,4 @@+import { setTimeout as wait } from 'node:timers/promises';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';import { afterAll, beforeAll, describe, expect, test } from 'vitest';diff --git a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.tsindex 0970ac12f..4ada3cf26 100644--- a/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts+++ b/packages/app/tests/integration/qa-039-reconciliation-counters-http.test.ts@@ -1,3 +1,4 @@+import { randomUUID } from 'node:crypto';import { afterEach, describe, expect, test } from 'vitest';import { agentWriteMd, createTestServer, type TestServer } from './test-harness';diff --git a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts b/packages/app/tests/integration/qa-045-restore-after-gc.test.tsindex b632185e1..cbe2b705f 100644--- a/packages/app/tests/integration/qa-045-restore-after-gc.test.ts+++ b/packages/app/tests/integration/qa-045-restore-after-gc.test.ts@@ -1,3 +1,4 @@+import { execFileSync } from 'node:child_process';import { randomUUID } from 'node:crypto';import { join } from 'node:path';diff --git a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.tsindex c530ce4ba..89bc9b4d9 100644--- a/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts+++ b/packages/app/tests/integration/qa-050-rollback-undo-shipped-path.test.ts@@ -1,3 +1,4 @@+import { randomUUID } from 'node:crypto';import { afterAll, afterEach, beforeAll, describe, expect, test } from 'vitest';import type * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-after-rollback.test.ts b/packages/app/tests/integration/undo-after-rollback.test.tsindex d3767adc9..a78aeb0e4 100644--- a/packages/app/tests/integration/undo-after-rollback.test.ts+++ b/packages/app/tests/integration/undo-after-rollback.test.ts@@ -1,3 +1,4 @@+import { ROLLBACK_ORIGIN } from '@inkeep/open-knowledge-server';import { afterAll, beforeAll, describe, expect, test } from 'vitest';import * as Y from 'yjs';diff --git a/packages/app/tests/integration/undo-recycle-reset.test.ts b/packages/app/tests/integration/undo-recycle-reset.test.tsindex b076f955c..e7cc69c3f 100644--- a/packages/app/tests/integration/undo-recycle-reset.test.ts+++ b/packages/app/tests/integration/undo-recycle-reset.test.ts@@ -1,3 +1,4 @@+import { writeFileSync } from 'node:fs';import { join } from 'node:path';import { setTimeout as wait } from 'node:timers/promises';diff --git a/packages/app/tests/integration/undo-rederive-survival.test.ts b/packages/app/tests/integration/undo-rederive-survival.test.tsindex 7935e35f8..9ddcd0730 100644--- a/packages/app/tests/integration/undo-rederive-survival.test.ts+++ b/packages/app/tests/integration/undo-rederive-survival.test.ts@@ -1,3 +1,4 @@+import { prependFrontmatter } from '@inkeep/open-knowledge-core';import { Plugin, PluginKey } from '@tiptap/pm/state';import { updateYFragment, yXmlFragmentToProseMirrorRootNode } from '@tiptap/y-tiptap';diff --git a/packages/core/src/bridge/compose.ts b/packages/core/src/bridge/compose.tsindex f4cc8a286..2a597ec3d 100644--- a/packages/core/src/bridge/compose.ts+++ b/packages/core/src/bridge/compose.ts@@ -1,3 +1,4 @@+import { prependFrontmatter, stripFrontmatter } from '../extensions/frontmatter.ts';export type ComposeAdjustment = 'none' | 'body' | 'frontmatter' | 'unresolved';diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.tsindex 8fb428b90..01ef76a9f 100644--- a/packages/core/src/bridge/doc-boundary-space.ts+++ b/packages/core/src/bridge/doc-boundary-space.ts@@ -1,3 +1,4 @@+import { FRONTMATTER_RE, stripFrontmatter } from '../extensions/frontmatter.ts';import { carriedEdgeEmpties, type DocEdgeEmpties } from '../markdown/doc-edge-blank-runs.ts';diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.tsindex bfbd5a2e8..20a68d2a1 100644--- a/packages/core/src/markdown/comment-promoter.ts+++ b/packages/core/src/markdown/comment-promoter.ts@@ -1,3 +1,4 @@+import type { Nodes, Paragraph, PhrasingContent, Root, RootContent, Text } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.tsindex bfd7e3109..fa3cfcd86 100644--- a/packages/core/src/markdown/merged-walker.ts+++ b/packages/core/src/markdown/merged-walker.ts@@ -1,3 +1,4 @@+import type { Nodes, Parent, Root } from 'mdast';import { SKIP, visit } from 'unist-util-visit';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/safe-url.ts b/packages/core/src/markdown/safe-url.tsindex 4d3250d3a..8be632ba4 100644--- a/packages/core/src/markdown/safe-url.ts+++ b/packages/core/src/markdown/safe-url.ts@@ -1,3 +1,4 @@+export const SAFE_URL_SCHEMES = ['https', 'http', 'mailto', 'tel', 'ftp', 'sms'] as const;const SCHEME_ALT = SAFE_URL_SCHEMES.map((s) => `${s}:`).join('|');