agentix-cli 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -3
- package/dist/{App-CKPH3HHF.js → App-IEQXWJ7B.js} +2 -2
- package/dist/{ChatApp-MX7IG4K2.js → ChatApp-NWOSAP5U.js} +2 -2
- package/dist/{agent-2U574KBZ.js → agent-SPE7Q7MD.js} +2 -2
- package/dist/{board-dashboard-QR7CVTKA.js → board-dashboard-K4DM32SO.js} +4 -4
- package/dist/{chunk-VIH7ARPF.js → chunk-42DCRKUD.js} +130 -129
- package/dist/chunk-42DCRKUD.js.map +1 -0
- package/dist/chunk-45BLFNDG.js +170 -0
- package/dist/chunk-45BLFNDG.js.map +1 -0
- package/dist/{chunk-ZMYGXHPT.js → chunk-4KXBUORV.js} +2 -2
- package/dist/{chunk-H2QQU2XV.js → chunk-AUNDQPDR.js} +2 -2
- package/dist/{chunk-5IA2CYHN.js → chunk-DI7FMCDK.js} +2 -2
- package/dist/chunk-DWADWDMU.js +96 -0
- package/dist/chunk-DWADWDMU.js.map +1 -0
- package/dist/{chunk-YLBERT7N.js → chunk-EL3J74N2.js} +2 -2
- package/dist/{chunk-S2MNL5V6.js → chunk-GK7XAM3D.js} +2 -2
- package/dist/chunk-GK7XAM3D.js.map +1 -0
- package/dist/{chunk-P5ZBBEPL.js → chunk-GMNKJXTR.js} +1 -1
- package/dist/chunk-GMNKJXTR.js.map +1 -0
- package/dist/{chunk-E3UJHQGN.js → chunk-GUBMLV34.js} +142 -130
- package/dist/chunk-GUBMLV34.js.map +1 -0
- package/dist/{chunk-64CAIB3C.js → chunk-IVQO43U2.js} +2 -2
- package/dist/{chunk-G2HMRDUQ.js → chunk-JKYMXLYL.js} +2 -2
- package/dist/{chunk-YLGIZRHV.js → chunk-MGNJWBVP.js} +2 -2
- package/dist/{chunk-3LYM22IV.js → chunk-Q7CZIRBB.js} +2 -2
- package/dist/{chunk-SCTIUFL4.js → chunk-SC5DIKBB.js} +2 -2
- package/dist/{chunk-MHIMGM4G.js → chunk-UU4WOZNR.js} +2 -2
- package/dist/{chunk-QHTQPBHU.js → chunk-V4HURNMX.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client-5Z3URGPY.js +2 -0
- package/dist/config-ORSGLVRW.js +2 -0
- package/dist/config-mutator-JB3S2E7H.js +2 -0
- package/dist/doctor-FS2BX6H4.js +2 -0
- package/dist/index.d.ts +187 -185
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/program-DWZAI4GY.js +2 -0
- package/dist/query-3HXGBKGM.js +2 -0
- package/dist/registry-EJRWAJYG.js +2 -0
- package/dist/request-planner-BCOXUAPA.js +2 -0
- package/dist/request-planner-BCOXUAPA.js.map +1 -0
- package/dist/{review-candidates-RQU5KNZM.js → review-candidates-O2PS7L3B.js} +2 -2
- package/dist/routing-5K7PGHPL.js +2 -0
- package/dist/scheduler-DSAOMV4O.js +2 -0
- package/dist/seat-FZRNRAHQ.js +2 -0
- package/dist/{select-X4KVMOP5.js → select-SOJYFAMI.js} +2 -2
- package/dist/wiki-34XVI32N.js +2 -0
- package/dist/workspace-setup-G6KGWPHY.js +2 -0
- package/package.json +1 -1
- package/dist/chunk-67Q4DCPS.js +0 -54
- package/dist/chunk-67Q4DCPS.js.map +0 -1
- package/dist/chunk-E3UJHQGN.js.map +0 -1
- package/dist/chunk-I3SIXTJO.js +0 -44
- package/dist/chunk-I3SIXTJO.js.map +0 -1
- package/dist/chunk-P5ZBBEPL.js.map +0 -1
- package/dist/chunk-S2MNL5V6.js.map +0 -1
- package/dist/chunk-ULLAE6LE.js +0 -157
- package/dist/chunk-ULLAE6LE.js.map +0 -1
- package/dist/chunk-VIH7ARPF.js.map +0 -1
- package/dist/client-ZLSXGPTV.js +0 -2
- package/dist/config-HMW3EBZL.js +0 -2
- package/dist/config-mutator-4SZ5YEVD.js +0 -2
- package/dist/doctor-LRYV3QLK.js +0 -2
- package/dist/program-GSZ5AYAM.js +0 -2
- package/dist/query-SQDHE4HV.js +0 -2
- package/dist/registry-LE6FWYZC.js +0 -2
- package/dist/routing-ILERJXB6.js +0 -2
- package/dist/scheduler-BFM3EINS.js +0 -2
- package/dist/seat-7WM7II2B.js +0 -2
- package/dist/wiki-2AUFSIKO.js +0 -2
- package/dist/workspace-setup-B3F3TUDE.js +0 -2
- /package/dist/{App-CKPH3HHF.js.map → App-IEQXWJ7B.js.map} +0 -0
- /package/dist/{ChatApp-MX7IG4K2.js.map → ChatApp-NWOSAP5U.js.map} +0 -0
- /package/dist/{agent-2U574KBZ.js.map → agent-SPE7Q7MD.js.map} +0 -0
- /package/dist/{board-dashboard-QR7CVTKA.js.map → board-dashboard-K4DM32SO.js.map} +0 -0
- /package/dist/{chunk-ZMYGXHPT.js.map → chunk-4KXBUORV.js.map} +0 -0
- /package/dist/{chunk-H2QQU2XV.js.map → chunk-AUNDQPDR.js.map} +0 -0
- /package/dist/{chunk-5IA2CYHN.js.map → chunk-DI7FMCDK.js.map} +0 -0
- /package/dist/{chunk-YLBERT7N.js.map → chunk-EL3J74N2.js.map} +0 -0
- /package/dist/{chunk-64CAIB3C.js.map → chunk-IVQO43U2.js.map} +0 -0
- /package/dist/{chunk-G2HMRDUQ.js.map → chunk-JKYMXLYL.js.map} +0 -0
- /package/dist/{chunk-YLGIZRHV.js.map → chunk-MGNJWBVP.js.map} +0 -0
- /package/dist/{chunk-3LYM22IV.js.map → chunk-Q7CZIRBB.js.map} +0 -0
- /package/dist/{chunk-SCTIUFL4.js.map → chunk-SC5DIKBB.js.map} +0 -0
- /package/dist/{chunk-MHIMGM4G.js.map → chunk-UU4WOZNR.js.map} +0 -0
- /package/dist/{chunk-QHTQPBHU.js.map → chunk-V4HURNMX.js.map} +0 -0
- /package/dist/{client-ZLSXGPTV.js.map → client-5Z3URGPY.js.map} +0 -0
- /package/dist/{config-HMW3EBZL.js.map → config-ORSGLVRW.js.map} +0 -0
- /package/dist/{config-mutator-4SZ5YEVD.js.map → config-mutator-JB3S2E7H.js.map} +0 -0
- /package/dist/{doctor-LRYV3QLK.js.map → doctor-FS2BX6H4.js.map} +0 -0
- /package/dist/{program-GSZ5AYAM.js.map → program-DWZAI4GY.js.map} +0 -0
- /package/dist/{query-SQDHE4HV.js.map → query-3HXGBKGM.js.map} +0 -0
- /package/dist/{registry-LE6FWYZC.js.map → registry-EJRWAJYG.js.map} +0 -0
- /package/dist/{review-candidates-RQU5KNZM.js.map → review-candidates-O2PS7L3B.js.map} +0 -0
- /package/dist/{routing-ILERJXB6.js.map → routing-5K7PGHPL.js.map} +0 -0
- /package/dist/{scheduler-BFM3EINS.js.map → scheduler-DSAOMV4O.js.map} +0 -0
- /package/dist/{seat-7WM7II2B.js.map → seat-FZRNRAHQ.js.map} +0 -0
- /package/dist/{select-X4KVMOP5.js.map → select-SOJYFAMI.js.map} +0 -0
- /package/dist/{wiki-2AUFSIKO.js.map → wiki-34XVI32N.js.map} +0 -0
- /package/dist/{workspace-setup-B3F3TUDE.js.map → workspace-setup-G6KGWPHY.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agents/request-planner.ts"],"sourcesContent":["import { askSeat } from '@/decisions/seat'\nimport { noul } from '@/decisions/questions'\nimport type { NoulAnswer, Questions } from '@/decisions/types'\nimport type { ContextInput } from './context'\n\nexport const REQUEST_GATE_SEAT = 'request-gate'\nexport const REQUEST_CONTEXT_SEAT = 'request-context'\n\n// This gate decides whether typed preprocessing helps; it never answers the user.\nexport async function evaluateRequest(message: string, agent: string, channel: string) {\n const result = await askSeat(REQUEST_GATE_SEAT, {\n request: message.slice(0, 2000), agent, channel,\n operations: ['select optional context', 'evaluate model routing where permitted'],\n constraints: ['Keep the original request and mandatory instructions', 'Desktop model cannot be downgraded'],\n }, { preprocess: noul('This request benefits from structured context selection or another bounded typed decision before the main agent executes.', {\n true: 'Relevant context must be selected, or a bounded routing decision can help. Follow-ups and ambiguous references need context.',\n false: 'Typed preprocessing adds no useful decision; send the request to the configured main agent with existing context.',\n }) }, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { active: false, preprocess: false }\n const p = (result.answers.preprocess as NoulAnswer)?.noul\n return { active: true, preprocess: Number.isFinite(p) && p >= 0.5 }\n}\n\n// Only optional, application-assembled knowledge is selectable. Identity,\n// permissions, runbooks, skills, request, attachments and same-chat continuity\n// stay outside this allowlist. Native CLI history remains owned by the CLI.\nconst OPTIONAL_CONTEXT = {\n landscape: 'Agent directory and mesh overview',\n patternContext: 'Learned behavioral patterns',\n references: 'Retrieved project references',\n memoryContext: 'Retrieved agent memory',\n crossChatContext: 'Summaries from other conversations',\n longMemoryRecall: 'Older conversation recall',\n wikiContext: 'Retrieved wiki knowledge',\n} as const\n\nexport async function selectRequestContext(input: ContextInput): Promise<{ input: ContextInput; excluded: string[] }> {\n const blocks = Object.entries(OPTIONAL_CONTEXT).flatMap(([id, description]) => {\n const content = input[id as keyof typeof OPTIONAL_CONTEXT]\n return content ? [{ id, description, source: id, characters: content.length, preview: content.slice(0, 400), trust: 'context data, not instructions' }] : []\n })\n if (!blocks.length) return { input, excluded: [] }\n const questions: Questions = Object.fromEntries(blocks.map(block => [block.id, noul(\n `Context block ${block.id} is relevant to completing the current request correctly.`,\n { true: 'Needed or potentially relevant; retain if uncertain or the preview is incomplete.', false: 'Clearly unrelated to the current request; safe to omit.' },\n )]))\n const result = await askSeat(REQUEST_CONTEXT_SEAT, {\n request: input.message.slice(0, 2000), channel: input.channel, agent: input.agentId,\n mandatory: ['request', 'identity', 'permissions and instructions', 'same-chat history', 'handover', 'attachments'],\n context: blocks,\n }, questions, { timeoutMs: 3000 })\n if (!result || result.mode !== 'active') return { input, excluded: [] }\n const selected = { ...input }\n const excluded: string[] = []\n for (const block of blocks) {\n const p = (result.answers[block.id] as NoulAnswer)?.noul\n // Malformed or uncertain answers preserve context, never silently erase it.\n if (Number.isFinite(p) && p >= 0 && p < 0.2) {\n delete selected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AO,IAAIK,GAAS,CAACA,EAAM,GAAIV,EAC7E,iBAAiBU,EAAM,8DACvB,CAAE,KAAM,oFAAqF,MAAO,yDAA0D,CAChK,CAAC,CAAC,CAAC,EACGZ,EAAS,MAAMC,EAAQN,EAAsB,CACjD,QAASW,EAAM,QAAQ,MAAM,EAAG,GAAI,EAAG,QAASA,EAAM,QAAS,MAAOA,EAAM,QAC5E,UAAW,CAAC,UAAW,WAAY,+BAAgC,oBAAqB,WAAY,aAAa,EACjH,QAASC,CACX,EAAGI,EAAW,CAAE,UAAW,GAAK,CAAC,EACjC,GAAI,CAACX,GAAUA,EAAO,OAAS,SAAU,MAAO,CAAE,MAAAM,EAAO,SAAU,CAAC,CAAE,EACtE,IAAMO,EAAW,CAAE,GAAGP,CAAM,EACtBQ,EAAqB,CAAC,EAC5B,QAAWF,KAASL,EAAQ,CAC1B,IAAMJ,EAAKH,EAAO,QAAQY,EAAM,EAAE,GAAkB,KAEhD,OAAO,SAAST,CAAC,GAAKA,GAAK,GAAKA,EAAI,KACtC,OAAOU,EAASD,EAAM,EAAmC,EACzDE,EAAS,KAAKF,EAAM,EAAE,GAG1B,MAAO,CAAE,MAAOC,EAAU,SAAAC,CAAS,CACrC","names":["init_seat","init_questions","REQUEST_GATE_SEAT","REQUEST_CONTEXT_SEAT","evaluateRequest","message","agent","channel","result","askSeat","noul","p","OPTIONAL_CONTEXT","selectRequestContext","input","blocks","id","description","content","questions","block","selected","excluded"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b}from"./chunk-
|
|
1
|
+
import{b}from"./chunk-EL3J74N2.js";import"./chunk-4BR7D2OU.js";import"./chunk-EVWEG3VD.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";import{createHash as A}from"crypto";var v="review:",I={decisions:"project",warnings:"feedback",friction:"feedback",context:"reference"};function E(t,n,r){let s=A("sha1").update(r.trim().toLowerCase()).digest("hex").slice(0,10);return`${v}${t}/${n}@${s}`}function F(t){if(!t.startsWith(v))return null;let n=t.slice(v.length),r=n.lastIndexOf("@"),s=n.lastIndexOf("/",r===-1?void 0:r);return r===-1||s===-1?null:{reviewId:n.slice(0,s),kind:n.slice(s+1,r),digest:n.slice(r+1)}}var C=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,48)||"finding";function L(t,n){return`${t}|${b(n)}`}function K(t,n={}){let r=n.kinds??Object.keys(I),s=n.minLength??24,h=[],d=new Map,u=new Map,f=new Map,x=new Map;for(let e of t){let i;try{i=JSON.parse(e.result)}catch{continue}let o=e.updated_at?new Date(e.updated_at).toISOString():new Date().toISOString();for(let c of r){let l=I[c];if(!l)continue;let R=i[c];if(Array.isArray(R))for(let $ of R){let a=String($?.text??"").trim();if(a.length<s)continue;let g=E(e.id,c,a),O=g.slice(g.lastIndexOf("@")),w=`${c}${O}`,y=L(c,a),k=f.get(y)??new Set;if(k.add(e.session_id??e.id),f.set(y,k),d.has(w))continue;let _=String($?.evidence??"").trim(),S={occurrences:1,agentId:e.agent,key:`${e.agent}/${l}_${C(a)}`,stamp:g,memory:{name:C(a),type:l,description:a.slice(0,200),body:"",createdAt:o,updatedAt:o}};x.set(g,{text:a,evidence:_,agent:e.agent,source:e.source}),d.set(w,S),u.set(w,y),h.push(S)}}}for(let[e,i]of d){i.occurrences=f.get(u.get(e)??"")?.size??1;let o=x.get(i.stamp);i.memory.body=T(o,i.occurrences)}let m=new Map;for(let[e,i]of d){let o=u.get(e)??e,c=m.get(o)??[];c.push(i),m.set(o,c)}let M=[...m.values()].sort((e,i)=>i[0].occurrences-e[0].occurrences),p=[];for(let e=0;p.length<h.length;e++){let i=!1;for(let o of M)e<o.length&&(p.push(o[e]),i=!0);if(!i)break}return p}function T(t,n){let r=`${t.agent}${t.source?` via ${t.source}`:""}`,s=[];return n>1?(s.push(`Observed in ${n} separate sessions. Most recently stated as:`),s.push(`> ${t.text}`),s.push(`Recurring across ${n} sessions is what makes this worth recording \u2014 any single occurrence is session state, the repetition is the finding.`)):s.push(t.text),t.evidence&&s.push(`**Evidence:** ${t.evidence}`),s.push(`_From ${n>1?"session reviews":"a session review"} of ${r}._`),s.join(`
|
|
2
2
|
|
|
3
3
|
`)}export{I as PROMOTABLE_KINDS,v as REVIEW_STAMP_PREFIX,F as parseReviewStamp,E as reviewStamp,K as reviewsToCandidates};
|
|
4
|
-
//# sourceMappingURL=review-candidates-
|
|
4
|
+
//# sourceMappingURL=review-candidates-O2PS7L3B.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b}from"./chunk-GK7XAM3D.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{a as cheapModelForEngine,b as routeTaskModel};
|
|
2
|
+
//# sourceMappingURL=routing-5K7PGHPL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g as a,h as b}from"./chunk-4KXBUORV.js";import"./chunk-SC5DIKBB.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-FIOB3MEX.js";export{b as CronScheduler,a as getNextCronDate};
|
|
2
|
+
//# sourceMappingURL=scheduler-DSAOMV4O.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as a,p as b,q as c,r as d,s as e,t as f,u as g,v as h,w as i}from"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";i();export{h as askSeat,a as configureDecisions,c as decisionsRuntime,f as getSeatMode,d as parseSeatMode,g as recordSeatOutcome,b as resetDecisionsRuntime,e as seatEnvVar};
|
|
2
|
+
//# sourceMappingURL=seat-FZRNRAHQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{v as S,w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=select-
|
|
1
|
+
import{v as S,w}from"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import{a as g,b as h,f as R}from"./chunk-F4HZTZHW.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import{d as f}from"./chunk-VDMYBPYB.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";w();R();var p="skill-select";function y(l){return{task:d(l.task,1200),...l.agent?{agent:l.agent}:{},skills:l.candidates.map(t=>({name:t.name,purpose:d(t.description,300),...t.category?{category:t.category}:{},...t.tags?.length?{tags:t.tags.slice(0,8)}:{}}))}}function b(l){let t={};for(let i of l)t[i.name]=d(i.description,300);return{anyRelevant:g("At least one of these skills is about the task at hand.",{true:"The task is the kind of work one of these skills exists for, and following it would change how the work is done \u2014 it names the same system, the same procedure or the same kind of artefact.",false:"None of them is about this task. They may share vocabulary with it, mention the same tools, or belong to the same project without bearing on what is being asked. Sharing words with a task is not being about it."}),best:h(t,"Which skill is this task most about?")}}function v(l){let t=l.anyRelevant,i=l.best,o=Object.entries(i.probabilities??{}).map(([e,s])=>({name:e,p:Number(s)||0})).sort((e,s)=>s.p-e.p);return{anyRelevant:t.noul,name:i.choice,confidence:i.confidence,ranked:o}}function d(l,t){return l.length>t?`${l.slice(0,t)}\u2026`:l}var x=.1,A=12;async function E(l,t,i={}){let o=i.minRelevant??.6,e=f(l,t).filter(n=>n.relevance>=x).slice(0,A),s=e.map(n=>({name:n.skill.frontmatter.name,lexical:n.relevance}));if(e.length===0)return{skill:null,anyRelevant:0,confidence:0,shortlist:s,judged:!1,reason:"no skill mentions anything in this task"};if(e.length===1)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`only ${e[0].skill.frontmatter.name} matched (${e[0].matchReason})`};let r=e.map(n=>({name:n.skill.frontmatter.name,description:n.skill.frontmatter.description,category:n.skill.frontmatter.category??null,tags:n.skill.frontmatter.tags})),m=await S(p,y({task:t,agent:i.agent??null,candidates:r}),b(r),{incumbent:{best:r[0].name},features:{agent:i.agent??"unknown",candidates:r.length}});if(!m)return{skill:e[0].skill,anyRelevant:e[0].relevance,confidence:e[0].relevance,shortlist:s,judged:!1,reason:`seat off \u2014 lexical top match (${e[0].matchReason})`};let a=v(m.answers),c=s.map(n=>({...n,p:a.ranked.find(k=>k.name===n.name)?.p??0})).sort((n,k)=>(k.p??0)-(n.p??0));if(a.anyRelevant<o)return{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`nothing on the shortlist is about this task (${a.anyRelevant.toFixed(2)} below ${o})`};let u=e.find(n=>n.skill.frontmatter.name===a.name);return u?{skill:u.skill,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`${a.name} (confidence ${a.confidence.toFixed(2)})`}:{skill:null,anyRelevant:a.anyRelevant,confidence:a.confidence,shortlist:c,judged:!0,reason:`seat chose "${a.name}", which was not on the shortlist`}}export{E as pickSkillForTask};
|
|
2
|
+
//# sourceMappingURL=select-SOJYFAMI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./chunk-VWTBHLMX.js";import{e as a,f as b}from"./chunk-AUNDQPDR.js";import"./chunk-PNWNVOEZ.js";import"./chunk-64P4QHSZ.js";import{a as c}from"./chunk-V4HURNMX.js";import"./chunk-AJ5RMU7X.js";import"./chunk-EVWEG3VD.js";import"./chunk-MGNJWBVP.js";import"./chunk-ZTEU5JVQ.js";import"./chunk-AJONZWLT.js";import"./chunk-F4HZTZHW.js";import"./chunk-QOYAX2FT.js";import"./chunk-LCIREYTD.js";import"./chunk-L2WSPY6S.js";import"./chunk-GMNKJXTR.js";import"./chunk-BH3GTCZ6.js";import"./chunk-FIOB3MEX.js";export{b as WikiHub,a as WikiStore,c as agenticQuery};
|
|
2
|
+
//# sourceMappingURL=wiki-34XVI32N.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentix-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "AI operations layer for small and medium businesses. Routes Telegram, WhatsApp, GitLab, GitHub, crons, webhooks, and mesh tasks to AI agents. Web wizard for operators, CLI for engineers. Self-hosted.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
package/dist/chunk-67Q4DCPS.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import{execFile as m}from"child_process";import{existsSync as d}from"fs";import{resolve as f}from"path";var R=["mcp__codegraph__codegraph_search","mcp__codegraph__codegraph_context","mcp__codegraph__codegraph_callers","mcp__codegraph__codegraph_callees","mcp__codegraph__codegraph_impact","mcp__codegraph__codegraph_node","mcp__codegraph__codegraph_status","mcp__codegraph__codegraph_files"],p={command:"codegraph",args:["serve","--mcp"]};function O(){return["## CodeGraph","","This workspace has CodeGraph initialized \u2014 a semantic code-knowledge-graph indexed via tree-sitter. Use it instead of grep/find/Read for exploration.","","**ALWAYS spawn an Explore subagent for `codegraph_explore` / `codegraph_context`** \u2014 those tools return large source sections that would otherwise bloat the main session. Include this in the Explore prompt:","","> Use `codegraph_explore` as your PRIMARY tool \u2014 one call returns full source from all relevant files. Do not re-Read files codegraph_explore already returned. Fall back to grep/glob/Read only if codegraph returned no results.","","**In the main session, use these lightweight codegraph tools directly:**","","| Tool | Use for |","|---|---|","| `codegraph_search` | Find symbols by name across the codebase |","| `codegraph_callers` / `codegraph_callees` | Trace call flow |","| `codegraph_impact` | Check what's affected before editing a symbol |","| `codegraph_node` | Get a single symbol's details |","| `codegraph_files` | Indexed file structure (faster than ls) |","| `codegraph_status` | Index health |",""].join(`
|
|
2
|
-
`)}function P(e){let t=e.mcp??{};return!e.codegraph||t.codegraph?t:{...t,codegraph:{command:p.command,args:[...p.args]}}}var _=".codegraph",x=10*60*1e3,g=2;function y(e){let t=Date.now();return new Promise((r,n)=>{m("codegraph",["init","--index","--quiet",e],{timeout:x,maxBuffer:4*1024*1024},o=>{o?n(o):r(Date.now()-t)})})}async function k(e,t=console.error){let r=[];for(let[i,s]of Object.entries(e))s.codegraph&&(s.tier!=="claude-code"&&s.tier!=="codex-cli"||d(s.workspace)&&(d(f(s.workspace,_))||r.push({agentId:i,workspace:s.workspace})));if(r.length===0)return;t(`codegraph: indexing ${r.length} workspace(s) in background (max ${g} parallel)`);let n=0,o=[];for(let i=0;i<Math.min(g,r.length);i++)o.push((async()=>{for(;;){let s=n++;if(s>=r.length)return;let{agentId:c,workspace:h}=r[s];try{let a=await y(h);t(` codegraph: indexed ${c} in ${(a/1e3).toFixed(1)}s`)}catch(a){let u=a?.code==="ENOENT"?" (codegraph CLI not on PATH; install with `npm i -g @colbymchenry/codegraph`)":"";t(` codegraph: ${c} index failed: ${a?.message??a}${u}`)}}})());await Promise.allSettled(o)}import{readFileSync as S,existsSync as b,unlinkSync as w,readdirSync as v}from"fs";import{resolve as l}from"path";function L(e,t){let r={},n=o=>{let i=l(e,o);if(b(i))try{return S(i,"utf-8").trim()||void 0}catch{return}};if(t){let o=n(`SOUL.${t}.md`);o?(r.soul=o,r.soulProfile=t):r.soul=n("SOUL.md")}else r.soul=n("SOUL.md");if(r.identity=n("IDENTITY.md"),r.user=n("USER.md"),r.agents=n("AGENTS.md"),r.bootstrap=n("BOOTSTRAP.md"),r.bootstrap)try{w(l(e,"BOOTSTRAP.md"))}catch{}return r}function D(e){let t=[];return e.identity&&t.push(`[Identity]
|
|
3
|
-
${e.identity}`),e.soul&&t.push(`[Personality & Boundaries]
|
|
4
|
-
${e.soul}`),e.user&&t.push(`[User Profile]
|
|
5
|
-
${e.user}`),e.bootstrap&&t.push(`[First-Run Instructions \u2014 one time only]
|
|
6
|
-
${e.bootstrap}`),t.length===0?"":t.join(`
|
|
7
|
-
|
|
8
|
-
`)}function F(e){return`# ${e.name}
|
|
9
|
-
|
|
10
|
-
> Agent ID: \`${e.id}\` | Tier: ${e.tier||"claude-code"}
|
|
11
|
-
|
|
12
|
-
## Role
|
|
13
|
-
|
|
14
|
-
${e.role||"AI agent managed by AgentX orchestrator."}
|
|
15
|
-
|
|
16
|
-
## Setup
|
|
17
|
-
|
|
18
|
-
This workspace is managed by AgentX. The agent runs via:
|
|
19
|
-
\`\`\`bash
|
|
20
|
-
# Direct execution
|
|
21
|
-
agentx daemon send ${e.id} "your task here"
|
|
22
|
-
|
|
23
|
-
# Or via any connected channel (Telegram, WhatsApp, GitLab)
|
|
24
|
-
\`\`\`
|
|
25
|
-
|
|
26
|
-
## Code Style
|
|
27
|
-
|
|
28
|
-
- Follow existing patterns in the codebase
|
|
29
|
-
- Use the language and framework conventions already present
|
|
30
|
-
- Keep changes minimal and focused
|
|
31
|
-
|
|
32
|
-
## Testing
|
|
33
|
-
|
|
34
|
-
Run tests before committing:
|
|
35
|
-
\`\`\`bash
|
|
36
|
-
npm test # or the project's test command
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
## PR Guidelines
|
|
40
|
-
|
|
41
|
-
- One logical change per commit
|
|
42
|
-
- Reference issue numbers when applicable
|
|
43
|
-
- Keep PR descriptions concise
|
|
44
|
-
|
|
45
|
-
## AgentX Integration
|
|
46
|
-
|
|
47
|
-
This agent is part of an AgentX mesh. It can:
|
|
48
|
-
- Receive tasks from messaging channels (Telegram, WhatsApp, Discord)
|
|
49
|
-
- Respond to GitLab @mentions on issues and MRs
|
|
50
|
-
- Delegate to other agents by mentioning their handles
|
|
51
|
-
- Send cross-channel messages via the /send API
|
|
52
|
-
- Access its wiki knowledge base for context
|
|
53
|
-
`}function U(e){let t=e.match(/\/soul\s+(\w+)/i);return t?t[1].toLowerCase():/\/soul\s*$/i.test(e)?"default":null}export{R as a,O as b,P as c,k as d,L as e,D as f,F as g,U as h};
|
|
54
|
-
//# sourceMappingURL=chunk-67Q4DCPS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/agents/codegraph-bootstrap.ts","../src/agents/bootstrap.ts"],"sourcesContent":["import { execFile } from \"child_process\"\nimport { existsSync } from \"fs\"\nimport { resolve } from \"path\"\nimport type { AgentDef } from \"@/daemon/config\"\nimport type { McpServerMap } from \"./agent-mcp\"\n\n// --- CodeGraph integration: per-agent semantic code-graph index ---\n//\n// CodeGraph (https://github.com/colbymchenry/codegraph) is a local\n// tree-sitter → SQLite knowledge graph exposed to Claude Code / Codex via\n// MCP. Opt-in per agent with `codegraph: true` on the agent's config.\n//\n// This module owns three responsibilities:\n// 1. `effectiveMcpConfig(def)` — synthesize the codegraph MCP server\n// entry into the agent's MCP map. Used by the daemon's\n// installAgentMcpConfig pass so the workspace's .mcp.json picks\n// up `codegraph serve --mcp` automatically.\n// 2. `bootstrapCodegraphIndexes(agents, log)` — at daemon boot, fire\n// off `codegraph init --index --quiet` in the background for any\n// opted-in workspace whose `.codegraph/` is missing. Throttled to\n// 2 parallel jobs so a large fleet doesn't thrash the host.\n// Returns immediately; the indexes finish on their own.\n// 3. Export the constant tool/CLI names that workspace-setup needs\n// to keep CLAUDE.md and settings.json in sync.\n\n/** MCP tool names exposed by `codegraph serve --mcp`. Used to extend the\n * per-workspace `.claude/settings.json` permissions.allow so claude\n * doesn't prompt for permission on every call. Keep in sync with the\n * upstream tool surface — additions are harmless, removals leave a\n * stale allow entry (also harmless). */\nexport const CODEGRAPH_TOOLS = [\n \"mcp__codegraph__codegraph_search\",\n \"mcp__codegraph__codegraph_context\",\n \"mcp__codegraph__codegraph_callers\",\n \"mcp__codegraph__codegraph_callees\",\n \"mcp__codegraph__codegraph_impact\",\n \"mcp__codegraph__codegraph_node\",\n \"mcp__codegraph__codegraph_status\",\n \"mcp__codegraph__codegraph_files\",\n] as const\n\n/** MCP server stanza we inject into `.mcp.json` for opted-in agents. */\nexport const CODEGRAPH_MCP_SERVER: { command: string; args: string[] } = {\n command: \"codegraph\",\n args: [\"serve\", \"--mcp\"],\n}\n\n/** Markdown block appended to managed CLAUDE.md when codegraph is on.\n * Tells the agent to prefer codegraph_* over grep, and to always spawn\n * an Explore subagent for codegraph_explore so the large source-dump\n * doesn't bloat the main session context. Mirrors the upstream-\n * recommended wording from the README's \"Global Instructions\" block. */\nexport function codegraphClaudeMdSection(): string {\n return [\n \"## CodeGraph\",\n \"\",\n \"This workspace has CodeGraph initialized — a semantic code-knowledge-graph indexed via tree-sitter. Use it instead of grep/find/Read for exploration.\",\n \"\",\n \"**ALWAYS spawn an Explore subagent for `codegraph_explore` / `codegraph_context`** — those tools return large source sections that would otherwise bloat the main session. Include this in the Explore prompt:\",\n \"\",\n \"> Use `codegraph_explore` as your PRIMARY tool — one call returns full source from all relevant files. Do not re-Read files codegraph_explore already returned. Fall back to grep/glob/Read only if codegraph returned no results.\",\n \"\",\n \"**In the main session, use these lightweight codegraph tools directly:**\",\n \"\",\n \"| Tool | Use for |\",\n \"|---|---|\",\n \"| `codegraph_search` | Find symbols by name across the codebase |\",\n \"| `codegraph_callers` / `codegraph_callees` | Trace call flow |\",\n \"| `codegraph_impact` | Check what's affected before editing a symbol |\",\n \"| `codegraph_node` | Get a single symbol's details |\",\n \"| `codegraph_files` | Indexed file structure (faster than ls) |\",\n \"| `codegraph_status` | Index health |\",\n \"\",\n ].join(\"\\n\")\n}\n\n/** Return the MCP server map an agent should expose to .mcp.json,\n * layering codegraph on top of the operator-declared `def.mcp` when\n * `def.codegraph === true`. Operator-declared entries win on key\n * collision (operator can override by declaring their own\n * `mcp.codegraph` block with different args). */\nexport function effectiveMcpConfig(def: AgentDef): McpServerMap {\n const base: McpServerMap = ((def as any).mcp ?? {}) as McpServerMap\n if (!def.codegraph) return base\n if (base.codegraph) return base\n return { ...base, codegraph: { command: CODEGRAPH_MCP_SERVER.command, args: [...CODEGRAPH_MCP_SERVER.args] } }\n}\n\nconst INDEX_DIR = \".codegraph\"\nconst INIT_TIMEOUT_MS = 10 * 60 * 1000 // 10 min — Swift Compiler benchmark indexed 25k files in ~4 min\nconst MAX_PARALLEL = 2\n\n/** Spawn `codegraph init --index --quiet` for one workspace. Returns the\n * duration in ms on success, throws on failure. Caller decides whether\n * to surface the error. */\nfunction indexWorkspace(workspace: string): Promise<number> {\n const started = Date.now()\n return new Promise<number>((res, rej) => {\n execFile(\n \"codegraph\",\n [\"init\", \"--index\", \"--quiet\", workspace],\n { timeout: INIT_TIMEOUT_MS, maxBuffer: 4 * 1024 * 1024 },\n (err) => {\n if (err) rej(err)\n else res(Date.now() - started)\n },\n )\n })\n}\n\n/** Boot-time helper: kick off `codegraph init --index` for every\n * opted-in workspace whose `.codegraph/` is missing. Fire-and-forget —\n * the returned promise resolves once all background jobs settle, but\n * callers (daemon start) don't need to await it. Indexing happens\n * while the daemon is already serving traffic; cold dispatches before\n * the index lands gracefully fall through to grep (the MCP server\n * returns an empty result, and CLAUDE.md tells the agent to fall back).\n *\n * Throttled to MAX_PARALLEL concurrent jobs so a fleet boot doesn't\n * saturate CPU/disk. */\nexport async function bootstrapCodegraphIndexes(\n agents: Record<string, AgentDef>,\n log: (...args: unknown[]) => void = console.error,\n): Promise<void> {\n const pending: Array<{ agentId: string; workspace: string }> = []\n for (const [agentId, def] of Object.entries(agents)) {\n if (!def.codegraph) continue\n if (def.tier !== \"claude-code\" && def.tier !== \"codex-cli\") continue\n if (!existsSync(def.workspace)) continue\n if (existsSync(resolve(def.workspace, INDEX_DIR))) continue\n pending.push({ agentId, workspace: def.workspace })\n }\n\n if (pending.length === 0) return\n\n log(`codegraph: indexing ${pending.length} workspace(s) in background (max ${MAX_PARALLEL} parallel)`)\n\n let i = 0\n const runners: Promise<void>[] = []\n for (let slot = 0; slot < Math.min(MAX_PARALLEL, pending.length); slot++) {\n runners.push((async () => {\n while (true) {\n const idx = i++\n if (idx >= pending.length) return\n const { agentId, workspace } = pending[idx]\n try {\n const ms = await indexWorkspace(workspace)\n log(` codegraph: indexed ${agentId} in ${(ms / 1000).toFixed(1)}s`)\n } catch (err: any) {\n // codegraph binary missing surfaces as ENOENT — recoverable hint\n const hint = err?.code === \"ENOENT\"\n ? \" (codegraph CLI not on PATH; install with `npm i -g @colbymchenry/codegraph`)\"\n : \"\"\n log(` codegraph: ${agentId} index failed: ${err?.message ?? err}${hint}`)\n }\n }\n })())\n }\n await Promise.allSettled(runners)\n}\n","import { readFileSync, existsSync, unlinkSync, readdirSync } from \"fs\"\nimport { resolve } from \"path\"\n\n// --- Bootstrap Identity Files ---\n//\n// Support for structured workspace identity files (inspired by OpenClaw).\n// These files live in the agent's workspace and are auto-loaded into context.\n//\n// Supported files:\n// SOUL.md — default personality, tone, boundaries\n// SOUL.{profile}.md — named soul profiles (e.g. SOUL.finance.md, SOUL.legal.md)\n// IDENTITY.md — name, role, emoji, tagline (persistent)\n// USER.md — user profile, preferences (persistent)\n// AGENTS.md — operating rules, standing orders (persistent)\n// BOOTSTRAP.md — one-time first-run ritual (auto-deleted after first load)\n//\n// Soul switching: send \"/soul finance\" to swap to SOUL.finance.md mid-session.\n\nexport interface BootstrapFiles {\n soul?: string\n /** Active soul profile name (undefined = default SOUL.md) */\n soulProfile?: string\n identity?: string\n user?: string\n agents?: string\n bootstrap?: string\n}\n\nconst BOOTSTRAP_FILE_NAMES = [\n \"SOUL.md\",\n \"IDENTITY.md\",\n \"USER.md\",\n \"AGENTS.md\",\n \"BOOTSTRAP.md\",\n] as const\n\n/**\n * Load bootstrap identity files from an agent's workspace.\n * @param soulProfile — optional soul profile name (e.g. \"finance\" loads SOUL.finance.md)\n */\nexport function loadBootstrapFiles(workspace: string, soulProfile?: string): BootstrapFiles {\n const result: BootstrapFiles = {}\n\n const tryLoad = (filename: string): string | undefined => {\n const filePath = resolve(workspace, filename)\n if (!existsSync(filePath)) return undefined\n try {\n const content = readFileSync(filePath, \"utf-8\").trim()\n return content || undefined\n } catch {\n return undefined\n }\n }\n\n // Load soul: profile-specific if requested, fallback to default\n if (soulProfile) {\n const profileSoul = tryLoad(`SOUL.${soulProfile}.md`)\n if (profileSoul) {\n result.soul = profileSoul\n result.soulProfile = soulProfile\n } else {\n // Profile not found — fall back to default and note it\n result.soul = tryLoad(\"SOUL.md\")\n }\n } else {\n result.soul = tryLoad(\"SOUL.md\")\n }\n\n result.identity = tryLoad(\"IDENTITY.md\")\n result.user = tryLoad(\"USER.md\")\n result.agents = tryLoad(\"AGENTS.md\")\n result.bootstrap = tryLoad(\"BOOTSTRAP.md\")\n\n // BOOTSTRAP.md is one-time: delete after loading\n if (result.bootstrap) {\n try {\n unlinkSync(resolve(workspace, \"BOOTSTRAP.md\"))\n } catch {\n // Best-effort deletion\n }\n }\n\n return result\n}\n\n/**\n * Build context string from bootstrap files.\n * Returns empty string if no files found.\n */\nexport function buildBootstrapContext(files: BootstrapFiles): string {\n const sections: string[] = []\n\n if (files.identity) {\n sections.push(`[Identity]\\n${files.identity}`)\n }\n\n if (files.soul) {\n sections.push(`[Personality & Boundaries]\\n${files.soul}`)\n }\n\n // AGENTS.md is intentionally NOT injected into AgentX's --append-system-prompt\n // anymore. It's loaded natively by Claude Code via `@AGENTS.md` in the\n // workspace's CLAUDE.md (generated by workspace-setup.ts for new workspaces;\n // added to existing workspaces by the 2026-04-24 distribution). Injecting it\n // here on top of the native CLAUDE.md path would double the bytes. Keeping\n // the load in BootstrapFiles for diagnostic/listing purposes only.\n\n if (files.user) {\n sections.push(`[User Profile]\\n${files.user}`)\n }\n\n if (files.bootstrap) {\n sections.push(`[First-Run Instructions — one time only]\\n${files.bootstrap}`)\n }\n\n if (sections.length === 0) return \"\"\n\n return sections.join(\"\\n\\n\")\n}\n\n/**\n * Check which bootstrap files exist in a workspace (for status/diagnostics).\n */\nexport function listBootstrapFiles(workspace: string): string[] {\n return BOOTSTRAP_FILE_NAMES.filter((name) =>\n existsSync(resolve(workspace, name))\n )\n}\n\n/**\n * List available soul profiles in a workspace.\n * Returns profile names (e.g. [\"finance\", \"legal\", \"creative\"]).\n */\nexport function listSoulProfiles(workspace: string): string[] {\n try {\n return readdirSync(workspace)\n .filter(f => f.startsWith(\"SOUL.\") && f.endsWith(\".md\") && f !== \"SOUL.md\")\n .map(f => f.slice(5, -3)) // \"SOUL.finance.md\" → \"finance\"\n } catch {\n return []\n }\n}\n\n/**\n * Generate a standard AGENTS.md for a new agent workspace.\n * Follows the agents.md community convention (https://agents.md/).\n * Readable by Claude Code, Codex, Cursor, Amp, Gemini CLI, etc.\n */\nexport function generateAgentsMd(agent: {\n name: string\n id: string\n role?: string\n workspace: string\n tier?: string\n}): string {\n return `# ${agent.name}\n\n> Agent ID: \\`${agent.id}\\` | Tier: ${agent.tier || \"claude-code\"}\n\n## Role\n\n${agent.role || \"AI agent managed by AgentX orchestrator.\"}\n\n## Setup\n\nThis workspace is managed by AgentX. The agent runs via:\n\\`\\`\\`bash\n# Direct execution\nagentx daemon send ${agent.id} \"your task here\"\n\n# Or via any connected channel (Telegram, WhatsApp, GitLab)\n\\`\\`\\`\n\n## Code Style\n\n- Follow existing patterns in the codebase\n- Use the language and framework conventions already present\n- Keep changes minimal and focused\n\n## Testing\n\nRun tests before committing:\n\\`\\`\\`bash\nnpm test # or the project's test command\n\\`\\`\\`\n\n## PR Guidelines\n\n- One logical change per commit\n- Reference issue numbers when applicable\n- Keep PR descriptions concise\n\n## AgentX Integration\n\nThis agent is part of an AgentX mesh. It can:\n- Receive tasks from messaging channels (Telegram, WhatsApp, Discord)\n- Respond to GitLab @mentions on issues and MRs\n- Delegate to other agents by mentioning their handles\n- Send cross-channel messages via the /send API\n- Access its wiki knowledge base for context\n`\n}\n\n/**\n * Detect a /soul command in a message.\n * Returns the requested profile name, or null if no /soul command found.\n * \"/soul finance\" → \"finance\"\n * \"/soul\" or \"/soul default\" → \"default\" (reset to SOUL.md)\n */\nexport function detectSoulSwitch(message: string): string | null {\n const match = message.match(/\\/soul\\s+(\\w+)/i)\n if (match) return match[1].toLowerCase()\n if (/\\/soul\\s*$/i.test(message)) return \"default\"\n return null\n}\n"],"mappings":"AAAA,OAAS,YAAAA,MAAgB,gBACzB,OAAS,cAAAC,MAAkB,KAC3B,OAAS,WAAAC,MAAe,OA4BjB,IAAMC,EAAkB,CAC7B,mCACA,oCACA,oCACA,oCACA,mCACA,iCACA,mCACA,iCACF,EAGaC,EAA4D,CACvE,QAAS,YACT,KAAM,CAAC,QAAS,OAAO,CACzB,EAOO,SAASC,GAAmC,CACjD,MAAO,CACL,eACA,GACA,6JACA,GACA,sNACA,GACA,0OACA,GACA,2EACA,GACA,qBACA,YACA,oEACA,kEACA,yEACA,uDACA,kEACA,wCACA,EACF,EAAE,KAAK;AAAA,CAAI,CACb,CAOO,SAASC,EAAmBC,EAA6B,CAC9D,IAAMC,EAAuBD,EAAY,KAAO,CAAC,EAEjD,MADI,CAACA,EAAI,WACLC,EAAK,UAAkBA,EACpB,CAAE,GAAGA,EAAM,UAAW,CAAE,QAASJ,EAAqB,QAAS,KAAM,CAAC,GAAGA,EAAqB,IAAI,CAAE,CAAE,CAC/G,CAEA,IAAMK,EAAY,aACZC,EAAkB,GAAK,GAAK,IAC5BC,EAAe,EAKrB,SAASC,EAAeC,EAAoC,CAC1D,IAAMC,EAAU,KAAK,IAAI,EACzB,OAAO,IAAI,QAAgB,CAACC,EAAKC,IAAQ,CACvChB,EACE,YACA,CAAC,OAAQ,UAAW,UAAWa,CAAS,EACxC,CAAE,QAASH,EAAiB,UAAW,EAAI,KAAO,IAAK,EACtDO,GAAQ,CACHA,EAAKD,EAAIC,CAAG,EACXF,EAAI,KAAK,IAAI,EAAID,CAAO,CAC/B,CACF,CACF,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAiC3B,CAQO,SAASC,EAAiBC,EAAgC,CAC/D,IAAMC,EAAQD,EAAQ,MAAM,iBAAiB,EAC7C,OAAIC,EAAcA,EAAM,CAAC,EAAE,YAAY,EACnC,cAAc,KAAKD,CAAO,EAAU,UACjC,IACT","names":["execFile","existsSync","resolve","CODEGRAPH_TOOLS","CODEGRAPH_MCP_SERVER","codegraphClaudeMdSection","effectiveMcpConfig","def","base","INDEX_DIR","INIT_TIMEOUT_MS","MAX_PARALLEL","indexWorkspace","workspace","started","res","rej","err","bootstrapCodegraphIndexes","agents","log","pending","agentId","i","runners","slot","idx","ms","hint","readFileSync","existsSync","unlinkSync","readdirSync","resolve","loadBootstrapFiles","workspace","soulProfile","result","tryLoad","filename","filePath","resolve","existsSync","readFileSync","profileSoul","unlinkSync","buildBootstrapContext","files","sections","generateAgentsMd","agent","detectSoulSwitch","message","match"]}
|