@cachly-dev/mcp-server 0.10.207 → 0.10.209

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 CHANGED
@@ -288,11 +288,10 @@ known cause. Ready-to-paste templates live in [`src/ci-integration/`](./src/ci-i
288
288
 
289
289
  - **GitHub Actions:** use [cachly-dev/cachly-action](https://github.com/cachly-dev/cachly-action).
290
290
  It needs the secrets `CACHLY_API_KEY` and `CACHLY_BRAIN_INSTANCE_ID`.
291
- - **GitLab CI:** copy [`brain-from-ci-gitlab.yml`](./src/ci-integration/brain-from-ci-gitlab.yml)
292
- into your pipeline. It adds two `.post` jobs (`on_success` and `on_failure`) with
293
- `allow_failure: true`. The
294
- [full GitLab template](https://github.com/cachly-dev/cachly-action/blob/main/templates/cachly.gitlab-ci.yml)
295
- adds hidden jobs for `learn`, `scan` and `confirm`. Pull it in with `include: remote:`.
291
+ - **GitLab CI:** pull in the
292
+ [GitLab template](https://github.com/cachly-dev/cachly-action/blob/main/templates/cachly.gitlab-ci.yml)
293
+ with `include: remote:`. It adds hidden jobs for `learn`, `scan`, `confirm` and `hygiene`;
294
+ extend the ones you want.
296
295
  - **Anything else:** [`push-ci-outcome.mjs`](./src/ci-integration/push-ci-outcome.mjs) is a
297
296
  standalone Node.js helper with no dependencies. It always exits 0, so your CI never
298
297
  fails because of a Brain push.
@@ -341,8 +340,8 @@ Manual snippets are in [Manual Setup](#manual-setup).
341
340
  | **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
341
  | **Windsurf** | yes, detected via `.windsurf/` | `.windsurf/mcp.json` | no | Project-level; restart Windsurf after setup |
343
342
  | **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** | hooks yes, detected via `~/.codex` | hooks in `.codex/hooks.json` | no | Trust `.codex/` and confirm the hook once in `/hooks`. For the tools, `init --editor codex` prints the `codex mcp add` line |
345
- | **Gemini CLI** | hooks yes, detected via `~/.gemini` | `hooks` in `.gemini/settings.json` | no | Lessons are appended to the prompt (`BeforeAgent`). For the tools, `init --editor gemini` prints the `gemini mcp add` line |
343
+ | **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` |
344
+ | **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
345
  | **Cline** | yes, detected via VS Code | `.vscode/mcp.json` | no | Shares the config with Copilot; restart VS Code |
347
346
  | **Continue.dev** | yes, detected via `.continue/` | `.continue/config.json` | no | Uses the `modelContextProtocolServers` key |
348
347
  | **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};