@mainsoft/agent-cms 0.10.1 → 0.11.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 +21 -0
- package/README.md +98 -2
- package/TODO.md +6 -6
- package/UPGRADE-0.11.md +43 -0
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +7 -7
- package/dist/bin.js +236 -23
- package/dist/{chunk-IU2SMWAM.js → chunk-42PW3HQ3.js} +15 -1
- package/dist/{chunk-6PB4ZCHH.js → chunk-CIMW73L3.js} +58 -1
- package/dist/{chunk-7Y6TU2UA.js → chunk-HY4ED7LT.js} +2 -2
- package/dist/{chunk-DSJETZT4.js → chunk-I3DF6DMI.js} +15 -10
- package/dist/{chunk-KAO3Z3CF.js → chunk-I5UHTAAW.js} +3 -1
- package/dist/{chunk-7SCYDG2G.js → chunk-J25IKU7C.js} +164 -28
- package/dist/{chunk-BFVBHIHV.js → chunk-J5DW3RFQ.js} +4 -1
- package/dist/{chunk-7WJIIJCI.js → chunk-LELPCGDX.js} +8 -5
- package/dist/{chunk-QMPSOLLH.js → chunk-NO6S7KOL.js} +1 -1
- package/dist/{chunk-ZCUJ4MPT.js → chunk-OLHLSSTD.js} +3 -3
- package/dist/{chunk-3OPKTBEI.js → chunk-SV3ZA6XP.js} +1 -1
- package/dist/{chunk-PEQY4N73.js → chunk-TKKTEGHL.js} +1 -0
- package/dist/{chunk-PGV2QPIL.js → chunk-WWG7XDIZ.js} +2 -0
- package/dist/cli.cjs +236 -23
- package/dist/cli.d.cts +2 -2
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +18 -16
- package/dist/client.cjs +4 -1
- package/dist/client.d.cts +14 -2
- package/dist/client.d.ts +14 -2
- package/dist/client.js +1 -1
- package/dist/{cms-pqJyowu1.d.ts → cms-A9tmLmTP.d.ts} +100 -5
- package/dist/{cms-C_vkAxYV.d.cts → cms-CaB81PPX.d.cts} +100 -5
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{drizzle-repo-DWLD0rWe.d.ts → drizzle-repo-BXV-hFkE.d.ts} +1 -1
- package/dist/{drizzle-repo-CviH3EX7.d.cts → drizzle-repo-CblPVYnK.d.cts} +1 -1
- package/dist/errors.cjs +4 -0
- package/dist/errors.d.cts +3 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.js +2 -2
- package/dist/frontmatter.d.cts +1 -1
- package/dist/frontmatter.d.ts +1 -1
- package/dist/http.cjs +32 -12
- package/dist/http.d.cts +18 -4
- package/dist/http.d.ts +18 -4
- package/dist/http.js +30 -20
- package/dist/image-sharp.cjs +104 -0
- package/dist/image-sharp.d.cts +47 -0
- package/dist/image-sharp.d.ts +47 -0
- package/dist/image-sharp.js +70 -0
- package/dist/index.cjs +244 -27
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +21 -21
- package/dist/mcp.cjs +9 -4
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +11 -11
- package/dist/messages/en.cjs +2 -0
- package/dist/messages/en.js +1 -1
- package/dist/messages/ko.cjs +2 -0
- package/dist/messages/ko.js +2 -0
- package/dist/registry/cms-doc-editor.json +6 -1
- package/dist/registry/cms-lib.json +2 -2
- package/dist/registry/cms-media-picker.json +2 -2
- package/dist/registry/cms-media.json +1 -1
- package/dist/registry/registry.json +4 -0
- package/dist/storage-vercel-blob.cjs +199 -0
- package/dist/storage-vercel-blob.d.cts +98 -0
- package/dist/storage-vercel-blob.d.ts +98 -0
- package/dist/storage-vercel-blob.js +165 -0
- package/dist/storage.cjs +63 -3
- package/dist/storage.d.cts +27 -2
- package/dist/storage.d.ts +27 -2
- package/dist/storage.js +9 -3
- package/dist/tables.cjs +15 -1
- package/dist/tables.d.cts +154 -1
- package/dist/tables.d.ts +154 -1
- package/dist/tables.js +2 -2
- package/dist/tools.cjs +8 -3
- package/dist/tools.d.cts +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +9 -9
- package/dist/types.cjs +5 -0
- package/dist/types.d.cts +6 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.js +3 -3
- package/package.json +36 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
What was left of the media library and the editor. **Schema version 5** (three columns on `cms_assets`; `npx agent-cms migrate apply`). See [UPGRADE-0.11.md](./UPGRADE-0.11.md).
|
|
6
|
+
|
|
7
|
+
- **New: Vercel Blob.** `vercelBlobStorage({ token, access })` from `@mainsoft/agent-cms/storage-vercel-blob` (`@vercel/blob` is an optional peer dependency). Browsers upload straight to Blob with a signed address that holds the file to its declared size; private stores are read through signed links. On this kind of store a file goes up in one request whatever its size, so there is no per-part retry and no carrying on after a reload; `storage check` and `_me.media.stores[].parts` say so. Checked against real public and private stores with `@vercel/blob` 2.9.0.
|
|
8
|
+
- **New: image sizes.** `media.transforms: sharpTransforms({ presets })` from `@mainsoft/agent-cms/image-sharp` (`sharp` is an optional peer dependency, Node only). Named sizes only, at `/files/<id>/<name>?size=card`, made on first request and kept under `_cms/derived/`; limits on side, input size, time and how many at once, with the original as the fallback. `cms.imageUrl(asset, { size })`. Pictures the server stores itself get a list thumbnail.
|
|
9
|
+
- **New: focal point.** Set on a picture in the file panel (mouse or arrow keys), through `PATCH /assets/:id { focal }` or the `update_asset` tool. `fit: "cover"` sizes are cropped around it and `assetsFor` returns `focal`.
|
|
10
|
+
- **New: replace a file at its address.** "Replace" in the file panel, `cms.assets.replace()`, or an upload request with `replace: <id>`. Same id and path, same type, checked before it takes the old content's place; `rev` counts replacements and the addresses the CMS hands out carry `?v=<rev>`. Audit action `asset.replace`.
|
|
11
|
+
- **New: `media.stripMetadata`.** JPEG photos lose their location, time and device data in the browser before they are sent (and on the server for imports). The picture, colour profile and orientation are kept.
|
|
12
|
+
- **New: uploads carry on after a reload.** Choosing the same file again within a day sends only the missing parts.
|
|
13
|
+
- **New (cms-doc-editor): section order.** Cards for the `##` sections, moved by dragging or with arrow buttons. New file `cms-body-tools.tsx` in the `cms-doc-editor` item.
|
|
14
|
+
- **New (cms-doc-editor): the preview follows the text** in both directions, and a click on a block in the preview selects its lines in the text. `MarkdownPreview` gained `components` and `onPickLines`; `cms-parts` exports `renderBlocks(blocks, components)`.
|
|
15
|
+
- **Changed (cms-doc-editor):** on wide screens the editor fills the window's height and scrolls inside itself (header and problems line stay in view). Pass `className` with the height that is left if your app has its own top bar.
|
|
16
|
+
- **Changed (`StorageAdapter`):** optional members `multipart` (set `false` when the storage has no parts), `settle(key, options)` (called once after a browser upload passed its checks) and `size` in the `presignPut` options. Existing adapters need no change.
|
|
17
|
+
- New errors: `asset_replace_type` (422), `unknown_image_size` (404).
|
|
18
|
+
|
|
19
|
+
## 0.10.2
|
|
20
|
+
|
|
21
|
+
- **Fix (REST):** a signed-in person's writes were refused with `cross_site` ("Cross-site request refused") whenever the app was reached through an address other than the one the server listens on: behind a reverse proxy or a preview tunnel, in a container, or simply by opening a `next start` server as `127.0.0.1` instead of `localhost`. The check compared the page's `Origin` only with `req.url`, which under `next start` holds the listening address. It now also reads the address from `Host` and `X-Forwarded-Host`, the way Next.js does for Server Actions. A page on another site still cannot change any of the three, so the protection is the same. Apps on Vercel were not affected.
|
|
22
|
+
- **New:** `createCmsHandler({ trustedOrigins: ["https://admin.example.com"] })` lets pages at other addresses write with a person's session, for an admin served from its own domain. The app's own address needs no entry.
|
|
23
|
+
|
|
3
24
|
## 0.10.1
|
|
4
25
|
|
|
5
26
|
- **Fix (cms-doc-editor):** saving or publishing a new document lost its confirmation line ("Saved v1", "Published v1") when the app answered `onCreated` by moving to the document's own address, which is what the examples do. The line now waits for the editor that opens next and shows there once. Update the copy with `npx agent-cms add cms-doc-editor --update`.
|
package/README.md
CHANGED
|
@@ -139,6 +139,13 @@ That gives you REST under `/api/cms/...` (route list at the top of
|
|
|
139
139
|
`ETag: "v<n>"`; send it back as `If-Match` on PATCH/DELETE (or pass
|
|
140
140
|
`expectedVersion`). `requireIfMatch: true` refuses writes without one (428).
|
|
141
141
|
|
|
142
|
+
A write that rides on a person's session must come from a page of the app
|
|
143
|
+
itself: the handler compares the browser's `Origin` with the address of the
|
|
144
|
+
request (`Host`, or `X-Forwarded-Host` behind a proxy) and answers 403
|
|
145
|
+
`cross_site` otherwise. Requests with an API key are not checked. If the
|
|
146
|
+
admin lives at another address, list it:
|
|
147
|
+
`createCmsHandler({ ..., trustedOrigins: ["https://admin.example.com"] })`.
|
|
148
|
+
|
|
142
149
|
## Admin screens
|
|
143
150
|
|
|
144
151
|
The screens are source files you copy into your app and then own, like
|
|
@@ -211,6 +218,23 @@ UI text is English by default; a Korean catalog ships with the screens.
|
|
|
211
218
|
"unarchive" | "delete", items)` runs each document on its own and returns
|
|
212
219
|
`{ slug, ok, error? }` for each.
|
|
213
220
|
|
|
221
|
+
### Long documents: section order, a preview that follows
|
|
222
|
+
|
|
223
|
+
- **Section order.** Above the text, "Section order" swaps the text box for
|
|
224
|
+
one card per `##` section. Drag a card or use its arrows to move the whole
|
|
225
|
+
section; the text before the first heading stays where it is. A card's
|
|
226
|
+
title jumps back to that section in the text.
|
|
227
|
+
- **The preview follows the text.** Scrolling either side moves the other to
|
|
228
|
+
the same block, and the block under the caret is brought into view.
|
|
229
|
+
- **Click the preview to find the line.** A click on a block in the preview
|
|
230
|
+
selects its lines in the text (not on links, players or while selecting
|
|
231
|
+
text). `MarkdownPreview` takes `onPickLines(line, endLine)` if you render
|
|
232
|
+
the preview yourself, and `renderBlocks(blocks, components)` from
|
|
233
|
+
`cms-parts` renders a block tree with your own components.
|
|
234
|
+
- The editor now fills the window's height and scrolls inside itself, so its
|
|
235
|
+
header and its problems line stay in view. An app with its own top bar
|
|
236
|
+
passes the height that is left: `<CmsDocEditor className="md:h-[calc(100dvh-4rem)]" />`.
|
|
237
|
+
|
|
214
238
|
### Scheduling, review, comments, releases, trash
|
|
215
239
|
|
|
216
240
|
The editor, the list and two more screens (`cms-trash`, `cms-releases`) cover
|
|
@@ -294,6 +318,29 @@ other S3-compatible server. It signs requests itself (`aws4fetch`), so there
|
|
|
294
318
|
is no AWS SDK to install. Another kind of storage is a `StorageAdapter`
|
|
295
319
|
(`./storage`).
|
|
296
320
|
|
|
321
|
+
**Vercel Blob** works the same way with its own adapter
|
|
322
|
+
(`npm install @vercel/blob`):
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
import { vercelBlobStorage } from "@mainsoft/agent-cms/storage-vercel-blob";
|
|
326
|
+
|
|
327
|
+
stores: {
|
|
328
|
+
// `access` is how the Blob store was created. A private store is read through signed links only.
|
|
329
|
+
public: { visibility: "public", adapter: vercelBlobStorage({ token: process.env.BLOB_READ_WRITE_TOKEN!, access: "public" }) },
|
|
330
|
+
private: { visibility: "private", adapter: vercelBlobStorage({ token: process.env.BLOB_PRIVATE_READ_WRITE_TOKEN!, access: "private" }) },
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The browser still sends the file straight to the storage, with a signed
|
|
335
|
+
address that holds it to the size it declared. What is different on Blob: a
|
|
336
|
+
file goes up in **one request** whatever its size, so there are no parts to
|
|
337
|
+
retry one by one and nothing to carry on after a reload (a failed upload
|
|
338
|
+
starts again; Vercel's own advice is parts above 100MB, and a 150MB file went
|
|
339
|
+
up in one request when we measured). Blob decides the stored type from the
|
|
340
|
+
file's extension, and there is no CORS rule to set. `storage check` says
|
|
341
|
+
"not supported on this store" for the parts step. Checked against real public
|
|
342
|
+
and private Blob stores with `@vercel/blob` 2.9.0.
|
|
343
|
+
|
|
297
344
|
**The bucket needs a CORS rule** that lets your site `PUT` to it. Add `media`
|
|
298
345
|
(the same object) to `agent-cms.config.ts` and run:
|
|
299
346
|
|
|
@@ -375,8 +422,43 @@ const cover = files[doc.fields.cover];
|
|
|
375
422
|
```
|
|
376
423
|
|
|
377
424
|
`parseMarkdown` gives `{ t: "media", asset, alt, caption }` blocks; look the
|
|
378
|
-
`asset` up in `files`.
|
|
379
|
-
framework's or CDN's job, through `media.imageUrl`.
|
|
425
|
+
`asset` up in `files`. By default the CMS stores originals only and resizing
|
|
426
|
+
is your framework's or CDN's job, through `media.imageUrl`.
|
|
427
|
+
|
|
428
|
+
**Image sizes made by the CMS** are an optional module (`npm install sharp`,
|
|
429
|
+
Node runtime only; on the Edge runtime it fails when the app starts, with the
|
|
430
|
+
reason):
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
import { sharpTransforms } from "@mainsoft/agent-cms/image-sharp";
|
|
434
|
+
|
|
435
|
+
media: {
|
|
436
|
+
stores: { … },
|
|
437
|
+
transforms: sharpTransforms({
|
|
438
|
+
presets: { thumb: { width: 480 }, card: { width: 800, height: 450, fit: "cover" }, full: { width: 1600 } },
|
|
439
|
+
formats: ["webp"], // webp (default), avif, jpeg, png
|
|
440
|
+
}),
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
<img src={cms.imageUrl(cover, { size: "card" })} style={{ objectPosition: cover.focal ? `${cover.focal.x * 100}% ${cover.focal.y * 100}%` : undefined }} />
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
- Only the sizes you name exist: `/api/cms/files/<id>/<name>?size=card`.
|
|
447
|
+
Another name answers 404 (`unknown_image_size`), so nobody can make your
|
|
448
|
+
server resize to arbitrary numbers.
|
|
449
|
+
- A size is made the first time it is asked for and stored in the same store
|
|
450
|
+
under `_cms/derived/`; after that the route redirects to the stored copy.
|
|
451
|
+
Copies are deleted with the original and when it is replaced.
|
|
452
|
+
- Limits: 4096px on the long side, four at a time, ten seconds each, 40MB of
|
|
453
|
+
input. Past a limit, or when sharp fails, the original is served instead.
|
|
454
|
+
SVG and GIF are always served as they are. Nothing is enlarged.
|
|
455
|
+
- **Focal point.** In a file's panel, "Focal point" lets an editor click the
|
|
456
|
+
part of a picture that must stay in view (arrow keys work too). `fit:
|
|
457
|
+
"cover"` sizes are cropped around it, and `assetsFor` returns it as `focal:
|
|
458
|
+
{ x, y }` (0 to 1) for your own `object-position`. There is no crop editor:
|
|
459
|
+
the original is never changed.
|
|
460
|
+
- With the module on, pictures an agent imports or the CLI uploads get their
|
|
461
|
+
list thumbnail from the server (a browser makes its own).
|
|
380
462
|
|
|
381
463
|
**Who may do what.** Listing files and opening private ones: signed-in
|
|
382
464
|
people and keys. Uploading, importing, alt text, tags, new folders: admins
|
|
@@ -413,6 +495,20 @@ in a file's panel renames it; the extension stays, so the type cannot change.
|
|
|
413
495
|
`<CmsProvider slots={{ assetAlt }}>` lets an extension package put its own
|
|
414
496
|
control next to a file's alt text field.
|
|
415
497
|
|
|
498
|
+
- **Replace.** "Replace" in a file's panel puts new content at the same
|
|
499
|
+
address: same id, same path, so documents need no edit. The new file must
|
|
500
|
+
be the same type; it is checked like any upload before it takes the old
|
|
501
|
+
one's place, and the old content cannot be brought back. Addresses the CMS
|
|
502
|
+
hands out get `?v=<n>` so browsers fetch the new content; a CDN in front of
|
|
503
|
+
a public bucket caches by its own rules. Needs the right to delete.
|
|
504
|
+
- **Camera data.** `media: { stripMetadata: true }` removes location, time
|
|
505
|
+
and device data (Exif, XMP, IPTC, comments) from JPEG photos in the browser
|
|
506
|
+
before they are sent, and on the server for imports. The picture itself,
|
|
507
|
+
its colour profile and its orientation are kept. Off by default.
|
|
508
|
+
- **Carrying on after a reload.** A large upload is remembered in the
|
|
509
|
+
browser's storage. Choosing the same file again within a day sends only the
|
|
510
|
+
parts that are still missing. (Not on Vercel Blob, which has no parts.)
|
|
511
|
+
|
|
416
512
|
Agents get six more tools when the app has a media library: `list_assets`,
|
|
417
513
|
`get_asset` (read), `import_asset` (fetch an https address into the library;
|
|
418
514
|
addresses inside your network are refused), `update_asset` (write),
|
package/TODO.md
CHANGED
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
32. **[P0] 복사형 어드민의 접근성 계약.** `role="status"` 저장 알림, `label`과 `aria-describedby`, 포커스 트랩과 복귀, 키보드만으로 생성부터 게시와 되돌리기까지. jsdom과 axe 검사로 고정한다. (Sanity Studio) [완료 0.6.0]
|
|
70
70
|
33. **[P1] "에이전트가 바꾼 곳" 표시와 부분 되돌리기.** `commit()`이 필드 단위 diff를 `cms_versions.changed`에 남기고, 편집 화면 상단에 "에이전트가 v12에서 제목, 본문 2곳을 바꿨어요"를 띄운다. hunk마다 "이 부분만 되돌리기"는 새 버전을 만든다. (Sanity AI Assist, Directus) [완료 0.6.0]
|
|
71
71
|
34. **[P1] 섹션에 붙는 댓글.** `cms_comments`(anchor, quote, thread, resolvedAt). 앵커는 `splitSections()`의 것을 쓴다. 서명된 미리보기 링크로 온 외부 리뷰어도 댓글만 남길 수 있다. 에이전트는 댓글을 읽고 수정안을 새 버전으로 만든다. (Directus, Sanity) **상태:** 0.10.0에서 완료.
|
|
72
|
-
35. **[P1] 분할 라이브 미리보기와 스크롤 동기화.** 저장 전 로컬 상태로 200ms 디바운스 렌더, 커서 섹션과 미리보기 앵커를 양방향으로 맞추고, 375/768/전체 폭 전환을 둔다. `renderBlocks(blocks, components)`로 앱 컴포넌트를 주입한다. (Payload live preview, TinaCMS) [0.6.0에서 일부: 미리보기와 폭
|
|
73
|
-
36. **[P1] 미리보기에서 소스로 점프.** 블록에 `line`, `endLine`을 남겨 제목을 누르면 편집기의 해당 줄을 선택한다. 댓글 인용과 섹션 diff에도 같은 좌표를 쓴다. (TinaCMS click-to-edit) **상태:** 0.10.0에서 `line`, `endLine`까지 완료. 미리보기를 눌러 줄을 찾는 동작은
|
|
72
|
+
35. **[P1] 분할 라이브 미리보기와 스크롤 동기화.** 저장 전 로컬 상태로 200ms 디바운스 렌더, 커서 섹션과 미리보기 앵커를 양방향으로 맞추고, 375/768/전체 폭 전환을 둔다. `renderBlocks(blocks, components)`로 앱 컴포넌트를 주입한다. (Payload live preview, TinaCMS) [0.6.0에서 일부: 미리보기와 폭 전환] **상태:** 0.11.0에서 완료 (양방향 스크롤 맞춤, `renderBlocks(blocks, components)`).
|
|
73
|
+
36. **[P1] 미리보기에서 소스로 점프.** 블록에 `line`, `endLine`을 남겨 제목을 누르면 편집기의 해당 줄을 선택한다. 댓글 인용과 섹션 diff에도 같은 좌표를 쓴다. (TinaCMS click-to-edit) **상태:** 0.10.0에서 `line`, `endLine`까지 완료. 미리보기를 눌러 줄을 찾는 동작은 0.11.0에서 완료.
|
|
74
74
|
37. **[P1] 저장 없는 미리보기 API.** `cms.preview(actor, col, input)`가 `{ blocks, toc, diagnostics, diff, publicUrl }`를 돌려준다. 어드민 미리보기와 에이전트의 저장 전 자기 점검이 같은 코드를 쓴다. **상태:** 0.10.0에서 완료.
|
|
75
75
|
38. **[P1] 앵커 고정과 별칭.** `## 제목 {#id}`로 명시 앵커를 허용하고, 제목을 바꾸면 옛 앵커를 `cms_anchor_aliases`에 남겨 공개 화면과 에이전트가 준 링크가 끊기지 않게 한다. (Mintlify, Fumadocs)
|
|
76
76
|
39. **[P1] 슬러그 도우미와 게시 후 주소 변경.** 한글 제목에서 `suggestSlug()`(로마자 표기 + 중복 검사)를 만들고, 게시 뒤 주소를 바꾸면 `cms_redirects`에 자동 기록한다. 지금은 게시 후 변경이 아예 금지돼 있다.
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
45. **[P1] 붙여넣기 정규화.** HTML을 지원 부분집합 마크다운으로 바꾸고(turndown), 제로폭 문자와 스마트 따옴표를 정리하며, 사라질 문법은 편집기에서 경고한다. (Payload Lexical) **상태:** 0.10.0에서 완료 (turndown 없이 직접 변환).
|
|
83
83
|
46. **[P2] 버전 이름표와 고정.** `cms_versions.label`, `pinned`; prune이 고정 버전을 보호한다. (Directus) **상태:** 0.10.0에서 완료.
|
|
84
84
|
47. **[P1] 어드민 ⌘K 빠른 열기.** 초안 포함 문서 퍼지 검색, 최근 편집, 게시와 버전 기록 같은 액션. (Sanity) [완료 0.6.0]
|
|
85
|
-
48. **[P2] 섹션 단위 편집기.** 섹션 카드로 편집, 순서 변경, 삽입. 댓글, 점프, 린트의 위치 기준이 된다. (Sanity Portable Text)
|
|
85
|
+
48. **[P2] 섹션 단위 편집기.** 섹션 카드로 편집, 순서 변경, 삽입. 댓글, 점프, 린트의 위치 기준이 된다. (Sanity Portable Text) **상태:** 0.11.0에서 순서 변경까지 완료 (섹션 카드를 끌거나 화살표로 옮긴다). 카드 안에서 고치기와 카드 사이 삽입은 만들지 않았다: 글 상자에서 한다.
|
|
86
86
|
|
|
87
87
|
## 3. 에이전트와 검색 (B)
|
|
88
88
|
|
|
@@ -184,8 +184,8 @@
|
|
|
184
184
|
|
|
185
185
|
107. **[P1] 미디어 라이브러리.** S3 호환 저장소 연결(`./storage-s3`), 브라우저 직접 올리기(조각, 재시도, 기본 5GB), 공개와 비공개 저장소, 폴더와 태그, 허용 형식과 최대 크기를 앱 전체와 저장소별과 필드별로 설정, 본문 `` 문법, 이미지와 파일 필드, 사용처와 삭제 확인, 브라우저 썸네일과 변환 주소 연결구, 에이전트 도구 6개. (Payload, Directus, Strapi) [0.8.0] → 0.8.0에서 완료. 화면에서 파일을 옮기거나 이름을 바꾸는 일은 108번(파일 관리자)에서 한다.
|
|
186
186
|
108. **[P1] 버킷 파일 관리자.** 버킷 전체를 폴더로 탐색하고 CMS가 모르는 파일도 등록, 여러 파일 이동과 삭제, 기한이 있는 공유 링크. [0.9.0] → 화면, REST, 도구 3개, `storage sync`까지 만듦(0.9.0에 나감). 일부만 다르게 만든 점은 `docs/roadmap/1-media-and-files.md`의 구현 결과에 적었다.
|
|
187
|
-
109. **[P1] Vercel Blob 어댑터.** `./storage-vercel-blob`. [0.9.0]
|
|
188
|
-
110. **[P2] 선택형 서버 이미지 변환 모듈.** sharp를 쓰는 앱만 켠다. 미리 정한 크기 목록, 크기 상한, 결과 캐시, 자르기와 초점 지정. (Payload, Directus, Sanity) [0.9.0]
|
|
187
|
+
109. **[P1] Vercel Blob 어댑터.** `./storage-vercel-blob`. [0.9.0] → 0.11.0에서 완료. 실제 공개·비공개 Blob 저장소로 계약 테스트 통과. 조각 올리기는 이 저장소에서 지원하지 않는다(파일 하나를 요청 하나로 올린다).
|
|
188
|
+
110. **[P2] 선택형 서버 이미지 변환 모듈.** sharp를 쓰는 앱만 켠다. 미리 정한 크기 목록, 크기 상한, 결과 캐시, 자르기와 초점 지정. (Payload, Directus, Sanity) [0.9.0] → 0.11.0에서 완료 (`./image-sharp`, `?size=`, 초점). 자르기 편집기는 만들지 않는다.
|
|
189
189
|
111. **[P1] 릴리스.** 여러 문서의 게시와 게시 취소를 묶어 한 번에, 또는 예약해서 실행한다. 하나라도 문제가 있으면 전부 하지 않는다. (Strapi, Sanity) **상태:** 0.10.0에서 완료 (되돌리기 없음).
|
|
190
190
|
112. **[P1] 단일 문서.** 사이트 설정이나 메뉴처럼 하나만 있는 문서(`defineSingle`).
|
|
191
191
|
113. **[P1] 역할 관리 화면.** 역할마다 컬렉션과 미디어와 폼의 읽기, 쓰기, 게시, 삭제를 정하고 사람을 넣는다. 지금은 권한을 코드 함수로만 정한다. (Strapi, Directus)
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
127. **[P2] 앱용 실시간 변경 알림.** 앱이 문서 변경을 SSE로 구독한다(75번 위에). (Directus realtime)
|
|
206
206
|
128. **[P2] 저장된 필터.** 문서 목록의 검색과 필터 조합에 이름을 붙여 다시 쓴다. (Payload query presets) **상태:** 0.10.0에서 완료.
|
|
207
207
|
129. **[P1] 목록 필드.** 메뉴 항목처럼 여러 값을 한 묶음으로 반복해 넣고 순서를 바꾸는 입력(`z.array(z.object())`의 위젯).
|
|
208
|
-
130. **[P2] 미디어 후속.** 어드민에서 URL로 가져오기, 새로 고친 뒤 올리기 이어 하기, 사진 위치 정보 지우기, 같은 주소로 파일 교체, 바이러스 검사 연결구.
|
|
208
|
+
130. **[P2] 미디어 후속.** 어드민에서 URL로 가져오기, 새로 고친 뒤 올리기 이어 하기, 사진 위치 정보 지우기, 같은 주소로 파일 교체, 바이러스 검사 연결구. **상태:** URL 가져오기와 검사 연결구는 0.9.0, 나머지 셋은 0.11.0에서 완료.
|
|
209
209
|
131. **[P2] 다른 CMS에서 가져오기.** WordPress 내보내기 파일, CSV, JSON.
|
|
210
210
|
132. **[P0] `./ai` 입구 제거.** 이 패키지는 모델을 부르지 않는다. `./ai`(`cmsTools`, `remoteCmsTools`)와 `ai` 의존성을 빼고, `./tools`에 `callTool`을 넣어 어떤 에이전트 틀에서든 `toolsFor`와 `callTool`로 도구를 붙이게 한다. 모델 호출 라이브러리를 불러오지 않는다는 것을 테스트로 지킨다. [0.8.0]
|
|
211
211
|
133. **[P0] 사람을 대신한 에이전트 표시.** 로그인한 사람의 권한으로 움직이는 에이전트가 고친 버전을 구분해 기록한다(`actor.agent`). 권한은 그 사람과 같고, "에이전트 변경" 표시와 감사 로그에 에이전트의 이름이 남는다. [0.8.0]
|
package/UPGRADE-0.11.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Upgrading to 0.11
|
|
2
|
+
|
|
3
|
+
Coming from 0.10.x. Nothing is removed and no call changes its meaning; there is one schema step and one layout change in a copied screen.
|
|
4
|
+
|
|
5
|
+
## 1. Schema version 5
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx agent-cms migrate check
|
|
9
|
+
npx agent-cms migrate apply # or `migrate print` and run the SQL yourself
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The step adds three columns to `cms_assets` and is safe to run twice: `focal_x`, `focal_y` (a picture's focal point, empty by default) and `rev` (how many times the file was replaced, 0 by default). Apps that create their tables at start (`ensureSchema`) get them by themselves. Drizzle users who keep the tables in their own schema file: re-export from `@mainsoft/agent-cms/tables` as before, the columns come with it.
|
|
13
|
+
|
|
14
|
+
`CmsAsset` gained `focalX`, `focalY` and `rev`; the `AssetInfo` that `assetsFor` returns gained `focal`. Code that builds a `CmsAsset` by hand (a custom `CmsRepo`, test fixtures) has to fill them in.
|
|
15
|
+
|
|
16
|
+
## 2. Update the copied screens
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx agent-cms add --update
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`cms-doc-editor` got a new file (`cms-body-tools.tsx`), and `cms-upload.ts`, `cms-media.tsx`, `cms-media-picker.tsx`, `cms-parts.tsx` and `cms-messages.ts` changed. `add --update` shows a diff first for files you edited.
|
|
23
|
+
|
|
24
|
+
**The editor's height.** On wide screens the editor used to grow with its content and scroll with the page. It now takes the window's height (`h-dvh`) and scrolls inside itself, which is what lets the text and the preview scroll together while the header stays in view. If your admin has a bar above the editor, pass the height that is left:
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
<CmsDocEditor className="md:h-[calc(100dvh-4rem)]" … />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Phones are unchanged.
|
|
31
|
+
|
|
32
|
+
## 3. New, all off until you turn them on
|
|
33
|
+
|
|
34
|
+
- **Vercel Blob:** `npm install @vercel/blob`, then `vercelBlobStorage({ token, access })` from `@mainsoft/agent-cms/storage-vercel-blob` as a store's adapter.
|
|
35
|
+
- **Image sizes:** `npm install sharp`, then `media.transforms: sharpTransforms({ presets })` from `@mainsoft/agent-cms/image-sharp`. Node runtime only.
|
|
36
|
+
- **Camera data:** `media.stripMetadata: true`.
|
|
37
|
+
- Replacing a file, the focal point and carrying on an upload after a reload need no setting; they appear in the media screen after step 2.
|
|
38
|
+
|
|
39
|
+
## 4. If you wrote your own storage adapter
|
|
40
|
+
|
|
41
|
+
Nothing to do. Three optional members were added to `StorageAdapter`: `multipart` (set it to `false` if your storage cannot take a file in parts; the CMS then sends every file in one request), `settle(key, options)` (called once after a browser upload passed its checks, before the file joins the library) and `size` in the options of `presignPut` (the size the uploader declared).
|
|
42
|
+
|
|
43
|
+
A store that hands out one address per file version behind a CDN should know that a replaced file keeps its address: the CMS adds `?v=<rev>` to the addresses it hands out, and how long a CDN keeps the old content is the CDN's setting.
|
package/dist/agent.d.cts
CHANGED
package/dist/agent.d.ts
CHANGED
package/dist/agent.js
CHANGED
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
envelope,
|
|
5
5
|
lookupForAgent,
|
|
6
6
|
verifyCitations
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-HY4ED7LT.js";
|
|
8
|
+
import "./chunk-J25IKU7C.js";
|
|
9
9
|
import {
|
|
10
10
|
appLinkKeys
|
|
11
11
|
} from "./chunk-MA6VKJ3F.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-TKKTEGHL.js";
|
|
13
|
+
import "./chunk-I5UHTAAW.js";
|
|
14
|
+
import "./chunk-WWG7XDIZ.js";
|
|
15
|
+
import "./chunk-SV3ZA6XP.js";
|
|
14
16
|
import "./chunk-AKN7SUXU.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-PGV2QPIL.js";
|
|
17
|
-
import "./chunk-6PB4ZCHH.js";
|
|
17
|
+
import "./chunk-CIMW73L3.js";
|
|
18
18
|
import "./chunk-2NTK7H4W.js";
|
|
19
19
|
export {
|
|
20
20
|
ENVELOPE_PREAMBLE,
|