mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
* feat(mcp): write per-Agent native fields from the source Some MCP settings have no portable form, such as Codex's default_tools_approval_mode or Claude Code's per-server timeout. Sync kept them only while an entry survived, so a recreated entry (for example after a rename) lost them, and every machine needed them added by hand again. A server's `options` now holds these fields per Agent, and sync writes them as given. The field ledger that piOptions used is extended to every Agent, so sync removes an option it wrote once the source drops it, and reports a conflict when the Agent changed it since. Options are refused when they could break the entry or leak a secret: fields Skillshare writes (including portable names some Agents rename), values a native format cannot write back (null, arrays of tables), options.pi (piOptions covers Pi), disabled entries, and credentials as plain text, since the Agent's file may be committed. The dashboard has no editor for options yet but keeps them on save. Refs: #578 * fix(mcp): close gaps in per-Agent options found in review - A credential option passed if it merely contained "${", so text around a reference, or another Agent's syntax, was written out as plain text. It must now be a whole-value reference in the Agent's own syntax, and Codex and Antigravity options, which read no references, cannot hold one. - The Kilo Code project check looked only at portable env references, so an {env:VAR} in options reached a project file Kilo refuses to load. - A replace resolution left the dropped-option conflict in place, so the plan stayed blocked; replace now lets the source win and prunes those fields. - Adopting an entry that already matched skipped writing its options until a later sync; the takeover now writes them. * fix(mcp): refuse numeric credentials and constrain option values in the schema - YAML reads an unquoted secret such as clientSecret: 123456 as a number, which the credential check skipped, so sync wrote it out as plain text. A mapping under a sensitive name such as credentials also hid its plainly named fields. Sensitivity now carries down through mappings and lists, and a number under a sensitive name is refused. - The schema allowed any value inside an Agent's options, so editors accepted null or nested lists that LoadSource then rejects. A recursive optionValue definition now matches the runtime rules. * docs(mcp): name every Agent whose options cannot hold a credential The docs named only Codex and Antigravity, but Claude Desktop, Goose, Junie, LM Studio and Warp read no environment references there either, so a source such as options.goose.apiKey: "${GOOSE_KEY}" looked valid while LoadSource refused it.
110 lines
8.5 KiB
JSON
110 lines
8.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://raw.githubusercontent.com/runkids/skillshare/main/schemas/mcp.schema.json",
|
|
"title": "Skillshare MCP Source",
|
|
"type": "object",
|
|
"required": ["servers"],
|
|
"additionalProperties": false,
|
|
"properties": {"servers": {"$ref": "#/$defs/servers"}},
|
|
"$defs": {
|
|
"optionScalar": {"type": ["string", "number", "boolean"]},
|
|
"optionValue": {"description": "What every native format writes back unchanged: no null, and a list holds only scalars.", "anyOf": [{"$ref": "#/$defs/optionScalar"}, {"type": "array", "items": {"$ref": "#/$defs/optionScalar"}}, {"type": "object", "additionalProperties": {"$ref": "#/$defs/optionValue"}}]},
|
|
"targets": {"type": "array", "uniqueItems": true, "items": {"anyOf": [{"enum": ["claude", "codex", "cursor", "vscode", "opencode", "kilocode", "grok", "antigravity", "amp", "claude-desktop", "cline", "copilot", "factory", "gemini", "goose", "junie", "kiro", "lmstudio", "warp", "windsurf", "pi", "omp"]}, {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$", "description": "A target that is another account of an Agent, declared under targets with agent and config_dir. Global config only."}]}},
|
|
"directTools": {
|
|
"deprecated": true,
|
|
"description": "Converted since 0.23.0: pi-mcp-adapter's setting becomes Pi's exposure (true: direct, \"search\": deferred) in piOptions, or piOptions.toolExposure for a list of tool names; a default under mcp or a project applies to each server that reaches Pi. Saving the config drops it.",
|
|
"oneOf": [{"type": "boolean"}, {"const": "search"}, {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}}]
|
|
},
|
|
"toolList": {"type": "array", "uniqueItems": true, "minItems": 1, "items": {"type": "string", "pattern": "^[^\\s,?\\[\\]{}]+$", "description": "A tool name; * matches any characters."}},
|
|
"tools": {
|
|
"type": "object", "additionalProperties": false,
|
|
"description": "Which of the server's tools reach the model, translated per Agent. Pi holds all of it; Codex and Copilot take exact tool names; the plan and mcp check name each Agent that cannot hold a part.",
|
|
"properties": {
|
|
"expose": {"enum": ["direct", "deferred", "hidden"], "description": "How the model reaches the tools: declared directly, loaded through tool search, or hidden. Unset leaves each Agent's default."},
|
|
"allow": {"$ref": "#/$defs/toolList", "description": "Only the tools that match are available."},
|
|
"deny": {"$ref": "#/$defs/toolList", "description": "The tools that match are never available; deny beats allow."}
|
|
}
|
|
},
|
|
"reference": {
|
|
"type": "object", "required": ["fromEnv"], "additionalProperties": false,
|
|
"properties": {"fromEnv": {"type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"}}
|
|
},
|
|
"value": {"oneOf": [{"type": "string"}, {"$ref": "#/$defs/reference"}]},
|
|
"servers": {
|
|
"type": "object",
|
|
"propertyNames": {"pattern": "^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$"},
|
|
"additionalProperties": {"$ref": "#/$defs/server"}
|
|
},
|
|
"configuration": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"targets": {"$ref": "#/$defs/targets"},
|
|
"directTools": {"$ref": "#/$defs/directTools"},
|
|
"servers": {"$ref": "#/$defs/servers"}
|
|
}
|
|
},
|
|
"serve": {
|
|
"type": "object", "additionalProperties": false,
|
|
"description": "Settings for skillshare mcp serve.",
|
|
"properties": {
|
|
"edit": {
|
|
"type": "object", "additionalProperties": false,
|
|
"description": "Lets MCP clients edit existing files of the matching skills: preview_skill_edit shows the change, apply_skill_edit saves it. Off when skills is empty.",
|
|
"properties": {
|
|
"skills": {"type": "array", "uniqueItems": true, "items": {"type": "string", "minLength": 1}, "description": "Patterns matched like a target's include filter. Skills installed from upstream or inside a tracked repo stay read-only."},
|
|
"preview_ttl": {"type": "string", "pattern": "^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$", "description": "How long a preview can be applied, as a Go duration such as 30m or 1h. Default 30m."}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"projectConfiguration": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"targets": {"$ref": "#/$defs/targets"},
|
|
"directTools": {"$ref": "#/$defs/directTools"},
|
|
"servers": {"$ref": "#/$defs/servers"},
|
|
"serve": {"$ref": "#/$defs/serve"}
|
|
}
|
|
},
|
|
"globalConfiguration": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"targets": {"$ref": "#/$defs/targets"},
|
|
"directTools": {"$ref": "#/$defs/directTools"},
|
|
"servers": {"$ref": "#/$defs/servers"},
|
|
"serve": {"$ref": "#/$defs/serve"},
|
|
"projects": {
|
|
"type": "object",
|
|
"description": "Project folders this global config syncs into, keyed by absolute path (or ~/...). Each takes what that project's own config.yaml would hold under mcp.",
|
|
"additionalProperties": {"$ref": "#/$defs/configuration"}
|
|
}
|
|
}
|
|
},
|
|
"server": {
|
|
"type": "object", "additionalProperties": false,
|
|
"properties": {
|
|
"piExtension": {"enum": ["builtin", "pi-mcp-adapter", "pi-mcp-extension"], "deprecated": true, "description": "Ignored since 0.23.0: Pi always uses its built-in MCP. Saving the config drops it."},
|
|
"transport": {"enum": ["stdio", "streamable-http"]},
|
|
"command": {"type": "string", "minLength": 1},
|
|
"args": {"type": "array", "items": {"type": "string"}},
|
|
"url": {"type": "string", "pattern": "^https?://"},
|
|
"env": {"type": "object", "additionalProperties": {"$ref": "#/$defs/value"}},
|
|
"headers": {"type": "object", "additionalProperties": {"$ref": "#/$defs/value"}},
|
|
"bearerToken": {"$ref": "#/$defs/reference"},
|
|
"targets": {"$ref": "#/$defs/targets"},
|
|
"directTools": {"$ref": "#/$defs/directTools"},
|
|
"tools": {"$ref": "#/$defs/tools"},
|
|
"piOptions": {"type": "object", "description": "Pi built-in per-server options. Known built-in fields are validated; unknown fields are preserved. pi-mcp-adapter-only fields are refused: set tool lists in tools; exposure and toolExposure cannot be combined with tools."},
|
|
"options": {"type": "object", "propertyNames": {"enum": ["claude", "codex", "cursor", "vscode", "opencode", "kilocode", "grok", "antigravity", "amp", "claude-desktop", "cline", "copilot", "factory", "gemini", "goose", "junie", "kiro", "lmstudio", "warp", "windsurf", "omp"]}, "additionalProperties": {"type": "object", "additionalProperties": {"$ref": "#/$defs/optionValue"}}, "description": "Native per-server fields of other Agents, keyed by Agent, written into that Agent's entry as given, such as codex: {default_tools_approval_mode: approve} or claude: {timeout: 600000}. Fields Skillshare writes from the server's own settings are refused; values are strings, numbers, booleans, lists of those, or mappings of them. Credentials must be a whole-value environment reference in the Agent's own syntax, such as ${VAR} or {env:VAR}, never plain text; options of Codex, Antigravity, Claude Desktop, Goose, Junie, LM Studio and Warp, which read no references there, cannot hold one. Set Pi's fields in piOptions. Sync removes an option it wrote once the source drops it."},
|
|
"piOptionsPrune": {"type": "boolean", "deprecated": true, "description": "Ignored since 0.23.0: sync always removes Pi options Skillshare wrote that are unchanged. Saving the config drops it."},
|
|
"disabled": {"const": true, "description": "Project mode only: turn off a server that the Agent's global config defines. Supported by claude, opencode and kilocode."}
|
|
},
|
|
"oneOf": [
|
|
{"required": ["disabled"], "not": {"anyOf": [{"required": ["directTools"]}, {"required": ["tools"]}, {"required": ["options"]}, {"required": ["command"]}, {"required": ["url"]}, {"required": ["args"]}, {"required": ["env"]}, {"required": ["headers"]}, {"required": ["bearerToken"]}, {"required": ["transport"]}]}},
|
|
{"required": ["command"], "not": {"anyOf": [{"required": ["disabled"]}, {"required": ["url"]}, {"required": ["headers"]}, {"required": ["bearerToken"]}]}, "properties": {"transport": {"const": "stdio"}}},
|
|
{"required": ["url"], "not": {"anyOf": [{"required": ["disabled"]}, {"required": ["command"]}, {"required": ["args"]}, {"required": ["env"]}]}, "properties": {"transport": {"const": "streamable-http"}}}
|
|
]
|
|
}
|
|
}
|
|
}
|