Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
feat(open-knowledge): grouped "what gets created" seed preview (#2493)
sarah7a550572b1df
diff --git a/.changeset/seed-preview-grouped-sections.md b/.changeset/seed-preview-grouped-sections.mdnew file mode 100644index 000000000..332737826--- /dev/null+++ b/.changeset/seed-preview-grouped-sections.md@@ -0,0 +1,5 @@+---+"@inkeep/open-knowledge": patch+---++Redesign the "What gets created" preview in the Initialize dialog so it's easier to read at a glance. The preview now groups what a starter pack scaffolds into clear **Folders**, **Files**, and **Skill** sections, each row showing the item's name and a one-line description of what it's for. The old collapsible file tree (which also exposed internal `.ok/` paths) is gone — the sections carry the same information more legibly. Hovering or focusing a folder's template count now reveals the names of the templates it installs.diff --git a/packages/app/src/components/CreatedItemsList.dom.test.tsx b/packages/app/src/components/CreatedItemsList.dom.test.tsxindex f54305359..46a05fa90 100644--- a/packages/app/src/components/CreatedItemsList.dom.test.tsx+++ b/packages/app/src/components/CreatedItemsList.dom.test.tsx@@ -1,6 +1,7 @@import { afterEach, describe, expect, mock, test } from 'bun:test';import { cleanup, render, screen } from '@testing-library/react';import type { ReactNode } from 'react';+import { TooltipProvider } from '@/components/ui/tooltip';import type { OkScaffoldPlan, OkSeedPackInfo } from '@/lib/desktop-bridge-types';import { renderLinguiTemplate } from '@/test-utils/lingui-mock';@@ -27,7 +28,13 @@ function pack(folders: Array<{ path: string; summary: string }>): OkSeedPackInfoasync function renderList(plan: OkScaffoldPlan, selectedPack: OkSeedPackInfo) {const { CreatedItemsList } = await import('./CreatedItemsList');- render(<CreatedItemsList plan={plan} selectedPack={selectedPack} />);+ // Folder rows with templates render a tooltip trigger, which needs the+ // TooltipProvider the app installs at its root (main.tsx).+ render(+ <TooltipProvider>+ <CreatedItemsList plan={plan} selectedPack={selectedPack} />+ </TooltipProvider>,+ );}/** The folder-count summary span renders as `<n> <label>` (e.g. "3 folders"). */diff --git a/packages/app/src/components/CreatedItemsList.tsx b/packages/app/src/components/CreatedItemsList.tsxindex eb8c9b231..4e9de2082 100644--- a/packages/app/src/components/CreatedItemsList.tsx+++ b/packages/app/src/components/CreatedItemsList.tsx@@ -1,34 +1,29 @@import { plural } from '@lingui/core/macro';import { Trans, useLingui } from '@lingui/react/macro';-import { ChevronDown, File, Folder, Hexagon } from 'lucide-react';-import { Fragment, useState } from 'react';-import { Button } from '@/components/ui/button';-import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';+import { File, Folder, Hexagon, type LucideIcon } from 'lucide-react';+import { Fragment } from 'react';+import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';import type { OkScaffoldPlan, OkSeedPackInfo } from '@/lib/desktop-bridge-types';import { skillDisplayName } from '@/lib/skill-scope';-import { cn } from '@/lib/utils';--interface CreatedItem {- kind: 'folder' | 'file';- name: string;-}function basename(path: string): string {return path.split('/').pop() ?? path;}/**- * A top-level folder to preview as a card. `templateCount` is the number of+ * A top-level folder to preview as a row. `templateCount` is the number of* starter/extra templates the plan installs into `<folder>/.ok/templates/`.*/interface FolderCard {path: string;summary: string;templateCount: number;+ /** Basenames of the templates installed into this folder's `.ok/templates/`. */+ templates: string[];}/**- * One card per pack folder actually being scaffolded. `templateCount` is the+ * One entry per pack folder actually being scaffolded. `templateCount` is the* number of templates the plan installs into that folder's `.ok/templates/`.* Derived from the plan we already fetched — no second round-trip — and honest* about re-scaffold: a fully-present folder (all in `skipped`) drops out.@@ -44,11 +39,14 @@ function describeFolderCards(// share one lookup without a bare `includes` false-matching a folder whose// name is a suffix of another (`notes` vs `keynotes`).const templatesNeedle = `${folder.path}/.ok/templates/`;- const templateCount = plan.created.filter(- (e) =>- e.kind === 'file' &&- (e.path.startsWith(templatesNeedle) || e.path.includes(`/${templatesNeedle}`)),- ).length;+ const templates = plan.created+ .filter(+ (e) =>+ e.kind === 'file' &&+ (e.path.startsWith(templatesNeedle) || e.path.includes(`/${templatesNeedle}`)),+ )+ .map((e) => basename(e.path));+ const templateCount = templates.length;// A folder whose directory is being created OR whose templates are being// (re)installed is in-scope; one that's fully present (all in `skipped`)// isn't part of "what gets created", so it drops out.@@ -56,7 +54,7 @@ function describeFolderCards((e) => e.kind === 'folder' && (e.path === folder.path || e.path.endsWith(`/${folder.path}`)),);if (templateCount > 0 || folderCreated) {- folders.push({ path: folder.path, summary: folder.summary, templateCount });+ folders.push({ path: folder.path, summary: folder.summary, templateCount, templates });}}return folders;@@ -73,13 +71,27 @@ function describeFileCards(plan: OkScaffoldPlan): Array<{ path: string; name: st.map((e) => ({ path: e.path, name: basename(e.path) }));}+/** One preview row — a folder, root file, or the pack skill. */+interface PreviewRow {+ key: string;+ icon: LucideIcon;+ name: string;+ title?: string;+ pill?: string;+ /** When set, the pill reveals these names (the folder's templates) on hover/focus. */+ pillTooltip?: string[];+ description?: string;+}+/**- * Renders `plan.created` as a card grid — folder / file / skill cards, each led- * by its type icon (no badge; the icon plus the folder trailing-slash carry the- * type). The summary line breaks the plan into the counts a user can actually- * observe in the app — folders, files, skill, templates — keeping templates- * distinct from files. The full nested layout lives behind a "Files & folders"- * disclosure; the folder cards above carry the human-readable summaries.+ * Renders `plan.created` grouped into typed sections — Folders, Files, Skill —+ * each a scannable list of rows. A row leads with a full-height icon block+ * (icon + folder trailing-slash carry the type — never color alone), then the+ * name, an optional count pill (folders' template count), and the human-readable+ * summary inline. The top summary header breaks the plan into the counts a user+ * can actually observe in the app — folders, files, skill, templates. Only+ * user-visible paths surface; `.ok/` internals (templates, frontmatter) never+ * appear.*/export function CreatedItemsList({plan,@@ -89,14 +101,13 @@ export function CreatedItemsList({selectedPack: OkSeedPackInfo | undefined;}) {const { t } = useLingui();- const [treeOpen, setTreeOpen] = useState(false);const folders = describeFolderCards(plan, selectedPack);const files = describeFileCards(plan);const skill = plan.packSkill?.pending ? plan.packSkill : undefined;- // Derive the counts straight from the cards so the summary line always+ // Derive the counts straight from the rows so the summary line always// matches what's rendered. Counting `plan.created` directly diverged in// subfolder mode, where the plan also creates the parent folder (e.g.- // `brain/`) — a real folder entry with no card, which read as one extra.+ // `brain/`) — a real folder entry with no row, which read as one extra.const folderCount = folders.length;const fileCount = files.length;const templateCount = folders.reduce((sum, f) => sum + f.templateCount, 0);@@ -155,13 +166,70 @@ export function CreatedItemsList({: null,].filter((c): c is { key: string; n: number; label: string } => c !== null);+ // Rows are grouped into their own sections (Folders / Files / Skill) rather+ // than one flat list. Every row is a leaf the user will actually see in the+ // sidebar; `.ok/` internals are filtered out upstream. `pill` is the count+ // badge — folders carry their template count; files and the skill carry none+ // (the section header already names the type, so a "Skill" pill is redundant).+ const folderRows: PreviewRow[] = folders.map((folder) => ({+ key: `folder:${folder.path}`,+ icon: Folder,+ name: `${basename(folder.path)}/`,+ pill:+ folder.templateCount > 0+ ? t`${plural(folder.templateCount, { one: '# template', other: '# templates' })}`+ : undefined,+ pillTooltip: folder.templateCount > 0 ? folder.templates : undefined,+ description: folder.summary || undefined,+ }));+ const fileRows: PreviewRow[] = files.map((file) => ({+ key: `file:${file.path}`,+ icon: File,+ name: file.name,+ title: file.name,+ description: fileDescriptions[file.name],+ }));+ const skillRows: PreviewRow[] = skill+ ? [+ {+ key: `skill:${skill.name}`,+ icon: Hexagon,+ // Drop the shared `open-knowledge-pack-` prefix (identical across+ // packs, non-distinguishing) so the name reads + fits; full name+ // stays on hover.+ name: skillDisplayName(skill.name),+ title: skill.name,+ description: t`Guides your AI agents on how to work here.`,+ },+ ]+ : [];++ // Ordered, non-empty sections. Labels pluralize with their own count so a+ // single item reads "Skill" / "File", not "Skills" / "Files".+ const sections = [+ {+ key: 'folders',+ label: t`${plural(folderRows.length, { one: 'Folder', other: 'Folders' })}`,+ rows: folderRows,+ },+ {+ key: 'files',+ label: t`${plural(fileRows.length, { one: 'File', other: 'Files' })}`,+ rows: fileRows,+ },+ {+ // Only ever 0 or 1 pack skill, so no plural arm (the section is hidden+ // when empty; when shown it's always exactly one).+ key: 'skill',+ label: t`Skill`,+ rows: skillRows,+ },+ ].filter((s) => s.rows.length > 0);+return (- <section className="@container/created space-y-2.5">+ <section className="space-y-5"><div className="flex flex-wrap justify-between items-baseline gap-x-2 gap-y-0.5">- <h3 className="flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-primary">- <span aria-hidden="true" className="flex items-center justify-center">- ◇- </span>+ <h3 className="flex items-center gap-1.5 text-xs font-medium uppercase font-mono tracking-wider text-muted-foreground"><Trans>What gets created</Trans></h3>{counts.length > 0 ? (@@ -183,182 +251,75 @@ export function CreatedItemsList({) : null}</div>- <div className="grid gap-3 @sm/created:grid-cols-2 @2xl/created:grid-cols-3">- {folders.map((folder) => (- <div- key={folder.path}- className="flex h-full min-w-0 flex-col gap-1.5 rounded-xl border border-border/60 bg-card p-3.5"- >- <div className="flex min-w-0 items-center gap-2">- <Folder aria-hidden="true" className="size-3.5 shrink-0 text-muted-foreground" />- <code className="min-w-0 truncate font-mono text-1sm font-medium text-foreground/90">- {basename(folder.path)}/- </code>- <span className="ml-auto shrink-0 font-mono text-[11px] uppercase tracking-wide text-muted-foreground">- {t`${plural(folder.templateCount, { one: '# template', other: '# templates' })}`}- </span>- </div>- {folder.summary ? (- <p className="text-1sm leading-relaxed text-muted-foreground">{folder.summary}</p>- ) : null}+ <div className="space-y-5">+ {sections.map((section) => (+ <div key={section.key} className="space-y-2.5">+ <h4 className="flex items-baseline gap-2 text-xs font-medium uppercase font-mono tracking-wider text-muted-foreground">+ <span>{section.label}</span>+ <span className="text-muted-foreground/50">{section.rows.length}</span>+ </h4>+ <ul className="space-y-4">+ {section.rows.map((row) => {+ const Icon = row.icon;+ return (+ <li key={row.key} className="flex items-center gap-3">+ {/* Type is+ carried by the icon + folder trailing-slash, never color+ alone. aria-hidden — the section header + name convey it. */}+ <div+ aria-hidden="true"+ className="flex size-8 shrink-0 items-center justify-center rounded-lg border border-border/60"+ >+ <Icon className="size-4 text-muted-foreground" />+ </div>+ <div className="min-w-0 flex-1 py-0.5">+ {/* Name + pill share the top line (pill aligned to the+ name, at the row's right edge); the description drops+ below, spanning the full width under both. */}+ <div className="flex items-center gap-2">+ <code+ className="min-w-0 flex-1 truncate font-mono text-1sm text-foreground/90"+ title={row.title}+ >+ {row.name}+ </code>+ {row.pill ? (+ row.pillTooltip && row.pillTooltip.length > 0 ? (+ <Tooltip>+ {/* Default (button) trigger so the template names are+ keyboard-reachable, not hover-only. cursor-help+ signals there's more to see. */}+ <TooltipTrigger className="shrink-0 cursor-help rounded bg-transparent p-0 font-mono text-2xs uppercase tracking-wide text-muted-foreground transition-colors hover:text-foreground/70 focus-visible:text-foreground/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50">+ {row.pill}+ </TooltipTrigger>+ <TooltipContent>+ <ul className="space-y-0.5 text-left font-mono">+ {row.pillTooltip.map((name) => (+ <li key={name}>{name}</li>+ ))}+ </ul>+ </TooltipContent>+ </Tooltip>+ ) : (+ <span className="shrink-0 font-mono text-2xs uppercase tracking-wide text-muted-foreground">+ {row.pill}+ </span>+ )+ ) : null}+ </div>+ {row.description ? (+ <p className="mt-0.5 text-xs leading-relaxed text-muted-foreground">+ {row.description}+ </p>+ ) : null}+ </div>+ </li>+ );+ })}+ </ul></div>))}-- {files.map((file) => {- const description = fileDescriptions[file.name];- return (- <div- key={file.path}- className="flex h-full min-w-0 flex-col gap-1.5 rounded-xl border border-border/60 bg-card p-3.5"- >- <div className="flex min-w-0 items-center gap-2">- <File aria-hidden="true" className="size-3.5 shrink-0 text-muted-foreground" />- <code- className="min-w-0 truncate font-mono text-1sm font-medium text-foreground/90"- title={file.name}- >- {file.name}- </code>- </div>- {description ? (- <p className="text-1sm leading-relaxed text-muted-foreground">{description}</p>- ) : null}- </div>- );- })}-- {skill ? (- <div className="flex h-full min-w-0 flex-col gap-1.5 rounded-xl border border-border/60 bg-card p-3.5">- <div className="flex min-w-0 items-center gap-2">- <Hexagon aria-hidden="true" className="size-3.5 shrink-0 text-muted-foreground" />- {/* Drop the shared `open-knowledge-pack-` prefix (the identical,- non-distinguishing part) so the pack name reads + fits; full- name stays on hover. The `Skill` pill mirrors the folder card's- template-count pill so the type is unmistakable. */}- <code- className="min-w-0 truncate font-mono text-1sm font-medium text-foreground/90"- title={skill.name}- >- {skillDisplayName(skill.name)}- </code>- <span className="ml-auto shrink-0 font-mono text-[11px] uppercase tracking-wide text-muted-foreground">- <Trans>Skill</Trans>- </span>- </div>- <p className="text-1sm leading-relaxed text-muted-foreground">- <Trans>Guides your AI agents on how to work here.</Trans>- </p>- </div>- ) : null}</div>-- {plan.created.length > 0 ? (- <Collapsible- open={treeOpen}- onOpenChange={setTreeOpen}- className="overflow-hidden rounded-md border border-border/60 bg-muted/20"- >- <CollapsibleTrigger asChild>- <Button- variant="link-muted"- size="sm"- className="h-auto w-full justify-between rounded-none px-3 py-2 font-mono text-xs uppercase tracking-wide text-muted-foreground hover:bg-muted/40"- >- <Trans>Files & folders</Trans>- <ChevronDown- aria-hidden="true"- className={cn('size-3.5 transition-transform', treeOpen && 'rotate-180')}- />- </Button>- </CollapsibleTrigger>- <CollapsibleContent>- <div className="border-t border-border/60">- <CreatedItemsTree plan={plan} />- </div>- </CollapsibleContent>- </Collapsible>- ) : null}</section>);}--function describeCreatedItems(plan: OkScaffoldPlan): CreatedItem[] {- const folders: CreatedItem[] = plan.created- .filter((e) => e.kind === 'folder')- .map((e) => ({ kind: 'folder', name: `${e.path}/` }));- const files: CreatedItem[] = plan.created- .filter((e) => e.kind === 'file')- .map((e) => ({ kind: 'file', name: e.path }));- return [...folders, ...files];-}--/**- * The full indented file tree (folders + every `.ok/` internal), rendered- * inside the "Show file tree" disclosure — the enclosing `Collapsible` owns the- * border + background. Pure structure: folder purpose lives on the cards above.- */-function CreatedItemsTree({ plan }: { plan: OkScaffoldPlan }) {- const { t } = useLingui();- const items = describeCreatedItems(plan);-- // Lex sort gives parent-before-children via string-prefix comparison.- const sorted = [...items].sort((a, b) => a.name.localeCompare(b.name));-- // Re-scaffold may put the parent in `plan.skipped`; anchoring depth +- // displayed name to PRESENT ancestors keeps guide bars from descending- // into rows that never render.- const presentPaths = new Set(sorted.map((i) => i.name.replace(/\/$/, '')));-- return (- <ul aria-label={t`Items to be created`} className="py-1.5">- {sorted.map((item) => {- const pathKey = item.name.replace(/\/$/, '');- const segments = pathKey.split('/');- // Count present ancestors (= visual depth); the leaf name spans- // any absent intermediate segments so the row stays unambiguous.- let depth = 0;- let nearestPresentEnd = 0;- for (let i = 1; i < segments.length; i++) {- const ancestor = segments.slice(0, i).join('/');- if (presentPaths.has(ancestor)) {- depth++;- nearestPresentEnd = i;- }- }- const displayName =- segments.slice(nearestPresentEnd).join('/') + (item.kind === 'folder' ? '/' : '');- const isFolder = item.kind === 'folder';- return (- <li- key={item.name}- className="relative flex min-w-0 items-center gap-1.5 py-1 pr-3"- style={{ paddingLeft: `${12 + depth * 16}px` }}- >- {/* Vertical guides at each present-ancestor depth (`+8`- centers the 1px line within the 16px icon column). */}- {Array.from({ length: depth }, (_, i) => (- <span- // biome-ignore lint/suspicious/noArrayIndexKey: depth-slot index is the stable identity (ancestor paths may include skipped segments)- key={`guide:${i}`}- aria-hidden="true"- className="absolute top-0 bottom-0 w-px bg-border/50"- style={{ left: `${12 + i * 16 + 8}px` }}- />- ))}- {isFolder ? (- <Folder- aria-hidden="true"- className="size-3.5 shrink-0 text-muted-foreground"- strokeWidth={1.5}- />- ) : (- // Spacer keeps file names aligned with sibling folder names.- <span aria-hidden="true" className="size-3.5 shrink-0" />- )}- <code className="font-mono text-1sm shrink-0 text-foreground/80">{displayName}</code>- </li>- );- })}- </ul>- );-}diff --git a/packages/app/src/components/SeedDialog.tsx b/packages/app/src/components/SeedDialog.tsxindex f34919926..b97c7721f 100644--- a/packages/app/src/components/SeedDialog.tsx+++ b/packages/app/src/components/SeedDialog.tsx@@ -437,26 +437,24 @@ function SeedDialogBody({}) {const { t } = useLingui();if (phase.kind === 'loading') {- // Card-sized skeleton blocks in the same grid as the real cards, so the- // plan swaps in without a layout jump. Count tracks the pack's folders (the- // dominant card kind). `role="status"` so assistive tech hears it loading.- const cardCount = selectedPack?.folders.length ?? 6;+ // Skeleton rows matching the real `CreatedItemsList` row shape (size-8 icon+ // block, centered, + name/description lines), so the plan swaps in without a+ // layout jump. Count tracks the pack's folders (the dominant row kind).+ // `role="status"` so assistive tech hears it loading.+ const rowCount = selectedPack?.folders.length ?? 6;return (- <section- className="@container/created"- role="status"- aria-busy="true"- aria-label={t`Loading preview`}- >- <div className="grid gap-3 @sm/created:grid-cols-2 @2xl/created:grid-cols-3">- {Array.from({ length: cardCount }, (_, i) => i).map((i) => (- <div- key={`seed-skeleton-${i}`}- aria-hidden="true"- className="h-20 animate-pulse rounded-xl bg-muted"- />+ <section role="status" aria-busy="true" aria-label={t`Loading preview`}>+ <ul className="space-y-2">+ {Array.from({ length: rowCount }, (_, i) => i).map((i) => (+ <li key={`seed-skeleton-${i}`} aria-hidden="true" className="flex items-center gap-3">+ <div className="size-8 shrink-0 animate-pulse rounded-lg bg-muted" />+ <div className="min-w-0 flex-1 py-0.5">+ <span className="block h-3.5 w-28 animate-pulse rounded bg-muted" />+ <span className="mt-2 block h-3 w-4/5 animate-pulse rounded bg-muted" />+ </div>+ </li>))}- </div>+ </ul></section>);}diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.jsonindex f3d9480ba..17f5aef7e 100644--- a/packages/app/src/locales/en/messages.json+++ b/packages/app/src/locales/en/messages.json@@ -767,7 +767,6 @@"IInnZo": ["Conflict"],"IKoTAC": ["Keep disabled"],"IN4UX8": ["Search (", ["searchShortcut"], ")"],- "INEQsp": ["Items to be created"],"IQPyrD": ["Missing page — click to create"],"IRv9cH": ["Cloned ", ["repoName"], "."],"IWGfGF": ["Checking your GitHub connection"],@@ -1403,6 +1402,7 @@"Zf0w-R": ["Take a piece of writing from a rough idea to a finished draft to something you're ready to share. Good for blog posts, essays, or anything you want to move through clear stages."],+ "ZgGuA4": [["0", "plural", { "one": ["File"], "other": ["Files"] }]],"ZhhOwV": ["Quote"],"ZjtgI-": ["Command palette"],"Zon_qG": ["Mirror source <0>", ["label"], "</0>"],@@ -2048,6 +2048,7 @@"pajIrl": ["Could not turn off the terminal: ", ["0"]],"pbwTg6": [["seconds"], "s ago"],"pckX1A": [["0", "plural", { "one": ["#", " use"], "other": ["#", " uses"] }]],+ "pcqlQu": [["0", "plural", { "one": ["Folder"], "other": ["Folders"] }]],"pgq_xf": [["0"], "/", ["1"], " ", ["2"]],"phM8Kh": ["Found the repo but could not open the project. Please try again."],"pha01Y": ["Project-level pages with no incoming graph edges."],@@ -2415,7 +2416,6 @@"zLGXna": ["No starter packs available."],"zLak8b": ["Activate new tab"],"zQBg2C": ["Move the current block up or down one position."],- "zTHnl4": ["Files & folders"],"zUhPuR": ["Open containing folder, ", ["hint"]],"zXj1rA": ["Search by meaning"],"zZ_I5K": ["Open project menu"],diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.poindex 733339588..b62717cb8 100644--- a/packages/app/src/locales/en/messages.po+++ b/packages/app/src/locales/en/messages.po@@ -130,6 +130,16 @@ msgstr "{0, plural, one {# template} other {# templates}}"msgid "{0, plural, one {# use} other {# uses}}"msgstr "{0, plural, one {# use} other {# uses}}"+#. placeholder {0}: fileRows.length+#: src/components/CreatedItemsList.tsx+msgid "{0, plural, one {File} other {Files}}"+msgstr "{0, plural, one {File} other {Files}}"++#. placeholder {0}: folderRows.length+#: src/components/CreatedItemsList.tsx+msgid "{0, plural, one {Folder} other {Folders}}"+msgstr "{0, plural, one {Folder} other {Folders}}"+#. placeholder {0}: group.worktrees.length#: src/components/RecentProjectsMenu.tsxmsgid "{0, plural, one {worktree} other {worktrees}}"@@ -3033,10 +3043,6 @@ msgstr "Filename"msgid "Files"msgstr "Files"-#: src/components/CreatedItemsList.tsx-msgid "Files & folders"-msgstr "Files & folders"-#: src/lib/keyboard-shortcuts.tsmsgid "Files sidebar"msgstr "Files sidebar"@@ -3684,10 +3690,6 @@ msgstr "Italic"msgid "Item {0}"msgstr "Item {0}"-#: src/components/CreatedItemsList.tsx-msgid "Items to be created"-msgstr "Items to be created"-#: src/components/SubscribeCard.tsxmsgid "Join us on Discord"msgstr "Join us on Discord"diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.jsonindex 2002d79ae..9c2fbf976 100644--- a/packages/app/src/locales/pseudo/messages.json+++ b/packages/app/src/locales/pseudo/messages.json@@ -767,7 +767,6 @@"IInnZo": ["Ćōńƒĺĩćţ"],"IKoTAC": ["Ķēēƥ ďĩśàƀĺēď"],"IN4UX8": ["Śēàŕćĥ (", ["searchShortcut"], ")"],- "INEQsp": ["Ĩţēḿś ţō ƀē ćŕēàţēď"],"IQPyrD": ["Ḿĩśśĩńĝ ƥàĝē — ćĺĩćķ ţō ćŕēàţē"],"IRv9cH": ["Ćĺōńēď ", ["repoName"], "."],"IWGfGF": ["Ćĥēćķĩńĝ ŷōũŕ ĜĩţĤũƀ ćōńńēćţĩōń"],@@ -1403,6 +1402,7 @@"Zf0w-R": ["Ţàķē à ƥĩēćē ōƒ ŵŕĩţĩńĝ ƒŕōḿ à ŕōũĝĥ ĩďēà ţō à ƒĩńĩśĥēď ďŕàƒţ ţō śōḿēţĥĩńĝ ŷōũ'ŕē ŕēàďŷ ţō śĥàŕē. Ĝōōď ƒōŕ ƀĺōĝ ƥōśţś, ēśśàŷś, ōŕ àńŷţĥĩńĝ ŷōũ ŵàńţ ţō ḿōvē ţĥŕōũĝĥ ćĺēàŕ śţàĝēś."],+ "ZgGuA4": [["0", "plural", { "one": ["Ƒĩĺē"], "other": ["Ƒĩĺēś"] }]],"ZhhOwV": ["Ǫũōţē"],"ZjtgI-": ["Ćōḿḿàńď ƥàĺēţţē"],"Zon_qG": ["Ḿĩŕŕōŕ śōũŕćē <0>", ["label"], "</0>"],@@ -2048,6 +2048,7 @@"pajIrl": ["Ćōũĺď ńōţ ţũŕń ōƒƒ ţĥē ţēŕḿĩńàĺ: ", ["0"]],"pbwTg6": [["seconds"], "ś àĝō"],"pckX1A": [["0", "plural", { "one": ["#", " ũśē"], "other": ["#", " ũśēś"] }]],+ "pcqlQu": [["0", "plural", { "one": ["Ƒōĺďēŕ"], "other": ["Ƒōĺďēŕś"] }]],"pgq_xf": [["0"], "/", ["1"], " ", ["2"]],"phM8Kh": ["Ƒōũńď ţĥē ŕēƥō ƀũţ ćōũĺď ńōţ ōƥēń ţĥē ƥŕōĴēćţ. Ƥĺēàśē ţŕŷ àĝàĩń."],"pha01Y": ["ƤŕōĴēćţ-ĺēvēĺ ƥàĝēś ŵĩţĥ ńō ĩńćōḿĩńĝ ĝŕàƥĥ ēďĝēś."],@@ -2415,7 +2416,6 @@"zLGXna": ["Ńō śţàŕţēŕ ƥàćķś àvàĩĺàƀĺē."],"zLak8b": ["Àćţĩvàţē ńēŵ ţàƀ"],"zQBg2C": ["Ḿōvē ţĥē ćũŕŕēńţ ƀĺōćķ ũƥ ōŕ ďōŵń ōńē ƥōśĩţĩōń."],- "zTHnl4": ["Ƒĩĺēś & ƒōĺďēŕś"],"zUhPuR": ["Ōƥēń ćōńţàĩńĩńĝ ƒōĺďēŕ, ", ["hint"]],"zXj1rA": ["Śēàŕćĥ ƀŷ ḿēàńĩńĝ"],"zZ_I5K": ["Ōƥēń ƥŕōĴēćţ ḿēńũ"],diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.poindex de3880145..6462425c4 100644--- a/packages/app/src/locales/pseudo/messages.po+++ b/packages/app/src/locales/pseudo/messages.po@@ -130,6 +130,16 @@ msgstr ""msgid "{0, plural, one {# use} other {# uses}}"msgstr ""+#. placeholder {0}: fileRows.length+#: src/components/CreatedItemsList.tsx+msgid "{0, plural, one {File} other {Files}}"+msgstr ""++#. placeholder {0}: folderRows.length+#: src/components/CreatedItemsList.tsx+msgid "{0, plural, one {Folder} other {Folders}}"+msgstr ""+#. placeholder {0}: group.worktrees.length#: src/components/RecentProjectsMenu.tsxmsgid "{0, plural, one {worktree} other {worktrees}}"@@ -3028,10 +3038,6 @@ msgstr ""msgid "Files"msgstr ""-#: src/components/CreatedItemsList.tsx-msgid "Files & folders"-msgstr ""-#: src/lib/keyboard-shortcuts.tsmsgid "Files sidebar"msgstr ""@@ -3679,10 +3685,6 @@ msgstr ""msgid "Item {0}"msgstr ""-#: src/components/CreatedItemsList.tsx-msgid "Items to be created"-msgstr ""-#: src/components/SubscribeCard.tsxmsgid "Join us on Discord"msgstr ""diff --git a/packages/core/src/bridge/bind-frontmatter-doc.ts b/packages/core/src/bridge/bind-frontmatter-doc.tsindex c014b1413..8f9d95287 100644--- a/packages/core/src/bridge/bind-frontmatter-doc.ts+++ b/packages/core/src/bridge/bind-frontmatter-doc.ts@@ -1,3 +1,4 @@+import type * as Y from 'yjs';import type { Err, Ok, Result } from '../config/result.ts';import { type FrontmatterValidationError, toFrontmatterIssue } from '../frontmatter/errors.ts';diff --git a/packages/core/src/bridge/bridge-invariant.ts b/packages/core/src/bridge/bridge-invariant.tsindex 005627195..8bfdb40cd 100644--- a/packages/core/src/bridge/bridge-invariant.ts+++ b/packages/core/src/bridge/bridge-invariant.ts@@ -1,3 +1,4 @@+import { fnv1aDigest } from './hash-util.ts';export type BridgeInvariantSite = 'observer-b' | 'persistence' | 'test-harness';diff --git a/packages/core/src/bridge/doc-boundary-space.ts b/packages/core/src/bridge/doc-boundary-space.tsindex 8890f6739..c18c086d5 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';const LEADING_BOUNDARY_RE = /^(?:\r?\n)+/;diff --git a/packages/core/src/bridge/merge-three-way.ts b/packages/core/src/bridge/merge-three-way.tsindex b0a80fbd9..864bc7245 100644--- a/packages/core/src/bridge/merge-three-way.ts+++ b/packages/core/src/bridge/merge-three-way.ts@@ -37,6 +37,7 @@ function mergeThreeWayImpl(baseline: string, userText: string, agentText: stringreturn parts.join('\n');}+export type BridgeMergeContentLossSide = 'user' | 'agent';export type BridgeMergeContentLossWhich = 'substring' | 'order';diff --git a/packages/core/src/bridge/normalize.ts b/packages/core/src/bridge/normalize.tsindex e67f33b40..592f0b956 100644--- a/packages/core/src/bridge/normalize.ts+++ b/packages/core/src/bridge/normalize.ts@@ -1,3 +1,4 @@+const COMMONMARK_ESCAPE_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~])/g;const TABLE_ALIGN_ROW_RE = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/;diff --git a/packages/core/src/markdown/callout-transformer.ts b/packages/core/src/markdown/callout-transformer.tsindex 83d47404a..a363dfd54 100644--- a/packages/core/src/markdown/callout-transformer.ts+++ b/packages/core/src/markdown/callout-transformer.ts@@ -1,3 +1,4 @@+import type { Blockquote, Paragraph, Root } from 'mdast';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import { visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/comment-promoter.ts b/packages/core/src/markdown/comment-promoter.tsindex 193e286b0..47f0d07e4 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/dedent-block-jsx-close.ts b/packages/core/src/markdown/dedent-block-jsx-close.tsindex ece5c02a1..b6299a948 100644--- a/packages/core/src/markdown/dedent-block-jsx-close.ts+++ b/packages/core/src/markdown/dedent-block-jsx-close.ts@@ -1,3 +1,4 @@+import { findFencedRegions, isInsideFence } from './fence-regions.ts';const INDENTED_BLOCK_JSX_CLOSE_RE = /^([ ]{1,3})(<\/[A-Z][A-Za-z0-9_]*\s*>)([ \t]*)$/gm;diff --git a/packages/core/src/markdown/details-accordion-promoter.ts b/packages/core/src/markdown/details-accordion-promoter.tsindex 54774764a..acd398aa6 100644--- a/packages/core/src/markdown/details-accordion-promoter.ts+++ b/packages/core/src/markdown/details-accordion-promoter.ts@@ -1,3 +1,4 @@+import type { Nodes, Paragraph, Parent, Root, Text } from 'mdast';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import { visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/fence-regions.ts b/packages/core/src/markdown/fence-regions.tsindex c7518d614..fb5ac8e8a 100644--- a/packages/core/src/markdown/fence-regions.ts+++ b/packages/core/src/markdown/fence-regions.ts@@ -1,3 +1,4 @@+const FENCE_RE = /^(`{3,}|~{3,})/gm;export function findFencedRegions(src: string): Array<[number, number]> {diff --git a/packages/core/src/markdown/fixtures/index.ts b/packages/core/src/markdown/fixtures/index.tsindex 00f5771ee..6931623c7 100644--- a/packages/core/src/markdown/fixtures/index.ts+++ b/packages/core/src/markdown/fixtures/index.ts@@ -1,3 +1,4 @@+import { readFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';@@ -8,6 +9,7 @@ function fixturePath(...segments: string[]): string {return resolve(FIXTURES_DIR, ...segments);}+interface GfmExample {section: string;markdown: string;@@ -17,6 +19,7 @@ export function loadGfmExamples(): GfmExample[] {return JSON.parse(readFileSync(fixturePath('gfm', 'examples.json'), 'utf8')) as GfmExample[];}+interface MdxCrashEntry {id: string;input: string;@@ -68,6 +71,7 @@ export function loadLargeEmbedFixtures(): LargeEmbedFixture[] {) as LargeEmbedFixture[];}+export function loadPrd6955Before(): string {return readFileSync(fixturePath('regression', 'prd-6955-before.md'), 'utf8');}@@ -76,6 +80,7 @@ export function loadPrd6955CorruptedTriplicated(): string {return readFileSync(fixturePath('regression', 'prd-6955-corrupted-triplicated.md'), 'utf8');}+export interface NgPinnedCase {id: string;name: string;@@ -92,6 +97,7 @@ export function loadNgPinnedCases(): NgPinnedCase[] {) as NgPinnedCase[];}+export function loadLargeRealistic(): string {return readFileSync(fixturePath('perf', 'large-realistic.md'), 'utf8');}diff --git a/packages/core/src/markdown/fixtures/perf/generate.ts b/packages/core/src/markdown/fixtures/perf/generate.tsindex 8b1eb8519..daa3ef82b 100644--- a/packages/core/src/markdown/fixtures/perf/generate.ts+++ b/packages/core/src/markdown/fixtures/perf/generate.ts@@ -1,3 +1,4 @@+import { writeFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';@@ -10,6 +11,7 @@ const BASELINE_ONLY_COUNTS = [500, 2500] as const;const SEED = 0xf1de1117;+function mulberry32(seed: number): () => number {let a = seed >>> 0;return () => {@@ -36,6 +38,7 @@ function pickWeighted<T>(rand: () => number, items: readonly [T, number][]): T {return items[items.length - 1][0];}+const WORDS = ['lorem','ipsum',@@ -153,6 +156,7 @@ function mdxBlock(rand: () => number): string {return `<${name}>\n\n${sentence(rand)}\n\n</${name}>`;}+type BlockKind = 'paragraph' | 'heading' | 'list' | 'code' | 'table' | 'mdx';const MIX: readonly [BlockKind, number][] = [@@ -191,6 +195,7 @@ function generateDocument(blockCount: number, seed: number): string {return `${blocks.join('\n\n')}\n`;}+function main(): void {for (const count of [...BLOCK_COUNTS, ...BASELINE_ONLY_COUNTS]) {const doc = generateDocument(count, SEED);diff --git a/packages/core/src/markdown/guard-flanking-matrix.ts b/packages/core/src/markdown/guard-flanking-matrix.tsindex 420dc0fe5..32c055c5b 100644--- a/packages/core/src/markdown/guard-flanking-matrix.ts+++ b/packages/core/src/markdown/guard-flanking-matrix.ts@@ -7,6 +7,7 @@ import {import { BACKSLASH_GUARD_SUBSTITUTIONS, encodeBackslashEscapes } from './backslash-escape-guard.ts';import { ENTITY_REF_GUARD_SUBSTITUTIONS, encodeEntityRefs } from './entity-ref-guard.ts';+export const ATTENTION_DELIMITERS = ['*', '_', '**', '~~', '=='] as const;export type FlankClass = 'whitespace' | 'punctuation' | 'other';diff --git a/packages/core/src/markdown/handler-shadow-audit.ts b/packages/core/src/markdown/handler-shadow-audit.tsindex 2653473da..283913255 100644--- a/packages/core/src/markdown/handler-shadow-audit.ts+++ b/packages/core/src/markdown/handler-shadow-audit.ts@@ -1,3 +1,4 @@+export interface HandlerShadowWitness {input: string;expect: 'byte' | 'byte-and-reparse-type';diff --git a/packages/core/src/markdown/highlight-promoter.ts b/packages/core/src/markdown/highlight-promoter.tsindex f758cf737..7a22e8016 100644--- a/packages/core/src/markdown/highlight-promoter.ts+++ b/packages/core/src/markdown/highlight-promoter.ts@@ -1,3 +1,4 @@+import type { Nodes, Parent, PhrasingContent, Root, Text } from 'mdast';import type { MdxJsxTextElement } from 'mdast-util-mdx';import { SKIP, visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/html-to-mdast.ts b/packages/core/src/markdown/html-to-mdast.tsindex 78fdfeb02..2f082e6d0 100644--- a/packages/core/src/markdown/html-to-mdast.ts+++ b/packages/core/src/markdown/html-to-mdast.ts@@ -1,3 +1,4 @@+import type { Root as HastRoot } from 'hast';import type { Root as MdastRoot } from 'mdast';import rehypeParse from 'rehype-parse';@@ -75,7 +76,8 @@ export function htmlToMdast(html: string, options?: HtmlToMdastOptions): MdastRothrow new HtmlPayloadTooLargeError(html.length, maxBytes);}- const processor = unified().use(rehypeParse, { fragment: true });+ const processor = unified()+ .use(rehypeParse, { fragment: true });for (const plugin of cleanupPlugins) {processor.use(plugin);diff --git a/packages/core/src/markdown/image-promoter.ts b/packages/core/src/markdown/image-promoter.tsindex 706fa9afb..994eb6917 100644--- a/packages/core/src/markdown/image-promoter.ts+++ b/packages/core/src/markdown/image-promoter.ts@@ -1,3 +1,4 @@+import type { Image, Paragraph, Root } from 'mdast';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import { visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/index.ts b/packages/core/src/markdown/index.tsindex 58a810193..064fa0773 100644--- a/packages/core/src/markdown/index.ts+++ b/packages/core/src/markdown/index.ts@@ -1,3 +1,4 @@+import {type FromProseMirrorOptions,fromPmMark,@@ -164,6 +165,7 @@ export class MarkdownManager {}}+const registry = createRegistry();function destructureAttrs(@@ -212,6 +214,7 @@ function destructureAttrs(return result;}+function hasDirtyDescendant(node: PmNode): boolean {let found = false;node.descendants((child) => {@@ -230,6 +233,7 @@ function effectiveDirty(node: PmNode): boolean {return node.attrs.sourceDirty || hasDirtyDescendant(node);}+function isEmptyMdastParagraph(node: MdastNodes): boolean {if (node.type !== 'paragraph') return false;const children = node.children ?? [];@@ -298,6 +302,7 @@ function extractTextFromMdastNodes(nodes: MdastNodes[]): string {return out;}+import {AUDIO_EXTENSIONS,FILE_ATTACHMENT_EXTENSIONS,@@ -547,6 +552,7 @@ function buildMdastToPmHandlers(}));}+if (m.emphasis) {handlers.emphasis = toPmMark(m.emphasis, (node: Emphasis) => ({sourceDelimiter: node.data?.sourceDelimiter ?? '*',@@ -626,6 +632,7 @@ function buildMdastToPmHandlers(}));}+if (m.link) {const sourceLiteralMark = m.sourceLiteral;handlers.link = (node: Link, _parent: MdastParent, state: MdastToPmState) => {@@ -904,6 +911,7 @@ function buildMdastToPmHandlers(};}+const blockUnknownHandler = (node: {type: string;position?: { start: { offset: number }; end: { offset: number } };@@ -1029,6 +1037,7 @@ function buildMdastToPmHandlers(return handlers as RemarkProseMirrorOptions['handlers'];}+function buildPmToMdastHandlers(schema: Schema): {nodeHandlers: FromProseMirrorOptions<string, string>['nodeHandlers'];markHandlers: FromProseMirrorOptions<string, string>['markHandlers'];diff --git a/packages/core/src/markdown/math-promoter.ts b/packages/core/src/markdown/math-promoter.tsindex a5b511f25..bd79424c7 100644--- a/packages/core/src/markdown/math-promoter.ts+++ b/packages/core/src/markdown/math-promoter.ts@@ -1,3 +1,4 @@+import type { Code, Root } from 'mdast';import type { Math as MdastMath } from 'mdast-util-math';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';diff --git a/packages/core/src/markdown/mdast-to-hast-handlers.ts b/packages/core/src/markdown/mdast-to-hast-handlers.tsindex 679c72ef7..f84967798 100644--- a/packages/core/src/markdown/mdast-to-hast-handlers.ts+++ b/packages/core/src/markdown/mdast-to-hast-handlers.ts@@ -1,3 +1,4 @@+import type { Comment, Element, ElementContent, Properties } from 'hast';import type { FootnoteDefinition, FootnoteReference } from 'mdast';import type { MdxJsxFlowElement, MdxJsxTextElement } from 'mdast-util-mdx';diff --git a/packages/core/src/markdown/mdast-to-html.ts b/packages/core/src/markdown/mdast-to-html.tsindex 8ce2b2492..df788a80d 100644--- a/packages/core/src/markdown/mdast-to-html.ts+++ b/packages/core/src/markdown/mdast-to-html.ts@@ -1,3 +1,4 @@+import type { Element, Root as HastRoot, Text as HastText } from 'hast';import type { Root as MdastRoot, Text as MdastText } from 'mdast';import type { Handler } from 'mdast-util-to-hast';diff --git a/packages/core/src/markdown/merged-walker.ts b/packages/core/src/markdown/merged-walker.tsindex 35d74b85e..a58f8c720 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/mermaid-promoter.ts b/packages/core/src/markdown/mermaid-promoter.tsindex 1a897fca8..17ed2b829 100644--- a/packages/core/src/markdown/mermaid-promoter.ts+++ b/packages/core/src/markdown/mermaid-promoter.ts@@ -1,3 +1,4 @@+import type { Code, Root } from 'mdast';import type { MdxJsxAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import { visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/parse-with-fallback.ts b/packages/core/src/markdown/parse-with-fallback.tsindex 9864b3b60..7e4a9a48b 100644--- a/packages/core/src/markdown/parse-with-fallback.ts+++ b/packages/core/src/markdown/parse-with-fallback.ts@@ -168,6 +168,7 @@ export function parseRecursive(}}+interface VFilePlace {offset?: number;start?: { offset?: number };@@ -186,6 +187,7 @@ function extractErrorOffset(err: unknown): number | undefined {return undefined;}+interface Region {start: number;end: number;@@ -209,6 +211,7 @@ function nearestBlankLineAfter(src: string, offset: number): number | null {return null;}+export interface TagEvent {kind: 'open' | 'close' | 'self-close';name: string;@@ -355,6 +358,7 @@ function findFallbackRegion(src: string, errorOffset: number): Region {return { start: blockStart, end: blockEnd };}+interface SourceBlock {src: string;start: number;@@ -452,6 +456,7 @@ function tryPerBlockFallback(};}+function wholeDocRawText(source: string): JSONContent {return {type: 'doc',diff --git a/packages/core/src/markdown/parser-drop-closure.ts b/packages/core/src/markdown/parser-drop-closure.tsindex e6ab4fd57..43d420187 100644--- a/packages/core/src/markdown/parser-drop-closure.ts+++ b/packages/core/src/markdown/parser-drop-closure.ts@@ -1,3 +1,4 @@+export type DroppedTokenAdjudication =| {kind: 'format-dof-axis';diff --git a/packages/core/src/markdown/pipeline.ts b/packages/core/src/markdown/pipeline.tsindex 5d6db7aa8..5b9550e90 100644--- a/packages/core/src/markdown/pipeline.ts+++ b/packages/core/src/markdown/pipeline.ts@@ -1,3 +1,4 @@+import {type FromProseMirrorOptions,fromProseMirror,diff --git a/packages/core/src/markdown/position-aware-join.ts b/packages/core/src/markdown/position-aware-join.tsindex 248685cfe..4ac5731e7 100644--- a/packages/core/src/markdown/position-aware-join.ts+++ b/packages/core/src/markdown/position-aware-join.ts@@ -1,3 +1,4 @@+import type { Join } from 'mdast-util-to-markdown';import type { Position } from 'unist';diff --git a/packages/core/src/markdown/position-slice.ts b/packages/core/src/markdown/position-slice.tsindex 50a193a16..240be90e6 100644--- a/packages/core/src/markdown/position-slice.ts+++ b/packages/core/src/markdown/position-slice.ts@@ -1,3 +1,4 @@+import type { Nodes, Root } from 'mdast';import { visit } from 'unist-util-visit';import type { VFile } from 'vfile';@@ -466,7 +467,8 @@ export function applyPositionSliceToNode(const first = source[startOff];if (first !== '[' && first !== '<' && !node.title) {node.data.sourceStyle = 'gfm-autolink';- } else if (first === '[') {+ }+ else if (first === '[') {const slice = source.slice(startOff, endOff);const closeBracketIdx = slice.lastIndexOf('](');if (closeBracketIdx !== -1) {diff --git a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.tsindex db10fa54b..ca225ce9b 100644--- a/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts+++ b/packages/core/src/markdown/rehype-plugins/skip-notion-whitespace.ts@@ -1,3 +1,4 @@+import type { Comment, Element, Root, Text } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.tsindex 34068d103..3a2524a9a 100644--- a/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-cocoa-meta.ts@@ -1,3 +1,4 @@+import type { Element, ElementContent, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.tsindex 93151d43b..2279a0189 100644--- a/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-gdocs-wrapper.ts@@ -1,3 +1,4 @@+import type { Element, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.tsindex 188f02d83..a0f467c42 100644--- a/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-github-hovercard.ts@@ -1,3 +1,4 @@+import type { Element, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.tsindex 4ba2c3418..4e8542a21 100644--- a/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-gmail-classes.ts@@ -1,3 +1,4 @@+import type { Element, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.tsindex 1a74b1272..a3c96b24a 100644--- a/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-gsheets-wrapper.ts@@ -1,3 +1,4 @@+import type { Element, ElementContent, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.tsindex de35e7b79..e95cf43d6 100644--- a/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-mso-styles.ts@@ -1,3 +1,4 @@+import type { Comment, Element, ElementContent, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.tsindex b4be1b2ea..ffdb4d5b5 100644--- a/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-slack-classes.ts@@ -1,3 +1,4 @@+import type { Element, ElementContent, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.tsindex 3c8d88b7c..e2a96d1a7 100644--- a/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts+++ b/packages/core/src/markdown/rehype-plugins/strip-vscode-spans.ts@@ -1,3 +1,4 @@+import type { Element, Root } from 'hast';import type { Plugin } from 'unified';diff --git a/packages/core/src/markdown/resolve-image-url.ts b/packages/core/src/markdown/resolve-image-url.tsindex cf2c9da8e..0389575ac 100644--- a/packages/core/src/markdown/resolve-image-url.ts+++ b/packages/core/src/markdown/resolve-image-url.ts@@ -1,3 +1,4 @@+import { isRelativeUrl } from './safe-url.ts';function isDevDiagnosticContext(): boolean {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('|');diff --git a/packages/core/src/markdown/serialize-helpers.ts b/packages/core/src/markdown/serialize-helpers.tsindex 46cc6a074..542204403 100644--- a/packages/core/src/markdown/serialize-helpers.ts+++ b/packages/core/src/markdown/serialize-helpers.ts@@ -1,3 +1,4 @@+import type { Node as PmNode } from '@tiptap/pm/model';import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import type { PropDef, SerializeContext } from '../registry/types.ts';diff --git a/packages/core/src/markdown/single-dollar-math-promoter.ts b/packages/core/src/markdown/single-dollar-math-promoter.tsindex be97d4d62..fe73659e6 100644--- a/packages/core/src/markdown/single-dollar-math-promoter.ts+++ b/packages/core/src/markdown/single-dollar-math-promoter.ts@@ -1,3 +1,4 @@+import type { PhrasingContent, Root, Text } from 'mdast';import type { InlineMath } from 'mdast-util-math';import { SKIP, visit } from 'unist-util-visit';diff --git a/packages/core/src/markdown/to-markdown-handlers.ts b/packages/core/src/markdown/to-markdown-handlers.tsindex 1a2fb5d50..e1161455b 100644--- a/packages/core/src/markdown/to-markdown-handlers.ts+++ b/packages/core/src/markdown/to-markdown-handlers.ts@@ -1,3 +1,4 @@+import type { Nodes, Parents } from 'mdast';import type { MdxJsxAttribute, MdxJsxExpressionAttribute, MdxJsxFlowElement } from 'mdast-util-mdx';import type { Handle, Info, State } from 'mdast-util-to-markdown';diff --git a/packages/core/src/markdown/unknown-mdast-guard.ts b/packages/core/src/markdown/unknown-mdast-guard.tsindex cd245c38c..c5bfd2386 100644--- a/packages/core/src/markdown/unknown-mdast-guard.ts+++ b/packages/core/src/markdown/unknown-mdast-guard.ts@@ -1,3 +1,4 @@+import type { Root as MdastRoot } from 'mdast';import type { VFile } from 'vfile';diff --git a/packages/core/src/markdown/whitespace-char-ref.ts b/packages/core/src/markdown/whitespace-char-ref.tsindex a100cad76..1b75ba564 100644--- a/packages/core/src/markdown/whitespace-char-ref.ts+++ b/packages/core/src/markdown/whitespace-char-ref.ts@@ -1,3 +1,4 @@+const INLINE_WHITESPACE_BY_CODE: ReadonlyMap<number, string> = new Map([[0x20, ' '],[0x09, '\t'],diff --git a/packages/core/src/markdown/wiki-link-micromark.ts b/packages/core/src/markdown/wiki-link-micromark.tsindex 6dad26200..afd9936fe 100644--- a/packages/core/src/markdown/wiki-link-micromark.ts+++ b/packages/core/src/markdown/wiki-link-micromark.ts@@ -17,6 +17,7 @@ declare module 'micromark-util-types' {}}+const CODE_BANG = 33; // !const CODE_LBRACKET = 91; // [const CODE_RBRACKET = 93; // ]@@ -260,6 +261,7 @@ export function wikiLinkSyntax(): Extension {};}+function enterWikiLink(this: CompileContext, token: Token) {this.enter({@@ -385,6 +387,7 @@ export const wikiLinkToMarkdown: {unsafe: [{ character: '[', inConstruct: ['phrasing'] }],};+const MICROMARK_EXT = wikiLinkSyntax();export function remarkWikiLink(this: Processor) {