okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-023-int into f-023-guifcb0c2d0e

main
923 B10 linesraw
1// The one rule for the name of a tool server (MCP), shared by the Settings editor (src/lib/mcp-names.ts keeps a copy; tests/mcp-rows.test.mjs
2// checks they agree), the save check (native-settings.mjs) and the agent profile (agent/profile.mjs).
3//
4// The model sees every tool as `mcp__<server>__<tool>`, and an OpenAI-style API takes at most 64 characters for that name, so the server's
5// part is limited to 32 (T6, tools and images review 2026-10-22). Before, the editor and the save check accepted 64 and the profile quietly
6// dropped everything over 32 (or with a dot): the model never saw the tool and nothing said why.
7export const MCP_NAME_MAX = 32;
8export const MCP_NAME_RE = /^[A-Za-z0-9_-]{1,32}$/;
9export const validMcpName = name => typeof name === 'string' && MCP_NAME_RE.test(name);
10export const MCP_NAME_HELP = 'Use a simple server name of up to 32 characters: letters, numbers, hyphens or underscores.';