@cachly-dev/mcp-server 0.10.192 → 0.10.193
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/src/cls-hook.js +7 -7
- package/dist/src/index.js +21 -21
- package/glama.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/src/cls-hook.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{existsSync as
|
|
2
|
-
`,"utf-8"),await
|
|
3
|
-
`)?
|
|
4
|
-
`,"utf-8"),await
|
|
1
|
+
import{existsSync as S}from"node:fs";import{readFile as m,writeFile as r,chmod as s,mkdir as d}from"node:fs/promises";import{resolve as a}from"node:path";import{instanzIdFuerSkript as C}from"./git-ohne-shell.js";const p="v3",u=/(?:#!\/bin\/sh\n)?# cachly CLS[\s\S]*?\nexit 0\n?/;async function A(e,c,h){if(!S(a(e,".git")))return"skipped-no-git";const l=a(e,".git","hooks"),t=a(l,"post-commit");await d(l,{recursive:!0});const n=L(c);let i="";try{i=await m(t,"utf-8")}catch{}if(!i)return await r(t,n+`
|
|
2
|
+
`,"utf-8"),await s(t,493).catch(()=>{}),"written";if(i.includes(`cachly CLS \u2014 Continuous Learning Stream ${p}`))return"unchanged";if(u.test(i)){const o=i.replace(u,n);return await r(t,o.endsWith(`
|
|
3
|
+
`)?o:o+`
|
|
4
|
+
`,"utf-8"),await s(t,493).catch(()=>{}),"upgraded"}return await r(t,i.trimEnd()+`
|
|
5
5
|
|
|
6
|
-
`+
|
|
7
|
-
`,"utf-8"),await
|
|
8
|
-
`)}export{
|
|
6
|
+
`+n+`
|
|
7
|
+
`,"utf-8"),await s(t,493).catch(()=>{}),"appended"}const _="try{var p={instance_id:process.env.CACHLY_BRAIN_INSTANCE_ID,source:'git_commit',payload:{message:process.env.CLS_MSG||'',sha:process.env.CLS_SHA||'',files:(process.env.CLS_FILES||'').split(',').filter(Boolean)}};require('child_process').execFileSync('npx',['@cachly-dev/mcp-server@latest','cls-ingest',JSON.stringify(p)],{stdio:'ignore',timeout:8000});}catch(e){}";function L(e,c){return e=C(e),["#!/bin/sh",`# cachly CLS \u2014 Continuous Learning Stream ${p}`,"# Runs silently on every commit to keep your brain up to date.",`export CACHLY_BRAIN_INSTANCE_ID="${e}"`,'CLS_SHA=$(git rev-parse HEAD 2>/dev/null || echo "")',"CLS_MSG=$(git log -1 --pretty=%B 2>/dev/null | head -1 | cut -c1-200)","CLS_FILES=$(git diff-tree --no-commit-id -r --name-only HEAD 2>/dev/null | tr '\\n' ',' | sed 's/,$//')","export CLS_SHA CLS_MSG CLS_FILES",`node -e "${_}" 2>/dev/null &`,"exit 0"].join(`
|
|
8
|
+
`)}export{p as CLS_HOOK_VERSION,L as buildClsPostCommitHook,A as installClsPostCommitHook};
|
package/dist/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{setzeClientKennung as Bt}from"./herkunft.js";import{jwtExpiryMs as jt,checkJwt as Ht,handleApiError as Ot,diagnoseAuth as _e,planAuthHeal as Pe,readClientCredentialsFromEnv as Pt,buildClientCredentialsBody as Mt,clientCredentialsTokenUrl as Dt}from"./auth.js";import{cachlyUrl as N}from"./cachly-url.js";import{nutzungsSchluessel as Jt}from"./werkzeug-nutzung.js";import{istLieferung as Yt,lieferSchluessel as Ut,tokenDerAntwort as Wt,hatTreffer as Ft,trefferSchluessel as Me}from"./geliefert.js";import{notify as De}from"./notifier.js";import{fileURLToPath as Je}from"node:url";import{createRequire as zt}from"node:module";import{execFile as $e}from"node:child_process";const Kt=process.argv[1]!=null&&(process.argv[1]===Je(import.meta.url)||process.argv[1].endsWith("/dist/index.js")||process.argv[1].endsWith("/src/index.ts"));import{Server as Ye}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as qt}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as Gt}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{CallToolRequestSchema as Ue,ErrorCode as ne,ListPromptsRequestSchema as We,ListResourceTemplatesRequestSchema as Fe,ListResourcesRequestSchema as ze,ListToolsRequestSchema as Ke,McpError as X}from"@modelcontextprotocol/sdk/types.js";import{Redis as qe}from"ioredis";let x=process.env.CACHLY_API_URL??"https://api.cachly.dev",v=it()??"";ae(v);const Ss=process.env.CACHLY_EMBED_MODEL??"",D=(()=>{try{const e=zt(import.meta.url);for(const t of["../../package.json","../package.json"])try{const o=e(t);if(o.name==="@cachly-dev/mcp-server"&&o.version)return o.version}catch{}}catch{}return"0.10.100"})(),Vt=Number(process.env.CACHLY_PROVISION_TIMEOUT_MS??9e4);let H=Re(process.env.CACHLY_BRAIN_INSTANCE_ID),V=0,ce=null,Ge=!1;async function Zt(){let e=[];try{G.getClientCapabilities()?.roots&&(e=(await G.listRoots(void 0,{timeout:3e3})).roots)}catch{}return _n({wurzeln:e,env:process.env,cwd:process.cwd(),dateiPfad:Je})}function se(){return Ge?dt(process.env):!1}function Ce(e,t){!e||!se()||bn({instanzId:e,verbindung:P,ausGit:o=>Ie("brain_from_git",o,P,O),projektOrdner:t?async()=>t:Zt,einbetten:o=>Qe(o,{geduld:"lang"}),hatEinbettung:uo,einbettenZweit:o=>Qe(o,{geduld:"lang",modell:po}),melde:o=>A("brain_from_git",{...v?{api_key:v}:{},instance_id:e,total:o,auto:"startwissen"}),startvorrat:o=>Le("brain_seed_starter",o,P,O),meldeStartvorrat:o=>A("brain_seed_starter",{...v?{api_key:v}:{},instance_id:e,auto:!0},{seeded_count:o,auto:!0})})}function Ae(){return se()&&$n()}const Qt=7e3,Xt=12e3,eo=6e4;let he=null;function Se(e){return he||(he=to(e).finally(()=>{he=null})),he}async function to(e){try{if(!v){const t=Date.now()+e;for(;!Ee()&&mn({})&&Date.now()<t;)await new Promise(n=>setTimeout(n,dn));const o=Ee();if(!o)return!1;v=o,ae(o);const s=Xo();s&&!H&&(H=s,V=0),await le(o),s&&await de(s),A("instant_trial_started",{tool:"sessionstart-hook",...s?{instance_id:s}:{}})}if(se()&<()){const t=un();t&&(Ne(t.instanzId,se(),Ae()),Ce(t.instanzId,t.projekt||void 0))}}catch{}return!!v}function oo(){if(!dt(process.env))return;const e=Date.now()+eo,t=setInterval(()=>{if(Date.now()>e){clearInterval(t);return}v&&!lt()||Se(0)},500);t.unref(),Se(0)}async function no(){if(!v)return"";try{const e=await fetch(`${x}/api/v1/instances/auto`,{method:"POST",headers:{Authorization:`Bearer ${v}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(12e3)});if(e.ok){const t=await e.json(),o=t.instance?.id??t.instance_id;if(o)return o}else fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`},body:JSON.stringify({event:"auto_provision_failed",status:e.status,version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{})}catch{fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:"auto_provision_failed",status:0,reason:"network_error",version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{})}return""}async function Ve(){if(H)return H;if(!v)return"";if(ce)return ce;const e=Date.now();if(V>0&&e-V<3e4)return"";V=e,ce=(async()=>{try{const t=await fetch(`${x}/api/v1/instances`,{headers:{Authorization:`Bearer ${v}`,Accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(t.ok){const s=(await t.json())?.data??[],n=s.find(i=>i.status==="running")??s.find(i=>i.status==="provisioning");if(n)return H=n.id,V=0,H;const c=await no();if(c)return H=c,V=0,Ne(c,se(),Ae()),de(c),Ce(c),H}}catch{}return""})();try{return await ce}finally{ce=null}}let ke=0;const so=6e4;let re="";async function le(e){try{const{writeFile:t,mkdir:o,readFile:s}=await import("node:fs/promises"),{existsSync:n}=await import("node:fs"),{resolve:c,dirname:i}=await import("node:path"),a=process.env.HOME??process.env.USERPROFILE??process.env.APPDATA??"";if(!a)return;const u=c(a,".claude","mcp.json");let g={};if(n(u))try{g=JSON.parse(await s(u,"utf-8"))}catch{}g.mcpServers??={};const l=g.mcpServers.cachly;if(l)l.env??={},l.env.CACHLY_JWT=e;else{const y={};y.CACHLY_JWT=e,g.mcpServers.cachly={command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:y}}await o(i(u),{recursive:!0}),await t(u,JSON.stringify(g,null,2),"utf-8");const m=[c(a,".cursor","mcp.json"),c(a,".codeium","windsurf","mcp_config.json")];await Promise.allSettled(m.map(async y=>{if(n(y))try{const w=await s(y,"utf-8"),b=JSON.parse(w),p=b?.mcpServers?.cachly;p?.env&&(p.env.CACHLY_JWT=e,await t(y,JSON.stringify(b,null,2),"utf-8"))}catch{}}))}catch{}}async function de(e){if(e){at(e,{apiKey:v});try{const{writeFile:t,readFile:o}=await import("node:fs/promises"),{existsSync:s}=await import("node:fs"),{resolve:n}=await import("node:path"),c=process.env.HOME??process.env.USERPROFILE??process.env.APPDATA??"";if(!c)return;const i=[n(c,".claude","mcp.json"),n(c,".cursor","mcp.json"),n(c,".codeium","windsurf","mcp_config.json")];await Promise.allSettled(i.map(async a=>{if(s(a))try{const u=JSON.parse(await o(a,"utf-8")),g=u?.mcpServers?.cachly;g?.env&&(g.env.CACHLY_BRAIN_INSTANCE_ID=e,await t(a,JSON.stringify(u,null,2),"utf-8"))}catch{}}))}catch{}}}async function ro(){try{const e=await fetch(`${x}/api/v1/api-keys`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`},body:JSON.stringify({name:"cachly-mcp-selfheal",scope:"read_write"}),signal:AbortSignal.timeout(8e3)});if(!e.ok)return!1;const t=await e.json();return t.key?(v=t.key,ae(t.key),le(t.key),A("auth_self_healed",{reason:"near_expiry_refresh"}),!0):!1}catch{return!1}}async function Te(){const e=_e(v),t=Pe(e);if(t==="none")return re="",!0;if(t==="refresh"){const o=Date.now();return o-ke>=so&&(ke=o,await ro())?(re="",!0):(re=e.message,e.usable)}return re=e.message,!1}function ie(e,t){const o=(i,a)=>{try{t?.(i,a)}catch{}},s=i=>{i?o(!1,i.code??i.message):o(!0)},n=Po(e);if(!n){o(!1,"keine-http-adresse");return}const c=Mo(n);try{process.platform==="win32"?$e("cmd",["/c","start","",c],{windowsHide:!0},s):process.platform==="darwin"?$e("open",[n],s):$e("xdg-open",[n],s)}catch(i){o(!1,i instanceof Error?i.message:"unknown")}}let q=null;async function io(){try{const e=await fetch(`${x}/auth/device`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({}),signal:AbortSignal.timeout(8e3)});if(e.ok){const t=await e.json(),o=t.verification_uri||N("/device","ambient-signin"),s=`${o}${o.includes("?")?"&":"?"}code=${encodeURIComponent(t.user_code)}`;return{deviceCode:t.device_code,userCode:t.user_code,verifyUrl:s,pollInterval:(t.interval??5)*1e3,deadline:Date.now()+600*1e3,polling:!1}}}catch{}try{const t=await fetch("https://auth.cachly.dev/realms/cachly/protocol/openid-connect/auth/device",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"client_id=cachly-cli&scope=openid",signal:AbortSignal.timeout(8e3)});if(!t.ok)return null;const o=await t.json();return{deviceCode:o.device_code,userCode:o.user_code,verifyUrl:o.verification_uri_complete,pollInterval:(o.interval??5)*1e3,deadline:Date.now()+600*1e3,polling:!1}}catch{return null}}async function ao(e){if(Date.now()>e.deadline)return"expired";const t=async()=>{const s=await fetch(`${x}/auth/device/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e.deviceCode}),signal:AbortSignal.timeout(8e3)});return s.ok?s.json():null},o=async()=>(await fetch("https://auth.cachly.dev/realms/cachly/protocol/openid-connect/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`client_id=cachly-cli&grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${e.deviceCode}`,signal:AbortSignal.timeout(8e3)})).json();try{let s=await t().catch(()=>null);if(s||(s=await o().catch(()=>null)),!s)return"pending";if(s.access_token){let n=s.access_token;try{const c=await fetch(`${x}/api/v1/api-keys`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({name:"cachly-mcp-smithery",scope:"read_write"}),signal:AbortSignal.timeout(8e3)});if(c.ok){const i=await c.json();i.key&&(n=i.key)}}catch{}return v=n,ae(n),q=null,A("device_flow_completed"),le(n),te(n),V=0,await Ve(),H&&de(H),"done"}return s.error==="slow_down"&&(e.pollInterval=Math.min(e.pollInterval+2e3,15e3)),"pending"}catch{return"pending"}}async function Ze(e){if(e.polling)return"pending";e.polling=!0;try{return await ao(e)}finally{e.polling=!1}}function co(e,t=Ze,o=n=>q===n,s=lo){const n=async()=>{if(!o(e))return;let c="pending";try{c=await t(e)}catch{}if(c!=="done"){if(c==="expired"){o(e)&&(q=null);return}o(e)&&s(n,e.pollInterval)}};s(n,e.pollInterval)}function lo(e,t){const o=setTimeout(e,t);typeof o.unref=="function"&&o.unref()}import{setEmbedJwt as ae,computeEmbedding as Qe,hasEmbedProvider as uo,EMBED_PROVIDER as Xe}from"./embeddings.js";import{ZWEIT_MODELL as po}from"./rangfolge-stellschrauben.js";import{tokenize as mo,splitMultiQuery as go,levenshtein as fo,recencyBoost as ho,extractTimestamp as yo,STOPWORDS as bo,katakanaToRomaji as vo,arabicLightStem as wo,expandCrossLingual as xo,CROSS_LINGUAL_MAP as _o,ZERO_RESULTS_LOG as $o,zeroResultsTotal as Co}from"./search.js";const ee=new Map;function Ao(e){return e<=1?200:null}async function P(e){if(!e)throw new X(ne.InvalidRequest,`\u23F3 Your Brain instance is still being set up.
|
|
2
|
+
import{setzeClientKennung as Bt}from"./herkunft.js";import{jwtExpiryMs as jt,checkJwt as Ht,handleApiError as Ot,diagnoseAuth as _e,planAuthHeal as Pe,readClientCredentialsFromEnv as Pt,buildClientCredentialsBody as Mt,clientCredentialsTokenUrl as Dt}from"./auth.js";import{cachlyUrl as N}from"./cachly-url.js";import{nutzungsSchluessel as Jt}from"./werkzeug-nutzung.js";import{istLieferung as Yt,lieferSchluessel as Ut,tokenDerAntwort as Wt,hatTreffer as Ft,trefferSchluessel as Me}from"./geliefert.js";import{notify as De}from"./notifier.js";import{fileURLToPath as Je}from"node:url";import{createRequire as zt}from"node:module";import{execFile as $e}from"node:child_process";const Kt=process.argv[1]!=null&&(process.argv[1]===Je(import.meta.url)||process.argv[1].endsWith("/dist/index.js")||process.argv[1].endsWith("/src/index.ts"));import{Server as Ye}from"@modelcontextprotocol/sdk/server/index.js";import{StdioServerTransport as qt}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as Gt}from"@modelcontextprotocol/sdk/server/streamableHttp.js";import{CallToolRequestSchema as Ue,ErrorCode as ne,ListPromptsRequestSchema as We,ListResourceTemplatesRequestSchema as Fe,ListResourcesRequestSchema as ze,ListToolsRequestSchema as Ke,McpError as ee}from"@modelcontextprotocol/sdk/types.js";import{Redis as qe}from"ioredis";let x=process.env.CACHLY_API_URL??"https://api.cachly.dev",v=it()??"";ae(v);const Ss=process.env.CACHLY_EMBED_MODEL??"",D=(()=>{try{const e=zt(import.meta.url);for(const t of["../../package.json","../package.json"])try{const o=e(t);if(o.name==="@cachly-dev/mcp-server"&&o.version)return o.version}catch{}}catch{}return"0.10.100"})(),Vt=Number(process.env.CACHLY_PROVISION_TIMEOUT_MS??9e4);let H=Re(process.env.CACHLY_BRAIN_INSTANCE_ID),V=0,ce=null,Ge=!1;async function Zt(){let e=[];try{G.getClientCapabilities()?.roots&&(e=(await G.listRoots(void 0,{timeout:3e3})).roots)}catch{}return _n({wurzeln:e,env:process.env,cwd:process.cwd(),dateiPfad:Je})}function se(){return Ge?dt(process.env):!1}function Ce(e,t){!e||!se()||bn({instanzId:e,verbindung:P,ausGit:o=>Ie("brain_from_git",o,P,O),projektOrdner:t?async()=>t:Zt,einbetten:o=>Qe(o,{geduld:"lang"}),hatEinbettung:uo,einbettenZweit:o=>Qe(o,{geduld:"lang",modell:po}),melde:o=>A("brain_from_git",{...v?{api_key:v}:{},instance_id:e,total:o,auto:"startwissen"}),startvorrat:o=>Le("brain_seed_starter",o,P,O),meldeStartvorrat:o=>A("brain_seed_starter",{...v?{api_key:v}:{},instance_id:e,auto:!0},{seeded_count:o,auto:!0})})}function Ae(){return se()&&$n()}const Qt=7e3,Xt=12e3,eo=6e4;let he=null;function Se(e){return he||(he=to(e).finally(()=>{he=null})),he}async function to(e){try{if(!v){const t=Date.now()+e;for(;!Ee()&&mn({})&&Date.now()<t;)await new Promise(n=>setTimeout(n,dn));const o=Ee();if(!o)return!1;v=o,ae(o);const s=Xo();s&&!H&&(H=s,V=0),await le(o),s&&await de(s),A("instant_trial_started",{tool:"sessionstart-hook",...s?{instance_id:s}:{}})}if(se()&<()){const t=un();t&&(Ne(t.instanzId,se(),Ae()),Ce(t.instanzId,t.projekt||void 0))}}catch{}return!!v}function oo(){if(!dt(process.env))return;const e=Date.now()+eo,t=setInterval(()=>{if(Date.now()>e){clearInterval(t);return}v&&!lt()||Se(0)},500);t.unref(),Se(0)}async function no(){if(!v)return"";try{const e=await fetch(`${x}/api/v1/instances/auto`,{method:"POST",headers:{Authorization:`Bearer ${v}`,"Content-Type":"application/json"},signal:AbortSignal.timeout(12e3)});if(e.ok){const t=await e.json(),o=t.instance?.id??t.instance_id;if(o)return o}else fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`},body:JSON.stringify({event:"auto_provision_failed",status:e.status,version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{})}catch{fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:"auto_provision_failed",status:0,reason:"network_error",version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{})}return""}async function Ve(){if(H)return H;if(!v)return"";if(ce)return ce;const e=Date.now();if(V>0&&e-V<3e4)return"";V=e,ce=(async()=>{try{const t=await fetch(`${x}/api/v1/instances`,{headers:{Authorization:`Bearer ${v}`,Accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(t.ok){const s=(await t.json())?.data??[],n=s.find(i=>i.status==="running")??s.find(i=>i.status==="provisioning");if(n)return H=n.id,V=0,H;const c=await no();if(c)return H=c,V=0,Ne(c,se(),Ae()),de(c),Ce(c),H}}catch{}return""})();try{return await ce}finally{ce=null}}let ke=0;const so=6e4;let re="";async function le(e){try{const{writeFile:t,mkdir:o,readFile:s}=await import("node:fs/promises"),{existsSync:n}=await import("node:fs"),{resolve:c,dirname:i}=await import("node:path"),a=process.env.HOME??process.env.USERPROFILE??process.env.APPDATA??"";if(!a)return;const u=c(a,".claude","mcp.json");let g={};if(n(u))try{g=JSON.parse(await s(u,"utf-8"))}catch{}g.mcpServers??={};const l=g.mcpServers.cachly;if(l)l.env??={},l.env.CACHLY_JWT=e;else{const y={};y.CACHLY_JWT=e,g.mcpServers.cachly={command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:y}}await o(i(u),{recursive:!0}),await t(u,JSON.stringify(g,null,2),"utf-8");const m=[c(a,".cursor","mcp.json"),c(a,".codeium","windsurf","mcp_config.json")];await Promise.allSettled(m.map(async y=>{if(n(y))try{const w=await s(y,"utf-8"),b=JSON.parse(w),p=b?.mcpServers?.cachly;p?.env&&(p.env.CACHLY_JWT=e,await t(y,JSON.stringify(b,null,2),"utf-8"))}catch{}}))}catch{}}async function de(e){if(e){at(e,{apiKey:v});try{const{writeFile:t,readFile:o}=await import("node:fs/promises"),{existsSync:s}=await import("node:fs"),{resolve:n}=await import("node:path"),c=process.env.HOME??process.env.USERPROFILE??process.env.APPDATA??"";if(!c)return;const i=[n(c,".claude","mcp.json"),n(c,".cursor","mcp.json"),n(c,".codeium","windsurf","mcp_config.json")];await Promise.allSettled(i.map(async a=>{if(s(a))try{const u=JSON.parse(await o(a,"utf-8")),g=u?.mcpServers?.cachly;g?.env&&(g.env.CACHLY_BRAIN_INSTANCE_ID=e,await t(a,JSON.stringify(u,null,2),"utf-8"))}catch{}}))}catch{}}}async function ro(){try{const e=await fetch(`${x}/api/v1/api-keys`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`},body:JSON.stringify({name:"cachly-mcp-selfheal",scope:"read_write"}),signal:AbortSignal.timeout(8e3)});if(!e.ok)return!1;const t=await e.json();return t.key?(v=t.key,ae(t.key),le(t.key),A("auth_self_healed",{reason:"near_expiry_refresh"}),!0):!1}catch{return!1}}async function Te(){const e=_e(v),t=Pe(e);if(t==="none")return re="",!0;if(t==="refresh"){const o=Date.now();return o-ke>=so&&(ke=o,await ro())?(re="",!0):(re=e.message,e.usable)}return re=e.message,!1}function ie(e,t){const o=(i,a)=>{try{t?.(i,a)}catch{}},s=i=>{i?o(!1,i.code??i.message):o(!0)},n=Po(e);if(!n){o(!1,"keine-http-adresse");return}const c=Mo(n);try{process.platform==="win32"?$e("cmd",["/c","start","",c],{windowsHide:!0},s):process.platform==="darwin"?$e("open",[n],s):$e("xdg-open",[n],s)}catch(i){o(!1,i instanceof Error?i.message:"unknown")}}let q=null;async function io(){try{const e=await fetch(`${x}/auth/device`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({}),signal:AbortSignal.timeout(8e3)});if(e.ok){const t=await e.json(),o=t.verification_uri||N("/device","ambient-signin"),s=`${o}${o.includes("?")?"&":"?"}code=${encodeURIComponent(t.user_code)}`;return{deviceCode:t.device_code,userCode:t.user_code,verifyUrl:s,pollInterval:(t.interval??5)*1e3,deadline:Date.now()+600*1e3,polling:!1}}}catch{}try{const t=await fetch("https://auth.cachly.dev/realms/cachly/protocol/openid-connect/auth/device",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"client_id=cachly-cli&scope=openid",signal:AbortSignal.timeout(8e3)});if(!t.ok)return null;const o=await t.json();return{deviceCode:o.device_code,userCode:o.user_code,verifyUrl:o.verification_uri_complete,pollInterval:(o.interval??5)*1e3,deadline:Date.now()+600*1e3,polling:!1}}catch{return null}}async function ao(e){if(Date.now()>e.deadline)return"expired";const t=async()=>{const s=await fetch(`${x}/auth/device/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:e.deviceCode}),signal:AbortSignal.timeout(8e3)});return s.ok?s.json():null},o=async()=>(await fetch("https://auth.cachly.dev/realms/cachly/protocol/openid-connect/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`client_id=cachly-cli&grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${e.deviceCode}`,signal:AbortSignal.timeout(8e3)})).json();try{let s=await t().catch(()=>null);if(s||(s=await o().catch(()=>null)),!s)return"pending";if(s.access_token){let n=s.access_token;try{const c=await fetch(`${x}/api/v1/api-keys`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({name:"cachly-mcp-smithery",scope:"read_write"}),signal:AbortSignal.timeout(8e3)});if(c.ok){const i=await c.json();i.key&&(n=i.key)}}catch{}return v=n,ae(n),q=null,A("device_flow_completed"),le(n),Z(n),V=0,await Ve(),H&&de(H),"done"}return s.error==="slow_down"&&(e.pollInterval=Math.min(e.pollInterval+2e3,15e3)),"pending"}catch{return"pending"}}async function Ze(e){if(e.polling)return"pending";e.polling=!0;try{return await ao(e)}finally{e.polling=!1}}function co(e,t=Ze,o=n=>q===n,s=lo){const n=async()=>{if(!o(e))return;let c="pending";try{c=await t(e)}catch{}if(c!=="done"){if(c==="expired"){o(e)&&(q=null);return}o(e)&&s(n,e.pollInterval)}};s(n,e.pollInterval)}function lo(e,t){const o=setTimeout(e,t);typeof o.unref=="function"&&o.unref()}import{setEmbedJwt as ae,computeEmbedding as Qe,hasEmbedProvider as uo,EMBED_PROVIDER as Xe}from"./embeddings.js";import{ZWEIT_MODELL as po}from"./rangfolge-stellschrauben.js";import{tokenize as mo,splitMultiQuery as go,levenshtein as fo,recencyBoost as ho,extractTimestamp as yo,STOPWORDS as bo,katakanaToRomaji as vo,arabicLightStem as wo,expandCrossLingual as xo,CROSS_LINGUAL_MAP as _o,ZERO_RESULTS_LOG as $o,zeroResultsTotal as Co}from"./search.js";const te=new Map;function Ao(e){return e<=1?200:null}async function P(e){if(!e)throw new ee(ne.InvalidRequest,`\u23F3 Your Brain instance is still being set up.
|
|
3
3
|
|
|
4
4
|
This usually resolves in a few seconds \u2014 just call the tool again and it will connect automatically.
|
|
5
5
|
|
|
6
6
|
If it keeps happening:
|
|
7
7
|
\u2022 Run \`list_instances\` to check your instances, or
|
|
8
8
|
\u2022 Set CACHLY_BRAIN_INSTANCE_ID in your MCP config, or
|
|
9
|
-
\u2022 Reach us at support@cachly.dev.`);const t=
|
|
9
|
+
\u2022 Reach us at support@cachly.dev.`);const t=te.get(e);return t||hn(So,e,()=>ko(e))}const So=new Map;async function ko(e){W("verbindung: Instanz abfragen");let t=await O(`/api/v1/instances/${e}`);if(W(`verbindung: Instanz ${t.status}`),t=await fn(t,()=>O(`/api/v1/instances/${e}`),{fristMs:Vt,melde:i=>W(`verbindung: Instanz ${i.status}`)}),t.status!=="running"){fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}},body:JSON.stringify({event:"instance_not_reachable",instance_id:e,status:t.status,version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{});let i;throw t.status==="provisioning"?i=`\u23F3 Brain instance "${t.name}" is still starting up.
|
|
10
10
|
|
|
11
11
|
First-time provisioning typically takes 1\u20133 minutes. Please retry in a moment \u2014 the instance will be ready soon.`:t.status==="failed"?i=`\u274C Brain instance "${t.name}" failed to start.
|
|
12
12
|
|
|
@@ -18,11 +18,11 @@ Update your payment method at: ${N("/billing","upgrade")}`:t.status==="pending_p
|
|
|
18
18
|
Complete your checkout at: ${N("/instances","upgrade")}`:i=`Brain instance "${t.name}" is not reachable (status: ${t.status}).
|
|
19
19
|
|
|
20
20
|
\u2022 View your instance at: ${N("/instances","instance-error")}
|
|
21
|
-
\u2022 Run \`get_api_status\` for a full diagnostic.`,new
|
|
21
|
+
\u2022 Run \`get_api_status\` for a full diagnostic.`,new ee(ne.InvalidRequest,i)}if(!t.host||!t.port)throw new ee(ne.InternalError,`Instance "${t.name}" is running but has no host/port \u2014 contact support@cachly.dev.`);let o,s=t.tls_enabled!==!1;try{const i=await O(`/api/v1/instances/${e}/connection`);o=i.password??void 0,s=i.tls_enabled!==!1,W("verbindung: Zugangsdaten da")}catch(i){const a=i instanceof Error?i.message:String(i);if(a.includes("401")||a.includes("403")||a.includes("Unauthorized"))throw new ee(ne.InvalidRequest,"API key rejected \u2014 run `cachly setup` to refresh your credentials.")}const n=new qe({host:t.host,port:t.port,password:o||void 0,commandTimeout:8e3,...s?{tls:{}}:{},lazyConnect:!0,enableReadyCheck:!0,connectTimeout:8e3,retryStrategy:Ao,maxRetriesPerRequest:1,keepAlive:15e3}),c=()=>{te.delete(e),n.disconnect()};n.on("error",c),n.on("end",c);try{await n.connect()}catch(i){n.disconnect();const a=i instanceof Error?i.message:String(i);throw fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}},body:JSON.stringify({event:"redis_connect_failed",instance_id:e,host:t.host,port:t.port,error:a,version:D}),signal:AbortSignal.timeout(3e3)}).catch(()=>{}),new ee(ne.InternalError,`Could not reach Brain instance "${t.name}" (${t.host}:${t.port}).
|
|
22
22
|
|
|
23
23
|
\u2022 Check your network connection
|
|
24
24
|
\u2022 Run \`get_api_status\` to verify instance status
|
|
25
|
-
\u2022 Technical detail: ${a}`)}return
|
|
25
|
+
\u2022 Technical detail: ${a}`)}return te.set(e,n),W("verbindung: Valkey verbunden"),n}async function O(e,t={},o=!1){o||Pe(_e(v))!=="none"&&await Te(),Ht(v);const s=Number(process.env.CACHLY_API_TIMEOUT_MS??15e3),n=await fetch(`${x}${e}`,{...t,signal:AbortSignal.timeout(s),headers:{"Content-Type":"application/json",Authorization:`Bearer ${v}`,...t.headers}});if(!n.ok){if(n.status===401&&!o&&(ke=0,await Te()))return O(e,t,!0);const i=(await n.json().catch(()=>({error:n.statusText}))).error??n.statusText;Ot(n.status,i)}if(n.status!==204)return n.json()}import{handleBrainTool as To}from"./handlers/brain.js";import{handleContextTool as Io}from"./handlers/context.js";import{handleInstanceTool as Eo}from"./handlers/instances.js";import{handleCacheTool as Ro}from"./handlers/cache.js";import{handleTeamTool as No}from"./handlers/team.js";import{handleRoadmapTool as Lo}from"./handlers/roadmap.js";import{handleAdvancedTool as Bo}from"./handlers/advanced.js";import{handleSyndicateTool as jo}from"./handlers/syndicate.js";import{handleFedbrainTool as Ie,_lastBrainFromGitCounts as ye}from"./handlers/fedbrain.js";import{extractFirstRecallProof as Ho,renderFirstRecallProof as Oo}from"./first-recall-proof.js";import{installClsPostCommitHook as et,CLS_HOOK_VERSION as tt}from"./cls-hook.js";import{gitLesen as ot}from"./git-ohne-shell.js";import{browserAdresse as Po,fuerCmd as Mo}from"./browser-adresse.js";import{installAmbientHooks as nt,installCursorHooks as Do,installCopilotHooks as Jo,installCodexHooks as Yo,installGeminiHooks as Uo,AMBIENT_HOOK_VERSION as st,COPILOT_HOOKS_DATEI as Wo,CODEX_HOOKS_DATEI as Fo,GEMINI_SETTINGS_DATEI as zo}from"./ambient-hooks.js";import{hookHauptlauf as Ko,auffrischenHauptlauf as qo}from"./ambient-hook.js";import{rahmeAntwort as Go}from"./antwort-rahmen.js";import{appendLedgerEntry as Vo,readLedger as rt,defaultLedgerPath as Zo,reportLedgerEntry as Qo}from"./ambient-ledger.js";import{resolveApiKey as it,saveApiKey as Z,saveInstanceId as at,readSavedApiKey as Ee,readInstanceId as Xo}from"./credentials.js";import{KEYCLOAK_BASIS as ct,istTestSchluessel as en,waehleTestSchluessel as tn,starteKeycloakAnmeldung as on,warteAufKeycloakAnmeldung as nn,uebernimm as sn,brainImKonto as rn,erfolgsText as an,fehlerText as cn,ersetzeSchluessel as ln}from"./uebernahme.js";import{WARTE_TAKT_MS as dn,auftragLiegt as lt,nimmAuftrag as un,sichereKonto as pn,sperreLiegt as mn,startwissenEingeschaltet as dt}from"./konto-anlegen.js";import{sichereZugang as gn,echterWert as Re}from"./zugang.js";import{zeitpunkt as W}from"./zeitmessung.js";import{warteAufLaufendeInstanz as fn,gemeinsamerAufbau as hn}from"./instanz-warten.js";import{merkeNeuesBrain as Ne,startetLautLetztemBlick as yn}from"./leeres-brain.js";import{starteStartwissen as bn,startwissenGestartet as vn,beanspruchStartwissen as wn,holeStartwissenHinweis as xn,waehleProjektOrdner as _n,startvorratErlaubt as $n}from"./startwissen.js";import{eigeneFassung as Cn,pruefeNeueFassung as An,holeNeueFassungHinweis as Sn}from"./neue-fassung.js";import{beiStdinEnde as kn}from"./stdin-ende.js";import{merkeWerkzeugAufruf as Tn,starteBrandWachhund as In}from"./brand-wachhund.js";import{sichtbareWerkzeuge as En,VERTEILER as ut}from"./werkzeug-auswahl.js";import{buildLessonsMarkdown as Rn,buildLessonsJsonl as Nn,vonRohLektion as Ln}from"./brain-export.js";import{detectEditor as Bn}from"./editor.js";import{milestoneSent as pt,markMilestoneSent as mt}from"./funnel-milestones.js";import{kostprobeUebrig as jn,kostprobeVerbrauchen as Hn,kostprobeHinweis as On,schrankeNachKostproben as Pn}from"./kostprobe.js";import{netBalance as Mn}from"./ambient-recall.js";import{handleShareTool as Le}from"./handlers/share.js";import{handleVizTool as Dn}from"./handlers/viz.js";import{commitArt as Jn,istRueckbau as Yn,zaehleLektionen as Un}from"./commit-art.js";import{TOOLS as ue}from"./tools.js";let gt=!1,be=!1;function ft(){return Bn()}function Wn(e){if(!e)return null;const t=e.match(/\*\*💡\s+([^*]+)\*\*/),o=e.match(/^>\s+(.+)$/m);if(!t||!o)return null;const s=t[1].trim(),n=o[1].trim();return!s||!n?null:{topic:s,what:n}}function Fn(e){try{const t=e.split(".");if(t.length!==3)return;const o=JSON.parse(Buffer.from(t[1],"base64url").toString("utf-8"));if(!o.sub)return;let s=2166136261;for(let n=0;n<o.sub.length;n++)s^=o.sub.charCodeAt(n),s=s*16777619>>>0;return s.toString(16).padStart(8,"0")+o.sub.length.toString(16).padStart(4,"0")}catch{return}}function A(e,t,o){if(process.env.CACHLY_NO_TELEMETRY==="1")return;const s=v?Fn(v):void 0;fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,version:D,editor:ft(),...v?{jwt:v}:{},...s?{user_fingerprint:s}:{},...o?{metrics:o}:{},...t}),signal:AbortSignal.timeout(3e3)}).catch(()=>{})}function zn(e,t){return Qo({apiUrl:x,jwt:v,instanceId:e},t)}async function Kn(e){if(!gt&&process.env.CACHLY_NO_TELEMETRY!=="1"){gt=!0;try{await fetch(`${x}/api/v1/telemetry/mcp`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:"first_call_no_jwt",version:D,editor:ft(),tool:e}),signal:AbortSignal.timeout(3e3)})}catch{}}}const qn=new Set(["causal_trace","brain_predict","brain_plan","brain_predict_failures","team_learn","team_confirm","team_recall","team_synthesize","team_crystallize","global_learn","global_recall"]),Gn={causal_trace:"Causal root-cause tracing \u2014 follow the failure chain to the real cause, not just the symptom.",brain_predict:"Predictive risk \u2014 your Brain warns you what will break *before* you run it.",brain_plan:"Generative planning \u2014 turn a goal into an ordered, risk-aware plan from your own history.",brain_predict_failures:"Failure prediction \u2014 catch CI/build breakage before it happens.",team_learn:"Team Brain \u2014 one shared memory across your whole team.",team_confirm:"Team Brain \u2014 peer + senior review that raises lesson trust.",team_recall:"Team Brain \u2014 recall everything your teammates have already solved.",team_synthesize:"Team Brain \u2014 synthesize collective knowledge across authors.",team_crystallize:"Team Brain \u2014 compress your team's wisdom into a shareable crystal.",global_learn:"Team Brain \u2014 contribute to your organization's shared memory.",global_recall:"Team Brain \u2014 recall across your entire organization."},ht=N("/billing","upgrade"),yt=new Map;async function Vn(e){const t=yt.get(e);if(t&&t.expiresAt>Date.now())return t.info;try{const s=((await O(`/api/v1/instances/${e}`))?.tier??"free").toLowerCase(),n={tier:s,isFree:s==="free"||s===""};return yt.set(e,{info:n,expiresAt:Date.now()+6e4}),n}catch{return{tier:"unknown",isFree:!1}}}async function Zn(e,t){if(!qn.has(e)||!t)return null;const{isFree:o}=await Vn(t);if(!o)return null;const s=Gn[e]??"A Premium intelligence feature.";if(jn(e)){const n=Hn(e);return{kostprobe:On(e,n,ht)}}return{sperre:Pn(e,s,ht)}}async function Qn(e,t){try{await(await P(e)).hincrby(Jt(e),t,1)}catch{}}async function Xn(e,t,o){if(Yt(t))try{const s=await P(e),n=Ft(o);await s.incrby(Ut(e),n?Wt(o):0),await s.hincrby(Me(e),"abrufe",1),n&&await s.hincrby(Me(e),"treffer",1)}catch{}}async function es(e){const t=await io();return t?(q=t,A("device_flow_started",{tool:e}),ie(t.verifyUrl,(o,s)=>{if(o){A("device_browser_opened",{stelle:"tool"});return}A("device_browser_failed",{reason:s??"unknown",stelle:"tool"}),process.stderr.write(`
|
|
26
26
|
cachly: could not open a browser (${s??"unknown"}).
|
|
27
27
|
cachly: open this yourself to finish signing in:
|
|
28
28
|
cachly: ${t.verifyUrl}
|
|
@@ -31,7 +31,7 @@ cachly: code ${t.userCode}
|
|
|
31
31
|
`)}),co(t),["\u{1F9E0} **cachly AI Brain \u2014 the user must sign in once.**","","**Show the following link and code to the user verbatim \u2014 they cannot","continue without them.**","",`\u{1F449} **${t.verifyUrl}**`,"",`Code: **${t.userCode}**`,"","A browser may have opened automatically with the code pre-filled. If it","did not, the link above is the whole step.","","Once signed in, the Brain activates on its own \u2014 no further action, no","restart. The next request arrives brain-powered.","",`\u2728 ${ue.length} MCP tools \xB7 GDPR \xB7 EU servers \xB7 free tier, no credit card`].join(`
|
|
32
32
|
`)):["\u{1F9E0} **cachly AI Brain \u2014 Setup required**","","Run the setup wizard once in your terminal:"," ```"," npx @cachly-dev/mcp-server@latest autopilot"," ```","",`Or get your API key at: ${N("/setup-ai","ambient-signin")}`,"","\u2728 Free tier includes: 1 Brain instance, persistent memory, semantic search."].join(`
|
|
33
33
|
`)}async function ts(e){if(!e)return!0;if(vn(e))return!1;try{return await wn(await P(e),"sitzungsstart")}catch{return!0}}async function U(e,t){if(!v&&await Se(Qt))return U(e,t);if(!v){if(Kn(e),q){const r=await Ze(q);return r==="done"?U(e,t):r==="expired"?(A("device_flow_failed",{reason:"timeout"}),q=null,"\u231B **Authentication timed out.** Please call any tool again to restart the sign-in flow."):["\u23F3 **Signing you in\u2026**","",`Finish in your browser: **${q.verifyUrl}**`,`Code: **${q.userCode}**`,"","This completes automatically once you sign in \u2014 no need to come back here."].join(`
|
|
34
|
-
`)}return gn({schluessel:v,konfigurierteInstanz:H,aufrufInstanz:t.instance_id,werkzeugName:e,holeSofortTest:async()=>{W("sofort-test: Anfang");const r=await pn({apiUrl:x,version:D,fristMs:Xt}),d=r.art==="angelegt"?r.test:r.art==="vorhanden"&&r.instanzId?{apiKey:r.apiKey,instanzId:r.instanzId}:null;return W(`sofort-test: ${d?"Brain angelegt":"kein Test"}`),d&&Ne(d.instanzId,se(),Ae()),d},ablagen:{setzeSchluessel:r=>{v=r},setEmbedJwt:ae,saveApiKey:r=>
|
|
34
|
+
`)}return gn({schluessel:v,konfigurierteInstanz:H,aufrufInstanz:t.instance_id,werkzeugName:e,holeSofortTest:async()=>{W("sofort-test: Anfang");const r=await pn({apiUrl:x,version:D,fristMs:Xt}),d=r.art==="angelegt"?r.test:r.art==="vorhanden"&&r.instanzId?{apiKey:r.apiKey,instanzId:r.instanzId}:null;return W(`sofort-test: ${d?"Brain angelegt":"kein Test"}`),d&&Ne(d.instanzId,se(),Ae()),d},ablagen:{setzeSchluessel:r=>{v=r},setEmbedJwt:ae,saveApiKey:r=>Z(r),persistApiKeyToConfig:le,merkeInstanz:r=>{H=r,V=0},persistInstanceIdToConfig:de},meldeEreignis:A,werkzeug:()=>U(e,t),anmelden:()=>es(e),neuesBrain:Ce})}if(!t.instance_id){const r=await Ve();r&&(t={...t,instance_id:r})}const o=await Zn(e,t.instance_id);let s="";if(o!==null){if("sperre"in o)return A("premium_gate_hit",{tool:e,instance_id:t.instance_id??""}),o.sperre;s=o.kostprobe,A("premium_taste_used",{tool:e,instance_id:t.instance_id??""})}typeof t.instance_id=="string"&&t.instance_id&&Qn(t.instance_id,e),W(`werkzeug ${e}: Zugang und Tarif geklaert`);const n=await To(e,t,P,O);if(W(`werkzeug ${e}: Brain-Werkzeug fertig`),n!==null){typeof t.instance_id=="string"&&t.instance_id&&Xn(t.instance_id,e,String(n??"")),!be&&v&&(be=!0,pt("first_call_success")||(mt("first_call_success"),A("first_call_success",{tool:e,instance_id:t.instance_id??H??""})));const r=t.instance_id??H??"",d=v?{api_key:v,instance_id:r}:{instance_id:r};if(e==="recall_best_solution")A("recall_best_solution",d);else if(e==="learn_from_attempts")A("learn_from_attempts",d);else if(e==="session_start"){A("session_start",d,{born_at:void 0,recalls_total:void 0,starter_seeded:!1});const h=typeof n=="object"&&n!==null&&"content"in n?JSON.stringify(n):String(n??""),T=h.includes("Welcome! Your AI Brain is live.");if(!yn(r)){if(!T&&h.length>100)A("recall_best_solution",d);else if(T&&t.workspace_path&&await ts(r))try{const I=await Ie("brain_from_git",{instance_id:r,repo_path:t.workspace_path,limit:50},P,O);if(I!==null){A("brain_from_git",{...d,...ye??{}}),A("recall_best_solution",d);let k="";if((ye?.total??0)===0)try{const j=await Le("brain_seed_starter",{instance_id:r},P,O);j&&(A("brain_seed_starter",{...d,auto:!0},{seeded_count:16,auto:!0}),k=`
|
|
35
35
|
---
|
|
36
36
|
`+String(j))}catch{}const E=String(I),$=ye?.total??0,C=$>0?`
|
|
37
37
|
\u2705 **Brain bootstrapped from git \u2014 ${$} lesson${$===1?"":"s"} loaded.** Your AI already knows your history.`:"";if(E||k||C)return String(n)+C+`
|
|
@@ -48,7 +48,7 @@ ${n}`}return n}const c=await Io(e,t,P,O);if(c!==null)return!be&&v&&(be=!0,pt("fi
|
|
|
48
48
|
|
|
49
49
|
\u{1F9E0} **Brain Instances:** none \u2014 create one at ${N("/instances","api-status")}`;else{const k=[`
|
|
50
50
|
|
|
51
|
-
\u{1F9E0} **Brain Instances:**`];for(const E of S){const $=E.status==="running"?"\u{1F7E2}":E.status==="provisioning"?"\u{1F7E1}":"\u{1F534}",C=E.id===H?" \u2190 active":"";if(k.push(` ${$} **${E.name}** (\`${E.id}\`) \xB7 ${E.status}${C}`),E.status==="running"&&E.host){const j=
|
|
51
|
+
\u{1F9E0} **Brain Instances:**`];for(const E of S){const $=E.status==="running"?"\u{1F7E2}":E.status==="provisioning"?"\u{1F7E1}":"\u{1F534}",C=E.id===H?" \u2190 active":"";if(k.push(` ${$} **${E.name}** (\`${E.id}\`) \xB7 ${E.status}${C}`),E.status==="running"&&E.host){const j=te.get(E.id);if(j)try{await j.ping(),k.push(" \u{1F493} Redis: connected")}catch{k.push(" \u26A0\uFE0F Redis: pooled but ping failed \u2014 will reconnect on next use")}else k.push(" \u{1F4A4} Redis: not connected yet (connects on first tool use)")}else E.status==="provisioning"?k.push(" \u23F3 Still provisioning \u2014 check back in ~30 s"):E.status!=="running"&&k.push(` \u274C Not reachable (status: ${E.status})`)}h=k.join(`
|
|
52
52
|
`)}}catch(I){h=`
|
|
53
53
|
|
|
54
54
|
\u{1F9E0} **Brain Instances:** could not fetch \u2014 ${I.message}`}await Te();const T=_e(v),B=T.state==="long_lived"?"\u{1F6E1}\uFE0F Self-healing: \u2705 long-lived API key (won't expire silently)":T.state==="healthy"?`\u{1F6E1}\uFE0F Self-healing: \u2705 token valid${T.expiresInMs?` (${Math.round(T.expiresInMs/36e5)}h left)`:""}`:T.state==="near_expiry"?"\u{1F6E1}\uFE0F Self-healing: \u267B\uFE0F token near expiry \u2014 auto-refresh attempted":`\u{1F6E1}\uFE0F Self-healing: \u26A0\uFE0F ${T.message.split(`
|
|
@@ -60,9 +60,9 @@ ${n}`}return n}const c=await Io(e,t,P,O);if(c!==null)return!be&&v&&(be=!0,pt("fi
|
|
|
60
60
|
- AFTER a fix, deploy, or discovery: call learn_from_attempts so the knowledge persists.
|
|
61
61
|
- BEFORE a risky op (deploy, migration, dependency bump): call brain_predict.
|
|
62
62
|
|
|
63
|
-
The Brain instance id comes from the CACHLY_BRAIN_INSTANCE_ID environment variable.`,wt={tools:{},resources:{},prompts:{}},xt=async()=>{const{katalog:e,unbekannteKernnamen:t}=En(ue);return t.length>0&&console.error(`cachly: ${t.length} Kernwerkzeug(e) gibt es gar nicht: ${t.join(", ")}`),{tools:e}};async function _t(){return{resources:[]}}async function $t(){return{resourceTemplates:[]}}async function Ct(){return{prompts:[]}}function os(e){e.setRequestHandler(Ke,xt),e.setRequestHandler(Ue,kt),e.setRequestHandler(ze,_t),e.setRequestHandler(Fe,$t),e.setRequestHandler(We,Ct)}function ns(){const e=new Ye({name:"cachly-mcp",version:D},{capabilities:wt,instructions:vt});return os(e),At(e),e}function At(e){const t=e.oninitialized;e.oninitialized=()=>{try{const o=e.getClientVersion();Bt(o?.name,o?.version)}catch{}t?.()}}const G=new Ye({name:"cachly-mcp",version:D},{capabilities:wt,instructions:vt});At(G),G.setRequestHandler(Ke,xt),G.setRequestHandler(ze,_t),G.setRequestHandler(Fe,$t),G.setRequestHandler(We,Ct);let Be=null,pe=!1,
|
|
63
|
+
The Brain instance id comes from the CACHLY_BRAIN_INSTANCE_ID environment variable.`,wt={tools:{},resources:{},prompts:{}},xt=async()=>{const{katalog:e,unbekannteKernnamen:t}=En(ue);return t.length>0&&console.error(`cachly: ${t.length} Kernwerkzeug(e) gibt es gar nicht: ${t.join(", ")}`),{tools:e}};async function _t(){return{resources:[]}}async function $t(){return{resourceTemplates:[]}}async function Ct(){return{prompts:[]}}function os(e){e.setRequestHandler(Ke,xt),e.setRequestHandler(Ue,kt),e.setRequestHandler(ze,_t),e.setRequestHandler(Fe,$t),e.setRequestHandler(We,Ct)}function ns(){const e=new Ye({name:"cachly-mcp",version:D},{capabilities:wt,instructions:vt});return os(e),At(e),e}function At(e){const t=e.oninitialized;e.oninitialized=()=>{try{const o=e.getClientVersion();Bt(o?.name,o?.version)}catch{}t?.()}}const G=new Ye({name:"cachly-mcp",version:D},{capabilities:wt,instructions:vt});At(G),G.setRequestHandler(Ke,xt),G.setRequestHandler(ze,_t),G.setRequestHandler(Fe,$t),G.setRequestHandler(We,Ct);let Be=null,pe=!1,Q=null,St=0;async function ss(e){if(!pe){if(Q){await Q;return}Q=(async()=>{pe=!0,Be=e;try{await U("session_start",{instance_id:e,focus:"auto (MCP session)",workspace_path:process.cwd()})}catch{}finally{Q=null}})(),await Q,process.env.CACHLY_AUTO_INDEX!=="false"&&(async()=>{const t=await P(e),o=await t.get(`cachly:index:last_indexed:${e}`),s=1440*60*1e3;(!o||Date.now()-parseInt(o,10)>s)&&(await t.set(`cachly:index:last_indexed:${e}`,String(Date.now()),"EX",9e4),await U("index_project",{instance_id:e,dir:process.cwd(),max_files:150,ttl:86400*7,namespace:"cachly:sem:code",hintergrund:!0}))})().catch(()=>{})}}async function je(){if(!(!pe||!Be)){pe=!1;try{await U("session_end",{instance_id:Be,summary:`Auto-ended after ${St} tool call(s). Session was started automatically.`,files_changed:[],lessons_learned:0})}catch{}}}const kt=async e=>{let{name:t,arguments:o}=e.params;if(t===ut){const n=o??{},c=typeof n.tool=="string"?n.tool:"";if(!c)return{content:[{type:"text",text:'cachly_tool braucht das Feld "tool" \u2014 den Namen des Werkzeugs.'}],isError:!0};const i=ue.find(a=>a.name===c);if(!i)return{content:[{type:"text",text:`Kein Werkzeug namens "${c}". Die Liste steht in der Beschreibung von ${ut}.`}],isError:!0};if(n.describe===!0)return{content:[{type:"text",text:JSON.stringify({name:i.name,description:i.description,inputSchema:i.inputSchema},null,2)}]};t=c,o=n.arguments??{}}const s=new Set(["session_start","session_start_summary","session_end","auto_learn_session"]);if(!s.has(t)&&!pe&&!Q){const n=Re(o?.instance_id)||H||Re(process.env.CACHLY_BRAIN_INSTANCE_ID);n&&await ss(n).catch(()=>{})}else Q&&await Q.catch(()=>{});s.has(t)||St++;try{Tn(),W(`werkzeug ${t}: Anfang`);const n=await U(t,o??{});return W(`werkzeug ${t}: Antwort fertig`),{content:[{type:"text",text:Go(t,n)+xn()+Sn(t)}]}}catch(n){if(n instanceof bt)return{content:[{type:"text",text:n.message}],isError:!0};if(n instanceof ee)throw n;const c=n.message??String(n);throw De("cachly","tool_error",{tool:t,error:c}).catch(()=>{}),new ee(ne.InternalError,c)}};G.setRequestHandler(Ue,kt),process.on("SIGTERM",async()=>{await je().catch(()=>{});for(const[,e]of te)await e.quit().catch(()=>{});process.exit(0)}),process.on("SIGINT",async()=>{await je().catch(()=>{});for(const[,e]of te)await e.quit().catch(()=>{});process.exit(0)}),process.on("unhandledRejection",e=>{const t=e instanceof Error?e.message:String(e);process.stderr.write(`[cachly-mcp] unhandledRejection: ${t}
|
|
64
64
|
`)}),process.on("uncaughtException",e=>{process.stderr.write(`[cachly-mcp] uncaughtException: ${e?.stack??String(e)}
|
|
65
|
-
`)}),process.stdout.on("error",()=>{}),process.stdin.on("error",()=>{});const ve={claude:".mcp.json",cursor:".cursor/mcp.json",windsurf:".windsurf/mcp.json",copilot:".vscode/mcp.json",continue:".continue/config.json",cline:".vscode/mcp.json",zed:".zed/settings.json"};function rs(e,t){const o=Object.entries(t).map(([s,n])=>`${s}=${n}`);return e==="codex"?{befehl:`codex mcp add cachly ${o.map(s=>`--env ${s}`).join(" ")} -- npx -y @cachly-dev/mcp-server@latest`,wo:"~/.codex/config.toml"}:e==="gemini"?{befehl:`gemini mcp add -s project ${o.map(s=>`-e ${s}`).join(" ")} cachly npx -- -y @cachly-dev/mcp-server@latest`,wo:".gemini/settings.json"}:null}const He="<!-- cachly-brain-start -->",Tt="<!-- cachly-brain-end -->",It="https://api.cachly.dev";function oe(e,t,o={}){const s={CACHLY_BRAIN_INSTANCE_ID:t};return o.includeApiKey&&(s.CACHLY_JWT=e),x&&x!==It&&(s.CACHLY_API_URL=x),s}function is(e,t,o){return o==="continue"?JSON.stringify({experimental:{modelContextProtocolServers:[{transport:{type:"stdio",command:"npx",args:["-y","@cachly-dev/mcp-server@latest"]},env:oe(e,t)}]}},null,2):o==="zed"?JSON.stringify({context_servers:{cachly:{command:{path:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)},settings:{}}}},null,2):Et(o)?JSON.stringify({servers:{cachly:{type:"stdio",command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)}}},null,2):JSON.stringify({mcpServers:{cachly:{command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)}}},null,2)}function Et(e){return ve[e]===".vscode/mcp.json"}function me(e,t){en(e)||
|
|
65
|
+
`)}),process.stdout.on("error",()=>{}),process.stdin.on("error",()=>{});const ve={claude:".mcp.json",cursor:".cursor/mcp.json",windsurf:".windsurf/mcp.json",copilot:".vscode/mcp.json",continue:".continue/config.json",cline:".vscode/mcp.json",zed:".zed/settings.json"};function rs(e,t){const o=Object.entries(t).map(([s,n])=>`${s}=${n}`);return e==="codex"?{befehl:`codex mcp add cachly ${o.map(s=>`--env ${s}`).join(" ")} -- npx -y @cachly-dev/mcp-server@latest`,wo:"~/.codex/config.toml"}:e==="gemini"?{befehl:`gemini mcp add -s project ${o.map(s=>`-e ${s}`).join(" ")} cachly npx -- -y @cachly-dev/mcp-server@latest`,wo:".gemini/settings.json"}:null}const He="<!-- cachly-brain-start -->",Tt="<!-- cachly-brain-end -->",It="https://api.cachly.dev";function oe(e,t,o={}){const s={CACHLY_BRAIN_INSTANCE_ID:t};return o.includeApiKey&&(s.CACHLY_JWT=e),x&&x!==It&&(s.CACHLY_API_URL=x),s}function is(e,t,o){return o==="continue"?JSON.stringify({experimental:{modelContextProtocolServers:[{transport:{type:"stdio",command:"npx",args:["-y","@cachly-dev/mcp-server@latest"]},env:oe(e,t)}]}},null,2):o==="zed"?JSON.stringify({context_servers:{cachly:{command:{path:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)},settings:{}}}},null,2):Et(o)?JSON.stringify({servers:{cachly:{type:"stdio",command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)}}},null,2):JSON.stringify({mcpServers:{cachly:{command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(e,t)}}},null,2)}function Et(e){return ve[e]===".vscode/mcp.json"}function me(e,t){en(e)||Z(e,t)}async function Rt(e,t,o,s,n,c={}){const i={command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(t,o)};if(!n.existsSync(e))return is(t,o,s);let a={};try{a=JSON.parse(await n.readFile(e,"utf-8"))}catch{try{const{rename:m}=await import("node:fs/promises");await m(e,e+".bak"),process.stderr.write(`\u26A0\uFE0F ${e} was not valid JSON \u2014 backed up to ${e}.bak
|
|
66
66
|
`)}catch{}}if(s==="continue"){const m=a.experimental??{},y=m.modelContextProtocolServers??[];let w;for(const p of y){const r=p.env??{};if(r.CACHLY_JWT){w=r.CACHLY_JWT;break}}w&&me(w,c);const b=y.filter(p=>{const r=p.env??{};return!r.CACHLY_JWT&&!r.CACHLY_BRAIN_INSTANCE_ID});return b.push({transport:{type:"stdio",command:"npx",args:["-y","@cachly-dev/mcp-server@latest"]},env:i.env}),a.experimental={...m,modelContextProtocolServers:b},JSON.stringify(a,null,2)}if(s==="zed"){const m=a.context_servers??{},w=m.cachly?.command?.env?.CACHLY_JWT;return w&&me(w,c),m.cachly={command:{path:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:i.env},settings:{}},a.context_servers=m,JSON.stringify(a,null,2)}if(Et(s)){const m=a.mcpServers??void 0,w=m?.cachly?.env?.CACHLY_JWT;w&&me(w,c),m&&"cachly"in m&&(delete m.cachly,Object.keys(m).length===0&&delete a.mcpServers);const b=a.servers??{},p=b.cachly,r=p?.env?.CACHLY_JWT;return r&&me(r,c),b.cachly=p?.envFile?{type:"stdio",...i,envFile:p.envFile}:{type:"stdio",...i},a.servers=b,JSON.stringify(a,null,2)}const u=a.mcpServers??{},l=u.cachly?.env?.CACHLY_JWT;return l&&me(l,c),u.cachly=i,a.mcpServers=u,JSON.stringify(a,null,2)}function Nt(e){return`${He}
|
|
67
67
|
## Cachly AI Brain \u2014 Always Active
|
|
68
68
|
|
|
@@ -177,7 +177,7 @@ Try it free: ${s}
|
|
|
177
177
|
`),process.exit(1)),console.log(` \u2705 Signed in!
|
|
178
178
|
`)}}catch(S){console.log(`
|
|
179
179
|
\u26A0\uFE0F Could not start sign-in: ${S.message}`),console.log(` Set CACHLY_JWT manually from ${N("/setup-ai","join")}
|
|
180
|
-
`),process.exit(1)}}const h=process.cwd(),T=i(),B=[{label:".mcp.json (Claude Code project)",path:n(h,".mcp.json")},{label:".cursor/mcp.json",path:n(h,".cursor","mcp.json")},{label:".windsurf/mcp.json",path:n(h,".windsurf","mcp.json")},{label:".vscode/mcp.json (Copilot/Cline)",path:n(h,".vscode","mcp.json")},{label:"~/.claude/mcp.json (global)",path:n(T,".claude","mcp.json"),global:!0}];let I=0;for(const{label:S,path:k,global:E}of B){const $=c(k);if(!(!E&&!s($)&&!s(k)))try{await o($,{recursive:!0});let C={};if(s(k))try{C=JSON.parse(await t(k,"utf-8"))}catch{try{await(await import("node:fs/promises")).rename(k,k+".bak")}catch{}}const j=C.mcpServers??{},F=j.cachly??{},z=F.env??{};z.CACHLY_BRAIN_INSTANCE_ID=l,d&&!z.CACHLY_JWT&&(z.CACHLY_JWT=d),x!==It&&(z.CACHLY_API_URL=x),j.cachly={...F,command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:z},C.mcpServers=j,await e(k,JSON.stringify(C,null,2),"utf-8"),console.log(` \u2705 ${S}`),I++}catch(C){C.code!=="ENOENT"&&console.log(` \u26A0\uFE0F ${S}: ${C.message}`)}}console.log(""),I===0?console.log(" \u26A0\uFE0F No editor configs found \u2014 run `cachly setup` first.\n"):(console.log(` \u{1F9E0} You're now sharing Brain: \x1B[1m${m}\x1B[0m`),console.log(` Restart your editor \u2014 your AI arrives pre-briefed from the team Brain.
|
|
180
|
+
`),process.exit(1)}}d&&d!==v&&Z(d);const h=process.cwd(),T=i(),B=[{label:".mcp.json (Claude Code project)",path:n(h,".mcp.json")},{label:".cursor/mcp.json",path:n(h,".cursor","mcp.json")},{label:".windsurf/mcp.json",path:n(h,".windsurf","mcp.json")},{label:".vscode/mcp.json (Copilot/Cline)",path:n(h,".vscode","mcp.json")},{label:"~/.claude/mcp.json (global)",path:n(T,".claude","mcp.json"),global:!0}];let I=0;for(const{label:S,path:k,global:E}of B){const $=c(k);if(!(!E&&!s($)&&!s(k)))try{await o($,{recursive:!0});let C={};if(s(k))try{C=JSON.parse(await t(k,"utf-8"))}catch{try{await(await import("node:fs/promises")).rename(k,k+".bak")}catch{}}const j=C.mcpServers??{},F=j.cachly??{},z=F.env??{};z.CACHLY_BRAIN_INSTANCE_ID=l,d&&E&&!z.CACHLY_JWT&&(z.CACHLY_JWT=d),x!==It&&(z.CACHLY_API_URL=x),j.cachly={...F,command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:z},C.mcpServers=j,await e(k,JSON.stringify(C,null,2),"utf-8"),console.log(` \u2705 ${S}`),I++}catch(C){C.code!=="ENOENT"&&console.log(` \u26A0\uFE0F ${S}: ${C.message}`)}}console.log(""),I===0?console.log(" \u26A0\uFE0F No editor configs found \u2014 run `cachly setup` first.\n"):(console.log(` \u{1F9E0} You're now sharing Brain: \x1B[1m${m}\x1B[0m`),console.log(` Restart your editor \u2014 your AI arrives pre-briefed from the team Brain.
|
|
181
181
|
`),console.log(" \u{1F4DB} Add the badge to your README:"),console.log(` npx @cachly-dev/mcp-server@latest badge
|
|
182
182
|
`)),process.exit(0)}if(process.argv[2]==="upgrade"){process.stdout.write(`
|
|
183
183
|
\u23F3 Checking for updates...
|
|
@@ -226,10 +226,10 @@ ${l}
|
|
|
226
226
|
Usage: npx @cachly-dev/mcp-server@latest init --instance-id <uuid> --api-key <cky_live_...> [--editor claude|cursor|windsurf|copilot|continue|codex|gemini] [--project-dir /path] [--api-url https://your-self-hosted-backend]
|
|
227
227
|
`),console.error(`First time? Run the zero-config wizard (signs you in, auto-provisions): npx @cachly-dev/mcp-server@latest autopilot
|
|
228
228
|
`),console.error(`Get your credentials from: ${N("/setup-ai","init")}
|
|
229
|
-
`),process.exit(1));const w=rs(l,oe(g,u));if(w)
|
|
230
|
-
\u{1F449} Register the MCP server once (writes ${w.wo}):`),console.log(` ${w.befehl}`);else{const r=ve[l]??".mcp.json",d=n(m,r);await o(c(d),{recursive:!0});const{existsSync:h}=await import("node:fs"),T=h(d),B=T?await s(d,"utf-8").catch(()=>""):"";
|
|
229
|
+
`),process.exit(1));const w=rs(l,oe(g,u));if(w)Z(g),console.log(`
|
|
230
|
+
\u{1F449} Register the MCP server once (writes ${w.wo}):`),console.log(` ${w.befehl}`);else{const r=ve[l]??".mcp.json",d=n(m,r);await o(c(d),{recursive:!0});const{existsSync:h}=await import("node:fs"),T=h(d),B=T?await s(d,"utf-8").catch(()=>""):"";Z(g);const I=await Rt(d,g,u,l,{readFile:s,existsSync:h});I!==B?(await t(d,I,"utf-8"),console.log(`
|
|
231
231
|
\u2705 ${T?"Updated":"Written"}: ${r}`)):console.log(`
|
|
232
|
-
\u2713 Already configured: ${r} (no change)`)}const b=await Lt(m,u);for(const[r,d]of Object.entries(b)){const h=d==="updated"?"\u2705 Updated":d==="appended"?"\u2705 Appended to":"\u2705 Written",T=r.split(/[\\/]/).pop()??r;console.log(`${h}: ${T}`)}try{const r=await et(m,u
|
|
232
|
+
\u2713 Already configured: ${r} (no change)`)}const b=await Lt(m,u);for(const[r,d]of Object.entries(b)){const h=d==="updated"?"\u2705 Updated":d==="appended"?"\u2705 Appended to":"\u2705 Written",T=r.split(/[\\/]/).pop()??r;console.log(`${h}: ${T}`)}try{const r=await et(m,u);r==="written"?console.log("\u2705 Written: .git/hooks/post-commit (CLS hook)"):r==="upgraded"?console.log(`\u2705 Upgraded: .git/hooks/post-commit (CLS hook \u2192 ${tt})`):r==="appended"?console.log("\u2705 Appended: .git/hooks/post-commit (CLS hook)"):r==="unchanged"&&console.log("\u2713 CLS hook already current in .git/hooks/post-commit")}catch{}if(l==="claude")try{const r=await nt(m,u),d=r.scripts==="written"?"\u2705 Written":r.scripts==="upgraded"?`\u2705 Upgraded (\u2192 ${st})`:"\u2713 Unchanged";console.log(`${d}: .claude/hooks/ (Ambient Recall \u2014 session briefing, per-prompt recall, file briefing, auto-learn)`),r.settings==="written"?console.log("\u2705 Written: .claude/settings.json (Ambient Recall hooks wired)"):r.settings==="merged"?console.log("\u2705 Merged: .claude/settings.json (Ambient Recall hooks wired)"):console.log("\u2713 Ambient Recall hooks already wired in .claude/settings.json")}catch{}(l==="cursor"||l==="copilot"||l==="codex"||l==="gemini")&&await ge(l,m,u,"");const p=((Date.now()-e)/1e3).toFixed(1);console.log(`
|
|
233
233
|
\u{1F9E0} Cachly AI Brain configured for ${l==="claude"?"Claude Code":l}! (${p}s)`),console.log(w?` Run the \`mcp add\` line above, then restart ${l} \u2014 the \`cachly\` MCP tools will appear.`:" Restart your editor \u2014 the `cachly` MCP tools will appear."),console.log(" Re-run `init` anytime \u2014 it's idempotent (only writes what changed)."),console.log(`
|
|
234
234
|
\u{1F4DB} Add a live badge to your README:`),console.log(` npx @cachly-dev/mcp-server@latest badge
|
|
235
235
|
`),process.exit(0)}if(process.argv[2]==="status"){const e=process.env.CACHLY_JWT??"",t=process.env.CACHLY_BRAIN_INSTANCE_ID??"";(!e||!t)&&(console.log(`
|
|
@@ -264,7 +264,7 @@ ${r.message}. Nothing was changed.
|
|
|
264
264
|
`)}catch(r){console.error(`
|
|
265
265
|
|
|
266
266
|
${cn(r)}
|
|
267
|
-
`),process.exit(1)}v=m.apiKey,
|
|
267
|
+
`),process.exit(1)}v=m.apiKey,Z(m.apiKey),at(m.instanceId,{apiKey:m.apiKey}),await le(m.apiKey),await de(m.instanceId);const y=n(),w=new Set([...Object.values(ve).map(r=>s(process.cwd(),r)),s(y,".claude.json"),s(y,".claude","mcp.json"),s(y,".cursor","mcp.json"),s(y,".codeium","windsurf","mcp_config.json")]);let b=0;for(const r of w)if(o(r))try{const d=ln(await e(r,"utf-8"),u,m.apiKey);d.ersetzt&&(await t(r,d.text,"utf-8"),b++)}catch{}const p=await rn(fetch,x,m.apiKey,m.instanceId);console.log(an(m,p)),console.log(`
|
|
268
268
|
New key stored in ~/.cachly/credentials.json${b?` and in ${b} editor config file(s) that held the test key`:""}.`),console.log(`Restart your editor (or reload its MCP servers) so it uses the new key.
|
|
269
269
|
`),process.exit(0)}const we=process.argv[2]==="autopilot";if(process.argv[2]==="autosetup"||process.argv[2]==="setup"||we){const{writeFile:e,mkdir:t,readFile:o}=await import("node:fs/promises"),{existsSync:s}=await import("node:fs"),{resolve:n,dirname:c}=await import("node:path"),{createInterface:i}=await import("node:readline"),a=Date.now(),u=we?"autopilot":"setup",g=process.argv.indexOf("--api-url");g!==-1&&process.argv[g+1]&&(x=process.argv[g+1].replace(/\/+$/,""),console.log(`\u2139\uFE0F Using self-hosted backend: ${x}
|
|
270
270
|
`)),A("setup_started");const l=process.stdin.isTTY===!0,m=we||process.argv.includes("--yes")||process.argv.includes("-y")||!l;we?console.log(`\u{1F916} Autopilot \u2014 one-command setup (auth \u2192 instance \u2192 configs \u2192 Brain), zero prompts.
|
|
@@ -273,9 +273,9 @@ New key stored in ~/.cachly/credentials.json${b?` and in ${b} editor config file
|
|
|
273
273
|
\u{1F9E0} cachly AI Brain \u2014 Setup`),console.log(`\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
274
274
|
`);let b=process.env.CACHLY_JWT??"";if(b)console.log(`\u2713 Using token from CACHLY_JWT env var
|
|
275
275
|
`);else{console.log(`Step 1: Sign in to cachly (free, no credit card)
|
|
276
|
-
`),A("setup_auth_started");let f="",_="",R="",J=5e3,Y=!1,
|
|
276
|
+
`),A("setup_auth_started");let f="",_="",R="",J=5e3,Y=!1,X="cachly";try{const K=await fetch(`${x}/auth/device`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({}),signal:AbortSignal.timeout(8e3)});if(K.ok){const L=await K.json();f=L.device_code,_=L.user_code;const M=L.verification_uri||N("/device",u);R=`${M}${M.includes("?")?"&":"?"}code=${encodeURIComponent(_)}`,J=(L.interval??5)*1e3,Y=!!f}}catch{}if(!Y)try{const L=await fetch("https://auth.cachly.dev/realms/cachly/protocol/openid-connect/auth/device",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"client_id=cachly-cli&scope=openid",signal:AbortSignal.timeout(8e3)});if(L.ok){const M=await L.json();f=M.device_code,_=M.user_code,R=M.verification_uri_complete,J=(M.interval??5)*1e3,Y=!0,X="keycloak"}}catch{}if(Y&&f){console.log(` Code: \x1B[1;33m${_}\x1B[0m`),console.log(" Open this URL and confirm the code:"),console.log(`${R}
|
|
277
277
|
`),ie(R,(L,M)=>{if(L){A("device_browser_opened",{stelle:"setup"});return}A("device_browser_failed",{reason:M??"unknown",stelle:"setup"}),console.log(` \u2139\uFE0F No browser could be opened here (${M??"unknown"}) \u2014 please open the URL yourself.
|
|
278
|
-
`)}),process.stdout.write(" Waiting for authorization");const K=Date.now()+600*1e3;for(;Date.now()<K;){await new Promise(L=>setTimeout(L,J)),process.stdout.write(".");try{let L=null;if(
|
|
278
|
+
`)}),process.stdout.write(" Waiting for authorization");const K=Date.now()+600*1e3;for(;Date.now()<K;){await new Promise(L=>setTimeout(L,J)),process.stdout.write(".");try{let L=null;if(X==="cachly")try{const M=await fetch(`${x}/auth/device/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:f}),signal:AbortSignal.timeout(8e3)});M.status<500&&(L=await M.json())}catch{}else{const M="https://auth.cachly.dev/realms/cachly/protocol/openid-connect";try{L=await(await fetch(`${M}/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`client_id=cachly-cli&grant_type=urn:ietf:params:oauth:grant-type:device_code&device_code=${f}`,signal:AbortSignal.timeout(8e3)})).json()}catch{}}if(L?.access_token){b=L.access_token,console.log(` \x1B[32m\u2713 Authorized!\x1B[0m
|
|
279
279
|
`),A("setup_auth_completed"),A("device_flow_completed");break}L?.error==="slow_down"?J=Math.min(J+2e3,15e3):L?.error&&L.error!=="authorization_pending"&&(A("device_flow_failed",{reason:L.error}),console.error(`
|
|
280
280
|
Auth error: ${L.error}. Aborting.
|
|
281
281
|
`),y.close(),process.exit(1))}catch{}}b||(A("device_flow_failed",{reason:"timeout"}),console.error(`
|
|
@@ -295,15 +295,15 @@ API key is required. Aborting.
|
|
|
295
295
|
Failed to fetch instances: ${_}`),_.includes("401")&&(console.error(`Token rejected. Get a valid token at ${N("/setup-ai",u)}
|
|
296
296
|
`),ie(N("/setup-ai",u))),y.close(),process.exit(1)}if(console.log(` found ${p.length}
|
|
297
297
|
`),p.length===0){process.stdout.write("\u23F3 Creating your free Brain instance...");try{const f=await fetch(`${x}/api/v1/instances/auto`,{method:"POST",headers:{Authorization:`Bearer ${b}`,"Content-Type":"application/json"}});if(!f.ok)throw new Error(`HTTP ${f.status}`);const _=await f.json();if(_.instance)p=[_.instance];else if(_.instance_id){const R=_.instance_id;console.log(` \u2713 created (${R.slice(0,8)}\u2026)
|
|
298
|
-
`),process.stdout.write("\u23F3 Waiting for instance to start");for(let J=0;J<45;J++){await new Promise(Y=>setTimeout(Y,3e3)),process.stdout.write(".");try{const Y=await fetch(`${x}/api/v1/instances/${R}`,{headers:{Authorization:`Bearer ${b}`}});if(Y.ok){const
|
|
298
|
+
`),process.stdout.write("\u23F3 Waiting for instance to start");for(let J=0;J<45;J++){await new Promise(Y=>setTimeout(Y,3e3)),process.stdout.write(".");try{const Y=await fetch(`${x}/api/v1/instances/${R}`,{headers:{Authorization:`Bearer ${b}`}});if(Y.ok){const X=await Y.json();if(X.status==="running"){p=[X];break}}}catch{}}console.log("")}}catch(f){console.log(` failed: ${f.message}
|
|
299
299
|
`)}p.length===0&&(console.error(`
|
|
300
300
|
Could not create an instance automatically. Opening ${N("/instances",u)} \u2026
|
|
301
301
|
`),ie(N("/instances",u)),y.close(),process.exit(1))}const r=p[0];p.length>1&&(console.log(`\u2139\uFE0F Multiple instances found \u2014 using most recent: ${r.name}`),console.log(` (Run with --instance-id <id> to use a different one)
|
|
302
302
|
`)),console.log(`\u2713 Instance: ${r.name} (${r.id.slice(0,8)}\u2026)
|
|
303
303
|
`),A("setup_instance_ready",{instance_id:r.id});const d=process.cwd(),h=[],{homedir:T}=await import("node:os"),B=T();h.push("claude"),s(n(d,".cursor"))&&h.push("cursor"),s(n(d,".windsurf"))&&h.push("windsurf"),s(n(d,".vscode"))&&h.push("copilot"),s(n(d,".continue"))&&h.push("continue");const I=process.platform==="darwin"?n(B,"Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev"):n(B,".vscode/extensions");(s(I)&&!h.includes("copilot")||s(I))&&h.push("cline");const S=process.platform==="darwin"?n(B,"Library/Application Support/Zed"):n(B,".config/zed");s(S)&&h.push("zed");const k=f=>({claude:"Claude Code",cursor:"Cursor",windsurf:"Windsurf",copilot:"GitHub Copilot",continue:"Continue.dev",cline:"Cline (VSCode)",zed:"Zed"})[f]??f,E=h;console.log(`Step 3: Configuring for: ${E.map(k).join(", ")}
|
|
304
|
-
`);const{existsSync:$}=await import("node:fs"),C=[];let j=0;
|
|
305
|
-
\u23F3 Fetching your Brain health preview...`);try{const f=await fetch(`${x}/api/v1/instances/${r.id}/memory`,{headers:{Authorization:`Bearer ${b}`},signal:AbortSignal.timeout(6e3)});if(f.ok){const _=await f.json(),R=_.lesson_count??0,J=_.context_count??0,Y=Math.round(_.iq_boost_pct??0),
|
|
306
|
-
`),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 \u{1F9E0} Brain Health Report \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 Lessons stored : ${String(R).padEnd(6)} \u2502 Level: ${
|
|
304
|
+
`);const{existsSync:$}=await import("node:fs"),C=[];let j=0;Z(b);for(const f of E){const _=ve[f]??".mcp.json",R=n(d,_);try{await t(c(R),{recursive:!0});const J=$(R),Y=await Rt(R,b,r.id,f,{readFile:o,existsSync:$});await e(R,Y,"utf-8"),console.log(`\u2705 ${J?"Updated":"Written"}: ${_}`),j++}catch(J){const Y=J.message;console.log(`\u26A0\uFE0F Could not write ${_}: ${Y}`),console.log(" Fix permissions or run with sudo, then re-run setup."),C.push({file:_,reason:Y})}}const F=n(B,".claude","mcp.json");try{await t(c(F),{recursive:!0});let f={};if(s(F))try{f=JSON.parse(await o(F,"utf-8"))}catch{}f.mcpServers??={},f.mcpServers.cachly={command:"npx",args:["-y","@cachly-dev/mcp-server@latest"],env:oe(b,r.id,{includeApiKey:!0})},await e(F,JSON.stringify(f,null,2),"utf-8"),console.log("\u2705 Written: ~/.claude/mcp.json (global \u2014 works in every project)"),j++}catch(f){const _=f.message;console.log(`\u26A0\uFE0F Could not write ~/.claude/mcp.json: ${_}`),C.push({file:"~/.claude/mcp.json",reason:_})}const z=await Lt(d,r.id);for(const[f,_]of Object.entries(z))console.log(`${_==="updated"?"\u2705 Updated":_==="appended"?"\u2705 Appended to":"\u2705 Written"}: ${f}`);v=b;let fe=0;if(s(n(d,".git"))){process.stdout.write("\u23F3 Bootstrapping Brain from git history (~10s)...");try{const f=await U("brain_from_git",{instance_id:r.id,repo_path:d,limit:100}),_=f.match(/Ingested: \*\*(\d+)\*\*/);fe=_?parseInt(_[1],10):0,console.log(` \u2713 ${fe} lesson${fe===1?"":"s"} extracted from git history`);const R=Ho(f);R&&(console.log(""),console.log(R))}catch(f){console.log(` (skipped: ${f.message.slice(0,80)})`)}}if(fe===0){process.stdout.write("\u{1F331} Seeding 16 universal engineering lessons (first recall works instantly)...");try{await U("brain_seed_starter",{instance_id:r.id}),console.log(" \u2713");try{const f=await U("smart_recall",{instance_id:r.id,query:"docker build slow"}),_=Wn(f);_&&(console.log(""),console.log(Oo(_.topic,_.what)))}catch{}}catch(f){console.log(` (skipped: ${f.message.slice(0,60)})`)}}process.stdout.write(`
|
|
305
|
+
\u23F3 Fetching your Brain health preview...`);try{const f=await fetch(`${x}/api/v1/instances/${r.id}/memory`,{headers:{Authorization:`Bearer ${b}`},signal:AbortSignal.timeout(6e3)});if(f.ok){const _=await f.json(),R=_.lesson_count??0,J=_.context_count??0,Y=Math.round(_.iq_boost_pct??0),X=R===0?"Intern \u{1F331}":R<10?"Junior Dev \u{1F527}":R<30?"Mid Dev \u26A1":R<60?"Senior Dev \u{1F9E0}":R<100?"Staff Eng \u{1F680}":"Principal Eng \u{1F3C6}";if(console.log(` \u2713
|
|
306
|
+
`),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 \u{1F9E0} Brain Health Report \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(`\u2502 Lessons stored : ${String(R).padEnd(6)} \u2502 Level: ${X.padEnd(20)}\u2502`),console.log(`\u2502 Context entries : ${String(J).padEnd(6)} \u2502 Quality score: ${String(Y).padEnd(3)}% \u2502`),R===0&&(console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log("\u2502 Your Brain is empty and ready to learn. \u2502"),console.log("\u2502 After your first coding session it will contain: \u2502"),console.log("\u2502 \u2022 Lessons from every bug you fixed \u2502"),console.log("\u2502 \u2022 Your project's indexed files \u2502"),console.log("\u2502 \u2022 A session summary for next time \u2502")),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),R>=5){process.stdout.write(`
|
|
307
307
|
\u23F3 Running predictive risk scan...`);try{const L=(await U("brain_predict",{instance_id:r.id,context:"starting a new development session"})).split(`
|
|
308
308
|
`).filter(M=>M.trim()).slice(0,6);if(L.length>0){console.log(` \u2713
|
|
309
309
|
`),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 \u{1F52E} Brain Risk Preview (brain_predict) \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(const M of L)console.log(`\u2502 ${M.slice(0,51).padEnd(51)} \u2502`);console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}else console.log(" (no risks found \u2014 clean slate!)")}catch{console.log(" (skipped)")}}}else console.log(" (skipped)")}catch{console.log(" (skipped)")}if(console.log(`
|
|
@@ -316,7 +316,7 @@ Could not create an instance automatically. Opening ${N("/instances",u)} \u2026
|
|
|
316
316
|
`),console.log(` team_assign_role(instance_id="${r.id}", handle="<teammate>", role="contributor", assigned_by="${_.trim()}")
|
|
317
317
|
`))}else console.log(` Skipped \u2014 run team_assign_role at any time.
|
|
318
318
|
`)}catch{}if(!m){const f=await w(" \u{1F4EC} Stay in the loop? Email for release notes [Enter to skip]: ");if(f&&f.includes("@"))try{await fetch(`${x}/api/newsletter/subscribe`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:f.trim().toLowerCase(),source:"mcp-setup"}),signal:AbortSignal.timeout(5e3)}),console.log(` \u2705 Subscribed \u2014 you'll only hear from us when it matters.
|
|
319
|
-
`)}catch{}}try{const f=await et(process.cwd(),r.id
|
|
319
|
+
`)}catch{}}try{const f=await et(process.cwd(),r.id);f==="written"?console.log(`
|
|
320
320
|
\u2705 CLS git hook installed \u2014 your brain will learn from every commit.`):f==="upgraded"?console.log(`
|
|
321
321
|
\u2705 CLS git hook upgraded to ${tt}.`):f==="appended"&&console.log(`
|
|
322
322
|
\u2705 CLS git hook appended to existing post-commit.`)}catch{}if(E.includes("claude"))try{const f=await nt(process.cwd(),r.id),_=f.scripts==="written"?"\u2705 Written":f.scripts==="upgraded"?`\u2705 Upgraded (\u2192 ${st})`:"\u2713 Unchanged";console.log(`${_}: .claude/hooks/ (Ambient Recall \u2014 session briefing, per-prompt recall, file briefing, auto-learn)`),f.settings==="written"?console.log("\u2705 Written: .claude/settings.json (Ambient Recall hooks wired)"):f.settings==="merged"?console.log("\u2705 Merged: .claude/settings.json (Ambient Recall hooks wired)"):console.log("\u2713 Ambient Recall hooks already wired in .claude/settings.json")}catch{}E.includes("cursor")&&await ge("cursor",process.cwd(),r.id," "),E.includes("copilot")&&await ge("copilot",process.cwd(),r.id," "),(s(n(B,".codex"))||s(n(d,".codex")))&&await ge("codex",process.cwd(),r.id," "),(s(n(B,".gemini"))||s(n(d,".gemini")))&&await ge("gemini",process.cwd(),r.id," "),v=b;const Oe=Math.round((Date.now()-a)/1e3);if(C.length>0&&A("setup_config_write_failed",{instance_id:r.id,failed:C.length,succeeded:j}),A("setup_completed",{instance_id:r.id,elapsed_s:Oe,config_failures:C.length}),C.length>0&&j===0){console.log(`
|
|
@@ -380,4 +380,4 @@ Could not create an instance automatically. Opening ${N("/instances",u)} \u2026
|
|
|
380
380
|
`)}}process.env.PORT||An({aktuelle:Cn(D)});const xe=process.env.PORT?parseInt(process.env.PORT,10):void 0;if(xe){const{createServer:e}=await import("node:http");e((o,s)=>{const n=new URL(o.url??"/",`http://localhost:${xe}`);if(n.pathname==="/health"){s.writeHead(200,{"Content-Type":"application/json"}),s.end(JSON.stringify({status:"ok",version:D,zeroResults:{total:Co,last10:$o.slice(-10).map(c=>({query:c.query,ts:new Date(c.ts).toISOString()}))}}));return}if(n.pathname==="/mcp"||n.pathname==="/"){(async()=>{const c=ns(),i=new Gt({sessionIdGenerator:void 0});s.on("close",()=>{i.close().catch(()=>{}),c.close().catch(()=>{})});try{await c.connect(i),await i.handleRequest(o,s)}catch(a){process.stderr.write(`cachly-mcp HTTP: ${a.message}
|
|
381
381
|
`),s.headersSent||(s.writeHead(500,{"Content-Type":"application/json"}),s.end(JSON.stringify({error:a.message})))}})();return}s.writeHead(404),s.end("not found")}).listen(xe,()=>{process.stderr.write(`cachly-mcp HTTP server listening on :${xe}
|
|
382
382
|
`)})}else{const e=new qt;W("start: Module geladen, stdio verbinden"),await G.connect(e),typeof process.argv[2]=="string"&&!process.argv[2].startsWith("-")||(Ge=!0,oo(),In(),kn(process.stdin,o=>{process.stderr.write(`[cachly-mcp] ${o} \u2014 Session zu Ende, Server geht mit
|
|
383
|
-
`),(async()=>{await je().catch(()=>{});for(const[,s]of
|
|
383
|
+
`),(async()=>{await je().catch(()=>{});for(const[,s]of te)await s.quit().catch(()=>{});process.exit(0)})()}))}De("cachly","startup",{version:D,mode:process.env.MCP_HTTP_PORT?"http":"stdio"}).catch(()=>{});export{Tt as CLAUDE_MD_MARKER_END,He as CLAUDE_MD_MARKER_START,_o as CROSS_LINGUAL_MAP,ve as EDITOR_FILES,bo as STOPWORDS,wo as arabicLightStem,Nt as buildClaudeMdBlock,is as buildMcpConfig,oe as buildServerEnv,xo as expandCrossLingual,yo as extractTimestamp,vo as katakanaToRomaji,fo as levenshtein,rs as mcpAddBefehl,Rt as mergeMcpConfig,ho as recencyBoost,Ao as reconnectOnce,go as splitMultiQuery,co as startBackgroundDevicePoll,mo as tokenize,Lt as writeInstructions};
|
package/glama.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cachly-dev/mcp-server",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.193",
|
|
4
4
|
"mcpName": "io.github.cachly-dev/mcp-server",
|
|
5
5
|
"description": "Solve it once. From then on, your AI knows. Experience for coding agents, EU-hosted: an MCP server for Claude Code, Cursor, Copilot & Windsurf. Learns from every bug fix, commit and CI run.",
|
|
6
6
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"url": "https://github.com/cachly-dev/cachly-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.10.
|
|
9
|
+
"version": "0.10.193",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"name": "@cachly-dev/mcp-server",
|
|
14
14
|
"identifier": "@cachly-dev/mcp-server",
|
|
15
|
-
"version": "0.10.
|
|
15
|
+
"version": "0.10.193",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|