@cachly-dev/mcp-server 0.10.207 → 0.10.208
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 +2 -2
- package/dist/src/editor-mcp-eintrag.js +10 -0
- package/dist/src/index.js +149 -150
- package/dist/src/uninstall.js +6 -6
- package/glama.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -341,8 +341,8 @@ Manual snippets are in [Manual Setup](#manual-setup).
|
|
|
341
341
|
| **Cursor** | yes, detected via `.cursor/` | `.cursor/mcp.json`, hooks in `.cursor/hooks.json` | no | Project-level; restart Cursor after setup. Lessons arrive with the first tool call of a turn |
|
|
342
342
|
| **Windsurf** | yes, detected via `.windsurf/` | `.windsurf/mcp.json` | no | Project-level; restart Windsurf after setup |
|
|
343
343
|
| **VS Code + Copilot** | yes, detected via `.vscode/` | `.vscode/mcp.json`, hooks in `.github/hooks/cachly-ambient.json` | no | Needs the VS Code MCP support or Copilot chat. Briefing at session start, lessons before each prompt |
|
|
344
|
-
| **Codex CLI** |
|
|
345
|
-
| **Gemini CLI** |
|
|
344
|
+
| **Codex CLI** | yes, detected via `~/.codex` | `.codex/config.toml` (`[mcp_servers.cachly]`), hooks in `.codex/hooks.json` | no | Codex loads both once you trust the folder; confirm the hook once in `/hooks` |
|
|
345
|
+
| **Gemini CLI** | yes, detected via `~/.gemini` | `mcpServers.cachly` and `hooks` in `.gemini/settings.json` | no | Gemini loads both once you trust the folder. Lessons are appended to the prompt (`BeforeAgent`) |
|
|
346
346
|
| **Cline** | yes, detected via VS Code | `.vscode/mcp.json` | no | Shares the config with Copilot; restart VS Code |
|
|
347
347
|
| **Continue.dev** | yes, detected via `.continue/` | `.continue/config.json` | no | Uses the `modelContextProtocolServers` key |
|
|
348
348
|
| **Zed** | yes, detected via `.zed/` | `.zed/settings.json` | no | Uses the `context_servers` key |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{existsSync as d}from"node:fs";import{mkdir as p,readFile as l,writeFile as f}from"node:fs/promises";import{dirname as m,resolve as h}from"node:path";import{GEMINI_SETTINGS_DATEI as x}from"./ambient-hooks.js";const a=".codex/config.toml",y="npx",g=["-y","@cachly-dev/mcp-server@latest"],i=n=>JSON.stringify(n),O=/^[A-Za-z0-9_-]+$/,_=/^\s*\[\[?[^[\],]+\]\]?\s*(?:#.*)?$/,w=/^\s*\[\s*mcp_servers\s*\.\s*(?:cachly|"cachly"|'cachly')\s*(?:\.[^\]]*)?\]\s*(?:#.*)?$/,C=/^\s*(?:mcp_servers\s*\.\s*)?["']?cachly["']?\s*(?:\.|=)/m;function N(n){const c=Object.entries(n).map(([t,e])=>{if(!O.test(t))throw new Error(`env name not usable as a TOML key: ${t}`);return`${t} = ${i(e)}`});return["[mcp_servers.cachly]",`command = ${i(y)}`,`args = [${g.map(i).join(", ")}]`,`env = { ${c.join(", ")} }`].join(`
|
|
2
|
+
`)}function A(n){const c=[];let t=!1,e=!1;for(const r of n.replace(/\r\n/g,`
|
|
3
|
+
`).split(`
|
|
4
|
+
`)){if(_.test(r)&&(t=w.test(r),t)){e=!0;continue}t||c.push(r)}const s=c.join(`
|
|
5
|
+
`).replace(/\s+$/,"");return{rest:s?s+`
|
|
6
|
+
`:"",entfernt:e}}function $(n,c){const t=N(c),e=n.replace(/\r\n/g,`
|
|
7
|
+
`),{rest:s}=A(e);if(C.test(s))return{grund:'has a "cachly" server in a form cachly does not rewrite (inline table or dotted key)'};const r=(s?s+`
|
|
8
|
+
`:"")+t+`
|
|
9
|
+
`;return{text:r,changed:r!==e}}async function J(n,c){const t=h(n,a),e=d(t)?await l(t,"utf-8"):"",s=e.charCodeAt(0)===65279?e.slice(1):e,r=$(s,c);return"grund"in r?{datei:a,status:"skipped",grund:r.grund}:r.changed?(await p(m(t),{recursive:!0}),await f(t,r.text,"utf-8"),{datei:a,status:e?"updated":"written"}):{datei:a,status:"unchanged"}}const S=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);async function L(n,c){const t=x,e=h(n,t),s=d(e)?await l(e,"utf-8"):"",r=s.charCodeAt(0)===65279?s.slice(1):s;let o;try{o=r.trim()?JSON.parse(r):{}}catch{const v=/^\s*\/\/|\/\*/m.test(r)?"has comments, and cachly only rewrites plain JSON":"is not valid JSON";return{datei:t,status:"skipped",grund:v}}if(!S(o))return{datei:t,status:"skipped",grund:"is not a JSON object"};if(o.mcpServers!==void 0&&!S(o.mcpServers))return{datei:t,status:"skipped",grund:'has a "mcpServers" field that is not an object'};const E={command:y,args:[...g],env:c},u={...o,mcpServers:{...o.mcpServers??{},cachly:E}};return JSON.stringify(u)===JSON.stringify(o)?{datei:t,status:"unchanged"}:(await p(m(e),{recursive:!0}),await f(e,JSON.stringify(u,null,2)+`
|
|
10
|
+
`,"utf-8"),{datei:t,status:s?"updated":"written"})}export{a as CODEX_CONFIG_DATEI,N as codexMcpBlock,J as installCodexMcp,L as installGeminiMcp,A as ohneCodexMcpEintrag,$ as setzeCodexMcpEintrag};
|