@lunora/mcp 1.0.0-alpha.79 → 1.0.0-alpha.80
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/dist/docs/index.d.mts +4 -1
- package/dist/docs/index.d.ts +4 -1
- package/dist/docs/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/DEFAULT_SEARCH_LIMIT-V7pCZ1wt.mjs +3 -0
- package/dist/packem_shared/{DOCS_SERVER_NAME-BWzPxJyZ.mjs → DOCS_SERVER_NAME-BNYVF715.mjs} +1 -1
- package/dist/packem_shared/{LOCAL_SERVER_NAME-0Jb4neqA.mjs → LOCAL_SERVER_NAME-CisKTqzv.mjs} +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/DEFAULT_SEARCH_LIMIT-DWPt0hvR.mjs +0 -3
package/dist/docs/index.d.mts
CHANGED
|
@@ -183,7 +183,10 @@ declare const DOCS_TOOL_DEFINITIONS: ReadonlyArray<ToolDefinition>;
|
|
|
183
183
|
* this path to `/llms.mdx`, so `../../api/search` would walk back out of the
|
|
184
184
|
* documentation tree and pull an unrelated path on the docs origin into the
|
|
185
185
|
* model's context — harmless against a public site, less so against the
|
|
186
|
-
* internal host a self-hosted `--docs-url` may point at.
|
|
186
|
+
* internal host a self-hosted `--docs-url` may point at. Percent-encoded
|
|
187
|
+
* forms (`%2e%2e`, doubled `%252e`) are rejected the same way: WHATWG URL
|
|
188
|
+
* parsing at fetch time decodes and collapses them into the very traversal
|
|
189
|
+
* the literal check would have caught.
|
|
187
190
|
*/
|
|
188
191
|
declare const normalizeDocUrl: (raw: string) => string;
|
|
189
192
|
/**
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -183,7 +183,10 @@ declare const DOCS_TOOL_DEFINITIONS: ReadonlyArray<ToolDefinition>;
|
|
|
183
183
|
* this path to `/llms.mdx`, so `../../api/search` would walk back out of the
|
|
184
184
|
* documentation tree and pull an unrelated path on the docs origin into the
|
|
185
185
|
* model's context — harmless against a public site, less so against the
|
|
186
|
-
* internal host a self-hosted `--docs-url` may point at.
|
|
186
|
+
* internal host a self-hosted `--docs-url` may point at. Percent-encoded
|
|
187
|
+
* forms (`%2e%2e`, doubled `%252e`) are rejected the same way: WHATWG URL
|
|
188
|
+
* parsing at fetch time decodes and collapses them into the very traversal
|
|
189
|
+
* the literal check would have caught.
|
|
187
190
|
*/
|
|
188
191
|
declare const normalizeDocUrl: (raw: string) => string;
|
|
189
192
|
/**
|
package/dist/docs/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{toDocsSearchHits as e}from"../packem_shared/toDocsSearchHits-CBLmtWXt.mjs";import{DEFAULT_DOCS_BASE_URL as D,createRemoteDocsIndex as t}from"../packem_shared/DEFAULT_DOCS_BASE_URL-CZ3fVsSc.mjs";import{DOCS_URI_SCHEME as s,docsResources as S,fromDocsUri as E,toDocsUri as I}from"../packem_shared/DOCS_URI_SCHEME-CFANc3vr.mjs";import{DOCS_SERVER_NAME as R,createDocsMcpFetchHandler as p,createDocsMcpServer as A}from"../packem_shared/DOCS_SERVER_NAME-
|
|
1
|
+
import{toDocsSearchHits as e}from"../packem_shared/toDocsSearchHits-CBLmtWXt.mjs";import{DEFAULT_DOCS_BASE_URL as D,createRemoteDocsIndex as t}from"../packem_shared/DEFAULT_DOCS_BASE_URL-CZ3fVsSc.mjs";import{DOCS_URI_SCHEME as s,docsResources as S,fromDocsUri as E,toDocsUri as I}from"../packem_shared/DOCS_URI_SCHEME-CFANc3vr.mjs";import{DOCS_SERVER_NAME as R,createDocsMcpFetchHandler as p,createDocsMcpServer as A}from"../packem_shared/DOCS_SERVER_NAME-BNYVF715.mjs";import{DEFAULT_SEARCH_LIMIT as M,DOCS_TOOL_DEFINITIONS as O,MAX_SEARCH_LIMIT as T,docsTools as U,normalizeDocUrl as a}from"../packem_shared/DEFAULT_SEARCH_LIMIT-V7pCZ1wt.mjs";export{D as DEFAULT_DOCS_BASE_URL,M as DEFAULT_SEARCH_LIMIT,R as DOCS_SERVER_NAME,O as DOCS_TOOL_DEFINITIONS,s as DOCS_URI_SCHEME,T as MAX_SEARCH_LIMIT,p as createDocsMcpFetchHandler,A as createDocsMcpServer,t as createRemoteDocsIndex,S as docsResources,U as docsTools,E as fromDocsUri,a as normalizeDocUrl,e as toDocsSearchHits,I as toDocsUri};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as T,callAgentTool as c,parseAgentsEnv as E}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-DRSY74ed.mjs";import{createToolServer as O}from"./packem_shared/createToolServer-BtGuPyMU.mjs";import{createMcpFetchHandler as _}from"./packem_shared/createMcpFetchHandler-TKDnZTGs.mjs";import{LOCAL_SERVER_NAME as N,NO_DEPLOYMENT_MESSAGE as n,connectLocalStdio as p,createLocalMcpServer as I,localTools as A}from"./packem_shared/LOCAL_SERVER_NAME-
|
|
1
|
+
import{AGENT_RUN_INPUT_SCHEMA as r,AGENT_STATUS_TOOL_NAME as t,agentToolDefinitions as T,callAgentTool as c,parseAgentsEnv as E}from"./packem_shared/AGENT_RUN_INPUT_SCHEMA-DRSY74ed.mjs";import{createToolServer as O}from"./packem_shared/createToolServer-BtGuPyMU.mjs";import{createMcpFetchHandler as _}from"./packem_shared/createMcpFetchHandler-TKDnZTGs.mjs";import{LOCAL_SERVER_NAME as N,NO_DEPLOYMENT_MESSAGE as n,connectLocalStdio as p,createLocalMcpServer as I,localTools as A}from"./packem_shared/LOCAL_SERVER_NAME-CisKTqzv.mjs";import{createPaidMcpServer as f}from"./packem_shared/createPaidMcpServer-CQO-59WV.mjs";import{connectStdio as m,createLunoraMcpServer as s}from"./packem_shared/connectStdio-BCeI0Wqu.mjs";import{READ_ONLY_TOOL_DEFINITIONS as M,WRITE_TOOL_DEFINITIONS as D,callTool as v,toolDefinitions as R}from"./packem_shared/READ_ONLY_TOOL_DEFINITIONS-DGexf3Tn.mjs";import{O as F}from"./packem_shared/observability-tools-Ce0YK58T.mjs";import{serveStateless as G}from"./packem_shared/serveStateless-Db7J3pAO.mjs";export{r as AGENT_RUN_INPUT_SCHEMA,t as AGENT_STATUS_TOOL_NAME,N as LOCAL_SERVER_NAME,n as NO_DEPLOYMENT_MESSAGE,F as OBSERVABILITY_TOOL_DEFINITIONS,M as READ_ONLY_TOOL_DEFINITIONS,D as WRITE_TOOL_DEFINITIONS,T as agentToolDefinitions,c as callAgentTool,v as callTool,p as connectLocalStdio,m as connectStdio,I as createLocalMcpServer,s as createLunoraMcpServer,_ as createMcpFetchHandler,f as createPaidMcpServer,O as createToolServer,A as localTools,E as parseAgentsEnv,G as serveStateless,R as toolDefinitions};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const T=10,A=50,h="docs",L=500,_={properties:{limit:{description:`Maximum hits to return (default ${String(10)}, max ${String(50)})`,type:"number"},query:{description:'Search terms, e.g. "shardBy" or "optimistic updates"',type:"string"}},required:["query"],type:"object"},m={properties:{url:{description:'Site-relative page URL from a search hit, e.g. "/docs/sharding"',type:"string"}},required:["url"],type:"object"},p={properties:{},type:"object"},s={destructiveHint:!1,idempotentHint:!0,openWorldHint:!0,readOnlyHint:!0},u={annotations:{...s,title:"Search the Lunora documentation"},description:"Search the Lunora documentation and return matching pages and sections. Use this before writing Lunora code (schema, queries, mutations, actions, sharding, .global(), client hooks) so the answer reflects the framework's current API rather than a guess. Follow a hit with lunora_get_doc to read the full page.",inputSchema:_,name:"lunora_search_docs"},l={annotations:{...s,title:"Read a Lunora documentation page"},description:"Return one Lunora documentation page in full, as Markdown. Takes the `url` of a lunora_search_docs hit or a lunora_list_docs entry.",inputSchema:m,name:"lunora_get_doc"},d={annotations:{...s,title:"List the Lunora documentation pages"},description:"List every Lunora documentation page with its title and description. Prefer lunora_search_docs when you know what you're looking for.",inputSchema:p,name:"lunora_list_docs"},y=[u,l,d],r=e=>({content:[{text:JSON.stringify(e,void 0,2),type:"text"}]}),g=e=>({content:[{text:e,type:"text"}],isError:!0}),a=512,c=(e,t)=>{const o=e[t];if(typeof o!="string"||o.trim().length===0)throw new TypeError(`"${t}" is required and must be a non-empty string`);if(o.length>a)throw new RangeError(`"${t}" must be at most ${String(a)} characters`);return o.trim()},f=e=>{const t=typeof e=="string"?Number(e):e;return typeof t!="number"||!Number.isFinite(t)?10:Math.min(50,Math.max(1,Math.floor(t)))},S=(e,t)=>{for(const o of e.split("/")){let n;try{n=decodeURIComponent(o)}catch{throw new RangeError(`"url" contains a malformed percent-escape: ${t}`)}if(n===".."||n==="."||n.includes("%")||n.includes("\\"))throw new RangeError(`"url" must not contain ".." or encoded segments: ${t}`)}},E=e=>{let t=e.trim().replaceAll("\\","/");if(t.startsWith("http://")||t.startsWith("https://")){const o=t.slice(t.indexOf("//")+2),n=o.indexOf("/");t=n===-1?"/":o.slice(n)}for(const o of["?","#"]){const n=t.indexOf(o);n!==-1&&(t=t.slice(0,n))}for(;t.endsWith("/")&&t.length>1;)t=t.slice(0,-1);return t.startsWith("/")||(t=t.startsWith("docs/")?`/${t}`:`/${h}/${t}`),S(t,e),t},O=e=>[{definition:u,handle:async t=>{const o=c(t,"query"),n=f(t.limit),i=(await e.search(o)).slice(0,n);return i.length===0?r({hits:[],note:`no documentation matched "${o}" — try fewer or more general terms, or lunora_list_docs to browse`}):r({hits:i})}},{definition:l,handle:async t=>{const o=E(c(t,"url")),n=await e.getPage(o);return n===void 0?g(`documentation page not found: ${o}. Use lunora_search_docs or lunora_list_docs to find a valid url.`):{content:[{text:`# ${n.title} (${n.url})
|
|
2
|
+
|
|
3
|
+
${n.content}`,type:"text"}]}}},{definition:d,handle:async()=>{const t=await e.listPages();return t.length>500?r({note:`showing the first ${String(500)} of ${String(t.length)} pages — use lunora_search_docs to find the rest`,pages:t.slice(0,500)}):r(t)}}];export{T as DEFAULT_SEARCH_LIMIT,y as DOCS_TOOL_DEFINITIONS,a as MAX_ARGUMENT_LENGTH,L as MAX_LISTED_PAGES,A as MAX_SEARCH_LIMIT,O as docsTools,E as normalizeDocUrl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createToolServer as d}from"./createToolServer-BtGuPyMU.mjs";import{serveStateless as a}from"./serveStateless-Db7J3pAO.mjs";import{docsResources as i}from"./DOCS_URI_SCHEME-CFANc3vr.mjs";import{docsTools as p}from"./DEFAULT_SEARCH_LIMIT-
|
|
1
|
+
import{createToolServer as d}from"./createToolServer-BtGuPyMU.mjs";import{serveStateless as a}from"./serveStateless-Db7J3pAO.mjs";import{docsResources as i}from"./DOCS_URI_SCHEME-CFANc3vr.mjs";import{docsTools as p}from"./DEFAULT_SEARCH_LIMIT-V7pCZ1wt.mjs";const u="lunora-docs",y=128*1024,m=e=>({name:u,version:e??"0.0.0"}),l=e=>d(m(e.version),p(e.index),i(e.index)),S=e=>new TextEncoder().encode(e).length,t=(e,r,o)=>Response.json({error:{code:r,message:o},id:null,jsonrpc:"2.0"},{status:e}),f=async(e,r)=>{if(e.method!=="POST")return{parsedBody:void 0};const o={response:t(413,-32600,`request body exceeds ${String(r)} bytes`)},s=Number(e.headers.get("content-length"));if(Number.isFinite(s)&&s>r)return o;const c=await e.text();if(S(c)>r)return o;let n;try{n=JSON.parse(c)}catch{return{response:t(400,-32700,"parse error: body is not valid JSON")}}return Array.isArray(n)?{response:t(400,-32600,"batched requests are not supported: send one JSON-RPC message per request")}:{parsedBody:n}},g=e=>{const r=e.maxRequestBytes??y;return async o=>{const s=await f(o,r);return"response"in s?s.response:a(l(e),o,s.parsedBody===void 0?void 0:{parsedBody:s.parsedBody})}};export{y as DEFAULT_MAX_REQUEST_BYTES,u as DOCS_SERVER_NAME,g as createDocsMcpFetchHandler,l as createDocsMcpServer};
|
package/dist/packem_shared/{LOCAL_SERVER_NAME-0Jb4neqA.mjs → LOCAL_SERVER_NAME-CisKTqzv.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{LunoraClient as f}from"@lunora/client";import{StdioServerTransport as p}from"@modelcontextprotocol/sdk/server/stdio.js";import{createToolServer as m}from"./createToolServer-BtGuPyMU.mjs";import{createRemoteDocsIndex as v}from"./DEFAULT_DOCS_BASE_URL-CZ3fVsSc.mjs";import{docsResources as h}from"./DOCS_URI_SCHEME-CFANc3vr.mjs";import{docsTools as y}from"./DEFAULT_SEARCH_LIMIT-
|
|
1
|
+
import{LunoraClient as f}from"@lunora/client";import{StdioServerTransport as p}from"@modelcontextprotocol/sdk/server/stdio.js";import{createToolServer as m}from"./createToolServer-BtGuPyMU.mjs";import{createRemoteDocsIndex as v}from"./DEFAULT_DOCS_BASE_URL-CZ3fVsSc.mjs";import{docsResources as h}from"./DOCS_URI_SCHEME-CFANc3vr.mjs";import{docsTools as y}from"./DEFAULT_SEARCH_LIMIT-V7pCZ1wt.mjs";import{toolDefinitions as E,callTool as R}from"./READ_ONLY_TOOL_DEFINITIONS-DGexf3Tn.mjs";const O=(e,n)=>{if(e.size<n)return;const t=e.keys().next().value;t!==void 0&&e.delete(t)},l=e=>e.docs===!1?void 0:v({...e.docs?.baseUrl===void 0?{}:{baseUrl:e.docs.baseUrl},...e.fetch===void 0?{}:{fetch:e.fetch}}),_="lunora",S="no Lunora dev server is running for this project — start one with `lunora dev`, then call this tool again (call lunora_dev_status to check).",T=8,d=e=>{const n=new Map;return t=>{const r=JSON.stringify([t.url,t.token??""]),c=n.get(r);if(c!==void 0)return c;const o=new f({fetch:e,url:t.url});return t.token!==void 0&&t.token.length>0&&o.setAuthToken(t.token),O(n,T),n.set(r,o),o}},i=e=>e?.token!==void 0&&e.token.length>0,C=(e,n,t)=>{const r=typeof e=="function"?e:()=>e;return E(n,i(r())).map(c=>({definition:c,handle:async o=>{const s=r();return s===void 0?{content:[{text:S,type:"text"}],isError:!0}:R(t(s),c.name,o,n,i(s))}}))},P="lunora-spec:openrpc",g="lunora-spec:openapi",a=[{description:"The deployment's generated OpenRPC 1.x document — every RPC function's path, kind, and argument schema in one read, instead of list_functions plus one get_function_schema call per function.",fetch:async e=>e.fetchOpenRpc(),name:"OpenRPC specification",uri:P},{description:"The deployment's generated OpenAPI 3.1 document.",fetch:async e=>e.fetchOpenApi(),name:"OpenAPI specification",uri:g}],k=(e,n)=>{const t=typeof e=="function"?e:()=>e,r=async c=>{const o=t();if(o!==void 0)try{return await c.fetch(n(o))}catch{return}};return{list:async()=>(await Promise.all(a.map(async o=>await r(o)===void 0?void 0:{description:o.description,mimeType:"application/json",name:o.name,uri:o.uri}))).filter(o=>o!==void 0),read:async c=>{const o=a.find(u=>u.uri===c);if(o===void 0)return;const s=await r(o);return s===void 0?void 0:{mimeType:"application/json",text:JSON.stringify(s,void 0,2)}}}},w=e=>({list:async()=>(await Promise.all(e.map(async t=>t.list()))).flat(),read:async n=>{for(const t of e){const r=await t.read(n);if(r!==void 0)return r}}}),x=(e,n)=>{const t=[],r=l(e);return r!==void 0&&t.push(...y(r)),t.push(...e.extraTools??[]),e.deployment!==void 0&&t.push(...C(e.deployment,e.allowWrites??!1,n??d(e.fetch))),t},A=(e={})=>{const n=l(e),t=[];n!==void 0&&t.push(h(n));const r=d(e.fetch);return e.deployment!==void 0&&t.push(k(e.deployment,r)),m({name:_,version:e.version??"0.0.0"},x(e,r),t.length===0?void 0:w(t))},j=async(e={})=>{const n=A(e);return await n.connect(new p),n};export{_ as LOCAL_SERVER_NAME,S as NO_DEPLOYMENT_MESSAGE,g as OPENAPI_RESOURCE_URI,P as OPENRPC_RESOURCE_URI,j as connectLocalStdio,A as createLocalMcpServer,x as localTools};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/mcp",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.80",
|
|
4
4
|
"description": "Model Context Protocol server exposing a Lunora deployment to AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lunora/client": "1.0.0-alpha.
|
|
56
|
+
"@lunora/client": "1.0.0-alpha.55",
|
|
57
57
|
"@lunora/errors": "1.0.0-alpha.22",
|
|
58
58
|
"@lunora/shard-engine": "1.0.0-alpha.33",
|
|
59
59
|
"@modelcontextprotocol/sdk": "^1.30.0"
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const T=10,I=50,h="docs",A=500,_={properties:{limit:{description:`Maximum hits to return (default ${String(10)}, max ${String(50)})`,type:"number"},query:{description:'Search terms, e.g. "shardBy" or "optimistic updates"',type:"string"}},required:["query"],type:"object"},p={properties:{url:{description:'Site-relative page URL from a search hit, e.g. "/docs/sharding"',type:"string"}},required:["url"],type:"object"},g={properties:{},type:"object"},i={destructiveHint:!1,idempotentHint:!0,openWorldHint:!0,readOnlyHint:!0},u={annotations:{...i,title:"Search the Lunora documentation"},description:"Search the Lunora documentation and return matching pages and sections. Use this before writing Lunora code (schema, queries, mutations, actions, sharding, .global(), client hooks) so the answer reflects the framework's current API rather than a guess. Follow a hit with lunora_get_doc to read the full page.",inputSchema:_,name:"lunora_search_docs"},l={annotations:{...i,title:"Read a Lunora documentation page"},description:"Return one Lunora documentation page in full, as Markdown. Takes the `url` of a lunora_search_docs hit or a lunora_list_docs entry.",inputSchema:p,name:"lunora_get_doc"},d={annotations:{...i,title:"List the Lunora documentation pages"},description:"List every Lunora documentation page with its title and description. Prefer lunora_search_docs when you know what you're looking for.",inputSchema:g,name:"lunora_list_docs"},L=[u,l,d],o=e=>({content:[{text:JSON.stringify(e,void 0,2),type:"text"}]}),m=e=>({content:[{text:e,type:"text"}],isError:!0}),a=512,c=(e,t)=>{const n=e[t];if(typeof n!="string"||n.trim().length===0)throw new TypeError(`"${t}" is required and must be a non-empty string`);if(n.length>a)throw new RangeError(`"${t}" must be at most ${String(a)} characters`);return n.trim()},f=e=>{const t=typeof e=="string"?Number(e):e;return typeof t!="number"||!Number.isFinite(t)?10:Math.min(50,Math.max(1,Math.floor(t)))},S=e=>{let t=e.trim();if(t.startsWith("http://")||t.startsWith("https://")){const n=t.slice(t.indexOf("//")+2),r=n.indexOf("/");t=r===-1?"/":n.slice(r)}for(const n of["?","#"]){const r=t.indexOf(n);r!==-1&&(t=t.slice(0,r))}for(;t.endsWith("/")&&t.length>1;)t=t.slice(0,-1);if(t.startsWith("/")||(t=t.startsWith("docs/")?`/${t}`:`/${h}/${t}`),t.split("/").includes(".."))throw new RangeError(`"url" must not contain ".." segments: ${e}`);return t},y=e=>[{definition:u,handle:async t=>{const n=c(t,"query"),r=f(t.limit),s=(await e.search(n)).slice(0,r);return s.length===0?o({hits:[],note:`no documentation matched "${n}" — try fewer or more general terms, or lunora_list_docs to browse`}):o({hits:s})}},{definition:l,handle:async t=>{const n=S(c(t,"url")),r=await e.getPage(n);return r===void 0?m(`documentation page not found: ${n}. Use lunora_search_docs or lunora_list_docs to find a valid url.`):{content:[{text:`# ${r.title} (${r.url})
|
|
2
|
-
|
|
3
|
-
${r.content}`,type:"text"}]}}},{definition:d,handle:async()=>{const t=await e.listPages();return t.length>500?o({note:`showing the first ${String(500)} of ${String(t.length)} pages — use lunora_search_docs to find the rest`,pages:t.slice(0,500)}):o(t)}}];export{T as DEFAULT_SEARCH_LIMIT,L as DOCS_TOOL_DEFINITIONS,a as MAX_ARGUMENT_LENGTH,A as MAX_LISTED_PAGES,I as MAX_SEARCH_LIMIT,y as docsTools,S as normalizeDocUrl};
|