@marvalt/digivalt-mcp 0.4.0 → 0.5.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 +8 -0
- package/README.md +70 -66
- package/dist/cli.js +4 -3
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.js +9 -1
- package/dist/config.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/README.md +16 -0
- package/docs/SECURITY.md +4 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0] - 2026-11-15
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Claude Desktop extension (`.mcpb`): `npm run pack:mcpb` bundles the server into one file and builds `dist-mcpb/digivalt-mcp-<version>.mcpb` with a settings form (WordPress URL and users, staging frontend, optional Cloudflare Access token, optional publisher account). Password and secret fields are marked sensitive. No Node install or `.env` file is needed.
|
|
7
|
+
- `DIGIVALT_MCP_DATA_DIR`: folder for the audit log and optional `.env.local` when there is no meaningful working directory (precedence: `--cwd`, then this, then the working directory).
|
|
8
|
+
- Blank settings, and unfilled `${user_config.*}` placeholders, are treated as unset.
|
|
9
|
+
- Bundle smoke test (`test/bundle.test.ts`, runs after `npm run pack:mcpb`).
|
|
10
|
+
|
|
3
11
|
## [0.4.0] - 2026-11-13
|
|
4
12
|
|
|
5
13
|
### Added
|
package/README.md
CHANGED
|
@@ -1,66 +1,70 @@
|
|
|
1
|
-
# @marvalt/digivalt-mcp
|
|
2
|
-
|
|
3
|
-
Local MCP server (stdio) that lets an AI agent read, validate and draft WordPress pages for a DigiValt frontend, through the `wp-pagesync` 2.1.0+ plugin. Works with Claude Code, Claude Desktop / Cowork, Cursor and OpenClaw.
|
|
4
|
-
|
|
5
|
-
Status: 0.
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
| `
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
# @marvalt/digivalt-mcp
|
|
2
|
+
|
|
3
|
+
Local MCP server (stdio) that lets an AI agent read, validate and draft WordPress pages for a DigiValt frontend, through the `wp-pagesync` 2.1.0+ plugin. Works with Claude Code, Claude Desktop / Cowork, Cursor and OpenClaw.
|
|
4
|
+
|
|
5
|
+
Status: 0.5.0 reads, validates and writes drafts, previews them, and, only with a separate publisher credential and the person's approval, promotes, publishes and rolls back.
|
|
6
|
+
|
|
7
|
+
## Claude Desktop extension
|
|
8
|
+
|
|
9
|
+
Content managers who do not use the repository can install `digivalt-mcp-<version>.mcpb` in Claude Desktop and fill in a settings form. See `docs/README.md` ("Claude Desktop extension"). Build it with `npm run pack:mcpb`.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
In the app repo, put these in `.env.local`:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
VITE_WORDPRESS_API_URL=https://cms.example.com
|
|
17
|
+
DIGIVALT_MCP_WP_USER=mcp-agent
|
|
18
|
+
DIGIVALT_MCP_WP_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
|
|
19
|
+
VITE_STAGING_FRONTEND=staging-website
|
|
20
|
+
VITE_ENABLED_POST_TYPES=post,event
|
|
21
|
+
# Cloudflare Access service token, only if WordPress sits behind Access:
|
|
22
|
+
# CF_ACCESS_CLIENT_ID=...
|
|
23
|
+
# CF_ACCESS_CLIENT_SECRET=...
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Register the server (Claude Code shown; run from the app repo):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude mcp add digivalt -- npx -y @marvalt/digivalt-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Other clients: command `npx`, args `["-y", "@marvalt/digivalt-mcp"]`, working directory the app repo (or pass `--cwd <dir>`).
|
|
33
|
+
|
|
34
|
+
Then ask the agent to call `site_info`.
|
|
35
|
+
|
|
36
|
+
## Tools
|
|
37
|
+
|
|
38
|
+
| Tool | Purpose |
|
|
39
|
+
|------|---------|
|
|
40
|
+
| `site_info` | Connection, user permissions, post types, staging frontend, limits |
|
|
41
|
+
| `list_post_types` | Enabled post types |
|
|
42
|
+
| `list_pages` | List posts of a type, including drafts |
|
|
43
|
+
| `get_page` | Read one post (block markup, status, shadow draft) |
|
|
44
|
+
| `list_blocks` | Blocks the frontend renders, and replacements for those it does not |
|
|
45
|
+
| `list_shortcodes` | Shortcode catalogue with attributes |
|
|
46
|
+
| `validate_page` | Local renderability check plus WordPress integrity check |
|
|
47
|
+
| `create_page` | New draft pinned to the staging frontend, from a block tree or markup |
|
|
48
|
+
| `update_page` | Edit a draft; on a published page the change goes to a shadow draft |
|
|
49
|
+
| `set_seo` | SEO fields on a draft (needs `digivalt-seo`) |
|
|
50
|
+
| `diff_page` | Published page vs its shadow draft |
|
|
51
|
+
| `discard_draft` | Trash a shadow draft (needs `confirm`) |
|
|
52
|
+
| `upload_media` | Upload a local image (alt required, max 12 MB and 3840x2160) |
|
|
53
|
+
| `promote_page` | Publisher only: make a shadow draft the live page (approval required; revision kept) |
|
|
54
|
+
| `publish_page` | Publisher only: publish a never-published draft (approval required) |
|
|
55
|
+
| `rollback_page` | Publisher only: restore the revision saved by the last promote (approval required) |
|
|
56
|
+
| `refresh_static_data` | Developer: run the app's `generate` with drafts overlaid for a local preview (needs wp-pagesync 2.1+, `VITE_FRONTEND_ID` = staging frontend) |
|
|
57
|
+
|
|
58
|
+
Every write is validated locally first; nothing is sent if there are errors. Writes are recorded in `.digivalt-mcp/audit.jsonl` (time, tool, post id, content hash; never content or credentials). Add `.digivalt-mcp` to the app's `.gitignore`.
|
|
59
|
+
|
|
60
|
+
Resources: `digivalt://guide/workflow`, `digivalt://guide/layout`, `digivalt://catalogue/shortcodes`, `digivalt://catalogue/blocks`.
|
|
61
|
+
|
|
62
|
+
## Security
|
|
63
|
+
|
|
64
|
+
- The agent user needs `edit_pages`, `edit_others_pages` and `upload_files`, and must not have `publish_pages` or `edit_published_pages`. WordPress enforces this; the MCP does not rely on trust.
|
|
65
|
+
- Publishing is off unless `DIGIVALT_MCP_PUBLISH_USER` / `DIGIVALT_MCP_PUBLISH_APP_PASSWORD` are set, for a separate WordPress user with publish rights. Keep them out of `.env.local` by default; add them for one session. Even then each publish needs the person's approval. See `docs/SECURITY.md`.
|
|
66
|
+
- Use a dedicated user and application password, not the app's Gravity Forms credentials (those work, with a notice).
|
|
67
|
+
- HTTPS is required except for localhost. Credentials are never logged. stdout carries the protocol; logs go to stderr.
|
|
68
|
+
- Cloudflare Access: set a service token, or run from an allowed network (static IP or WARP).
|
|
69
|
+
|
|
70
|
+
See `docs/README.md` for configuration details.
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
3
|
import { AuditLog } from './audit.js';
|
|
4
|
-
import { loadEnvFiles, readConfig } from './config.js';
|
|
4
|
+
import { loadEnvFiles, readConfig, resolveDataDir } from './config.js';
|
|
5
5
|
import { WpClient } from './wp-client.js';
|
|
6
6
|
import { createServer } from './server.js';
|
|
7
7
|
import { PACKAGE_NAME, VERSION } from './version.js';
|
|
@@ -11,7 +11,8 @@ Local MCP server (stdio) for building WordPress pages for a DigiValt frontend.
|
|
|
11
11
|
|
|
12
12
|
Usage: digivalt-mcp [--cwd <dir>]
|
|
13
13
|
|
|
14
|
-
--cwd <dir> Load .env.local and .env from this directory
|
|
14
|
+
--cwd <dir> Load .env.local and .env from this directory, and keep the audit log there
|
|
15
|
+
(default: DIGIVALT_MCP_DATA_DIR, then the current directory)
|
|
15
16
|
--version Print the version
|
|
16
17
|
--help Print this help
|
|
17
18
|
|
|
@@ -34,7 +35,7 @@ function main() {
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
const cwdIndex = args.indexOf('--cwd');
|
|
37
|
-
const dir = cwdIndex >= 0
|
|
38
|
+
const dir = resolveDataDir(cwdIndex >= 0 ? args[cwdIndex + 1] : undefined, process.env, process.cwd());
|
|
38
39
|
// stdout carries the protocol: log to stderr only.
|
|
39
40
|
const loaded = loadEnvFiles(dir);
|
|
40
41
|
const config = readConfig();
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","s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AC,CAAC;IACjC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,KAAK,MAAM,IAAI,IAAI,MAAM;QAAE,OAAO,CAAC,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC;IAC1E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ;QAAE,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;IAC/E,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,EAAE,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACvH,MAAM;SACH,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC;SACnC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,OAAO,QAAQ,CAAC,CAAC;SAC5D,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,CAAC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export interface Config {
|
|
|
34
34
|
type Env = Record<string, string | undefined>;
|
|
35
35
|
/** Accepts the site root or a /wp-json URL; returns the site root. */
|
|
36
36
|
export declare function normalizeWpUrl(raw: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Directory for .env files, the audit log and the app's static data: --cwd, then DIGIVALT_MCP_DATA_DIR
|
|
39
|
+
* (set by the desktop extension, whose working directory is not meaningful), then the working directory.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveDataDir(cwdArg: string | undefined, env: Env, cwd: string): string;
|
|
37
42
|
/**
|
|
38
43
|
* Load .env.local then .env from a directory into process.env.
|
|
39
44
|
* Existing variables win (shell > .env.local > .env).
|
package/dist/config.js
CHANGED
|
@@ -3,7 +3,8 @@ import { join } from 'node:path';
|
|
|
3
3
|
function first(env, ...names) {
|
|
4
4
|
for (const name of names) {
|
|
5
5
|
const value = env[name]?.trim();
|
|
6
|
-
|
|
6
|
+
// An unfilled optional extension field can arrive as its literal placeholder: treat it as unset.
|
|
7
|
+
if (value && !value.startsWith('${user_config.'))
|
|
7
8
|
return value;
|
|
8
9
|
}
|
|
9
10
|
return null;
|
|
@@ -21,6 +22,13 @@ export function normalizeWpUrl(raw) {
|
|
|
21
22
|
const path = url.pathname.replace(/\/wp-json(\/.*)?$/, '').replace(/\/+$/, '');
|
|
22
23
|
return `${url.origin}${path}`;
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Directory for .env files, the audit log and the app's static data: --cwd, then DIGIVALT_MCP_DATA_DIR
|
|
27
|
+
* (set by the desktop extension, whose working directory is not meaningful), then the working directory.
|
|
28
|
+
*/
|
|
29
|
+
export function resolveDataDir(cwdArg, env, cwd) {
|
|
30
|
+
return cwdArg?.trim() || first(env, 'DIGIVALT_MCP_DATA_DIR') || cwd;
|
|
31
|
+
}
|
|
24
32
|
/**
|
|
25
33
|
* Load .env.local then .env from a directory into process.env.
|
|
26
34
|
* Existing variables win (shell > .env.local > .env).
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAmCjC,SAAS,KAAK,CAAC,GAAQ,EAAE,GAAG,KAAe;I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,WAAW,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,qGAAqG,CAAC,CAAC;QACpH,WAAW,GAAG,IAAI,CAAC;QACnB,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC;SAAM,IAAI,WAAW,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,kHAAkH,CAAC,CAAC;IACnI,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,0BAA0B,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAEnF,OAAO;QACL,KAAK;QACL,MAAM;QACN,UAAU;QACV,gBAAgB;QAChB,UAAU;QACV,cAAc;QACd,UAAU;QACV,gBAAgB;QAChB,eAAe;QACf,UAAU;QACV,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;QAC1D,WAAW;QACX,eAAe;QACf,kBAAkB,EAAE,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,kCAAkC,CAAC,IAAI,EAAE,CAAC;QAChG,UAAU,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,MAAM,EAAE;QACrG,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/docs/README.md
CHANGED
|
@@ -15,6 +15,22 @@ Loaded from the shell, then `.env.local`, then `.env` in the working directory (
|
|
|
15
15
|
| `DIGIVALT_MCP_PUBLISH_USER` / `DIGIVALT_MCP_PUBLISH_APP_PASSWORD` | no | A separate WordPress user who can publish (for example an Editor). Enables `promote_page`, `publish_page`, `rollback_page` only. Both or neither. |
|
|
16
16
|
| `DIGIVALT_MCP_REQUIRE_ELICITATION` | no | `true`: publishing needs a client that can prompt the person; the approval-code fallback is disabled. |
|
|
17
17
|
| `DIGIVALT_MCP_WRITE_LIMIT` | no | Writes allowed per 10 minutes (default 60). Reads are not counted. |
|
|
18
|
+
| `DIGIVALT_MCP_DATA_DIR` | no | Folder for `.env.local`, the audit log and the app's static data when `--cwd` is not given. The desktop extension sets it from its "Working folder" field. |
|
|
19
|
+
|
|
20
|
+
## Claude Desktop extension (.mcpb)
|
|
21
|
+
|
|
22
|
+
For people who do not work in the app repository (content managers). One file, no Node, no `.env`.
|
|
23
|
+
|
|
24
|
+
1. Get `digivalt-mcp-<version>.mcpb` (GitHub release, or `npm run pack:mcpb` in the package).
|
|
25
|
+
2. Claude Desktop: Settings, Extensions, install the file (or open it).
|
|
26
|
+
3. Fill the form: WordPress URL, agent user and application password, staging frontend. Add the Cloudflare Access client ID and secret only if the site is behind Access, and the publisher user and password only if this person may publish (each publish still needs their approval). Leave unused fields empty.
|
|
27
|
+
4. Ask Claude to call `site_info`.
|
|
28
|
+
|
|
29
|
+
Notes:
|
|
30
|
+
- Password and secret fields are entered once and kept by Claude Desktop, not in a project folder.
|
|
31
|
+
- "Working folder" holds the audit log. Choose an app repository to also allow `refresh_static_data`; its `.env.local` fills anything not entered in the form.
|
|
32
|
+
- To update, install the new `.mcpb` over the old one. To revoke access, delete the application passwords in WordPress.
|
|
33
|
+
- The same bundle (`server/index.mjs` inside the file) runs in any client that starts a stdio command: `node server/index.mjs` with the variables above in the client's `env`.
|
|
18
34
|
|
|
19
35
|
## WordPress requirements
|
|
20
36
|
|
package/docs/SECURITY.md
CHANGED
|
@@ -35,6 +35,10 @@ Keep the publisher credential out of `.env.local` by default and add it for a se
|
|
|
35
35
|
| Malicious image upload | Type read from bytes, size and dimension limits, SVG refused, alt required, server re-checks |
|
|
36
36
|
| Cloudflare Access bypass | Service token only; redirects to Access are reported, never followed |
|
|
37
37
|
|
|
38
|
+
## Desktop extension
|
|
39
|
+
|
|
40
|
+
The `.mcpb` form marks passwords and secrets as sensitive, so Claude Desktop masks them and keeps them outside any project folder. The server receives them as environment variables, like any stdio client. The same residual risk applies (below): software running as the same user can read what the desktop app can read. The publisher fields are optional; leave them empty on machines whose users should not publish.
|
|
41
|
+
|
|
38
42
|
## Residual risk
|
|
39
43
|
|
|
40
44
|
A local stdio MCP runs with the developer's privileges and reads `.env.local`. Anyone who can run commands as that developer can read the credentials directly; the approval gate does not protect against that. Use short-lived, revocable application passwords.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marvalt/digivalt-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "MCP server for building and editing DigiValt WordPress pages with AI agents",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"typecheck": "tsc --noEmit",
|
|
35
35
|
"test": "vitest run",
|
|
36
36
|
"clean": "rimraf dist",
|
|
37
|
-
"prepublishOnly": "npm run clean && npm run build && node ../scripts/verify-pack.cjs"
|
|
37
|
+
"prepublishOnly": "npm run clean && npm run build && node ../scripts/verify-pack.cjs",
|
|
38
|
+
"pack:mcpb": "node scripts/build-mcpb.mjs"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
@@ -42,7 +43,9 @@
|
|
|
42
43
|
"zod": "^4.6.7"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
46
|
+
"@anthropic-ai/mcpb": "^2.1.2",
|
|
45
47
|
"@types/node": "^26.6.6",
|
|
48
|
+
"esbuild": "^0.28.2",
|
|
46
49
|
"rimraf": "^6.1.4",
|
|
47
50
|
"typescript": "^7.0.2",
|
|
48
51
|
"vitest": "^5.1.0"
|