opencode-haimati 1.0.8 → 1.0.9
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/index.js +79 -74
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,88 +1,93 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
`);for(let e of
|
|
5
|
-
`)
|
|
6
|
-
`)
|
|
7
|
-
`);
|
|
8
|
-
`)
|
|
9
|
-
`)[1]||"",c=s.substring(e+q.length),d=parseInt(c.trim(),10)||1,h=s.substring(0,e).substring(o.length+1+a.length+1);return{title:o,createdAt:a,content:h,version:d}}async function R(t,i,n,s,e,o=1){let r=ut(t);await E(r)||await Tt(r,{recursive:!0});let a=C(t,i);await E(a)||await Tt(a,{recursive:!0});let c=K(t,i),d=`${n}
|
|
1
|
+
var Y=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Rt=Object.prototype.hasOwnProperty;var It=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,n)=>(typeof require<"u"?require:r)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Z=(t,r)=>()=>(t&&(r=t(t=0)),r);var Et=(t,r)=>{for(var n in r)Y(t,n,{get:r[n],enumerable:!0})},Gt=(t,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of Bt(r))!Rt.call(t,e)&&e!==n&&Y(t,e,{get:()=>r[e],enumerable:!(s=Wt(r,e))||s.enumerable});return t};var tt=t=>Gt(Y({},"__esModule",{value:!0}),t);var _t={};Et(_t,{AUTO_INJECT_CONTEXT:()=>lt,DEFAULT_VERSION:()=>G,HAIMATI_CONFIG_FILE:()=>at,HAIMATI_DIR:()=>et,HAIMATI_PATH_KEY:()=>ct,INDEX_FILE:()=>nt,LOCK_MAX_WAIT:()=>st,LOG_FILE:()=>ot,NEXT_ID_FILE:()=>it,PAGES_DIR:()=>rt,PAGE_GROUP_SIZE:()=>j,VERSION_SEPARATOR:()=>Ht});var et,nt,rt,it,ot,st,at,ct,Ht,G,lt,j,C=Z(()=>{"use strict";et=".haimati",nt="\u7D22\u5F15.md",rt="\u4E66\u9875",it="next-id.txt",ot="haimati.log",st=5e3,at="opencode-haimati.conf",ct="haimati-path",Ht=`
|
|
2
|
+
version:`,G=1,lt=!1,j=50});import v from"path";import Ut from"os";import H from"fs";function Xt(t){let r=v.join(t,at);if(!H.existsSync(r))return null;try{let s=H.readFileSync(r,"utf-8").split(`
|
|
3
|
+
`);for(let e of s){let i=e.trim();if(!i||i.startsWith("#"))continue;let o=i.match(/^([^:]+):\s*(.+)$/);if(o){let c=o[1].trim(),a=o[2].trim();if(c===ct&&a)return v.resolve(t,a)}}}catch(n){console.error("[haimati] \u8BFB\u53D6\u914D\u7F6E\u6587\u4EF6\u5931\u8D25:",n)}return null}function k(t){let r=Xt(t);return r||v.join(t,et)}function b(t){return v.join(k(t),nt)}function U(t){return v.join(k(t),it)}function ft(t){return v.join(k(t),".lock")}function ut(t){return v.join(k(t),"\u4E66\u9875")}function F(t,r){let n=parseInt(r,10),s=Math.floor((n-1)/50)*50+1,e=s+50-1,i=`${String(s).padStart(3,"0")}-${String(e).padStart(3,"0")}`;return v.join(ut(t),i)}function X(t,r){let n=String(parseInt(r,10)).padStart(3,"0");return v.join(F(t,r),`${n}.md`)}function Pt(){let t=Ut.tmpdir();return v.join(t,"haimati_logs",ot)}function S(t){return H.promises.mkdir(t,{recursive:!0}).then(()=>{})}function x(t){return H.promises.access(t).then(()=>!0).catch(()=>!1)}var D=Z(()=>{"use strict";C()});var gt={};Et(gt,{buildIndexTree:()=>K,extractCategoryName:()=>W,findEntryById:()=>N,findEntryByPath:()=>B,getTreeDepth:()=>O,parseIndex:()=>kt,readIndex:()=>P,readIndexContent:()=>ht,removeIndexEntry:()=>mt,writeIndex:()=>dt});import bt from"fs";import{promisify as vt}from"util";function O(t){let r=0,n=0,s=t.length;for(;n<s;)if(t[n]==="\u2502"&&n+3<s&&t.slice(n+1,n+4)===" ")r++,n+=4;else if(t.slice(n,n+4)===" ")r++,n+=4;else{if((t[n]==="\u251C"||t[n]==="\u2514")&&n+3<s&&t.slice(n+1,n+4)==="\u2500\u2500 ")break;break}return r}function W(t){let n=t.trim().replace(/^[│├└─\s]+/,"").trim();return n==="/"?"/":!n.endsWith("/")||(n=n.slice(0,-1),!n)?null:n}function kt(t){let r=[],n=t.split(`
|
|
4
|
+
`),s=[];for(let e of n){if(!e.trim())continue;let i=O(e),o=e.match(/^\s*[│├└─\s]*(.+?)\s*-\s*(\d+)\s*$/);if(o){let c=o[1].trim(),a=String(parseInt(o[2],10)),f=s.slice(0,i).filter(d=>d!=="").join("/");r.push({id:a,category:f,title:c})}else{let c=W(e);if(c)if(c==="/"){s[i]="";for(let a=i+1;a<s.length;a++)delete s[a]}else{s[i]=c;for(let a=i+1;a<s.length;a++)delete s[a]}}}return r}function N(t,r){return t.find(n=>n.id===r)||null}function B(t,r,n){return t.find(s=>s.category===r&&s.title===n)||null}function mt(t,r){return t.filter(n=>n.id!==r)}function K(t){if(t.length===0)return"";let r={name:"/",children:[],entry:null};for(let e of t){let i=e.category.split("/"),o=r;for(let a=0;a<i.length;a++){let h=i[a];if(!h)continue;let f=o.children.find(d=>d.name===h);f||(f={name:h,children:[],entry:null},o.children.push(f)),o=f}let c={name:e.id,children:[],entry:e};o.children.push(c)}function n(e){e.children.sort((i,o)=>i.name.localeCompare(o.name,void 0,{sensitivity:"base"}));for(let i of e.children)n(i)}n(r);function s(e,i,o){let c=[],a=i+(o?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "),h=e.name==="/"?"/":e.name+"/";c.push(`${a}${h}`),i=i+(o?" ":"\u2502 ");let f=e.children.filter(m=>m.entry===null),d=e.children.filter(m=>m.entry!==null),p=[...f,...d];for(let m=0;m<p.length;m++){let u=p[m],y=m===p.length-1;if(u.entry){let g=i+(y?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ");c.push(`${g}${u.entry.title} - ${u.entry.id}`)}else c.push(...s(u,i,y))}return c}return s(r,"",!0).join(`
|
|
5
|
+
`)}async function P(t){let r=b(t);if(!await x(r))return[];let n=await Mt(r,"utf-8");return kt(n)}async function dt(t,r){let n=It("path").join(t,(C(),tt(_t)).HAIMATI_DIR);await x(n)||await S(n);let s=K(r),e=b(t);await Kt(e,s,"utf-8")}async function ht(t){let r=b(t);return await x(r)?Mt(r,"utf-8"):""}var Mt,Kt,A=Z(()=>{"use strict";D();Mt=vt(bt.readFile),Kt=vt(bt.writeFile)});D();A();import{tool as I}from"@opencode-ai/plugin";D();C();import V from"fs";import{promisify as J}from"util";var Vt=J(V.readFile),Jt=J(V.writeFile),zt=J(V.unlink),St=J(V.mkdir);async function T(t,r){let n=X(t,r);if(!await x(n))return null;let e=(await Vt(n,"utf-8")).split(`
|
|
6
|
+
`);if(e.length<3)return null;if(e[2].startsWith("version:")){let c=e[0],a=e[1],h=parseInt(e[2].substring(8).trim(),10)||1,f=e.slice(3).join(`
|
|
7
|
+
`);return{title:c,createdAt:a,content:f,version:h}}let i=e[0],o=e.join(`
|
|
8
|
+
`);return{title:i,createdAt:"",content:o,version:1}}async function R(t,r,n,s,e,i=1){let o=ut(t);await x(o)||await St(o,{recursive:!0});let c=F(t,r);await x(c)||await St(c,{recursive:!0});let a=X(t,r),h=e?`${n}
|
|
10
9
|
${s}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
`)
|
|
10
|
+
version:${i}
|
|
11
|
+
${e}`:`${n}
|
|
12
|
+
${s}
|
|
13
|
+
version:${i}`;await Jt(a,h,"utf-8")}async function Tt(t,r){let n=X(t,r);return await x(n)?(await zt(n),!0):!1}async function z(t,r,n,s,e=!1){let i=r.toLowerCase().split(/\s+/).filter(c=>c.length>0);if(i.length===0)return[];let o=[];for(let c of t){let a=c.title.toLowerCase(),h=c.category.toLowerCase(),f=c.id.toLowerCase(),d=0,p=0;for(let u of i)(a.includes(u)||h.includes(u)||f.includes(u))&&d++;if(e&&s){let u=await T(s,c.id);if(u&&u.content){let y=u.content.toLowerCase();for(let g of i)y.includes(g)&&p++}}let m=d+p;n==="and"?m>=i.length&&o.push({entry:c,score:m}):(d>0||e&&p>0)&&o.push({entry:c,score:m})}return o.sort((c,a)=>a.score-c.score),o.map(c=>c.entry)}A();D();A();import Nt from"fs";import{promisify as At}from"util";D();C();import Dt from"fs";import{promisify as Lt}from"util";var Qt=Lt(Dt.writeFile),Yt=Lt(Dt.unlink);async function Ct(t){let r=k(t);await x(r)||await S(r);let n=ft(t),s=Date.now(),e=50+Math.random()*20;for(;await x(n);){if(Date.now()-s>5e3)return!1;await new Promise(i=>setTimeout(i,e))}return await Qt(n,String(process.pid),"utf-8"),!0}async function Ft(t){let r=ft(t);await x(r)&&await Yt(r)}D();import pt from"fs";import{promisify as yt}from"util";var Zt=yt(pt.appendFile),te=yt(pt.writeFile),ee=yt(pt.stat);function w(t,r=500){if(t.length<=r)return t;let n=Math.floor((r-20)/2);return t.substring(0,n)+"...(\u7701\u7565"+(t.length-r)+"\u5B57\u7B26)..."+t.substring(t.length-n)}async function ne(t){try{let r=new Date,n=r.toISOString().split("T")[0],s=r.toISOString().replace("T"," ").split(".")[0],e=Pt(),i=It("path").dirname(e);await x(i)||await S(i);let o=!1;await x(e)&&(await ee(e)).mtime.toISOString().split("T")[0]!==n&&(o=!0);let c=`[${s}] ${t}`;o?await te(e,c+`
|
|
14
|
+
`,"utf-8"):await Zt(e,c+`
|
|
15
|
+
`,"utf-8")}catch(r){console.error("[haimati] \u5199\u5165\u65E5\u5FD7\u6587\u4EF6\u5931\u8D25:",r)}}async function l(t,r){await ne(`[${t.toUpperCase()}] ${r}`)}var re=At(Nt.readFile),ie=At(Nt.writeFile);async function oe(t){let r=U(t);if(!await x(r))return 1;let s=(await re(r,"utf-8")).trim(),e=parseInt(s,10);return!isNaN(e)&&e>0?e:1}async function se(t){let r=U(t);if(await x(r))return;let n=await P(t),s=0;for(let e of n){let i=parseInt(e.id,10);i>s&&(s=i)}await qt(t,s+1)}async function qt(t,r){let n=k(t);await x(n)||await S(n);let s=U(t);await ie(s,String(r),"utf-8")}async function jt(t,r,n,s,e,i=!1){if(/ - \d{3}$/.test(n))throw await l("warn",`[allocateIdWithLock] title \u683C\u5F0F\u4E0D\u5408\u89C4: "${n}", \u629B\u51FA\u9519\u8BEF`),new Error('\u6807\u9898\u4E0D\u80FD\u4EE5 " - \u5E8F\u53F7" \u683C\u5F0F\u7ED3\u5C3E\uFF0C\u5E8F\u53F7\u7531\u7CFB\u7EDF\u81EA\u52A8\u5206\u914D\uFF0C\u8BF7\u4FEE\u6539\u6807\u9898');if(await l("info",`[allocateIdWithLock] \u5F00\u59CB\u5206\u914D\u5E8F\u53F7: category="${r}", title="${n}"`),!await Ct(t))return await l("warn",`[allocateIdWithLock] \u83B7\u53D6\u9501\u5931\u8D25: category="${r}", title="${n}"`),null;await l("debug",`[allocateIdWithLock] \u83B7\u53D6\u9501\u6210\u529F: category="${r}", title="${n}"`);try{await se(t);let o=await P(t),c=o.find(d=>d.category===r&&d.title===n);if(c){if(!i)throw new Error(`\u8BB0\u5FC6\u5DF2\u5B58\u5728: ${r}/${n}\uFF0C\u5982\u9700\u66F4\u65B0\u8BF7\u4F7F\u7528 haimati_edit \u5DE5\u5177`);let d=await T(t,c.id),p=d?d.createdAt:s,m=d?d.version+1:1;return await R(t,c.id,n,p,e,m),await l("info",`[allocateIdWithLock] \u66F4\u65B0\u5DF2\u6709\u6761\u76EE: #${c.id} ${r}/${n}, \u65B0\u7248\u672C: ${m}`),null}let a=await oe(t),h=String(a).padStart(3,"0");await R(t,h,n,s,e,1);let f={id:h,category:r,title:n};return o.push(f),await dt(t,o),await qt(t,a+1),await l("info",`[allocateIdWithLock] \u5206\u914D\u5E8F\u53F7\u6210\u529F: #${h} ${r}/${n}`),h}catch(o){let c=o instanceof Error?o.message:String(o);return await l("error",`[allocateIdWithLock] \u5206\u914D\u5E8F\u53F7\u5931\u8D25: ${c}`),null}finally{await Ft(t)}}function Ot(){return{haimati_read:I({description:"\u4ECE\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u8BFB\u53D6\u5185\u5BB9\u3002\u901A\u8FC7\u5E8F\u53F7\uFF08\u5982 '086'\uFF09\u6765\u5B9A\u4F4D\u5E76\u8BFB\u53D6\u8BB0\u5FC6\u5185\u5BB9\u3002\u652F\u6301\u5206\u9875\u8BFB\u53D6\uFF08offset/limit\uFF09\uFF0C\u8FD4\u56DE\u5185\u5BB9\u5E26\u884C\u53F7\u548C\u7248\u672C\u53F7\u3002",args:{query:I.schema.string().describe("\u5E8F\u53F7\u3002\u4F8B\u5982\uFF1A'086'"),offset:I.schema.number().optional().default(1).describe("\u8D77\u59CB\u884C\u53F7\uFF08\u9ED8\u8BA4 1\uFF09"),limit:I.schema.number().optional().default(2e3).describe("\u6700\u5927\u8BFB\u53D6\u884C\u6570\uFF08\u9ED8\u8BA4 2000\uFF09")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_read] \u5165\u53C2: query="${t.query}", offset=${t.offset||1}, limit=${t.limit||2e3}`),!await x(s)){let e=`\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728\u4E8E ${s}`;return await l("warn",`[haimati_read] \u51FA\u53C2:
|
|
16
|
+
${w(e)}`),e}try{let e=await P(n);await l("debug",`[haimati_read] \u8BFB\u53D6\u7D22\u5F15: \u5171 ${e.length} \u6761\u8BB0\u5F55`);let i=t.query.trim();if(!/^\d+$/.test(i)){let $="\u9519\u8BEF\uFF1Aquery \u5FC5\u987B\u662F\u5E8F\u53F7\uFF0C\u53EA\u652F\u6301\u5E8F\u53F7\u67E5\u8BE2";return await l("warn",`[haimati_read] \u51FA\u53C2:
|
|
17
|
+
${w($)}`),$}let o=String(parseInt(i,10)),c=N(e,o);if(await l("debug",`[haimati_read] \u5E8F\u53F7\u67E5\u8BE2 #${i}: ${c?"\u627E\u5230":"\u672A\u627E\u5230"}`),!c){let $=`\u672A\u627E\u5230\u8BB0\u5FC6: ${t.query}`;return await l("info",`[haimati_read] \u51FA\u53C2:
|
|
18
|
+
${w($)}`),$}let a=await T(n,c.id);if(!a){let $=`\u672A\u627E\u5230\u4E66\u9875: #${c.id}`;return await l("error",`[haimati_read] \u51FA\u53C2:
|
|
19
|
+
${w($)}`),$}let h=F(n,c.id);await l("debug",`[haimati_read] \u8BFB\u53D6\u4E66\u9875: \u4E66\u9875/${h.split(/[\\/]/).pop()}/${c.id}.md, version=${a.version}`);let f=a.content.split(`
|
|
20
|
+
`),d=t.offset||1,p=t.limit||2e3,m=f.length,u=Math.max(0,d-1),y=Math.min(m,u+p),g=[];g.push(`version:${a.version}`);for(let $=u;$<y;$++)g.push(`${$+1}|${f[$]}`);let E=g.join(`
|
|
19
21
|
`);return await l("info",`[haimati_read] \u51FA\u53C2:
|
|
20
|
-
${
|
|
21
|
-
\u5806\u6808: ${
|
|
22
|
-
${
|
|
23
|
-
`);try{let s=new Date().toISOString(),e=null;for(let
|
|
22
|
+
${w(E)}`),E}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_read] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
23
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}}),haimati_write:I({description:"\u5C06\u65B0\u4FE1\u606F\u5199\u5165\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u3002\u9700\u8981\u63D0\u4F9B\u5206\u7C7B\u8DEF\u5F84\uFF08\u5982 'xxx\u9879\u76EE/\u7B7E\u7AE0'\uFF09\u3001\u6807\u9898\u548C\u5185\u5BB9\u3002\u5982\u679C\u76F8\u540C\u5206\u7C7B\u548C\u6807\u9898\u7684\u8BB0\u5FC6\u5DF2\u5B58\u5728\uFF0C\u5219\u4F1A\u62A5\u9519\u3002",args:{category:I.schema.string().describe("\u5206\u7C7B\u8DEF\u5F84\uFF0C\u5982 'xxx\u9879\u76EE/\u7B7E\u7AE0' \u6216 '\u901A\u7528'"),title:I.schema.string().describe("\u8BB0\u5FC6\u6807\u9898\uFF0C\u5982 '\u7B7E\u7AE0\u670D\u52A1WS\u901A\u4FE1\u673A\u5236'"),content:I.schema.string().describe("\u8981\u5199\u5165\u7684\u8BE6\u7EC6\u5185\u5BB9")},async execute(t,r){let{directory:n}=r;await l("info",`[haimati_write] \u5165\u53C2: category="${t.category}", title="${t.title}", content\u957F\u5EA6=${t.content.length}\u5B57\u7B26, content=
|
|
24
|
+
${w(t.content)}
|
|
25
|
+
`);try{let s=new Date().toISOString(),e=null;for(let a=0;a<3&&(e=await jt(n,t.category,t.title,s,t.content,!1),!e);a++)await l("warn",`[haimati_write] \u9501\u83B7\u53D6\u5931\u8D25\uFF0C\u91CD\u8BD5\u7B2C ${a+1} \u6B21`);if(e){let a=F(n,e);await l("debug",`[haimati_write] \u5206\u914D\u65B0\u5E8F\u53F7: #${e}`),await l("debug",`[haimati_write] \u4E66\u9875\u548C\u7D22\u5F15\u5DF2\u66F4\u65B0: \u4E66\u9875/${a.split(/[\\/]/).pop()}/${e}.md`);let h=`\u5DF2\u5199\u5165\u6D77\u9A6C\u4F53 #${e}
|
|
24
26
|
\u8DEF\u5F84: ${t.category}/${t.title}
|
|
25
27
|
\u7248\u672C: 1`;return await l("info",`[haimati_write] \u51FA\u53C2:
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
${
|
|
29
|
-
\u5806\u6808: ${
|
|
30
|
-
${
|
|
31
|
-
${
|
|
32
|
-
`),
|
|
33
|
-
`);for(let
|
|
34
|
-
`).filter(
|
|
28
|
+
${w(h)}`),h}let i=await P(n),o=B(i,t.category,t.title);if(o){let a=`\u9519\u8BEF\uFF1A\u8BB0\u5FC6\u5DF2\u5B58\u5728 #${o.id} (${t.category}/${t.title})\uFF0C\u5982\u9700\u66F4\u65B0\u8BF7\u4F7F\u7528 haimati_edit \u5DE5\u5177`;return await l("error",`[haimati_write] \u51FA\u53C2:
|
|
29
|
+
${w(a)}`),a}let c="\u9519\u8BEF\uFF1A\u65E0\u6CD5\u5206\u914D\u5E8F\u53F7\uFF08\u9501\u7B49\u5F85\u8D85\u65F6\uFF09";return await l("error",`[haimati_write] \u51FA\u53C2:
|
|
30
|
+
${w(c)}`),c}catch(s){let e=s instanceof Error?s.message:String(s),i=s instanceof Error?s.stack:"";return await l("error",`[haimati_write] \u51FA\u53C2: \u9519\u8BEF: ${e}
|
|
31
|
+
\u5806\u6808: ${i}`),`\u9519\u8BEF: ${e}`}}}),haimati_search:I({description:"\u641C\u7D22\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\uFF08\u652F\u6301\u591A\u5173\u952E\u5B57\uFF0C\u7528\u7A7A\u683C\u5206\u9694\uFF09\u3002\u641C\u7D22\u8303\u56F4\u5305\u62EC\uFF1A\u6807\u9898\u3001\u5206\u7C7B\u3001\u5E8F\u53F7\u3001\u4E66\u9875\u5185\u5BB9\u3002\u8F93\u5165\u5173\u952E\u8BCD\uFF0C\u8FD4\u56DE\u5339\u914D\u7684\u6761\u76EE\u5217\u8868\u548C\u5185\u5BB9\u7247\u6BB5\uFF0C\u652F\u6301\u5206\u9875\uFF08limit/offset\uFF09\u3002",args:{keyword:I.schema.string().describe("\u641C\u7D22\u5173\u952E\u8BCD\uFF08\u652F\u6301\u591A\u5173\u952E\u5B57\uFF0C\u7528\u7A7A\u683C\u5206\u9694\uFF09"),match:I.schema.string().describe("\u5339\u914D\u6A21\u5F0F\uFF1Aand=\u6240\u6709\u5173\u952E\u5B57\u90FD\u5339\u914D\uFF0Cor=\u4EFB\u610F\u5173\u952E\u5B57\u5339\u914D"),limit:I.schema.number().default(10).describe("\u8FD4\u56DE\u7ED3\u679C\u6570\u91CF\u9650\u5236"),offset:I.schema.number().default(0).describe("\u5206\u9875\u504F\u79FB\u91CF\uFF0C\u7528\u4E8E\u83B7\u53D6\u540E\u7EED\u9875\u9762")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_search] \u5165\u53C2: keyword="${t.keyword}", match="${t.match}", limit=${t.limit||10}, offset=${t.offset||0}`),!await x(s)){let e="\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728";return await l("warn",`[haimati_search] \u51FA\u53C2:
|
|
32
|
+
${w(e)}`),e}try{let e=await P(n),i=t.keyword.trim(),o=t.match,c=t.limit||10,a=t.offset||0,h=await z(e,i,o,n,!0),f=h.length,d=h.slice(a,a+c);if(d.length===0){let g=`\u672A\u627E\u5230\u5305\u542B '${i}' \u7684\u8BB0\u5FC6`;return await l("info",`[haimati_search] \u51FA\u53C2:
|
|
33
|
+
${w(g)}`),g}let p=[],m=a+d.length<f,u=m?`${a+1}-${a+d.length}/${f}`:`${a+1}-${a+d.length}/${f}`;p.push(`\u627E\u5230 ${u} \u6761\u5339\u914D\uFF1A
|
|
34
|
+
`),m&&p.push(`\uFF08\u5982\u9700\u83B7\u53D6\u66F4\u591A\uFF0C\u8BF7\u4F7F\u7528 offset=${a+c} \u7EE7\u7EED\u7FFB\u9875\uFF09
|
|
35
|
+
`);for(let g of d){let E=await T(n,g.id),$=`${g.category}/${g.title}`,M="";E&&(M=E.content.split(`
|
|
36
|
+
`).filter(Q=>Q.trim()).slice(0,3).join(" | ").substring(0,150),M.length===150&&(M+="...")),p.push(`## ${$} [${g.id}]`),M&&p.push(`> ${M}`),p.push("")}let y=p.join(`
|
|
35
37
|
`);return await l("info",`[haimati_search] \u51FA\u53C2:
|
|
36
|
-
${
|
|
37
|
-
\u5806\u6808: ${
|
|
38
|
-
${
|
|
39
|
-
`),!await
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
`).length;if(
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
`){if(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
\
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
`)}`}}
|
|
55
|
-
${
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
${
|
|
60
|
-
${
|
|
61
|
-
`)}`}}
|
|
62
|
-
${
|
|
63
|
-
|
|
64
|
-
\
|
|
65
|
-
${
|
|
66
|
-
\
|
|
67
|
-
${
|
|
68
|
-
|
|
38
|
+
${w(y)}`),y}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_search] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
39
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}}),haimati_edit:I({description:"\u4FEE\u6539\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7684\u90E8\u5206\u5185\u5BB9\u3002\u5C06\u6307\u5B9A\u884C\u53F7\u8303\u56F4 [offsetBegin, offsetEnd) \u7684\u5185\u5BB9\u66FF\u6362\u4E3A\u65B0 content\uFF0CoffsetEnd \u4E0D\u5305\u62EC\u6B64\u884C\u3002\u9700\u8981\u63D0\u4F9B read \u65F6\u8FD4\u56DE\u7684 version \u8FDB\u884C\u5E76\u53D1\u63A7\u5236\u3002",args:{query:I.schema.string().describe("\u5E8F\u53F7\uFF0C\u7528\u4E8E\u5B9A\u4F4D\u8981\u66F4\u65B0\u7684\u8BB0\u5FC6"),offsetBegin:I.schema.number().describe("\u8D77\u59CB\u884C\u53F7\uFF08\u5305\u62EC\uFF09"),offsetEnd:I.schema.number().describe("\u7ED3\u675F\u884C\u53F7\uFF08\u4E0D\u5305\u62EC\u6B64\u884C\uFF09"),content:I.schema.string().describe("\u66FF\u6362\u5185\u5BB9"),version:I.schema.number().describe("read \u65F6\u8FD4\u56DE\u7684 version\uFF0C\u7528\u4E8E\u5E76\u53D1\u63A7\u5236")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_edit] \u5165\u53C2: query="${t.query}", offsetBegin=${t.offsetBegin}, offsetEnd=${t.offsetEnd}, content\u957F\u5EA6=${t.content.length}\u5B57\u7B26, version=${t.version}, content=
|
|
40
|
+
${w(t.content)}
|
|
41
|
+
`),!await x(s)){let e="\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728";return await l("warn",`[haimati_edit] \u51FA\u53C2:
|
|
42
|
+
${w(e)}`),e}try{let e=await P(n),i=t.query.trim();if(!/^\d+$/.test(i)){let _="\u9519\u8BEF\uFF1Aquery \u5FC5\u987B\u662F\u5E8F\u53F7\uFF0C\u53EA\u652F\u6301\u5E8F\u53F7\u67E5\u8BE2";return await l("warn",`[haimati_edit] \u51FA\u53C2:
|
|
43
|
+
${w(_)}`),_}let o=String(parseInt(i,10)),c=N(e,o);if(!c){let _=`\u672A\u627E\u5230\u4E0E '${i}' \u76F8\u5173\u7684\u8BB0\u5FC6`;return await l("info",`[haimati_edit] \u51FA\u53C2:
|
|
44
|
+
${w(_)}`),_}let a=await T(n,c.id);if(!a){let _=`\u672A\u627E\u5230\u4E66\u9875: #${c.id}`;return await l("error",`[haimati_edit] \u51FA\u53C2:
|
|
45
|
+
${w(_)}`),_}let h=t.offsetBegin,f=t.offsetEnd,d=a.content.split(`
|
|
46
|
+
`).length;if(h<1||h>=d+1||h>=f||f>d+1){let _=`\u9519\u8BEF\uFF1Aoffset \u975E\u6CD5\uFF0CoffsetBegin=${h}, offsetEnd=${f}, \u6587\u4EF6\u603B\u884C\u6570=${d}\uFF0C\u6709\u6548\u8303\u56F4 offsetBegin=[1, ${d+1}), offsetEnd=[offsetBegin+1, ${d+1}]`;return await l("warn",`[haimati_edit] \u51FA\u53C2:
|
|
47
|
+
${w(_)}`),_}if(a.version!==t.version){let _=`\u9519\u8BEF\uFF1A\u7248\u672C\u51B2\u7A81\uFF0C\u5F53\u524D version=${a.version}\uFF0C\u4F20\u5165 version=${t.version}\uFF0C\u8BF7\u91CD\u65B0\u8BFB\u53D6\u540E\u518D\u64CD\u4F5C`;return await l("warn",`[haimati_edit] \u51FA\u53C2:
|
|
48
|
+
${w(_)}`),_}let p=(_,$t)=>{if($t===0)return 0;let xt=1,q=0;for(;q<_.length;){if(_[q]===`
|
|
49
|
+
`){if(xt===$t)return q+1;xt++}q++}return q},m=p(a.content,h-1),u=p(a.content,f-1),y=a.content.substring(0,Math.min(100,a.content.length));await l("debug",`[haimati_edit] content\u957F\u5EA6=${a.content.length}, content\u524D100\u5B57\u7B26: ${JSON.stringify(y)}, offsetBegin=${h}, offsetEnd=${f}, beforeEndIndex=${m}, afterStartIndex=${u}`);let E=(u<a.content.length?a.content.substring(u):"").startsWith(`
|
|
50
|
+
`),$=u<a.content.length&&!t.content.endsWith(`
|
|
51
|
+
`)&&!E,M=a.content.substring(0,m)+t.content+($?`
|
|
52
|
+
`:"")+a.content.substring(u),L=a.version+1;await R(n,c.id,c.title,a.createdAt,M,L);let Q=`${c.category}/${c.title}`,wt=`\u5DF2\u66F4\u65B0\u6D77\u9A6C\u4F53 #${c.id}
|
|
53
|
+
\u8DEF\u5F84: ${Q}
|
|
54
|
+
\u65B0\u7248\u672C: ${L}`;return await l("info",`[haimati_edit] \u51FA\u53C2:
|
|
55
|
+
${w(wt)}`),wt}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_edit] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
56
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}}),haimati_delete:I({description:"\u5220\u9664\u6D77\u9A6C\u4F53\u4E2D\u7684\u8BB0\u5FC6\u3002\u901A\u8FC7\u5E8F\u53F7\uFF08\u5982 '086'\uFF09\u6216\u5B8C\u6574\u8DEF\u5F84\uFF08\u5982 'xxx\u9879\u76EE/\u7B7E\u7AE0/\u7B7E\u7AE0\u670D\u52A1WS\u901A\u4FE1\u673A\u5236'\uFF09\u6765\u5B9A\u4F4D\u8981\u5220\u9664\u7684\u8BB0\u5FC6\u3002",args:{query:I.schema.string().describe("\u5E8F\u53F7\u6216\u5B8C\u6574\u8DEF\u5F84\uFF0C\u7528\u4E8E\u5B9A\u4F4D\u8981\u5220\u9664\u7684\u8BB0\u5FC6")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_delete] \u5165\u53C2: query="${t.query}"`),!await x(s)){let e="\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728";return await l("warn",`[haimati_delete] \u51FA\u53C2:
|
|
57
|
+
${w(e)}`),e}try{let e=await P(n),i=t.query.trim(),o=null;if(/^\d+$/.test(i))o=N(e,String(parseInt(i,10)));else{let f=i.split("/").filter(Boolean);if(f.length>=2){let d=f.pop(),p=f.join("/");o=B(e,p,d)}else{let d=await z(e,i,"or",n);if(d.length===1)o=d[0];else if(d.length>1)return`\u627E\u5230\u591A\u6761\u5339\u914D\uFF0C\u8BF7\u4F7F\u7528\u5E8F\u53F7\u7CBE\u786E\u6307\u5B9A\uFF1A
|
|
58
|
+
${d.slice(0,10).map(m=>` - ${m.category}/${m.title} [${m.id}]`).join(`
|
|
59
|
+
`)}`}}if(!o){let f=`\u672A\u627E\u5230\u4E0E '${i}' \u76F8\u5173\u7684\u8BB0\u5FC6`;return await l("info",`[haimati_delete] \u51FA\u53C2:
|
|
60
|
+
${w(f)}`),f}await Tt(n,o.id);let c=mt(e,o.id);await(A(),tt(gt)).writeIndex(n,c);let a=`${o.category}/${o.title}`,h=`\u5DF2\u5220\u9664\u6D77\u9A6C\u4F53 #${o.id}
|
|
61
|
+
\u8DEF\u5F84: ${a}`;return await l("info",`[haimati_delete] \u51FA\u53C2:
|
|
62
|
+
${w(h)}`),h}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_delete] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
63
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}}),haimati_move:I({description:"\u4FEE\u6539\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7684\u5206\u7C7B\u8DEF\u5F84\u3002\u901A\u8FC7\u5E8F\u53F7\u6216\u5B8C\u6574\u8DEF\u5F84\u5B9A\u4F4D\u8BB0\u5FC6\uFF0C\u7136\u540E\u5C06\u5176\u79FB\u52A8\u5230\u65B0\u7684\u5206\u7C7B\u3002",args:{query:I.schema.string().describe("\u5E8F\u53F7\u6216\u5B8C\u6574\u8DEF\u5F84\uFF0C\u7528\u4E8E\u5B9A\u4F4D\u8981\u79FB\u52A8\u7684\u8BB0\u5FC6"),newCategory:I.schema.string().describe("\u65B0\u7684\u5206\u7C7B\u8DEF\u5F84\uFF0C\u5982 'xxx\u9879\u76EE/\u5BA2\u6237\u7AEF' \u6216 '\u901A\u7528'")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_move] \u5165\u53C2: query="${t.query}", newCategory="${t.newCategory}"`),!await x(s)){let e="\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728";return await l("warn",`[haimati_move] \u51FA\u53C2:
|
|
64
|
+
${w(e)}`),e}try{let e=await P(n),i=t.query.trim(),o=null;if(/^\d+$/.test(i))o=N(e,String(parseInt(i,10)));else{let m=i.split("/").filter(Boolean);if(m.length>=2){let u=m.pop(),y=m.join("/");o=B(e,y,u)}else{let u=await z(e,i,"or",n);if(u.length===1)o=u[0];else if(u.length>1)return`\u627E\u5230\u591A\u6761\u5339\u914D\uFF0C\u8BF7\u4F7F\u7528\u5E8F\u53F7\u7CBE\u786E\u6307\u5B9A\uFF1A
|
|
65
|
+
${u.slice(0,10).map(g=>` - ${g.category}/${g.title} [${g.id}]`).join(`
|
|
66
|
+
`)}`}}if(!o){let m=`\u672A\u627E\u5230\u4E0E '${i}' \u76F8\u5173\u7684\u8BB0\u5FC6`;return await l("info",`[haimati_move] \u51FA\u53C2:
|
|
67
|
+
${w(m)}`),m}let a=`${o.category}/${o.title}`,h=t.newCategory,f=`${h}/${o.title}`,d=e.map(m=>m.id===o.id?{...m,category:h}:m);await(A(),tt(gt)).writeIndex(n,d);let p=`\u5DF2\u79FB\u52A8\u6D77\u9A6C\u4F53 #${o.id}
|
|
68
|
+
\u65E7\u8DEF\u5F84: ${a}
|
|
69
|
+
\u65B0\u8DEF\u5F84: ${f}`;return await l("info",`[haimati_move] \u51FA\u53C2:
|
|
70
|
+
${w(p)}`),p}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_move] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
71
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}}),haimati_list:I({description:"\u5217\u51FA\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u7684\u5B8C\u6574\u7D22\u5F15\u7ED3\u6784\u3002",args:{category:I.schema.string().optional().describe("\u53EF\u9009\u7684\u5206\u7C7B\u8DEF\u5F84\uFF0C\u5217\u51FA\u8BE5\u5206\u7C7B\u4E0B\u7684\u6761\u76EE"),recursive:I.schema.boolean().optional().default(!1).describe("\u662F\u5426\u9012\u5F52\u904D\u5386\u5B50\u5206\u7C7B\uFF0C\u9ED8\u8BA4false")},async execute(t,r){let{directory:n}=r,s=b(n);if(await l("info",`[haimati_list] \u5165\u53C2: category="${t.category||"(\u65E0)"}, recursive=${t.recursive}"`),!await x(s)){let e="\u9519\u8BEF\uFF1A\u6D77\u9A6C\u4F53\u7D22\u5F15\u4E0D\u5B58\u5728";return await l("warn",`[haimati_list] \u51FA\u53C2:
|
|
72
|
+
${w(e)}`),e}try{let e=await P(n);if(t.category){let a=(await ht(n)).split(`
|
|
73
|
+
`),h=0,f=[];for(let u of a){if(!u.trim())continue;let y=O(u);if(u.match(/^\s*[│├└─\s]*(.+?)\s*-\s*(\d+)\s*$/))continue;let E=W(u);if(E&&(E==="/"?f[y]="":f[y]=E,f=f.slice(0,y+1),f.filter(Boolean).join("/")===t.category)){h=y;break}}let d=[],p=[];f=[];for(let u of a){if(!u.trim())continue;let y=O(u),g=u.match(/^\s*[│├└─\s]*(.+?)\s*-\s*(\d+)\s*$/);if(g){let $=g[1].trim(),M=g[2];if(y===h+1){let L=f.slice(1,y).filter(Boolean).join("/");L===t.category&&p.push({category:L,title:$,id:M})}continue}let E=W(u);E&&(E==="/"?f[y]="":f[y]=E,f=f.slice(0,y+1),y===h+1&&f.filter(Boolean).join("/")===t.category&&d.push(E))}let m=`## ${t.category}
|
|
69
74
|
|
|
70
|
-
`;if(t.recursive){let
|
|
71
|
-
`,
|
|
75
|
+
`;if(t.recursive){let u=e.filter(g=>g.category===t.category||g.category.startsWith(t.category+"/")),y=new Map;for(let g of u){let $=g.category.slice(t.category.length+1).split("/")[0]||"(\u76F4\u63A5)";y.has($)||y.set($,[]),y.get($).push(g)}for(let[g,E]of y)m+=`### ${g}/
|
|
76
|
+
`,m+=E.map($=>`- ${$.title} - ${$.id}`).join(`
|
|
72
77
|
`)+`
|
|
73
78
|
|
|
74
|
-
`}else
|
|
75
|
-
`+
|
|
79
|
+
`}else d.length>0&&(m+=`**\u5B50\u5206\u7C7B\uFF1A**
|
|
80
|
+
`+d.map(u=>`- ${u}/`).join(`
|
|
76
81
|
`)+`
|
|
77
82
|
|
|
78
|
-
`),
|
|
79
|
-
`+
|
|
83
|
+
`),p.length>0&&(m+=`**\u76F4\u63A5\u6761\u76EE\uFF1A**
|
|
84
|
+
`+p.map(u=>`- ${u.title} - ${u.id}`).join(`
|
|
80
85
|
`));return await l("info",`[haimati_list] \u51FA\u53C2:
|
|
81
|
-
${
|
|
86
|
+
${w(m)}`),m}let o=`## \u6D77\u9A6C\u4F53\u7D22\u5F15
|
|
82
87
|
|
|
83
|
-
${
|
|
84
|
-
${
|
|
85
|
-
\u5806\u6808: ${
|
|
88
|
+
${K(e)||"(\u7A7A)"}`;return await l("info",`[haimati_list] \u51FA\u53C2:
|
|
89
|
+
${w(o)}`),o}catch(e){let i=e instanceof Error?e.message:String(e),o=e instanceof Error?e.stack:"";return await l("error",`[haimati_list] \u51FA\u53C2: \u9519\u8BEF: ${i}
|
|
90
|
+
\u5806\u6808: ${o}`),`\u9519\u8BEF: ${i}`}}})}}C();var tn=async t=>(await l("info","\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u63D2\u4EF6(\u6587\u4EF6\u7248)debug\u7248\u672C04091356\u5DF2\u52A0\u8F7D"),{tool:Ot(),event:async({event:n})=>{if(n.type==="session.created")try{let s=n.properties?.info?.id;if(!s){await l("warn","[session.created] \u65E0\u6CD5\u83B7\u53D6 sessionID\uFF0C\u8DF3\u8FC7\u6CE8\u5165");return}if(!!1){await l("info","[session.created] \u81EA\u52A8\u6CE8\u5165\u5DF2\u5173\u95ED\uFF0C\u8DF3\u8FC7\u6CE8\u5165 (AUTO_INJECT_CONTEXT=false)");return}await t.client.session.prompt({path:{id:s},body:{noReply:!0,parts:[{type:"text",text:`## \u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u4F7F\u7528\u89C4\u5219
|
|
86
91
|
|
|
87
92
|
\u4F60\u6709\u4E00\u4E2A\u6D77\u9A6C\u4F53\u8BB0\u5FC6\u7CFB\u7EDF\u53EF\u7528\uFF0C\u7528\u4E8E\u5B58\u50A8\u548C\u68C0\u7D22\u8DE8\u4F1A\u8BDD\u7684\u77E5\u8BC6\u3002
|
|
88
93
|
|
|
@@ -116,4 +121,4 @@ ${$(r)}`),r}catch(e){let o=e instanceof Error?e.message:String(e),r=e instanceof
|
|
|
116
121
|
|
|
117
122
|
**\u4F1A\u8BDD\u5F00\u59CB\u524D**: \u4F7F\u7528 haimati_list \u6216 haimati_search \u8BFB\u53D6\u4E0E\u5F53\u524D\u4EFB\u52A1\u76F8\u5173\u7684\u8BB0\u5FC6\u5185\u5BB9\uFF0C\u518D\u5F00\u59CB\u5DE5\u4F5C\u3002
|
|
118
123
|
|
|
119
|
-
**\u4F1A\u8BDD\u7ED3\u675F\u540E**: \u4F7F\u7528 haimati_write \u5C06\u65B0\u83B7\u5F97\u7684\u77E5\u8BC6\u3001\u7ECF\u9A8C\u3001\u51B3\u7B56\u5199\u5165\u6D77\u9A6C\u4F53\uFF0C\u4FDD\u6301\u4FE1\u606F\u7684\u6301\u7EED\u79EF\u7D2F\u3002`}]}}),await l("info",`[session.created] \u6D77\u9A6C\u4F53\u89C4\u5219\u5DF2\u6CE8\u5165\u65B0\u4F1A\u8BDD (sessionID: ${s})`)}catch(s){let e=s instanceof Error?s.message:String(s);await l("error",`[session.created] \u6CE8\u5165\u6D77\u9A6C\u4F53\u89C4\u5219\u5931\u8D25: ${e}`)}}});export{
|
|
124
|
+
**\u4F1A\u8BDD\u7ED3\u675F\u540E**: \u4F7F\u7528 haimati_write \u5C06\u65B0\u83B7\u5F97\u7684\u77E5\u8BC6\u3001\u7ECF\u9A8C\u3001\u51B3\u7B56\u5199\u5165\u6D77\u9A6C\u4F53\uFF0C\u4FDD\u6301\u4FE1\u606F\u7684\u6301\u7EED\u79EF\u7D2F\u3002`}]}}),await l("info",`[session.created] \u6D77\u9A6C\u4F53\u89C4\u5219\u5DF2\u6CE8\u5165\u65B0\u4F1A\u8BDD (sessionID: ${s})`)}catch(s){let e=s instanceof Error?s.message:String(s);await l("error",`[session.created] \u6CE8\u5165\u6D77\u9A6C\u4F53\u89C4\u5219\u5931\u8D25: ${e}`)}}});export{tn as HaimatiPlugin};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-haimati",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "OpenCode plugin for a file-based memory system inspired by the hippocampus, providing long-term memory storage and retrieval across sessions.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-haimati",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "OpenCode plugin for a file-based memory system inspired by the hippocampus, providing long-term memory storage and retrieval across sessions.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|