@enfyra/mcp-server 0.0.122 → 0.1.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/README.md +71 -5
- package/package.json +1 -1
- package/src/index.mjs +5 -3
- package/src/lib/config-local.mjs +158 -63
- package/src/lib/mcp-examples.js +5 -5
- package/src/lib/platform-operation-tools.js +7 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Enfyra MCP Server
|
|
2
2
|
|
|
3
|
-
Manage Enfyra instances from MCP-compatible coding tools such as **Codex**, **Claude Code**, **Cursor**, MCP Inspector, and other STDIO MCP hosts.
|
|
3
|
+
Manage Enfyra instances from MCP-compatible coding tools such as **Codex**, **Claude Code**, **Cursor**, **VS Code / GitHub Copilot**, **Google Antigravity**, MCP Inspector, and other STDIO MCP hosts.
|
|
4
4
|
|
|
5
5
|
This package is the MCP bridge only. Assistant rules, schema behavior, dynamic script guidance, and examples are served through the MCP server itself from `src/lib/mcp-instructions.js`, `src/lib/mcp-examples.js`, and tool descriptions in `src/mcp-server-entry.mjs`.
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ From your project root:
|
|
|
12
12
|
npx @enfyra/mcp-server config
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The config command writes project config for Codex, Claude Code, and
|
|
15
|
+
The config command writes project config for Codex, Claude Code, Cursor, VS Code / GitHub Copilot, and Google Antigravity. It preserves other MCP servers and replaces only the `enfyra` entry.
|
|
16
16
|
|
|
17
17
|
Interactive setup asks for your Enfyra app/admin URL, then guides you to the token page when needed and asks for `ENFYRA_API_TOKEN`.
|
|
18
18
|
|
|
@@ -25,6 +25,8 @@ npx @enfyra/mcp-server config --yes \
|
|
|
25
25
|
# One or more clients
|
|
26
26
|
npx @enfyra/mcp-server config --codex
|
|
27
27
|
npx @enfyra/mcp-server config --cursor --claude-code
|
|
28
|
+
npx @enfyra/mcp-server config --vscode
|
|
29
|
+
npx @enfyra/mcp-server config --antigravity
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
Equivalent in this repo:
|
|
@@ -40,7 +42,9 @@ yarn mcp:config
|
|
|
40
42
|
| Codex | `npx @enfyra/mcp-server config --codex` | `.codex/config.toml` |
|
|
41
43
|
| Claude Code | `npx @enfyra/mcp-server config --claude-code` | `.mcp.json` |
|
|
42
44
|
| Cursor | `npx @enfyra/mcp-server config --cursor` | `.cursor/mcp.json` |
|
|
43
|
-
|
|
|
45
|
+
| VS Code / GitHub Copilot | `npx @enfyra/mcp-server config --vscode` | `.vscode/mcp.json` |
|
|
46
|
+
| Google Antigravity | `npx @enfyra/mcp-server config --antigravity` | `.agents/mcp_config.json` |
|
|
47
|
+
| MCP Inspector / other project-scoped hosts | Paste the shared STDIO config below | Host-specific project config |
|
|
44
48
|
|
|
45
49
|
<details>
|
|
46
50
|
<summary><strong>Codex setup</strong></summary>
|
|
@@ -108,10 +112,71 @@ Official reference: [Cursor MCP](https://cursor.com/docs/context/mcp).
|
|
|
108
112
|
|
|
109
113
|
</details>
|
|
110
114
|
|
|
115
|
+
<details>
|
|
116
|
+
<summary><strong>VS Code / GitHub Copilot setup</strong></summary>
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npx @enfyra/mcp-server config --vscode
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
VS Code workspace config is written to `.vscode/mcp.json`:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"servers": {
|
|
127
|
+
"enfyra": {
|
|
128
|
+
"type": "stdio",
|
|
129
|
+
"command": "npx",
|
|
130
|
+
"args": ["-y", "@enfyra/mcp-server"],
|
|
131
|
+
"env": {
|
|
132
|
+
"ENFYRA_API_URL": "http://localhost:3000/api",
|
|
133
|
+
"ENFYRA_API_TOKEN": "efy_pat_your-token"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Use the VS Code command `MCP: List Servers` to inspect or start the server after setup. This is a workspace config, so it stays tied to the current project.
|
|
141
|
+
|
|
142
|
+
Official references: [VS Code MCP servers](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) and [VS Code MCP configuration](https://code.visualstudio.com/docs/agents/reference/mcp-configuration).
|
|
143
|
+
|
|
144
|
+
</details>
|
|
145
|
+
|
|
146
|
+
<details>
|
|
147
|
+
<summary><strong>Google Antigravity setup</strong></summary>
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npx @enfyra/mcp-server config --antigravity
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Antigravity project config is written to `.agents/mcp_config.json`:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"mcpServers": {
|
|
158
|
+
"enfyra": {
|
|
159
|
+
"command": "npx",
|
|
160
|
+
"args": ["-y", "@enfyra/mcp-server"],
|
|
161
|
+
"env": {
|
|
162
|
+
"ENFYRA_API_URL": "http://localhost:3000/api",
|
|
163
|
+
"ENFYRA_API_TOKEN": "efy_pat_your-token"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Antigravity also documents a shared user config at `~/.gemini/config/mcp_config.json`; this helper intentionally writes the project-local `.agents/mcp_config.json` file so Enfyra URL and token stay scoped to the current workspace.
|
|
171
|
+
|
|
172
|
+
Official reference: [Antigravity MCP](https://antigravity.google/docs/mcp).
|
|
173
|
+
|
|
174
|
+
</details>
|
|
175
|
+
|
|
111
176
|
<details>
|
|
112
177
|
<summary><strong>Other MCP hosts and MCP Inspector</strong></summary>
|
|
113
178
|
|
|
114
|
-
Use the shared STDIO config with any host that accepts an `mcpServers` JSON block:
|
|
179
|
+
Use the shared STDIO config with any project-scoped host that accepts an `mcpServers` JSON block:
|
|
115
180
|
|
|
116
181
|
```json
|
|
117
182
|
{
|
|
@@ -145,11 +210,12 @@ npx @enfyra/mcp-server config [options]
|
|
|
145
210
|
| `--app-url` | Set the Enfyra app/admin URL |
|
|
146
211
|
| `--api-token`, `-t` | Set `ENFYRA_API_TOKEN` |
|
|
147
212
|
| `--yes` | Non-interactive mode for CI/scripts |
|
|
148
|
-
| `--global` | Write global/user config instead of project config |
|
|
149
213
|
| `--reconfig` | Prompt for target clients again and replace the existing `enfyra` entry |
|
|
150
214
|
| `--codex` | Write Codex config |
|
|
151
215
|
| `--claude-code`, `--claude` | Write Claude Code config |
|
|
152
216
|
| `--cursor` | Write Cursor config |
|
|
217
|
+
| `--vscode`, `--copilot` | Write VS Code / GitHub Copilot config |
|
|
218
|
+
| `--antigravity` | Write Google Antigravity config |
|
|
153
219
|
| `-h`, `--help` | Show CLI help |
|
|
154
220
|
|
|
155
221
|
Without a target flag, interactive mode asks which client to configure. Non-interactive mode defaults to all supported clients.
|
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -11,15 +11,17 @@ if (args[0] === '--help' || args[0] === '-h' || args[0] === 'help') {
|
|
|
11
11
|
|
|
12
12
|
Usage:
|
|
13
13
|
npx @enfyra/mcp-server Start the MCP stdio server
|
|
14
|
-
npx @enfyra/mcp-server config [flags] Write local MCP host config
|
|
14
|
+
npx @enfyra/mcp-server config [flags] Write project-local MCP host config
|
|
15
15
|
|
|
16
16
|
Common config flags:
|
|
17
|
-
--codex Write
|
|
17
|
+
--codex Write ./.codex/config.toml
|
|
18
18
|
--claude-code Write ./.mcp.json
|
|
19
19
|
--cursor Write ./.cursor/mcp.json
|
|
20
|
+
--vscode Write ./.vscode/mcp.json
|
|
21
|
+
--antigravity Write ./.agents/mcp_config.json
|
|
20
22
|
--reconfig Prompt for host and credentials again, replacing the enfyra entry
|
|
21
23
|
--yes Non-interactive
|
|
22
|
-
|
|
24
|
+
--app-url ENFYRA_APP_URL
|
|
23
25
|
-t, --api-token ENFYRA_API_TOKEN
|
|
24
26
|
-h, --help Show config help
|
|
25
27
|
|
package/src/lib/config-local.mjs
CHANGED
|
@@ -3,7 +3,6 @@ import { createInterface } from 'node:readline/promises';
|
|
|
3
3
|
import { emitKeypressEvents } from 'node:readline';
|
|
4
4
|
import { stdin as input, stdout as output, cwd } from 'node:process';
|
|
5
5
|
import { dirname, join } from 'node:path';
|
|
6
|
-
import { homedir } from 'node:os';
|
|
7
6
|
|
|
8
7
|
const SERVER_KEY = 'enfyra';
|
|
9
8
|
const forceColor = process.env.FORCE_COLOR != null && process.env.FORCE_COLOR !== '0';
|
|
@@ -36,6 +35,16 @@ const clients = {
|
|
|
36
35
|
path: './.cursor/mcp.json',
|
|
37
36
|
color: style.cyan,
|
|
38
37
|
},
|
|
38
|
+
vscode: {
|
|
39
|
+
label: 'VS Code / Copilot',
|
|
40
|
+
path: './.vscode/mcp.json',
|
|
41
|
+
color: style.blue,
|
|
42
|
+
},
|
|
43
|
+
antigravity: {
|
|
44
|
+
label: 'Antigravity',
|
|
45
|
+
path: './.agents/mcp_config.json',
|
|
46
|
+
color: style.yellow,
|
|
47
|
+
},
|
|
39
48
|
};
|
|
40
49
|
|
|
41
50
|
function statusIcon(kind) {
|
|
@@ -55,7 +64,7 @@ function exitCancelled() {
|
|
|
55
64
|
|
|
56
65
|
function printHelp() {
|
|
57
66
|
console.log(`${style.bold('Enfyra MCP config')}
|
|
58
|
-
${style.dim('Write local MCP client config for Enfyra.')}
|
|
67
|
+
${style.dim('Write project-local MCP client config for Enfyra.')}
|
|
59
68
|
|
|
60
69
|
${style.bold('Usage')}
|
|
61
70
|
npx @enfyra/mcp-server config [options]
|
|
@@ -64,12 +73,12 @@ ${style.bold('Supported clients')}
|
|
|
64
73
|
Codex ./.codex/config.toml
|
|
65
74
|
Claude Code ./.mcp.json
|
|
66
75
|
Cursor ./.cursor/mcp.json
|
|
67
|
-
|
|
76
|
+
VS Code ./.vscode/mcp.json
|
|
77
|
+
Antigravity ./.agents/mcp_config.json
|
|
68
78
|
|
|
69
79
|
${style.bold('Options')}
|
|
70
80
|
--app-url <url> Enfyra app/admin URL, for example https://demo.enfyra.io
|
|
71
81
|
--api-token, -t <secret> ENFYRA_API_TOKEN
|
|
72
|
-
--global Write global/user config for selected clients instead of project config
|
|
73
82
|
--reconfig Always choose target again in interactive mode and replace the old enfyra config for that target
|
|
74
83
|
--yes Non-interactive: no prompts (CI / scripts); use CLI, env, existing file, then defaults
|
|
75
84
|
|
|
@@ -79,20 +88,23 @@ ${style.bold('Client selection')}
|
|
|
79
88
|
--claude-code, --claude, --claude-only Only ./.mcp.json (Claude Code project scope)
|
|
80
89
|
--cursor, --cursor-only Only ./.cursor/mcp.json (Cursor)
|
|
81
90
|
--codex, --codex-only Only ./.codex/config.toml (Codex project scope)
|
|
91
|
+
--vscode, --copilot, --vscode-only Only ./.vscode/mcp.json (VS Code / Copilot)
|
|
92
|
+
--antigravity, --antigravity-only Only ./.agents/mcp_config.json (Antigravity)
|
|
82
93
|
Passing multiple target flags writes each selected target.
|
|
83
94
|
|
|
84
95
|
-h, --help Show this help
|
|
85
96
|
|
|
86
97
|
${style.bold('Interactive mode')}
|
|
87
|
-
Choose Codex, Claude Code, Cursor, or all clients; then enter ENFYRA_APP_URL and ENFYRA_API_TOKEN.
|
|
98
|
+
Choose Codex, Claude Code, Cursor, VS Code, Antigravity, or all clients; then enter ENFYRA_APP_URL and ENFYRA_API_TOKEN.
|
|
88
99
|
Existing Enfyra config and environment variables are used as defaults. Re-run anytime to update.
|
|
89
100
|
|
|
90
101
|
${style.bold('Examples')}
|
|
91
102
|
npx @enfyra/mcp-server config
|
|
92
103
|
npx @enfyra/mcp-server config --yes
|
|
93
104
|
npx @enfyra/mcp-server config --codex --cursor
|
|
105
|
+
npx @enfyra/mcp-server config --vscode
|
|
106
|
+
npx @enfyra/mcp-server config --antigravity
|
|
94
107
|
npx @enfyra/mcp-server config --claude-code
|
|
95
|
-
npx @enfyra/mcp-server config --global --codex
|
|
96
108
|
npx @enfyra/mcp-server config --reconfig
|
|
97
109
|
npx @enfyra/mcp-server config --app-url http://localhost:3000 -t 'efy_pat_...'
|
|
98
110
|
ENFYRA_APP_URL=https://demo.enfyra.io ENFYRA_API_TOKEN=efy_pat_... npx @enfyra/mcp-server config --yes
|
|
@@ -109,11 +121,14 @@ function parseArgs(argv) {
|
|
|
109
121
|
help: false,
|
|
110
122
|
yes: false,
|
|
111
123
|
reconfig: false,
|
|
112
|
-
|
|
124
|
+
vscode: true,
|
|
125
|
+
antigravity: true,
|
|
113
126
|
};
|
|
114
127
|
let pickClaude = false;
|
|
115
128
|
let pickCursor = false;
|
|
116
129
|
let pickCodex = false;
|
|
130
|
+
let pickVscode = false;
|
|
131
|
+
let pickAntigravity = false;
|
|
117
132
|
for (let i = 0; i < argv.length; i += 1) {
|
|
118
133
|
const a = argv[i];
|
|
119
134
|
const next = () => {
|
|
@@ -126,7 +141,6 @@ function parseArgs(argv) {
|
|
|
126
141
|
else if (a === 'help') out.help = true;
|
|
127
142
|
else if (a === '--yes') out.yes = true;
|
|
128
143
|
else if (a === '--reconfig') out.reconfig = true;
|
|
129
|
-
else if (a === '--global') out.global = true;
|
|
130
144
|
else if (a === '--app-url') out.appUrl = next();
|
|
131
145
|
else if (a === '--api-url' || a === '-a') {
|
|
132
146
|
throw new Error(`${a} is no longer supported for setup; use --app-url instead`);
|
|
@@ -138,13 +152,17 @@ function parseArgs(argv) {
|
|
|
138
152
|
else if (a === '--claude-only' || a === '--claude-code' || a === '--claude') pickClaude = true;
|
|
139
153
|
else if (a === '--cursor-only' || a === '--cursor') pickCursor = true;
|
|
140
154
|
else if (a === '--codex-only' || a === '--codex') pickCodex = true;
|
|
155
|
+
else if (a === '--vscode-only' || a === '--vscode' || a === '--copilot') pickVscode = true;
|
|
156
|
+
else if (a === '--antigravity-only' || a === '--antigravity') pickAntigravity = true;
|
|
141
157
|
else throw new Error(`Unknown argument: ${a}`);
|
|
142
158
|
}
|
|
143
|
-
out.targetExplicit = pickClaude || pickCursor || pickCodex;
|
|
159
|
+
out.targetExplicit = pickClaude || pickCursor || pickCodex || pickVscode || pickAntigravity;
|
|
144
160
|
if (out.targetExplicit) {
|
|
145
161
|
out.claude = pickClaude;
|
|
146
162
|
out.cursor = pickCursor;
|
|
147
163
|
out.codex = pickCodex;
|
|
164
|
+
out.vscode = pickVscode;
|
|
165
|
+
out.antigravity = pickAntigravity;
|
|
148
166
|
}
|
|
149
167
|
return out;
|
|
150
168
|
}
|
|
@@ -193,9 +211,7 @@ async function mergeMcpFile(absPath, serverEntry) {
|
|
|
193
211
|
try {
|
|
194
212
|
const raw = await readFile(absPath, 'utf8');
|
|
195
213
|
const parsed = JSON.parse(raw);
|
|
196
|
-
if (parsed && typeof parsed === 'object' &&
|
|
197
|
-
data.mcpServers = { ...parsed.mcpServers };
|
|
198
|
-
} else if (parsed && typeof parsed === 'object') {
|
|
214
|
+
if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
199
215
|
data = { ...parsed, mcpServers: parsed.mcpServers && typeof parsed.mcpServers === 'object' ? { ...parsed.mcpServers } : {} };
|
|
200
216
|
}
|
|
201
217
|
} catch (e) {
|
|
@@ -207,6 +223,31 @@ async function mergeMcpFile(absPath, serverEntry) {
|
|
|
207
223
|
await writeFile(absPath, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
|
208
224
|
}
|
|
209
225
|
|
|
226
|
+
async function mergeVscodeMcpFile(absPath, serverEntry) {
|
|
227
|
+
let data = { servers: {} };
|
|
228
|
+
try {
|
|
229
|
+
const raw = await readFile(absPath, 'utf8');
|
|
230
|
+
const parsed = JSON.parse(raw);
|
|
231
|
+
if (parsed && typeof parsed === 'object') {
|
|
232
|
+
data = {
|
|
233
|
+
...parsed,
|
|
234
|
+
servers: parsed.servers && typeof parsed.servers === 'object' ? { ...parsed.servers } : {},
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
if (e.code !== 'ENOENT') throw e;
|
|
239
|
+
}
|
|
240
|
+
data.servers = {
|
|
241
|
+
...data.servers,
|
|
242
|
+
[SERVER_KEY]: {
|
|
243
|
+
type: 'stdio',
|
|
244
|
+
...serverEntry,
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
await mkdir(dirname(absPath), { recursive: true });
|
|
248
|
+
await writeFile(absPath, `${JSON.stringify(data, null, 2)}\n`, 'utf8');
|
|
249
|
+
}
|
|
250
|
+
|
|
210
251
|
function tomlString(value) {
|
|
211
252
|
return JSON.stringify(String(value ?? ''));
|
|
212
253
|
}
|
|
@@ -285,50 +326,69 @@ async function readCodexEnfyraEnv(absPath) {
|
|
|
285
326
|
return null;
|
|
286
327
|
}
|
|
287
328
|
|
|
288
|
-
function getCodexConfigPath(root
|
|
289
|
-
return
|
|
329
|
+
function getCodexConfigPath(root) {
|
|
330
|
+
return join(root, '.codex', 'config.toml');
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function getClaudeConfigPath(root) {
|
|
334
|
+
return join(root, '.mcp.json');
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function getCursorConfigPath(root) {
|
|
338
|
+
return join(root, '.cursor', 'mcp.json');
|
|
290
339
|
}
|
|
291
340
|
|
|
292
|
-
function
|
|
293
|
-
return
|
|
341
|
+
function getVscodeConfigPath(root) {
|
|
342
|
+
return join(root, '.vscode', 'mcp.json');
|
|
294
343
|
}
|
|
295
344
|
|
|
296
|
-
function
|
|
297
|
-
return
|
|
345
|
+
function getAntigravityConfigPath(root) {
|
|
346
|
+
return join(root, '.agents', 'mcp_config.json');
|
|
298
347
|
}
|
|
299
348
|
|
|
300
|
-
function getClientPath(client, root
|
|
301
|
-
if (client === 'claude') return getClaudeConfigPath(root
|
|
302
|
-
if (client === 'cursor') return getCursorConfigPath(root
|
|
303
|
-
if (client === 'codex') return getCodexConfigPath(root
|
|
349
|
+
function getClientPath(client, root) {
|
|
350
|
+
if (client === 'claude') return getClaudeConfigPath(root);
|
|
351
|
+
if (client === 'cursor') return getCursorConfigPath(root);
|
|
352
|
+
if (client === 'codex') return getCodexConfigPath(root);
|
|
353
|
+
if (client === 'vscode') return getVscodeConfigPath(root);
|
|
354
|
+
if (client === 'antigravity') return getAntigravityConfigPath(root);
|
|
304
355
|
throw new Error(`Unknown MCP client: ${client}`);
|
|
305
356
|
}
|
|
306
357
|
|
|
307
|
-
async function
|
|
358
|
+
async function readMcpServerEnv(absPath, serverRootKey) {
|
|
359
|
+
try {
|
|
360
|
+
const raw = await readFile(absPath, 'utf8');
|
|
361
|
+
const j = JSON.parse(raw);
|
|
362
|
+
const e = j?.[serverRootKey]?.[SERVER_KEY]?.env;
|
|
363
|
+
if (e && typeof e === 'object' && (e.ENFYRA_API_URL || e.ENFYRA_API_TOKEN)) {
|
|
364
|
+
return {
|
|
365
|
+
apiUrl: typeof e.ENFYRA_API_URL === 'string' ? e.ENFYRA_API_URL : '',
|
|
366
|
+
apiToken: typeof e.ENFYRA_API_TOKEN === 'string' ? e.ENFYRA_API_TOKEN : '',
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
} catch {
|
|
370
|
+
/* */
|
|
371
|
+
}
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
async function loadExistingEnfyraEnv(root, readClaude, readCursor, readCodex, readVscode, readAntigravity) {
|
|
308
376
|
const paths = [];
|
|
309
|
-
if (readClaude) paths.push(getClaudeConfigPath(root,
|
|
310
|
-
if (readCursor) paths.push(getCursorConfigPath(root,
|
|
311
|
-
if (!
|
|
377
|
+
if (readClaude) paths.push({ path: getClaudeConfigPath(root), rootKey: 'mcpServers' });
|
|
378
|
+
if (readCursor) paths.push({ path: getCursorConfigPath(root), rootKey: 'mcpServers' });
|
|
379
|
+
if (!readClaude && readCursor) paths.push({ path: getClaudeConfigPath(root), rootKey: 'mcpServers' });
|
|
380
|
+
if (readVscode) paths.push({ path: getVscodeConfigPath(root), rootKey: 'servers' });
|
|
381
|
+
if (readAntigravity) paths.push({ path: getAntigravityConfigPath(root), rootKey: 'mcpServers' });
|
|
312
382
|
const seen = new Set();
|
|
313
|
-
for (const
|
|
314
|
-
|
|
315
|
-
seen.
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
const e = j?.mcpServers?.[SERVER_KEY]?.env;
|
|
320
|
-
if (e && typeof e === 'object' && (e.ENFYRA_API_URL || e.ENFYRA_API_TOKEN)) {
|
|
321
|
-
return {
|
|
322
|
-
apiUrl: typeof e.ENFYRA_API_URL === 'string' ? e.ENFYRA_API_URL : '',
|
|
323
|
-
apiToken: typeof e.ENFYRA_API_TOKEN === 'string' ? e.ENFYRA_API_TOKEN : '',
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
} catch {
|
|
327
|
-
/* */
|
|
328
|
-
}
|
|
383
|
+
for (const entry of paths) {
|
|
384
|
+
const key = `${entry.rootKey}:${entry.path}`;
|
|
385
|
+
if (seen.has(key)) continue;
|
|
386
|
+
seen.add(key);
|
|
387
|
+
const env = await readMcpServerEnv(entry.path, entry.rootKey);
|
|
388
|
+
if (env) return env;
|
|
329
389
|
}
|
|
330
390
|
if (readCodex) {
|
|
331
|
-
const codex = await readCodexEnfyraEnv(getCodexConfigPath(root
|
|
391
|
+
const codex = await readCodexEnfyraEnv(getCodexConfigPath(root));
|
|
332
392
|
if (codex) return codex;
|
|
333
393
|
}
|
|
334
394
|
return { apiUrl: '', apiToken: '' };
|
|
@@ -338,23 +398,31 @@ async function promptTargetChoice() {
|
|
|
338
398
|
const choices = [
|
|
339
399
|
{
|
|
340
400
|
client: 'codex',
|
|
341
|
-
value: { claude: false, cursor: false, codex: true },
|
|
401
|
+
value: { claude: false, cursor: false, codex: true, vscode: false, antigravity: false },
|
|
342
402
|
},
|
|
343
403
|
{
|
|
344
404
|
client: 'claude',
|
|
345
|
-
value: { claude: true, cursor: false, codex: false },
|
|
405
|
+
value: { claude: true, cursor: false, codex: false, vscode: false, antigravity: false },
|
|
346
406
|
},
|
|
347
407
|
{
|
|
348
408
|
client: 'cursor',
|
|
349
|
-
value: { claude: false, cursor: true, codex: false },
|
|
409
|
+
value: { claude: false, cursor: true, codex: false, vscode: false, antigravity: false },
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
client: 'vscode',
|
|
413
|
+
value: { claude: false, cursor: false, codex: false, vscode: true, antigravity: false },
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
client: 'antigravity',
|
|
417
|
+
value: { claude: false, cursor: false, codex: false, vscode: false, antigravity: true },
|
|
350
418
|
},
|
|
351
419
|
{
|
|
352
420
|
client: 'all',
|
|
353
|
-
value: { claude: true, cursor: true, codex: true },
|
|
421
|
+
value: { claude: true, cursor: true, codex: true, vscode: true, antigravity: true },
|
|
354
422
|
},
|
|
355
423
|
];
|
|
356
424
|
if (input.setRawMode && output.isTTY) {
|
|
357
|
-
return promptTargetSelect(choices,
|
|
425
|
+
return promptTargetSelect(choices, 5);
|
|
358
426
|
}
|
|
359
427
|
|
|
360
428
|
const rl = createInterface({ input, output });
|
|
@@ -363,23 +431,31 @@ async function promptTargetChoice() {
|
|
|
363
431
|
+ ' [1] Codex ./.codex/config.toml\n'
|
|
364
432
|
+ ' [2] Claude Code ./.mcp.json\n'
|
|
365
433
|
+ ' [3] Cursor ./.cursor/mcp.json\n'
|
|
366
|
-
+ ' [4]
|
|
367
|
-
+ '
|
|
434
|
+
+ ' [4] VS Code ./.vscode/mcp.json\n'
|
|
435
|
+
+ ' [5] Antigravity ./.agents/mcp_config.json\n'
|
|
436
|
+
+ ' [6] All [default]\n'
|
|
437
|
+
+ 'Choice [6]: ',
|
|
368
438
|
)).trim().toLowerCase();
|
|
369
439
|
await rl.close();
|
|
370
|
-
if (line === '' || line === '
|
|
371
|
-
return { claude: true, cursor: true, codex: true };
|
|
440
|
+
if (line === '' || line === '6' || line === 'all' || line === 'a') {
|
|
441
|
+
return { claude: true, cursor: true, codex: true, vscode: true, antigravity: true };
|
|
372
442
|
}
|
|
373
443
|
if (line === '1' || line === 'codex' || line === 'x') {
|
|
374
|
-
return { claude: false, cursor: false, codex: true };
|
|
444
|
+
return { claude: false, cursor: false, codex: true, vscode: false, antigravity: false };
|
|
375
445
|
}
|
|
376
446
|
if (line === '2' || line === 'claude' || line === 'claude-code') {
|
|
377
|
-
return { claude: true, cursor: false, codex: false };
|
|
447
|
+
return { claude: true, cursor: false, codex: false, vscode: false, antigravity: false };
|
|
378
448
|
}
|
|
379
449
|
if (line === '3' || line === 'cursor' || line === 'u') {
|
|
380
|
-
return { claude: false, cursor: true, codex: false };
|
|
450
|
+
return { claude: false, cursor: true, codex: false, vscode: false, antigravity: false };
|
|
451
|
+
}
|
|
452
|
+
if (line === '4' || line === 'vscode' || line === 'vs-code' || line === 'copilot') {
|
|
453
|
+
return { claude: false, cursor: false, codex: false, vscode: true, antigravity: false };
|
|
454
|
+
}
|
|
455
|
+
if (line === '5' || line === 'antigravity') {
|
|
456
|
+
return { claude: false, cursor: false, codex: false, vscode: false, antigravity: true };
|
|
381
457
|
}
|
|
382
|
-
return { claude: true, cursor: true, codex: true };
|
|
458
|
+
return { claude: true, cursor: true, codex: true, vscode: true, antigravity: true };
|
|
383
459
|
}
|
|
384
460
|
|
|
385
461
|
async function promptTargetSelect(choices, initialIndex = 0) {
|
|
@@ -392,7 +468,7 @@ async function promptTargetSelect(choices, initialIndex = 0) {
|
|
|
392
468
|
if (choice.client === 'all') {
|
|
393
469
|
const label = active ? style.bold(style.underline('All supported clients')) : 'All supported clients';
|
|
394
470
|
const paddedLabel = label + ' '.repeat(22 - 'All supported clients'.length);
|
|
395
|
-
const hint = active ? style.cyan('Codex + Claude Code + Cursor') : style.dim('Codex + Claude Code + Cursor');
|
|
471
|
+
const hint = active ? style.cyan('Codex + Claude Code + Cursor + VS Code + Antigravity') : style.dim('Codex + Claude Code + Cursor + VS Code + Antigravity');
|
|
396
472
|
return `${accent} ${indicator} ${paddedLabel} ${hint}`;
|
|
397
473
|
}
|
|
398
474
|
|
|
@@ -545,14 +621,18 @@ export async function runLocalConfig(argv) {
|
|
|
545
621
|
let writeClaude = opts.claude;
|
|
546
622
|
let writeCursor = opts.cursor;
|
|
547
623
|
let writeCodex = opts.codex;
|
|
624
|
+
let writeVscode = opts.vscode;
|
|
625
|
+
let writeAntigravity = opts.antigravity;
|
|
548
626
|
if (usePrompt && (!opts.targetExplicit || opts.reconfig)) {
|
|
549
627
|
const t = await promptTargetChoice();
|
|
550
628
|
writeClaude = t.claude;
|
|
551
629
|
writeCursor = t.cursor;
|
|
552
630
|
writeCodex = t.codex;
|
|
631
|
+
writeVscode = t.vscode;
|
|
632
|
+
writeAntigravity = t.antigravity;
|
|
553
633
|
}
|
|
554
634
|
|
|
555
|
-
const existing = await loadExistingEnfyraEnv(root, writeClaude, writeCursor, writeCodex,
|
|
635
|
+
const existing = await loadExistingEnfyraEnv(root, writeClaude, writeCursor, writeCodex, writeVscode, writeAntigravity);
|
|
556
636
|
|
|
557
637
|
let apiUrl;
|
|
558
638
|
let apiToken;
|
|
@@ -578,23 +658,32 @@ export async function runLocalConfig(argv) {
|
|
|
578
658
|
const written = [];
|
|
579
659
|
|
|
580
660
|
if (writeCodex) {
|
|
581
|
-
const p = getClientPath('codex', root
|
|
661
|
+
const p = getClientPath('codex', root);
|
|
582
662
|
await mergeCodexConfig(p, apiUrl, apiToken);
|
|
583
663
|
written.push({ client: 'codex', path: p });
|
|
584
664
|
}
|
|
585
665
|
if (writeClaude) {
|
|
586
|
-
const p = getClientPath('claude', root
|
|
666
|
+
const p = getClientPath('claude', root);
|
|
587
667
|
await mergeMcpFile(p, serverEntry);
|
|
588
668
|
written.push({ client: 'claude', path: p });
|
|
589
669
|
}
|
|
590
670
|
if (writeCursor) {
|
|
591
|
-
const p = getClientPath('cursor', root
|
|
671
|
+
const p = getClientPath('cursor', root);
|
|
592
672
|
await mergeMcpFile(p, serverEntry);
|
|
593
673
|
written.push({ client: 'cursor', path: p });
|
|
594
674
|
}
|
|
675
|
+
if (writeVscode) {
|
|
676
|
+
const p = getClientPath('vscode', root);
|
|
677
|
+
await mergeVscodeMcpFile(p, serverEntry);
|
|
678
|
+
written.push({ client: 'vscode', path: p });
|
|
679
|
+
}
|
|
680
|
+
if (writeAntigravity) {
|
|
681
|
+
const p = getClientPath('antigravity', root);
|
|
682
|
+
await mergeMcpFile(p, serverEntry);
|
|
683
|
+
written.push({ client: 'antigravity', path: p });
|
|
684
|
+
}
|
|
595
685
|
|
|
596
|
-
|
|
597
|
-
console.log(`${statusIcon('success')} ${style.bold(style.green('Enfyra MCP config updated'))} ${style.dim(`(${scopeLabel})`)}\n`);
|
|
686
|
+
console.log(`${statusIcon('success')} ${style.bold(style.green('Enfyra MCP config updated'))} ${style.dim('(project)')}\n`);
|
|
598
687
|
for (const entry of written) {
|
|
599
688
|
const meta = clients[entry.client];
|
|
600
689
|
console.log(` ${style.cyan('•')} ${style.bold(meta.color(meta.label))}`);
|
|
@@ -612,6 +701,12 @@ export async function runLocalConfig(argv) {
|
|
|
612
701
|
if (selectedClients.has('cursor')) {
|
|
613
702
|
console.log(' - Cursor: restart Cursor or reload MCP, then confirm the server under Settings -> MCP.');
|
|
614
703
|
}
|
|
704
|
+
if (selectedClients.has('vscode')) {
|
|
705
|
+
console.log(' - VS Code / Copilot: run MCP: List Servers or reload the workspace, then start the Enfyra server if prompted.');
|
|
706
|
+
}
|
|
707
|
+
if (selectedClients.has('antigravity')) {
|
|
708
|
+
console.log(' - Antigravity: reopen the workspace or reload MCP servers so ./.agents/mcp_config.json is picked up.');
|
|
709
|
+
}
|
|
615
710
|
console.log(' - Re-run this command anytime to update the same Enfyra entries.');
|
|
616
711
|
if (!apiToken) {
|
|
617
712
|
console.log(`\n${statusIcon('warn')} ${style.yellow('ENFYRA_API_TOKEN is empty; tools will not authenticate until it is set.')}`);
|
package/src/lib/mcp-examples.js
CHANGED
|
@@ -1550,7 +1550,7 @@ ensure_page_extension({
|
|
|
1550
1550
|
name: "ReportsPage",
|
|
1551
1551
|
description: "Reports dashboard",
|
|
1552
1552
|
menuId: "<created-menu-id>",
|
|
1553
|
-
code: "<template><section class=\\"min-h-full w-full space-y-4\\"><div class=\\"grid gap-4 md:grid-cols-2 xl:grid-cols-3\\"><article class=\\"eapp-surface-card p-4\\"><div class=\\"flex items-start justify-between gap-3\\"><div><p class=\\"text-sm font-medium eapp-text-tertiary\\">Total</p><p class=\\"mt-2 text-2xl font-semibold eapp-text-primary\\">0</p></div><span class=\\"eapp-primary-soft eapp-
|
|
1553
|
+
code: "<template><section class=\\"min-h-full w-full space-y-4\\"><div class=\\"grid gap-4 md:grid-cols-2 xl:grid-cols-3\\"><article class=\\"eapp-surface-card p-4\\"><div class=\\"flex items-start justify-between gap-3\\"><div><p class=\\"text-sm font-medium eapp-text-tertiary\\">Total</p><p class=\\"mt-2 text-2xl font-semibold eapp-text-primary\\">0</p></div><span class=\\"eapp-primary-soft eapp-icon-tile\\"><span class=\\"eapp-primary-text\\">◆</span></span></div><div class=\\"mt-3 h-1.5 overflow-hidden eapp-radius-pill eapp-surface-muted\\"><div class=\\"eapp-primary-solid h-full w-1/2\\"></div></div></article><article class=\\"eapp-primary-surface eapp-radius-panel border p-4\\"><p class=\\"text-sm font-semibold eapp-text-primary\\">Selected report</p><p class=\\"mt-1 text-sm eapp-text-tertiary\\">Only selected/current identity blocks use identity surface.</p></article></div></section></template><script setup>const { registerPageHeader } = usePageHeaderRegistry(); const { register: registerHeaderActions } = useHeaderActionRegistry(); registerPageHeader({ title: 'Reports', description: 'Operational report overview.', leadingIcon: 'lucide:bar-chart-3', gradient: 'none', variant: 'minimal' }); registerHeaderActions([{ id: 'refresh-reports', label: 'Refresh', icon: 'lucide:refresh-cw', color: 'neutral', variant: 'outline', onClick: () => {}, order: 80 }])</script>",
|
|
1554
1554
|
isEnabled: true
|
|
1555
1555
|
})`,
|
|
1556
1556
|
notes: [
|
|
@@ -1566,15 +1566,15 @@ ensure_page_extension({
|
|
|
1566
1566
|
'Page extensions should be full-bleed by default and responsive from the first version.',
|
|
1567
1567
|
'The extension root is already inside Enfyra admin page main; do not add root-level page padding.',
|
|
1568
1568
|
'Use eApp theme class tokens for panels, rows, badges, borders, controls, radius, and text. Generated extension templates should prefer eapp-surface-*, eapp-text-*, eapp-radius-*, eapp-divide-y, and eapp-primary-* over raw CSS variable utilities.',
|
|
1569
|
-
'Treat primary color as runtime-configurable by the app color picker. For Nuxt UI components, choose color="primary" by semantic intent. For custom extension UI, decide whether each element is neutral surface, runtime-primary identity, or status: regular panels/KPI cards/list rows use eapp-surface-card/eapp-surface-muted/eapp-surface-hover/eapp-divide-y and eapp-text-* classes, while selected/current identity blocks, primary tiles, progress fills, primary icons, and primary CTA fills use eapp-primary-surface, eapp-primary-soft, eapp-primary-subtle, eapp-primary-solid, or eapp-primary-text so the color picker controls them.',
|
|
1569
|
+
'Treat primary color as runtime-configurable by the app color picker. For Nuxt UI components, choose color="primary" by semantic intent. For custom extension UI, decide whether each element is neutral surface, runtime-primary identity, or status: regular panels/KPI cards/list rows use eapp-surface-card/eapp-surface-muted/eapp-surface-hover/eapp-divide-y and eapp-text-* classes, while selected/current identity blocks, primary tiles, progress fills, primary icons, and primary CTA fills use eapp-primary-surface, eapp-primary-soft, eapp-primary-subtle, eapp-primary-solid, or eapp-primary-text so the color picker controls them. eapp-primary-surface supplies selected identity color but does not replace card chrome; keep border/radius classes on selected blocks.',
|
|
1570
1570
|
'Decision cases: normal decorative accents, feature icons, non-state tiles, active tabs, progress fills, selected segments, and primary actions use runtime primary/identity classes; true semantic states use their matching status colors such as error, warning, success, or info; large ordinary surfaces stay neutral and carry only small badges/icons for status; selected/current entity blocks may use eapp-primary-surface.',
|
|
1571
|
-
'Pattern examples: KPI/metric cards should be eapp-surface-card with a small eapp-primary-soft icon
|
|
1571
|
+
'Pattern examples: KPI/metric cards should be eapp-surface-card with a small icon tile using eapp-primary-soft eapp-icon-tile; selected/current entity cards may use eapp-primary-surface; progress bars use eapp-surface-muted tracks plus eapp-primary-solid fills; list rows use eapp-surface-card/eapp-divide-y/eapp-surface-hover and only small chips inside; primary scope actions use UButton color="primary" variant="solid"; secondary actions use neutral variants.',
|
|
1572
1572
|
'Status colors belong only in UBadge/UAlert semantic colors or eapp-status-*-soft/text/border classes for badges, small icons, or short status text. Do not read --badge-* variables directly in extension templates. Do not color large panels, alert-like success blocks, KPI cards, list containers, or attention/reconciliation blocks green/yellow/red because of state; keep the block neutral and place the status badge/icon inside.',
|
|
1573
1573
|
'Use PageHeader gradient: "none" for generated operational pages unless the user explicitly asks for a decorative page accent; do not hardcode cyan/violet/purple/blue/green gradients.',
|
|
1574
1574
|
'For general card grids inside the shell, use md:grid-cols-2 xl:grid-cols-3 instead of lg:grid-cols-3 because the desktop sidebar leaves tablet-width content at 1024px.',
|
|
1575
1575
|
'Do not use Nuxt UI neutral semantic classes such as bg-default, text-muted, text-dimmed, border-default, or divide-default inside extension code; use eApp class tokens instead. Do not write text-[var(...)], bg-[var(...)], or border-[var(...)] in generated extension templates unless no class token exists for that exact primitive.',
|
|
1576
1576
|
'Do not pass ui.content: "eapp-surface-card" to UModal/CommonModal; modal content uses the app modal surface and caller content classes should only append z-index or width.',
|
|
1577
|
-
'CommonModal and CommonDrawer own action-only footers through cancelAction, primaryAction, dangerAction, leadingActions, and footerHint. Pass action intent through props instead of styling footer buttons manually; cancelAction defaults to
|
|
1577
|
+
'CommonModal and CommonDrawer own action-only footers through cancelAction, primaryAction, dangerAction, leadingActions, and footerHint. Pass action intent through props instead of styling footer buttons manually; cancelAction defaults to neutral outline, dangerAction is for irreversible destructive work, and Keep editing should use tone: "primary" in discard dialogs.',
|
|
1578
1578
|
'Use UTabs for page sections instead of custom tab bars so the app-level active/inactive indicators, spacing, focus rings, and theme contrast stay consistent.',
|
|
1579
1579
|
'Do not inject global CSS, create theme guards, redefine the app palette, or solve one extension by overriding the whole app shell.',
|
|
1580
1580
|
'Keep list selection local and fetch detail rows only; do not refetch the whole list after a row click unless the list data changed.',
|
|
@@ -1932,7 +1932,7 @@ onMounted(() => fetchOrders())
|
|
|
1932
1932
|
</template>`,
|
|
1933
1933
|
notes: [
|
|
1934
1934
|
'For action-only footers, use CommonModal/CommonDrawer footer props: cancelAction, primaryAction, dangerAction, leadingActions, and footerHint.',
|
|
1935
|
-
'cancelAction defaults to
|
|
1935
|
+
'cancelAction defaults to neutral outline. Use dangerAction for irreversible destructive work and tone: "primary" for Keep editing in discard dialogs.',
|
|
1936
1936
|
'Every trigger/body action button inside CommonModal, CommonDrawer, or UModal should use type="button" unless it intentionally submits a form.',
|
|
1937
1937
|
'Use @click.stop.prevent on body action buttons so clicks do not bubble to row/page triggers.',
|
|
1938
1938
|
'Open modal/drawer shells immediately, then load content inside them; do not close and reopen after an API call.',
|
|
@@ -303,7 +303,7 @@ function getExtensionThemeContract() {
|
|
|
303
303
|
theme: [
|
|
304
304
|
'Use eApp theme class tokens, not hardcoded light/dark colors and not raw CSS variables inside extension templates. The app owns the CSS variable implementation; generated extensions should choose class tokens by intent.',
|
|
305
305
|
'Primary color is runtime-configurable through the app color picker and must affect extension identity UI. For Nuxt UI components, choose color="primary" by semantic intent and let the app map it through the primary contract; do not choose a concrete palette. For custom extension UI, first choose whether the element is neutral surface, runtime-primary identity, or status. Regular panels, KPI cards, list rows, and large content blocks should use eapp-surface-card, eapp-surface-muted, eapp-surface-flat, eapp-surface-hover, eapp-divide-y, and eapp-text-* classes. Entity identity, selected/current state, active progress, primary tiles, primary icons, and primary CTA fills should use eapp-primary-surface, eapp-primary-soft, eapp-primary-subtle, eapp-primary-solid, eapp-primary-text, eapp-primary-border, or eapp-primary-ring so the color picker controls them.',
|
|
306
|
-
'Use eapp-primary-surface only for larger entity/feature blocks, selected/current cards, tiles, or cards that should read like normal app cards with a very subtle active-primary tint; it is not a saturated selected-state fill and must not be applied broadly to every KPI/list wrapper. Add eapp-primary-surface-hover when that block is clickable. Use eapp-primary-soft for compact selected entity chips, pills,
|
|
306
|
+
'Use eapp-primary-surface only for larger entity/feature blocks, selected/current cards, tiles, or cards that should read like normal app cards with a very subtle active-primary tint; it supplies selected identity color but does not replace card chrome, so keep normal border/radius classes such as border plus eapp-radius-panel on the element. It is not a saturated selected-state fill and must not be applied broadly to every KPI/list wrapper. Add eapp-primary-surface-hover when that block is clickable. Use eapp-primary-soft for compact selected entity chips, pills, square icon tiles using eapp-icon-tile, and identity callouts; add eapp-primary-soft-hover when compact surfaces are clickable; use eapp-primary-subtle for a slightly stronger selected fill; use eapp-primary-solid only for primary identity fills; use eapp-primary-text for identity icons or inline text. eapp-identity-* remains an alias for the same runtime-primary intent, but eapp-primary-* is preferred in new extension code.',
|
|
307
307
|
'Nuxt UI secondary is still a valid semantic color when the product intentionally wants a secondary action or state. Do not use color="secondary", from-secondary-*, bg-secondary-*, text-secondary-*, or cyan/purple/green palette utilities merely to approximate an entity accent; use eapp-primary-* and let the app decide the color.',
|
|
308
308
|
'The app runs on Tailwind v4. Short Tailwind color utilities are the canonical way to apply contract colors and ARE allowed: bg-primary, text-primary, border-primary, ring-primary, bg-success, text-error, etc., including opacity modifiers (bg-primary/10, ring-success/20) which v4 resolves via color-mix. They are generated from the token-backed config (primary -> --md-primary runtime, success/error/warning/info -> --st-* status, secondary -> --md-tertiary) so they follow the color picker and dark theme. Do NOT use raw CSS-variable utilities (text-[var(--*)], bg-[var(--*)], border-[var(--*)]), hardcoded hex, inline style colors, or concrete palette substitution (color="violet", from-cyan-*, text-violet-*, bg-green-*, bg-emerald-*, text-green-*, dark:bg-zinc-950). For intent surfaces with no Tailwind equivalent (selected identity block, soft/solid/subtle surface, divider, radius, modal chrome) use the eapp-* classes below; the app owns how they map to the active color picker value.',
|
|
309
309
|
'Use UButton color="primary" only for the single main action for the current scope. Refresh, back, navigation, filters, and secondary actions should be neutral variants unless they are the main mutation.',
|
|
@@ -347,14 +347,14 @@ function getExtensionThemeContract() {
|
|
|
347
347
|
'Buttons should have stable geometry: hover may change color, border, or shadow but must not move the button or resize its content. Disabled buttons keep disabled cursor/visual state.',
|
|
348
348
|
'Inputs and textareas should not add hover movement or decorative hover states; focus, invalid, disabled, and loading states must be explicit.',
|
|
349
349
|
'Dynamic extensions resolve UModal to the app CommonModal. Do not pass ui.content: "eapp-surface-card" or "surface-card" to UModal/CommonModal; modal content uses the app modal surface and caller ui.content should only append z-index, width, or max-width classes.',
|
|
350
|
-
'CommonModal and CommonDrawer own action-only footers through cancelAction, primaryAction, dangerAction, leadingActions, and footerHint. Pass footer button intent through those props instead of custom footer slots. cancelAction defaults to
|
|
350
|
+
'CommonModal and CommonDrawer own action-only footers through cancelAction, primaryAction, dangerAction, leadingActions, and footerHint. Pass footer button intent through those props instead of custom footer slots. cancelAction defaults to neutral outline; use dangerAction for irreversible destructive work and tone: "primary" for Keep editing in discard dialogs.',
|
|
351
351
|
'Use custom #footer content only when the footer contains real custom layout or non-button content. Every modal/drawer button should use type="button" unless it intentionally submits a form.',
|
|
352
352
|
'Use CommonDrawer for side-panel editing. Open drawers immediately on user action and render loading/error/content inside the drawer instead of waiting for fetch before opening.',
|
|
353
353
|
'Use UTabs for page sections and large grouped forms instead of custom tab bars; the app-level Nuxt UI override owns active and inactive indicators, focus rings, spacing, and theme contrast.',
|
|
354
354
|
'Use UBadge or token-backed badge spans for status. Keep badges legible in both themes with tokenized background, text, and border.',
|
|
355
355
|
],
|
|
356
356
|
loadingAndLists: [
|
|
357
|
-
'For first load of card/list pages, render calm skeleton cards with a slow pulse. For subsequent pagination/filter refreshes, keep the card shells mounted and skeletonize card content until the new list is ready.',
|
|
357
|
+
'For first load of card/list pages, render calm skeleton cards with a slow pulse. Use USkeleton or shared loading components so the app-owned skeleton theme controls contrast and accent matching. For subsequent pagination/filter refreshes, keep the card shells mounted and skeletonize card content until the new list is ready.',
|
|
358
358
|
'Keep pagination inside the same transition/loading branch as the list. Do not show pagination before the list content has left loading.',
|
|
359
359
|
'Use bounded pagination for operational lists. Do not replace pagination with arbitrary fixed caps such as 30 or 50.',
|
|
360
360
|
'Empty states should use an app-matched card surface with compact icon tile, title, and description; do not use huge blank white panels or naked UEmpty chrome on page surfaces.',
|
|
@@ -373,12 +373,12 @@ function getExtensionThemeContract() {
|
|
|
373
373
|
{
|
|
374
374
|
useWhen: 'Ordinary KPI, metric, or summary card where the whole card is not selected/current identity.',
|
|
375
375
|
use: 'Neutral card surface; put runtime-primary only on a small identity icon tile, progress fill, or main CTA inside the card.',
|
|
376
|
-
snippet: '<article class="eapp-surface-card p-4"><div class="flex items-start justify-between gap-3"><div><p class="text-sm eapp-text-tertiary">Metric</p><p class="mt-2 text-2xl font-semibold eapp-text-primary">{{ value }}</p></div><span class="eapp-primary-soft eapp-
|
|
376
|
+
snippet: '<article class="eapp-surface-card p-4"><div class="flex items-start justify-between gap-3"><div><p class="text-sm eapp-text-tertiary">Metric</p><p class="mt-2 text-2xl font-semibold eapp-text-primary">{{ value }}</p></div><span class="eapp-primary-soft eapp-icon-tile"><UIcon name="lucide:square-stack" class="size-5 eapp-primary-text" /></span></div></article>',
|
|
377
377
|
},
|
|
378
378
|
{
|
|
379
379
|
useWhen: 'Selected/current entity, active plan, chosen package, or the single block that represents the active identity.',
|
|
380
380
|
use: 'eapp-primary-surface for the selected/current block, with eapp-primary-soft/text for compact icon parts.',
|
|
381
|
-
snippet: '<article class="eapp-primary-surface eapp-primary-surface-hover eapp-radius-panel border p-4"><div class="flex items-center gap-3"><span class="eapp-primary-soft eapp-
|
|
381
|
+
snippet: '<article class="eapp-primary-surface eapp-primary-surface-hover eapp-radius-panel border p-4"><div class="flex items-center gap-3"><span class="eapp-primary-soft eapp-icon-tile"><UIcon name="lucide:box" class="size-5 eapp-primary-text" /></span><div><p class="font-semibold eapp-text-primary">{{ name }}</p><p class="text-sm eapp-text-tertiary">Currently selected</p></div></div></article>',
|
|
382
382
|
},
|
|
383
383
|
{
|
|
384
384
|
useWhen: 'Progress, active tab indicator, selected segment fill, or primary visual meter.',
|
|
@@ -401,7 +401,7 @@ function getExtensionThemeContract() {
|
|
|
401
401
|
snippet: '<div class="flex justify-end gap-2"><UButton color="neutral" variant="outline">Cancel</UButton><UButton color="primary" variant="solid" icon="lucide:save">Save</UButton></div>',
|
|
402
402
|
},
|
|
403
403
|
],
|
|
404
|
-
compactExample: '<template><section class="min-h-full w-full space-y-4"><article class="eapp-surface-card p-4"><div class="flex items-start justify-between gap-3"><div><p class="text-sm eapp-text-tertiary">Neutral KPI</p><p class="mt-2 text-2xl font-semibold eapp-text-primary">24</p></div><span class="eapp-primary-soft eapp-
|
|
404
|
+
compactExample: '<template><section class="min-h-full w-full space-y-4"><article class="eapp-surface-card p-4"><div class="flex items-start justify-between gap-3"><div><p class="text-sm eapp-text-tertiary">Neutral KPI</p><p class="mt-2 text-2xl font-semibold eapp-text-primary">24</p></div><span class="eapp-primary-soft eapp-icon-tile"><UIcon name="lucide:square-stack" class="size-5 eapp-primary-text" /></span></div><div class="mt-3 h-1.5 overflow-hidden eapp-radius-pill eapp-surface-muted"><div class="eapp-primary-solid h-full w-1/2"></div></div></article><section class="eapp-surface-card p-4"><div class="flex items-center justify-between gap-3"><p class="font-semibold eapp-text-primary">Status block stays neutral</p><UBadge color="success" variant="soft">Healthy</UBadge></div></section></section></template>',
|
|
405
405
|
contractAuthority: [
|
|
406
406
|
'This is the authoritative Enfyra theme & color contract. Source of truth: documents/app/theme-color-contract.md. The app owns color through app/utils/primary-colors.ts (Material You seed-to-role generation), app/assets/css/theme.css (semantic variables and Nuxt UI ramps), app/assets/css/main.css (extension-safe semantic utilities), and app/app.config.ts (Nuxt UI component mapping). Pages and extensions only CONSUME classes/Nuxt UI props; they never define colors.',
|
|
407
407
|
'Every color flows from two base layers: --md-* (Material You, runtime primary picker) and --st-* (status). Runtime primary roles are generated with SchemeTonalSpot. Success/warning/info stay fixed status quarts; error follows the generated Material error role through the single --danger-* lane. All Nuxt UI semantic colors (primary/secondary/success/warning/error/info/neutral) are re-pointed to these, so Nuxt UI is used per its docs but colors are decided by Enfyra. This applies to the shell, system pages, and compiled dynamic extensions.',
|
|
@@ -443,6 +443,7 @@ function getThemeClassReference() {
|
|
|
443
443
|
{ group: 'Runtime primary identity', classes: 'eapp-primary-solid, eapp-primary-text, eapp-primary-soft(+hover), eapp-primary-subtle, eapp-primary-surface(+hover), eapp-primary-border, eapp-primary-ring' },
|
|
444
444
|
{ group: 'Status (badges/small icons/short text only)', classes: 'eapp-status-{success|warning|danger|info|neutral}-{soft|text|border}' },
|
|
445
445
|
{ group: 'Radius', classes: 'eapp-radius-card, eapp-radius-panel, eapp-radius-control, eapp-radius-subcontrol, eapp-radius-pill' },
|
|
446
|
+
{ group: 'Icon tile geometry', classes: 'eapp-icon-tile, eapp-icon-tile-sm, eapp-icon-tile-lg' },
|
|
446
447
|
{ group: 'Dividers', classes: 'eapp-divider, eapp-divide-y' },
|
|
447
448
|
{ group: 'Modal', classes: 'eapp-modal-surface (never surface-card as modal ui.content)' },
|
|
448
449
|
],
|