@mainsoft/agent-cms 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +359 -2
- package/TODO.md +178 -0
- package/UPGRADE-0.6.md +236 -0
- package/dist/agent.cjs +250 -0
- package/dist/agent.d.cts +88 -0
- package/dist/agent.d.ts +88 -0
- package/dist/agent.js +24 -0
- package/dist/ai.cjs +555 -0
- package/dist/ai.d.cts +48 -0
- package/dist/ai.d.ts +48 -0
- package/dist/ai.js +73 -0
- package/dist/bin.js +1556 -0
- package/dist/chunk-2NTK7H4W.js +10 -0
- package/dist/chunk-52NUUZC7.js +1446 -0
- package/dist/chunk-6K5ZTGHQ.js +30 -0
- package/dist/chunk-AKN7SUXU.js +281 -0
- package/dist/chunk-CRDW6Q72.js +188 -0
- package/dist/chunk-DD56PTZ4.js +78 -0
- package/dist/chunk-DOADAH4L.js +52 -0
- package/dist/chunk-EXV6JNLY.js +251 -0
- package/dist/chunk-IGL2V6US.js +324 -0
- package/dist/chunk-IW3D4I7Q.js +317 -0
- package/dist/chunk-OQ55GEF3.js +6 -0
- package/dist/chunk-QC2M4NZY.js +158 -0
- package/dist/chunk-QQV6VLYJ.js +204 -0
- package/dist/chunk-T66ZKBHF.js +25 -0
- package/dist/chunk-VICZ76TR.js +118 -0
- package/dist/chunk-Y63XQS2J.js +6 -0
- package/dist/cli.cjs +1596 -0
- package/dist/cli.d.cts +89 -0
- package/dist/cli.d.ts +89 -0
- package/dist/cli.js +534 -0
- package/dist/client.cjs +185 -0
- package/dist/client.d.cts +228 -0
- package/dist/client.d.ts +228 -0
- package/dist/client.js +13 -0
- package/dist/cms-BPp01z-8.d.ts +411 -0
- package/dist/cms-D6D89-qZ.d.cts +411 -0
- package/dist/config.cjs +61 -0
- package/dist/config.d.cts +36 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.js +11 -0
- package/dist/diff.cjs +316 -0
- package/dist/diff.d.cts +122 -0
- package/dist/diff.d.ts +122 -0
- package/dist/diff.js +29 -0
- package/dist/drizzle-repo-B1rt7r4j.d.ts +90 -0
- package/dist/drizzle-repo-Cn-kL2FK.d.cts +90 -0
- package/dist/errors.cjs +193 -0
- package/dist/errors.d.cts +109 -0
- package/dist/errors.d.ts +109 -0
- package/dist/errors.js +16 -0
- package/dist/frontmatter.cjs +103 -0
- package/dist/frontmatter.d.cts +32 -0
- package/dist/frontmatter.d.ts +32 -0
- package/dist/frontmatter.js +9 -0
- package/dist/http.cjs +1105 -0
- package/dist/http.d.cts +75 -0
- package/dist/http.d.ts +75 -0
- package/dist/http.js +321 -0
- package/dist/index.cjs +3066 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +263 -0
- package/dist/markdown.cjs +220 -0
- package/dist/markdown.d.cts +88 -0
- package/dist/markdown.d.ts +88 -0
- package/dist/markdown.js +23 -0
- package/dist/mcp.cjs +652 -0
- package/dist/mcp.d.cts +43 -0
- package/dist/mcp.d.ts +43 -0
- package/dist/mcp.js +26 -0
- package/dist/messages/en.cjs +76 -0
- package/dist/messages/en.d.cts +7 -0
- package/dist/messages/en.d.ts +7 -0
- package/dist/messages/en.js +7 -0
- package/dist/messages/ko.cjs +76 -0
- package/dist/messages/ko.d.cts +7 -0
- package/dist/messages/ko.d.ts +7 -0
- package/dist/messages/ko.js +53 -0
- package/dist/registry/cms-audit.json +25 -0
- package/dist/registry/cms-command.json +23 -0
- package/dist/registry/cms-doc-editor.json +36 -0
- package/dist/registry/cms-doc-list.json +29 -0
- package/dist/registry/cms-empty.json +22 -0
- package/dist/registry/cms-keys.json +29 -0
- package/dist/registry/cms-lib.json +33 -0
- package/dist/registry/cms-merge.json +26 -0
- package/dist/registry/cms-shell.json +22 -0
- package/dist/registry/cms-versions.json +26 -0
- package/dist/registry/registry.json +255 -0
- package/dist/repo-BWI2Pkrv.d.ts +162 -0
- package/dist/repo-CeDxUxO6.d.cts +162 -0
- package/dist/tables.cjs +356 -0
- package/dist/tables.d.cts +3515 -0
- package/dist/tables.d.ts +3515 -0
- package/dist/tables.js +35 -0
- package/dist/tools.cjs +420 -0
- package/dist/tools.d.cts +27 -0
- package/dist/tools.d.ts +27 -0
- package/dist/tools.js +18 -0
- package/dist/types.cjs +226 -0
- package/dist/types.d.cts +286 -0
- package/dist/types.d.ts +286 -0
- package/dist/types.js +28 -0
- package/package.json +277 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
- **Anonymous MCP read:** `createCmsHandler({ mcp: { anonymous: "read" } })` lets agents use `/mcp` without a key. They get the read tools only (`ANONYMOUS_READ_TOOLS`) and see published documents of collections anyone may read. Off by default.
|
|
6
|
+
- Releases are published with npm trusted publishing (OIDC) and provenance only; no npm token is stored in the repository.
|
|
7
|
+
|
|
8
|
+
## 0.6.1
|
|
9
|
+
|
|
10
|
+
- **Renamed to `@mainsoft/agent-cms`** and published to npmjs.com (with provenance) instead of GitHub Packages: `npm i @mainsoft/agent-cms` needs no `.npmrc` or token. Import paths change scope only (`@mainsoft-2024/agent-cms/http` → `@mainsoft/agent-cms/http`). `@mainsoft-2024/agent-cms` on GitHub Packages stays at 0.6.0. See "New name on npmjs" in [UPGRADE-0.6.md](./UPGRADE-0.6.md).
|
|
11
|
+
- The admin screens install with the shadcn CLI: `npx shadcn add <registry-url>/cms-shell.json`. `npm run build:registry -- --base-url <url> --out <dir>` writes the registry (files go to `<components>/cms/`, screens that need other screens point at their URLs, this package is pinned to `^0.6.1`).
|
|
12
|
+
- `scripts/shadcn-smoke.sh` and a CI job install a screen into a fresh Next.js app with the shadcn CLI and build it.
|
|
13
|
+
|
|
14
|
+
## 0.6.0
|
|
15
|
+
|
|
16
|
+
Breaking changes are listed with what to do in [UPGRADE-0.6.md](./UPGRADE-0.6.md).
|
|
17
|
+
|
|
18
|
+
### Breaking
|
|
19
|
+
|
|
20
|
+
- Collections require `visibility: "public" | "internal"`; `internal` requires `access.read`.
|
|
21
|
+
- Fine error codes (`invalid_slug`, `conflict_version`, `forbidden_write`, …) with the old coarse value in `kind`; wire shape `{ error, kind, message, params, diagnostics?, current? }`. Messages are English by default (`messages/ko` ships).
|
|
22
|
+
- `update` treats `fields` as a JSON Merge Patch.
|
|
23
|
+
- Gaps removed from the library (`cmsGaps`, `CmsGap`, `reportGap`, `gaps`, `setGapState`, `/_gaps`, `list_gaps`, `resolve_gap`, `search.gapLogging`). Searches that found nothing call `onSearchMiss` when the caller asks (`reportMiss`, `?miss=1`); the app stores them. The library never touches an existing `cms_gaps` table.
|
|
24
|
+
- Peer `zod` is `^3.25 || ^4`. MCP is served by the official SDK (`@modelcontextprotocol/sdk` 1.32).
|
|
25
|
+
- `CmsRepo` changed (gap methods out; reviews, audit, meta in; hits by source; key expiry).
|
|
26
|
+
- Database: new columns and `cms_audit`; run `npx agent-cms migrate check`.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `diagnose()` and `POST /_diagnose` / `diagnose_document`: every problem at once.
|
|
31
|
+
- ETag / `If-Match` on REST, `requireIfMatch`; 409 carries the current copy.
|
|
32
|
+
- Autosave without versions; versions record changed fields and hunks; `cms.diff(a, b)`.
|
|
33
|
+
- `./diff` (browser-safe): Myers line and word diff, hunks, `merge3`, `mergeDocs`.
|
|
34
|
+
- Agent change review: `agentChanges`, `reviewChanges` (accept; revert saved as one version).
|
|
35
|
+
- `patch()` / `patch_document`: section replace, insert, delete, append, dry run.
|
|
36
|
+
- `lookupForAgent` returns citation ids, trust (human or agent), a `<cms-document>` envelope, token-budget packing; `verifyCitations`.
|
|
37
|
+
- Draft preview links (`previewSecret`, `createPreviewLink`, `readPreview`), pinned to a version, 1h / 24h / 7d.
|
|
38
|
+
- `bulk()` and `bulk_documents`: publish, unpublish, archive, unarchive, delete with per-document results.
|
|
39
|
+
- List summaries with paging (`?fields=summary`), `counts()`, `docState()` with "modified since publish", `republishedAt`.
|
|
40
|
+
- API key expiry; audit log (`cms.audit`, `GET /audit`).
|
|
41
|
+
- `cmsTables({ prefix, schema })`, `SCHEMA_VERSION` handshake (`schema_outdated`).
|
|
42
|
+
- `Cms<C>`: collection names and `fields` typed from the collection list.
|
|
43
|
+
- CLI: `init`, `doctor`, `migrate check | print | apply`, `add` (`--diff`, `--update`), `patch`.
|
|
44
|
+
- Admin screens as a copy-in registry (`cms-shell`, `cms-doc-list`, `cms-doc-editor`, `cms-merge`, `cms-versions`, `cms-keys`, `cms-audit`, `cms-command`, `cms-empty`) on the app's shadcn/ui parts, English and Korean.
|
|
45
|
+
- `normalizeQuery` exported; it ignores word order.
|
|
46
|
+
- Usage hits record their source (`rest`, `mcp`, `ai`, `cli`, `app`).
|
|
47
|
+
|
|
48
|
+
## 0.5.3
|
|
49
|
+
|
|
50
|
+
- Draft-only saves no longer rebuild the search index; `afterChange` / `onChange` get `{ contentChanged }`.
|
|
51
|
+
- `createCms({ timeZone })` for usage-hit days; `hitCounts` filters by collection.
|
|
52
|
+
- `toJsonSchema` keeps lengths, ranges, defaults and enums.
|
|
53
|
+
- Unbiased API key generation.
|
|
54
|
+
- `remoteCmsToolsFor()` offers only the tools a key may use.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mainsoft
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,360 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agent-cms
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An add-on CMS that runs **inside your existing web app**: no separate server,
|
|
4
|
+
no new database. People edit in an admin UI; AI agents read and write the same
|
|
5
|
+
documents through tools. Use it for anything a CMS is for: a blog, release
|
|
6
|
+
notes, a help center, internal docs, a notice board.
|
|
7
|
+
|
|
8
|
+
- **Collections over one table set.** Every collection lives in the same
|
|
9
|
+
`cms_*` tables, so adding one needs no migration. Typed per-collection
|
|
10
|
+
`fields` (zod), categories, slugs, house-style checks.
|
|
11
|
+
- **Versions.** Every save is a full snapshot. Drafts, publish, unpublish,
|
|
12
|
+
archive, restore. Two writers never overwrite each other: a stale save is a
|
|
13
|
+
conflict (409) that carries the other person's copy, and the admin screen
|
|
14
|
+
merges the two line by line.
|
|
15
|
+
- **Agents are first-class editors.** One tool list, four ways in:
|
|
16
|
+
- **AI SDK tools** (`./ai`) for your own agent: `cmsTools(cms, actor)`
|
|
17
|
+
in-process, or `remoteCmsTools({ url, key })` against another app. They
|
|
18
|
+
are plain AI SDK `Tool`s, so they also work unchanged with anything built
|
|
19
|
+
on the AI SDK, such as slash-agent-sdk.
|
|
20
|
+
- **MCP** at `/api/cms/mcp` for coding agents (Claude Code, Cursor, …),
|
|
21
|
+
served with the official MCP SDK.
|
|
22
|
+
- **CLI** (`agent-cms put notes/launch.md --publish`) for agents with a shell.
|
|
23
|
+
- **REST** for everything else.
|
|
24
|
+
Agents change one section at a time (`patch_document`), check a draft
|
|
25
|
+
before saving (`diagnose_document`), and people review what agents changed
|
|
26
|
+
block by block.
|
|
27
|
+
- **Search built for answering.** In-memory, Korean-aware (particles, verb
|
|
28
|
+
endings, 2-grams), returns *sections* with citation ids
|
|
29
|
+
(`cms://guide/slack#connect`) rather than whole documents. Searches that
|
|
30
|
+
found nothing are passed to your app through `onSearchMiss`; storing them is
|
|
31
|
+
up to the app.
|
|
32
|
+
- **Admin screens you own.** `npx agent-cms add cms-doc-list` copies the
|
|
33
|
+
screens (list, editor with split preview, merge, versions, API keys, audit
|
|
34
|
+
log, ⌘K) into your app, built on your own shadcn/ui parts.
|
|
35
|
+
- **Safe defaults.** Every collection says whether it is `public` or
|
|
36
|
+
`internal`; API keys are stored as sha256 only, can expire, and are scoped
|
|
37
|
+
(`read` / `write` / `publish` / `admin`, optionally per collection). Key
|
|
38
|
+
changes, publishing, deletes and refusals go to an audit log.
|
|
39
|
+
|
|
40
|
+
> Design follows [Payload](https://payloadcms.com)'s collection, version and
|
|
41
|
+
> MCP shapes, written to run on Next.js 14+/React 18 and Postgres + Drizzle.
|
|
42
|
+
|
|
43
|
+
Upgrading from 0.5? Read [UPGRADE-0.6.md](./UPGRADE-0.6.md) first (the
|
|
44
|
+
`cms_gaps` table needs moving before anything drops it). Changes are in
|
|
45
|
+
[CHANGELOG.md](./CHANGELOG.md).
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
npm i @mainsoft/agent-cms
|
|
51
|
+
npx agent-cms init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Peer dependencies: `drizzle-orm`, `zod` (`^3.25` or `^4`), and `ai` (only for
|
|
55
|
+
`./ai`). `init` writes `agent-cms.config.ts`, `lib/cms.ts`, the API route,
|
|
56
|
+
a schema re-export and `.env.example` lines, and never overwrites a file.
|
|
57
|
+
|
|
58
|
+
## Set up
|
|
59
|
+
|
|
60
|
+
**1. Tables.** Re-export them from your Drizzle schema so drizzle-kit sees
|
|
61
|
+
them, or put the SQL in a migration:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
export { cmsDocuments, cmsVersions, cmsApiKeys, cmsHits, cmsMeta, cmsAudit } from "@mainsoft/agent-cms/tables";
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
npx agent-cms migrate check # what is missing, as SQL (exit 1 when behind)
|
|
69
|
+
npx agent-cms migrate apply # or run the idempotent DDL directly
|
|
70
|
+
npx agent-cms doctor # tables, columns, schema version, broken rows
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`cmsTables({ prefix: "blog_", schema: "content" })` gives a set with another
|
|
74
|
+
name prefix or Postgres schema; pass it to `new DrizzleRepo(db, { tables })`
|
|
75
|
+
and to `defineConfig({ tables })`. The CMS checks `cms_meta.schema_version`
|
|
76
|
+
on its first call and answers `schema_outdated` (503) with the command to run
|
|
77
|
+
when the database is behind.
|
|
78
|
+
|
|
79
|
+
**2. An instance.**
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { createCms, defineCollection, DrizzleRepo } from "@mainsoft/agent-cms";
|
|
83
|
+
import { ko } from "@mainsoft/agent-cms/messages/ko";
|
|
84
|
+
import { z } from "zod";
|
|
85
|
+
|
|
86
|
+
export const posts = defineCollection({
|
|
87
|
+
slug: "posts",
|
|
88
|
+
label: "Blog",
|
|
89
|
+
visibility: "public", // required: "public" or "internal"
|
|
90
|
+
categories: ["News", "Engineering"],
|
|
91
|
+
versions: { max: 100, drafts: true }, // edits wait for publish
|
|
92
|
+
search: { enabled: true },
|
|
93
|
+
fields: z.object({ cover: z.string().url().optional(), tags: z.array(z.string()).default([]) }),
|
|
94
|
+
admin: { fields: { tags: { label: "Tags", widget: "tags" } } },
|
|
95
|
+
url: (d) => `/blog/${d.slug}`,
|
|
96
|
+
access: { write: ({ actor }) => actor.kind === "user" && actor.isAdmin },
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export const cms = createCms({
|
|
100
|
+
repo: new DrizzleRepo(db),
|
|
101
|
+
collections: [posts],
|
|
102
|
+
timeZone: "Asia/Seoul",
|
|
103
|
+
messages: ko, // error messages (default English)
|
|
104
|
+
previewSecret: process.env.CMS_PREVIEW_SECRET, // draft preview links (32+ chars)
|
|
105
|
+
onSearchMiss: (e) => saveMiss(e), // your table, your rules
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`internal` collections must say who may read them (`access.read`); the CMS
|
|
110
|
+
refuses to start otherwise, so nothing is public by accident.
|
|
111
|
+
|
|
112
|
+
`cms` is typed by its collections: `cms.get(actor, "posts", slug)` returns
|
|
113
|
+
`fields` as the zod output, and an unknown collection name is a compile
|
|
114
|
+
error. On `update`, `fields` is a JSON Merge Patch: keys you send replace,
|
|
115
|
+
`null` removes, the rest stay.
|
|
116
|
+
|
|
117
|
+
`timeZone` (default `UTC`) decides which calendar day a usage count lands on.
|
|
118
|
+
`afterChange` hooks and `cms.onChange` listeners get a second argument
|
|
119
|
+
`{ contentChanged }`: false when only a draft changed and the public copy is
|
|
120
|
+
the same (skip revalidating pages then).
|
|
121
|
+
|
|
122
|
+
`managed: true` makes a collection writable only by your app code (the
|
|
123
|
+
`system` actor): users and keys can read it but not change it. Use it when the
|
|
124
|
+
app wraps saves in rules of its own.
|
|
125
|
+
|
|
126
|
+
**3. The route** (`app/api/cms/[...path]/route.ts`):
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { createCmsHandler } from "@mainsoft/agent-cms/http";
|
|
130
|
+
|
|
131
|
+
const handler = createCmsHandler({ cms, basePath: "/api/cms", resolveUser });
|
|
132
|
+
export { handler as GET, handler as POST, handler as PUT, handler as PATCH, handler as DELETE };
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
That gives you REST under `/api/cms/...` (route list at the top of
|
|
136
|
+
`src/http.ts`) and MCP at `/api/cms/mcp`. A document GET sends
|
|
137
|
+
`ETag: "v<n>"`; send it back as `If-Match` on PATCH/DELETE (or pass
|
|
138
|
+
`expectedVersion`). `requireIfMatch: true` refuses writes without one (428).
|
|
139
|
+
|
|
140
|
+
## Admin screens
|
|
141
|
+
|
|
142
|
+
The screens are source files you copy into your app and then own, like
|
|
143
|
+
shadcn/ui. They use your shadcn/ui parts (`components.json` decides where
|
|
144
|
+
they go and how imports are written) and talk to the CMS through
|
|
145
|
+
`createRestClient` from `./client`.
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
npx agent-cms add --list
|
|
149
|
+
npx agent-cms add cms-shell cms-doc-list cms-doc-editor cms-versions cms-keys cms-audit cms-command
|
|
150
|
+
npx agent-cms add --diff # what a new release would change in your copies
|
|
151
|
+
npx agent-cms add --update # update files you did not edit; yours get a .new copy
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Missing shadcn parts are listed with the `npx shadcn add …` line to run
|
|
155
|
+
(`--yes` runs it). `agent-cms.json` records what was copied.
|
|
156
|
+
|
|
157
|
+
The same screens install with the shadcn CLI, from any host that serves the
|
|
158
|
+
registry (`npm run build:registry -- --base-url <url> --out <dir>` writes it).
|
|
159
|
+
Files go to `<components>/cms/`; the shadcn parts and the screens an item
|
|
160
|
+
needs come along:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
npx shadcn@latest add <registry-url>/cms-doc-editor.json
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`agent-cms add --diff` and `--update` only know about copies made with
|
|
167
|
+
`agent-cms add`.
|
|
168
|
+
|
|
169
|
+
| Item | What it is |
|
|
170
|
+
|---|---|
|
|
171
|
+
| `cms-shell` | Sidebar with collections, API keys and audit log, plus an `extraNav` slot for your own screens; a sheet menu on phones |
|
|
172
|
+
| `cms-doc-list` | State tabs (draft, published, modified since publish, hidden), filters, 7-day views, bulk publish / unpublish / hide / unhide / delete with a confirm and a result list; long-press to select on phones |
|
|
173
|
+
| `cms-doc-editor` | Fields form generated from the collection's zod schema, markdown with split preview, autosave and restore, problems list, agent change blocks (accept, revert, accept all), public link, draft preview link |
|
|
174
|
+
| `cms-merge` | When someone saved first: what merged by itself, and for each overlap theirs / mine / both |
|
|
175
|
+
| `cms-versions` | History, side-by-side or unified diff, restore, publish an old version |
|
|
176
|
+
| `cms-keys` | Keys with expiry; the secret is shown once with MCP and CLI set-up |
|
|
177
|
+
| `cms-audit` | Who did what, filterable |
|
|
178
|
+
| `cms-command` | ⌘K to find any document, drafts included |
|
|
179
|
+
| `cms-empty` | Empty collection: new document, or how to write with an agent |
|
|
180
|
+
|
|
181
|
+
UI text is English by default; a Korean catalog ships with the screens.
|
|
182
|
+
|
|
183
|
+
### Agent changes, merges, previews, bulk actions
|
|
184
|
+
|
|
185
|
+
- **Agent changes.** Each body hunk an API key or your assistant saved is a
|
|
186
|
+
review item until a person accepts it (`cms.reviewChanges`) or reverts it in
|
|
187
|
+
the editor (saved as one version). `cms.agentChanges(actor, col, slug)` lists
|
|
188
|
+
what is open.
|
|
189
|
+
- **Merge.** A 409 carries `current`; `mergeDocs(base, mine, theirs)` from
|
|
190
|
+
`./diff` (browser-safe) merges the body by lines and the other values by
|
|
191
|
+
field. "Both" puts theirs first, then mine.
|
|
192
|
+
- **Draft preview links.** With `previewSecret`, `cms.createPreviewLink(actor,
|
|
193
|
+
col, slug, { ttl: "1h" | "24h" | "7d" })` signs a link to that exact
|
|
194
|
+
version. Your public page renders it:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
const token = searchParams.cms_preview;
|
|
198
|
+
const doc = token ? (await cms.readPreview(token)).doc : await cms.get(anon, "posts", slug);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Links cannot be revoked one by one; rotating `previewSecret` revokes all.
|
|
202
|
+
- **Bulk.** `cms.bulk(actor, col, "publish" | "unpublish" | "archive" |
|
|
203
|
+
"unarchive" | "delete", items)` runs each document on its own and returns
|
|
204
|
+
`{ slug, ok, error? }` for each.
|
|
205
|
+
|
|
206
|
+
## Agents
|
|
207
|
+
|
|
208
|
+
### Your own agent (AI SDK, slash-agent-sdk)
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
import { streamText } from "ai";
|
|
212
|
+
import { cmsTools } from "@mainsoft/agent-cms/ai";
|
|
213
|
+
|
|
214
|
+
const result = streamText({
|
|
215
|
+
model,
|
|
216
|
+
tools: {
|
|
217
|
+
...myTools,
|
|
218
|
+
// Every tool this actor may use; `only` and `prefix` narrow and rename.
|
|
219
|
+
...cmsTools(cms, { kind: "system", label: "assistant" }, { prefix: "cms_" }),
|
|
220
|
+
},
|
|
221
|
+
messages,
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
From another process (a script, a scheduled job, another service), use a key:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
import { remoteCmsTools } from "@mainsoft/agent-cms/ai";
|
|
229
|
+
|
|
230
|
+
const tools = remoteCmsTools(
|
|
231
|
+
{ url: "https://app.example.com/api/cms", key: process.env.AGENT_CMS_KEY! },
|
|
232
|
+
{ only: ["search_documents", "get_document", "patch_document"] }
|
|
233
|
+
);
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`await remoteCmsToolsFor(client, opts)` does the same but first asks the
|
|
237
|
+
server which tools the key may use (`tools/list`), so a read-only key is
|
|
238
|
+
offered read tools only.
|
|
239
|
+
|
|
240
|
+
Tool errors come back as results, not throws, so the model can re-read and
|
|
241
|
+
retry: `{ error: "conflict_version", kind: "conflict", message, params: {
|
|
242
|
+
expected, current } }`. Every code is in `./errors` (`ERROR_CODES`).
|
|
243
|
+
|
|
244
|
+
| Tool | Needs |
|
|
245
|
+
|---|---|
|
|
246
|
+
| `list_collections`, `search_documents`, `read_for_answer`, `list_documents`, `get_document` | read |
|
|
247
|
+
| `create_document`, `update_document`, `patch_document`, `diagnose_document`, `list_versions`, `restore_version` | write |
|
|
248
|
+
| `publish_document`, `unpublish_document`, `archive_document`, `delete_document`, `bulk_documents` | publish |
|
|
249
|
+
|
|
250
|
+
`lookupForAgent(cms, actor, collections, question, { budget, countTokens })`
|
|
251
|
+
(`./agent`) is the answer-a-user helper behind `read_for_answer`: matching
|
|
252
|
+
sections with citation ids, resolved `[[link:key|label]]` links, the URL of
|
|
253
|
+
each section, whether a person or an agent wrote it, and `context`, the
|
|
254
|
+
sections wrapped in `<cms-document>` tags that tell the model the text is
|
|
255
|
+
reference, not instructions. With a budget and your tokenizer it packs
|
|
256
|
+
sections to fit. `verifyCitations(citations, lookup)` checks an answer's
|
|
257
|
+
citation ids and quotes.
|
|
258
|
+
|
|
259
|
+
### Search misses
|
|
260
|
+
|
|
261
|
+
```ts
|
|
262
|
+
createCms({
|
|
263
|
+
onSearchMiss: async (e) => {
|
|
264
|
+
// { query, normalized, collections, actor, source, at, nearest }
|
|
265
|
+
if (e.actor.kind === "anonymous") return;
|
|
266
|
+
await db.insert(searchMisses).values({ query: e.query, normalized: e.normalized, collection: e.collections[0] })
|
|
267
|
+
.onConflictDoUpdate({ target: [searchMisses.collection, searchMisses.normalized], set: { count: sql`${searchMisses.count} + 1` } });
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
It is called only when the caller asked (`search(..., { reportMiss: true })`,
|
|
273
|
+
`GET /search?miss=1`, `read_for_answer`), never awaited, and its errors go to
|
|
274
|
+
`onError`. `normalized` ignores particles and word order, so group by it.
|
|
275
|
+
`search_documents` (a duplicate check before writing) never reports.
|
|
276
|
+
|
|
277
|
+
### Coding agents (MCP)
|
|
278
|
+
|
|
279
|
+
Register `https://app.example.com/api/cms/mcp` with the header
|
|
280
|
+
`Authorization: Bearer sgk_…`. The key's scopes decide which tools it sees.
|
|
281
|
+
Published documents are also resources (`cms://<collection>/<slug>`), and
|
|
282
|
+
two prompts (`answer_from_cms`, `edit_document`) show the safe way to work.
|
|
283
|
+
|
|
284
|
+
For public docs that any agent may read without a key, turn on anonymous read:
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
createCmsHandler({ cms, resolveUser, mcp: { anonymous: "read" } });
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
A request without a key then gets the read tools only (`list_collections`,
|
|
291
|
+
`search_documents`, `read_for_answer`, `list_documents`, `get_document`) and
|
|
292
|
+
sees published documents of collections anyone may read. Write tools are not
|
|
293
|
+
listed and calling one fails with `unknown_tool`. Requests with a key work as
|
|
294
|
+
before. The default stays off (401 without a key).
|
|
295
|
+
|
|
296
|
+
### CLI
|
|
297
|
+
|
|
298
|
+
```
|
|
299
|
+
export AGENT_CMS_URL=https://app.example.com/api/cms AGENT_CMS_KEY=sgk_…
|
|
300
|
+
npx agent-cms collections
|
|
301
|
+
npx agent-cms search "slack 연결" --collections guide
|
|
302
|
+
npx agent-cms get posts hello-world --draft
|
|
303
|
+
npx agent-cms put posts ./hello-world.md --publish --note "launch post"
|
|
304
|
+
npx agent-cms patch posts hello-world ./ops.json --expected-version 3 --dry-run
|
|
305
|
+
npx agent-cms call archive_document '{"collection":"posts","slug":"old","archived":true}'
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
`put` creates the document. To update one that exists, pass the version you
|
|
309
|
+
read (`get <collection> <slug> --draft` shows it) as `--expected-version N`;
|
|
310
|
+
if someone saved since, `put` fails with a conflict instead of overwriting
|
|
311
|
+
their edit. `--force` skips that check. The file is markdown with
|
|
312
|
+
frontmatter; keys other than `slug`, `title`, `summary`, `category` and
|
|
313
|
+
`keywords` go into `fields`:
|
|
314
|
+
|
|
315
|
+
```
|
|
316
|
+
---
|
|
317
|
+
title: Hello, world
|
|
318
|
+
summary: Our first post
|
|
319
|
+
category: News
|
|
320
|
+
tags: [launch]
|
|
321
|
+
---
|
|
322
|
+
Body in **markdown**.
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`--env <file>` reads `AGENT_CMS_URL` / `AGENT_CMS_KEY` from a file instead.
|
|
326
|
+
|
|
327
|
+
## Rendering
|
|
328
|
+
|
|
329
|
+
`@mainsoft/agent-cms/markdown` is browser-safe: `parseMarkdown` gives a
|
|
330
|
+
small block tree (headings with stable anchors, lists, callouts `> [!tip]`,
|
|
331
|
+
code, link rows) and `extractToc` a table of contents. Render it with your
|
|
332
|
+
own components.
|
|
333
|
+
|
|
334
|
+
## Develop
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
npm ci
|
|
338
|
+
npm run typecheck && npm test && npm run build
|
|
339
|
+
npm run test:db # pglite, or a server with DATABASE_URL
|
|
340
|
+
npm run test:ui # admin screens (jsdom, Testing Library, axe)
|
|
341
|
+
npm run test:e2e # browser tests against examples/next (Playwright)
|
|
342
|
+
bash scripts/pack-smoke.sh # install the packed tarball into a fresh app
|
|
343
|
+
npm run check:pack # publint and arethetypeswrong
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
`examples/next` is a Next.js 14 app made with `init` and `add`, on pglite;
|
|
347
|
+
the browser tests run against it.
|
|
348
|
+
|
|
349
|
+
Release: bump `version` in `package.json`, push a `v<version>` tag; the
|
|
350
|
+
Publish workflow publishes it to npmjs.com with provenance.
|
|
351
|
+
|
|
352
|
+
`bash scripts/shadcn-smoke.sh` (`npm run test:shadcn`) builds the shadcn
|
|
353
|
+
registry, serves it locally and installs a screen into a fresh Next.js app
|
|
354
|
+
with `npx shadcn add`, then type-checks and builds that app.
|
|
355
|
+
|
|
356
|
+
The roadmap is in [TODO.md](./TODO.md).
|
|
357
|
+
|
|
358
|
+
## License
|
|
359
|
+
|
|
360
|
+
MIT
|
package/TODO.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# agent-cms TODO
|
|
2
|
+
|
|
3
|
+
일반 웹 앱(Next.js 등)에 얹어서 함께 돌아가는 **애드온 CMS**. 사람(어드민 화면)과 에이전트(REST, MCP, AI SDK 도구)가 같은 문서를 같이 고친다.
|
|
4
|
+
블로그, 사내 문서, 개발 문서, 공지, 게시판처럼 CMS가 쓰이는 곳이면 어디든 쓸 수 있어야 한다. 특정 앱의 개발 흐름(PR, CI, 배포)에 묶인 기능은 라이브러리에 넣지 않는다. 그런 흐름은 앱이 이 라이브러리의 도구(`./ai`, CLI)를 써서 직접 짠다.
|
|
5
|
+
이 목록은 라이브러리를 키울 때의 백로그다. 서비서(첫 사용처)는 새 버전을 받아 올려 쓴다.
|
|
6
|
+
사용자 질문(검색어, 못 찾은 질문, 질의 로그)은 앱의 데이터다. 라이브러리는 이를 저장하지 않고 `onSearchMiss` 같은 이벤트 훅만 낸다. 저장과 운영 화면은 앱이 맡는다(0.6.0부터). 삭제한 항목도 번호는 그대로 둔다.
|
|
7
|
+
|
|
8
|
+
표기: **[P0]** 떼어 내기 전에 필요, **[P1]** 첫 공개 버전, **[P2]** 그 뒤.
|
|
9
|
+
출처: (lead) 리드 에이전트, (A)~(D) 검토 에이전트 4개.
|
|
10
|
+
|
|
11
|
+
## 0. 지금 있는 것 (기준선)
|
|
12
|
+
|
|
13
|
+
- 컬렉션 설정 (`defineCollection`): 분류, zod `fields`, 버전 보관 수, 초안 모드 또는 바로 반영 모드, 금지 문자, 검색과 못 찾은 질문 기록(0.6.0에서 제거, `onSearchMiss` 훅으로 대체), `[[link:key|label]]` 화면 링크 검증, 공개 URL, 접근 함수, `afterChange` 훅
|
|
14
|
+
- 문서 상태: draft / published / archived. 버전마다 전체 스냅샷을 남기고, 되돌리기는 새 버전을 만든다
|
|
15
|
+
- 동시 편집 보호: `expectedVersion`이 다르면 409
|
|
16
|
+
- 한글 2-gram 메모리 검색 (섹션 단위, 조사 제거, 불용어, 영문 오타 1글자 허용)
|
|
17
|
+
- API 키: sha256 해시만 저장, read / write / publish / admin 범위와 컬렉션 제한
|
|
18
|
+
- REST 하나와 stateless MCP(JSON-RPC)
|
|
19
|
+
- 도구 목록 하나(`tools.ts`)를 MCP, AI SDK 도구(`./ai`: `cmsTools`, `remoteCmsTools`, slash-agent-sdk에서도 그대로), CLI가 함께 쓴다
|
|
20
|
+
- CLI: `tools`, `collections`, `list`, `get`, `search`, `put <file.md>`(frontmatter), `publish`, `call`
|
|
21
|
+
- 저장소 인터페이스: `MemoryRepo`(테스트), `DrizzleRepo`(Postgres)
|
|
22
|
+
|
|
23
|
+
## 1. 리드 아이디어 (lead)
|
|
24
|
+
|
|
25
|
+
### 콘텐츠 모델
|
|
26
|
+
1. **[P1] 필드 스키마로 어드민 폼 자동 생성.** zod `fields`를 읽어 입력 컴포넌트(텍스트, 숫자, 선택, 날짜, 불리언, 배열, 관계)를 고르고, 필드마다 `admin: { label, help, widget }` 메타를 붙인다. 지금은 `fields`가 JSON으로만 다뤄진다.
|
|
27
|
+
2. **[P1] 관계 필드.** `relation('guide')`처럼 다른 문서를 가리키고, 삭제와 보관 때 참조하는 쪽을 경고한다. 공개 화면에서는 "관련 문서"로 그린다.
|
|
28
|
+
3. **[P2] 블록(섹션) 기반 본문.** 마크다운 외에 callout, 단계, 이미지, 표, 영상, 링크 카드 블록 배열을 쓰는 모드. 에이전트에게는 블록 단위로 패치하게 한다.
|
|
29
|
+
4. **[P1] 문서 트리와 순서.** `parent`와 `order`로 사이드바 목차를 정하고, 어드민에서 끌어서 순서를 바꾼다. 지금은 분류 안에서 갱신 시각순이다.
|
|
30
|
+
5. **[P1] 다국어(locale).** 문서마다 locale별 콘텐츠를 두고, 번역이 낡았는지(원문 버전보다 이전인지) 표시한다. 에이전트 번역 초안을 만들고 사람이 검토한다.
|
|
31
|
+
|
|
32
|
+
### 편집과 검토
|
|
33
|
+
6. **[P0] 버전 diff 화면.** 두 버전의 필드별 차이와 본문 줄 단위 diff를 보여 준다. 되돌리기 전에 꼭 필요하다. [완료 0.6.0]
|
|
34
|
+
7. **[P1] 예약 게시와 예약 숨김.** `publishAt`, `unpublishAt`. 앱의 크론(Inngest 등)에 붙일 `runScheduled()`를 제공한다.
|
|
35
|
+
8. **[P1] 검토 요청 흐름.** 에이전트가 쓴 버전은 "검토 대기"로 두고, 승인한 사람과 시각을 기록한다. 컬렉션마다 "에이전트 글은 사람 승인 필수"를 켤 수 있다.
|
|
36
|
+
9. **[P1] 편집 잠금 표시.** 누가 이 문서를 열고 있는지 보여 준다(하트비트, 오래되면 자동 해제). 409보다 앞서 충돌을 막는다.
|
|
37
|
+
10. **[P2] 버전 간 3-way 병합.** 409가 났을 때 내 변경과 남의 변경이 겹치지 않으면 자동으로 합친다. [완료 0.6.0]
|
|
38
|
+
11. **[P1] 미리보기 링크.** 서명된 토큰으로 초안을 공개 화면 모양 그대로 보는 URL(만료 시간 포함). 로그인 없이 리뷰어에게 보낼 수 있다. [완료 0.6.0]
|
|
39
|
+
|
|
40
|
+
### 검색과 에이전트
|
|
41
|
+
12. **[P1] 선택형 임베딩 검색.** 키워드 점수와 벡터 점수를 섞고(pgvector 어댑터), 키워드만으로도 돌아가게 둔다. 임베딩은 게시 때만 다시 계산한다.
|
|
42
|
+
13. **[P1] 동의어 사전.** 컬렉션 설정이나 어드민에서 "슬랙 = slack", "ppt = 발표 자료 = 슬라이드"를 관리한다. 지금은 문서마다 keywords에 반복해 넣어야 한다.
|
|
43
|
+
14. ~~**[P1] 못 찾은 질문에서 바로 초안 만들기.** 같은 의도의 질문을 묶고, "이 질문들로 초안 쓰기"를 에이전트에게 맡긴다(MCP 도구 `draft_from_gaps`).~~ [삭제] 사용자 질문은 앱 데이터. 앱이 `onSearchMiss`로 모은 질문으로 직접 에이전트를 부른다.
|
|
44
|
+
15. **[P1] 검색 품질 평가 세트.** `queries.eval.json`(질문 → 기대 문서)과 CLI `agent-cms eval`로 순위 회귀를 CI에서 잡는다.
|
|
45
|
+
16. **[P2] 답변 피드백 수집.** 에이전트가 문서로 답한 뒤 사용자의 반응(도움 됨/안 됨, 이어서 다시 물음)을 문서별 점수로 모은다.
|
|
46
|
+
|
|
47
|
+
### 운영과 보안
|
|
48
|
+
17. **[P0] 감사 로그.** 키 생성과 폐기, 게시, 삭제, 권한 실패를 누가 언제 했는지 남긴다. 지금은 버전 기록만 있다. [완료 0.6.0]
|
|
49
|
+
18. **[P1] 키 사용량 제한(rate limit)과 만료일.** 키마다 분당 요청 수와 만료일, IP 허용 목록을 둔다. [0.6.0에서 만료일만]
|
|
50
|
+
19. **[P1] 소프트 삭제와 휴지통.** 삭제는 30일 보관 뒤 영구 삭제한다. 지금은 바로 지운다.
|
|
51
|
+
20. **[P1] 웹훅.** 게시, 수정, 삭제 때 서명된 POST를 보낸다(재시도, 실패 기록). ISR 재검증이나 Slack 알림에 쓴다.
|
|
52
|
+
21. **[P2] 멀티 테넌트.** `tenant` 열을 두고, 한 앱 안의 워크스페이스마다 별도 문서 세트를 둔다.
|
|
53
|
+
|
|
54
|
+
### 패키징과 개발 경험
|
|
55
|
+
22. **[P0] 다른 저장소로 분리.** `@mainsoft/agent-cms`로 만들고 엔트리를 나눈다(server, http, mcp, ai, react, markdown, cli). peer deps는 drizzle-orm, zod, ai(선택), react(선택).
|
|
56
|
+
23. **[P0] 공식 MCP SDK로 교체.** 지금은 손으로 짠 JSON-RPC다. `@modelcontextprotocol/sdk`로 바꾸고 resources(문서를 리소스로)와 prompts도 노출한다. [완료 0.6.0]
|
|
57
|
+
24. **[P1] `agent-cms add <component>` 레지스트리.** shadcn처럼 어드민 UI 컴포넌트를 앱으로 복사해 넣는다(문서 목록, 편집기, 버전 기록, 키 관리). [완료 0.6.0]
|
|
58
|
+
25. **[P1] 마이그레이션 생성기.** `agent-cms ddl`이 버전별 증분 SQL을 내보내고, 앱의 마이그레이션 체계(drizzle-kit, 직접 작성한 guarded step)에 붙인다.
|
|
59
|
+
26. **[P1] 가져오기와 내보내기.** 폴더의 md(frontmatter)와 DB를 서로 옮기는 CLI(`agent-cms export ./content`, `import`). 백업과 초기 시드, 로컬 편집에 쓴다.
|
|
60
|
+
27. **[P2] Next 이외 어댑터.** Hono, Express, Remix용 핸들러(지금 핸들러는 fetch `Request`/`Response`라 얇게 감쌀 수 있다).
|
|
61
|
+
28. **[P1] 예제 앱과 문서 사이트.** 문서 사이트 자체를 agent-cms로 만든다.
|
|
62
|
+
|
|
63
|
+
## 2. 편집 경험과 콘텐츠 모델 (A)
|
|
64
|
+
|
|
65
|
+
29. **[P0] 전체 진단 `diagnose()`와 필드별 오류.** 지금 `validate()`는 첫 오류에서 throw한다. `Diagnostic[]`(`{ path, code, message, params }`)을 한 번에 돌려주고 `POST /collections/:c/_diagnose`로 저장 없이 검사한다. 폼은 입력마다 `aria-invalid`를 붙이고, 에이전트는 한 번에 모든 문제를 받는다. (Payload, Sanity) [완료 0.6.0]
|
|
66
|
+
30. **[P0] 오류 코드 계약과 문구 카탈로그.** `CmsError`의 한국어 산문을 `invalid_slug`, `unknown_link`, `conflict_version` 같은 세분 코드와 `params`로 바꾸고 `createCms({ messages })`로 문구를 주입한다. 공개 패키지가 한국어 전용이 되지 않게 한다. (Directus, Strapi) [완료 0.6.0]
|
|
67
|
+
31. **[P0] 버전을 만들지 않는 자동 저장.** `autosave jsonb`, `autosave_at`, `autosave_by`에 저장하고 버전은 사람이 저장할 때만 만든다. 다시 열면 "저장하지 않은 내용을 복구할까요?"를 띄운다. 자동 저장이 `versions.max`를 채워 실제 이력을 밀어내는 것을 막는다. (Payload autosave) [완료 0.6.0]
|
|
68
|
+
32. **[P0] 복사형 어드민의 접근성 계약.** `role="status"` 저장 알림, `label`과 `aria-describedby`, 포커스 트랩과 복귀, 키보드만으로 생성부터 게시와 되돌리기까지. jsdom과 axe 검사로 고정한다. (Sanity Studio)
|
|
69
|
+
33. **[P1] "에이전트가 바꾼 곳" 표시와 부분 되돌리기.** `commit()`이 필드 단위 diff를 `cms_versions.changed`에 남기고, 편집 화면 상단에 "에이전트가 v12에서 제목, 본문 2곳을 바꿨어요"를 띄운다. hunk마다 "이 부분만 되돌리기"는 새 버전을 만든다. (Sanity AI Assist, Directus) [완료 0.6.0]
|
|
70
|
+
34. **[P1] 섹션에 붙는 댓글.** `cms_comments`(anchor, quote, thread, resolvedAt). 앵커는 `splitSections()`의 것을 쓴다. 서명된 미리보기 링크로 온 외부 리뷰어도 댓글만 남길 수 있다. 에이전트는 댓글을 읽고 수정안을 새 버전으로 만든다. (Directus, Sanity)
|
|
71
|
+
35. **[P1] 분할 라이브 미리보기와 스크롤 동기화.** 저장 전 로컬 상태로 200ms 디바운스 렌더, 커서 섹션과 미리보기 앵커를 양방향으로 맞추고, 375/768/전체 폭 전환을 둔다. `renderBlocks(blocks, components)`로 앱 컴포넌트를 주입한다. (Payload live preview, TinaCMS)
|
|
72
|
+
36. **[P1] 미리보기에서 소스로 점프.** 블록에 `line`, `endLine`을 남겨 제목을 누르면 편집기의 해당 줄을 선택한다. 댓글 인용과 섹션 diff에도 같은 좌표를 쓴다. (TinaCMS click-to-edit)
|
|
73
|
+
37. **[P1] 저장 없는 미리보기 API.** `cms.preview(actor, col, input)`가 `{ blocks, toc, diagnostics, diff, publicUrl }`를 돌려준다. 어드민 미리보기와 에이전트의 저장 전 자기 점검이 같은 코드를 쓴다.
|
|
74
|
+
38. **[P1] 앵커 고정과 별칭.** `## 제목 {#id}`로 명시 앵커를 허용하고, 제목을 바꾸면 옛 앵커를 `cms_anchor_aliases`에 남겨 공개 화면과 에이전트가 준 링크가 끊기지 않게 한다. (Mintlify, Fumadocs)
|
|
75
|
+
39. **[P1] 슬러그 도우미와 게시 후 주소 변경.** 한글 제목에서 `suggestSlug()`(로마자 표기 + 중복 검사)를 만들고, 게시 뒤 주소를 바꾸면 `cms_redirects`에 자동 기록한다. 지금은 게시 후 변경이 아예 금지돼 있다.
|
|
76
|
+
40. **[P1] 문서 구조 린트와 게시 전 품질 게이트.** `structure: { requiredSections, maxSectionChars, requireIntro, requireLink }`. 목록에 품질 배지, 게시 다이얼로그에 체크리스트. 검색이 `##` 단위라 구조가 곧 검색 품질이다. (Fumadocs, Mintlify)
|
|
77
|
+
41. **[P1] 컬렉션별 문서 템플릿.** `templates: [{ key, label, body, fields }]`, `cms.create({ template })`, MCP `list_templates`. 사람과 에이전트가 같은 골격에서 시작한다. (Sanity initial value templates)
|
|
78
|
+
42. **[P1] 재사용 스니펫.** `[[snippet:key]]`로 다른 문서를 끼워 넣고, 순환 감지와 "이 스니펫을 쓰는 문서 5개" 역색인을 둔다. (Mintlify snippets)
|
|
79
|
+
43. **[P1] 내부 링크와 고아 문서 리포트.** `cms.linkReport()`가 `{ broken, orphans, unreachable }`를 돌려주고 어드민 "링크" 탭과 MCP 도구로 노출한다.
|
|
80
|
+
44. **[P1] 외부 URL 미디어와 figure 블록.** `{ url, alt, caption, width, height }`, alt 필수, https만, CLS 방지 상자, lazy 로딩. 업로드 저장소는 그 뒤. (Strapi)
|
|
81
|
+
45. **[P1] 붙여넣기 정규화.** HTML을 지원 부분집합 마크다운으로 바꾸고(turndown), 제로폭 문자와 스마트 따옴표를 정리하며, 사라질 문법은 편집기에서 경고한다. (Payload Lexical)
|
|
82
|
+
46. **[P2] 버전 이름표와 고정.** `cms_versions.label`, `pinned`; prune이 고정 버전을 보호한다. (Directus)
|
|
83
|
+
47. **[P1] 어드민 ⌘K 빠른 열기.** 초안 포함 문서 퍼지 검색, 최근 편집, 게시와 버전 기록 같은 액션. (Sanity)
|
|
84
|
+
48. **[P2] 섹션 단위 편집기.** 섹션 카드로 편집, 순서 변경, 삽입. 댓글, 점프, 린트의 위치 기준이 된다. (Sanity Portable Text)
|
|
85
|
+
|
|
86
|
+
## 3. 에이전트와 검색 (B)
|
|
87
|
+
|
|
88
|
+
49. **[완료 0.5.0] 도구 스펙 단일 레지스트리와 `/ai` 진입점.** MCP와 AI SDK 도구가 같은 `ToolDef[]`(이름, 설명, zod 입력, 권한)를 쓰게 `tools.ts`로 옮기고, `createAgentTools(cms, { collections })`가 `search_docs`, `get_doc`, `report_gap`을 만든다. 지금 서비서는 앱 쪽에서 직접 감싼다.
|
|
89
|
+
50. **[P0] 토크나이저 기반 컨텍스트 패커.** 지금은 섹션을 1,400자로 자른다. 호출자가 넘긴 프로바이더 `countTokens`로만 예산을 계산하고(문자 수 추정 금지), 문장 경계 절단, 중복 억제, `{ sections, usedTokens, dropped }`를 돌려준다. (Context7 `tokens` 파라미터) [완료 0.6.0]
|
|
90
|
+
51. **[P0] 섹션 패치 API.** `patch(actor, col, slug, ops)`; op는 `replace | insert_after | insert_before | delete | append` + `anchor`. 틀린 앵커는 유효 앵커 목록과 함께 422, `dryRun`은 unified diff. 60k 본문을 통째로 다시 쓰는 비용과 불필요한 409를 없앤다. MCP `patch_document`. [완료 0.6.0]
|
|
91
|
+
52. **[P0] 인용 계약과 검증.** `citations: [{ id: "cms://guide/slack#connect", quote, charRange }]`와 `verifyCitations(answer, lookup)`. 앱이 출처를 그리고 없는 slug/anchor를 잡는다. (Inkeep, GitBook) [완료 0.6.0]
|
|
92
|
+
53. **[P0] 사용 기록에 출처 붙이기.** `cms_hits`에 `source`(ai, mcp, rest)와 MCP `clientInfo`를 남긴다. 이번에 `lookupForAgent`가 기록을 시작했다. (GitBook 분석) [완료 0.6.0]
|
|
93
|
+
54. **[P1] 에이전트 작업 레시피.** "코드가 바뀌면 에이전트를 불러 관련 문서를 고친다", "출시 때 공지 초안을 쓴다" 같은 흐름을 라이브러리 기능이 아니라 예제(`examples/`)로 보여 준다. `remoteCmsTools` + 모델 호출 몇 줄이면 되게.
|
|
94
|
+
55. **[P1] `llms.txt`, `llms-full.txt`, 문서별 `.md`.** `GET /llms.txt`와 `/:c/:slug.md`를 `changeStamp()` 캐시와 함께 연다. (Mintlify)
|
|
95
|
+
56. **[P1] 컬렉션 설정으로 만드는 MCP `instructions`.** 컬렉션, 링크 키, 금지 문자, 필드 설명을 담은 안내문을 생성하고 내용 해시가 바뀔 때만 바꿔 캐시를 지킨다. (Mintlify `skill.md`)
|
|
96
|
+
57. **[P2] 계층 색인과 이웃 섹션.** `###`를 자식 단위로 색인하고 결과에 `more: [{ anchor, rel: prev | next | child }]`를 붙여 재검색 없이 넓힌다. (Context7)
|
|
97
|
+
58. **[P1] 순위 함수 수리.** 필드 최댓값만 쓰는 지금 방식에 BM25식 tf 포화, 섹션 길이 정규화, 섹션 단위 coverage(형제 섹션이 대신 맞춰 주지 않게), 신선도 감쇠, `fields` 저가중 색인을 넣는다. (Algolia)
|
|
98
|
+
59. **[P1] 코드 블록과 오류 문자열 색인.** 지금 `plainText`가 펜스 코드를 지워 `ENOTFOUND` 같은 문자열을 못 찾는다. 별도 필드, 정확 일치 보너스, `matchedTerms` 반환.
|
|
99
|
+
60. **[P1] 한글 자모, 초성, 한글 오타.** "슬렉", "ㅅㄹ" 같은 입력을 자모 분해와 초성 토큰으로 받고, 영문 오타 스캔은 BK-tree로 바꾼다.
|
|
100
|
+
61. **[P2] 동의어 후보 받기.** 앱이 자기 질문 기록에서 뽑은 후보를 `cms.proposeSynonyms([{ term, target }])`로 넘기고 어드민에서 승인한다(`cms_synonyms(term, target, state: proposed | active)`). 키워드에서 슬랙↔slack 같은 로마자 별칭 뽑기는 라이브러리가 한다. (Algolia dynamic synonyms)
|
|
101
|
+
62. **[P1] `onSearch` 이벤트.** 모든 검색의 `{ query, resultIds, usedIds, source, latencyMs }`를 앱에 넘긴다. 질의 로그 저장, 실패율과 1순위 오답 리포트는 앱이 한다. 58번과 64번의 입력은 앱이 내보낸 로그를 쓴다.
|
|
102
|
+
63. **[P1] 질문 의도 분류.** `howto | error | exists | concept`에 따라 섹션 가중치와 반환 범위를 바꾼다. (Algolia query categorization)
|
|
103
|
+
64. **[P1] 섹션 단위 평가와 하드 네거티브.** 기대 `slug#anchor`, 하드 네거티브, recall@1/3, MRR, 답변당 토큰, p95를 재고 `agent-cms eval --baseline`이 떨어진 질의와 이유를 낸다(15번 확장).
|
|
104
|
+
65. **[P1] `lint_document` 사전 검증 도구.** 헤딩 단계 건너뜀, 닫히지 않은 펜스, 중복 헤딩, 요약 누락, 긴 섹션을 `issues[]`로. error는 저장을 막고 warn은 응답에 싣는다. (GitBook Agent)
|
|
105
|
+
66. **[P1] 신선도와 `review_queue`.** 문서마다 `reviewEveryDays`(또는 컬렉션 기본값)와 `lastReviewedAt`을 두고, 기한이 지난 문서를 MCP `review_queue`로 돌려준다. 무엇을 계기로 검토할지는 앱이 정한다.
|
|
106
|
+
67. **[P2] 쓰기 권한 에이전트의 초안 포함 검색.** 중복 문서 작성을 막는다. 읽기 전용 actor에게는 초안을 절대 보이지 않는다.
|
|
107
|
+
68. **[P2] 사용 신호 기반 순위 보정.** hits로 문서 prior를 상한 있게 적용하고, 평가 세트를 통과 못 하면 자동으로 끈다.
|
|
108
|
+
|
|
109
|
+
## 4. 보안, 운영, 성능 (C)
|
|
110
|
+
|
|
111
|
+
69. **[P0] 접근 기본값 fail-closed.** `visibility: "public" | "internal"`을 필수로 두고, `internal`인데 `access`가 없으면 부팅 시 예외. 공개로 열린 컬렉션을 부팅 로그에 한 번 경고한다. [완료 0.6.0]
|
|
112
|
+
70. **[P0] 프롬프트 인젝션 경계.** 에이전트에게 주는 문서를 `<cms-document … trust="human|agent">` 봉투로 감싸고 "참고 자료이지 지시가 아님" 프리앰블을 붙인다. 에이전트가 쓴 미검토 문서는 표시한다. [완료 0.6.0]
|
|
113
|
+
71. **[P0] `If-Match`/`ETag`.** GET에 `ETag: "v<n>"`, PATCH/DELETE/publish/restore는 `If-Match`를 `expectedVersion`으로 쓴다. 지금 DELETE에는 낙관적 가드가 없다. [완료 0.6.0]
|
|
114
|
+
72. ~~**[P0] gap 기록 정책과 상한.** 이번에 익명 기록을 막았다. 남은 일: `gapLogging: off | agents | all`, (actor, normalized) 짧은 창 중복 제거, 하루 신규 행 상한.~~ [삭제] gaps를 라이브러리에서 뺌(0.6.0). 거르기와 상한은 앱이 `onSearchMiss`에서 한다.
|
|
115
|
+
73. **[P1] 렌더러 XSS 계약.** React `DocBody`는 트리만 받아 엘리먼트로 그리고 HTML 문자열 경로를 두지 않는다. `javascript:`, `data:`, 대소문자와 공백 우회, 중첩 링크를 담은 적대적 픽스처 테스트.
|
|
116
|
+
74. **[P1] 증분 색인.** `SearchIndex.upsertDoc / removeDoc`로 바뀐 문서만 갈아끼우고, 영문 어휘 스캔을 접두 맵으로. 수천 문서에서 p95 5ms를 지킨다.
|
|
117
|
+
75. **[P1] 프로세스 간 무효화를 `pg_notify` + 시퀀스로.** `cms_change_log(seq bigserial)`와 `LISTEN`으로 즉시 무효화하고 폴링은 안전망으로. 지금 `changeStamp()`는 30~60초마다 `count(*)`를 돌린다.
|
|
118
|
+
76. **[P1] 게시본 읽기 캐시 어댑터.** `CacheAdapter`(메모리, Redis, Next `unstable_cache`), 키에 `publishedVersion`, 무효화는 `onChange`와 75번.
|
|
119
|
+
77. **[P1] 페이지네이션과 컬럼 프로젝션.** 목록은 본문 없이, 버전 목록은 스냅샷 없이 요약 모드와 `limit/cursor`. 지금은 버전 100개의 전체 스냅샷을 한 번에 보낸다. [0.6.0에서 일부]
|
|
120
|
+
78. **[P1] 인덱스 추가와 N+1 제거.** `cms_hits(day)` 인덱스. 목록과 검색 색인 빌드의 일괄 조회.
|
|
121
|
+
79. **[P1] CLI 확장.** `put`에 폴더 단위 일괄 처리(`put <collection> ./dir`), `--dry-run`, `diff`(파일과 현재 초안 비교), 출력 형식 `--format table`.
|
|
122
|
+
80. **[P1] 구조화 이벤트와 지표 훅.** `onEvent(e)`로 요청(라우트, actor 종류, 상태, ms), 검색(hit 수, ms), 색인 빌드, 훅 실패를 내보내 OTel/Prometheus에 연결한다.
|
|
123
|
+
81. **[P1] 보존 정책과 주체 삭제.** `retention: { hitsDays, revokedKeysDays }`, `purgeActor(id)`, `exportActor(id)`, `agent-cms retention --dry-run`.
|
|
124
|
+
82. **[P1] 스키마 버전 핀과 `doctor`.** `cms_meta.schema_version`을 부팅 때 비교해 명확히 실패하고, `doctor`가 테이블과 인덱스, 게시 버전 정합성, 고아 행, DDL 드리프트를 검사한다. 복구 절차(Neon PITR + 버전 스냅샷)를 문서화한다. [0.6.0에서 일부]
|
|
125
|
+
83. **[P2] 키 회전과 식별.** `rotateKey(id, { graceMinutes })`, 표시 접두 8자, `revoked_reason`, 선택적 `last_used_ip`. `touchKey`를 서버리스에서 유실되지 않게 `waitUntil`로.
|
|
126
|
+
|
|
127
|
+
## 5. 개발 경험, 패키징, 확장 (D)
|
|
128
|
+
|
|
129
|
+
84. **[P0] 설정에서 끝까지 이어지는 타입 `Cms<C>`.** `defineCollections([...] as const)` → `cms.get("guide", …)`의 `fields`가 `z.infer`로 좁혀지고 오타 슬러그는 컴파일 에러. (Payload generate:types, Better Auth `$Infer`) [완료 0.6.0]
|
|
130
|
+
85. **[P0] `agent-cms.config.ts`와 `defineConfig`.** 런타임과 CLI가 같은 파일을 읽는다(jiti). (Fumadocs `source.config.ts`, Keystone) [완료 0.6.0]
|
|
131
|
+
86. **[P0] `agent-cms init`과 `doctor`.** 설정 파일, `app/api/cms/[...path]/route.ts`, 스키마 재export, 환경 변수 자리까지 만들고 doctor가 초록이면 설치 끝. (shadcn) [완료 0.6.0]
|
|
132
|
+
87. **[P0] 분리 게이트.** `npm pack` 결과를 임시 Next 14 앱에 설치해 subpath `exports`가 실제로 resolve되는지, `publint`와 `attw` 검사. (지금 앱 import 금지 규칙은 `parts.test.ts`가 지킨다.) [완료 0.6.0]
|
|
133
|
+
88. **[P0] `cmsTables({ prefix, schema })` 팩토리.** `DrizzleRepo`가 테이블 세트를 생성자로 받고 `cmsDdl(tables)`도 접두사와 스키마를 따른다. (Payload `schemaName`) [완료 0.6.0]
|
|
134
|
+
89. **[P0] 스키마 버전 핸드셰이크와 `migrate check`.** 패키지가 기대하는 `SCHEMA_VERSION`과 DB를 비교해 빠진 컬럼만 guarded `ALTER`로 출력한다. 서비서의 `migrate-prod.ts` step 형식 그대로. [완료 0.6.0]
|
|
135
|
+
90. **[P1] 드라이버 독립 어댑터.** `PgDatabase` 계열로 넓히고 neon-http(트랜잭션 없음)는 `db.batch`로 폴백. postgres.js, pglite 팩토리.
|
|
136
|
+
91. **[P1] `createTestCms()`와 fetch 하네스.** `agent-cms/testing`에서 `seedDoc`, `asAdmin`, `asKey(scopes)`, `createFetchMock(cms)`. (Better Auth)
|
|
137
|
+
92. **[P1] 플러그인 시스템.** `definePlugin({ name, setup(ctx) })`로 훅, 컬렉션 확장, 라우트, 테이블 추가. 감사 로그, 웹훅, rate limit이 코어 수정 없이 붙는다. (Better Auth registry, Payload plugins)
|
|
138
|
+
93. **[P1] 전체 라이프사이클 훅.** `beforeValidate`, `beforeChange`(변형 가능), `afterChange`, `before/afterPublish`, `afterDelete`, `afterRead`와 `{ actor, previous, operation, abort }` 컨텍스트. (Payload hooks)
|
|
139
|
+
94. **[P1] 타입드 클라이언트와 TanStack Query 어댑터.** `createCmsClient()`의 `client.guide.update(slug, doc, { expectedVersion })`, `useDoc`, `useUpdateDoc`(409면 재조회).
|
|
140
|
+
95. **[P1] OpenAPI 3.1 출력.** `agent-cms openapi`와 `GET /api/cms/openapi.json`. TypeScript 밖(Python, Zapier, GPT action)의 공식 계약.
|
|
141
|
+
96. **[P1] `agent-cms types` 코드젠.** `.agent-cms/types.d.ts`(컬렉션 유니온, `Fields<"guide">`, `LinkKey`), `--check`로 CI에서 낡음 감지. (Fumadocs postinstall)
|
|
142
|
+
97. **[P1] 복사형 UI 소유권 추적과 3-way 업그레이드.** `agent-cms.json`에 복사한 파일의 버전과 해시를 남기고 `add --diff`, `add --update`(안 고친 파일만). shadcn 스키마의 `registry.json`도 빌드한다. [완료 0.6.0]
|
|
143
|
+
98. **[P1] 업그레이드 규율.** changesets, `@next` 프리릴리스, `agent-cms codemod v0.x`(ts-morph), 제거 예정 API의 1회 경고. (`@next/codemod`)
|
|
144
|
+
99. **[P1] 공개 렌더링 킷.** `agent-cms/next`: `generateDocParams`, 태그 캐시(`cms:guide:slug`), `revalidateDoc`, sitemap, RSS, OG 이미지.
|
|
145
|
+
100. **[P1] `agent-cms lint` 콘텐츠 린터.** 저장 검증과 같은 함수로 전체 문서를 검사하고 `--fix`, `--staged`(pre-commit).
|
|
146
|
+
101. **[P1] `agent-cms dev` 단독 하네스.** 호스트 앱 없이 pglite나 메모리 저장소로 어드민, REST, MCP를 띄운다. (Keystone dev)
|
|
147
|
+
102. **[P1] 호환성 매트릭스 CI.** Next 14/15/16, React 18/19, zod 3/4, ai SDK 버전 조합에 tarball을 설치해 스모크 테스트하고 지원표를 자동 갱신한다.
|
|
148
|
+
103. **[P1] 에이전트용 라이브러리 문서.** 문서 사이트의 `llms.txt`, MCP 리소스 `cms://docs/*`, subpath별 TypeDoc. 코딩 에이전트에게 "agent-cms로 어드민 붙여 줘"가 첫 사용 경로가 된다.
|
|
149
|
+
104. **[P2] Edge 런타임.** `node:crypto` 대신 `crypto.subtle`, `doctor --runtime=edge`.
|
|
150
|
+
105. **[P2] `import --dry-run --diff`.** 폴더 md와 DB의 차이를 문서별로 보여 주고 `db-wins | file-wins | newest`를 고른다.
|
|
151
|
+
106. **[P2] `agent-cms bench`.** 검색 p95, 색인 빌드 시간, 1만 문서 목록 쿼리를 CI에서 회귀 감시.
|
|
152
|
+
|
|
153
|
+
## 6. 이번 PR에서 고친 것 (리뷰 에이전트가 찾음)
|
|
154
|
+
|
|
155
|
+
- admin 범위 키가 자기보다 넓은 키를 발급하던 권한 상승 (`createKey`가 부분집합만 허용)
|
|
156
|
+
- 익명 검색과 `reportGap`이 `cms_gaps`에 무제한으로 쓰던 문제 (요청할 때만, 익명은 금지)
|
|
157
|
+
- 색인 빌드 실패 시 낡은 색인이 계속 쓰이던 문제 (stamp 먼저, 실패 시 dirty 유지와 보고)
|
|
158
|
+
- publish와 restore가 잘못된 JSON 본문을 삼키고 최신 버전을 게시하던 문제
|
|
159
|
+
- `Authorization`이 키가 아니어도 세션을 무시하고 401을 내던 문제, 세션 쓰기 요청의 Origin 검사
|
|
160
|
+
- `/api/cmsx` 같은 접두 경로 오매칭, 퍼센트 인코딩 오류의 500, 음수 limit, 512KB 본문 상한, MCP 배치 20개 상한
|
|
161
|
+
- 동시 생성의 유니크 위반이 500이던 것 (409로)
|
|
162
|
+
- MCP에서 숨긴 도구도 호출되던 불일치, `JSON.stringify` 들여쓰기로 토큰 낭비
|
|
163
|
+
- `recordHits`가 아무 데서도 불리지 않던 것, slug 지정 시 질문을 무시하던 것
|
|
164
|
+
- jsonb 키 순서 때문에 변경 없는 저장이 새 버전을 만들던 것
|
|
165
|
+
|
|
166
|
+
## 7. 아직 남은 버그와 약점
|
|
167
|
+
|
|
168
|
+
- `cms.update`의 `fields`가 얕은 병합이라 중첩 객체를 지울 수 없다(JSON Merge Patch 의미로). [완료 0.6.0]
|
|
169
|
+
- 상태만 바뀌어도 `changed()`가 색인을 dirty로 만들고 `afterChange`를 부른다(게시 내용 변화 여부로 구분). [완료 0.5.3]
|
|
170
|
+
- `recordHits`의 날짜가 UTC라 KST 오전 9시 전 사용량이 전날로 들어간다(`timeZone` 옵션). [완료 0.5.3]
|
|
171
|
+
- `archive` 뒤 재게시해도 `publishedAt`이 최초 시각으로 남는다(`republishedAt` 분리). [완료 0.6.0]
|
|
172
|
+
- `normalizeQuery`가 어순을 정렬하지 않아 "슬랙 연결"과 "연결 슬랙"이 다른 gap이 된다. [해당 없음: 0.6.0에서 gaps 제거]
|
|
173
|
+
- `hitCounts`가 컬렉션 필터 없이 전체를 집계한다. [완료 0.5.3]
|
|
174
|
+
- `toJsonSchema`가 `.min/.max/.default`를 버려 모델이 제한을 모른다. [완료 0.5.3]
|
|
175
|
+
- 키 생성의 `% 62` 모듈로 편향(거부 샘플링으로), 쓰이지 않는 `sameHash`. [완료 0.5.3]
|
|
176
|
+
- 문서 삭제 시 `cms_gaps.document_slug` 참조가 남는다. [해당 없음: 0.6.0에서 gaps 제거]
|
|
177
|
+
- `remoteCmsTools`는 키 권한과 상관없이 모든 도구를 노출한다(`only`로 직접 줄여야 함). 시작할 때 `tools/list`로 맞추는 비동기 버전 `await remoteCmsToolsFor(...)`. [완료 0.5.3]
|
|
178
|
+
- `cms_documents`에 0.4.0까지 쓰던 `covers`, `needs_review`, `review_reason`, `pending_pr`, `cms_versions.pr` 열이 기존 DB에 남아 있다. 쓰지 않으니 해는 없지만 `doctor`가 알려 주고 지울 SQL을 내야 한다. [완료 0.6.0]
|