opencode-wyvern 0.2.3 → 0.2.4
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 +5 -6
- package/package.json +1 -1
- package/src/sections.js +3 -3
- package/src/server.js +21 -10
- package/src/setup.js +2 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ npm install -g opencode-wyvern
|
|
|
20
20
|
Il comando si chiama **`oc-setup`** (non `oc-help`, non `oc`). Verifica:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
oc-setup --version # → 0.2.
|
|
23
|
+
oc-setup --version # → 0.2.4
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Se compare `oc-setup: command not found` subito dopo l'installazione, il
|
|
@@ -96,7 +96,7 @@ accodata al valore precedente.
|
|
|
96
96
|
| `client-bash` | locale | stesso blocco in `~/.bashrc` |
|
|
97
97
|
| `server` | remoto | controlla node/npm, installa opencode se manca, crea `~/.config/opencode` + `AGENTS.md` |
|
|
98
98
|
| `commands` | remoto | comandi custom in `command/*.md` (`/baseline-ui`, `/omniroute-restart`, `/review`, ...) |
|
|
99
|
-
| `mcp` | remoto | server MCP preset (Figma
|
|
99
|
+
| `mcp` | remoto | server MCP preset (Figma Developer MCP); token in `.env` |
|
|
100
100
|
| `providers` | remoto | provider opencode in `opencode.json`; chiavi in `.env` |
|
|
101
101
|
| `plugins` | remoto | plugin npm installati nella dir config e listati in `opencode.json` |
|
|
102
102
|
| `claude-mem` | remoto | memoria: wrapper `plugins/claude-mem-plugin.js` |
|
|
@@ -125,10 +125,9 @@ Docker OmniRoute e attende che sia `healthy`), `/review`, `/refactor`, `/tests`,
|
|
|
125
125
|
|
|
126
126
|
## MCP
|
|
127
127
|
|
|
128
|
-
La sezione `mcp`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
token finisce in `.env` sul server, mai in `config.json`).
|
|
128
|
+
La sezione `mcp` configura **Figma Developer MCP** (stdio via
|
|
129
|
+
`npx figma-developer-mcp`). Il Figma personal access token finisce in `.env`
|
|
130
|
+
sul server, mai in `config.json`.
|
|
132
131
|
|
|
133
132
|
## Client
|
|
134
133
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-wyvern",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Setup modulare per OpenCode: SSH, client PowerShell/bash (comandi oc-*), configurazione server opencode, provider, plugin e comandi custom. Installi tutto, attivi quello che vuoi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/sections.js
CHANGED
|
@@ -155,7 +155,6 @@ export const COMMAND_CHOICES = [
|
|
|
155
155
|
]
|
|
156
156
|
|
|
157
157
|
export const MCP_CHOICES = [
|
|
158
|
-
{ label: "Figma Desktop — Dev Mode (localhost, " + ui("nessun segreto", "no secret") + ")", value: "figma-desktop" },
|
|
159
158
|
{ label: "Figma Developer MCP — npx + " + ui("token personale Figma", "personal Figma token"), value: "figma-developer" },
|
|
160
159
|
]
|
|
161
160
|
|
|
@@ -196,7 +195,8 @@ export function serverState(cfg) {
|
|
|
196
195
|
omnirouteUrl,
|
|
197
196
|
baseUrls: cfg.baseUrls || {},
|
|
198
197
|
customCommands: cfg.customCommands || [],
|
|
199
|
-
|
|
198
|
+
// Ignora preset rimossi: `oc-setup generate` pulisce anche le vecchie config.
|
|
199
|
+
mcpList: (cfg.mcpList || []).filter((id) => MCP_PRESETS[id]),
|
|
200
200
|
defaultModel,
|
|
201
201
|
smallModel,
|
|
202
202
|
tuning: cfg.tuning,
|
|
@@ -259,4 +259,4 @@ export function applyRemoteSections(cfg, { dryRun = false, envKeys, applyMode }
|
|
|
259
259
|
}
|
|
260
260
|
runRemote(cfg.entry || cfg, script)
|
|
261
261
|
return { applied: true, script }
|
|
262
|
-
}
|
|
262
|
+
}
|
package/src/server.js
CHANGED
|
@@ -158,16 +158,14 @@ function providerBlock(id, models, baseUrls = {}, omnirouteUrl = "") {
|
|
|
158
158
|
* `envKey` = chiave d'ambiente da chiedere al setup (finisce in .env sul server).
|
|
159
159
|
*/
|
|
160
160
|
export const MCP_PRESETS = {
|
|
161
|
-
"figma-desktop": {
|
|
162
|
-
label: "Figma Desktop — Dev Mode (localhost, nessun segreto)",
|
|
163
|
-
type: "remote",
|
|
164
|
-
url: "http://127.0.0.1:3845/mcp",
|
|
165
|
-
},
|
|
166
161
|
"figma-developer": {
|
|
167
162
|
label: "Figma Developer MCP — npx + Figma personal token",
|
|
168
163
|
type: "local",
|
|
169
|
-
command: ["npx", "-y", "figma-developer-mcp", "--stdio"],
|
|
170
|
-
environment: {
|
|
164
|
+
command: ["npx", "-y", "figma-developer-mcp", "--stdio", "--no-telemetry"],
|
|
165
|
+
environment: {
|
|
166
|
+
FIGMA_API_KEY: "{env:FIGMA_API_KEY}",
|
|
167
|
+
PATH: "{env:PATH}",
|
|
168
|
+
},
|
|
171
169
|
timeout: 15000,
|
|
172
170
|
envKey: "FIGMA_API_KEY",
|
|
173
171
|
},
|
|
@@ -175,14 +173,14 @@ export const MCP_PRESETS = {
|
|
|
175
173
|
|
|
176
174
|
/** Raggruppa i preset MCP scelti nel blocco `mcp` di opencode.json. */
|
|
177
175
|
export function buildMcpBlock(mcpList = []) {
|
|
178
|
-
const
|
|
176
|
+
const servers = {}
|
|
179
177
|
for (const id of mcpList) {
|
|
180
178
|
const p = MCP_PRESETS[id]
|
|
181
179
|
if (!p) continue
|
|
182
180
|
const { label, envKey, ...serv } = p
|
|
183
|
-
|
|
181
|
+
servers[id] = serv
|
|
184
182
|
}
|
|
185
|
-
return
|
|
183
|
+
return Object.keys(servers).length ? { servers } : {}
|
|
186
184
|
}
|
|
187
185
|
|
|
188
186
|
/** Modello default (inner ID) per un preset MCP che richiede un token. */
|
|
@@ -413,6 +411,19 @@ export function buildRemoteScript({ sections = new Set(), providers = new Set(),
|
|
|
413
411
|
lines.push("umask 077; [ -f \"$CFG_DIR/.env\" ] || : > \"$CFG_DIR/.env\"")
|
|
414
412
|
}
|
|
415
413
|
|
|
414
|
+
if (mcpList.includes("figma-developer")) {
|
|
415
|
+
lines.push(
|
|
416
|
+
'NVM_NODE_BIN="$(ls -dt \"$HOME\"/.nvm/versions/node/*/bin 2>/dev/null | head -n1)"',
|
|
417
|
+
'if [ -n "$NVM_NODE_BIN" ] && [ -x "$NVM_NODE_BIN/node" ]; then',
|
|
418
|
+
' touch "$CFG_DIR/.env"',
|
|
419
|
+
' grep -v "^PATH=" "$CFG_DIR/.env" > "$CFG_DIR/.env.tmp" || true',
|
|
420
|
+
' printf \'PATH="%s:%s"\\n\' "$NVM_NODE_BIN" "$PATH" >> "$CFG_DIR/.env.tmp"',
|
|
421
|
+
' mv "$CFG_DIR/.env.tmp" "$CFG_DIR/.env"',
|
|
422
|
+
' chmod 600 "$CFG_DIR/.env"',
|
|
423
|
+
'fi',
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
|
|
416
427
|
lines.push('log "config opencode scritta in: $CFG_DIR"')
|
|
417
428
|
lines.push("[ -n \"$OPENCODE_BIN\" ] && \"$OPENCODE_BIN\" --version && echo REMOTE_OK || echo REMOTE_NO_OPENCODE")
|
|
418
429
|
return lines.join("\n")
|
package/src/setup.js
CHANGED
|
@@ -393,7 +393,8 @@ export async function cmdStatus() {
|
|
|
393
393
|
console.log(` server: provider ${providers.join(", ")}${urls.length ? ` · ${urls.join(" · ")}` : ""}${cfg.tuning ? ui(" · tuning on", " · tuning on") : ""}`)
|
|
394
394
|
}
|
|
395
395
|
if (cfg.customCommands?.length) console.log(` cmds : ${cfg.customCommands.map((x) => "/" + x).join(", ")}`)
|
|
396
|
-
|
|
396
|
+
const mcpList = (cfg.mcpList || []).filter((id) => MCP_PRESETS[id])
|
|
397
|
+
if (mcpList.length) console.log(` mcp : ${mcpList.join(", ")}`)
|
|
397
398
|
console.log("")
|
|
398
399
|
console.log(ui(" moduli:", " modules:"))
|
|
399
400
|
for (const s of SECTIONS) {
|