Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
"mdxe",
"@mdxe/*"
],
[
"mdxui",
"@mdxui/*"
],
[
"mdxai",
"@mdxai/*"
Expand Down
24 changes: 24 additions & 0 deletions .changeset/one-diff-implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@mdxld/diff': minor
'@mdxld/extract': minor
'@mdxld/markdown': minor
'@mdxld/formats': minor
---

One diff implementation in the repo (mdx-8je.12).

- `@mdxld/diff`: `merge3way` now returns merged CONTENT with git-style conflict regions
(it returned a unified patch and printed `[object Object]` for conflicts); new
path-based `diffPaths`, `applyPaths`, `merge3wayObjects` and exported `deepEqual`.
- `@mdxld/extract`: `diff` / `applyExtract` delegate to `@mdxld/diff` (key order inside a
list's objects is no longer a change); new 3-way `mergeExtract`; `extractWithAI` is
implemented over `ai-functions` `generateObject` (optional peer) with an injectable
`generate`; loop / conditional slots are captured as regions instead of breaking the
match for the scalars beside them; slot parsing is brace-balanced; entity tables go
through `@mdxld/markdown`; render → extract identity is proved against the npm
`@mdxui/text` md register for every Role fixture.
- `@mdxld/markdown`: `diff` / `applyExtract` / `DiffResult` removed (use `@mdxld/extract`
or `@mdxld/diff`); new `parseTable` / `renderTable` shared with `@mdxld/extract`;
`fromMarkdown` keeps empty table cells positional.
- `@mdxld/formats`: re-exports `parseTable` / `renderTable` instead of the removed
`diff` / `applyExtract` / `DiffResult`.
57 changes: 0 additions & 57 deletions .github/workflows/chromatic.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "packages/@mdxui/editor/app"]
path = packages/@mdxui/editor/app
url = https://github.com/dot-do/editor
[submodule "examples/agi.as"]
path = examples/agi.as
url = https://github.com/dot-do/agi.as
Expand Down
47 changes: 22 additions & 25 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,22 @@ The monorepo follows a clear separation of concerns:
| **@mdxld** | Parsing & Transformation | "How is MDXLD processed?" |
| **@mdxai** | AI Integrations | "How does AI interact?" |

### @mdxui - Rendering & Output Formats
### @mdxui - Rendering & Output Formats (lives in dot-do/ui, consumed from npm)

Defines rendering conventions for core components (`Site`, `Docs`, `App`, `Page`, etc.) to various output formats:
`mdxui` and every `@mdxui/*` package are owned by [dot-do/ui](https://github.com/dot-do/ui) (mdx-8je.8). No @mdxui sources live in this repo: `packages/mdxui`, `packages/@mdxui` and the storybook app are gone, and `test/repo/mdxui-home.test.ts` keeps them gone. The format renderers that used to be here (`html`, `json`, `markdown`, `slack`, `email`) were received there with history; `@mdxui/markdown` became the `md` register of `@mdxui/text`.

What this repo consumes, from the registry only:

```
@mdxui/
├── html → React → HTML strings (SSR)
├── markdown → React → Markdown strings
├── json → React → JSON / JSON-LD / Tool Schemas
├── email → React → Email HTML (React Email)
├── slack → React → Slack blocks (Slack-JSX)
├── shadcn → React web components (shadcn/ui)
├── fumadocs → Documentation utilities (Fumadocs)
└── widgets → Interactive widgets (Chat, Editor, Search)
@mdxui/text → text registers (plain / md / ascii / unicode / ansi) + the capability resolver.
`@mdxui/text/md` renders a parsed MDXLD document to markdown; @mdxe/hono's `md`
format and @mdxe/workers' `.md` assets go through it.
@mdxui/fumadocs → Hono JSX docs layouts re-exported by @mdxe/hono/jsx.
```

> **Note:** Terminal output is rendered to plain bytes by `@mdxui/text` (planned). `@mdxe/ink` is a *viewer* over the `@mdxe/tui` seam: it displays those bytes and handles input, never renders MDX itself, loads Ink lazily on `mount()`, and refuses to attach when stdout or stdin is not a TTY.
Adding any other `@mdxui/*` dependency means adding it to `NPM_ALLOWED` in `test/repo/mdxui-home.test.ts` — with a registry range, never `workspace:`.

> **Note:** Terminal output is the bytes `@mdxui/text` emits. `@mdxe/ink` is a *viewer* over the `@mdxe/tui` seam: it displays those bytes and handles input, never renders MDX itself, loads Ink lazily on `mount()`, and refuses to attach when stdout or stdin is not a TTY.

### @mdxe - Execution Environments & Protocols

Expand Down Expand Up @@ -239,20 +238,18 @@ const doc = parse(content) // Returns { id, type, context, data, content }

### Rendering to Multiple Formats

The renderers are npm packages from dot-do/ui; this repo wires them into `@mdxe/hono` (content negotiation) and `@mdxe/workers` (static assets):

```typescript
import { parse } from 'mdxld'
import { toHTML } from '@mdxui/html'
import { toJSON } from '@mdxui/json'
import { toSlack } from '@mdxui/slack'
import { toEmail } from '@mdxui/email'
import { render as toMarkdown } from '@mdxui/text/md' // the md register (npm @mdxui/text)

const doc = parse(mdxContent)

// Same document, different output formats
const html = await toHTML(doc) // HTML string for web
const json = await toJSON(doc) // JSON-LD for APIs
const slack = await toSlack(doc) // Slack blocks for messaging
const email = await toEmail(doc) // Email HTML for notifications
const md = toMarkdown(doc) // frontmatter + clean markdown, JSX stripped
const json = JSON.stringify(doc) // the parsed document as JSON
// html: @mdxe/hono renderPage / @mdxe/workers generateHtmlPage (fumadocs-style layout)
// slack / email / React HTML: @mdxui/{slack,email,html} from npm, not used by this repo
```

### Execution via Protocols
Expand Down Expand Up @@ -349,8 +346,8 @@ mdxld (core parsing)
├── mdxe (execution)
│ └── @mdxe/* (workers, isolate, hono, cli-core, deploy, fumadocs, ink, tui, mcp, vitest)
│
├── mdxui (rendering)
│ └── @mdxui/* (html, json, markdown, email, slack, shadcn)
├── @mdxui/text, @mdxui/fumadocs (npm, from dot-do/ui — no mdxui sources here)
│ └── used by @mdxe/hono (md format, docs JSX) and @mdxe/workers (.md assets)
│
└── mdxai (AI integrations)
└── @mdxai/* (claude, mastra, vapi)
Expand All @@ -366,8 +363,8 @@ ai-* primitives (npm, ^2.4.0)

When creating a new scoped package, ask:

1. **Is it about OUTPUT FORMAT?** → `@mdxui/`
- Rendering MDX to HTML, JSON, Markdown, Slack, Email, Terminal
1. **Is it about OUTPUT FORMAT?** → `@mdxui/` — in dot-do/ui, not here
- Rendering MDX to HTML, JSON, Markdown, Slack, Email, Terminal belongs to that repo; consume the published package

2. **Is it about EXECUTION?** → `@mdxe/`
- Runtimes (workers only — Cloudflare-native; no node/bun eval)
Expand Down
36 changes: 14 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,21 @@ A monorepo for building MDX-based AI applications that combine structured data,
| **mdxld** | Parse, stringify, validate, and compile MDXLD documents |
| **mdxdb** | Database abstraction with graph relationships and vector search |
| **mdxe** | Execute MDX in different environments and protocols |
| **mdxui** | Render MDX to different output formats |
| **mdxui** | Render MDX to different output formats — lives in [dot-do/ui](https://github.com/dot-do/ui), consumed here from npm |
| **mdxai** | AI integrations for generation, enrichment, and agents |

### @mdxui - Rendering & Output Formats

**"How does a component render to X format?"**

Defines rendering conventions for core components (`Site`, `Docs`, `App`, etc.) to various output formats:
`mdxui` and `@mdxui/*` live in [dot-do/ui](https://github.com/dot-do/ui) and are consumed here from npm only (no @mdxui sources in this repo). The format renderers that used to be here moved there; `@mdxui/markdown` became the `md` register of `@mdxui/text`.

| Package | Output Format | Technology |
|---------|--------------|------------|
| **@mdxui/html** | HTML strings | React → HTML |
| **@mdxui/markdown** | Markdown strings | React → Markdown |
| **@mdxui/json** | JSON / JSON-LD | React → JSON |
| **@mdxui/email** | Email HTML | React Email |
| **@mdxui/slack** | Slack blocks | Slack-JSX |
| **@mdxui/shadcn** | React components | shadcn/ui |
| **@mdxui/fumadocs** | Documentation | Fumadocs |
| **@mdxui/widgets** | Chat, Editor, Search | React |
| Package (npm) | Used here for |
|---------------|---------------|
| **@mdxui/text** | `@mdxui/text/md` renders a parsed document to markdown — `@mdxe/hono` `md` format, `@mdxe/workers` `.md` assets |
| **@mdxui/fumadocs** | Hono JSX docs layouts re-exported by `@mdxe/hono/jsx` |

> **Note:** Terminal output is plain bytes from **@mdxui/text** (planned); **@mdxe/ink** is a viewer over the **@mdxe/tui** seam that displays those bytes and handles input — it never renders MDX itself and never attaches to a pipe.
> **Note:** Terminal output is the bytes **@mdxui/text** emits; **@mdxe/ink** is a viewer over the **@mdxe/tui** seam that displays those bytes and handles input — it never renders MDX itself and never attaches to a pipe.

### @mdxe - Execution Environments & Protocols

Expand Down Expand Up @@ -194,20 +188,18 @@ export const greeting = () => "Hello!"

## Example: Rendering to Multiple Formats

The renderers are npm packages from [dot-do/ui](https://github.com/dot-do/ui); `@mdxe/hono` negotiates them by extension / `Accept` and `@mdxe/workers` emits them as static assets.

```typescript
import { parse } from 'mdxld'
import { toHTML } from '@mdxui/html'
import { toJSON } from '@mdxui/json'
import { toMarkdown } from '@mdxui/markdown'
import { toSlack } from '@mdxui/slack'
import { render as toMarkdown } from '@mdxui/text/md' // the md register of npm @mdxui/text

const doc = parse(mdxContent)

// Render to different formats
const html = await toHTML(doc) // HTML string
const json = await toJSON(doc) // JSON-LD object
const md = await toMarkdown(doc) // Markdown string
const slack = await toSlack(doc) // Slack blocks
const md = toMarkdown(doc) // frontmatter + clean markdown, JSX stripped
const json = JSON.stringify(doc) // the parsed document as JSON
// html: @mdxe/hono renderPage / @mdxe/workers generateHtmlPage (fumadocs-style layout)
// slack / email / React HTML: @mdxui/{slack,email,html} from npm, not used by this repo
```

## Example: Execution via Protocols
Expand Down
46 changes: 0 additions & 46 deletions apps/storybook/.storybook/main.ts

This file was deleted.

16 changes: 0 additions & 16 deletions apps/storybook/.storybook/manager.ts

This file was deleted.

42 changes: 0 additions & 42 deletions apps/storybook/.storybook/preview.ts

This file was deleted.

Loading
Loading