Pudu programming language
Menu
Package

@chrismichaelps / pudu-lang-mcp

Model Context Protocol server for Pudu language documentation and compiler tools

0.1.1Apache-2.01

InstallClose

Protocol.pudu

Pudu57 lines2.4 KB

GitHub ↗
1/** @Constants.Protocol.VocabularyMCP and JSON-RPC wire literals */2module PuduLangMcp.Constants.Protocol34/// The per-request protocol version this server serves statelessly.5export const MODERN_VERSION: Str = "2026-07-28"67/// Handshake-era versions an `initialize` may select, newest first.8export const LEGACY_VERSIONS: Array[Str] = ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"]910/// The version an `initialize` receives when it asks for one not supported.11export const LATEST_LEGACY_VERSION: Str = "2025-11-25"1213/// The `jsonrpc` member every message carries.14export const JSONRPC_VERSION: Str = "2.0"1516/// The member of `params` and of a result that holds protocol metadata.17export const META_KEY: Str = "_meta"18/// Metadata key naming the protocol version of one modern request.19export const META_PROTOCOL_VERSION: Str = "io.modelcontextprotocol/protocolVersion"20/// Metadata key holding the capabilities a modern client declares per request.21export const META_CLIENT_CAPABILITIES: Str = "io.modelcontextprotocol/clientCapabilities"22/// Metadata key under which every result names this server.23export const META_SERVER_INFO: Str = "io.modelcontextprotocol/serverInfo"2425/// The line is not JSON.26export const PARSE_ERROR: Int = -3270027/// The JSON is not a valid request or notification.28export const INVALID_REQUEST: Int = -3260029/// The method does not exist in the era the request was admitted under.30export const METHOD_NOT_FOUND: Int = -3260131/// The parameters are wrong, including a missing resource or cursor.32export const INVALID_PARAMS: Int = -3260233/// The server failed while answering.34export const INTERNAL_ERROR: Int = -3260335/// The requested protocol version is not one this server speaks.36export const UNSUPPORTED_PROTOCOL_VERSION: Int = -320223738/// The `resultType` of every final result.39export const RESULT_COMPLETE: Str = "complete"40/// Cache scope for results any client may share.41export const CACHE_PUBLIC: Str = "public"42/// Cache scope for results that depend on this machine.43export const CACHE_PRIVATE: Str = "private"4445/// `LEGACY_VERSIONS` as a set, for membership tests.46const LEGACY_SET: Set[Str] = setOf(LEGACY_VERSIONS)4748/// Every version this server accepts, modern first.49export fn supportedVersions() -> Array[Str] {50  [MODERN_VERSION].concat(LEGACY_VERSIONS)51}5253/// Whether a version is one an `initialize` may select.54export fn isLegacyVersion(version: Str) -> Bool {55  LEGACY_SET.contains(version)56}57