@polycode-projects/the-mechanical-code-talker 5.0.26 → 5.0.28
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/corpus/worlds/index.json.gz +0 -0
- package/corpus/worlds/manifest.json +27 -17
- package/corpus/worlds/shards/river-crossing.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square-chapel.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square-market.jsonl.gz +0 -0
- package/corpus/worlds/shards/town-square.jsonl.gz +0 -0
- package/corpus/worlds/src/river-crossing.jsonl +29 -0
- package/corpus/worlds/src/town-square-chapel.jsonl +12 -8
- package/corpus/worlds/src/town-square-market.jsonl +12 -8
- package/corpus/worlds/src/town-square.jsonl +12 -8
- package/package.json +2 -1
- package/src/adapters/memory/inspect.mjs +37 -0
- package/src/domain/agent-traits.mjs +282 -0
- package/src/domain/ask.mjs +19 -6
- package/src/domain/choice-question.mjs +135 -6
- package/src/domain/codegraph.mjs +8 -1
- package/src/domain/el-classify.mjs +39 -7
- package/src/domain/fact-phrase.mjs +7 -4
- package/src/domain/interpret/normalize.mjs +58 -2
- package/src/domain/town-square-world.mjs +44 -19
- package/src/services/adventure.mjs +5 -16
- package/src/services/agent-editor.mjs +216 -0
- package/src/services/chat-session.mjs +26 -5
- package/src/services/chat.mjs +221 -58
- package/src/services/mudiii-scene.mjs +32 -5
- package/src/services/mudiii-turn.mjs +7 -3
- package/src/services/mudiii-viz.mjs +215 -1
- package/src/services/news-viz.mjs +489 -0
- package/src/services/predator-prey.mjs +157 -24
- package/src/surfaces/web/chat-browser-entry.mjs +69 -3
- package/src/surfaces/web/memory-ask-browser.bundle.js +155 -155
- package/src/surfaces/web/mudiii-browser-entry.mjs +35 -0
- package/src/surfaces/web/news-browser-entry.mjs +384 -0
- package/src/surfaces/web/turn-session.mjs +13 -9
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
(()=>{var Jx=Object.defineProperty;var C=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var qt=(e,t)=>{for(var n in t)Jx(e,n,{get:t[n],enumerable:!0})};var lt,e1,t1,n1,s1,o1,r1,i1,a1,c1,l1,u1,d1,p1,f1,h1,m1,Z,me,Ft,ul,Rf,g1,b1,w1,Ve=C(()=>{lt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},e1=lt("createRequire"),t1=lt("readFileSync"),n1=lt("access"),s1=lt("readFile"),o1=lt("writeFile"),r1=lt("appendFile"),i1=lt("mkdir"),a1=lt("mkdtemp"),c1=lt("rename"),l1=lt("unlink"),u1=lt("rm"),d1=lt("stat"),p1=lt("copyFile"),f1=lt("readdir"),h1=lt("createReadStream"),m1=lt("createWriteStream"),Z=(...e)=>e.join("/"),me=e=>String(e).replace(/\/[^/]*$/,""),Ft=(...e)=>e.join("/"),ul=e=>String(e).startsWith("/"),Rf="/",g1=lt("randomBytes"),b1=lt("spawnSync"),w1=lt("createInterface")});var ut,$1,v1,dl,Te,Tr,Qx,An,Zx,Mi,pl,eE,tE,x1,nE,E1,S1,k1,j1,R1,Tt=C(()=>{ut=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},$1=ut("createRequire"),v1=ut("readFileSync"),dl=ut("access"),Te=ut("readFile"),Tr=ut("writeFile"),Qx=ut("appendFile"),An=ut("mkdir"),Zx=ut("mkdtemp"),Mi=ut("rename"),pl=ut("unlink"),eE=ut("rm"),tE=ut("stat"),x1=ut("copyFile"),nE=ut("readdir"),E1=ut("createReadStream"),S1=ut("createWriteStream"),k1=ut("randomBytes"),j1=ut("spawnSync"),R1=ut("createInterface")});function Oo(e){let t=oE.exec(String(e||""));return t?t[1].toLowerCase():null}function Fi(e){return String(e||"").replace(rE,"$1")}function Es(e){return e.replace(iE,"").trim()}function on(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(cE,"").trim();if(s=s.replace(uE,"").trim(),s===t)break;t=s}return t}var _f,Ar,Js,Tf,Af,sE,oE,Ir,sn,fl,rE,xn,hl,iE,aE,cE,lE,uE,ue,Cr,Di,dE,If,He,rn,Ss,Cf,ml,gl,bl,Of,Or,Qs,Lf,Nf,Zs,Zn,es,Lo,et,Pf,eo,to,In,Cn,Mf,Lr,No,zi,Po,Ff,On=C(()=>{_f=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],Ar={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","lives in","live in","is defined in","are defined in","is part of","are part of","sits in","sit in","sits inside","sit inside","containing"]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",..._f]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},Js=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),Tf=Object.freeze(Object.fromEntries(Object.entries(Js).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Af=Object.freeze(Object.values(Js).map(e=>e.predicate)),sE=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),oE=new RegExp(`^mgx:[a-z]+-(${sE.join("|")})$`,"i");Ir=Object.freeze([..._f,"is the superclass of","are the superclass of","is the parent class of"]),sn=Object.freeze(["defined","declared","located","implemented"]),fl=Object.freeze(["now","currently","right now","at the moment","these days","today"]),rE=new RegExp(`\\s+(?:${[...fl].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");xn=Object.freeze(["mentioned","referenced"]),hl=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),iE=new RegExp(`\\s+(?:${hl.join("|")})\\s*[?.!]*$`,"i");aE=Object.freeze(["then","though","too"]),cE=new RegExp(`\\s+(?:${aE.join("|")})\\s*[?.!]*$`,"i"),lE=Object.freeze(["please explain","explain"]),uE=new RegExp(`,\\s*(?:${lE.join("|")})\\s*[?.!]*$`,"i");ue=Object.freeze(Object.fromEntries(Object.entries(Ar).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Cr=Object.freeze(new Set(["has","have","holds","hold"])),Di=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),dE=e=>!Ir.includes(e),If=Object.freeze([...new Set(Object.keys(ue).filter(dE).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),He=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),rn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Ss=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),Cf=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),ml=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),gl=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),bl=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),Of=/\b([a-z]{3,})in'/gi,Or=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),Qs=Object.freeze(["this","it","that","here","this one","that one"]),Lf=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),Nf=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),Zs=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),Zn=Object.freeze(["that","which","who"]),es=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Lo=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),et=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),Pf=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),eo=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),to=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),In=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),Cn=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),Mf=Object.freeze({tests:"Module",test:"Module"}),Lr=Object.freeze(["those","them","these"]),No=Object.freeze(["contains","defines"]),zi=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),Po=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Ff=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var qe,ks,Ui=C(()=>{qe="#000000",ks=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${qe}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${qe}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${qe}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${qe}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${qe}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${qe}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${qe}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${qe}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${qe}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${qe}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${qe}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${qe}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${qe}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${qe}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${qe}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${qe}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${qe}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${qe}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${qe}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${qe}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${qe}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${qe}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${qe}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${qe}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var pE,pn,Df,zf,wl,Uf,O1,L1,Bf=C(()=>{On();Ui();pE=()=>Object.keys(ks).sort(),pn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Df=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),zf=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),wl=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:sn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:pn("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:pn("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:Df("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:zf("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:zf("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:pE(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:Df("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:pn("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:pn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:pn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:pn("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:pn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:pn("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:pn("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:pn("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:pn("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:pn("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),Uf=wl.filter(e=>e.tier==="hot"),O1=wl.filter(e=>e.tier==="cold"),L1=Object.freeze(wl.map(e=>e.name))});var Wf,Ae,Kt=C(()=>{Ve();Wf=Z(".tmct","graph.json"),Ae=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function fE(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function Gf(e){let t=(Array.isArray(e)?e:[]).map((l,c)=>({file:l?.file,payload:l?.payload||{},name:l?.name!=null&&String(l.name).length?String(l.name):String(c)})),n=t.map(({payload:l})=>fE(l)),s=new Map;for(let l of n)for(let c of l)s.set(c,(s.get(c)||0)+1);let o=new Set([...s.entries()].filter(([,l])=>l>1).map(([l])=>l)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:l,name:c}of t){a=a&&!!l.bootstrap,typeof l.generated_at=="string"&&l.generated_at>i&&(i=l.generated_at);let u=p=>o.has(p)?`${c}/${p}`:p;Array.isArray(l.classes)&&r.classes.push(...l.classes),Array.isArray(l.vocabulary)&&r.vocabulary.push(...l.vocabulary);for(let p of Array.isArray(l.individuals)?l.individuals:[]){if(!p)continue;let f={...p};f.id&&(f.id=u(f.id)),Array.isArray(f.derived_from)&&(f.derived_from=f.derived_from.map(h=>u(h))),Array.isArray(f.mentions)&&(f.mentions=f.mentions.map(h=>h&&h.id?{...h,id:u(h.id)}:h)),r.individuals.push(f)}for(let p of Array.isArray(l.objectProperties)?l.objectProperties:[]){if(!p)continue;let f={...p};Array.isArray(f.examples)&&(f.examples=f.examples.map(h=>{if(!h)return h;let m={...h};return m.subject&&(m.subject=u(m.subject)),m.object&&(m.object=u(m.object)),m})),r.objectProperties.push(f)}let d=l.proseIndex&&typeof l.proseIndex=="object"?l.proseIndex:{};for(let[p,f]of Object.entries(d)){let h=r.proseIndex[p]||(r.proseIndex[p]=[]);for(let m of Array.isArray(f)?f:[]){let b=u(m);h.includes(b)||h.push(b)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Vf=C(()=>{});var Fo={};qt(Fo,{clearCache:()=>hE,emptyEntities:()=>yl,fetchEntities:()=>wE,registerProvider:()=>mE});function hE(){Mo=null,Nr=null}function mE(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Bi;return Bi=e??null,Mo=null,t}function yl(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function gE(e){let t;try{t=await Te(e,"utf8")}catch(n){if(n?.code==="ENOENT")return yl();throw new Ae(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Ae(`graph artifact ${e} is not valid JSON`)}}async function bE(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(Nr&&Nr.key===n)return Nr.payload;let s=[];for(let r=0;r<t.length;r++){let i=await gE(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Gf(s);return Nr={key:n,payload:o},o}async function wE(e){if(Bi){let s;try{s=await Bi(e)}catch(o){throw o instanceof Ae?o:new Ae(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Ae("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return bE(e);if(Mo&&Mo.file===e.graphFile)return Mo.payload;let t;try{t=await Te(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return yl();throw new Ae(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Ae(`graph artifact ${e.graphFile} is not valid JSON`)}return Mo={file:e.graphFile,payload:n},n}var Mo,Nr,Bi,Pr=C(()=>{Tt();Kt();Vf();Mo=null,Nr=null,Bi=null});function Ln(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=Hf)}function $l(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>Hf||yE.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=$E))break;return t}function Wi({name:e,doc:t}={}){return[...new Set([...Ln(e),...$l(t)])].sort()}function qf(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function no(e,t,{limit:n=10}={}){let s=[...new Set([...Ln(t),...$l(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function Kf(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let l of Object.keys(s)){let c=s[l];if(!c||typeof c!="object")continue;let u=c[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let p of d)i.add(p);a.add(l)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var yE,Hf,$E,js=C(()=>{yE=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),Hf=40,$E=120});function Yf(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function vE(e){if(!e.startsWith(Jf))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Xf);if(o<0)return null;let r=n.slice(o+Xf.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Jf.length,o),createdAt:s}:null}function ts(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:EE(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:")){let s=t.slice(9),o=s.lastIndexOf("@");return{kind:"referenceLive",pack:"research",article:(o>=0?s.slice(0,o):s).trim()||"unknown"}}let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:"))return{kind:"operator",...Yf(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=vE(s);return o||{kind:"teach",...Yf(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}:n.startsWith("news-fixture:")?{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"}:n.startsWith("extracted:news:")?{kind:"web",url:n.slice(10)}:n.startsWith("news:")?{kind:"web",url:n}:n.startsWith("optimistic-extract:")?{kind:"optimisticExtract",name:n.slice(19)||"unknown"}:n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function nh(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Zf;let n=Number(t);return Number.isFinite(n)?Math.max(vl,Math.min(th,n)):Zf}function sh(e,t=Date.now(),n=SE){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Qf+(1-Qf)*Math.pow(.5,o/n)}function oh(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let f of o){if(r.has(f))continue;r.add(f);let h=t[f],m=kE(h);if(!m)continue;i.push(m);let b=(so[m]??0)*nh(h);a.push(Math.max(0,Math.min(1,b)))}let l=0,c=1;for(let f of a)c*=1-f;if(a.length&&(l=Math.min(1,1-c)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let f=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;l=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*f))}let u=sh(e?.createdAt,s,n.halfLifeMs),d=Do(Math.min(1,l*u)),p={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Do(u)};return{score:d,inputs:p}}function Vi(e,t){let n=(so[e]??0)*nh(t);return Do(Math.max(0,Math.min(1,n)))}function jE(e){if(e==="operator")return 1;let t=so[e];return t===void 0?1:(t+1)/2}function Hi(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let l=sh(a?.assertedAt,n,t.halfLifeMs),c=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,c*l)),p=o.get(u)||{complement:1,strongest:0};p.complement*=1-d,p.strongest=Math.max(p.strongest,d),o.set(u,p),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:c,recency:Do(l)})}let i=1;for(let[a,l]of o){let c=Math.max(jE(a),l.strongest);i*=1-Math.min(1-l.complement,c)}return{score:s.length?Do(Math.min(1,1-i)):0,inputs:r}}function rh(e){return Hi(e,{halfLifeMs:RE})}function ih({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+_E),i=(o*r+1)/2;return Do(vl+(th-vl)*i)}var zo,Gi,tt,Rs,Xf,Jf,xE,EE,so,xl,eh,SE,Qf,vl,th,Zf,Do,kE,RE,_E,ns=C(()=>{zo="mgx:trustScore",Gi="mgx:trustInputs",tt="mgx:createdAt",Rs="mgx:updatedAt";Xf="#node:",Jf="peer:";xE="wikipedia-live",EE=e=>e===xE?"referenceLive":"reference";so=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),xl=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),eh=new Set(Object.entries(xl).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),SE=720*60*60*1e3,Qf=.9,vl=.5,th=1.5,Zf=1,Do=(e,t=6)=>Number(e.toFixed(t)),kE=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";RE=1/0;_E=19});var oo,El=C(()=>{oo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function Sl(e,t){return Math.log(1+e/(1+t))}var Mr=C(()=>{});var Yi={};qt(Yi,{bfsLevels:()=>Ki,findActionPath:()=>qi,findReachableSet:()=>kl});function ah(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function ch(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function qi(e,t,n,{maxDepth:s=50,stateKey:o=ah}={}){if(t(e))return{actions:[],states:[e]};let r=ch(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let c of r)if(t(c.state))return{actions:c.actions,states:c.states};if(a===s)break;let l=[];for(let c of r){let u=o(c.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:p}of n(c.state)||[]){let f=o(p);i.has(f)||l.push({state:p,actions:[...c.actions,d],states:[...c.states,p]})}}}r=l}return null}function kl(e,t,{maxDepth:n=50,stateKey:s=ah}={}){let o=ch(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let l=[];for(let c of o){let u=s(c.state);if(!r.has(u)&&(r.add(u),i.push({node:c.state,path:{actions:c.actions,states:c.states}}),a!==n))for(let{action:d,nextState:p}of t(c.state)||[]){let f=s(p);r.has(f)||l.push({state:p,actions:[...c.actions,d],states:[...c.states,p]})}}o=l}return i}function*Ki(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],l=[];for(let c of r)for(let u of t(c)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),l.push(d))}r=l,yield a}}var _s=C(()=>{});function Ji(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function Fr(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function is(e){let t=String(e?.prop||"").toLowerCase();if(lh[t])return lh[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":null}function os(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function jl(e){let t=os(e).split("/");return t[t.length-1]}function TE(e){return(e?.derived_from||[]).filter(xh).length}function uh(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+TE(e)}function an(e,t){let n=os(t);if(!n)return{match:null,candidates:[]};let s=jl(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=os(i.label),l=String(i.id||"").toLowerCase(),c=0;a===n||l===n?c=100:a.endsWith(`/${n}`)||o&&(jl(a)===s||jl(a).replace(/\.[a-z]+$/,"")===s)?c=80:a.includes(n)&&(c=Math.max(10,50-(a.length-n.length))),c>0&&r.push({ind:i,score:c})}return r.sort((i,a)=>a.score-i.score||uh(a.ind)-uh(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function At(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function AE(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function dh(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function rs(e){let t=e||"Entity",n=Ln(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function dt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function Cl(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${rs(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(xh);o.length&&s.push(`attestation: touched by ${o.length} commit(s)`);for(let l of t.attributes||[])s.push(`attribute: ${l.key} = ${l.value}${l.prop?` [${l.prop}]`:""}`);let{out:r,incoming:i}=AE(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:l,edges:c}of r)s.push(` ${dh(l)} (${c.length}) \u2192 ${dt(c.map(u=>u.objectLabel||u.object),ph)}`);for(let{group:l,edges:c}of i)s.push(` \u2190 ${dh(l)} (${c.length}) by ${dt(c.map(u=>u.subjectLabel||u.subject),ph)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${dt(a,IE)}`),n.length&&s.push(`other matches: ${n.map(l=>`${l.label} (${rs(l.class)})`).join(", ")}`),e.truncated.length&&s.push(CE(e)),s.join(`
|
|
2
|
-
`)}function
|
|
3
|
-
`)}function Sh(e){let t=new Map;for(let n of e.relations)if(is(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function hh(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Th(e,t,n=null){let s=n||(i=>ss(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of ke(e,i))r(s(a.subject),s(a.object));return o}function gS(e,t,n){if(t.length<2)return;let s=new Map(t.map(c=>[c.ind.id,c])),o=new Map(t.map(c=>[c.ind.id,c.score])),r=c=>{if(!c.size)return[[],[]];let u=0;for(let h of c.values())u=Math.max(u,h);let d=[...c.entries()].sort((h,m)=>m[1]-h[1]),p=[],f=[];for(let[h,m]of d)m>=u*iS&&p.length<n?p.push([h,m]):f.length<fh&&f.push([h,m]);return[p,f]},[i,a]=r(new Map(t.map(c=>[c.ind.id,c.score]))),l=new Set(i.map(([c])=>c));for(let c=0;c<lS&&i.length;c++){let u=new Map,d=[];for(let p of uS){let f=Th(e,p),h=new Map;for(let[g,y]of i)for(let w of f.get(g)||[])o.has(w)&&h.set(w,Math.max(h.get(w)||0,y));let[m,b]=r(h);for(let[g,y]of m)u.set(g,Math.max(u.get(g)||0,y));d.push(...b)}a.push(...d);for(let[p,f]of u){if(l.has(p))continue;let h=s.get(p);h&&(h.score+=Math.min(f*aS,h.score*cS),l.add(p))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,fh).filter(([p])=>!l.has(p)))}}function bS(e,t=[],{depth:n=jh,q:s=_h,nodeLimit:o=Rh,kinds:r=dS,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:l=null,hubDegree:c=1/0}={}){let u=new Map(t.map(S=>[S.ind.id,S])),d=0;for(let S of t)d=Math.max(d,S.score);let p=t.length>0&&d>0,f=new Set(l??u.keys());if(!f.size)return[];let h=Th(e,r,a),m=S=>h.get(S)?.size||0,b=[],g=(S,_)=>S.hop!==_.hop?S.hop<_.hop:S.deg!==_.deg?S.deg<_.deg:S.id<_.id,y=(S,_)=>{let R=b[S];b[S]=b[_],b[_]=R},w=S=>{b.push(S);let _=b.length-1;for(;_>0;){let R=_-1>>1;if(g(b[_],b[R]))y(_,R),_=R;else break}},v=()=>{let S=b[0],_=b.pop();if(b.length){b[0]=_;let R=0;for(;;){let T=2*R+1,M=2*R+2,I=R;if(T<b.length&&g(b[T],b[I])&&(I=T),M<b.length&&g(b[M],b[I])&&(I=M),I===R)break;y(R,I),R=I}}return S},k=new Set(f);for(let S of f)w({id:S,hop:0,deg:m(S)});let $=null,x=0,E=[];for(;b.length&&x<o;){let S=v();if(E.push({id:S.id,hop:S.hop}),!f.has(S.id)){if(p){let T=d*pS*Math.pow(fS,S.hop-1),M=u.get(S.id);if(M)M.score+=Math.min(T*hS,M.score*mS);else{let I=e.byId?.get?.(S.id);if(I&&i(I)){$||($=Sh(e));let D=$.get(I.id)||[],B={ind:I,score:T,defineCount:D.length,matching:[],density:0};t.push(B),u.set(S.id,B)}}}x++}if(S.hop>=n||S.hop>0&&m(S.id)>c)continue;let _=[];for(let T of h.get(S.id)||[]){if(k.has(T))continue;let M=e.byId?.get?.(T);!M||!i(M)||_.push({id:T,deg:m(T)})}if(!_.length)continue;_.sort((T,M)=>T.deg-M.deg||(T.id<M.id?-1:T.id>M.id?1:0));let R=Math.max(1,Math.floor(s*_.length));for(let T=0;T<R;T++){let M=_[T];k.add(M.id),w({id:M.id,hop:S.hop+1,deg:M.deg})}}return E}function Ah(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:l=!1,proseLayers:c=!1,literalMention:u=!1,rawQuery:d=""}=n,p=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,f=Sh(e),h=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let k=String(v.label),$=k.toLowerCase(),x=f.get(v.id)||[],E=new Set(x.map(R=>R.toLowerCase())),S=new Set;for(let R of x)for(let T of hh(R))S.add(T);let _=u?String((v.attributes||[]).find(R=>R.key==="dotted")?.value||"").toLowerCase():"";h.push({ind:v,label:k,labelLc:$,defines:x,symSet:E,symComps:S,dotted:_})}let m=h.length||1,b=new Map,g=v=>{let k=0;for(let $ of h)($.labelLc.includes(v)||$.symComps.has(v)||$.symSet.has(v))&&k++;return k},y=v=>(b.has(v)||b.set(v,Sl(m,g(v))),b.get(v));for(let v of t)y(v);let w=[];for(let v of h){let k=0,$=0,x=0,E=[];for(let M of t){let I=b.get(M)||0;I&&(v.symSet.has(M)?(k+=I*kh,x++):v.symComps.has(M)&&(E.push(I),x++),v.labelLc.includes(M)&&($+=I*PE))}E.sort((M,I)=>I-M);let S=0;for(let M=0;M<Math.min(E.length,FE);M++)S+=E[M]*ME;let _=k+$+S;if(!_)continue;s&&(oo(v.labelLc)||BE(v.labelLc))?_*=UE:oo(v.labelLc)&&(_*=.4);let R=v.defines.filter(M=>{let I=M.toLowerCase(),D=hh(M);return t.some(B=>I===B||D.has(B))}),T=v.defines.length?x/v.defines.length:0;w.push({ind:v.ind,score:_,defineCount:v.defines.length,matching:R,density:T})}if(u&&d&&w.length){let v=String(d).toLowerCase(),k=S=>S!=null&&/[a-z0-9_./]/.test(S),$=S=>{for(let _=v.indexOf(S);_!==-1;_=v.indexOf(S,_+1))if(!k(v[_-1])&&!k(v[_+S.length]))return!0;return!1},x=new Map(h.map(S=>[S.ind.id,S])),E=0;for(let S of w)E=Math.max(E,S.score);for(let S of w){let _=x.get(S.ind.id);if(!_)continue;let R=0;for(let T of new Set([_.dotted,_.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<nS||!$(T))continue;let M=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((D,B)=>B-D),I=0;for(let D=0;D<Math.min(M.length,sS);D++)I+=M[D]*tS;R=Math.max(R,I)}R&&(S.score+=Math.min(R*oS,E*rS))}}if(w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of ke(e,"imports"))!v.has($.subject)&&!v.has($.object)||(k.has($.subject)||k.set($.subject,new Set),k.has($.object)||k.set($.object,new Set),k.get($.subject).add($.object),k.get($.object).add($.subject));for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*DE,$.score*zE)}}if(o&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of["calls","callsSymbol"])for(let x of ke(e,$)){let E=ss(e,x.subject),S=ss(e,x.object);!E||!S||E===S||!v.has(E)&&!v.has(S)||(k.has(E)||k.set(E,new Set),k.has(S)||k.set(S,new Set),k.get(E).add(S),k.get(S).add(E))}for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*WE,$.score*GE)}}if(r&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of e.individuals)($.class||"")==="Class"&&$.label&&k.set(String($.label),$);for(let $ of w){if(!qE($.ind.label))continue;let x=0;for(let E of ke(e,"inherits")){if(ss(e,E.subject)!==$.ind.id||!KE(E.objectLabel))continue;let _=ss(e,E.object);if(!_){let R=k.get(String(E.objectLabel||""));R&&(_=Nn(e,R))}_&&(x=Math.max(x,v.get(_)||0))}$.score+=Math.min(x*VE,$.score*HE)}}if(l&&w.length&&e.proseIndex){let v=no(e.proseIndex,t.join(" "),{limit:JE});if(v.length){let k=new Map;for(let{id:$,score:x}of v){let E=ss(e,$);E&&k.set(E,(k.get(E)||0)+x)}for(let $ of w){let x=k.get($.ind.id)||0;x&&($.score+=Math.min(x*YE,$.score*XE))}}}if(c&&w.length&&e.proseIndex){let v=new Map(w.map(x=>[x.ind.id,x])),k=new Map(h.map(x=>[x.ind.id,x])),$=new Map;for(let x of new Set(t)){let E=b.get(x)||0;if(!E)continue;let{ids:S}=Kf(e.proseIndex,x);if(!S.length)continue;let _=new Set;for(let R of S){let T=ss(e,R);if(!T||_.has(T)||(_.add(T),!v.has(T)))continue;let M=k.get(T);M&&(M.symSet.has(x)||M.symComps.has(x)||M.labelLc.includes(x))||$.set(T,($.get(T)||0)+E*eS)}}for(let x of w){let E=$.get(x.ind.id)||0;E&&(x.score+=Math.min(E*QE,x.score*ZE))}}return i&&w.length>1&&gS(e,w,p),a&&w.length&&bS(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:jh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:_h,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Rh}),w.sort((v,k)=>k.score-v.score||k.density-v.density||v.defineCount-k.defineCount||String(v.ind.label).length-String(k.ind.label).length),w}function Ih(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return Ah(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function yS(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let l=0;l<e.length;l++){let c=e[l];if(c==="\\"){let u=e[l+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),l+=1,r="",i=!1;continue}if(o){c==="]"&&(o=!1,r="]",i=!1);continue}if(c==="["){o=!0,r="[",i=!1;continue}if(c==="?"&&(r==="("||i)){r="?",i=!1;continue}if(c==="*"||c==="+"||c==="?"){a(),r=c;continue}if(c==="{"){let u=e.indexOf("}",l),d=u===-1?"":e.slice(l+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),l=u,r="}";continue}r="{",i=!1;continue}r=c,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function Ol(e,{now:t=Date.now}={}){let n=String(e);if(n.length>mh)return{error:`name pattern is ${n.length} characters; the limit is ${mh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=yS(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>gh)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${gh}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(l){if(a===null)a=t()+bh;else if(t()>a)throw new Xi(`name pattern "${n}" exceeded its ${bh}ms matching budget.`);return i.test(String(l).slice(0,wS))}}}function Ch(e,t,{limit:n=Qi,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),l=String(s||"").trim().toLowerCase(),c=String(o||"").trim().toLowerCase(),u=null;if(r){let h=Ol(r);if(h.error)return h.error;u=h}if(l&&l!=="module")try{return SS(e,a,{limit:n,kind:l,decFilter:c,nameRe:u,toolNamePrefix:i})}catch(h){if(h instanceof Xi)return h.message;throw h}if(!a.length&&!u&&!c)return"empty query";let d=Ah(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let p=d.slice(0,n),f=[`${d.length} module(s) match "${t}" (top ${p.length}):`];for(let{ind:h,defineCount:m,matching:b}of p){let g=b.length?` \u2014 matching: ${dt([...new Set(b)],NE)}`:"";f.push(`- ${h.label} (defines ${m} symbol(s))${g}`)}return f.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),f.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
`);let r=[],i=[];for(let a of o){let
|
|
6
|
-
`)}function
|
|
7
|
-
`)}function
|
|
8
|
-
`)}function
|
|
9
|
-
`)}function
|
|
10
|
-
${
|
|
1
|
+
(()=>{var wS=Object.defineProperty;var N=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Ot=(e,t)=>{for(var n in t)wS(e,n,{get:t[n],enumerable:!0})};var ht,xM,EM,SM,jM,kM,RM,_M,TM,AM,CM,IM,OM,LM,NM,PM,MM,te,be,Ut,Gl,xm,FM,DM,zM,Ye=N(()=>{ht=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},xM=ht("createRequire"),EM=ht("readFileSync"),SM=ht("access"),jM=ht("readFile"),kM=ht("writeFile"),RM=ht("appendFile"),_M=ht("mkdir"),TM=ht("mkdtemp"),AM=ht("rename"),CM=ht("unlink"),IM=ht("rm"),OM=ht("stat"),LM=ht("copyFile"),NM=ht("readdir"),PM=ht("createReadStream"),MM=ht("createWriteStream"),te=(...e)=>e.join("/"),be=e=>String(e).replace(/\/[^/]*$/,""),Ut=(...e)=>e.join("/"),Gl=e=>String(e).startsWith("/"),xm="/",FM=ht("randomBytes"),DM=ht("spawnSync"),zM=ht("createInterface")});var gt,BM,WM,Vl,Ae,qo,yS,Un,Em,la,Hl,Sm,$S,GM,vS,VM,HM,qM,KM,YM,Lt=N(()=>{gt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},BM=gt("createRequire"),WM=gt("readFileSync"),Vl=gt("access"),Ae=gt("readFile"),qo=gt("writeFile"),yS=gt("appendFile"),Un=gt("mkdir"),Em=gt("mkdtemp"),la=gt("rename"),Hl=gt("unlink"),Sm=gt("rm"),$S=gt("stat"),GM=gt("copyFile"),vS=gt("readdir"),VM=gt("createReadStream"),HM=gt("createWriteStream"),qM=gt("randomBytes"),KM=gt("spawnSync"),YM=gt("createInterface")});function Ko(e){let t=ES.exec(String(e||""));return t?t[1].toLowerCase():null}function ua(e){return String(e||"").replace(SS,"$1")}function Ps(e){return e.replace(jS,"").trim()}function pn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(RS,"").trim();if(s=s.replace(TS,"").trim(),s===t)break;t=s}return t}var jm,qr,fo,km,Rm,xS,ES,Kr,fn,ql,SS,On,Kl,jS,kS,RS,_S,TS,fe,Yr,da,AS,_m,Xe,mn,Ms,Tm,Yl,Xl,Jl,Am,Xr,po,Cm,Im,mo,fs,ps,Yo,rt,Om,ho,go,Bn,Wn,Lm,Jr,Xo,fa,Jo,Nm,Gn=N(()=>{jm=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],qr={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","lives in","live in","is defined in","are defined in","is part of","are part of","sits in","sit in","sits inside","sit inside","containing"]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",...jm]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},fo=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),km=Object.freeze(Object.fromEntries(Object.entries(fo).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Rm=Object.freeze(Object.values(fo).map(e=>e.predicate)),xS=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),ES=new RegExp(`^mgx:[a-z]+-(${xS.join("|")})$`,"i");Kr=Object.freeze([...jm,"is the superclass of","are the superclass of","is the parent class of"]),fn=Object.freeze(["defined","declared","located","implemented"]),ql=Object.freeze(["now","currently","right now","at the moment","these days","today"]),SS=new RegExp(`\\s+(?:${[...ql].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");On=Object.freeze(["mentioned","referenced"]),Kl=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),jS=new RegExp(`\\s+(?:${Kl.join("|")})\\s*[?.!]*$`,"i");kS=Object.freeze(["then","though","too"]),RS=new RegExp(`\\s+(?:${kS.join("|")})\\s*[?.!]*$`,"i"),_S=Object.freeze(["please explain","explain"]),TS=new RegExp(`,\\s*(?:${_S.join("|")})\\s*[?.!]*$`,"i");fe=Object.freeze(Object.fromEntries(Object.entries(qr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Yr=Object.freeze(new Set(["has","have","holds","hold"])),da=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),AS=e=>!Kr.includes(e),_m=Object.freeze([...new Set(Object.keys(fe).filter(AS).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Xe=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),mn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Ms=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),Tm=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),Yl=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),Xl=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),Jl=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),Am=/\b([a-z]{3,})in'/gi,Xr=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),po=Object.freeze(["this","it","that","here","this one","that one"]),Cm=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),Im=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),mo=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),fs=Object.freeze(["that","which","who"]),ps=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Yo=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),rt=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),Om=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),ho=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),go=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),Bn=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),Wn=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),Lm=Object.freeze({tests:"Module",test:"Module"}),Jr=Object.freeze(["those","them","these"]),Xo=Object.freeze(["contains","defines"]),fa=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),Jo=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Nm=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var Je,Fs,pa=N(()=>{Je="#000000",Fs=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Je}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Je}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Je}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Je}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Je}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Je}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Je}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Je}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Je}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Je}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Je}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Je}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Je}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Je}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Je}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Je}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Je}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Je}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Je}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Je}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Je}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Je}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${Je}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${Je}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var CS,$n,Pm,Mm,Ql,Fm,tF,nF,Dm=N(()=>{Gn();pa();CS=()=>Object.keys(Fs).sort(),$n=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Pm=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Mm=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),Ql=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:fn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:$n("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:$n("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:Pm("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:Mm("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:Mm("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:CS(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:Pm("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:$n("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:$n("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:$n("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:$n("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:$n("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:$n("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:$n("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:$n("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:$n("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:$n("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),Fm=Ql.filter(e=>e.tier==="hot"),tF=Ql.filter(e=>e.tier==="cold"),nF=Object.freeze(Ql.map(e=>e.name))});var zm,Ie,Kt=N(()=>{Ye();zm=te(".tmct","graph.json"),Ie=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function IS(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function Um(e){let t=(Array.isArray(e)?e:[]).map((c,l)=>({file:c?.file,payload:c?.payload||{},name:c?.name!=null&&String(c.name).length?String(c.name):String(l)})),n=t.map(({payload:c})=>IS(c)),s=new Map;for(let c of n)for(let l of c)s.set(l,(s.get(l)||0)+1);let o=new Set([...s.entries()].filter(([,c])=>c>1).map(([c])=>c)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:c,name:l}of t){a=a&&!!c.bootstrap,typeof c.generated_at=="string"&&c.generated_at>i&&(i=c.generated_at);let u=f=>o.has(f)?`${l}/${f}`:f;Array.isArray(c.classes)&&r.classes.push(...c.classes),Array.isArray(c.vocabulary)&&r.vocabulary.push(...c.vocabulary);for(let f of Array.isArray(c.individuals)?c.individuals:[]){if(!f)continue;let p={...f};p.id&&(p.id=u(p.id)),Array.isArray(p.derived_from)&&(p.derived_from=p.derived_from.map(m=>u(m))),Array.isArray(p.mentions)&&(p.mentions=p.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(p)}for(let f of Array.isArray(c.objectProperties)?c.objectProperties:[]){if(!f)continue;let p={...f};Array.isArray(p.examples)&&(p.examples=p.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(p)}let d=c.proseIndex&&typeof c.proseIndex=="object"?c.proseIndex:{};for(let[f,p]of Object.entries(d)){let m=r.proseIndex[f]||(r.proseIndex[f]=[]);for(let h of Array.isArray(p)?p:[]){let g=u(h);m.includes(g)||m.push(g)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Bm=N(()=>{});var Zo={};Ot(Zo,{clearCache:()=>OS,emptyEntities:()=>Zl,fetchEntities:()=>MS,registerProvider:()=>LS});function OS(){Qo=null,Qr=null}function LS(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=ma;return ma=e??null,Qo=null,t}function Zl(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function NS(e){let t;try{t=await Ae(e,"utf8")}catch(n){if(n?.code==="ENOENT")return Zl();throw new Ie(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Ie(`graph artifact ${e} is not valid JSON`)}}async function PS(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(Qr&&Qr.key===n)return Qr.payload;let s=[];for(let r=0;r<t.length;r++){let i=await NS(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Um(s);return Qr={key:n,payload:o},o}async function MS(e){if(ma){let s;try{s=await ma(e)}catch(o){throw o instanceof Ie?o:new Ie(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Ie("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return PS(e);if(Qo&&Qo.file===e.graphFile)return Qo.payload;let t;try{t=await Ae(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return Zl();throw new Ie(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Ie(`graph artifact ${e.graphFile} is not valid JSON`)}return Qo={file:e.graphFile,payload:n},n}var Qo,Qr,ma,Zr=N(()=>{Lt();Kt();Bm();Qo=null,Qr=null,ma=null});function Vn(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=Wm)}function eu(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>Wm||FS.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=DS))break;return t}function ha({name:e,doc:t}={}){return[...new Set([...Vn(e),...eu(t)])].sort()}function Gm(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function bo(e,t,{limit:n=10}={}){let s=[...new Set([...Vn(t),...eu(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function Vm(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let c of Object.keys(s)){let l=s[c];if(!l||typeof l!="object")continue;let u=l[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let f of d)i.add(f);a.add(c)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var FS,Wm,DS,Ds=N(()=>{FS=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),Wm=40,DS=120});function Hm(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function zS(e){if(!e.startsWith(Km))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(qm);if(o<0)return null;let r=n.slice(o+qm.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Km.length,o),createdAt:s}:null}function Hn(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:BS(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:")){let s=t.slice(9),o=s.lastIndexOf("@");return{kind:"referenceLive",pack:"research",article:(o>=0?s.slice(0,o):s).trim()||"unknown"}}let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:"))return{kind:"operator",...Hm(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=zS(s);return o||{kind:"teach",...Hm(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}:n.startsWith("news-fixture:")?{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"}:n.startsWith("extracted:news:")?{kind:"web",url:n.slice(10)}:n.startsWith("news:")?{kind:"web",url:n}:n.startsWith("optimistic-extract:")?{kind:"optimisticExtract",name:n.slice(19)||"unknown"}:n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function Zm(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Xm;let n=Number(t);return Number.isFinite(n)?Math.max(tu,Math.min(Qm,n)):Xm}function eh(e,t=Date.now(),n=WS){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Ym+(1-Ym)*Math.pow(.5,o/n)}function th(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let p of o){if(r.has(p))continue;r.add(p);let m=t[p],h=GS(m);if(!h)continue;i.push(h);let g=(ms[h]??0)*Zm(m);a.push(Math.max(0,Math.min(1,g)))}let c=0,l=1;for(let p of a)l*=1-p;if(a.length&&(c=Math.min(1,1-l)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let p=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;c=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*p))}let u=eh(e?.createdAt,s,n.halfLifeMs),d=er(Math.min(1,c*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:er(u)};return{score:d,inputs:f}}function ba(e,t){let n=(ms[e]??0)*Zm(t);return er(Math.max(0,Math.min(1,n)))}function VS(e){if(e==="operator")return 1;let t=ms[e];return t===void 0?1:(t+1)/2}function wa(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let c=eh(a?.assertedAt,n,t.halfLifeMs),l=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,l*c)),f=o.get(u)||{complement:1,strongest:0};f.complement*=1-d,f.strongest=Math.max(f.strongest,d),o.set(u,f),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:l,recency:er(c)})}let i=1;for(let[a,c]of o){let l=Math.max(VS(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?er(Math.min(1,1-i)):0,inputs:r}}function nh(e){return wa(e,{halfLifeMs:HS})}function sh({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+qS),i=(o*r+1)/2;return er(tu+(Qm-tu)*i)}var tr,ga,it,zs,qm,Km,US,BS,ms,nu,Jm,WS,Ym,tu,Qm,Xm,er,GS,HS,qS,qn=N(()=>{tr="mgx:trustScore",ga="mgx:trustInputs",it="mgx:createdAt",zs="mgx:updatedAt";qm="#node:",Km="peer:";US="wikipedia-live",BS=e=>e===US?"referenceLive":"reference";ms=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),nu=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),Jm=new Set(Object.entries(nu).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),WS=720*60*60*1e3,Ym=.9,tu=.5,Qm=1.5,Xm=1,er=(e,t=6)=>Number(e.toFixed(t)),GS=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";HS=1/0;qS=19});var wo,su=N(()=>{wo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function ou(e,t){return Math.log(1+e/(1+t))}var ei=N(()=>{});var va={};Ot(va,{bfsLevels:()=>$a,findActionPath:()=>ya,findReachableSet:()=>ru});function oh(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function rh(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function ya(e,t,n,{maxDepth:s=50,stateKey:o=oh}={}){if(t(e))return{actions:[],states:[e]};let r=rh(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let l of r)if(t(l.state))return{actions:l.actions,states:l.states};if(a===s)break;let c=[];for(let l of r){let u=o(l.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:f}of n(l.state)||[]){let p=o(f);i.has(p)||c.push({state:f,actions:[...l.actions,d],states:[...l.states,f]})}}}r=c}return null}function ru(e,t,{maxDepth:n=50,stateKey:s=oh}={}){let o=rh(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let c=[];for(let l of o){let u=s(l.state);if(!r.has(u)&&(r.add(u),i.push({node:l.state,path:{actions:l.actions,states:l.states}}),a!==n))for(let{action:d,nextState:f}of t(l.state)||[]){let p=s(f);r.has(p)||c.push({state:f,actions:[...l.actions,d],states:[...l.states,f]})}}o=c}return i}function*$a(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],c=[];for(let l of r)for(let u of t(l)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),c.push(d))}r=c,yield a}}var Us=N(()=>{});function Ea(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function ti(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function ws(e){let t=String(e?.prop||"").toLowerCase();if(ih[t])return ih[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":/denot/.test(n)?"denotes":/\bserve/.test(n)?"serves":null}function gs(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function iu(e){let t=gs(e).split("/");return t[t.length-1]}function KS(e){return(e?.derived_from||[]).filter(yh).length}function ah(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+KS(e)}function hn(e,t){let n=gs(t);if(!n)return{match:null,candidates:[]};let s=iu(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=gs(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(iu(a)===s||iu(a).replace(/\.[a-z]+$/,"")===s)?l=80:a.includes(n)&&(l=Math.max(10,50-(a.length-n.length))),l>0&&r.push({ind:i,score:l})}return r.sort((i,a)=>a.score-i.score||ah(a.ind)-ah(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function Bt(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function YS(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function ch(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function bs(e){let t=e||"Entity",n=Vn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function bt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function fu(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${bs(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(yh);o.length&&s.push(`attestation: touched by ${o.length} commit(s)`);for(let c of t.attributes||[])s.push(`attribute: ${c.key} = ${c.value}${c.prop?` [${c.prop}]`:""}`);let{out:r,incoming:i}=YS(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:c,edges:l}of r)s.push(` ${ch(c)} (${l.length}) \u2192 ${bt(l.map(u=>u.objectLabel||u.object),lh)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${ch(c)} (${l.length}) by ${bt(l.map(u=>u.subjectLabel||u.subject),lh)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${bt(a,XS)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${bs(c.class)})`).join(", ")}`),e.truncated.length&&s.push(JS(e)),s.join(`
|
|
2
|
+
`)}function JS(e){return`note: partial edge lists for: ${e.truncated.map(n=>`${n.predicate} (${n.shown}/${n.count})`).join(", ")}. Counts are complete; the lists are not.`}function sr(e,t,{maxDepth:n=8}={}){let s=new Map,o=new Map,r=(a,c,l,u)=>{!a||!c||a===c||(s.has(a)||s.set(a,[]),s.get(a).push({id:c,label:l,via:u}))};for(let a of e.relations){let c=ws(a);if(c==="imports"||c==="calls")for(let l of a.edges)r(l.object,l.subject,l.subjectLabel||l.subject,a.predicate);else if(c==="callsSymbol")for(let l of a.edges){let u=hs(e,l.subject),d=hs(e,l.object);if(!u||!d)continue;let f=e.byId.get(u)?.label||u;r(d,u,f,a.predicate),u!==d&&r(l.object,u,f,a.predicate)}else if(c==="tests")for(let l of a.edges)o.has(l.object)||o.set(l.object,[]),o.get(l.object).push(l.subjectLabel||l.subject);else if(c==="serves")for(let l of a.edges)r(l.subject,l.object,l.objectLabel||l.object,a.predicate)}let i=[];for(let a of $a(t.id,c=>s.get(c)||[],{maxDepth:n,keyOf:c=>c.id})){if(!a.length)continue;let c=a.map(l=>({...l,tests:o.get(l.id)||[]})).sort((l,u)=>String(l.label).localeCompare(String(u.label)));i.push(c)}return i}function $h(e,t,{maxDepth:n=8}={}){let s=sr(e,t,{maxDepth:n}),o=[`Impact of changing ${t.label} (reverse closure over imports/calls edges, module- and function-level):`];s.length||o.push("no dependents found in the current artifact \u2014 nothing imports or calls it (or its edges are not in the extracted graph yet).");let r=s.reduce((a,c)=>a+c.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,c)=>{if(c>=QS){o.push(`depth ${c+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(c===0?`depth 1 (${a.length} direct dependents):`:`depth ${c+1} (${a.length}):`);for(let l of a.slice(0,au)){let u=l.tests.length?`tests: ${bt(l.tests,ZS)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>au&&o.push(` \u2026+${a.length-au} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=ws({predicate:a.predicate});return c==="imports"||c==="calls"||c==="callsSymbol"||c==="tests"||c==="serves"});return i.length&&o.push("warning: partial edge lists ("+i.map(a=>`${a.predicate}: ${a.shown}/${a.count}`).join(", ")+") \u2014 this closure may be missing edges. Cross-check critical results with a lexical search (/find <term>)."),o.join(`
|
|
3
|
+
`)}function vh(e){let t=new Map;for(let n of e.relations)if(ws(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function dh(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function kh(e,t,n=null){let s=n||(i=>hs(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of Re(e,i))r(s(a.subject),s(a.object));return o}function Nj(e,t,n){if(t.length<2)return;let s=new Map(t.map(l=>[l.ind.id,l])),o=new Map(t.map(l=>[l.ind.id,l.score])),r=l=>{if(!l.size)return[[],[]];let u=0;for(let m of l.values())u=Math.max(u,m);let d=[...l.entries()].sort((m,h)=>h[1]-m[1]),f=[],p=[];for(let[m,h]of d)h>=u*jj&&f.length<n?f.push([m,h]):p.length<uh&&p.push([m,h]);return[f,p]},[i,a]=r(new Map(t.map(l=>[l.ind.id,l.score]))),c=new Set(i.map(([l])=>l));for(let l=0;l<_j&&i.length;l++){let u=new Map,d=[];for(let f of Tj){let p=kh(e,f),m=new Map;for(let[b,y]of i)for(let $ of p.get(b)||[])o.has($)&&m.set($,Math.max(m.get($)||0,y));let[h,g]=r(m);for(let[b,y]of h)u.set(b,Math.max(u.get(b)||0,y));d.push(...g)}a.push(...d);for(let[f,p]of u){if(c.has(f))continue;let m=s.get(f);m&&(m.score+=Math.min(p*kj,m.score*Rj),c.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,uh).filter(([f])=>!c.has(f)))}}function Pj(e,t=[],{depth:n=Eh,q:s=jh,nodeLimit:o=Sh,kinds:r=Aj,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=1/0}={}){let u=new Map(t.map(w=>[w.ind.id,w])),d=0;for(let w of t)d=Math.max(d,w.score);let f=t.length>0&&d>0,p=new Set(c??u.keys());if(!p.size)return[];let m=kh(e,r,a),h=w=>m.get(w)?.size||0,g=[],b=(w,S)=>w.hop!==S.hop?w.hop<S.hop:w.deg!==S.deg?w.deg<S.deg:w.id<S.id,y=(w,S)=>{let x=g[w];g[w]=g[S],g[S]=x},$=w=>{g.push(w);let S=g.length-1;for(;S>0;){let x=S-1>>1;if(b(g[S],g[x]))y(S,x),S=x;else break}},E=()=>{let w=g[0],S=g.pop();if(g.length){g[0]=S;let x=0;for(;;){let A=2*x+1,L=2*x+2,T=x;if(A<g.length&&b(g[A],g[T])&&(T=A),L<g.length&&b(g[L],g[T])&&(T=L),T===x)break;y(x,T),x=T}}return w},R=new Set(p);for(let w of p)$({id:w,hop:0,deg:h(w)});let v=null,j=0,k=[];for(;g.length&&j<o;){let w=E();if(k.push({id:w.id,hop:w.hop}),!p.has(w.id)){if(f){let A=d*Cj*Math.pow(Ij,w.hop-1),L=u.get(w.id);if(L)L.score+=Math.min(A*Oj,L.score*Lj);else{let T=e.byId?.get?.(w.id);if(T&&i(T)){v||(v=vh(e));let O=v.get(T.id)||[],_={ind:T,score:A,defineCount:O.length,matching:[],density:0};t.push(_),u.set(w.id,_)}}}j++}if(w.hop>=n||w.hop>0&&h(w.id)>l)continue;let S=[];for(let A of m.get(w.id)||[]){if(R.has(A))continue;let L=e.byId?.get?.(A);!L||!i(L)||S.push({id:A,deg:h(A)})}if(!S.length)continue;S.sort((A,L)=>A.deg-L.deg||(A.id<L.id?-1:A.id>L.id?1:0));let x=Math.max(1,Math.floor(s*S.length));for(let A=0;A<x;A++){let L=S[A];R.add(L.id),$({id:L.id,hop:w.hop+1,deg:L.deg})}}return k}function Rh(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:c=!1,proseLayers:l=!1,literalMention:u=!1,rawQuery:d=""}=n,f=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,p=vh(e),m=[];for(let E of e.individuals){if((E.class||"")!=="Module")continue;let R=String(E.label),v=R.toLowerCase(),j=p.get(E.id)||[],k=new Set(j.map(x=>x.toLowerCase())),w=new Set;for(let x of j)for(let A of dh(x))w.add(A);let S=u?String((E.attributes||[]).find(x=>x.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:E,label:R,labelLc:v,defines:j,symSet:k,symComps:w,dotted:S})}let h=m.length||1,g=new Map,b=E=>{let R=0;for(let v of m)(v.labelLc.includes(E)||v.symComps.has(E)||v.symSet.has(E))&&R++;return R},y=E=>(g.has(E)||g.set(E,ou(h,b(E))),g.get(E));for(let E of t)y(E);let $=[];for(let E of m){let R=0,v=0,j=0,k=[];for(let L of t){let T=g.get(L)||0;T&&(E.symSet.has(L)?(R+=T*xh,j++):E.symComps.has(L)&&(k.push(T),j++),E.labelLc.includes(L)&&(v+=T*tj))}k.sort((L,T)=>T-L);let w=0;for(let L=0;L<Math.min(k.length,sj);L++)w+=k[L]*nj;let S=R+v+w;if(!S)continue;s&&(wo(E.labelLc)||aj(E.labelLc))?S*=ij:wo(E.labelLc)&&(S*=.4);let x=E.defines.filter(L=>{let T=L.toLowerCase(),O=dh(L);return t.some(_=>T===_||O.has(_))}),A=E.defines.length?j/E.defines.length:0;$.push({ind:E.ind,score:S,defineCount:E.defines.length,matching:x,density:A})}if(u&&d&&$.length){let E=String(d).toLowerCase(),R=w=>w!=null&&/[a-z0-9_./]/.test(w),v=w=>{for(let S=E.indexOf(w);S!==-1;S=E.indexOf(w,S+1))if(!R(E[S-1])&&!R(E[S+w.length]))return!0;return!1},j=new Map(m.map(w=>[w.ind.id,w])),k=0;for(let w of $)k=Math.max(k,w.score);for(let w of $){let S=j.get(w.ind.id);if(!S)continue;let x=0;for(let A of new Set([S.dotted,S.labelLc])){if(!A||A.split(/[./]+/).filter(Boolean).length<vj||!v(A))continue;let L=[...new Set(A.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((O,_)=>_-O),T=0;for(let O=0;O<Math.min(L.length,xj);O++)T+=L[O]*$j;x=Math.max(x,T)}x&&(w.score+=Math.min(x*Ej,k*Sj))}}if($.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of Re(e,"imports"))!E.has(v.subject)&&!E.has(v.object)||(R.has(v.subject)||R.set(v.subject,new Set),R.has(v.object)||R.set(v.object,new Set),R.get(v.subject).add(v.object),R.get(v.object).add(v.subject));for(let v of $){let j=0;for(let k of R.get(v.ind.id)||[])j=Math.max(j,E.get(k)||0);v.score+=Math.min(j*oj,v.score*rj)}}if(o&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of["calls","callsSymbol"])for(let j of Re(e,v)){let k=hs(e,j.subject),w=hs(e,j.object);!k||!w||k===w||!E.has(k)&&!E.has(w)||(R.has(k)||R.set(k,new Set),R.has(w)||R.set(w,new Set),R.get(k).add(w),R.get(w).add(k))}for(let v of $){let j=0;for(let k of R.get(v.ind.id)||[])j=Math.max(j,E.get(k)||0);v.score+=Math.min(j*cj,v.score*lj)}}if(r&&$.length>1){let E=new Map($.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&R.set(String(v.label),v);for(let v of $){if(!fj(v.ind.label))continue;let j=0;for(let k of Re(e,"inherits")){if(hs(e,k.subject)!==v.ind.id||!pj(k.objectLabel))continue;let S=hs(e,k.object);if(!S){let x=R.get(String(k.objectLabel||""));x&&(S=Kn(e,x))}S&&(j=Math.max(j,E.get(S)||0))}v.score+=Math.min(j*uj,v.score*dj)}}if(c&&$.length&&e.proseIndex){let E=bo(e.proseIndex,t.join(" "),{limit:gj});if(E.length){let R=new Map;for(let{id:v,score:j}of E){let k=hs(e,v);k&&R.set(k,(R.get(k)||0)+j)}for(let v of $){let j=R.get(v.ind.id)||0;j&&(v.score+=Math.min(j*mj,v.score*hj))}}}if(l&&$.length&&e.proseIndex){let E=new Map($.map(j=>[j.ind.id,j])),R=new Map(m.map(j=>[j.ind.id,j])),v=new Map;for(let j of new Set(t)){let k=g.get(j)||0;if(!k)continue;let{ids:w}=Vm(e.proseIndex,j);if(!w.length)continue;let S=new Set;for(let x of w){let A=hs(e,x);if(!A||S.has(A)||(S.add(A),!E.has(A)))continue;let L=R.get(A);L&&(L.symSet.has(j)||L.symComps.has(j)||L.labelLc.includes(j))||v.set(A,(v.get(A)||0)+k*yj)}}for(let j of $){let k=v.get(j.ind.id)||0;k&&(j.score+=Math.min(k*bj,j.score*wj))}}return i&&$.length>1&&Nj(e,$,f),a&&$.length&&Pj(e,$,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:Eh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:jh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Sh}),$.sort((E,R)=>R.score-E.score||R.density-E.density||E.defineCount-R.defineCount||String(E.ind.label).length-String(R.ind.label).length),$}function _h(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return Rh(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Fj(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let c=0;c<e.length;c++){let l=e[c];if(l==="\\"){let u=e[c+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),c+=1,r="",i=!1;continue}if(o){l==="]"&&(o=!1,r="]",i=!1);continue}if(l==="["){o=!0,r="[",i=!1;continue}if(l==="?"&&(r==="("||i)){r="?",i=!1;continue}if(l==="*"||l==="+"||l==="?"){a(),r=l;continue}if(l==="{"){let u=e.indexOf("}",c),d=u===-1?"":e.slice(c+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),c=u,r="}";continue}r="{",i=!1;continue}r=l,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function pu(e,{now:t=Date.now}={}){let n=String(e);if(n.length>fh)return{error:`name pattern is ${n.length} characters; the limit is ${fh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Fj(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>ph)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${ph}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(c){if(a===null)a=t()+mh;else if(t()>a)throw new xa(`name pattern "${n}" exceeded its ${mh}ms matching budget.`);return i.test(String(c).slice(0,Mj))}}}function Th(e,t,{limit:n=Sa,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),c=String(s||"").trim().toLowerCase(),l=String(o||"").trim().toLowerCase(),u=null;if(r){let m=pu(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return Wj(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof xa)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=Rh(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let f=d.slice(0,n),p=[`${d.length} module(s) match "${t}" (top ${f.length}):`];for(let{ind:m,defineCount:h,matching:g}of f){let b=g.length?` \u2014 matching: ${bt([...new Set(g)],ej)}`:"";p.push(`- ${m.label} (defines ${h} symbol(s))${b}`)}return p.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),p.join(`
|
|
4
|
+
`)}function Re(e,t){let n=hh.get(e);n||(n=new Map,hh.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(ws(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function hs(e,t){let n=e.byId?.get?.(t);if(n)return Kn(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Kn(e,t){if((t?.class||"")==="Module")return t.id;let n=Bt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function mu(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function nr(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function Ah(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${bs(t.class)} (id: ${t.id})`],o=Re(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
|
|
5
|
+
`);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=mu(c?Bt(c):null),u=c?nr(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${bt(r,gh)}`),i.length&&s.push(`attributes (${i.length}): ${bt(i,gh)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
|
|
6
|
+
`)}function Ch(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Bt(t),o=[`${t.label} \u2014 ${bs(t.class)}${mu(s)}`],r=Ge(t,"params"),i=Ge(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];Ge(t,"isStatic")&&a.push("static"),Ge(t,"isAbstract")&&a.push("abstract"),Ge(t,"isConstant")&&a.push("constant");let c=Ge(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=nr(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=Ge(t,"raises");u&&o.push(`raises: ${u}`);let d=Ge(t,"catches");d&&o.push(`catches: ${d}`);let f=Ge(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=Ge(t,"value");p&&o.push(`value: ${p}`);let m=Ge(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
|
|
7
|
+
`)}function Ih(e,t){let n=Re(e,"inherits"),s=n.filter(c=>c.subject===t.id).map(c=>c.objectLabel||c.object),o=new Map;for(let c of n)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push({id:c.subject,label:c.subjectLabel||c.subject});let r=[`${t.label} \u2014 ${bs(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${bt(s,bh)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of $a(t.id,l=>o.get(l)||[],{maxDepth:8,keyOf:l=>l.id}))c.length&&i.push(c.map(l=>l.label).sort((l,u)=>String(l).localeCompare(String(u))));let a=i.reduce((c,l)=>c+l.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((c,l)=>r.push(` depth ${l+1} (${c.length}): ${bt(c,bh)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
|
|
8
|
+
`)}function ja(e){let t=new Map;for(let n of e){let s=n.label.includes("/")?n.label.slice(0,n.label.lastIndexOf("/")):"(root)";t.set(s,(t.get(s)||0)+1)}return t}function ka(e,t=""){let n=gs(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||gs(s.label).startsWith(n)))}function Oh(e,{pkg:t=""}={}){let n=gs(t),s=ka(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=ja(s),r=new Map;for(let u of Re(e,"imports"))r.set(u.object,(r.get(u.object)||0)+1);let i=new Set(s.map(u=>u.id)),a=[...r.entries()].filter(([u])=>i.has(u)).sort((u,d)=>d[1]-u[1]).slice(0,zj).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),c=[...o.entries()].sort((u,d)=>d[1]-u[1]),l=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${c.length} package(s).`];return l.push(`packages (by module count): ${bt(c.map(([u,d])=>`${u} (${d})`),Dj)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
|
|
9
|
+
`)}function Nh(e,t){let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Bt(t)?.path||n,o=[...new Set(Re(e,"tests").filter(a=>a.object===n).map(a=>a.subjectLabel||a.subject))],r=o.length>0,i=r?`covered by ${o.length} test module(s):
|
|
10
|
+
${bt(o,Lh,`
|
|
11
11
|
`)}`:"no covering tests recorded (no test module imports it).";return n===t.id?`${s}: ${i}`:`${t.label} is defined in ${s}, which ${r?"is":"has"} ${i}
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
`)}`:"every source module has at least one covering test module."}function
|
|
15
|
-
${
|
|
16
|
-
`)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=
|
|
17
|
-
${
|
|
18
|
-
`)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function
|
|
19
|
-
${
|
|
20
|
-
`)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=
|
|
21
|
-
${
|
|
22
|
-
`)}`:`${s}: no recorded callees.`}function
|
|
23
|
-
${
|
|
24
|
-
`)}`}function
|
|
25
|
-
\u2026+${o.length-
|
|
12
|
+
${Uj}`}function Ph(e,{codeDomainActive:t=null}={}){let n=t??ti(e)>0,s=new Set,o=new Set;for(let a of Re(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!wo(String(a.label).toLowerCase()));if(!r.length)return n?ti(e)===0?`no modules to check for test coverage in this index. ${du}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.":"this session holds no graph to check test coverage against.";let i=r.filter(a=>!s.has(a.id)).map(a=>a.label).sort();return i.length?`${i.length} source module(s) with no covering test module:
|
|
13
|
+
${bt(i,Lh,`
|
|
14
|
+
`)}`:"every source module has at least one covering test module."}function Mh(e,t){let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Re(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${bt(o,tn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Dh(e,t,{toolNamePrefix:n="tmct_"}={}){if(Fh.has(t.class)){let i=[...new Set(Re(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
|
|
15
|
+
${bt(i,ni,`
|
|
16
|
+
`)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=Kn(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(Re(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
|
|
17
|
+
${bt(r,ni,`
|
|
18
|
+
`)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function zh(e,t){if(Fh.has(t.class)){let r=[...new Set(Re(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
|
|
19
|
+
${bt(r,ni,`
|
|
20
|
+
`)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(Re(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
|
|
21
|
+
${bt(o,ni,`
|
|
22
|
+
`)}`:`${s}: no recorded callees.`}function Uh(e,t){let n=e.byId.get(t.object),s=n?Bt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function hu(e,t){if(!t?.id)return"";let n=Re(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${bt(n.map(s=>Uh(e,s)),Bj)}`:""}function Bh(e,t){let n=Re(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${bs(t.class)}: no in-repo calls recorded (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`;let s=n.map(o=>Uh(e,o));return`${t.label} \u2014 ${bs(t.class)} calls ${n.length} in-repo symbol(s):
|
|
23
|
+
${bt(s,ni,`
|
|
24
|
+
`)}`}function Wh(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=Ge(s,"commitDate")||Ge(s,"date"),i=Ge(s,"commitAuthor")||Ge(s,"author"),a=Ge(s,"commitMessage")||Ge(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function Gh(e,t){let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Re(e,"touches").filter(a=>a.object===n);if(!o.length)return`${s}: no commit history recorded (outside the git-log window or unmodified).`;let r=o.slice(0,tn).map(a=>` ${Wh(e,a.subject,a.subjectLabel)}`),i=o.length>tn?`
|
|
25
|
+
\u2026+${o.length-tn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
|
|
26
26
|
${r.join(`
|
|
27
|
-
`)}${i}`}function
|
|
28
|
-
\u2026+${n.length-
|
|
27
|
+
`)}${i}`}function Vh(e,t){let n=Re(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${bs(t.class)}: no symbol-level commit history recorded (outside the git-log window, or fine-grained history is not in the extracted graph).`;let s=n.slice(0,tn).map(r=>` ${Wh(e,r.subject,r.subjectLabel)}`),o=n.length>tn?`
|
|
28
|
+
\u2026+${n.length-tn} more`:"";return`${t.label} \u2014 ${bs(t.class)}: touched by ${n.length} commit(s):
|
|
29
29
|
${s.join(`
|
|
30
|
-
`)}${o}`}function
|
|
31
|
-
`)}function
|
|
30
|
+
`)}${o}`}function Hh(e,t){return Vh(e,t)}function qh(e,t){return Vh(e,t)}function gu(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Kh[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!nr(a).toLowerCase().includes(s))continue;let c=String(a.label).toLowerCase(),l=t.length?0:1;for(let u of t)c.includes(u)&&(l+=5);t.length&&!l||i.push({ind:a,score:l})}return i.sort((a,c)=>c.score-a.score||String(a.ind.label).length-String(c.ind.label).length),i}function Wj(e,t,{limit:n=Sa,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Kh[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=gu(e,t,{kind:s,decFilter:o,nameRe:r});if(!c.length)return`no ${s} matches the given filters.`;let l=c.slice(0,n),u=[`${c.length} ${s}(s) match (top ${l.length}):`];for(let{ind:d}of l)u.push(`- ${d.label}${mu(Bt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
|
|
31
|
+
`)}function Zj(e){return{paramCount:Ra(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function ek(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>Ra(i.params)),n=e.filter(i=>!!i.returns).length,s=e.filter(i=>!!i.raises).length,o=new Map;for(let i of e)for(let a of i.callees||[])o.set(a,(o.get(a)||0)+1);let r=new Set([...o.entries()].filter(([,i])=>i>=2).map(([i])=>i));return{paramCount:Qj(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function tk(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(Ra(e.params)-t.paramCount));!!e.returns===t.hasReturns&&(n+=2),!!e.raises===t.hasRaises&&(n+=2);let s=[...e.callees||[]].filter(o=>t.callees.has(o)).length;return n+Math.min(s,4)*2}function nk(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of cu(f.decorators))r.set(p,(r.get(p)||0)+1);let i="",a=1;for(let[f,p]of r)p>a&&(a=p,i=f);let c=new Set(cu(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(wh(n)),d=s?.start??null;for(let f of e){let p=cu(f.decorators).some(b=>l.has(b))?1:0,m=wh(f.label).filter(b=>u.has(b)).length,h=tk(f,o),g=d!=null&&f.site?1/(1+Math.abs(f.site.start-d)):0;f._score=p*1e3+m*50+h+g}return[...e].sort((f,p)=>p._score-f._score||(f.site?.start||0)-(p.site?.start||0))}function or(e,t){let n=Kn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Re(e,"defines").filter(x=>x.subject===n),r=new Map;for(let x of Re(e,"callsSymbol"))r.has(x.subject)||r.set(x.subject,new Set),r.get(x.subject).add(x.object);let i=[],a=[],c=0;for(let x of o){let A=e.byId.get(x.object);if(!A)continue;let L=A.class||"",T=Bt(A);L==="GlobalVariable"?(a.push({label:A.label,value:(A.attributes||[]).find(O=>O.key==="value")?.value||"",site:T}),T&&(c=Math.max(c,T.end))):(L==="Function"||L==="Class")&&(i.push({id:A.id,label:A.label,class:L,site:T,decorators:nr(A),raises:Ge(A,"raises"),doc:Ge(A,"doc"),params:Ge(A,"params"),returns:Ge(A,"returns"),callees:r.get(A.id)||new Set}),T&&(c=Math.max(c,T.end)))}let l=Bt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:nr(t),raises:Ge(t,"raises"),params:Ge(t,"params"),returns:Ge(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?Zj(u):ek(i);i=nk(i,u||{label:t.label},f);let p=u?null:i.find(x=>x.site&&x.label!==t.label)||null,m=[...new Set(Re(e,"tests").filter(x=>x.object===n).map(x=>x.subjectLabel||x.subject))].slice(0,qj),h=Qh(e,n).slice(0,Hj),g=Re(e,"reexports").filter(x=>x.subject===n).map(x=>x.objectLabel||x.object).slice(0,20),b=Ge(e.byId.get(n),"all"),y=Re(e,"contains"),$=null;(t.class||"")==="Class"?$=t.id:(t.class||"")==="Method"&&($=y.find(x=>x.object===t.id)?.subject||null);let E=null;if($){let x=e.byId.get($),A=y.filter(L=>L.subject===$).map(L=>{let T=e.byId.get(L.object);return{label:L.objectLabel||T?.label||L.object,class:T?.class||"",site:T?Bt(T):null,decorators:T?nr(T):"",params:T?Ge(T,"params"):"",returns:T?Ge(T,"returns"):"",raises:T?Ge(T,"raises"):""}}).slice(0,Vj);E={className:x?.label||String($).replace(/^fn:.*#/,""),members:A,total:y.filter(L=>L.subject===$).length}}let R=null;for(let x of[...i,...a])x.site&&(!R||x.site.start>R.start)&&(R=x.site);let v=R?{start:R.start,end:R.end}:null,j=u||p,k=j?.id?e.byId.get(j.id):null,w=k?hu(e,k):"",S=[];if(j?.callees)for(let x of j.callees){let A=e.byId.get(x),L=A?Bt(A):null;if(L&&S.push({label:A.label,site:L}),S.length>=Jj)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:p,globals:a,tests:m,cochange:h,exports:g,allExports:b,classMembers:E,insertion:c,insertionRegion:v,calleeBodies:S,callHint:w,siblingCap:Gj}}function yo(e){let t={anchor:!0,exemplar:!0,registration:!0,insertionRegion:!0,allExports:!0,classMembers:!0,siblings:!0,reexports:!0,tests:!0,cochange:!0,inlinedCallees:!1};return e==="TINY"?{...t,classMembers:!1,siblings:!1,reexports:!1,tests:!1,cochange:!1}:e==="LARGE"||e==="FULL"?{...t,inlinedCallees:!0}:t}function Yh(e){return{...e,anchor:!1,exemplar:!1,inlinedCallees:!1,classMembers:!1,reexports:!1,tests:!1,cochange:!1,registration:!0,siblings:!0,insertionRegion:!0,allExports:!0}}function _a(e,t,{untuned:n=!1}={}){let s=e.anchor||e.exemplar,o="TINY";if(e.anchor&&e.anchor.site||e.exemplar&&e.exemplar.site||(o="MID"),e.classMembers&&e.classMembers.members&&e.classMembers.members.length&&(o="MID"),s){let i=s.site?s.site.end-s.site.start+1:1/0,a=Ra(s.params);(i>Kj||a>Yj||s.raises)&&(o="MID");let c=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),f=d?Bt(d):null;if(f&&f.path!==e.moduleLabel){c=!0;break}}let l=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=Xj;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:yo(o),topup:o!=="TINY"}}function Xh(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
|
|
32
32
|
## members of ${e.classMembers.className}:`);for(let n of e.classMembers.members){let s=String(n.label).split(".").pop(),o=n.params!=null&&n.params!==""?`(${n.params})${n.returns?` -> ${n.returns}`:""}`:"",r=n.decorators?`@${n.decorators} `:"",i=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${s}${n.site?` :${n.site.start}`:""} ${r}${s}${o}${i}`)}}if(e.siblings.length){t.push(`
|
|
33
33
|
## sibling symbols (most relevant first; ${e.siblings.length} total):`);for(let n of e.siblings.slice(0,e.siblingCap)){let s=n.decorators?`@${n.decorators} `:"",o=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${n.label}${n.site?` :${n.site.start}`:""} ${s}${o}`)}e.siblings.length>e.siblingCap&&t.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return e.allExports&&t.push(`
|
|
34
34
|
## module __all__: ${e.allExports}`),e.exports&&e.exports.length&&t.push(`
|
|
35
35
|
## re-exported symbols: ${e.exports.join(", ")}`),e.tests.length&&t.push(`
|
|
36
36
|
## covering tests: ${e.tests.join(", ")}`),e.cochange&&e.cochange.length&&t.push(`
|
|
37
37
|
## usually changed together: ${e.cochange.map(n=>`${n.label} (\xD7${n.weight})`).join(", ")}`),t.length===1&&t.push("(no omitted sections \u2014 the lean bundle already contained everything for this symbol.)"),t.join(`
|
|
38
|
-
`)}function
|
|
38
|
+
`)}function Jh(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
|
|
39
39
|
## registration / module globals (replicate this pattern):`);for(let s of e.globals)n.push(` ${s.label} = ${s.value}${s.site?` [:${s.site.start}]`:""}`)}if(t.classMembers&&e.classMembers&&e.classMembers.members.length){n.push(`
|
|
40
40
|
## members of ${e.classMembers.className}:`);for(let s of e.classMembers.members){let o=String(s.label).split(".").pop(),r=s.params!=null&&s.params!==""?`(${s.params})${s.returns?` -> ${s.returns}`:""}`:"",i=s.decorators?`@${s.decorators} `:"",a=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${o}${s.site?` :${s.site.start}`:""} ${i}${o}${r}${a}`)}}if(t.siblings&&e.siblings.length){n.push(`
|
|
41
41
|
## sibling symbols to copy the style of (most relevant first; ${e.siblings.length} total):`);for(let s of e.siblings.slice(0,e.siblingCap)){let o=s.decorators?`@${s.decorators} `:"",r=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${s.label}${s.site?` :${s.site.start}`:""} ${o}${r}`)}e.siblings.length>e.siblingCap&&n.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return t.allExports&&e.allExports&&n.push(`
|
|
@@ -45,66 +45,66 @@ ${s.join(`
|
|
|
45
45
|
## insert the new sibling after line ~${e.insertion} (end of the last top-level definition).`)),t.tests&&e.tests.length&&n.push(`
|
|
46
46
|
## covering tests: ${e.tests.join(", ")}`),t.cochange&&e.cochange&&e.cochange.length&&n.push(`
|
|
47
47
|
## usually changed together (consider editing these too): ${e.cochange.map(s=>`${s.label} (\xD7${s.weight})`).join(", ")}`),n.join(`
|
|
48
|
-
`)}function
|
|
48
|
+
`)}function Qh(e,t){let n=[];for(let s of Re(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function Zh(e,t){let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Qh(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,lu).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
|
|
49
49
|
${r.join(`
|
|
50
|
-
`)}`+(o.length>
|
|
51
|
-
\u2026+${o.length-
|
|
50
|
+
`)}`+(o.length>lu?`
|
|
51
|
+
\u2026+${o.length-lu} more`:"")}function eg(e,t){let n=Kn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Re(e,"reexports").filter(i=>i.subject===n);if(!o.length)return`${s}: no public exports recorded (no export list / __all__ found, or none resolved).`;let r=o.slice(0,uu).map(i=>{let a=e.byId.get(i.object),c=a?Bt(a):null,l=c?` \u2190 ${c.path}`:"";return`${i.objectLabel||i.object}${l}`});return`${s} \u2014 public API (${o.length} export(s)):
|
|
52
52
|
${r.join(`
|
|
53
|
-
`)}`+(o.length>
|
|
54
|
-
\u2026+${o.length-Al} more`:"")}var Il,lh,xh,ph,IE,OE,Rl,LE,Qi,NE,PE,ME,kh,FE,DE,zE,UE,BE,WE,GE,VE,HE,qE,KE,YE,XE,JE,QE,ZE,eS,tS,nS,sS,oS,rS,iS,aS,cS,fh,lS,uS,jh,Rh,_h,dS,pS,fS,hS,mS,mh,gh,wS,bh,Xi,wh,yh,$h,Dr,ze,$S,vS,Mh,xS,Yt,Uh,ES,Jh,kS,jS,RS,_S,TS,AS,IS,CS,_l,vh,ta,OS,Tl,Al,Pe=C(()=>{js();ns();El();Mr();_s();Il="This store holds no code index, so it records no modules or commits to look through.",lh={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};xh=e=>/^(git|turn):/.test(String(e||""));ph=30,IE=8;OE=2,Rl=25,LE=3;Qi=10,NE=8,PE=3,ME=2,kh=5,FE=4,DE=.2,zE=.35,UE=.15,BE=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),WE=.2,GE=.35,VE=.2,HE=.35,qE=e=>/\.cs$/i.test(e),KE=e=>/^I[A-Z]/.test(String(e||"")),YE=.2,XE=.35,JE=50,QE=.2,ZE=.35,eS=.5,tS=kh,nS=3,sS=4,oS=1,rS=.9,iS=.5,aS=.2,cS=.35,fh=4,lS=2,uS=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],jh=3,Rh=12,_h=.9,dS=["imports","calls","callsSymbol","inherits"],pS=.5,fS=.6,hS=.2,mS=.35;mh=128,gh=4,wS=64,bh=250,Xi=class extends Error{};wh=new WeakMap;yh=40,$h=40,Dr=30;ze=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";$S=25,vS=15;Mh=40,xS="tests edges are recorded module to module, so this is module-grain coverage.";Yt=15;Uh=new Set(["Function","Method"]);ES=8;Jh={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};kS=8,jS=16,RS=4,_S=6,TS=12,AS=2,IS=8,CS=3,_l=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),vh=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),ta=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},OS=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};Tl=20;Al=40});function Ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function um(e){let t=String(e||"");return om&&(t=t.replace(om," ")),t.replace(/\s+/g," ").trim()}function dm(e){let t=String(e||"");t=t.replace(nk," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(JS);if(o&&(t=o[1].trim()),o=t.match(QS),o&&(t=o[1].trim()),o=t.match(rm),o&&(t=o[1].trim()),o=t.match(im),o&&(t=o[1].trim()),o=t.match(am),o&&(t=o[1].trim()),o=t.match(tk),o&&(t=o[1].trim()),o=t.match(cm),o&&(t=o[1].trim()),o=t.match(sk),o&&(t=o[1].trim()),o=t.match(ok),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(rk),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(ik),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(ak),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(ck),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(lk),o&&Ts.test(o[1].trim())&&(t=o[1].trim()),o=t.match(uk),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(dk),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(pk),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(fk),o){let r=o[1].trim();XS(r)||(t=!hk.test(r)&&(qS.test(r)||Ts.test(r))?r:`describe ${r}`)}if(o=t.match(mk),o){let r=o[1].trim();(Ts.test(r)||gk.test(r)||cm.test(r)||rm.test(r)||am.test(r)||im.test(r)||bk.test(r))&&(t=r)}if(t===s)break}return t}function Rk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(kk);if(o&&(t=o[1].trim()),o=t.match(jk),o&&(t=o[1].trim()),t===s)break}return t}function Tk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(_k);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function Ck(e){let t=String(e||""),n=t.match(Ik);if(n){let o=fm[n[1].toLowerCase()],r=pm[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(hm);return s?`which modules transitively import ${s[1].trim()}`:t}function oa(e){return String(e||"").replace(DS,t=>ml[t.toLowerCase()])}function io(e){let t=oa(e);return t=t.replace(zS,n=>gl[n.toLowerCase()]),t=t.replace(US,n=>bl[n.toLowerCase()]),t=t.replace(BS,"with"),t=t.replace(WS,(n,s)=>`${s} for`),t=t.replace(GS,(n,s)=>`for ${s}`),t=t.replace(VS,(n,s)=>s),t=t.replace(Ok,"$1$2"),t=t.replace(Of,"$1ing"),t=dm(t),t=Tk(t),t=Rk(t),t=Ck(t),t=um(t),t=on(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Ur(e){for(let t of[...Nf,...Lf]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Ml(e){for(let t of Lk){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function mm(e){let t=String(e||"").match(Nk);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var FS,DS,lm,zS,US,BS,WS,GS,VS,HS,om,qS,Ts,KS,YS,XS,zr,JS,QS,ZS,ek,rm,im,am,tk,nk,sk,ok,rk,ik,ak,ck,lk,uk,dk,pk,fk,hk,mk,gk,bk,cm,sa,wk,yk,$k,vk,xk,Ek,Sk,tP,kk,jk,_k,pm,fm,Ak,Ik,hm,Ok,Lk,Nk,nt,Xt,pe,fn=C(()=>{On();FS=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ye).join("|")+")\\b","gi"),DS=FS(ml),lm=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ye).join("|")+")\\b(?!\\.[a-z0-9])","gi"),zS=lm(gl),US=lm(bl),BS=/(?<=^|\s)w\/(?=\s|$)/gi,WS=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,GS=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,VS=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,HS=Object.keys(ue).sort((e,t)=>t.length-e.length).map(Ye).join("|"),om=Or.length?new RegExp("\\b("+[...Or].sort((e,t)=>t.length-e.length).map(Ye).join("|")+")\\b\\s*,?","gi"):null;qS=new RegExp("\\b(?:"+Object.keys(ue).sort((e,t)=>t.length-e.length).map(Ye).join("|")+")\\b","i"),Ts=/^(?:which|what|who|whose|where|when|why|how)\b/i,KS=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),YS=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,XS=e=>{if(YS.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return KS.has((t[t.length-1]||"").toLowerCase())},zr="[,.;:!]|\u2014|\u2013|-",JS=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,QS=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,ZS="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",ek="(?:just\\s+)?(?:one|another)\\s+more",rm=new RegExp(`^(?:(?:${ZS})[\\s,]+|(?:${ek})\\s*(?:${zr})\\s*)+(.+)$`,"i"),im=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,am=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,tk=/^(?:please[\s,]+)+(.+)$/i,nk=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,sk=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,ok=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,rk=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,ik=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,ak=/^do\s+you\s+know\s+(.+?)\??$/i,ck=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,lk=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,uk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,dk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,pk=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,fk=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,hk=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,mk=/^(?:and|also|so|then|now|but)\s+(.+)$/i,gk=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,bk=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,cm=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;sa=e=>[...e].sort((t,n)=>n.length-t.length).map(Ye).join("|"),wk=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),yk=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),$k=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),vk=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),xk=`(?:${sa(wk)})(?:\\s+(?:${sa(yk)}))?\\s*(?:${zr})\\s*`,Ek=`(?:${sa($k)})\\s*(?:(?:${zr})\\s*|\\s+)`,Sk=`(?:${sa(vk)})\\s*(?:${zr})\\s*`,tP=new RegExp(`^(?:sorry\\s*(?:${zr})?\\s*)?(?:${xk}|${Ek}|${Sk})+`,"i"),kk=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,jk=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;_k=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;pm=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),fm=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),Ak="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",Ik=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(fm).join("|")+")\\s+("+Object.keys(pm).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+Ak+")\\??$","i"),hm=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;Ok=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${fl.map(Ye).join("|")})(\\s*[?.!]*)$`,"i");Lk=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${hl.map(Ye).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${HS})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);Nk=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");nt=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),Xt=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),pe=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var bm,gm=C(()=>{bm={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function as(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let l=1;l<=t.length;l+=1){let c=e[r-1]===t[l-1]?0:1,u=Math.min(o[l]+1,i[l-1]+1,o[l-1]+c);r>1&&l>1&&e[r-1]===t[l-2]&&e[r-2]===t[l-1]&&(u=Math.min(u,s[l-2]+c)),i[l]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Dl(e){return/^[a-z]+$/.test(e)&&!nt.has(e)&&!Fl.has(e)}function $m(e){return Dk(e)?null:ra(e,ym,cs(e))}function ra(e,t,n=cs(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=as(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var Mk,cs,Fl,wm,ym,Fk,Dk,Go=C(()=>{On();gm();fn();Mk=["used"];cs=e=>e.length<=5?1:2,Fl=new Set([...Object.keys(ue),...Object.keys(He),...Object.keys(rn),...Mk].flatMap(e=>e.split(" "))),wm=4,ym=[...new Set([...Object.keys(ue),...Object.keys(rn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=wm))],Fk=new Set(bm.words),Dk=e=>Fk.has(e)});function Vo(e){for(let t of Wk){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var ia,zk,Uk,Bk,zl,Wk,vm,aa=C(()=>{On();fn();ia=Object.keys(ue).sort((e,t)=>t.length-e.length).map(Ye).join("|"),zk=Object.keys(He).sort((e,t)=>t.length-e.length).map(Ye).join("|"),Uk=Object.keys(rn).sort((e,t)=>t.length-e.length).map(Ye).join("|"),Bk=Zs.slice().sort((e,t)=>t.length-e.length).map(Ye).join("|"),zl=(e,t)=>e==="defines"&&Cr.has(t),Wk=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${ia})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=ue[t];if(zl(n,t))return null;let s=e[1].trim(),o=e[3].trim();return Ir.includes(t)&&([s,o]=[o,s]),{shape:"ask",entityType:null,modifier:"direct",kind:n,subject:s,object:o}}},{name:"reverse",re:new RegExp(`^which\\s+(${zk})\\s+(?:(${Uk})\\s+)?(${ia})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=ue[t];return zl(n,t)?null:{shape:"reverse",entityType:He[e[1].toLowerCase()],modifier:e[2]?rn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${ia})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=ue[t];return zl(n,t)?null:{shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()}}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${Bk})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=on(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!He[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&If.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Es(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${xn.map(Ye).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${sn.map(Ye).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${ia})\\??$`,"i"),build:e=>ue[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];vm={id:"grammar",class:"graph-query",run(e){let t=Vo(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function xm(e){let t=e.trim().split(/\s+/);return t.length>1&&Di.has(t[0].toLowerCase())}function qk(e){return ue[e.trim().toLowerCase()]==="calls"}function It(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,l)=>n.has(i+l)))&&r.every((a,l)=>e[i+l]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function Wr(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(E=>E.toLowerCase());if(s.includes("where")&&!It(s,ue)){let E=s.some(R=>xn.includes(R)),S=new Set([...sn,...xn]),_=n.filter((R,T)=>!nt.has(s[T])&&!S.has(s[T])).join(" ").trim();if(_){let R=E?"mentions":"where";return{shape:R,entityType:null,modifier:"direct",kind:R,object:_}}}if(new Set(["has","have","had"]).has(s[0])){let E=s.length;for(;E>1&&(s[E-1]==="ever"||s[E-1]==="been");)E-=1;if((E>1?ue[s[E-1]]:null)==="touches"){let _=n.slice(1,E-1).filter((R,T)=>!nt.has(s[1+T])).join(" ").trim();if(_)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:_}}}let r=s,i=It(s,ue);if(!i&&t){let E=s.map(S=>{if(!Dl(S))return S;let _=t.lemma(S);return Fl.has(_)?_:S});i=It(E,ue),i&&(r=E)}let a=null;if(!i){let E=s.map(S=>S.length>=4&&Dl(S)&&$m(S)||S);if(i=It(E,ue),i){r=E;let S=s.slice(i.start,i.end).findIndex((R,T)=>R!==E[i.start+T]),_=i.start+Math.max(S,0);a={from:s[_],to:E[_]}}}let l=!1;if(!i)for(let E=0;E<s.length;E+=1){let S=Ss[s[E]];if(!(S&&s[E]==="used"&&s[E+1]==="for")&&S&&s.slice(0,E).some(_=>Br.has(_))){i={kind:S,start:E,end:E+1},l=!0;break}}if(!i)return null;!l&&i.end-i.start===1&&Ss[s[i.start]]&&s.slice(0,i.start).some(E=>Br.has(E))&&(l=!0);let c=E=>a?{...E,fuzzyVerb:a}:E;if(t&&i.end-i.start===1){let E=i.start,S=s[E-1];if((S==="the"||S==="these"||S==="those")&&s[E+1]==="of"&&t.posTags(n)[E]==="NOUN"){let R=n.slice(E+2).filter((T,M)=>!nt.has(s[E+2+M])).join(" ").trim();if(R)return c({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:R})}}let u=new Set,d=E=>{if(E)for(let S=E.start;S<E.end;S+=1)u.add(S)};d(i);for(let[E,S]of Object.entries(ue)){if(S!==i.kind)continue;let _=E.split(" "),R=i.end;if(_.every((T,M)=>r[R+M]===T)){d({start:R,end:R+_.length});break}}let p=It(r,He,u);d(p);let f=It(r,rn,u);d(f);let h=(E,S)=>n.slice(E,S).filter((_,R)=>!u.has(E+R)&&!nt.has(s[E+R])).join(" ").trim(),m=h(0,i.start),b=h(i.end,n.length);l&&!s.includes("by")&&Hk.has(b.toLowerCase())&&(b="");let g=i.kind,y=p?He[r.slice(p.start,p.end).join(" ")]:null,w=f?rn[r.slice(f.start,f.end).join(" ")]:"direct";if(g==="touches"&&s.includes("when")){let E=m||b;if(E)return c({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:E})}if(g==="touches"&&s.includes("who")&&s.includes("last")){let E=m||b;if(E)return c({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:E})}let v=s.indexOf("by"),k=s.slice(0,i.start).findIndex(E=>Br.has(E)),$=k>=0,x=$&&k>v;if(v>=0&&!u.has(v)&&$){let E=(R,T)=>n.slice(R,T).filter((M,I)=>{let D=R+I,B=s[D];return!u.has(D)&&!nt.has(B)&&B!=="by"&&!Br.has(B)&&!Gk.has(B)&&!Vk.has(B)}).join(" ").trim(),[S,_]=x?[E(k+1,n.length),E(v+1,k)]:[E(0,v),E(v+1,n.length)];if(S&&_)return g==="defines"&&Cr.has(r.slice(i.start,i.end).join(" "))?null:c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:_,object:S});if(_)return c({shape:"forward",entityType:y,modifier:w,kind:g,object:_});if(S)return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:S})}if(l&&v<0&&b&&s[i.start]==="called")return null;if(m&&b){let E=r.slice(i.start,i.end).join(" ");if(g==="defines"&&Cr.has(E)||g==="calls"&&(xm(b)||qk(m)))return null;let S=m,_=b;return Ir.includes(E)&&([S,_]=[_,S]),c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:S,object:_})}if(b){if(g==="calls"&&xm(b))return null;let E=p&&p.start>=i.end?null:y;return c({shape:"reverse",entityType:E,modifier:w,kind:g,object:b})}if(g==="inherits"&&!m&&p&&p.start===i.end){let E=r.slice(p.start,p.end).join(" ");if(E)return c({shape:"reverse",entityType:null,modifier:w,kind:g,object:E})}if(m&&!b&&$&&i.end-i.start===1&&Ss[s[i.start]]){if(m.split(/\s+/).length>1)return null;if(g==="touches")return c({shape:"when",entityType:null,modifier:"direct",kind:g,object:m});let E=Br.has(s[0]);return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:m,...E?{polar:!0}:{}})}return m?c({shape:"forward",entityType:y,modifier:"direct",kind:g,object:m}):null}var Br,Gk,Vk,Hk,Em,ca=C(()=>{On();fn();Go();Br=new Set(["is","are","was","were","be","been","being","get","gets","got"]),Gk=new Set(["which","what","who","whom","whose"]),Vk=new Set(es.map(e=>e.toLowerCase())),Hk=new Set(["recently","lately","yet","already","ever","again"]);Em={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Wr(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function Yk(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],l=a.toLowerCase();!/^[a-z]+$/.test(a)||Sm.has(l)||!s.has(l)||o[i]==="VERB"&&r.push(l)}return r}function Xk(e,t=null){let n=Xt(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!Sm.has(a)&&(Kk.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=Yk(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var Sm,Kk,km,jm=C(()=>{On();fn();aa();ca();Sm=new Set([...nt,...pe(Qs),...pe(Object.keys(ue)),...pe(Object.keys(He)),...pe(Object.keys(rn)),...pe(Object.keys(et)),...pe(eo),...pe(to),...pe(Object.keys(In)),...pe(Object.keys(Cn)),...pe(Object.keys(Lo)),...pe(es),...pe(Lr),...pe(Zs),...pe(sn),...pe(xn),...pe(Zn),...pe(Object.keys(Po))]),Kk=new Set([...pe(Or),...pe(zi)]);km={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Vo(e))return null;let{text:n,dropped:s,maybeNoise:o}=Xk(e,t.nlp||null);if(!s.length||!n)return null;let r=Vo(n)||Wr(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var Rm=C(()=>{});var la,ua=C(()=>{la=()=>{}});function Tm(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Ho(e.subject)===Ho(t.subject)&&Ho(e.object)===Ho(t.object):Ho(e.object)===Ho(t.object)}function Ul(e){let t=(e||[]).filter(c=>c&&Array.isArray(c.candidates)&&c.candidates.length);if(!t.length)return null;let n=[];for(let c of t)for(let u of c.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:c.strategyId,class:c.class});if(n.some(c=>!Am(c))&&(n=n.filter(c=>!Am(c))),!n.length)return null;let s=new Map;for(let c of n)s.has(c.class)||s.set(c.class,[]),s.get(c.class).push(c);let o=[];for(let[c,u]of s){let d=[];for(let p of u){let f=d.find(h=>Tm(h.parsed,p.parsed)&&h.via===p.via);if(f){f.agreed+=1,f.confidence=Math.max(f.confidence,p.confidence),_m(p.parsed)<_m(f.parsed)&&(f.parsed=p.parsed);continue}d.push({...p,agreed:1})}d.length&&o.push({class:c,candidates:d})}if(!o.length)return null;let r=c=>Math.max(...c.candidates.map(u=>u.confidence)),i=o[0];for(let c of o)r(c)>r(i)&&(i=c);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(c=>c.parsed)},l=o.filter(c=>c!==i).map(c=>c.candidates[0]).filter(c=>!i.candidates.some(u=>Tm(u.parsed,c.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:l}}function Zk(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function Im(e,{describe:t=Zk,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var Ho,Jk,_m,Qk,Am,Bl=C(()=>{Ho=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),Jk=/^\s*(?:the|a|an)\s+/i,_m=e=>[e?.subject,e?.object].filter(t=>Jk.test(String(t||""))).length;Qk=new Set(["fuzzy","lemma","spell"]),Am=e=>Qk.has(e.via)});function da(e){Wl=e}function pa(){return typeof Wl=="function"?Wl():null}var Wl,qo=C(()=>{Wl=null});function Lm(e,t={},n=tj){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var ej,tj,Nm=C(()=>{fn();aa();ca();jm();Rm();ua();Bl();qo();ej=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],tj=[vm,Em,km,...ej]});function Ko(e){return nj.test(String(e||"").trim())?"an":"a"}function fa(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function Yo(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Gr(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var nj,ha=C(()=>{nj=/^[aeiou]/i});var Vr,Gl=C(()=>{Vr=(e,t,n)=>n});var Sg={};qt(Sg,{DYNAMIC_TAIL_OK_RE:()=>wu,applyNegationFrames:()=>Ur,ask:()=>Os,classDisplayName:()=>ls,degreeMetric:()=>mg,metaFallbackEntityAnswer:()=>cg,normalizeQuery:()=>io,parseQuery:()=>uo,parseQueryFull:()=>ru,render:()=>Sn,rephraseHint:()=>pu,resolveObject:()=>kn,traverse:()=>Jt,worldRelationGraphPayload:()=>XR});function Je(e,t){let n=Pm.get(e);n||(n=new Map,Pm.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(is(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Ue(e,t){let[n,s]=Xl[e]||["result","results"];return t===1?n:s}function Jr(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Ue(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function ls(e){let t=String(e||"");if(typeof Ln=="function"){let n=Ln(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function ao(e){return oj[e]||e}function lj(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||cj.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return pe(Zs).includes(o)?t:e}function pj(e,t){if(!e||e.shape!=="where"||e.altObject||!uj.test(t))return e;let n=Fi(t),s=Fi(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=Xt(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||nt.has(i)||ue[i]||i.endsWith("ing"))return o;let a=Xt(n).map(c=>c.toLowerCase());for(;a.length&&dj.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let l=r.slice(0,-1).join(" ");return{...e,object:l,altObject:s,verb:i}}function uo(e,{nlp:t=void 0}={}){return ru(e,{nlp:t}).parsed}function ru(e,{nlp:t=void 0}={}){let n=t===void 0?pa():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Ml(Ur(io(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=hj(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Ul(Lm(o,{nlp:n,raw:s}));return i?{parsed:pj(lj(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Ql(e,t){return t.length&&Qm.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Qo(e,t){return Vo(e)||Wr(e,t)}function hj(e,t){let n=Xt(e),s=n.map(o=>o.toLowerCase());return Lj(n,s)||Pj(n,s)||wj(n,s,t)||eg(e,t,0)||Mj(n,s,t)||$j(n,s,t)||Rj(n,s,t,0)||Tj(n,s)||Cj(n,s,t)||Fj(n,s,t)||Uj(n,s,t)||Wj(n,s,t,0)||zj(n,s,t,0)||au(n,s,t,0)||xj(n,s,t)||gj(n,s)||ig(n,s,t,0)}function gj(e,t){let n=0;mj.has(t[n])&&(n+=1);let s=Ct(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=h=>h+1<t.length?Cf[`${t[h]} ${t[h+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,l=-1,c;for(let h=a;h+1<t.length;h+=1){let m=r(h);if(m){l=h,c=m;break}}if(l<0)return null;let u=e.slice(a,l).join(" ").trim(),d=e.slice(l+2).join(" ").trim();if(!u||!d)return null;let p=(h,m)=>h.role==="object"?{shape:"reverse",kind:h.kind,entityType:o,modifier:"direct",object:m}:{shape:"forward",kind:h.kind,modifier:"direct",object:m},f=p(i,u);return f.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:f}},{op:"intersection",kind:"set",ast:{node:"clause",clause:p(c,d)}}]}}function ga(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function wj(e,t,n){if(!["do","does","did"].includes(t[0])||!bj.has(t[1]))return null;let s=Ct(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let l=It(a,ue);if(!l)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((p,f)=>(f<l.start||f>=l.end)&&!nt.has(a[f])&&a[f]!=="from").join(" ").trim();if(!u)return null;let d=Zo(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:l.kind,object:u,complement:ga(o,{op:"difference",kind:"set",ast:d})}}function eg(e,t,n=0){let s=mm(e);if(!s)return null;let o=Ct(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=Xt(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>et[d]))return ga(r,{op:"difference",kind:"qual",filters:a});let l=It(a,ue);if(!l)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,p)=>(p<l.start||p>=l.end)&&!nt.has(a[p])&&a[p]!=="from").length)return ga(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:l.kind}});let u=Zo(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:ga(r,{op:"difference",kind:"set",ast:u})}function $j(e,t,n){let s=0;for(;s<t.length&&yj.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=It(r,ue);if(!a)return null;let c=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!nt.has(r[d])).join(" ").trim();return c?{node:"forwardComplement",kind:a.kind,subjectTerm:c}:null}function tg(e,t){let n=new Set;for(let s of t)for(let o of Je(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function ng(e,t){let n=Dt(t),s=n.filter(r=>!Xm.has(r)),o=tg(e,s.length?s:n);return o.size===1?[...o][0]:null}function Zo(e,t,n){if(n>Jm)return{node:"miss",reason:"too deep to resolve"};let s=eg(e,t,n);if(s)return s;let o=Xt(e),r=o.map(c=>c.toLowerCase()),i=au(o,r,t,n);if(i)return i;let a=ig(o,r,t,n);if(a)return a;let l=Qo(e,t);return l?{node:"clause",clause:l}:null}function au(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=Zn.includes(t[o]),i=!r&&Zm(t[o]);if(!r&&!i||r&&o+1>=t.length||!Ct(t[o-1]))continue;let l=e.slice(0,o-1);if(!l.length||l.every(p=>et[p.toLowerCase()]))continue;let c=Qo([...l,Jl].join(" "),n);if(!c||c.shape!=="reverse"&&c.shape!=="forward"||c.modifier&&c.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=Zo(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:c.shape==="reverse"?"reverseSet":"forwardSet",kind:c.kind,entityType:c.entityType,inner:d}}return null}function xj(e,t,n){for(let s=0;s<t.length;s+=1){if(!vj.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!ue[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Jl,...e.slice(s+1)],a=Qo(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Jl&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function Rj(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!Ej.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(Sj.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&kj.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&jj.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>Zn.includes(d)))return null;let l=iu.has(a[0])?i.join(" "):`which ${i.join(" ")}`,c=Zo(l,n,s+1);if(!c||c.node==="miss")return c?{node:"miss",reason:c.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=Ct(a[0]);return{node:"temporal",inner:c,entityType:u&&u.entityType||null}}function Tj(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!_j.has(t[n]))return null;let s=t[n],o=e.slice(n+1).join(" ").trim();return o?{node:"commitFilter",op:s,pivotRaw:o}:{node:"miss",reason:`"what changed ${s}" needs a date or commit afterward`}}function Ij(e){let t=new Set,n=[];for(let s of e){if(!s||!Aj.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function Cj(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!Lr.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let p=t.slice(0,d).join(" ");if(d===t.length-1&&(eo.includes(p)||to.includes(p))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=eo.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=Oj(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let l=o?s-1:s,c=Ij(e.slice(0,l)),u={node:"anaphora",mode:i,filter:a};return c.length>=2&&(u.candidateTerms=c),u}function Oj(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&fj.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>et[a]))return{type:"qual",filters:r};if(o.length===1){let a=Ct(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Qo(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function Lj(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?Ct(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let l=i.indexOf("in",1);if(l>0){let u=a.slice(1,l).join(" ").trim(),d=a.slice(l+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:c,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:null,scopeModule:l}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function Nj(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Es(n).slice(e.length).trim(),o=Xt(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function Pj(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let c=1;c<t.length;c+=1)if(et[t[c]]){n=c,s=t[c-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&Ss[t[n]]){let c=o+1;for(;c<t.length&&(t[c]==="the"||t[c]==="a"||t[c]==="an");)c+=1;let u=t[c];if(u&&!Pf.has(u))return null}let r=Nj(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let l=a>i?e.slice(i,a).join(" ").trim():"";return l?{node:"qualCheck",term:l,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function Mj(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=Qo(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function Fj(e,t,n){let s=eo.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&et[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?Ct(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let l=e.slice(o),c=t.slice(o).some(d=>!nt.has(d)&&!sg.has(d)),u;if(c){let d=Zo(`which ${a} ${l.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function zj(e,t,n,s){let o=0,r=!1,i=null;for(let y of og){let w=y.split(" ");if(t.slice(0,w.length).join(" ")===y){i=y,o=w.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&cu.has(t[o]);)o+=1;let a=[];for(;o<t.length&&et[t[o]];)a.push(t[o]),o+=1;let l=o<t.length?Ct(t[o]):null;if(!l||l.placeholder||l.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!ue[t[o]]&&!es.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${rg}`}:null;let c=l.entityType,u=t[o];o+=1;let d=e.slice(o),p=t.slice(o).some(y=>!nt.has(y)&&!sg.has(y)),f=t.slice(o),h=d;(f[0]==="is"||f[0]==="are")&&(f=f.slice(1),h=h.slice(1));let m=r&&Dj.has(f[0]);if(r&&(p&&!m||d.length===0))return null;let b,g=!1;if(p){let y=m?h:d,w=Zo(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!w||w.node==="miss")return{node:"miss",reason:w&&w.reason||"the list filter didn't parse"};b=w,g=!0}else b={node:"allOfClass",entityType:c},a.length&&(b={node:"qualifier",filters:a,inner:b});return{node:"list",entityType:c,base:b,scoped:g}}function Uj(e,t,n){let s=null,o=-1;for(let h=0;h<t.length;h+=1){let m=t.slice(h,h+2).join(" ");if(In[m]){s=In[m],o=h;break}if(In[t[h]]){s=In[t[h]],o=h;break}}if(!s)return null;let r=null,i=null;for(let h=o;h<t.length;h+=1)if(Cn[t[h]]){r=Cn[t[h]],i=t[h];break}if(!r){for(let h=o-1;h>=0;h-=1)if(Cn[t[h]]){r=Cn[t[h]],i=t[h];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),l=["important","significant","central","key","core","essential","critical","principal"],c=t.some(h=>l.includes(h));!r&&(a||c)&&(r=Cn.connections,i="connections");let u,d=null;for(let h of t){let m=Ct(h);if(m&&!m.placeholder){u=m.entityType,d=h;break}}if(!d&&(u=i?Mf[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let p=["needs","need","needing","lacks","lack","lacking","misses","missing"],f=t.some(h=>p.includes(h))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:f}}function Wj(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&cu.has(t[o]);)o+=1;if(o>=t.length)return null;let r=Ct(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&Bj.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=Ct(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>Zn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!ue[t[o]]&&!es.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${rg}`}:null}function Gj(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&cu.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(Zn.includes(t[i])){s=i;break}if(s<0)return null;let o=Ct(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function Vj(e,t,n,s,o,r){let{branches:i,ops:a}=ba(n,s),l=null,c=[];for(let u=0;u<i.length;u+=1){let d=i[u],p=d.map(y=>y.toLowerCase()),f=u===0?"intersection":a[u-1],h=Ql(d,p);if(h.blc.length&&h.blc.every(y=>et[y])){c.push({op:f,kind:"qual",filters:h.blc});continue}if(p[0]==="of"||p[0]==="in"){c.push({op:f,kind:"set",ast:{node:"membership",entityType:e,term:d.slice(1).join(" ")}});continue}let m=d,b=It(p,ue);b?l=d.slice(b.start,b.end):l&&(m=[...l,...d]);let g=ag(`${t} ${m.join(" ")}`,o,r);if(!g||g.node==="miss")return{miss:g&&g.reason||"a clause in the combination didn't parse"};c.push({op:f,kind:"set",ast:g})}return{atoms:c}}function ig(e,t,n,s){let o=Gj(e,t);if(o){let{entityType:_,term:R,relIdx:T}=o,M=t.slice(T+1),I=e.slice(T+1);if(!M.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let D=Vj(_,`which ${t[T-1]}`,M,I,n,s+1);if(D.miss)return{node:"miss",reason:D.miss};let B=[{op:"seed",kind:"set",ast:{node:"find",entityType:_,term:R}},...D.atoms];return B.length===1?B[0].ast:{node:"boolean",entityType:_,atoms:B}}let r=0;for(;r<t.length&&iu.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&et[t[r]];)a.push(t[r]),r+=1;let l=r<t.length?Ct(t[r]):null;if(!l){let _=r+1<t.length?Ct(t[r+1]):null;if(Mm.has(t[r])&&_&&_.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(Qm.has(t[r])){let R=r+1;R<t.length&&(t[R]==="the"||t[R]==="a"||t[R]==="an")&&(R+=1);let T=R+1<t.length?Ct(t[R+1]):null;if(Mm.has(t[R])&&T&&T.entityType==="Commit"&&R+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&_&&/^[a-z]+$/.test(t[r])&&!ue[t[r]]&&!nt.has(t[r])&&!gu.has(t[r])?{node:"find",entityType:_.entityType,term:e[r]}:null}let c=l.entityType,u=t[r];r+=1;let d=t.slice(r),p=e.slice(r),f=!1;d.length&&Zn.includes(d[0])&&(f=!0,d=d.slice(1),p=p.slice(1));let h=d[0]==="of"||d[0]==="in",m=d.length>0&&Zm(d[0]),b=p.length>0&&ba(d,p).branches.some(_=>{let{blc:R}=Ql(_,_.map(T=>T.toLowerCase()));return R.length&&R.every(T=>et[T])}),g=p.length>0?ba(d,p).branches:[],y=!1;if(g.length>1){let _=g[0].map(T=>T.toLowerCase()),R=It(_,ue);R&&R.start===0&&(y=g.slice(1).every(T=>{let M=T.map(D=>D.toLowerCase()),I=It(M,ue);return I&&I.start===0?I.kind===R.kind:!I}))}let w=!1;if(g.length>1){let _=g[0].map(T=>T.toLowerCase()),R=It(_,ue);R&&R.start===0&&(w=g.slice(1).every(T=>{let M=T.map(D=>D.toLowerCase()),I=It(M,ue);return!!I&&I.start===0&&I.end-I.start===1}))}if(!(a.length||f||h||m||b||y||w))return null;if(!p.length){let _={node:"allOfClass",entityType:c};return a.length?{node:"qualifier",filters:a,inner:_,entityType:c}:{node:"miss",reason:"nothing to filter or traverse"}}let v=l.placeholder?"what":`which ${u}`,{branches:k,ops:$}=ba(d,p),x=null,E=[];for(let _=0;_<k.length;_+=1){let R=k[_],T=R.map(ae=>ae.toLowerCase()),M=_===0?"seed":$[_-1],I=Ql(R,T);if(I.blc.length&&I.blc.every(ae=>et[ae])){E.push({op:M,kind:"qual",filters:I.blc});continue}if(T[0]==="of"||T[0]==="in"){E.push({op:M,kind:"set",ast:{node:"membership",entityType:c,term:R.slice(1).join(" ")}});continue}let D=R,B=It(T,ue);B?x=R.slice(B.start,B.end):x&&(D=[...x,...R]);let X=ag(`${v} ${D.join(" ")}`,n,s+1);if(!X||X.node==="miss")return{node:"miss",reason:X&&X.reason||"a clause in the combination didn't parse"};E.push({op:M,kind:"set",ast:X})}if(E[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let S;return E.length===1?S=E[0].ast:S={node:"boolean",entityType:c,atoms:E},a.length&&(S={node:"qualifier",filters:a,inner:S,entityType:c}),S}function ag(e,t,n){if(n>Jm)return{node:"miss",reason:"too deep to resolve"};let s=Xt(e),o=s.map(a=>a.toLowerCase()),r=au(s,o,t,n);if(r)return r;let i=Qo(e,t);return i?{node:"clause",clause:i}:null}function ba(e,t){let n=Object.keys(Lo).sort((a,l)=>l.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let l of n){let c=l.split(" ");if(e.slice(i,i+c.length).join(" ")===l){a={c:l,len:c.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(Lo[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function lu(e,t,n,s){let o=Xo[t];if(o&&Cs.has(n)){let u=Je(e,o).filter(d=>s.has(d.object));return ds(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Cs.has(e.byId.get(u)?.class))?[...Dt(t),o]:Dt(t)).flatMap(u=>Je(e,u)).filter(u=>s.has(u.object)),l=ds(a.map(u=>e.byId.get(u.subject)).filter(Boolean));if(!n||n==="Change")return l;let c=l.filter(u=>u.class===n);return c.length?c:n!=="Module"&&l.some(u=>u.class==="Module")?fu(e,new Set(l.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function qj(e,t){let n=new Set(lu(e,"touches","Commit",t).map(s=>String(s.label||"").toLowerCase()));for(let s of t)for(let o of e.byId.get(s)?.derived_from||[]){let r=Hj.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function Kr(e,t,n){let s=Dt(t).flatMap(o=>Je(e,o)).filter(o=>n.has(o.subject));return ds(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ds(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function Kj(e,t){let n=os(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&os(o.label).startsWith(s))}function Zl(e){let t=Fm.get(e);if(t)return t;let n=new Set;for(let i of Je(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of Je(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of Je(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Fm.set(e,t),t}function Jo(e,t){return t?t.class==="Module"?t.id:Zl(e).moduleOfSymbol.get(t.id)||null:null}function cg(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>Yj.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Jo(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Ue(o.class,1),l=a==="attribute"?"an":"a",c=i?`, ${Vr("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${l} ${a} in this codebase${c} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function eu(e,t,n){let s=ds(No.flatMap(o=>Kr(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function uu(e,t,n=null){let s=us(e,t,n);if(!(s.match&&s.tier===1)){let o=Kj(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function lg(e,t,n,s,o){let r=o||(()=>!0),i=eu(e,t,s).filter(r);if(i.length||!dg(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of ug(e,t)){let l=e.byId.get(a);if(!l)continue;let c=eu(e,a,s).filter(r);if(c.length)return{own:i,inherited:c,viaId:a,viaLabel:l.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function co(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=Zl(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=Jo(e,t),o=Zl(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&oo(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function du(e){return Je(e,"inherits")}function tu(e,t){return du(e).filter(n=>n.object===t).map(n=>n.subject)}function Dm(e,t){return du(e).filter(n=>n.subject===t).map(n=>n.object)}function Xj(e,t){let n=new Set,s=[...tu(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of tu(e,o))n.has(r)||s.push(r)}}return n}function ug(e,t){let n=new Set,s=[...Dm(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Dm(e,o))n.has(r)||s.push(r)}}return n}function dg(e,t){let n=zm.get(e);if(n||(n=new Map,zm.set(e,n)),n.has(t))return n.get(t);let s=du(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function Um(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function Wm(e){return e.slice().sort((t,n)=>Bm[n.via]-Bm[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Gm(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=cs(n);if(as(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of lo(e.label))if(as(o,n,s)<=s)return!0;return!1}function pg(e,t,n){let s=e.individuals.filter(l=>l.class===t),o=[...lo(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=dg(e,t),i=[];for(let l of s){let c=Um(l,o);if(c){i.push({ind:l,via:c});continue}if(!r)continue;[...Xj(e,l.id)].some(d=>{let p=e.byId.get(d);return!!p&&!!Um(p,o)})&&i.push({ind:l,via:"chain"})}if(i.length||!r)return{narrow:Wm(i),broad:[]};let a=new Map;for(let l of s)for(let c of ug(e,l.id)){if(!a.has(c)){let u=e.byId.get(c);u&&u.class===t&&Gm(u,n)&&a.set(c,{ind:u,via:"chain"})}for(let u of tu(e,c)){if(u===l.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Gm(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Wm([...a.values()])}}function Jj(e){return[...Zi(ea(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function hn(e,t,n){switch(t.node){case"clause":return Jt(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?Jj(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=pg(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Dt(t.kind).flatMap(o=>Je(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=us(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=ng(e,t.kind);if(!o)return[];let r=new Set(Kr(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"reverseSet":{let s=new Set(hn(e,t.inner,n).map(o=>o.id));return lu(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(hn(e,t.inner,n).map(o=>o.id));return Kr(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=uu(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(l=>l.id));return ds(No.flatMap(l=>Kr(e,l,i))).filter(l=>l.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=lg(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?gg(e,t,n).matches:hn(e,t.inner,n).filter(o=>t.filters.every(r=>co(e,o,et[r])));case"boolean":return fg(e,t,n);case"anaphora":return hg(e,t,n).matches;default:return[]}}function fg(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=hn(e,o.ast,n);continue}if(o.kind==="qual"){let i=l=>o.filters.every(c=>co(e,l,et[c])),a=l=>o.filters.every(c=>{let u=Qj(et[c]);return u?co(e,l,u):!co(e,l,et[c])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(hn(e,o.ast,n).map(i=>i.id));if(o.op==="intersection")s=s.filter(i=>r.has(i.id));else if(o.op==="difference")s=s.filter(i=>!r.has(i.id));else if(o.op==="union"){let i=new Set(s.map(a=>a.id));for(let a of hn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function Zj(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=kn(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function hg(e,t,n){let o=Zj(e,t.candidateTerms);if(!o){let d=n&&n.prev;if(!Array.isArray(d)||!d.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=d.map(p=>e.byId.get(p)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(d=>i.filters.every(p=>co(e,d,et[p])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=kn(e,i.clause.object);if(!d.match)r=[];else{let p=Xo[i.clause.kind],f=[...Dt(i.clause.kind),...p?[p]:[]],h=new Set(f.flatMap(m=>Je(e,m)).filter(m=>m.object===d.match.id).map(m=>m.subject));r=r.filter(m=>h.has(m.id))}}let a=d=>d.length&&d.every(p=>p.class===d[0].class)?d[0].class:null,l=i&&i.type==="entity"?i.entityType:a(o),c=r.length?a(r):l;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:c,matches:[]};let u=Jr(c,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:c,referents:u}}function mg(e,t,n){let s=n.kind==="*"?eR:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of Je(e,r)){let a=i.subject===t.id,l=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let c=e.byId.get(i.object);if(!c||c.class!==n.filter)continue}o+=1}else(n.dir==="in"&&l||n.dir==="both"&&(a||l))&&(o+=1)}return o}function tR(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function sR(e,t){let{op:n,pivotRaw:s}=t,o=u=>String((u.attributes||[]).find(d=>d.key==="date")?.value||"").slice(0,10),r=null,i=null,a=null;if(nR.test(s))r=s;else{let{match:u,ambiguous:d}=kn(e,s,{expectedClass:"Commit"});u&&!d&&u.class==="Commit"&&o(u)&&(i=u.id,a=u.label,r=o(u))}if(!r)return{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotResolved:!1,matches:[]};let l=e.individuals.filter(u=>u.class==="Commit"&&u.id!==i&&o(u)).filter(u=>{let d=o(u);return n==="since"?d>=r:n==="before"?d<r:n==="after"?d>r:d===r}).sort((u,d)=>o(d).localeCompare(o(u))),c=[];return l.length&&c.push({kind:"set",class:"Commit",label:`${l.length} commit${l.length===1?"":"s"} ${n} ${s}`,ids:l.map(u=>u.id),attrs:{count:l.length,op:n,...i?{pivot:i}:{}},lane:"commitFilter"}),i&&c.push({kind:"event",class:"Commit",label:a,ids:[i],attrs:{date:r},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:r,pivotResolved:!0,matches:l,referents:c}}function oR(e,t,n){let s=hn(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size)return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0};let r=lu(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(l=>l.key==="date")?.value||"");return r.sort((a,l)=>i(l).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function rR(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(Je(e,"tests").map(l=>l.subject));n=n.filter(l=>!a.has(l.id)&&!oo(String(l.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:mg(e,a,t.metric)})).sort((a,l)=>t.extreme==="most"?l.score-a.score:a.score-l.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?Jr(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function gg(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?h=>s.filters.every(m=>co(e,h,et[m])):null,a=h=>Jr(r,h,"membership"),l=uu(e,o.term,n&&n.contextId);if(l.kind==="dir"){let h;if(!r||r==="Module")h=l.mods;else{let m=new Set(l.mods.map(b=>b.id));h=ds(No.flatMap(b=>Kr(e,b,m))).filter(b=>b.class===r)}return i&&(h=h.filter(i)),{compositeKind:"set",matches:h,entityType:r,referents:a(h)}}if(l.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:c,inherited:u,viaLabel:d}=lg(e,l.id,l.entityClass,r,i),p=!c.length&&u.length>0,f=p?u:c;return{compositeKind:"membership",entityType:r,matches:f,inheritedNotOwn:p,viaLabel:d,ownerLabel:l.label,referents:a(f)}}function iR(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=kn(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=kn(e,s,{expectedClass:n}),l=!r||a.match&&Jo(e,a.match)===r.id,c=a.match&&l;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:c?[a.match]:[]}}let i=r?fu(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function aR(e,t,n){let s=Jo(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||eu(e,n.id).some(o=>o.id===t.id)}function cR(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=us(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=uu(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!aR(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let l=co(e,a.match,et[o]),c=r?!l:l,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:c,matches:[a.match],referents:u}}function lR(e,t,n){let s=kn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=hn(e,{node:"allOfClass",entityType:t.entityType},n),r=fg(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function uR(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(hn(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=Jt(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function dR(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return iR(e,t);if(t.node==="qualCheck")return cR(e,t,n);if(t.node==="universal")return lR(e,t,n);if(t.node==="count"){let i=uR(e,t.base,n);return i?{compositeKind:"count",count:qj(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:hn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:hn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return qR(e,t);if(t.node==="superlative")return rR(e,t);if(t.node==="temporal")return oR(e,t,n);if(t.node==="recentCommits")return tR(e);if(t.node==="commitFilter")return sR(e,t);if(t.node==="anaphora")return hg(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return gg(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=pg(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:i.length?i:a,broad:!i.length&&a.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let s=hn(e,t,n),o=t.entityType||null,r=Jr(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function bg(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function pR(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=Xr(e);return n?`${t} in ${n}`:t}function nu(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(nu):Array.isArray(e.filters)&&e.filters.some(t=>et[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(nu)}function fR(e,t){return!["Function","Method"].includes(t)||!nu(e)?null:"This index records tests edges module to module, so it holds no function-grain coverage to filter on \u2014 ask whether the module a function lives in is tested instead."}function hR(e,t,n){if(t.compositeMiss)return t.reason==="no-prev"?{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1}:{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${bg()}.`,miss:!0,ambiguous:!1};if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=Ue(t.entityType,1),o=Ue(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=Xr(i),l=i.class==="Module"?"":a?`, ${Vr("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${As(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=Ue(t.entityType,t.total),o=ij(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${As(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Ue(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${Ue(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>Xe?` \u2014 narrow with "${Ue(t.entityType,2)} in <module>"`:"";return{content:`${As(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=En(t.asked),o=Js[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length)return{content:`nothing in the index matches that${t.entityType?` (${Ue(t.entityType,2)})`:""}. ${Is(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Ue(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${As(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${As(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Ue(t.entityType,1);if(!t.matches.length)return{content:`no ${Ue(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?pR(t.matches[0]):As(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Ue(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,Yt).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Yt?` \u2026+${t.matches.length-Yt} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,Yt).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Yt?` \u2026+${t.matches.length-Yt} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${Ue(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${As(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?Ue(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:`nothing in the index matches the inner set, so there is no change history to date. ${Is(n)}`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${Is(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let l=(i.attributes||[]).find(d=>d.key==="message")?.value||"",c=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${c}${l?` ("${l}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=fR(e,t.entityType)||Is(n);return{content:`nothing in the index matches that${t.entityType?` (${Ue(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${As(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function pu(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+bg()}function Is(e=null){return e&&Fr(e)===0?Il:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function lo(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function ya(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function wg(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function mR(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Hr(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(b=>b.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let b=i[2],g=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${b}`)||String(y.label).toLowerCase().startsWith(b)));if(g.length===1)return{match:g[0],candidates:[],tier:1,ambiguous:!1};if(g.length>1)return{match:g[0],candidates:g.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(b=>String(b.label).toLowerCase()===o||String(b.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let l=`ext:${o}`,c=null;e:for(let b of e.relations)for(let g of b.edges)if(String(g.object).toLowerCase()===l){c=g.object;break e}if(c&&!n)return{match:{id:c,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(b=>b.trim()).filter(Boolean);if(u.length>1){let b=new Set;for(let g of u){let y=Hr(e,g,{expectedClass:n});y.match&&!y.ambiguous&&b.add(y.match.id)}if(b.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],p=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(p){let b=o.split(".").pop();for(let g of r){let y=String(g.label||"").toLowerCase();g.class==="Module"?y.split("/").pop()===o&&d.push({ind:g,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:g,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${b}`)&&d.push({ind:g,score:1500-Math.abs(y.length-o.length)})}}else{let b=[...lo(s)],g=o.split(/\s+/).find($=>$.includes("/")),y=g?g.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,k=v?mR(s):null;for(let $ of r){let x=String($.label||"").toLowerCase(),E=x.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(E===o){d.push({ind:$,score:5e3});continue}if(o.length>=4&&(E.startsWith(o)||E.endsWith(o))){d.push({ind:$,score:4e3-Math.abs(E.length-o.length)});continue}if(v){let R=wg($.label);if(R&&R===k){d.push({ind:$,score:5e3});continue}let T=/[/_-]/.test($.label)||/\.[a-z0-9]+$/i.test(String($.label||""));if(R&&T&&k.length>=4&&R.includes(k)){d.push({ind:$,score:2e3-Math.abs(R.length-k.length)});continue}}if($.class==="Module"){let R=ya(o);if(R!==o&&R===ya(E)){let T=cs(o);if(as(E,o,T)>T){d.push({ind:$,score:3e3-Math.abs(E.length-o.length)});continue}}}if(o.length>=4&&x.includes(o)){d.push({ind:$,score:1e3-Math.abs(x.length-o.length)});continue}let S=lo($.label),_=b.filter(R=>S.has(R)).length;_>0&&(!y||S.has(y))&&d.push({ind:$,score:_/b.length*Hl})}}if(d.sort((b,g)=>g.score-b.score),d.length){let[b,...g]=d,y=g.filter(v=>v.score===b.score),w=b.score>=Hl?g.filter(v=>v.score>=Hl):g;return{match:b.ind,candidates:w.slice(0,4).map(v=>v.ind),tier:3,ambiguous:y.length>0}}let f=p||o.includes("/"),h=null,m=!f&&typeof no=="function"?no(e.proseIndex,s).filter(b=>!n||e.byId.get(b.id)?.class===n):[];if(m.length){let[b,...g]=m,y=e.byId.get(b.id);if(y){let w=g.filter(v=>v.score===b.score);if(h={match:y,candidates:g.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!h.ambiguous&&b.via!=="spell")return h}}if(!i&&o.length>=4){let b=cs(o),g=b+1,y=[];for(let w of r){let v=as(String(w.label||"").toLowerCase(),o,b);if(v>0)for(let k of lo(w.label)){if(v<=0)break;v=Math.min(v,as(k,o,b))}v<g?(g=v,y=[w]):v===g&&v<=b&&y.push(w)}if(g<=b&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(g<=b&&y.length>1&&!h){let[w,...v]=y;return{match:w,candidates:v.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return h||{match:null,candidates:[],tier:null,ambiguous:!1}}function ql(e,t){let n=wg(t),s=[...lo(t)],o=[];for(let r of lo(e))n.includes(r)||s.some(i=>ya(i)===ya(r))||wa.has(r)||vg.has(r)||o.push(r);return o}function ma(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(ql(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),ql(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:En(s.slice(0,4).map(r=>r.label))}:e}let n=ql(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function kn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(gR,"").trim(),i=r.match(bR);if(i){let a=r.slice(0,i.index).trim(),l=He[i[1].toLowerCase()];if(a&&l){let c=ma(Hr(e,a,{expectedClass:l}),a);if(c?.match?.id&&!c.ambiguous)return c}}if(r&&r!==o){let a=ma(Hr(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return ma(Hr(e,t,n),t)}return ma(Hr(e,t,n),t)}function us(e,t,n){if(Qs.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return kn(e,t)}function fu(e,t,n){let s=[];for(let o of Je(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function wR(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Cs.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],l=a.flatMap(c=>Je(e,c)).filter(c=>c.subject===t.id).map(c=>e.byId.get(c.object)).filter(Boolean);return n&&Cs.has(n)&&(l=l.filter(c=>c.class===n)),{matches:l,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function xR(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&hu.has(Vm(s.label))).map(s=>({ind:s,named:n.has(Vm(s.label))?1:0,depth:String(s.label).split("/").length,fixture:vR(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function ER(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function mu(e){return(e?.attributes||[]).find(t=>t.prop===SR)?.value||null}function kR(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Ko(e)} ${e} in this graph's vocabulary`}function Jt(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return dR(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let I=t.candidates.map(D=>{let B=Jt(e,D,{contextId:n,prev:s});return{parsed:D,result:B,rendered:Sn(D,B,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:I}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let I=String(t.object||"").trim(),D=I.toLowerCase(),B=(e.individuals||[]).find(X=>{if(!mu(X))return!1;if(String(X.label).toLowerCase()===D)return!0;let ae=(X.attributes||[]).find(ie=>ie.key==="token")?.value;return ae&&String(ae).toLowerCase()===D});if(!B){let X=cg(e,I);return X?{matches:[X.hit],objMatch:X.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:X.text,traversal:`schema lookup for "${I}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${I}"`,ambiguous:!1}}return{matches:[B],objMatch:B,candidates:[],traversal:`schema lookup for "${I}"`,ambiguous:!1}}if(r==="mentions"){let I=String(t.object||"").trim();return{matches:(typeof no=="function"?no(e.proseIndex,I):[]).map(X=>e.byId.get(X.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${I}"`}}if(r==="where"&&yR.test(String(t.object||"").trim())){let I=xR(e,t.object);return{matches:I,objMatch:I[0]||null,candidates:I.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...hu].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!ER(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let I=us(e,t.subject,n),D=us(e,t.object,n);if(!I.match||!D.match||I.ambiguous||D.ambiguous)return{matches:[],objMatch:D.match,candidates:D.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(I.unresolvedPronoun||D.unresolvedPronoun)};let[B,X]=[I.match,D.match];i==="touches"&&X.class==="Commit"&&B.class!=="Commit"&&([B,X]=[X,B]);let ae=Xo[i],ie=[...new Set(ae?[...Dt(i),ae]:Dt(i))],te=ie.flatMap(U=>Je(e,U)).filter(U=>U.subject===B.id&&U.object===X.id);return{matches:te,answer:t.negated?te.length===0:te.length>0,objMatch:D.match,subjMatch:I.match,candidates:[],traversal:`${ie.join("+")} edge from ${B.label} to ${X.label}`,ambiguous:!1}}let l;if(o)l={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(l=us(e,t.object,n),t.altObject&&t.altObject!==t.object){let I=us(e,t.altObject,n),D=!!l.match&&!l.ambiguous,B=!!I.match&&!I.ambiguous;!D&&B?l=I:D&&B&&l.match.id!==I.match.id&&(l={...l,ambiguous:!0,candidates:[I.match,...l.candidates||[]]})}if(t.kind==="tests"&&l.match&&!l.ambiguous&&!String(t.object||"").includes("/")){let I=X=>X.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),D=I(String(t.object||"").trim().toLowerCase()),B=(e.individuals||[]).find(X=>{if(X.class!=="Module"||X.id===l.match.id)return!1;let ae=String(X.label||"").toLowerCase().split("/").pop();return ae!==I(ae)&&I(ae)===D});B&&(l={...l,ambiguous:!0,candidates:[B,...l.candidates||[]]})}}let{match:c,candidates:u,ambiguous:d,unresolvedPronoun:p,matchedVia:f,unplacedWords:h,nearestLabel:m}=l;if(!c)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:p,unplacedWords:h,nearestLabel:m};if(d){let D=ds([c,...u||[]]).slice(0,Xe).map(B=>{let X=Jt(e,t,{contextId:n,prev:s,pinnedObjMatch:B});return{candidate:B,result:X,rendered:Sn(t,X,e)}});return{matches:[],objMatch:c,candidates:u,traversal:null,ambiguous:!0,branches:D}}if(r==="where"){let I=(c.attributes||[]).find(D=>D.key==="site")?.value||null;return{matches:[c],objMatch:c,candidates:u,ambiguous:d,matchedVia:f,whereShape:!0,site:I,traversal:I?`site attribute of ${c.label}`:`class + defining module of ${c.label}`}}if(r==="when"){let I=X=>String((X.attributes||[]).find(ae=>ae.key==="date")?.value||""),D;if(c.class==="Commit")D=[c];else{let X=["touches","touchesSymbol"].flatMap(ie=>Je(e,ie)).filter(ie=>ie.object===c.id),ae=new Set;D=[];for(let ie of X){if(ae.has(ie.subject))continue;ae.add(ie.subject);let te=e.byId.get(ie.subject);te&&te.class==="Commit"&&D.push(te)}D.sort((ie,te)=>I(te).localeCompare(I(ie)))}let B=D.length&&I(D[0])?[{kind:"event",class:"Commit",label:D[0].label,ids:[D[0].id],attrs:{date:I(D[0]).slice(0,10)},lane:"when"}]:[];return{matches:D,objMatch:c,candidates:u,ambiguous:d,matchedVia:f,whenShape:!0,referents:B,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit date first`}}if(r==="whoLast"){let I=ie=>String((ie.attributes||[]).find(te=>te.key==="date")?.value||""),D=["touches","touchesSymbol"].flatMap(ie=>Je(e,ie)).filter(ie=>ie.object===c.id),B=new Set,X=[];for(let ie of D){if(B.has(ie.subject))continue;B.add(ie.subject);let te=e.byId.get(ie.subject);te&&te.class==="Commit"&&X.push(te)}X.sort((ie,te)=>I(te).localeCompare(I(ie)));let ae=X.length&&I(X[0])?[{kind:"event",class:"Commit",label:X[0].label,ids:[X[0].id],attrs:{date:I(X[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:X,objMatch:c,candidates:u,ambiguous:d,matchedVia:f,whoLastShape:!0,referents:ae,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit's author`}}if(i==="touches"&&c.class==="Commit")return wR(e,c,a,{candidates:u,ambiguous:d,matchedVia:f});if(r==="forward"){let I=Xo[i],B=!!(I&&c.class&&Cs.has(c.class))?[...new Set([...Dt(i),I])]:Dt(i);if(a&&a!=="Change"){let z=tg(e,B),A=Vl[a];if(z.size&&!z.has(a)&&!(A&&z.has(A)))return{matches:[],objMatch:c,candidates:u,ambiguous:d,matchedVia:f,forwardGrainMiss:!0,wantClasses:[...z],traversal:`${B.join("+")} edges where subject = ${c.label} (grain mismatch: this "${i}" relation never targets a ${ls(a)})`}}let ae=B.flatMap(z=>Je(e,z)).filter(z=>z.subject===c.id).map(z=>e.byId.get(z.object)).filter(Boolean),ie=ds(ae),te=ie,U="";if(a&&a!=="Change"){te=ie.filter(A=>A.class===a);let z=Vl[a];if(!te.length&&z){let A=ie.filter(N=>N.class===z);A.length&&(te=A,U=`, widened to ${z} subjects (no ${a} recorded)`)}}return{matches:te,objMatch:c,candidates:u,traversal:`${B.join("+")} edges where subject = ${c.label}${U}`,ambiguous:d,matchedVia:f}}if(t.modifier==="transitive")return{matches:Bo(e,c,{maxDepth:Hm}).flat().map(B=>e.byId.get(B.id)).filter(Boolean),objMatch:c,candidates:u,ambiguous:d,matchedVia:f,traversal:`reverse dependency closure over imports+calls edges from ${c.label} (impactClosure, maxDepth=${Hm})`};let b=Xo[i]||Dt(i).find(I=>Xm.has(I))||null,g=!!(c.class&&Cs.has(c.class));if(b&&(Cs.has(a)||g)){let I=Je(e,b).filter(U=>U.object===c.id),D=ds(I.map(U=>e.byId.get(U.subject)).filter(Boolean)),B=!a||a==="Change"?D:D.filter(U=>U.class===a),X="",ae=Vl[a];if(!B.length&&ae){let U=D.filter(z=>z.class===ae);U.length&&(B=U,X=`, widened to ${ae} subjects (no ${a} recorded)`)}let ie=(i==="touches"||i==="calls"||i==="uses")&&c.class==="Class"&&!Je(e,"contains").some(U=>U.subject===c.id),te=ie?e.byId.get(Jo(e,c)||""):null;if(B.length||!(ie&&te))return{matches:B,objMatch:c,candidates:u,traversal:`${b} edges where object = ${c.label}${X}`,ambiguous:d,matchedVia:f}}let y=c,w=u,v=d,k=f,$="",x=ng(e,i);if(x&&y.class&&y.class!==x){let I=kn(e,t.object,{expectedClass:x});if(I.match&&!I.ambiguous)y=I.match,w=I.candidates,v=I.ambiguous,k=I.matchedVia;else if(x==="Module"){let D=Jo(e,y),B=D&&e.byId.get(D);if(B)$=`, refined from ${y.label} to its containing module`,y=B;else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${ls(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ls(x)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${ls(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ls(x)})`}}let E=Dt(i).flatMap(I=>Je(e,I)).filter(I=>I.object===y.id);i==="cochange"&&(E=E.concat(Dt(i).flatMap(I=>Je(e,I)).filter(I=>I.subject===y.id).map(I=>({...I,subject:I.object,object:I.subject}))));let S="";if(!E.length&&y.class){let I=`ext:${String(y.label).toLowerCase()}`;E=Dt(i).flatMap(D=>Je(e,D)).filter(D=>String(D.object).toLowerCase()===I),E.length&&(S=` (by name, via unresolved ${I} references)`)}let _=[],R=new Set;for(let I of E){let D=e.byId.get(I.subject);D&&!R.has(D.id)&&(R.add(D.id),_.push(D))}let T,M="";if(!a||a==="Change")T=_;else{let I=_.filter(D=>D.class===a);if(I.length)T=I;else if(a!=="Module"&&_.some(D=>D.class==="Module")){let D=new Set(_.filter(B=>B.class==="Module").map(B=>B.id));T=fu(e,D,a),M=`, then ${ls(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:y,candidates:w,traversal:`${Dt(i).join("+")} edges where object = ${y.label}${S}${M}${$}`,ambiguous:v,matchedVia:k}}function Xr(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function Kl(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function jR(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function En(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function qr(e){let t=e.object??e.subject??"?";return`${e.entityType?Ue(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function su(e){return Ar[e]?.bare||e}function RR(e){let t=su(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function _R(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=Ue(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${su(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${su(o.kind)} ${JSON.stringify(String(r))}`}function yg(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(qr).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>yg(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?_R(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${ao(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?Ue(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${ao(e.kind)}`:`${r}${ao(e.kind)} "${e.object}"`}return{english:o,machine:s}}function Sn(e,t,n=null){let s=$g(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function $g(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${pu()}`,miss:!0,ambiguous:!1};if(e.node)return hR(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
|
|
55
|
-
${t.branches.map((l
|
|
53
|
+
`)}`+(o.length>uu?`
|
|
54
|
+
\u2026+${o.length-uu} more`:"")}var du,ih,yh,lh,XS,QS,au,ZS,Sa,ej,tj,nj,xh,sj,oj,rj,ij,aj,cj,lj,uj,dj,fj,pj,mj,hj,gj,bj,wj,yj,$j,vj,xj,Ej,Sj,jj,kj,Rj,uh,_j,Tj,Eh,Sh,jh,Aj,Cj,Ij,Oj,Lj,fh,ph,Mj,mh,xa,hh,gh,bh,ni,Ge,Dj,zj,Lh,Uj,tn,Fh,Bj,Kh,Gj,Vj,Hj,qj,Kj,Yj,Xj,Jj,cu,wh,Ra,Qj,lu,uu,Me=N(()=>{Ds();qn();su();ei();Us();du="This store holds no code index, so it records no modules or commits to look through.",ih={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};yh=e=>/^(git|turn):/.test(String(e||""));lh=30,XS=8;QS=2,au=25,ZS=3;Sa=10,ej=8,tj=3,nj=2,xh=5,sj=4,oj=.2,rj=.35,ij=.15,aj=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),cj=.2,lj=.35,uj=.2,dj=.35,fj=e=>/\.cs$/i.test(e),pj=e=>/^I[A-Z]/.test(String(e||"")),mj=.2,hj=.35,gj=50,bj=.2,wj=.35,yj=.5,$j=xh,vj=3,xj=4,Ej=1,Sj=.9,jj=.5,kj=.2,Rj=.35,uh=4,_j=2,Tj=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],Eh=3,Sh=12,jh=.9,Aj=["imports","calls","callsSymbol","inherits"],Cj=.5,Ij=.6,Oj=.2,Lj=.35;fh=128,ph=4,Mj=64,mh=250,xa=class extends Error{};hh=new WeakMap;gh=40,bh=40,ni=30;Ge=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";Dj=25,zj=15;Lh=40,Uj="tests edges are recorded module to module, so this is module-grain coverage.";tn=15;Fh=new Set(["Function","Method"]);Bj=8;Kh={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};Gj=8,Vj=16,Hj=4,qj=6,Kj=12,Yj=2,Xj=8,Jj=3,cu=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),wh=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),Ra=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},Qj=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};lu=20;uu=40});function Ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ag(e){let t=String(e||"");return tg&&(t=t.replace(tg," ")),t.replace(/\s+/g," ").trim()}function cg(e){let t=String(e||"");t=t.replace(vk," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(gk);if(o&&(t=o[1].trim()),o=t.match(bk),o&&(t=o[1].trim()),o=t.match(ng),o&&(t=o[1].trim()),o=t.match(sg),o&&(t=o[1].trim()),o=t.match(og),o&&(t=o[1].trim()),o=t.match($k),o&&(t=o[1].trim()),o=t.match(rg),o&&(t=o[1].trim()),o=t.match(xk),o&&(t=o[1].trim()),o=t.match(Ek),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Sk),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(jk),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(kk),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Rk),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(_k),o&&Bs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Tk),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(Ak),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(Ck),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(Ik),o){let r=o[1].trim();hk(r)||(t=!Ok.test(r)&&(fk.test(r)||Bs.test(r))?r:`describe ${r}`)}if(o=t.match(Lk),o){let r=o[1].trim();(Bs.test(r)||Nk.test(r)||rg.test(r)||ng.test(r)||og.test(r)||sg.test(r)||Pk.test(r))&&(t=r)}if(t===s)break}return t}function qk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(Vk);if(o&&(t=o[1].trim()),o=t.match(Hk),o&&(t=o[1].trim()),t===s)break}return t}function Yk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(Kk);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function Qk(e){let t=String(e||""),n=t.match(Jk);if(n){let o=ug[n[1].toLowerCase()],r=lg[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(dg);return s?`which modules transitively import ${s[1].trim()}`:t}function Aa(e){return String(e||"").replace(ok,t=>Yl[t.toLowerCase()])}function $o(e){let t=Aa(e);return t=t.replace(rk,n=>Xl[n.toLowerCase()]),t=t.replace(ik,n=>Jl[n.toLowerCase()]),t=t.replace(ak,"with"),t=t.replace(ck,(n,s)=>`${s} for`),t=t.replace(lk,(n,s)=>`for ${s}`),t=t.replace(uk,(n,s)=>s),t=t.replace(Zk,"$1$2"),t=t.replace(Am,"$1ing"),t=cg(t),t=Yk(t),t=qk(t),t=Qk(t),t=ag(t),t=pn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function oi(e){for(let t of[...Im,...Cm]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function wu(e){for(let t of eR){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function fg(e){let t=String(e||"").match(tR);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var sk,ok,ig,rk,ik,ak,ck,lk,uk,dk,tg,fk,Bs,pk,mk,hk,si,gk,bk,wk,yk,ng,sg,og,$k,vk,xk,Ek,Sk,jk,kk,Rk,_k,Tk,Ak,Ck,Ik,Ok,Lk,Nk,Pk,rg,Ta,Mk,Fk,Dk,zk,Uk,Bk,Wk,EF,bu,Gk,SF,jF,kF,Vk,Hk,Kk,lg,ug,Xk,Jk,dg,Zk,eR,tR,ct,nn,me,vn=N(()=>{Gn();sk=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b","gi"),ok=sk(Yl),ig=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b(?!\\.[a-z0-9])","gi"),rk=ig(Xl),ik=ig(Jl),ak=/(?<=^|\s)w\/(?=\s|$)/gi,ck=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,lk=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,uk=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,dk=Object.keys(fe).sort((e,t)=>t.length-e.length).map(Ze).join("|"),tg=Xr.length?new RegExp("\\b("+[...Xr].sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b\\s*,?","gi"):null;fk=new RegExp("\\b(?:"+Object.keys(fe).sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b","i"),Bs=/^(?:which|what|who|whose|where|when|why|how)\b/i,pk=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),mk=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,hk=e=>{if(mk.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return pk.has((t[t.length-1]||"").toLowerCase())},si="[,.;:!]|\u2014|\u2013|-",gk=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,bk=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,wk="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",yk="(?:just\\s+)?(?:one|another)\\s+more",ng=new RegExp(`^(?:(?:${wk})[\\s,]+|(?:${yk})\\s*(?:${si})\\s*)+(.+)$`,"i"),sg=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,og=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,$k=/^(?:please[\s,]+)+(.+)$/i,vk=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,xk=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,Ek=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,Sk=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,jk=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,kk=/^do\s+you\s+know\s+(.+?)\??$/i,Rk=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,_k=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,Tk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,Ak=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,Ck=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,Ik=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,Ok=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,Lk=/^(?:and|also|so|then|now|but)\s+(.+)$/i,Nk=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,Pk=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,rg=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;Ta=e=>[...e].sort((t,n)=>n.length-t.length).map(Ze).join("|"),Mk=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),Fk=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),Dk=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),zk=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),Uk=`(?:${Ta(Mk)})(?:\\s+(?:${Ta(Fk)}))?\\s*(?:${si})\\s*`,Bk=`(?:${Ta(Dk)})\\s*(?:(?:${si})\\s*|\\s+)`,Wk=`(?:${Ta(zk)})\\s*(?:${si})\\s*`,EF=new RegExp(`^(?:sorry\\s*(?:${si})?\\s*)?(?:${Uk}|${Bk}|${Wk})+`,"i"),bu="what|who|which|where|when|why|how",Gk="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",SF=new RegExp(`\\b(?:an?|the)?\\s*(?:${bu})\\s*\\?\\s*$`,"i"),jF=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${bu})\\b`,"i"),kF=new RegExp(`\\b(?:${bu})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${Gk})\\b`,"i"),Vk=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,Hk=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;Kk=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;lg=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),ug=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),Xk="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",Jk=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(ug).join("|")+")\\s+("+Object.keys(lg).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+Xk+")\\??$","i"),dg=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;Zk=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${ql.map(Ze).join("|")})(\\s*[?.!]*)$`,"i");eR=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${Kl.map(Ze).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${dk})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);tR=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");ct=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),nn=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),me=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var mg,pg=N(()=>{mg={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function ys(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let c=1;c<=t.length;c+=1){let l=e[r-1]===t[c-1]?0:1,u=Math.min(o[c]+1,i[c-1]+1,o[c-1]+l);r>1&&c>1&&e[r-1]===t[c-2]&&e[r-2]===t[c-1]&&(u=Math.min(u,s[c-2]+l)),i[c]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function $u(e){return/^[a-z]+$/.test(e)&&!ct.has(e)&&!yu.has(e)}function bg(e){return rR(e)?null:Ca(e,gg,$s(e))}function Ca(e,t,n=$s(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=ys(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var sR,$s,yu,hg,gg,oR,rR,rr=N(()=>{Gn();pg();vn();sR=["used"];$s=e=>e.length<=5?1:2,yu=new Set([...Object.keys(fe),...Object.keys(Xe),...Object.keys(mn),...sR].flatMap(e=>e.split(" "))),hg=4,gg=[...new Set([...Object.keys(fe),...Object.keys(mn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=hg))],oR=new Set(mg.words),rR=e=>oR.has(e)});function ir(e){for(let t of lR){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Ia,iR,aR,cR,vu,lR,wg,Oa=N(()=>{Gn();vn();Ia=Object.keys(fe).sort((e,t)=>t.length-e.length).map(Ze).join("|"),iR=Object.keys(Xe).sort((e,t)=>t.length-e.length).map(Ze).join("|"),aR=Object.keys(mn).sort((e,t)=>t.length-e.length).map(Ze).join("|"),cR=mo.slice().sort((e,t)=>t.length-e.length).map(Ze).join("|"),vu=(e,t)=>e==="defines"&&Yr.has(t),lR=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Ia})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=fe[t];if(vu(n,t))return null;let s=e[1].trim(),o=e[3].trim();return Kr.includes(t)&&([s,o]=[o,s]),{shape:"ask",entityType:null,modifier:"direct",kind:n,subject:s,object:o}}},{name:"reverse",re:new RegExp(`^which\\s+(${iR})\\s+(?:(${aR})\\s+)?(${Ia})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=fe[t];return vu(n,t)?null:{shape:"reverse",entityType:Xe[e[1].toLowerCase()],modifier:e[2]?mn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Ia})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=fe[t];return vu(n,t)?null:{shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()}}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${cR})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=pn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Xe[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&_m.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Ps(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${On.map(Ze).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${fn.map(Ze).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${Ia})\\??$`,"i"),build:e=>fe[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];wg={id:"grammar",class:"graph-query",run(e){let t=ir(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function yg(e){let t=e.trim().split(/\s+/);return t.length>1&&da.has(t[0].toLowerCase())}function pR(e){return fe[e.trim().toLowerCase()]==="calls"}function Wt(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,c)=>n.has(i+c)))&&r.every((a,c)=>e[i+c]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function ii(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(k=>k.toLowerCase());if(s.includes("where")&&!Wt(s,fe)){let k=s.some(x=>On.includes(x)),w=new Set([...fn,...On]),S=n.filter((x,A)=>!ct.has(s[A])&&!w.has(s[A])).join(" ").trim();if(S){let x=k?"mentions":"where";return{shape:x,entityType:null,modifier:"direct",kind:x,object:S}}}if(new Set(["has","have","had"]).has(s[0])){let k=s.length;for(;k>1&&(s[k-1]==="ever"||s[k-1]==="been");)k-=1;if((k>1?fe[s[k-1]]:null)==="touches"){let S=n.slice(1,k-1).filter((x,A)=>!ct.has(s[1+A])).join(" ").trim();if(S)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:S}}}let r=s,i=Wt(s,fe);if(!i&&t){let k=s.map(w=>{if(!$u(w))return w;let S=t.lemma(w);return yu.has(S)?S:w});i=Wt(k,fe),i&&(r=k)}let a=null;if(!i){let k=s.map(w=>w.length>=4&&$u(w)&&bg(w)||w);if(i=Wt(k,fe),i){r=k;let w=s.slice(i.start,i.end).findIndex((x,A)=>x!==k[i.start+A]),S=i.start+Math.max(w,0);a={from:s[S],to:k[S]}}}let c=!1;if(!i)for(let k=0;k<s.length;k+=1){let w=Ms[s[k]];if(!(w&&s[k]==="used"&&s[k+1]==="for")&&w&&s.slice(0,k).some(S=>ri.has(S))){i={kind:w,start:k,end:k+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&Ms[s[i.start]]&&s.slice(0,i.start).some(k=>ri.has(k))&&(c=!0);let l=k=>a?{...k,fuzzyVerb:a}:k;if(t&&i.end-i.start===1){let k=i.start,w=s[k-1];if((w==="the"||w==="these"||w==="those")&&s[k+1]==="of"&&t.posTags(n)[k]==="NOUN"){let x=n.slice(k+2).filter((A,L)=>!ct.has(s[k+2+L])).join(" ").trim();if(x)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:x})}}let u=new Set,d=k=>{if(k)for(let w=k.start;w<k.end;w+=1)u.add(w)};d(i);for(let[k,w]of Object.entries(fe)){if(w!==i.kind)continue;let S=k.split(" "),x=i.end;if(S.every((A,L)=>r[x+L]===A)){d({start:x,end:x+S.length});break}}let f=Wt(r,Xe,u);d(f);let p=Wt(r,mn,u);d(p);let m=(k,w)=>n.slice(k,w).filter((S,x)=>!u.has(k+x)&&!ct.has(s[k+x])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);c&&!s.includes("by")&&fR.has(g.toLowerCase())&&(g="");let b=i.kind,y=f?Xe[r.slice(f.start,f.end).join(" ")]:null,$=p?mn[r.slice(p.start,p.end).join(" ")]:"direct";if(b==="touches"&&s.includes("when")){let k=h||g;if(k)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:k})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let k=h||g;if(k)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:k})}let E=s.indexOf("by"),R=s.slice(0,i.start).findIndex(k=>ri.has(k)),v=R>=0,j=v&&R>E;if(E>=0&&!u.has(E)&&v){let k=(x,A)=>n.slice(x,A).filter((L,T)=>{let O=x+T,_=s[O];return!u.has(O)&&!ct.has(_)&&_!=="by"&&!ri.has(_)&&!uR.has(_)&&!dR.has(_)}).join(" ").trim(),[w,S]=j?[k(R+1,n.length),k(E+1,R)]:[k(0,E),k(E+1,n.length)];if(w&&S)return b==="defines"&&Yr.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:S,object:w});if(S)return l({shape:"forward",entityType:y,modifier:$,kind:b,object:S});if(w)return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:w})}if(c&&E<0&&g&&s[i.start]==="called")return null;if(h&&g){let k=r.slice(i.start,i.end).join(" ");if(b==="defines"&&Yr.has(k)||b==="calls"&&(yg(g)||pR(h)))return null;let w=h,S=g;return Kr.includes(k)&&([w,S]=[S,w]),l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:w,object:S})}if(g){if(b==="calls"&&yg(g))return null;let k=f&&f.start>=i.end?null:y;return l({shape:"reverse",entityType:k,modifier:$,kind:b,object:g})}if(b==="inherits"&&!h&&f&&f.start===i.end){let k=r.slice(f.start,f.end).join(" ");if(k)return l({shape:"reverse",entityType:null,modifier:$,kind:b,object:k})}if(h&&!g&&v&&i.end-i.start===1&&Ms[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(b==="touches")return l({shape:"when",entityType:null,modifier:"direct",kind:b,object:h});let k=ri.has(s[0]);return l({shape:"reverse",entityType:y,modifier:$,kind:b,object:h,...k?{polar:!0}:{}})}return h?l({shape:"forward",entityType:y,modifier:"direct",kind:b,object:h}):null}var ri,uR,dR,fR,$g,La=N(()=>{Gn();vn();rr();ri=new Set(["is","are","was","were","be","been","being","get","gets","got"]),uR=new Set(["which","what","who","whom","whose"]),dR=new Set(ps.map(e=>e.toLowerCase())),fR=new Set(["recently","lately","yet","already","ever","again"]);$g={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=ii(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function hR(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],c=a.toLowerCase();!/^[a-z]+$/.test(a)||vg.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function gR(e,t=null){let n=nn(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!vg.has(a)&&(mR.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=hR(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var vg,mR,xg,Eg=N(()=>{Gn();vn();Oa();La();vg=new Set([...ct,...me(po),...me(Object.keys(fe)),...me(Object.keys(Xe)),...me(Object.keys(mn)),...me(Object.keys(rt)),...me(ho),...me(go),...me(Object.keys(Bn)),...me(Object.keys(Wn)),...me(Object.keys(Yo)),...me(ps),...me(Jr),...me(mo),...me(fn),...me(On),...me(fs),...me(Object.keys(Jo))]),mR=new Set([...me(Xr),...me(fa)]);xg={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(ir(e))return null;let{text:n,dropped:s,maybeNoise:o}=gR(e,t.nlp||null);if(!s.length||!n)return null;let r=ir(n)||ii(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var Sg=N(()=>{});var Na,Pa=N(()=>{Na=()=>{}});function kg(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?ar(e.subject)===ar(t.subject)&&ar(e.object)===ar(t.object):ar(e.object)===ar(t.object)}function xu(e){let t=(e||[]).filter(l=>l&&Array.isArray(l.candidates)&&l.candidates.length);if(!t.length)return null;let n=[];for(let l of t)for(let u of l.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:l.strategyId,class:l.class});if(n.some(l=>!Rg(l))&&(n=n.filter(l=>!Rg(l))),!n.length)return null;let s=new Map;for(let l of n)s.has(l.class)||s.set(l.class,[]),s.get(l.class).push(l);let o=[];for(let[l,u]of s){let d=[];for(let f of u){let p=d.find(m=>kg(m.parsed,f.parsed)&&m.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),jg(f.parsed)<jg(p.parsed)&&(p.parsed=f.parsed);continue}d.push({...f,agreed:1})}d.length&&o.push({class:l,candidates:d})}if(!o.length)return null;let r=l=>Math.max(...l.candidates.map(u=>u.confidence)),i=o[0];for(let l of o)r(l)>r(i)&&(i=l);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(l=>l.parsed)},c=o.filter(l=>l!==i).map(l=>l.candidates[0]).filter(l=>!i.candidates.some(u=>kg(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function yR(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function _g(e,{describe:t=yR,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var ar,bR,jg,wR,Rg,Eu=N(()=>{ar=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),bR=/^\s*(?:the|a|an)\s+/i,jg=e=>[e?.subject,e?.object].filter(t=>bR.test(String(t||""))).length;wR=new Set(["fuzzy","lemma","spell"]),Rg=e=>wR.has(e.via)});function Ma(e){Su=e}function Fa(){return typeof Su=="function"?Su():null}var Su,cr=N(()=>{Su=null});function Cg(e,t={},n=vR){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var $R,vR,Ig=N(()=>{vn();Oa();La();Eg();Sg();Pa();Eu();cr();$R=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],vR=[wg,$g,xg,...$R]});function lr(e){return xR.test(String(e||"").trim())?"an":"a"}function Da(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function ur(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function ai(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var xR,za=N(()=>{xR=/^[aeiou]/i});var ci,ju=N(()=>{ci=(e,t,n)=>n});var $b={};Ot($b,{DYNAMIC_TAIL_OK_RE:()=>ed,applyNegationFrames:()=>oi,ask:()=>Hs,classDisplayName:()=>vs,degreeMetric:()=>db,metaFallbackEntityAnswer:()=>ob,normalizeQuery:()=>$o,parseQuery:()=>So,parseQueryFull:()=>zu,render:()=>Nn,rephraseHint:()=>Ku,resolveObject:()=>Pn,traverse:()=>sn,worldRelationGraphPayload:()=>gT});function tt(e,t){let n=Og.get(e);n||(n=new Map,Og.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(ws(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Fe(e,t){let[n,s]=Cu[e]||["result","results"];return t===1?n:s}function mi(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Fe(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function vs(e){let t=String(e||"");if(typeof Vn=="function"){let n=Vn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function vo(e){return SR[e]||e}function TR(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||_R.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return me(mo).includes(o)?t:e}function IR(e,t){if(!e||e.shape!=="where"||e.altObject||!AR.test(t))return e;let n=ua(t),s=ua(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=nn(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||ct.has(i)||fe[i]||i.endsWith("ing"))return o;let a=nn(n).map(l=>l.toLowerCase());for(;a.length&&CR.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let c=r.slice(0,-1).join(" ");return{...e,object:c,altObject:s,verb:i}}function So(e,{nlp:t=void 0}={}){return zu(e,{nlp:t}).parsed}function zu(e,{nlp:t=void 0}={}){let n=t===void 0?Fa():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=wu(oi($o(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=LR(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=xu(Cg(o,{nlp:n,raw:s}));return i?{parsed:IR(TR(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Ou(e,t){return t.length&&Yg.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function pr(e,t){return ir(e)||ii(e,t)}function LR(e,t){let n=nn(e),s=n.map(o=>o.toLowerCase());return e_(n,s)||n_(n,s)||FR(n,s,t)||Jg(e,t,0)||s_(n,s,t)||zR(n,s,t)||qR(n,s,t,0)||YR(n,s)||QR(n,s,t)||o_(n,s,t)||a_(n,s,t)||l_(n,s,t,0)||i_(n,s,t,0)||Wu(n,s,t,0)||BR(n,s,t)||PR(n,s)||nb(n,s,t,0)}function PR(e,t){let n=0;NR.has(t[n])&&(n+=1);let s=Vt(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?Tm[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,c=-1,l;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){c=m,l=h;break}}if(c<0)return null;let u=e.slice(a,c).join(" ").trim(),d=e.slice(c+2).join(" ").trim();if(!u||!d)return null;let f=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},p=f(i,u);return p.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:p}},{op:"intersection",kind:"set",ast:{node:"clause",clause:f(l,d)}}]}}function Ba(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function FR(e,t,n){if(!["do","does","did"].includes(t[0])||!MR.has(t[1]))return null;let s=Vt(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let c=Wt(a,fe);if(!c)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((f,p)=>(p<c.start||p>=c.end)&&!ct.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=mr(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:c.kind,object:u,complement:Ba(o,{op:"difference",kind:"set",ast:d})}}function Jg(e,t,n=0){let s=fg(e);if(!s)return null;let o=Vt(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=nn(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>rt[d]))return Ba(r,{op:"difference",kind:"qual",filters:a});let c=Wt(a,fe);if(!c)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,f)=>(f<c.start||f>=c.end)&&!ct.has(a[f])&&a[f]!=="from").length)return Ba(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=mr(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:Ba(r,{op:"difference",kind:"set",ast:u})}function zR(e,t,n){let s=0;for(;s<t.length&&DR.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=Wt(r,fe);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!ct.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function Bu(e,t){let n=new Set;for(let s of t)for(let o of tt(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function Qg(e,t){let n=Gt(t),s=n.filter(r=>!qg.has(r)),o=Bu(e,s.length?s:n);return o.size===1?[...o][0]:null}function mr(e,t,n){if(n>Kg)return{node:"miss",reason:"too deep to resolve"};let s=Jg(e,t,n);if(s)return s;let o=nn(e),r=o.map(l=>l.toLowerCase()),i=Wu(o,r,t,n);if(i)return i;let a=nb(o,r,t,n);if(a)return a;let c=pr(e,t);return c?{node:"clause",clause:c}:null}function Wu(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=fs.includes(t[o]),i=!r&&Xg(t[o]);if(!r&&!i||r&&o+1>=t.length||!Vt(t[o-1]))continue;let c=e.slice(0,o-1);if(!c.length||c.every(f=>rt[f.toLowerCase()]))continue;let l=pr([...c,Iu].join(" "),n);if(!l||l.shape!=="reverse"&&l.shape!=="forward"||l.modifier&&l.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=mr(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:l.shape==="reverse"?"reverseSet":"forwardSet",kind:l.kind,entityType:l.entityType,inner:d}}return null}function BR(e,t,n){for(let s=0;s<t.length;s+=1){if(!UR.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!fe[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Iu,...e.slice(s+1)],a=pr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Iu&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function qR(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!WR.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(GR.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&VR.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&HR.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>fs.includes(d)))return null;let c=Uu.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=mr(c,n,s+1);if(!l||l.node==="miss")return l?{node:"miss",reason:l.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=Vt(a[0]);return{node:"temporal",inner:l,entityType:u&&u.entityType||null}}function YR(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!KR.has(t[n]))return null;let s=t[n],o=e.slice(n+1).join(" ").trim();return o?{node:"commitFilter",op:s,pivotRaw:o}:{node:"miss",reason:`"what changed ${s}" needs a date or commit afterward`}}function JR(e){let t=new Set,n=[];for(let s of e){if(!s||!XR.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function QR(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!Jr.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let f=t.slice(0,d).join(" ");if(d===t.length-1&&(ho.includes(f)||go.includes(f))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=ho.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=ZR(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let c=o?s-1:s,l=JR(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function ZR(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&OR.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>rt[a]))return{type:"qual",filters:r};if(o.length===1){let a=Vt(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=pr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function e_(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?Vt(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let c=i.indexOf("in",1);if(c>0){let u=a.slice(1,c).join(" ").trim(),d=a.slice(c+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:l,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:null,scopeModule:c}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function t_(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Ps(n).slice(e.length).trim(),o=nn(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function n_(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let l=1;l<t.length;l+=1)if(rt[t[l]]){n=l,s=t[l-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&Ms[t[n]]){let l=o+1;for(;l<t.length&&(t[l]==="the"||t[l]==="a"||t[l]==="an");)l+=1;let u=t[l];if(u&&!Om.has(u))return null}let r=t_(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let c=a>i?e.slice(i,a).join(" ").trim():"";return c?{node:"qualCheck",term:c,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function s_(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=pr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function o_(e,t,n){let s=ho.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&rt[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?Vt(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let c=e.slice(o),l=t.slice(o).some(d=>!ct.has(d)&&!Zg.has(d)),u;if(l){let d=mr(`which ${a} ${c.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function i_(e,t,n,s){let o=0,r=!1,i=null;for(let y of eb){let $=y.split(" ");if(t.slice(0,$.length).join(" ")===y){i=y,o=$.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&Gu.has(t[o]);)o+=1;let a=[];for(;o<t.length&&rt[t[o]];)a.push(t[o]),o+=1;let c=o<t.length?Vt(t[o]):null;if(!c||c.placeholder||c.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!fe[t[o]]&&!ps.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${tb}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some(y=>!ct.has(y)&&!Zg.has(y)),p=t.slice(o),m=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),m=m.slice(1));let h=r&&r_.has(p[0]);if(r&&(f&&!h||d.length===0))return null;let g,b=!1;if(f){let y=h?m:d,$=mr(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!$||$.node==="miss")return{node:"miss",reason:$&&$.reason||"the list filter didn't parse"};g=$,b=!0}else g={node:"allOfClass",entityType:l},a.length&&(g={node:"qualifier",filters:a,inner:g});return{node:"list",entityType:l,base:g,scoped:b}}function a_(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(Bn[h]){s=Bn[h],o=m;break}if(Bn[t[m]]){s=Bn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(Wn[t[m]]){r=Wn[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(Wn[t[m]]){r=Wn[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),c=["important","significant","central","key","core","essential","critical","principal"],l=t.some(m=>c.includes(m));!r&&(a||l)&&(r=Wn.connections,i="connections");let u,d=null;for(let m of t){let h=Vt(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?Lm[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let f=["needs","need","needing","lacks","lack","lacking","misses","missing"],p=t.some(m=>f.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:p}}function l_(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Gu.has(t[o]);)o+=1;if(o>=t.length)return null;let r=Vt(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&c_.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=Vt(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>fs.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!fe[t[o]]&&!ps.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${tb}`}:null}function u_(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Gu.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(fs.includes(t[i])){s=i;break}if(s<0)return null;let o=Vt(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function d_(e,t,n,s,o,r){let{branches:i,ops:a}=Wa(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],f=d.map(y=>y.toLowerCase()),p=u===0?"intersection":a[u-1],m=Ou(d,f);if(m.blc.length&&m.blc.every(y=>rt[y])){l.push({op:p,kind:"qual",filters:m.blc});continue}if(f[0]==="of"||f[0]==="in"){l.push({op:p,kind:"set",ast:{node:"membership",entityType:e,term:d.slice(1).join(" ")}});continue}let h=d,g=Wt(f,fe);g?c=d.slice(g.start,g.end):c&&(h=[...c,...d]);let b=sb(`${t} ${h.join(" ")}`,o,r);if(!b||b.node==="miss")return{miss:b&&b.reason||"a clause in the combination didn't parse"};l.push({op:p,kind:"set",ast:b})}return{atoms:l}}function nb(e,t,n,s){let o=u_(e,t);if(o){let{entityType:S,term:x,relIdx:A}=o,L=t.slice(A+1),T=e.slice(A+1);if(!L.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[A]}"`};let O=d_(S,`which ${t[A-1]}`,L,T,n,s+1);if(O.miss)return{node:"miss",reason:O.miss};let _=[{op:"seed",kind:"set",ast:{node:"find",entityType:S,term:x}},...O.atoms];return _.length===1?_[0].ast:{node:"boolean",entityType:S,atoms:_}}let r=0;for(;r<t.length&&Uu.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&rt[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?Vt(t[r]):null;if(!c){let S=r+1<t.length?Vt(t[r+1]):null;if(Lg.has(t[r])&&S&&S.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(Yg.has(t[r])){let x=r+1;x<t.length&&(t[x]==="the"||t[x]==="a"||t[x]==="an")&&(x+=1);let A=x+1<t.length?Vt(t[x+1]):null;if(Lg.has(t[x])&&A&&A.entityType==="Commit"&&x+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&S&&/^[a-z]+$/.test(t[r])&&!fe[t[r]]&&!ct.has(t[r])&&!Qu.has(t[r])?{node:"find",entityType:S.entityType,term:e[r]}:null}let l=c.entityType,u=t[r];r+=1;let d=t.slice(r),f=e.slice(r),p=!1;d.length&&fs.includes(d[0])&&(p=!0,d=d.slice(1),f=f.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&Xg(d[0]),g=f.length>0&&Wa(d,f).branches.some(S=>{let{blc:x}=Ou(S,S.map(A=>A.toLowerCase()));return x.length&&x.every(A=>rt[A])}),b=f.length>0?Wa(d,f).branches:[],y=!1;if(b.length>1){let S=b[0].map(A=>A.toLowerCase()),x=Wt(S,fe);x&&x.start===0&&(y=b.slice(1).every(A=>{let L=A.map(O=>O.toLowerCase()),T=Wt(L,fe);return T&&T.start===0?T.kind===x.kind:!T}))}let $=!1;if(b.length>1){let S=b[0].map(A=>A.toLowerCase()),x=Wt(S,fe);x&&x.start===0&&($=b.slice(1).every(A=>{let L=A.map(O=>O.toLowerCase()),T=Wt(L,fe);return!!T&&T.start===0&&T.end-T.start===1}))}if(!(a.length||p||m||h||g||y||$))return null;if(!f.length){let S={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:S,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let E=c.placeholder?"what":`which ${u}`,{branches:R,ops:v}=Wa(d,f),j=null,k=[];for(let S=0;S<R.length;S+=1){let x=R[S],A=x.map(G=>G.toLowerCase()),L=S===0?"seed":v[S-1],T=Ou(x,A);if(T.blc.length&&T.blc.every(G=>rt[G])){k.push({op:L,kind:"qual",filters:T.blc});continue}if(A[0]==="of"||A[0]==="in"){k.push({op:L,kind:"set",ast:{node:"membership",entityType:l,term:x.slice(1).join(" ")}});continue}let O=x,_=Wt(A,fe);_?j=x.slice(_.start,_.end):j&&(O=[...j,...x]);let P=sb(`${E} ${O.join(" ")}`,n,s+1);if(!P||P.node==="miss")return{node:"miss",reason:P&&P.reason||"a clause in the combination didn't parse"};k.push({op:L,kind:"set",ast:P})}if(k[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let w;return k.length===1?w=k[0].ast:w={node:"boolean",entityType:l,atoms:k},a.length&&(w={node:"qualifier",filters:a,inner:w,entityType:l}),w}function sb(e,t,n){if(n>Kg)return{node:"miss",reason:"too deep to resolve"};let s=nn(e),o=s.map(a=>a.toLowerCase()),r=Wu(s,o,t,n);if(r)return r;let i=pr(e,t);return i?{node:"clause",clause:i}:null}function Wa(e,t){let n=Object.keys(Yo).sort((a,c)=>c.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let c of n){let l=c.split(" ");if(e.slice(i,i+l.length).join(" ")===c){a={c,len:l.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(Yo[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function Vu(e,t,n,s){let o=dr[t];if(o&&Vs.has(n)){let u=tt(e,o).filter(d=>s.has(d.object));return Es(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Vs.has(e.byId.get(u)?.class))?[...Gt(t),o]:Gt(t)).flatMap(u=>tt(e,u)).filter(u=>s.has(u.object)),c=Es(a.map(u=>e.byId.get(u.subject)).filter(Boolean));if(!n||n==="Change")return c;let l=c.filter(u=>u.class===n);return l.length?l:n!=="Module"&&c.some(u=>u.class==="Module")?Yu(e,new Set(c.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function p_(e,t){let n=new Set(Vu(e,"touches","Commit",t).map(s=>String(s.label||"").toLowerCase()));for(let s of t)for(let o of e.byId.get(s)?.derived_from||[]){let r=f_.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function di(e,t,n){let s=Gt(t).flatMap(o=>tt(e,o)).filter(o=>n.has(o.subject));return Es(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function Es(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function m_(e,t){let n=gs(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&gs(o.label).startsWith(s))}function Lu(e){let t=Ng.get(e);if(t)return t;let n=new Set;for(let i of tt(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of tt(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of tt(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Ng.set(e,t),t}function fr(e,t){return t?t.class==="Module"?t.id:Lu(e).moduleOfSymbol.get(t.id)||null:null}function ob(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>h_.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=fr(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Fe(o.class,1),c=a==="attribute"?"an":"a",l=i?`, ${ci("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${c} ${a} in this codebase${l} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function Nu(e,t,n){let s=Es(Xo.flatMap(o=>di(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function Hu(e,t,n=null){let s=xs(e,t,n);if(!(s.match&&s.tier===1)){let o=m_(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function rb(e,t,n,s,o){let r=o||(()=>!0),i=Nu(e,t,s).filter(r);if(i.length||!ab(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of ib(e,t)){let c=e.byId.get(a);if(!c)continue;let l=Nu(e,a,s).filter(r);if(l.length)return{own:i,inherited:l,viaId:a,viaLabel:c.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function xo(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=Lu(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=fr(e,t),o=Lu(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&wo(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function qu(e){return tt(e,"inherits")}function Pu(e,t){return qu(e).filter(n=>n.object===t).map(n=>n.subject)}function Pg(e,t){return qu(e).filter(n=>n.subject===t).map(n=>n.object)}function g_(e,t){let n=new Set,s=[...Pu(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Pu(e,o))n.has(r)||s.push(r)}}return n}function ib(e,t){let n=new Set,s=[...Pg(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Pg(e,o))n.has(r)||s.push(r)}}return n}function ab(e,t){let n=Mg.get(e);if(n||(n=new Map,Mg.set(e,n)),n.has(t))return n.get(t);let s=qu(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function Fg(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function zg(e){return e.slice().sort((t,n)=>Dg[n.via]-Dg[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Ug(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=$s(n);if(ys(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of Eo(e.label))if(ys(o,n,s)<=s)return!0;return!1}function cb(e,t,n){let s=e.individuals.filter(c=>c.class===t),o=[...Eo(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=ab(e,t),i=[];for(let c of s){let l=Fg(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...g_(e,c.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!Fg(f,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:zg(i),broad:[]};let a=new Map;for(let c of s)for(let l of ib(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&Ug(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Pu(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Ug(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:zg([...a.values()])}}function b_(e){return[...ja(ka(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function xn(e,t,n){switch(t.node){case"clause":return sn(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?b_(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=cb(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Gt(t.kind).flatMap(o=>tt(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=xs(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=Qg(e,t.kind);if(!o)return[];let r=new Set(di(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"reverseSet":{let s=new Set(xn(e,t.inner,n).map(o=>o.id));return Vu(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(xn(e,t.inner,n).map(o=>o.id));return di(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=Hu(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(c=>c.id));return Es(Xo.flatMap(c=>di(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=rb(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?fb(e,t,n).matches:xn(e,t.inner,n).filter(o=>t.filters.every(r=>xo(e,o,rt[r])));case"boolean":return lb(e,t,n);case"anaphora":return ub(e,t,n).matches;default:return[]}}function lb(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=xn(e,o.ast,n);continue}if(o.kind==="qual"){let i=c=>o.filters.every(l=>xo(e,c,rt[l])),a=c=>o.filters.every(l=>{let u=w_(rt[l]);return u?xo(e,c,u):!xo(e,c,rt[l])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(xn(e,o.ast,n).map(i=>i.id));if(o.op==="intersection")s=s.filter(i=>r.has(i.id));else if(o.op==="difference")s=s.filter(i=>!r.has(i.id));else if(o.op==="union"){let i=new Set(s.map(a=>a.id));for(let a of xn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function y_(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=Pn(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function ub(e,t,n){let o=y_(e,t.candidateTerms);if(!o){let d=n&&n.prev;if(!Array.isArray(d)||!d.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=d.map(f=>e.byId.get(f)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(d=>i.filters.every(f=>xo(e,d,rt[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=Pn(e,i.clause.object);if(!d.match)r=[];else{let f=dr[i.clause.kind],p=[...Gt(i.clause.kind),...f?[f]:[]],m=new Set(p.flatMap(h=>tt(e,h)).filter(h=>h.object===d.match.id).map(h=>h.subject));r=r.filter(h=>m.has(h.id))}}let a=d=>d.length&&d.every(f=>f.class===d[0].class)?d[0].class:null,c=i&&i.type==="entity"?i.entityType:a(o),l=r.length?a(r):c;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:l,matches:[]};let u=mi(l,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:l,referents:u}}function db(e,t,n){let s=n.kind==="*"?$_:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of tt(e,r)){let a=i.subject===t.id,c=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let l=e.byId.get(i.object);if(!l||l.class!==n.filter)continue}o+=1}else(n.dir==="in"&&c||n.dir==="both"&&(a||c))&&(o+=1)}return o}function v_(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function E_(e,t){let{op:n,pivotRaw:s}=t,o=u=>String((u.attributes||[]).find(d=>d.key==="date")?.value||"").slice(0,10),r=null,i=null,a=null;if(x_.test(s))r=s;else{let{match:u,ambiguous:d}=Pn(e,s,{expectedClass:"Commit"});u&&!d&&u.class==="Commit"&&o(u)&&(i=u.id,a=u.label,r=o(u))}if(!r)return{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotResolved:!1,matches:[]};let c=e.individuals.filter(u=>u.class==="Commit"&&u.id!==i&&o(u)).filter(u=>{let d=o(u);return n==="since"?d>=r:n==="before"?d<r:n==="after"?d>r:d===r}).sort((u,d)=>o(d).localeCompare(o(u))),l=[];return c.length&&l.push({kind:"set",class:"Commit",label:`${c.length} commit${c.length===1?"":"s"} ${n} ${s}`,ids:c.map(u=>u.id),attrs:{count:c.length,op:n,...i?{pivot:i}:{}},lane:"commitFilter"}),i&&l.push({kind:"event",class:"Commit",label:a,ids:[i],attrs:{date:r},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:r,pivotResolved:!0,matches:c,referents:l}}function S_(e,t,n){let s=xn(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size)return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0};let r=Vu(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(c=>c.key==="date")?.value||"");return r.sort((a,c)=>i(c).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function j_(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(tt(e,"tests").map(c=>c.subject));n=n.filter(c=>!a.has(c.id)&&!wo(String(c.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:db(e,a,t.metric)})).sort((a,c)=>t.extreme==="most"?c.score-a.score:a.score-c.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?mi(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function fb(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?m=>s.filters.every(h=>xo(e,m,rt[h])):null,a=m=>mi(r,m,"membership"),c=Hu(e,o.term,n&&n.contextId);if(c.kind==="dir"){let m;if(!r||r==="Module")m=c.mods;else{let h=new Set(c.mods.map(g=>g.id));m=Es(Xo.flatMap(g=>di(e,g,h))).filter(g=>g.class===r)}return i&&(m=m.filter(i)),{compositeKind:"set",matches:m,entityType:r,referents:a(m)}}if(c.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:l,inherited:u,viaLabel:d}=rb(e,c.id,c.entityClass,r,i),f=!l.length&&u.length>0,p=f?u:l;return{compositeKind:"membership",entityType:r,matches:p,inheritedNotOwn:f,viaLabel:d,ownerLabel:c.label,referents:a(p)}}function k_(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=Pn(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=Pn(e,s,{expectedClass:n}),c=!r||a.match&&fr(e,a.match)===r.id,l=a.match&&c;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:l?[a.match]:[]}}let i=r?Yu(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function R_(e,t,n){let s=fr(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Nu(e,n.id).some(o=>o.id===t.id)}function __(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=xs(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=Hu(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!R_(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let c=xo(e,a.match,rt[o]),l=r?!c:c,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:l,matches:[a.match],referents:u}}function T_(e,t,n){let s=Pn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=xn(e,{node:"allOfClass",entityType:t.entityType},n),r=lb(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function A_(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(xn(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=sn(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function C_(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return k_(e,t);if(t.node==="qualCheck")return __(e,t,n);if(t.node==="universal")return T_(e,t,n);if(t.node==="count"){let i=A_(e,t.base,n);return i?{compositeKind:"count",count:p_(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:xn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:xn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return pT(e,t);if(t.node==="superlative")return j_(e,t);if(t.node==="temporal")return S_(e,t,n);if(t.node==="recentCommits")return v_(e);if(t.node==="commitFilter")return E_(e,t);if(t.node==="anaphora")return ub(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return fb(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=cb(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:i.length?i:a,broad:!i.length&&a.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let s=xn(e,t,n),o=t.entityType||null,r=mi(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function pb(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function I_(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=pi(e);return n?`${t} in ${n}`:t}function Mu(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(Mu):Array.isArray(e.filters)&&e.filters.some(t=>rt[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(Mu)}function O_(e,t){return!["Function","Method"].includes(t)||!Mu(e)?null:"This index records tests edges module to module, so it holds no function-grain coverage to filter on \u2014 ask whether the module a function lives in is tested instead."}function L_(e,t,n){if(t.compositeMiss)return t.reason==="no-prev"?{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1}:{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${pb()}.`,miss:!0,ambiguous:!1};if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=Fe(t.entityType,1),o=Fe(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=pi(i),c=i.class==="Module"?"":a?`, ${ci("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${Ws(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=Fe(t.entityType,t.total),o=kR(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${Ws(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Fe(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${Fe(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>et?` \u2014 narrow with "${Fe(t.entityType,2)} in <module>"`:"";return{content:`${Ws(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=Ln(t.asked),o=fo[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length)return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${Gs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Fe(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${Ws(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${Ws(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Fe(t.entityType,1);if(!t.matches.length)return{content:`no ${Fe(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?I_(t.matches[0]):Ws(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Fe(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,tn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>tn?` \u2026+${t.matches.length-tn} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,tn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>tn?` \u2026+${t.matches.length-tn} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${Fe(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${Ws(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?Fe(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:`nothing in the index matches the inner set, so there is no change history to date. ${Gs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${Gs(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let c=(i.attributes||[]).find(d=>d.key==="message")?.value||"",l=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${l}${c?` ("${c}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=O_(e,t.entityType)||Gs(n);return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${Ws(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function Ku(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+pb()}function Gs(e=null){return e&&ti(e)===0?du:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function Eo(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Va(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function mb(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function N_(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function li(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(g=>g.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let g=i[2],b=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${g}`)||String(y.label).toLowerCase().startsWith(g)));if(b.length===1)return{match:b[0],candidates:[],tier:1,ambiguous:!1};if(b.length>1)return{match:b[0],candidates:b.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(g=>String(g.label).toLowerCase()===o||String(g.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let c=`ext:${o}`,l=null;e:for(let g of e.relations)for(let b of g.edges)if(String(b.object).toLowerCase()===c){l=b.object;break e}if(l&&!n)return{match:{id:l,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(g=>g.trim()).filter(Boolean);if(u.length>1){let g=new Set;for(let b of u){let y=li(e,b,{expectedClass:n});y.match&&!y.ambiguous&&g.add(y.match.id)}if(g.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],f=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(f){let g=o.split(".").pop();for(let b of r){let y=String(b.label||"").toLowerCase();b.class==="Module"?y.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:b,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs(y.length-o.length)})}}else{let g=[...Eo(s)],b=o.split(/\s+/).find(v=>v.includes("/")),y=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,E=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,R=E?N_(s):null;for(let v of r){let j=String(v.label||"").toLowerCase(),k=j.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(k===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(k.startsWith(o)||k.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(k.length-o.length)});continue}if(E){let x=mb(v.label);if(x&&x===R){d.push({ind:v,score:5e3});continue}let A=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if(x&&A&&R.length>=4&&x.includes(R)){d.push({ind:v,score:2e3-Math.abs(x.length-R.length)});continue}}if(v.class==="Module"){let x=Va(o);if(x!==o&&x===Va(k)){let A=$s(o);if(ys(k,o,A)>A){d.push({ind:v,score:3e3-Math.abs(k.length-o.length)});continue}}}if(o.length>=4&&j.includes(o)){d.push({ind:v,score:1e3-Math.abs(j.length-o.length)});continue}let w=Eo(v.label),S=g.filter(x=>w.has(x)).length;S>0&&(!y||w.has(y))&&d.push({ind:v,score:S/g.length*Ru})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,y=b.filter(E=>E.score===g.score),$=g.score>=Ru?b.filter(E=>E.score>=Ru):b;return{match:g.ind,candidates:$.slice(0,4).map(E=>E.ind),tier:3,ambiguous:y.length>0}}let p=f||o.includes("/"),m=null,h=!p&&typeof bo=="function"?bo(e.proseIndex,s).filter(g=>!n||e.byId.get(g.id)?.class===n):[];if(h.length){let[g,...b]=h,y=e.byId.get(g.id);if(y){let $=b.filter(E=>E.score===g.score);if(m={match:y,candidates:b.slice(0,4).map(E=>e.byId.get(E.id)).filter(Boolean),tier:4,ambiguous:$.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=$s(o),b=g+1,y=[];for(let $ of r){let E=ys(String($.label||"").toLowerCase(),o,g);if(E>0)for(let R of Eo($.label)){if(E<=0)break;E=Math.min(E,ys(R,o,g))}E<b?(b=E,y=[$]):E===b&&E<=g&&y.push($)}if(b<=g&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&y.length>1&&!m){let[$,...E]=y;return{match:$,candidates:E.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function _u(e,t){let n=mb(t),s=[...Eo(t)],o=[];for(let r of Eo(e))n.includes(r)||s.some(i=>Va(i)===Va(r))||Ga.has(r)||bb.has(r)||o.push(r);return o}function Ua(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(_u(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),_u(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:Ln(s.slice(0,4).map(r=>r.label))}:e}let n=_u(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function Pn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(P_,"").trim(),i=r.match(M_);if(i){let a=r.slice(0,i.index).trim(),c=Xe[i[1].toLowerCase()];if(a&&c){let l=Ua(li(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ua(li(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ua(li(e,t,n),t)}return Ua(li(e,t,n),t)}function xs(e,t,n){if(po.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return Pn(e,t)}function Yu(e,t,n){let s=[];for(let o of tt(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function F_(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Vs.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>tt(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&Vs.has(n)&&(c=c.filter(l=>l.class===n)),{matches:c,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function B_(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&Xu.has(Bg(s.label))).map(s=>({ind:s,named:n.has(Bg(s.label))?1:0,depth:String(s.label).split("/").length,fixture:U_(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function W_(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function Ju(e){return(e?.attributes||[]).find(t=>G_.has(t.prop))?.value||null}function V_(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${lr(e)} ${e} in this graph's vocabulary`}function sn(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return C_(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let T=t.candidates.map(O=>{let _=sn(e,O,{contextId:n,prev:s});return{parsed:O,result:_,rendered:Nn(O,_,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:T}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let T=String(t.object||"").trim(),O=T.toLowerCase(),_=(e.individuals||[]).find(P=>{if(!Ju(P))return!1;if(String(P.label).toLowerCase()===O)return!0;let G=(P.attributes||[]).find(J=>J.key==="token")?.value;return G&&String(G).toLowerCase()===O});if(!_){let P=ob(e,T);return P?{matches:[P.hit],objMatch:P.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:P.text,traversal:`schema lookup for "${T}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}return{matches:[_],objMatch:_,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}if(r==="mentions"){let T=String(t.object||"").trim();return{matches:(typeof bo=="function"?bo(e.proseIndex,T):[]).map(P=>e.byId.get(P.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${T}"`}}if(r==="where"&&D_.test(String(t.object||"").trim())){let T=B_(e,t.object);return{matches:T,objMatch:T[0]||null,candidates:T.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...Xu].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!W_(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let T=xs(e,t.subject,n),O=xs(e,t.object,n);if(!T.match||!O.match||T.ambiguous||O.ambiguous)return{matches:[],objMatch:O.match,candidates:O.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(T.unresolvedPronoun||O.unresolvedPronoun)};let[_,P]=[T.match,O.match];i==="touches"&&P.class==="Commit"&&_.class!=="Commit"&&([_,P]=[P,_]);let G=dr[i],J=[...new Set(G?[...Gt(i),G]:Gt(i))],q=J.flatMap(z=>tt(e,z)).filter(z=>z.subject===_.id&&z.object===P.id);return{matches:q,answer:t.negated?q.length===0:q.length>0,objMatch:O.match,subjMatch:T.match,candidates:[],traversal:`${J.join("+")} edge from ${_.label} to ${P.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=xs(e,t.object,n),t.altObject&&t.altObject!==t.object){let T=xs(e,t.altObject,n),O=!!c.match&&!c.ambiguous,_=!!T.match&&!T.ambiguous;!O&&_?c=T:O&&_&&c.match.id!==T.match.id&&(c={...c,ambiguous:!0,candidates:[T.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let T=P=>P.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),O=T(String(t.object||"").trim().toLowerCase()),_=(e.individuals||[]).find(P=>{if(P.class!=="Module"||P.id===c.match.id)return!1;let G=String(P.label||"").toLowerCase().split("/").pop();return G!==T(G)&&T(G)===O});_&&(c={...c,ambiguous:!0,candidates:[_,...c.candidates||[]]})}}let{match:l,candidates:u,ambiguous:d,unresolvedPronoun:f,matchedVia:p,unplacedWords:m,nearestLabel:h}=c;if(!l)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:f,unplacedWords:m,nearestLabel:h};if(d){let O=Es([l,...u||[]]).slice(0,et).map(_=>{let P=sn(e,t,{contextId:n,prev:s,pinnedObjMatch:_});return{candidate:_,result:P,rendered:Nn(t,P,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:O}}if(r==="where"){let T=(l.attributes||[]).find(O=>O.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whereShape:!0,site:T,traversal:T?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let T=P=>String((P.attributes||[]).find(G=>G.key==="date")?.value||""),O;if(l.class==="Commit")O=[l];else{let P=["touches","touchesSymbol"].flatMap(J=>tt(e,J)).filter(J=>J.object===l.id),G=new Set;O=[];for(let J of P){if(G.has(J.subject))continue;G.add(J.subject);let q=e.byId.get(J.subject);q&&q.class==="Commit"&&O.push(q)}O.sort((J,q)=>T(q).localeCompare(T(J)))}let _=O.length&&T(O[0])?[{kind:"event",class:"Commit",label:O[0].label,ids:[O[0].id],attrs:{date:T(O[0]).slice(0,10)},lane:"when"}]:[];return{matches:O,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:_,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let T=J=>String((J.attributes||[]).find(q=>q.key==="date")?.value||""),O=["touches","touchesSymbol"].flatMap(J=>tt(e,J)).filter(J=>J.object===l.id),_=new Set,P=[];for(let J of O){if(_.has(J.subject))continue;_.add(J.subject);let q=e.byId.get(J.subject);q&&q.class==="Commit"&&P.push(q)}P.sort((J,q)=>T(q).localeCompare(T(J)));let G=P.length&&T(P[0])?[{kind:"event",class:"Commit",label:P[0].label,ids:[P[0].id],attrs:{date:T(P[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:P,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:G,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return F_(e,l,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let T=dr[i],_=!!(T&&l.class&&Vs.has(l.class))?[...new Set([...Gt(i),T])]:Gt(i);if(a&&a!=="Change"){let B=Bu(e,_),I=ku[a];if(B.size&&!B.has(a)&&!(I&&B.has(I)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...B],traversal:`${_.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${vs(a)})`}}let G=_.flatMap(B=>tt(e,B)).filter(B=>B.subject===l.id).map(B=>e.byId.get(B.object)).filter(Boolean),J=Es(G),q=J,z="";if(a&&a!=="Change"){q=J.filter(I=>I.class===a);let B=ku[a];if(!q.length&&B){let I=J.filter(D=>D.class===B);I.length&&(q=I,z=`, widened to ${B} subjects (no ${a} recorded)`)}}return{matches:q,objMatch:l,candidates:u,traversal:`${_.join("+")} edges where subject = ${l.label}${z}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:sr(e,l,{maxDepth:Wg}).flat().map(_=>e.byId.get(_.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${Wg})`};let g=dr[i]||Gt(i).find(T=>qg.has(T))||null,b=!!(l.class&&Vs.has(l.class));if(g&&(Vs.has(a)||b)){let T=tt(e,g).filter(z=>z.object===l.id),O=Es(T.map(z=>e.byId.get(z.subject)).filter(Boolean)),_=!a||a==="Change"?O:O.filter(z=>z.class===a),P="",G=ku[a];if(!_.length&&G){let z=O.filter(B=>B.class===G);z.length&&(_=z,P=`, widened to ${G} subjects (no ${a} recorded)`)}let J=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!tt(e,"contains").some(z=>z.subject===l.id),q=J?e.byId.get(fr(e,l)||""):null;if(_.length||!(J&&q))return{matches:_,objMatch:l,candidates:u,traversal:`${g} edges where object = ${l.label}${P}`,ambiguous:d,matchedVia:p}}let y=l,$=u,E=d,R=p,v="",j=Qg(e,i);if(j&&y.class&&y.class!==j){let T=Pn(e,t.object,{expectedClass:j});if(T.match&&!T.ambiguous)y=T.match,$=T.candidates,E=T.ambiguous,R=T.matchedVia;else if(j==="Module"){let O=fr(e,y),_=O&&e.byId.get(O);if(_)v=`, refined from ${y.label} to its containing module`,y=_;else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:R,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${vs(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${vs(j)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:$,ambiguous:E,matchedVia:R,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${vs(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${vs(j)})`}}let k=Gt(i).flatMap(T=>tt(e,T)).filter(T=>T.object===y.id);i==="cochange"&&(k=k.concat(Gt(i).flatMap(T=>tt(e,T)).filter(T=>T.subject===y.id).map(T=>({...T,subject:T.object,object:T.subject}))));let w="";if(!k.length&&y.class){let T=`ext:${String(y.label).toLowerCase()}`;k=Gt(i).flatMap(O=>tt(e,O)).filter(O=>String(O.object).toLowerCase()===T),k.length&&(w=` (by name, via unresolved ${T} references)`)}let S=[],x=new Set;for(let T of k){let O=e.byId.get(T.subject);O&&!x.has(O.id)&&(x.add(O.id),S.push(O))}let A,L="";if(!a||a==="Change")A=S;else{let T=S.filter(O=>O.class===a);if(T.length)A=T;else if(a!=="Module"&&S.some(O=>O.class==="Module")){let O=new Set(S.filter(_=>_.class==="Module").map(_=>_.id));A=Yu(e,O,a),L=`, then ${vs(a)} defined in the matched module(s)`}else A=[]}return{matches:A,objMatch:y,candidates:$,traversal:`${Gt(i).join("+")} edges where object = ${y.label}${w}${L}${v}`,ambiguous:E,matchedVia:R}}function pi(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function Tu(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function H_(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function Ln(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function ui(e){let t=e.object??e.subject??"?";return`${e.entityType?Fe(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Fu(e){return qr[e]?.bare||e}function q_(e){let t=Fu(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function K_(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=Fe(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${Fu(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${Fu(o.kind)} ${JSON.stringify(String(r))}`}function hb(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(ui).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>hb(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?K_(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${vo(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?Fe(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${vo(e.kind)}`:`${r}${vo(e.kind)} "${e.object}"`}return{english:o,machine:s}}function Nn(e,t,n=null){let s=gb(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function gb(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${Ku()}`,miss:!0,ambiguous:!1};if(e.node)return L_(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
|
|
55
|
+
${t.branches.map((c,l)=>`${l+1}) as ${ui(c.parsed)}: ${c.rendered.content}`).join(`
|
|
56
56
|
`)}
|
|
57
|
-
(ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(
|
|
58
|
-
${a.map((
|
|
59
|
-
`)}`:p,miss:!1,ambiguous:!0,candidates:i.map(g=>g.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let c=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${Kl(i)} is defined in ${a[1]} at ${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}let l=Xr(i);return l?{content:`${Kl(i)} is defined in ${l} (no line span recorded in this index).`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Is(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(p=>p.key==="date")?.value||"";if(!l)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let c=(a.attributes||[]).find(p=>p.key==="message")?.value||"",u=String(l).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${Vr("is-dated",a.id,"is dated")} ${u}${c?` ("${c}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${c?` ("${c}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Is(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!l)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let c=t.matches.length-1;return{content:`${i} was last touched by ${l} (commit ${a.label})${c?`; ${c} earlier commit${c===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,Xe)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let l=[...a.entries()].map(([u,d])=>`${Ue(u,d.length)} ${En(d)}`),c=t.matches.length>Xe?`; \u2026and ${t.matches.length-Xe} more`:"";return{content:`${i} touched ${l.join("; ")}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,l=e.negated?a:i,c=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?l:c}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(No.includes(e.kind)&&n&&t.objMatch)for(let l of No){if(l===e.kind)continue;let c={...e,kind:l},u=Jt(n,c,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return $g(c,u,n)}return{content:`${t.objMatch.label} has no ${ao(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(aj,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=Ue(e.entityType||"Module",2),a=t.objMatch&&Qs.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${ao(e.kind)} ${a}. ${Is(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${RR(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!Cs.has(i.class))){let i=t.matches.slice(0,Xe).map(l=>l.class==="Commit"?jR(l):l.label),a=t.matches.length>Xe?`, \u2026and ${t.matches.length-Xe} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,Xe)){let a=Xr(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Kl(i))}let o=[...s.entries()].map(([i,a],l)=>{let c=En(a);return l===0?`in ${i} there is ${c}`:`there is ${c} in ${i}`}),r=t.matches.length>Xe?` \u2026and ${t.matches.length-Xe} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function xg(e){if(e.length<4||IR.has(e))return null;let t=cs(e),n=t+1,s=null,o=!1;for(let r of AR){let i=as(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function qm(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!mu(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=xg(n);return!!s&&s!==n&&!!He[s]}function Eg(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=us(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||qm(s,t.object))return!1;if(t.shape==="ask"){let o=us(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!qm(o,t.subject))}return!0}function CR(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Ff.includes(t)}function OR(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Ur(io(String(t||""))),i=Xt(r);if(!i.length)return null;let a=[],l=[],c=R=>{let T=kn(e,R);return!!T.match&&T.tier!=null&&T.tier<=2},u=R=>{let T=kn(e,R);return!!T.match&&T.tier!=null&&T.tier<=3},d=R=>{let T=String(R||"").trim().toLowerCase();return Qs.includes(T)?!0:Xt(T).some(M=>{let I=M.toLowerCase();return!wa.has(I)&&!ou.has(I)})},p=new Set(["reverse","forward","where","when","ask"]),f=R=>{let T=R.join(" "),M=uo(T,{nlp:n});return Eg(e,M,s)!==!0||M&&!M.node&&p.has(M.shape)&&(M.object!=null&&!d(M.object)||M.shape==="ask"&&M.subject!=null&&!d(M.subject))||Sn(M,Jt(e,M,{contextId:s,prev:o}),e).miss?null:{parsed:M,text:T}},h=R=>({parsed:R.parsed,from:r,to:R.text,dropped:[...a],steps:l}),m=0,b=Math.max(i.length,1)+12;for(;m<b;m+=1){let R=-1;for(let I=0;I<i.length;I+=1){let D=i[I].toLowerCase();if(gu.has(D)&&!wa.has(D)&&!c(i[I])){R=I;break}}if(R<0)break;let T=i[R];i=i.filter((I,D)=>D!==R),a.push(T),l.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let M=f(i);if(M)return h(M)}let g=uo(i.join(" "),{nlp:n}),y=new Set;if(g&&!g.node&&p.has(g.shape))for(let R of[g.object,g.subject])for(let T of Xt(String(R||"").toLowerCase()))y.add(T);let w=[],v=[],k=[];for(let R of i){let T=R.toLowerCase();if(!/^[a-z]+$/.test(T)||wa.has(T)||ou.has(T)||u(R)){w.push(R);continue}let I=xg(T);if(I&&I!==T){w.push(I),k.push(`${R}\u2192${I}`);continue}if(y.has(T)){w.push(R);continue}v.push(R)}if((k.length||v.length)&&w.length){i=w,a.push(...v),k.length&&l.push(`fuzzy-correct ${JSON.stringify(k)} \u2192 "${i.join(" ")}"`),v.length&&l.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let R=f(i);if(R)return h(R)}let $=!1,x=i.map(R=>{let T=R.toLowerCase();return Po[T]&&!u(R)?($=!0,Po[T]):R});if($){l.push(`normalise synonyms \u2192 "${x.join(" ")}"`);let R=f(x);if(R)return h(R)}let E=Xt(r).map(R=>R.toLowerCase()),S=[],_=[];for(let R of E){if(vg.has(R))continue;let T=He[R];T&&T!=="Change"?S.push(R):_.push(R)}if(S.length===1&&_.length===0){let R=f(["count",S[0]]);if(R)return l.push(`bare kind "${S[0]}" \u2192 count`),h(R)}return null}function NR(e,t){let n=String(t||"");if(!e||!Km.test(n))return n;let s=e.individuals.filter(l=>l.class==="Commit");if(!s.length)return n;let o=l=>String((l.attributes||[]).find(c=>c.key==="date")?.value||""),r=[...s].sort((l,c)=>o(c).localeCompare(o(l)))[0];if(!r)return n;let i=n.replace(Km,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return LR.test(a)?`${a} touched`:i}function PR(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function bu(e,t){let n=PR(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function DR(e,t){let n=String(t||"").trim(),s=n.match(MR),o=s?null:n.match(FR),r=s||o;if(!r||!wu.test(r[2]||"")||He[r[1].toLowerCase()])return null;let i=bu(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function zR(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=bu(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function GR(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function VR(e,t){let n=Fi(String(t||"").trim()),s=n.match(UR),o=s?Tf[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(BR)?.[1]||n.match(WR)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Js[o].predicate},a=zR(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let l=GR(e,r);return l?{...i,subjects:[l],asked:[l]}:null}function HR(e,t){return Js[e].matchesLocativePredicates?Oo(Yr(t.prop))||Oo(Yr(t.predicate)):null}function qR(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Js[t.relation],r=Yr(o.predicate),i=new Map,a=new Map;for(let c of e?.relations||[]){let u=Yr(c.prop),d=Yr(c.predicate),p=u===r||d===r,f=p?null:HR(t.relation,c);if(!(!p&&!f))for(let h of c.edges||[]){let m=e.byId?.get(h.subject);if(!m||!(s?s.has(h.subject):n.has(m.class)))continue;let g={subject:m,object:h.object,reads:p?o.reads:`is ${f}`};p?i.set(h.subject,g):a.set(`${u||d}\0${h.subject}`,g)}}let l=[...i.values(),...[...a.values()].filter(c=>!i.has(c.subject.id))].sort((c,u)=>String(c.subject.id).localeCompare(String(u.subject.id))||String(c.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:l,matches:l.map(c=>c.subject)}}function Yl(e){let t=KR.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function XR(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Yl(a.subject).base,String(a.object));let s=new Set(Af),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:l,epoch:c,stamp:u}=Yl(a.subject),d=n.get(l)||t(l);if(!d)continue;let p=`${a.predicate}\0${l}`;YR(r.get(p),c,u)&&(o.set(l,{id:l,label:l,class:d}),r.set(p,{epoch:c,stamp:u,predicate:a.predicate,subject:l,object:Yl(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function ZR(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=bu(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(l=>l.id));if(i.size<2)return!1;let a=new Map;for(let l of e?.individuals||[])l?.id&&(a.has(l.id)||a.set(l.id,new Set),a.get(l.id).add(l.class));return[...i].every(l=>l===o||a.get(l)?.has(o))}function Os(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(CR(t))return{content:pu(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=NR(e,t);let r=ru(t,{nlp:s}),i=r.parsed,a=i,l=null;if(Eg(e,i,n)===!1){let p=OR(e,t,{nlp:s,contextId:n,prev:o});p&&(a=p.parsed,l={from:p.from,to:p.to,dropped:p.dropped,steps:p.steps})}let c=Jt(e,a,{contextId:n,prev:o}),u=Sn(a,c,e);if(Ym(e,a,c,u)){let p=DR(e,t);if(p){let f=Jt(e,p,{contextId:n,prev:o}),h=Sn(p,f,e);h.miss||(a=p,c=f,u=h,l=null)}}if(Ym(e,a,c,u)){let p=VR(e,t);if(p){let f=Jt(e,p,{contextId:n,prev:o}),h=Sn(p,f,e);h.miss||(a=p,c=f,u=h,l=null)}}if(a===null&&u.miss&&!u.ambiguous){let f=oa(String(t||"")).trim().match(JR)?.[1]?.trim();if(f&&!/\s+(?:for|about)$/i.test(f)){let h=uo(`what is a ${f}`,{nlp:s});h?.shape==="meta"&&(c=Jt(e,h,{contextId:n,prev:o}),u=Sn(h,c,e))}}if(a===null&&u.miss&&!u.ambiguous){let f=io(String(t||"")).match(QR)?.[1]?.trim();if(f){let h=uo(`what is a ${f}`,{nlp:s});if(h?.shape==="meta"){let m=Jt(e,h,{contextId:n,prev:o}),b=Sn(h,m,e);!b.miss&&!b.ambiguous&&(c=m,u=b)}}}let d=l&&!u.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${u.content}`:u.content;if(!l&&!u.miss&&!u.ambiguous&&r.alternates.length){let p=r.alternates.map(f=>{let h=Jt(e,f.parsed,{contextId:n,prev:o}),m=Sn(f.parsed,h,e);return m.miss?null:{a:f,text:m.content}}).filter(Boolean);if(p.length){let f=Im(p.map(h=>h.a),{answerFor:h=>p.find(m=>m.a===h)?.text||null});d=`${d}
|
|
60
|
-
${
|
|
61
|
-
`)}`}}if(!u.ambiguous&&
|
|
62
|
-
(answering for ${
|
|
63
|
-
`);return{start:o,end:r,text:a,truncated:i}}async function
|
|
64
|
-
`);return s==null||o==null?{lines:
|
|
65
|
-
## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(
|
|
66
|
-
## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${
|
|
67
|
-
## inlined callee body (depth-1 in-repo call): ${a.label} @ ${a.site.path}:${
|
|
68
|
-
`)}function
|
|
69
|
-
${
|
|
70
|
-
## anchor: ${
|
|
71
|
-
## registration / module globals (replicate this pattern):`);for(let
|
|
72
|
-
## closest example (full body) \u2014 copy this style: ${
|
|
73
|
-
## inlined callee body (depth-1 in-repo call): ${
|
|
74
|
-
## members of ${
|
|
75
|
-
## sibling symbols to copy the style of (most relevant first; ${
|
|
57
|
+
(ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(ui),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${ui(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(ui),candidateParses:e.candidates};if(t.unresolvedPronoun)return{content:`"${e.object??e.subject}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.unsupportedModifier)return{content:`the "${e.modifier}" modifier isn't supported for "${e.kind}" queries yet \u2014 only imports/calls (module-level) have a transitive closure today.`,miss:!0,ambiguous:!1};if(t.wrongGrainMiss){let i=t.objMatch.class?Fe(t.objMatch.class,1):"term",a=Fe(t.wantClass,1);return{content:`"${e.object}" resolved to the ${i} ${t.objMatch.label}, but this question needs a ${a} \u2014 no ${a} named "${e.object}" was found in the index.`,miss:!0,ambiguous:!1}}if(t.forwardGrainMiss){let i=t.wantClasses.map(a=>Fe(a,2));return{content:`${t.objMatch.label}'s "${vo(e.kind)}" relation in this index never produces ${Fe(e.entityType,2)} \u2014 only ${Ln(i)}.`,miss:!0,ambiguous:!1}}if(e.shape==="meta"){if(!t.objMatch)return{content:`"${e.object}" isn't a term in this graph's own vocabulary (no matching class or predicate).`,miss:!0,ambiguous:!1};if(t.metaCodeClass)return{content:t.metaFallbackText,miss:!1,ambiguous:!1,matches:t.matches};let i=Ju(t.objMatch)||"";return{content:`${t.objMatch.label} is ${V_(t.objMatch.class)}: ${i}`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.mentionsShape){if(!t.matches.length)return{content:`"${e.object}" is not mentioned in any indexed identifier or doc-comment prose.`,miss:!0,ambiguous:!1};let i=t.matches.slice(0,et).map(c=>`${c.label} (${Fe(c.class,1)})`),a=t.matches.length>et?`, \u2026and ${t.matches.length-et} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${Ln(i)}${a}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.entryPointShape){if(!t.matches.length)return{content:`no entry-point module found in the index \u2014 no module basename matches ${Ln([...Xu])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,et).map(d=>d.label),l=a.length>et?`, \u2026and ${a.length-et} more`:"",u=a.length?` \u2014 also matched: ${Ln(c)}${l}`:"";return{content:`ranked ${t.matches.length} entry-point match${t.matches.length===1?"":"es"}; top: ${i.label}${u}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.objMatch&&(!t.candidates||t.candidates.length===0)&&e.shape!=="ask"){let i=String(e.object||"").trim(),a=e.entityType&&Cu[e.entityType]?Fe(e.entityType,1):"module",c=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let l=Ln(t.unplacedWords.map(f=>`"${f}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${c} matching "${e.object}" found in the index. ${l} ${u} nothing here, and reading past ${t.unplacedWords.length===1?"it":"them"} would answer a different question.${d}`,miss:!0,ambiguous:!1,candidates:[]}}return{content:`no ${c} matching "${e.object}" found in the index. ${Gs(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(b=>b.class==="Commit")){let b=$=>!["Commit","Session","Source","Utterance"].includes($?.class),y=i.filter(b);y.length&&(i=y,a?.length&&(a=a.filter($=>b($.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),y=new Set(Vn(String(e.object||"")).filter(j=>j.length>=3)),$=new Set(i.map(j=>j.id)),E=null,R=0,v=1/0;if(y.size)for(let j of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(j.class)||$.has(j.id))continue;let k=Vn(String(j.label)).filter(S=>y.has(S)).length;if(!k||k<R)continue;let w=ys(String(j.label).toLowerCase(),b,8);(k>R||w<v)&&(E=j,R=k,v=w)}if(E&&(i=[...i,E],a)){let j=sn(n,e,{pinnedObjMatch:E});a=[...a,{candidate:E,result:j,rendered:Nn(e,j,n)}]}}let c=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,l=c?Cu[c]?Fe(c,1):vs(c):"module",u=i.slice(0,et).map(b=>b.label),d=i.length>et?`, \u2026and ${i.length-et} more`:"",f=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${Ln(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,p=String(e.object||""),m=p?new RegExp(`\\b${Ze(p)}\\b`,"gi"):null,h=b=>{let y=String(b.candidate.label||"");return!m||!y?b.rendered.content:b.rendered.content.split(y).map($=>$.replace(m,y)).join(y)};return{content:a&&a.length?`${f}
|
|
58
|
+
${a.map((b,y)=>`${y+1}) ${b.candidate.label}: ${h(b)}`).join(`
|
|
59
|
+
`)}`:f,miss:!1,ambiguous:!0,candidates:i.map(b=>b.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let l=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${Tu(i)} is defined in ${a[1]} at ${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}let c=pi(i);return c?{content:`${Tu(i)} is defined in ${c} (no line span recorded in this index).`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Gs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(f=>f.key==="date")?.value||"";if(!c)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let l=(a.attributes||[]).find(f=>f.key==="message")?.value||"",u=String(c).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${ci("is-dated",a.id,"is dated")} ${u}${l?` ("${l}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${l?` ("${l}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Gs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!c)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let l=t.matches.length-1;return{content:`${i} was last touched by ${c} (commit ${a.label})${l?`; ${l} earlier commit${l===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,et)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let c=[...a.entries()].map(([u,d])=>`${Fe(u,d.length)} ${Ln(d)}`),l=t.matches.length>et?`; \u2026and ${t.matches.length-et} more`:"";return{content:`${i} touched ${c.join("; ")}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,c=e.negated?a:i,l=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?c:l}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(Xo.includes(e.kind)&&n&&t.objMatch)for(let c of Xo){if(c===e.kind)continue;let l={...e,kind:c},u=sn(n,l,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return gb(l,u,n)}return{content:`${t.objMatch.label} has no ${vo(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(RR,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?Fe(e.entityType,2):(()=>{let c=[...Bu(n,Gt(e.kind))];return c.length===1?Fe(c[0],2):c.length>1?c.map(l=>Fe(l,2)).join(" or "):Fe("Module",2)})(),a=t.objMatch&&po.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${vo(e.kind)} ${a}. ${Gs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${q_(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!Vs.has(i.class))){let i=t.matches.slice(0,et).map(c=>c.class==="Commit"?H_(c):c.label),a=t.matches.length>et?`, \u2026and ${t.matches.length-et} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,et)){let a=pi(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Tu(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=Ln(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>et?` \u2026and ${t.matches.length-et} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function wb(e){if(e.length<4||J_.has(e))return null;let t=$s(e),n=t+1,s=null,o=!1;for(let r of X_){let i=ys(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function Gg(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!Ju(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=wb(n);return!!s&&s!==n&&!!Xe[s]}function yb(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=xs(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Gg(s,t.object))return!1;if(t.shape==="ask"){let o=xs(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Gg(o,t.subject))}return!0}function Q_(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Nm.includes(t)}function Z_(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=oi($o(String(t||""))),i=nn(r);if(!i.length)return null;let a=[],c=[],l=x=>{let A=Pn(e,x);return!!A.match&&A.tier!=null&&A.tier<=2},u=x=>{let A=Pn(e,x);return!!A.match&&A.tier!=null&&A.tier<=3},d=x=>{let A=String(x||"").trim().toLowerCase();return po.includes(A)?!0:nn(A).some(L=>{let T=L.toLowerCase();return!Ga.has(T)&&!Du.has(T)})},f=new Set(["reverse","forward","where","when","ask"]),p=x=>{let A=x.join(" "),L=So(A,{nlp:n});return yb(e,L,s)!==!0||L&&!L.node&&f.has(L.shape)&&(L.object!=null&&!d(L.object)||L.shape==="ask"&&L.subject!=null&&!d(L.subject))||Nn(L,sn(e,L,{contextId:s,prev:o}),e).miss?null:{parsed:L,text:A}},m=x=>({parsed:x.parsed,from:r,to:x.text,dropped:[...a],steps:c}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let x=-1;for(let T=0;T<i.length;T+=1){let O=i[T].toLowerCase();if(Qu.has(O)&&!Ga.has(O)&&!l(i[T])){x=T;break}}if(x<0)break;let A=i[x];i=i.filter((T,O)=>O!==x),a.push(A),c.push(`strip noise "${A}" \u2192 "${i.join(" ")}"`);let L=p(i);if(L)return m(L)}let b=So(i.join(" "),{nlp:n}),y=new Set;if(b&&!b.node&&f.has(b.shape))for(let x of[b.object,b.subject])for(let A of nn(String(x||"").toLowerCase()))y.add(A);let $=[],E=[],R=[];for(let x of i){let A=x.toLowerCase();if(!/^[a-z]+$/.test(A)||Ga.has(A)||Du.has(A)||u(x)){$.push(x);continue}let T=wb(A);if(T&&T!==A){$.push(T),R.push(`${x}\u2192${T}`);continue}if(y.has(A)){$.push(x);continue}E.push(x)}if((R.length||E.length)&&$.length){i=$,a.push(...E),R.length&&c.push(`fuzzy-correct ${JSON.stringify(R)} \u2192 "${i.join(" ")}"`),E.length&&c.push(`drop unmatched ${JSON.stringify(E)} \u2192 "${i.join(" ")}"`);let x=p(i);if(x)return m(x)}let v=!1,j=i.map(x=>{let A=x.toLowerCase();return Jo[A]&&!u(x)?(v=!0,Jo[A]):x});if(v){c.push(`normalise synonyms \u2192 "${j.join(" ")}"`);let x=p(j);if(x)return m(x)}let k=nn(r).map(x=>x.toLowerCase()),w=[],S=[];for(let x of k){if(bb.has(x))continue;let A=Xe[x];A&&A!=="Change"?w.push(x):S.push(x)}if(w.length===1&&S.length===0){let x=p(["count",w[0]]);if(x)return c.push(`bare kind "${w[0]}" \u2192 count`),m(x)}return null}function tT(e,t){let n=String(t||"");if(!e||!Vg.test(n))return n;let s=e.individuals.filter(c=>c.class==="Commit");if(!s.length)return n;let o=c=>String((c.attributes||[]).find(l=>l.key==="date")?.value||""),r=[...s].sort((c,l)=>o(l).localeCompare(o(c)))[0];if(!r)return n;let i=n.replace(Vg,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return eT.test(a)?`${a} touched`:i}function nT(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function Zu(e,t){let n=nT(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function rT(e,t){let n=String(t||"").trim(),s=n.match(sT),o=s?null:n.match(oT),r=s||o;if(!r||!ed.test(r[2]||"")||Xe[r[1].toLowerCase()])return null;let i=Zu(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function iT(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=Zu(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function uT(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function dT(e,t){let n=ua(String(t||"").trim()),s=n.match(aT),o=s?km[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(cT)?.[1]||n.match(lT)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:fo[o].predicate},a=iT(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=uT(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function fT(e,t){return fo[e].matchesLocativePredicates?Ko(fi(t.prop))||Ko(fi(t.predicate)):null}function pT(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=fo[t.relation],r=fi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=fi(l.prop),d=fi(l.predicate),f=u===r||d===r,p=f?null:fT(t.relation,l);if(!(!f&&!p))for(let m of l.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let b={subject:h,object:m.object,reads:f?o.reads:`is ${p}`};f?i.set(m.subject,b):a.set(`${u||d}\0${m.subject}`,b)}}let c=[...i.values(),...[...a.values()].filter(l=>!i.has(l.subject.id))].sort((l,u)=>String(l.subject.id).localeCompare(String(u.subject.id))||String(l.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:c,matches:c.map(l=>l.subject)}}function Au(e){let t=mT.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function gT(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Au(a.subject).base,String(a.object));let s=new Set(Rm),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:c,epoch:l,stamp:u}=Au(a.subject),d=n.get(c)||t(c);if(!d)continue;let f=`${a.predicate}\0${c}`;hT(r.get(f),l,u)&&(o.set(c,{id:c,label:c,class:d}),r.set(f,{epoch:l,stamp:u,predicate:a.predicate,subject:c,object:Au(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function yT(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=Zu(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(c=>c.id));if(i.size<2)return!1;let a=new Map;for(let c of e?.individuals||[])c?.id&&(a.has(c.id)||a.set(c.id,new Set),a.get(c.id).add(c.class));return[...i].every(c=>c===o||a.get(c)?.has(o))}function Hs(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(Q_(t))return{content:Ku(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=tT(e,t);let r=zu(t,{nlp:s}),i=r.parsed,a=i,c=null;if(yb(e,i,n)===!1){let f=Z_(e,t,{nlp:s,contextId:n,prev:o});f&&(a=f.parsed,c={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let l=sn(e,a,{contextId:n,prev:o}),u=Nn(a,l,e);if(Hg(e,a,l,u)){let f=rT(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=Nn(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(Hg(e,a,l,u)){let f=dT(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=Nn(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Aa(String(t||"")).trim().match(bT)?.[1]?.trim();if(p&&!/\s+(?:for|about)$/i.test(p)){let m=So(`what is a ${p}`,{nlp:s});m?.shape==="meta"&&(l=sn(e,m,{contextId:n,prev:o}),u=Nn(m,l,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=$o(String(t||"")).match(wT)?.[1]?.trim();if(p){let m=So(`what is a ${p}`,{nlp:s});if(m?.shape==="meta"){let h=sn(e,m,{contextId:n,prev:o}),g=Nn(m,h,e);!g.miss&&!g.ambiguous&&(l=h,u=g)}}}let d=c&&!u.miss&&c.to!==c.from?`read as "${c.to}" \u2014 ${u.content}`:u.content;if(!c&&!u.miss&&!u.ambiguous&&r.alternates.length){let f=r.alternates.map(p=>{let m=sn(e,p.parsed,{contextId:n,prev:o}),h=Nn(p.parsed,m,e);return h.miss?null:{a:p,text:h.content}}).filter(Boolean);if(f.length){let p=_g(f.map(m=>m.a),{answerFor:m=>f.find(h=>h.a===m)?.text||null});d=`${d}
|
|
60
|
+
${p.join(`
|
|
61
|
+
`)}`}}if(!u.ambiguous&&l.objMatch&&Array.isArray(l.candidates)&&l.candidates.length){let f=new Set((l.matches||[]).map(m=>m&&m.id)),p=l.candidates.filter(m=>m&&m.id&&m.id!==l.objMatch.id&&!f.has(m.id));if(p.length){let m=p.slice(0,3).map(b=>b.label).filter(Boolean),h=p.length-m.length,g=m.join(", ")+(h>0?`, +${h} more`:"");d=`${d}
|
|
62
|
+
(answering for ${l.objMatch.label} \u2014 ${p.length} other match${p.length===1?"":"es"}: ${g})`}}return!Array.isArray(l.referents)&&!u.miss&&!u.ambiguous&&(a?.shape==="reverse"||a?.shape==="forward")&&a.entityType&&Array.isArray(l.matches)&&l.matches.length&&l.matches.every(f=>f&&f.class===a.entityType)&&(l={...l,referents:mi(a.entityType,l.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:hb(a),matches:(l.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?pi(f):void 0})),traversal:l.traversal||null,miss:!!u.miss,ambiguous:!!u.ambiguous,relaxed:c,matchedVia:l.matchedVia||null,...Array.isArray(l.referents)&&l.referents.length?{discourse:l.referents}:{},...u.ambiguous?{candidates:u.candidates,candidateParses:u.candidateParses}:{}}}}var Og,dr,Vs,ku,ER,Gt,qg,et,Cu,SR,jR,kR,RR,_R,AR,CR,Kg,Iu,OR,Uu,Yg,Vt,Xg,NR,MR,DR,UR,WR,GR,VR,HR,KR,XR,Zg,Gu,eb,tb,r_,c_,Lg,f_,Ng,h_,Mg,Dg,w_,$_,x_,Ws,Ru,P_,M_,D_,Xu,z_,Bg,U_,Wg,G_,Ga,Du,Qu,bb,Y_,X_,J_,Vg,eT,sT,oT,ed,aT,cT,lT,fi,mT,hT,bT,wT,Hg,Yn=N(()=>{Me();su();Gn();vn();rr();Oa();La();Ig();Eu();Ds();za();ju();cr();Og=new WeakMap;dr={calls:"callsSymbol",touches:"touchesSymbol"},Vs=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),ku={Function:"Method",Method:"Function"},ER={uses:["imports","calls","callsSymbol"]},Gt=e=>ER[e]||[e],qg=new Set(Object.values(dr)),et=12,Cu={Function:["function","functions"],Method:["method","methods"],Class:["class","classes"],Module:["module","modules"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Change:["change","changes"],Package:["package","packages"],Fact:["fact","facts"],Utterance:["utterance","utterances"],Session:["session","sessions"],Source:["source","sources"],Rule:["rule","rules"]};SR={cochange:"cochanges",reexports:"export"};jR={imports:"import",calls:"call",callsSymbol:"call",inherits:"inherit from",contains:"contain",tests:"test",touches:"touch",cochange:"cochange",reexports:"export",uses:"use",serves:"serve",denotes:"denote"},kR=e=>jR[e]||vo(e),RR=new RegExp(`^(?:${Object.keys(fe).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),_R=new Set(["imports"]);AR=/^where\s+(?:does|do|did)\s+/i,CR=new Set(me(fn));Kg=4,Iu="zzinnerset",OR=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Uu=new Set(["which","what","who","list","show","find","give","me","us","all"]),Yg=new Set(["are","is","was","were"]);Vt=e=>Xe[e]?{entityType:Xe[e],placeholder:!1}:ps.includes(e)?{entityType:null,placeholder:!0}:null,Xg=e=>!!fe[e]&&e.endsWith("ing");NR=new Set(["which","the","all"]);MR=new Set(["all","every","each"]);DR=new Set(["what","which","thing","things","one","ones","stuff"]);UR=new Set(["those","them"]);WR=new Set(["did","was","were","do","does","has","have","had"]),GR=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),VR=new Set(["last","recently","ever","get","got","been","then","now","already"]),HR=new Set(["the","a","an","all","those","these","any"]);KR=new Set(["since","before","after","on"]);XR=/\b[\w-]+(?:[/.][\w-]+)+\b|\b[A-Z][A-Za-z0-9_]*\b|\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/;Zg=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Gu=new Set(["the","a","an","all","me","us"]),eb=[...go].sort((e,t)=>t.split(" ").length-e.split(" ").length),tb="functions, classes, methods, modules, packages, attributes, variables, or commits",r_=new Set(["in","inside","under"]);c_=new Set(["called","named","about","like","containing","matching","with"]);Lg=new Set(["recent","latest","newest"]);f_=/^git:(.+)$/i;Ng=new WeakMap;h_=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Mg=new WeakMap;Dg={label:3,chain:2,attr:1};w_=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;$_=["imports","calls","callsSymbol","inherits","contains","tests"];x_=/^\d{4}-\d{2}-\d{2}$/;Ws=e=>Ln(e.slice(0,et).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>et?`, \u2026and ${e.length-et} more`:"");Ru=10;P_=/^(?:the|a|an)\s+/i,M_=new RegExp(`\\s+(${Object.keys(Xe).join("|")})$`,"i");D_=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,Xu=new Set(["index","main","app","server","cli","__main__"]),z_=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Bg=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),U_=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>z_.has(t));Wg=8,G_=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);Ga=new Set([...me(Object.keys(fe)),...me(Object.keys(Xe)),...me(Object.keys(mn)),...me(Object.keys(rt)),...me(ho),...me(Object.keys(Bn)),...me(Object.keys(Wn)),...me(Object.keys(Yo)),...me(ps),...me(Jr),...me(mo),...me(fn),...me(On),...me(fs),...me(Object.keys(Jo)),...me([...da])]),Du=new Set([...ct,...Uu,...po]),Qu=new Set(me(fa)),bb=new Set([...Qu,...Du]),Y_=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],X_=[...new Set([...me(Object.keys(fe)),...Object.keys(Xe),...Y_])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!ct.has(e)),J_=new Set(["impact","impacts","impacted"]);Vg=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,eT=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;sT=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,oT=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,ed=/^(?:are there(?:\s+in\s+total)?|is there|do you know(?:\s+about)?|do you have|exist(?:s)?|are known|in (?:the |a )?(?:graph|memory)|you know(?:\s+about)?)?[?.!\s]*$/i;aT=new RegExp(`^(?:${eb.map(Ze).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),cT=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,lT=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;fi=e=>String(e||"").toLowerCase();mT=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;hT=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;bT=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,wT=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;Hg=(e,t,n,s)=>s.ambiguous?yT(e,t,n):!!s.miss});function qs(e,t,n,s){let o=Math.max(1,t),r=Math.min(e.length,n),i=!1;s!=null&&r-o+1>s&&(r=o+s-1,i=!0);let a=e.slice(o-1,r).map((c,l)=>`${o+l} ${c}`).join(`
|
|
63
|
+
`);return{start:o,end:r,text:a,truncated:i}}async function Ss({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Ut(t),a=Ut(i,n);if(a!==i&&!a.startsWith(i+xm))throw new Ie(`refusing to read outside the repository root: ${n}`);let l=(await e(a,"utf8")).split(`
|
|
64
|
+
`);return s==null||o==null?{lines:l}:{lines:l,...qs(l,s,o,r)}}var Ha=N(()=>{Ye();Kt()});function _t(e){return{ok:!0,value:e}}function Tt(e,{detail:t="",term:n=null}={}){if(!ft[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Xn(e){return!e||!e.id?null:{id:String(e.id),label:e.label!=null?String(e.label):String(e.id),class:e.class||"Entity",attributes:(Array.isArray(e.attributes)?e.attributes:[]).map(t=>({key:t.key,value:t.value,prop:t.prop||null}))}}function qa(e,{predicate:t="",prop:n=null}={}){let s={subject:e.subject,object:e.object,predicate:t,prop:n||null};return e.subjectLabel!=null&&(s.subjectLabel=e.subjectLabel),e.objectLabel!=null&&(s.objectLabel=e.objectLabel),e.weight!=null&&(s.weight=e.weight),s}var nd,$T,ft,sd,xD,vb,od,vT,Mn,td,Ht,ED,xb=N(()=>{nd="1.1.0",$T="urn:tmct:core",ft=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),sd=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),xD=Object.freeze({imports:"tmct:imports",calls:"tmct:calls",callsSymbol:"tmct:calls",defines:"tmct:defines",tests:"tmct:covers",touches:"tmct:touches",touchesSymbol:"tmct:touches",contains:"tmct:contains",inherits:"tmct:extends",cochange:"tmct:dependsOn",reexports:"tmct:exports",serves:"tmct:serves",denotes:"tmct:denotes"}),vb=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),od=Object.freeze(Object.values(vb).flat()),vT=Object.freeze(new Set(vb.source));Mn="Individual",td="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",ED=Object.freeze({version:nd,ontology:$T,missReasons:Object.values(ft),edgeKinds:[...sd],types:{Individual:{fields:{id:"string (opaque provider id)",label:"string (human/display name)",class:"string \u2014 a tmct: class token (module|class|function|method|attribute|variable|commit|test|\u2026)",attributes:"Array<{ key: string, value: string, prop: string|null }> \u2014 prop is the SEON/mgx token grounding the value"}},Edge:{fields:{subject:"string (individual id)",object:"string (individual id)",predicate:"string \u2014 the relation predicate",prop:"string|null \u2014 the SEON/mgx property token; see edgeKinds \u2192 tmct: mapping",subjectLabel:"string? (additive)",objectLabel:"string? (additive)",weight:"number? (additive; e.g. cochange coupling)"}},Result:{shape:"{ ok: true, value: T } | { ok: false, miss: Miss }"},Miss:{shape:"{ reason: MISS_REASONS, detail: string, term: string|null }"}},capabilitiesModel:"A provider advertises `capabilities: string[]` (service names it implements). A service outside the set is negotiated away to miss(CAPABILITY_ABSENT) \u2014 never an error. snippet may be advertised yet answer miss(NO_SOURCE) when no working tree exists (it has nothing useful without fs); context is graph-only-capable since INTERFACE_VERSION 1.1.0 \u2014 it returns a real hit (graph-only bundle) for any resolvable symbol even with no working tree, only escalating NO_SOURCE-style behavior to richer body text when source-capable.",services:{resolve:{group:"resolution",args:{term:"string"},result:`{ match: ${Mn}, candidates: ${Mn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The resolveSymbol seam: map a free term to an individual + runner-up candidates. Every id-taking service consumes a resolved id."},describe:{group:"resolution",args:{id:"string"},result:`{ individual: ${Mn}, out: ${td}[], incoming: ${td}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${Mn}[], attributes: ${Mn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${Mn}[], subclasses: ${Mn}[], levels: Array<${Mn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape."},exports:{group:"resolution",args:{moduleId:"string"},result:`{ exports: ${Mn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A module's curated public API (resolved __all__ / re-exports)."},signature:{group:"resolution",args:{id:"string"},result:"{ id, label, class, params, returns, raises, decorators, doc, selfFields, flags }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The compact API surface of a symbol without its body."},edges:{group:"traversal",args:{id:"string",kind:"EDGE_KINDS member"},result:`{ kind: string, edges: ${td}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Outgoing edges of one closed kind from an individual (an honest empty array is not a miss).",note:"An unknown kind (outside EDGE_KINDS) is a programming error and throws TypeError, not a miss."},impact:{group:"traversal",args:{moduleId:"string"},result:"{ total: number, levels: Array<Array<{ id, label, via, tests }>> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The transitive dependent closure the interpreter cannot compute without provider truth."},snippet:{group:"source",args:{id:"string"},result:"{ path: string, span: { start, end }, body: string|null } \u2014 Promise<Result>",misses:["UNRESOLVED_TERM","NO_SOURCE"],concurrency:Ht,purpose:"The exact source span of a symbol. A provider with no working tree returns miss(NO_SOURCE) honestly \u2014 snippet has nothing useful without fs.",note:"ASYNC (returns Promise<Result>) \u2014 a real body read is inherently fs I/O; callers should always await it. A graph-only provider still resolves synchronously-in-spirit (the promise settles on the same tick) but the return type is uniformly a Promise regardless of sourceAccess."},context:{group:"source",args:{symbol:"string",depth:"min|auto|full?"},result:"{ text: string, tier: string } (a sized edit bundle) \u2014 Promise<Result>",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The composed edit bundle (exemplar, siblings, registration, insertion region). A graph-only provider returns the graph-only sections as a real hit; a source-capable provider (sourceAccess:true, repoRoot, readFile) additionally includes the anchor/exemplar/inlined-callee body text.",note:"ASYNC (returns Promise<Result>) \u2014 see snippet's note; source-capable rendering is fs I/O."},architecture:{group:"aggregate",args:{package:"string?"},result:"{ modules: number, packages: Array<[dir, count]>, hubs: Array<{ id, label, importers }> }",misses:[],concurrency:Ht,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${Mn}[] }`,misses:[],concurrency:Ht,purpose:"Modules with no covering test module (via the tests relation)."},stats:{group:"aggregate",args:{},result:"{ total: number, classes: Array<{ class: string, count: number }>, truncated: boolean }",misses:[],concurrency:Ht,purpose:"Per-tmct:class individual counts, read straight from the payload."},history:{group:"temporal",args:{id:"string"},result:"{ commits: Array<{ id, label, author, date, message }> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The commits that touched an individual (tmct:commit individuals via tmct:touches)."},search:{group:"search",args:{query:"string",kind:"string?",name:"string?",decorator:"string?"},result:`{ results: ${Mn}[] }`,misses:[],concurrency:Ht,purpose:"Lexical, provider-local locate. An empty result set is honest, not a miss."},ask:{group:"search",args:{query:"string"},result:"{ content: string, tmct_ask: object } (the composed NL round-trip envelope)",misses:[],concurrency:Ht,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function xT(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(qa(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(qa(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function ET(e,t){for(let n of e.relations)if(ws(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function jT(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Ss({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
|
|
65
|
+
## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(qs(o,i,a,rd).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,c=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
|
|
66
|
+
## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(qs(o,i,a,rd).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=ST;for(let a of e.calleeBodies){if(i<=0)break;let c=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await Ss({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=qs(u,c,a.site.end,i);r.push(`
|
|
67
|
+
## inlined callee body (depth-1 in-repo call): ${a.label} @ ${a.site.path}:${c}-${a.site.end}`),r.push(d.text),i-=d.end-c+1}}return r.join(`
|
|
68
|
+
`)}function Ka(e,{sourceAccess:t=!1,repoRoot:n=null,readFile:s=null,tel:o=null,ask:r=null}={}){let i=e.byId;if(t&&(!n||typeof s!="function"))throw new TypeError("createGraphService({ sourceAccess: true }) requires both repoRoot and readFile \u2014 fs access is an injected capability, not an ambient import.");let a=l=>i.get(l)||null,c={version:nd,capabilities:[...od],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=hn(e,String(l??""));return u?_t({match:Xn(u),candidates:d.map(Xn)}):Tt(ft.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return Tt(ft.UNRESOLVED_TERM,{term:l});let{out:d,incoming:f}=xT(e,l);return _t({individual:Xn(u),out:d,incoming:f})},members(l){if(!a(l))return Tt(ft.UNRESOLVED_TERM,{term:l});let d=Re(e,"contains").filter(m=>m.subject===l),f=[],p=[];for(let m of d){let h=i.get(m.object),g=h?Xn(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?p.push(g):f.push(g)}return _t({methods:f,attributes:p})},subclasses(l){if(!a(l))return Tt(ft.UNRESOLVED_TERM,{term:l});let d=Re(e,"inherits"),f=d.filter(y=>y.subject===l).map(y=>i.get(y.object)?Xn(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),p=new Map;for(let y of d)p.has(y.object)||p.set(y.object,[]),p.get(y.object).push(y.subject);let m=new Set([l]),h=[],g=[],b=[l];for(let y=0;y<8&&b.length;y+=1){let $=[],E=[];for(let R of b)for(let v of p.get(R)||[]){if(m.has(v))continue;m.add(v);let j=i.get(v),k=j?Xn(j):{id:v,label:v,class:"Class",attributes:[]};h.push(k),E.push(k),$.push(v)}E.length&&g.push(E),b=$}return _t({bases:f,subclasses:h,levels:g})},exports(l){if(!a(l))return Tt(ft.UNRESOLVED_TERM,{term:l});let f=Re(e,"reexports").filter(p=>p.subject===l).map(p=>i.get(p.object)?Xn(i.get(p.object)):{id:p.object,label:p.objectLabel||p.object,class:"Entity",attributes:[]});return _t({exports:f})},signature(l){let u=a(l);if(!u)return Tt(ft.UNRESOLVED_TERM,{term:l});let d=[];for(let[p,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])on(u,p)&&d.push(m);let f=on(u,"visibility");return f&&d.push(f),_t({id:u.id,label:u.label,class:u.class||"Entity",params:on(u,"params"),returns:on(u,"returns"),raises:on(u,"raises"),decorators:on(u,"decorators"),doc:on(u,"doc"),selfFields:on(u,"self_fields"),flags:d})},edges(l,u,{limit:d,offset:f=0}={}){if(!sd.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return Tt(ft.UNRESOLVED_TERM,{term:l});let m=ET(e,u),h=Re(e,u).filter(g=>g.subject===l).map(g=>qa(g,m));return h=d==null?h.slice(f):h.slice(f,f+d),_t({kind:u,edges:h})},impact(l,{maxDepth:u}={}){let d=a(l);if(!d)return Tt(ft.UNRESOLVED_TERM,{term:l});let f=u==null?sr(e,d):sr(e,d,{maxDepth:u}),p=f.reduce((m,h)=>m+h.length,0);return _t({total:p,levels:f})},async snippet(l){let u=a(l);if(!u)return Tt(ft.UNRESOLVED_TERM,{term:l});let d=Bt(u);if(!c.sourceAccess)return Tt(ft.NO_SOURCE,{term:l,detail:d?`span is ${d.path}:${d.start}-${d.end}; this provider exposes no working tree`:"no source span in the graph"});if(!d)return Tt(ft.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let f=await Ss({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:rd});return _t({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return Tt(ft.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=hn(e,String(l??""));if(!d)return Tt(ft.UNRESOLVED_TERM,{term:String(l??"")});let f=or(e,d),p=String(u||"auto").trim().toLowerCase(),m,h;p==="min"?(m="TINY",h=yo("TINY")):p==="full"?(m="FULL",h=yo("FULL")):{tier:m,mask:h}=_a(f,e,{});let g=Jh(f,h);if(!c.sourceAccess)return _t({text:g,tier:m});let b=await jT(f,h,{readFile:s,repoRoot:n});return _t({text:b?`${g}
|
|
69
|
+
${b}`:g,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(b=>(b.class||"")==="Module"&&(!u||String(b.label||"").toLowerCase().startsWith(u))),f=new Map;for(let b of d){let y=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";f.set(y,(f.get(y)||0)+1)}let p=new Set(d.map(b=>b.id)),m=new Map;for(let b of Re(e,"imports"))p.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,y)=>y[1]-b[1]).map(([b,y])=>({id:b,label:i.get(b)?.label||b,importers:y})),g=[...f.entries()].sort((b,y)=>y[1]-b[1]);return _t({modules:d.length,packages:g,hubs:h})},untested(){let l=new Set(Re(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(Xn);return _t({modules:u})},stats(){let l=new Map;for(let d of e.individuals){let f=d.class||"Entity";l.set(f,(l.get(f)||0)+1)}let u=[...l.entries()].map(([d,f])=>({class:d,count:f})).sort((d,f)=>f.count-d.count||d.class.localeCompare(f.class));return _t({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(l){if(!a(l))return Tt(ft.UNRESOLVED_TERM,{term:l});let d=[...Re(e,"touches"),...Re(e,"touchesSymbol")].filter(m=>m.object===l),f=new Set,p=[];for(let m of d){if(f.has(m.subject))continue;f.add(m.subject);let h=i.get(m.subject);p.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?on(h,"author")??on(h,"commitAuthor"):null,date:h?on(h,"date")??on(h,"commitDate"):null,message:h?on(h,"message")??on(h,"commitMessage"):null})}return _t({commits:p})},search(l,{kind:u="",name:d="",decorator:f="",limit:p=Sa,offset:m=0}={}){let h=String(l||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),y=String(f||"").trim().toLowerCase(),$;if(g&&g!=="module"){let R=null;if(b){let j=pu(b);if(j.error)return Tt(ft.UNRESOLVED_TERM,{term:b,detail:j.error});R=j}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{$=gu(e,v,{kind:g,decFilter:y,nameRe:R}).map(j=>j.ind)}catch(j){return Tt(ft.UNRESOLVED_TERM,{term:b,detail:String(j?.message||j)})}}else{let R=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&R.set(v.label,v);$=_h(e,h).map(({path:v})=>R.get(v)).filter(Boolean)}let E=$.slice(m,m+p).map(Xn);return _t({results:E})},ask(l){if(typeof r!="function")return Tt(ft.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(l||""));return _t({content:u,tmct_ask:d})}};if(o)for(let l of od){let u=c[l];typeof u=="function"&&(c[l]=(...d)=>{let f=performance.now(),p=u.apply(c,d);return p&&typeof p.then=="function"?p.then(m=>(Eb(o,l,performance.now()-f,m),m)):(Eb(o,l,performance.now()-f,p),p)})}return c}function Eb(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:kT(s)})}catch{}}function kT(e){if(!e||typeof e!="object"||e.ok!==!0)return{ok:!1,reason:e?.miss?.reason||null};let t=0,n=e.value;if(Array.isArray(n))t=n.length;else if(n&&typeof n=="object")for(let s of Object.values(n))Array.isArray(s)&&(t+=s.length);return{ok:!0,count:t}}var on,rd,ST,Ya=N(()=>{Me();Ha();xb();on=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;rd=200,ST=120});async function hi(e,t){let n=await t.fetchEntities(e),s=Ea(n);if(!s.individuals.length){let o=new Ie(`the graph at ${e.graphFile} is empty \u2014 no entities to answer from yet (this repo starts with no graph; the chat session folds the conversation into one).`);throw o.emptyGraph=!0,o}return s}var Xa=N(()=>{Kt();Me()});function Ks({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function lt(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Ie(`${t} is required`);return n}function Nt(e,t,n){let{match:s,candidates:o}=hn(e.graph,t);if(!s)throw new Ie(`no entity matching ${n} "${t}" in the code-map graph. Try a repo-relative path (e.g. path/to/module), a basename, or tmct_search for a fuzzy lookup.`);return{match:s,candidates:o}}var gi,pt,Qe=N(()=>{Kt();Me();gi=200;pt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Nt(s,lt(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Sb(e,{config:t,source:n=Zo,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Ie("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,c=!!e?.untuned,l=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await hi(t,n),f=be(be(t.graphFile)),p=Ka(d,{sourceAccess:!0,repoRoot:f,readFile:Ae,tel:o,ask:Hs}),{match:m}=Nt(p,r,"symbol"),h=or(d,m),g,b,y=!1;a||i==="min"?(g="TINY",b=yo("TINY")):l||i==="full"?(g="FULL",b=yo("FULL"),y=!0):{tier:g,mask:b,topup:y}=_a(h,d,{untuned:c}),s&&!l&&(b=Yh(b));let $=null;if(h.moduleLabel)try{({lines:$}=await Ss({readFile:Ae,repoRoot:f,path:h.moduleLabel}))}catch{$=null}let E=j=>$&&$[j-1]!=null?$[j-1].trim():"",R=(j,k)=>qs($,j,k,gi).text,v=[`Edit context for ${h.moduleLabel} [${g}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(b.anchor&&h.anchor?.site&&$){let{start:j,end:k}=h.anchor.site;v.push(`
|
|
70
|
+
## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${j}-${k}`),v.push(R(j,k)),h.callHint&&v.push(h.callHint)}if(b.registration&&h.globals.length){v.push(`
|
|
71
|
+
## registration / module globals (replicate this pattern):`);for(let j of h.globals)v.push(` ${j.label} = ${j.value}${j.site?` [:${j.site.start}]`:""}`)}if(b.exemplar&&h.exemplar?.site&&$){let{start:j,end:k}=h.exemplar.site,w=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";v.push(`
|
|
72
|
+
## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${w} @ ${h.moduleLabel}:${j}-${k}`),v.push(R(j,k)),h.callHint&&v.push(h.callHint)}if(b.inlinedCallees&&h.calleeBodies.length&&$){let j=120;for(let k of h.calleeBodies){if(j<=0)break;let w=k.site.start,x=k.site.path===h.moduleLabel&&$?$:await Ss({readFile:Ae,repoRoot:f,path:k.site.path}).then(L=>L.lines).catch(()=>null);if(!x)continue;let A=qs(x,w,k.site.end,j);v.push(`
|
|
73
|
+
## inlined callee body (depth-1 in-repo call): ${k.label} @ ${k.site.path}:${w}-${k.site.end}`),v.push(A.text),j-=A.end-w+1}}if(b.classMembers&&h.classMembers&&h.classMembers.members.length){v.push(`
|
|
74
|
+
## members of ${h.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let j of h.classMembers.members){let k=String(j.label).split(".").pop(),w=j.params!=null&&j.params!==""?`(${j.params})${j.returns?` -> ${j.returns}`:""}`:"",S=j.decorators?`@${j.decorators} `:"",x=j.raises?` raises=${j.raises}`:"";v.push(` ${j.class} ${k}${j.site?` :${j.site.start}`:""} ${S}${k}${w}${x}`)}}if(b.siblings&&h.siblings.length){v.push(`
|
|
75
|
+
## sibling symbols to copy the style of (most relevant first; ${h.siblings.length} total):`);for(let j of h.siblings.slice(0,h.siblingCap)){let k=j.site?E(j.site.start):"",w=j.decorators?`@${j.decorators} `:"",S=j.raises?` raises=${j.raises}`:"";v.push(` ${j.class} ${j.label}${j.site?` :${j.site.start}`:""} ${w}${k}${S}`)}h.siblings.length>h.siblingCap&&v.push(` \u2026+${h.siblings.length-h.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(b.allExports&&h.allExports&&v.push(`
|
|
76
76
|
## module __all__ \u2014 this module curates its public API; ADD your new public symbol to this list so it is importable:
|
|
77
|
-
${
|
|
78
|
-
## re-exported symbols (resolved __all__ \u2192 defining module): ${
|
|
79
|
-
## insertion region (write your new sibling here) \u2014 ${
|
|
80
|
-
`))}else
|
|
81
|
-
## insert the new sibling after line ~${
|
|
82
|
-
## covering tests: ${
|
|
83
|
-
## usually changed together (consider editing these too): ${
|
|
84
|
-
You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${
|
|
85
|
-
`),tier:b,topup:y}}async function Su(e,{config:t,source:n,tel:s}){return(await _g(e,{config:t,source:n,tel:s})).text}var ku=C(()=>{Tt();Ve();Kt();$a();Pr();Pe();Pn();Ea();Sa();Ke();Su.ownsGraphLoad=!0});function Tg(e,{graph:t,svc:n}){let{match:s}=kt(n,st(e,"symbol"),"symbol");return Zh(Wo(t,s))}var Ag=C(()=>{Pe();Ke()});function ka(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function ei(e){return ka(e).toString(16).padStart(8,"0")}function c_(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let w=0;w<16;w+=1)i[w]=o.getUint32(u+w*4);for(let w=16;w<64;w+=1){let v=a(i[w-15],7)^a(i[w-15],18)^i[w-15]>>>3,k=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+v+i[w-7]+k>>>0}let[d,p,f,h,m,b,g,y]=r;for(let w=0;w<64;w+=1){let v=a(m,6)^a(m,11)^a(m,25),k=m&b^~m&g,$=y+v+k+a_[w]+i[w]>>>0,x=a(d,2)^a(d,13)^a(d,22),E=d&p^d&f^p&f,S=x+E>>>0;y=g,g=b,b=m,m=h+$>>>0,h=f,f=p,p=d,d=$+S>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+m>>>0,r[5]=r[5]+b>>>0,r[6]=r[6]+g>>>0,r[7]=r[7]+y>>>0}let l=new Uint8Array(32),c=new DataView(l.buffer);for(let u=0;u<8;u+=1)c.setUint32(u*4,r[u]);return l}function l_(e,t){let n=c_(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function G(e){let t=fs(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function hs(e){let t=fs(e);return d_.get(t)??t}function we(e,t,n){return er(G(e),hs(t),G(n))}var a_,u_,fs,d_,er,Lt=C(()=>{a_=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);u_=2e3,fs=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,u_);d_=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);er=(e,t,n)=>`fact:${l_(`${e}\0${t}\0${n}`,8)}`});var Zt={};qt(Zt,{CARDINALITY_RULE_CONFIDENCE:()=>w_,CAX_DW_RULE:()=>Ru,CAX_DW_RULE_CONFIDENCE:()=>Tu,CAX_MAXC0_RULE_CONFIDENCE:()=>$_,CLS_SVF1_RULE:()=>Au,CLS_SVF1_RULE_CONFIDENCE:()=>Cu,DEFAULT_MAX_ENVIRONMENTS:()=>ja,DISJOINT_PREDICATE:()=>tr,ENTAILED_DISJOINT_PROVENANCE:()=>_u,ENTAILED_PROVENANCE:()=>Og,ENTAILED_SCM_SVF_PROVENANCE:()=>Nu,ENTAILED_SVF1_PROVENANCE:()=>Iu,ENTAILED_TYPE_PROVENANCE:()=>Ng,ON_PROPERTY_PREDICATE:()=>Fn,SCM_SVF_RULE:()=>Lu,SCM_SVF_RULE_CONFIDENCE:()=>Pu,SOME_VALUES_FROM_PREDICATE:()=>Dn,SUBCLASS_PREDICATE:()=>We,TYPE_PREDICATE:()=>zt,buildCardinalityRestrictions:()=>b_,buildRelevanceFrontier:()=>ju,buildSubClassSuccessors:()=>Ra,deriveDisjointViolations:()=>Dg,deriveSomeValuesFromApplication:()=>zg,deriveSomeValuesFromSubsumption:()=>Ug,deriveSubClassClosure:()=>Pg,deriveSubClassClosureDelta:()=>Mg,deriveTypePropagation:()=>Fg,entailedTrustFrom:()=>f_,findConsistencyViolations:()=>x_,findIsaChain:()=>Mu,proveCardinalityAtLeast:()=>y_,proveMaxCardinalityZeroDenial:()=>v_,retractSubClassOf:()=>R_,syllogise:()=>E_});function Ig(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function f_(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function ms(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=G(s);o&&n.add(o)}return n.size?n:null}function Pg(e,{depth:t=32,budget:n=50,focus:s=null}={}){let o=new Set,r=new Map;for(let[u,d]of e||[])!u||!d||u===d||(o.add(`${u}${Fe}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:ms(s),a=(u,d,p)=>!i||i.has(u)||i.has(d)||i.has(p),l=[],c=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[f,h]of r)for(let m of h){let b=r.get(m);if(b)for(let g of b){if(f===g)continue;let y=`${f}${Fe}${g}`;o.has(y)||c.has(y)||a(f,m,g)&&d.push([f,m,g,y])}}if(!d.length)break;d.sort((f,h)=>f[0].localeCompare(h[0])||f[2].localeCompare(h[2])||f[1].localeCompare(h[1]));let p=!1;for(let[f,h,m,b]of d)if(!c.has(b)){if(l.length>=n)break;c.add(b),l.push({subject:f,object:m,via:h}),r.has(f)||r.set(f,new Set),r.get(f).add(m),p=!0}if(l.length>=n||!p)break}return l}function Mg(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[h,m]of e||[])!h||!m||h===m||(r.add(`${h}${Fe}${m}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),a.has(m)||a.set(m,new Set),a.get(m).add(h));let l=[],c=new Set;for(let[h,m]of t||[]){if(!h||!m||h===m)continue;let b=`${h}${Fe}${m}`;c.has(b)||(c.add(b),l.push([h,m]))}let u=o instanceof Set?o.size?o:null:ms(o),d=(h,m,b)=>!u||u.has(h)||u.has(m)||u.has(b),p=[],f=new Set;for(let h=0;h<n&&l.length;h+=1){let m=[],b=(w,v,k)=>{if(w===k)return;let $=`${w}${Fe}${k}`;r.has($)||f.has($)||d(w,v,k)&&m.push([w,v,k,$])};for(let[w,v]of l){for(let k of i.get(v)||[])b(w,v,k);for(let k of a.get(w)||[])b(k,w,v)}if(!m.length)break;m.sort((w,v)=>w[0].localeCompare(v[0])||w[2].localeCompare(v[2])||w[1].localeCompare(v[1]));let g=!1,y=[];for(let[w,v,k,$]of m)if(!f.has($)){if(p.length>=s)break;f.add($),p.push({subject:w,object:k,via:v}),i.has(w)||i.set(w,new Set),i.get(w).add(k),a.has(k)||a.set(k,new Set),a.get(k).add(w),y.push([w,k]),g=!0}if(p.length>=s||!g)break;l=y}return p}function zn(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function h_(e){return zn((e||[]).map(([t,n])=>[n,t]))}function ju(e,t){let n=[],s=[],o=new Map,r=new Map;for(let c of e||[])!c||!c.subject||!c.predicate||!c.object||(Ps(c.predicate)?n.push([c.subject,c.object]):fo(c.predicate)?s.push([c.subject,c.object]):nr(c.predicate)?o.set(c.subject,c.object):ni(c.predicate)&&r.set(c.subject,c.object));let i=h_(n),a=new Set;for(let c of t||[]){let u=G(c);if(u){a.add(u);for(let d of i(u))a.add(d)}}let l=new Set(a);for(let[c,u]of s)a.has(u)&&l.add(c);for(let[c,u]of r)o.has(c)&&a.has(u)&&l.add(c);return l}function Fg(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=zn(t),i=new Set,a=new Set;for(let[f,h]of o||[])f&&h&&i.add(`${f}${Fe}${h}`);let l=s instanceof Set?s.size?s:null:ms(s),c=(f,h,m)=>!l||l.has(f)||l.has(h)||l.has(m),u=[];for(let[f,h]of e||[]){if(!f||!h)continue;let m=`${f}${Fe}${h}`;if(!a.has(m)){a.add(m);for(let b of r(h)){if(b===h||b===f)continue;let g=`${f}${Fe}${b}`;i.has(g)||c(f,h,b)&&u.push([f,h,b,g])}}}u.sort((f,h)=>f[0].localeCompare(h[0])||f[2].localeCompare(h[2])||f[1].localeCompare(h[1]));let d=[],p=new Set;for(let[f,h,m,b]of u)if(!p.has(b)){if(d.length>=n)break;p.add(b),d.push({subject:f,object:m,via:h})}return d}function Dg(e,t,n,{budget:s=50,focus:o=null}={}){let r=zn(t),i=new Map,a=new Set;for(let[h,m]of n||[])!h||!m||h===m||(a.add(`${h}${Fe}${m}`),a.add(`${m}${Fe}${h}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(h));if(!i.size)return[];let l=new Set,c=o instanceof Set?o.size?o:null:ms(o),u=(h,m,b)=>!c||c.has(h)||c.has(m)||c.has(b),d=[];for(let[h,m]of e||[]){if(!h||!m)continue;let b=`${h}${Fe}${m}`;if(!l.has(b)){l.add(b);for(let g of[m,...r(m)]){let y=i.get(g);if(y)for(let w of y){if(w===h)continue;let v=`${h}${Fe}${w}`;a.has(v)||u(h,m,w)&&d.push([h,m,g,w,v])}}}}d.sort((h,m)=>h[0].localeCompare(m[0])||h[3].localeCompare(m[3])||h[2].localeCompare(m[2])||h[1].localeCompare(m[1]));let p=[],f=new Set;for(let[h,m,b,g,y]of d)if(!f.has(y)){if(p.length>=s)break;f.add(y),p.push({subject:h,object:g,viaType:m,viaClass:b})}return p}function zg(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=zn(n),a=new Map;for(let b of s||[]){if(!b||!b.restriction||!b.property||!b.target)continue;let g=`${b.property}${Fe}${b.target}`;a.has(g)||a.set(g,new Set),a.get(g).add(b.restriction)}if(!a.size)return[];let l=new Set,c=new Map;for(let[b,g]of t||[])!b||!g||(l.add(`${b}${Fe}${g}`),c.has(b)||c.set(b,new Set),c.get(b).add(g));let u=r instanceof Set?r.size?r:null:ms(r),d=(b,g,y)=>!u||u.has(b)||u.has(g)||u.has(y),p=new Set,f=[];for(let[b,g,y]of e||[]){if(!b||!g||!y)continue;let w=G(g),v=`${b}${Fe}${w}${Fe}${y}`;if(p.has(v))continue;p.add(v);let k=c.get(y);if(k)for(let $ of k)for(let x of[$,...i($)]){let E=a.get(`${w}${Fe}${x}`);if(E)for(let S of E){if(b===S)continue;let _=`${b}${Fe}${S}`;l.has(_)||d(b,y,S)&&f.push([b,g,w,y,$,x,S,_])}}}f.sort((b,g)=>b[0].localeCompare(g[0])||b[6].localeCompare(g[6])||b[1].localeCompare(g[1])||b[3].localeCompare(g[3]));let h=[],m=new Set;for(let[b,g,y,w,v,k,$,x]of f)if(!m.has(x)){if(h.length>=o)break;m.add(x),h.push({subject:b,object:$,viaProperty:g,viaPropertyKey:y,viaValue:w,viaType:v,viaTarget:k})}return h}function b_(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(nr(r.predicate))t.set(r.subject,r.object);else if(p_(r.predicate))s.set(r.subject,r.object);else{let i=g_[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==m_)continue;let l=s.get(r);l&&o.push({restriction:r,kind:i,n:a,onClass:l})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function Ug(e,t,{budget:n=50,focus:s=null}={}){let o=zn(t),r=new Map;for(let p of e||[]){if(!p||!p.restriction||!p.property||!p.target)continue;let f=G(p.property);r.has(f)||r.set(f,[]),r.get(f).push({restriction:p.restriction,target:p.target})}let i=new Set;for(let[p,f]of t||[])p&&f&&i.add(`${p}${Fe}${f}`);let a=s instanceof Set?s.size?s:null:ms(s),l=(p,f)=>!a||a.has(p)||a.has(f),c=[];for(let[,p]of r)if(!(p.length<2))for(let f of p)for(let h of p){if(f.restriction===h.restriction||f.target===h.target||!o(f.target).has(h.target))continue;let m=`${f.restriction}${Fe}${h.restriction}`;i.has(m)||l(f.restriction,h.restriction)&&c.push([f.restriction,h.restriction,f.target,h.target,m])}c.sort((p,f)=>p[0].localeCompare(f[0])||p[1].localeCompare(f[1]));let u=[],d=new Set;for(let[p,f,h,m,b]of c)if(!d.has(b)){if(u.length>=n)break;d.add(b),u.push({subject:p,object:f,viaY1:h,viaY2:m})}return u}function Bg(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=zn(e),a=r instanceof Set?r.size?r:null:ms(r),l=p=>!a||a.has(n)||a.has(p),c=new Map;for(let[p,f]of e||[])!p||!f||(c.has(p)||c.set(p,new Set),c.get(p).add(f));let u=new Map((t||[]).map(p=>[p.restriction,p])),d=0;for(let p of[n,...i(n)]){if(d>=o)break;if(d+=1,!!l(p))for(let f of c.get(p)||[]){let h=u.get(f);if(h&&s(h))return{viaClass:p,viaRestriction:f,record:h}}}return null}function y_(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Bg(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function v_(e,t,n,s,o={}){if(!s)return null;let r=Bg(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function x_(e,t,n,{budget:s=50,focus:o=null}={}){let r=zn(t),i=new Map;for(let[f,h]of n||[])!f||!h||f===h||(i.has(f)||i.set(f,new Set),i.get(f).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(f));if(!i.size)return[];let a=new Map;for(let[f,h]of e||[])!f||!h||(a.has(f)||a.set(f,new Set),a.get(f).add(h));let l=o instanceof Set?o.size?o:null:ms(o),c=f=>!l||l.has(f),u=[],d=new Set;for(let[f,h]of a){if(!c(f))continue;let m=[...h].sort();for(let b=0;b<m.length;b+=1)for(let g=b+1;g<m.length;g+=1){let[y,w]=[m[b],m[g]],v=[y,...r(y)],k=[w,...r(w)],$=null;for(let E of v){let S=i.get(E);if(S){for(let _ of k)if(S.has(_)){$=[E,_];break}if($)break}}if(!$)continue;let x=`${f}${Fe}${y}${Fe}${w}`;d.has(x)||(d.add(x),u.push([f,y,w,$[0],$[1]]))}}u.sort((f,h)=>f[0].localeCompare(h[0])||f[1].localeCompare(h[1])||f[2].localeCompare(h[2]));let p=[];for(let[f,h,m,b,g]of u){if(p.length>=s)break;p.push({subject:f,classA:h,classB:m,viaA:b,viaB:g})}return p}async function E_(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=ja,full:i=!1,store:a}={}){let{loadMemory:l,readFactRows:c,appendFacts:u}=Ig(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",p=await l(e),f=c(p),h=f.filter(j=>Ps(j.predicate)).map(j=>[j.subject,j.object]),m=f.filter(j=>fo(j.predicate)).map(j=>[j.subject,j.object]),b=f.filter(j=>po(j.predicate)).map(j=>[j.subject,j.object]),g=new Map,y=new Map,w=[];for(let j of f){let de=String(j.predicate||"").trim().toLowerCase();nr(j.predicate)?g.set(j.subject,j.object):ni(j.predicate)?y.set(j.subject,j.object):Ou.has(de)||w.push([j.subject,j.predicate,j.object])}let v=[];for(let[j,de]of g){let Ce=y.get(j);Ce&&v.push({restriction:j,property:de,target:Ce})}let k=ms(s),$=o&&k?ju(f,[...k]):k,x=$===null&&d?await a.loadSyllogiseState(e):null,E=new Set(f.map(j=>j.id)),S=Array.isArray(x?.factIds)?x.factIds.filter(j=>!E.has(j)):[],_=x&&Array.isArray(x.factIds)&&!S.length&&!i?"delta":"full",R=_==="delta"?new Set(x.factIds):null,T=_==="delta"?f.filter(j=>!R.has(j.id)):f,M=T.length,I=new Map;for(let j of f)I.set(`${j.subject}${Fe}${j.predicate}${Fe}${j.object}`,j.trust);let D=(j,de,Ce)=>I.get(`${j}${Fe}${de}${Fe}${Ce}`),B=(j,de,Ce)=>I.has(`${j}${Fe}${de}${Fe}${Ce}`),X=j=>j.filter(de=>typeof de=="number"),ae=_==="delta"&&!T.length,ie=_==="delta"?T.filter(j=>Ps(j.predicate)).map(j=>[j.subject,j.object]):[],te=_==="delta"?ie.length?Mg(h,ie,{depth:t,budget:n,focus:$}):[]:Pg(h,{depth:t,budget:n,focus:$}),U=h.concat(te.map(j=>[j.subject,j.object])),z=$,A=null;if(_==="delta"&&!ae){let j=f.concat(te.map(Ce=>({subject:Ce.subject,predicate:We,object:Ce.object}))),de=[];for(let Ce of T)de.push(Ce.subject,Ce.object);A=ju(j,de),z=A}let N=j=>!A||A.has(j),O=A?m.filter(([j,de])=>N(j)||N(de)):m,P=new Set;if(A)for(let j of T)po(j.predicate)&&(P.add(j.subject),P.add(j.object));let F=A&&P.size?zn(U):null,L=A?m.filter(([j,de])=>N(j)||N(de)||F&&[...F(de)].some(Ce=>P.has(Ce))):m,K=new Set;if(A){for(let j of T)if(nr(j.predicate)||ni(j.predicate)){let de=g.get(j.subject);de&&K.add(G(de))}}let Y=A?w.filter(([j,de,Ce])=>N(j)||N(Ce)||K.has(G(de))):w,ne=Math.max(0,n-te.length),re=ne>0&&!ae?Fg(O,U,{budget:ne,focus:z,presentTypeEdges:m}):[],Q=Math.max(0,n-te.length-re.length),H=Q>0&&!ae?Dg(L,U,b,{budget:Q,focus:z}):[],ee=Math.max(0,n-te.length-re.length-H.length),q=ee>0&&v.length&&!ae?zg(Y,m,U,v,{budget:ee,focus:z}):[],be=Math.max(0,n-te.length-re.length-H.length-q.length),Oe=be>0&&v.length>1&&!ae?Ug(v,U,{budget:be,focus:z}):[],le=new Map(v.map(j=>[j.restriction,j])),je=[...te.map(j=>({subject:j.subject,predicate:We,object:j.object,provenance:Og,justification:[[we(j.subject,We,j.via),we(j.via,We,j.object)]]})),...re.map(j=>({subject:j.subject,predicate:zt,object:j.object,provenance:Ng,justification:[[we(j.subject,zt,j.via),we(j.via,We,j.object)]]})),...H.map(j=>{let de=B(j.viaClass,tr,j.object),[Ce,dn]=de?[j.viaClass,j.object]:[j.object,j.viaClass],Qn=X([D(j.subject,zt,j.viaType),D(Ce,tr,dn),...j.viaClass!==j.viaType?[D(j.viaType,We,j.viaClass)]:[]]);return{subject:j.subject,predicate:tr,object:j.object,provenance:_u,justification:[[we(j.subject,zt,j.viaType),we(Ce,tr,dn),...j.viaClass!==j.viaType?[we(j.viaType,We,j.viaClass)]:[]]],...Qn.length?{premiseTrusts:Qn,ruleConfidence:Tu}:{}}}),...q.map(j=>{let de=X([D(j.subject,j.viaProperty,j.viaValue),D(j.viaValue,zt,j.viaType),D(j.object,Fn,j.viaPropertyKey),D(j.object,Dn,j.viaTarget),...j.viaType!==j.viaTarget?[D(j.viaType,We,j.viaTarget)]:[]]);return{subject:j.subject,predicate:zt,object:j.object,provenance:Iu,justification:[[we(j.subject,j.viaProperty,j.viaValue),we(j.viaValue,zt,j.viaType),we(j.object,Fn,j.viaPropertyKey),we(j.object,Dn,j.viaTarget),...j.viaType!==j.viaTarget?[we(j.viaType,We,j.viaTarget)]:[]]],...de.length?{premiseTrusts:de,ruleConfidence:Cu}:{}}}),...Oe.map(j=>{let de=le.get(j.subject),Ce=le.get(j.object),dn=X([de&&D(j.subject,Fn,de.property),D(j.subject,Dn,j.viaY1),Ce&&D(j.object,Fn,Ce.property),D(j.object,Dn,j.viaY2),D(j.viaY1,We,j.viaY2)]);return{subject:j.subject,predicate:We,object:j.object,provenance:Nu,justification:[[...de?[we(j.subject,Fn,de.property)]:[],we(j.subject,Dn,j.viaY1),...Ce?[we(j.object,Fn,Ce.property)]:[],we(j.object,Dn,j.viaY2),we(j.viaY1,We,j.viaY2)]],...dn.length?{premiseTrusts:dn,ruleConfidence:Pu}:{}}})],Me=je.map(j=>({id:we(j.subject,j.predicate,j.object),subject:j.subject,predicate:j.predicate,object:j.object,environments:j.justification,write:j})),ye=Gg(f.concat(Me.map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object})))),ce=new Map(f.map(j=>[j.id,j])),oe=j=>Ps(j)||fo(j)||po(j),Re=j=>_!=="delta"||A!==null&&(A.has(j.subject)||A.has(j.object)),V=f.filter(j=>oe(j.predicate)&&Wg(j.provenance)&&ti(j).length<r&&Re(j)).map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object,environments:ti(j),provenance:j.provenance})),$e=[...Me,...V].sort((j,de)=>j.subject.localeCompare(de.subject)||j.predicate.localeCompare(de.predicate)||j.object.localeCompare(de.object)),rt=0,Ie=!1,Vt=0;for(let j of $e){if(Vt>=n){Ie=!0;break}Vt+=1;let de=ye(j,{maxEnvironments:r+1}),{kept:Ce,truncated:dn}=k_(j.environments,de,r);if(dn&&(Ie=!0),!(Ce.length<=j.environments.length)){if(rt+=Ce.length-j.environments.length,j.write){j.write.justification=Ce;continue}je.push({subject:j.subject,predicate:j.predicate,object:j.object,justification:Ce,...Vg(j.provenance,Ce,Qn=>ce.get(Qn)?.trust)||{}})}}let{ids:Mt}=await u(e,je),tn=[],un=0;for(let j of te)tn.push({id:Mt[un],subject:j.subject,object:j.object,via:j.via,rule:Cg}),un+=1;for(let j of re)tn.push({id:Mt[un],subject:j.subject,object:j.object,via:j.via,rule:Lg}),un+=1;for(let j of H)tn.push({id:Mt[un],subject:j.subject,object:j.object,via:j.viaClass,rule:Ru}),un+=1;for(let j of q)tn.push({id:Mt[un],subject:j.subject,object:j.object,via:j.viaValue,rule:Au}),un+=1;for(let j of Oe)tn.push({id:Mt[un],subject:j.subject,object:j.object,via:j.viaY1,rule:Lu}),un+=1;let Ni=tn.length>=n;if($===null&&d&&!Ni){let j=new Set(E);for(let de of Mt)j.add(de);await a.saveSyllogiseState(e,{version:1,factIds:[...j].sort(),completedAt:new Date().toISOString()})}return{derived:tn,count:tn.length,budget:n,depth:t,truncated:Ni,mode:_,deltaSize:M,environmentsAdded:rt,alternatesTruncated:Ie}}function Wg(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function S_(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();Ps(u.predicate)?t.push([u.subject,u.object]):fo(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):po(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):nr(u.predicate)?o.set(u.subject,u.object):ni(u.predicate)?r.set(u.subject,u.object):Ou.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([G(u.predicate),u.object]))}let a=zn(t),l=(u,d)=>u!==d&&a(u).has(d),c=u=>{let d=o.get(u),p=r.get(u);return d&&p?{property:G(d),target:p}:null};return u=>{if(Ps(u.predicate)){if(l(u.subject,u.object))return!0;let d=c(u.subject),p=c(u.object);return!!(d&&p&&d.property===p.property&&l(d.target,p.target))}if(fo(u.predicate)){for(let p of n.get(u.subject)||[])if(l(p,u.object))return!0;let d=c(u.object);if(d){for(let[p,f]of i.get(u.subject)||[])if(p===d.property){for(let h of n.get(f)||[])if(h===d.target||l(h,d.target))return!0}}return!1}if(po(u.predicate)){for(let d of n.get(u.subject)||[])for(let p of[d,...a(d)])if(s.get(p)?.has(u.object))return!0;return!1}return!0}}function Gg(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,l=new Map,c=new Map;for(let f of e){if(!f||!f.subject||!f.predicate||!f.object)continue;f.id&&t.add(f.id);let h=String(f.predicate||"").trim().toLowerCase();Ps(f.predicate)?(n.push([f.subject,f.object]),s.has(f.subject)||s.set(f.subject,new Set),s.get(f.subject).add(f.object)):fo(f.predicate)?(o.has(f.subject)||o.set(f.subject,new Set),o.get(f.subject).add(f.object)):po(f.predicate)?(r.add(`${f.subject}${Fe}${f.object}`),i.has(f.subject)||i.set(f.subject,new Set),i.get(f.subject).add(f.object),i.has(f.object)||i.set(f.object,new Set),i.get(f.object).add(f.subject)):nr(f.predicate)?a.set(f.subject,f.object):ni(f.predicate)?l.set(f.subject,f.object):Ou.has(h)||(c.has(f.subject)||c.set(f.subject,[]),c.get(f.subject).push([f.predicate,f.object]))}let u=zn(n),d=f=>s.get(f)||new Set,p=f=>{let h=a.get(f),m=l.get(f);return h&&m?{property:h,propertyKey:G(h),target:m}:null};return(f,{maxEnvironments:h=ja}={})=>{let m=[],b=new Set,g=y=>{if(m.length>=h||f.id&&y.includes(f.id)||!y.every(v=>t.has(v)))return;let w=[...y].sort().join(" ");b.has(w)||(b.add(w),m.push(y))};if(Ps(f.predicate)){for(let y of[...d(f.subject)].sort()){if(m.length>=h)break;y===f.subject||y===f.object||d(y).has(f.object)&&g([we(f.subject,We,y),we(y,We,f.object)])}if(m.length<h){let y=p(f.subject),w=p(f.object);y&&w&&y.propertyKey===w.propertyKey&&y.target!==w.target&&d(y.target).has(w.target)&&g([we(f.subject,Fn,y.property),we(f.subject,Dn,y.target),we(f.object,Fn,w.property),we(f.object,Dn,w.target),we(y.target,We,w.target)])}return m}if(fo(f.predicate)){for(let w of[...o.get(f.subject)||[]].sort()){if(m.length>=h)break;w!==f.object&&d(w).has(f.object)&&g([we(f.subject,zt,w),we(w,We,f.object)])}let y=p(f.object);if(y){let w=[...c.get(f.subject)||[]].filter(([v])=>G(v)===y.propertyKey).sort((v,k)=>v[0].localeCompare(k[0])||v[1].localeCompare(k[1]));for(let[v,k]of w){if(m.length>=h)break;for(let $ of[...o.get(k)||[]].sort()){if(m.length>=h)break;$!==y.target&&!d($).has(y.target)||g([we(f.subject,v,k),we(k,zt,$),we(f.object,Fn,y.propertyKey),we(f.object,Dn,y.target),...$!==y.target?[we($,We,y.target)]:[]])}}}return m}if(po(f.predicate)){let y=[];for(let w of o.get(f.subject)||[])for(let v of[w,...u(w)])(i.get(v)||new Set).has(f.object)&&y.push([w,v]);y.sort((w,v)=>w[0].localeCompare(v[0])||w[1].localeCompare(v[1]));for(let[w,v]of y){if(m.length>=h)break;let k=r.has(`${v}${Fe}${f.object}`),[$,x]=k?[v,f.object]:[f.object,v];g([we(f.subject,zt,w),we($,tr,x),...v!==w?[we(w,We,v)]:[]])}return m}return m}}function k_(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function Vg(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=j_.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(c=>n(c)).filter(c=>typeof c=="number");if(a.length!==i.length)continue;let l=Math.min(...a);l>r&&(r=l,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function R_(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=ja,store:i,sourceTags:a=[],predicate:l=We}={}){let{loadMemory:c,readFactRows:u,removeFacts:d}=Ig(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),p=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,h=(a||[]).filter(Boolean);if(h.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let m=G(t),b=G(n),g=we(m,l,b),y=await c(e),w=u(y),v=new Map(w.map(B=>[B.id,B]));if(!v.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let k=v.get(g).sourceIds||[],$=h.map(B=>f(g,B).slice(g.length+1)),x=h.length?k.filter(B=>$.includes(B)):[],E=!h.length||x.length>0;if(h.length&&!E)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=h.length>0&&x.length<k.length,_=new Set([g]),R=[g],T=new Map,M=!1;if(!S){let B=w.filter(te=>ti(te).length&&Wg(te.provenance)),X=new Map;for(let te of B)for(let U of ti(te))for(let z of U)X.has(z)||X.set(z,new Set),X.get(z).add(te.id);let ae=0,ie=[g];for(;ae<o;ae+=1){let te=new Set;for(let L of ie)for(let K of X.get(L)||[])_.has(K)||te.add(K);let U=[...te].map(L=>v.get(L)).sort((L,K)=>L.subject.localeCompare(K.subject)||L.predicate.localeCompare(K.predicate)||L.object.localeCompare(K.object));if(!U.length)break;let z=w.filter(L=>!_.has(L.id)&&!te.has(L.id)),A=new Set(z.map(L=>L.id)),N=Gg(z),O=S_(z),P=!1,F=!1;ie=[];for(let L of U){if(_.size>=s){F=!0;break}let K=ti(L),Y=K.filter(re=>re.every(Q=>A.has(Q)));if(Y.length){Y.length!==K.length&&T.set(L.id,Y);continue}let ne=N(L,{maxEnvironments:r});if(ne.length){T.set(L.id,ne);continue}O(L)||(_.add(L.id),R.push(L.id),ie.push(L.id),P=!0)}if(F){M=!0;break}if(!P)break}!M&&ae>=o&&(M=B.some(te=>!_.has(te.id)&&te.justification.some(U=>_.has(U))))}let I=h.length?[...x.map(B=>`${g}@${B}`),...R.slice(1)]:R,{removed:D}=await d(e,I);if(p){let B=[...T.entries()].filter(([X])=>!_.has(X)).sort((X,ae)=>X[0].localeCompare(ae[0])).map(([X,ae])=>{let ie=v.get(X);return{subject:ie.subject,predicate:ie.predicate,object:ie.object,justification:ae,...Vg(ie.provenance,ae,te=>v.get(te)?.trust)||{}}});B.length&&await p(e,B)}return{retracted:D,count:D.length,budget:s,depth:o,truncated:M,found:!0,...h.length?{ownRecord:!0,stillStands:S}:{}}}function Ra(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Mu(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:Ra(s),a=[];for(let[c,u]of n||[])c===e&&u&&a.push({node:u,path:[{subject:c,predicate:zt,object:u}]});for(let c of i.get(e)||[])a.push({node:c,path:[{subject:e,predicate:We,object:c}]});let l=new Set([e]);for(let c=1;c<=o&&a.length;c+=1){for(let{node:d,path:p}of a)if(r.has(d))return p;if(c===o)break;let u=[];for(let{node:d,path:p}of a)if(!l.has(d)){l.add(d);for(let f of i.get(d)||[])l.has(f)||u.push({node:f,path:[...p,{subject:d,predicate:We,object:f}]})}a=u}return null}var We,Cg,Og,zt,Lg,Ng,tr,Ru,_u,Tu,Fn,Dn,Au,Iu,Cu,ja,Fe,Ps,fo,po,nr,ni,p_,Ou,m_,g_,Lu,Nu,Pu,w_,$_,ti,j_,Nt=C(()=>{Lt();We="rdfs:subClassOf",Cg="subClassOf",Og=`entailed:${Cg}`,zt="rdf:type",Lg="type",Ng=`entailed:${Lg}`,tr="owl:disjointWith",Ru="disjointWith",_u=`entailed:${Ru}`,Tu=.95,Fn="owl:onProperty",Dn="owl:someValuesFrom",Au="someValuesFrom",Iu=`entailed:${Au}`,Cu=.95,ja=4,Fe="\u241F",Ps=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",fo=e=>String(e||"").trim().toLowerCase()==="rdf:type",po=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",nr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",ni=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",p_=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Ou=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);m_="has",g_={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Lu="someValuesFromSubsumption",Nu=`entailed:${Lu}`,Pu=.95;w_=.95;$_=.95;ti=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);j_=new Map([[_u,Tu],[Iu,Cu],[Nu,Pu]])});function ir(e){let t=String(e||""),n=Hg.get(t);return n||(t.startsWith(Fu)?sr+t.slice(Fu.length):t)}function qg(e){let t=String(e||""),n=__.get(t);return n||(t.startsWith(sr)?Fu+t.slice(sr.length):null)}function Xg(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Mu(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function Aa(e,t,n,{maxHops:s=3}={}){let o=rr(e),r=rr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:l}=Yg(i),c=i.filter(g=>(g.predicate===Ta||g.predicate===or)&&r.has(g.object)),u=[];for(let g of c){let y=g.predicate===or?"negative":"positive";if(o.has(g.subject)){u.push({fact:g,polarity:y,hops:0,chain:null});continue}let w=Xg(o,g.subject,a,l,s);w&&w.length&&u.push({fact:g,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:zu(o,r,i,{maxHops:s})};u.sort((g,y)=>g.hops-y.hops||(y.fact.trust||0)-(g.fact.trust||0));let d=u[0].hops,p=u.filter(g=>g.hops===d),f=p.filter(g=>g.polarity==="positive").map(g=>g.fact),h=p.filter(g=>g.polarity==="negative").map(g=>g.fact),m=h.length&&!f.length?"negative":"positive",b=u.find(g=>g.hops>d&&g.polarity!==m)||null;return{verdict:f.length&&h.length?"both":h.length?"no":"yes",hops:d,positive:f,negative:h,chain:u[0].chain,overrides:b?{fact:b.fact,chain:b.chain}:null,baseRate:null}}function zu(e,t,n,{maxHops:s=3}={}){let o=rr(e),r=rr(t),i=Array.isArray(n)?n:[],a=i.filter(m=>m.predicate===We||m.predicate===zt),l=a.filter(m=>o.has(m.subject)).map(m=>m.object);if(!l.length)return null;let c=l[0],u=[...new Set(a.filter(m=>m.object===c&&!o.has(m.subject)).map(m=>m.subject))],d=m=>{let b=i.find(g=>g.subject===m&&r.has(g.object)&&(g.predicate===Ta||g.predicate===or));return b?{name:m,polarity:b.predicate===or?"negative":"positive",fact:b}:{name:m,polarity:"unknown",fact:null}},p=u.map(d),{typeEdges:f,subClassSucc:h}=Yg(i);return{klass:c,kinds:u.length,positive:p.filter(m=>m.polarity==="positive"),negative:p.filter(m=>m.polarity==="negative"),unknown:p.filter(m=>m.polarity==="unknown"),chain:Xg(o,c,f,h,s)}}function Uu(e,t,{exclude:n=[],maxHops:s=3}={}){let o=rr(e),r=rr(n),i=Array.isArray(t)?t:[],a=new Set,l=[];for(let c of i)c.predicate!==Ta||!o.has(c.object)||r.has(c.subject)||a.has(c.subject)||(a.add(c.subject),Aa(new Set([c.subject]),o,i,{maxHops:s}).verdict==="yes"&&l.push(c));return l.sort(T_)}var sr,Fu,_a,Hg,__,Kg,Ta,or,Du,T_,rr,Yg,Ia=C(()=>{Nt();sr="mgxneg:",Fu="mgx:",_a="mgxneg:subClassOf",Hg=new Map([[We,_a]]),__=new Map([...Hg].map(([e,t])=>[t,e]));Kg=e=>String(e||"").startsWith(sr),Ta="mgx:capableOf",or=ir(Ta),Du=6,T_=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),rr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),Yg=e=>{let t=e.filter(s=>s.predicate===zt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===We).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:Ra(n)}}});function Ca(e){let t=String(e||"");return Gu.has(t)?Bu:I_.has(t)||C_.test(t)?si:O_.has(t)?Jg:Wu}function L_(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(eh.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function N_(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(L_(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Vu(e,t){let n=t===Jg;if(!n&&t!==si)return null;let s=(e||[]).map(r=>({row:r,at:N_(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[l,c]=[String(r.row.object),String(i.row.object)];return l<c?-1:l>c?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Bu,si,Jg,Wu,A_,Gu,I_,C_,O_,Qg=C(()=>{Ia();ns();Bu="merge",si="latest-observation-wins",Jg="first-claim-wins",Wu="contradiction",A_=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],Gu=new Set(A_.flatMap(e=>[e,ir(e)])),I_=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),C_=/^mgx:has-exit-([a-z]+)$/,O_=new Set(["mgx:playedBy"])});function ii(e){let t=String(e||""),n=t.indexOf(Oa);return n<0?"":t.slice(n+Oa.length)}function z_(e){let t=1,n=0;for(let s of e)t*=1-F_(s),n+=1;return n?D_(Math.min(1,1-t)):0}function sb(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function ib(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function ab(e,t="",n=""){let s=t,o=n;for(let r of e)s=ob(s,r.assertedAt),o=rb(o,r.assertedAt);return{earliest:s,latest:o}}function Yu({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let l=[...new Set(o)].filter(Boolean).sort(),c=a?z_(l.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:P_,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===ar?"rollupSourceIds":"rollupRecordIds",value:l.join(" ")},{prop:ri,key:"rollupCount",value:String(l.length)},{prop:Un,key:"rollupEarliest",value:r},{prop:Bn,key:"rollupLatest",value:i},...c===void 0?[]:[{prop:cr,key:"rollupPrior",value:String(c)}]]}}function cb({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort(ib).slice(8);if(!i.length)return null;let{earliest:a,latest:l}=ab(i,jt(s,Un),jt(s,Bn));return{rollup:Yu({id:Hu(e,t),sourceKey:`rollup:${t}`,template:Xu(i[0].record||s),idsProp:ar,ids:[...Pa(s),...i.map(u=>u.sourceId)],earliest:a,latest:l,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function lb({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort(ib),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:l}=ab(i,jt(s,Un),jt(s,Bn));return{rollup:Yu({id:qu(e,t),sourceKey:t,template:Xu(i[0].record||s),idsProp:oi,ids:[...M_(s),...i.map(u=>u.id)],earliest:a,latest:l}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Ju(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Ms(s),r=o?ar:oi,i=a=>Ku(jt(a,r));return Yu({id:s,sourceKey:jt(e,"mgx:sourceId")||jt(t,"mgx:sourceId"),template:Xu(jt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:ob(jt(e,Un),jt(t,Un)),latest:rb(jt(e,Bn),jt(t,Bn)),priorFor:o?n:void 0})}function ub(e,t){if(!t)return!1;for(let n of e||[])if(Pa(n).includes(t))return!0;return!1}var P_,Zg,eb,La,tb,ar,oi,ri,Un,Bn,cr,Oa,nb,Hu,qu,Ms,lr,Na,jt,Ku,Pa,M_,F_,D_,ob,rb,Xu,Qu=C(()=>{P_="Fact",Zg=64,eb=8,La=8,tb=2,ar="mgx:rollupSourceIds",oi="mgx:rollupRecordIds",ri="mgx:rollupCount",Un="mgx:rollupEarliest",Bn="mgx:rollupLatest",cr="mgx:rollupPrior",Oa="@rollup:",nb="#rollup",Hu=(e,t)=>`${e}${Oa}${t}`,qu=(e,t)=>`${e}@${t}${nb}`,Ms=e=>String(e||"").includes(Oa),lr=e=>String(e||"").endsWith(nb),Na=e=>Ms(e)||lr(e);jt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Ku=e=>String(e||"").split(" ").filter(Boolean),Pa=e=>Ku(jt(e,ar)),M_=e=>Ku(jt(e,oi)),F_=e=>Math.max(0,Math.min(1,Number(e)||0)),D_=e=>Number(e.toFixed(6));ob=(e,t)=>sb(e,t,Math.min),rb=(e,t)=>sb(e,t,Math.max);Xu=e=>({label:e?.label||"",subject:jt(e,"rdf:subject"),predicate:jt(e,"rdf:predicate"),object:jt(e,"rdf:object")})});function nd(e){let t=String(e||"");return td(t)?t.slice(0,-za.length):""}function db(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function sd({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:cn,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:Fa,key:"retractedRecordIds",value:i.join(" ")},{prop:Zu,key:"retractedCount",value:String(i.length)},{prop:Da,key:"retractedAt",value:o||""},...a.length?[{prop:ai,key:"provenance",value:a.join(" | ")}]:[]]}}function fb({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...ho(o),...n].filter(Boolean);return a.length?sd({id:ed(e,t),sourceId:t,template:r||pb(o),ids:a,retractedAt:db(mo(o),s),tags:[...ci(mn(o,ai)),...ci(i)]}):null}function hb(e,t){let n=pb(mn(e,"rdf:subject")?e:t);return sd({id:e?.id||t?.id,sourceId:mn(e,"mgx:sourceId")||mn(t,"mgx:sourceId"),template:n,ids:[...ho(e),...ho(t)],retractedAt:db(mo(e),mo(t)),tags:[...ci(mn(e,ai)),...ci(mn(t,ai))]})}function B_(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function W_(e,t,n=""){return!e||!t||!ho(e).includes(t)?!1:B_(n,mo(e))}function Ua(e,t,n=""){for(let s of e||[])if(W_(s,t,n))return!0;return!1}function G_(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function V_(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function Ba(e){let t=nd(e?.id);return t?{id:e.id,subject:t,predicate:Ma,object:G_(mo(e),ho(e)),provenance:mn(e,ai)}:null}function Wa(e){if(!e||e.predicate!==Ma)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=V_(e.object);return o.length?sd({id:`${t}${za}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ci(e.provenance)}):null}var cn,Ma,Fa,Da,Zu,za,ai,ed,td,mn,U_,ci,ho,mo,pb,od=C(()=>{cn="Retraction",Ma="mgx:retracted",Fa="mgx:retractedRecordIds",Da="mgx:retractedAt",Zu="mgx:retractedCount",za="#retracted",ai="mgx:factProvenance",ed=(e,t)=>`${e}@${t}${za}`,td=e=>String(e||"").endsWith(za);mn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",U_=e=>String(e||"").split(" ").filter(Boolean),ci=e=>String(e||"").split(" | ").filter(Boolean),ho=e=>U_(mn(e,Fa)),mo=e=>mn(e,Da);pb=e=>({label:e?.label||"",subject:mn(e,"rdf:subject"),predicate:mn(e,"rdf:predicate"),object:mn(e,"rdf:object")})});var H_,q_,K_,Y_,rd,OM,mb=C(()=>{ns();H_="mgx:worldName",q_="mgx:nodeName",K_="mgx:playedBy",Y_="mgx:waved",rd="mgx:invitedBy",OM=Object.freeze([H_,q_,K_,Y_,rd])});function Ga(e){let t=new Set;for(let n of e||[])n?.predicate===rd&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function id(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Va({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=id(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let l=s(a);r.set(a,new Set([...l||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(l=>r.get(l).has(a)))}var ad=C(()=>{mb()});function gs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function tT(e,t){(!e?.class||!X_.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function nT(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])li(gs(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=gs(e,i);a!==void 0&&Q_.test(a)&&t.push(`a Fact's ${i} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(a)})`)}let n=gs(e,"mgx:factProvenance");n!==void 0&&!li(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";Z_(s)&&!bb.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=gs(e,"mgx:sourceId");o!==void 0&&!li(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=gs(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);for(let i of eT){let a=gs(e,i);if(a===void 0)continue;let l=a.split(" ").filter(Boolean);l.length||t.push(`${i}, when present, must name at least one record id`);for(let c of l)bb.test(c)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(c)})`)}}function sT(e,t){li(gs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=gs(e,"mgx:ruleKind");if(!n||!gb.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...gb].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of J_[n])li(gs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function oT(e){let t=[];return tT(e,t),e?.class==="Fact"&&nT(e,t),e?.class==="Rule"&&sT(e,t),{ok:t.length===0,violations:t}}function cd(e){let t=oT(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var X_,gb,J_,Q_,bb,Z_,eT,li,wb=C(()=>{X_=new Set(["Utterance","Fact","Session","Source","Rule"]),gb=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),J_={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},Q_=/[.!?]\s+\w/,bb=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,Z_=e=>e.includes("@")||/#v\d/.test(e),eT=["mgx:supersedes","mgx:supersededBy"];li=e=>typeof e=="string"&&e.trim().length>0});var yb={};qt(yb,{access:()=>aT,appendFile:()=>uT,basename:()=>jT,copyFile:()=>bT,createInterface:()=>IT,createReadStream:()=>yT,createRequire:()=>rT,createWriteStream:()=>$T,default:()=>OT,dirname:()=>ET,existsSync:()=>vT,fileURLToPath:()=>_T,isAbsolute:()=>kT,join:()=>xT,mkdir:()=>dT,mkdtemp:()=>pT,randomBytes:()=>TT,readFile:()=>cT,readFileSync:()=>iT,readdir:()=>wT,rename:()=>fT,resolve:()=>ST,rm:()=>mT,sep:()=>RT,spawnSync:()=>AT,stat:()=>gT,tmpdir:()=>CT,unlink:()=>hT,writeFile:()=>lT});var pt,rT,iT,aT,cT,lT,uT,dT,pT,fT,hT,mT,gT,bT,wT,yT,$T,vT,xT,ET,ST,kT,jT,RT,_T,TT,AT,IT,CT,OT,$b=C(()=>{pt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},rT=pt("createRequire"),iT=pt("readFileSync"),aT=pt("access"),cT=pt("readFile"),lT=pt("writeFile"),uT=pt("appendFile"),dT=pt("mkdir"),pT=pt("mkdtemp"),fT=pt("rename"),hT=pt("unlink"),mT=pt("rm"),gT=pt("stat"),bT=pt("copyFile"),wT=pt("readdir"),yT=pt("createReadStream"),$T=pt("createWriteStream"),vT=()=>!1,xT=(...e)=>e.join("/"),ET=e=>String(e).replace(/\/[^/]*$/,""),ST=(...e)=>e.join("/"),kT=e=>String(e).startsWith("/"),jT=e=>String(e).split("/").pop(),RT="/",_T=e=>String(e),TT=pt("randomBytes"),AT=pt("spawnSync"),IT=pt("createInterface"),CT=()=>"/tmp",OT={}});var LT,ui,ld=C(()=>{LT=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ui=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(LT);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function NT(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function PT(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
|
|
77
|
+
${h.allExports}`),b.reexports&&h.exports&&h.exports.length&&v.push(`
|
|
78
|
+
## re-exported symbols (resolved __all__ \u2192 defining module): ${h.exports.join(", ")}`),b.insertionRegion&&h.insertionRegion&&$){let j=h.insertionRegion.start,k=Math.min($.length,j+40-1);v.push(`
|
|
79
|
+
## insertion region (write your new sibling here) \u2014 ${h.moduleLabel}:${j}-${k}`),v.push($.slice(j-1,k).map((w,S)=>`${j+S} ${w}`).join(`
|
|
80
|
+
`))}else h.insertion&&v.push(`
|
|
81
|
+
## insert the new sibling after line ~${h.insertion} (end of the last top-level definition).`);return b.tests&&h.tests.length&&v.push(`
|
|
82
|
+
## covering tests: ${h.tests.join(", ")}`),b.cochange&&h.cochange&&h.cochange.length&&v.push(`
|
|
83
|
+
## usually changed together (consider editing these too): ${h.cochange.map(j=>`${j.label} (\xD7${j.weight})`).join(", ")}`),v.push(`
|
|
84
|
+
You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${h.moduleLabel}.`),g!=="FULL"&&v.push(`(bundle tier ${g}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:v.join(`
|
|
85
|
+
`),tier:g,topup:y}}async function id(e,{config:t,source:n,tel:s}){return(await Sb(e,{config:t,source:n,tel:s})).text}var ad=N(()=>{Lt();Ye();Kt();Ha();Zr();Me();Yn();Ya();Xa();Qe();id.ownsGraphLoad=!0});function jb(e,{graph:t,svc:n}){let{match:s}=Nt(n,lt(e,"symbol"),"symbol");return Xh(or(t,s))}var kb=N(()=>{Me();Qe()});function Ja(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function bi(e){return Ja(e).toString(16).padStart(8,"0")}function Qa(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let $=0;$<16;$+=1)i[$]=o.getUint32(u+$*4);for(let $=16;$<64;$+=1){let E=a(i[$-15],7)^a(i[$-15],18)^i[$-15]>>>3,R=a(i[$-2],17)^a(i[$-2],19)^i[$-2]>>>10;i[$]=i[$-16]+E+i[$-7]+R>>>0}let[d,f,p,m,h,g,b,y]=r;for(let $=0;$<64;$+=1){let E=a(h,6)^a(h,11)^a(h,25),R=h&g^~h&b,v=y+E+R+RT[$]+i[$]>>>0,j=a(d,2)^a(d,13)^a(d,22),k=d&f^d&p^f&p,w=j+k>>>0;y=b,b=g,g=h,h=m+v>>>0,m=p,p=f,f=d,d=v+w>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+p>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+g>>>0,r[6]=r[6]+b>>>0,r[7]=r[7]+y>>>0}let c=new Uint8Array(32),l=new DataView(c.buffer);for(let u=0;u<8;u+=1)l.setUint32(u*4,r[u]);return c}function _T(e,t){let n=Qa(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function V(e){let t=js(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function Jn(e){let t=js(e);return AT.get(t)??t}function ye(e,t,n){return jo(V(e),Jn(t),V(n))}var RT,TT,js,AT,jo,nt=N(()=>{RT=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);TT=2e3,js=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,TT);AT=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);jo=(e,t,n)=>`fact:${_T(`${e}\0${t}\0${n}`,8)}`});var rn={};Ot(rn,{CARDINALITY_RULE_CONFIDENCE:()=>PT,CAX_DW_RULE:()=>ld,CAX_DW_RULE_CONFIDENCE:()=>dd,CAX_MAXC0_RULE_CONFIDENCE:()=>FT,CLS_SVF1_RULE:()=>fd,CLS_SVF1_RULE_CONFIDENCE:()=>md,DEFAULT_MAX_ENVIRONMENTS:()=>br,DISJOINT_PREDICATE:()=>hr,ENTAILED_DISJOINT_PROVENANCE:()=>ud,ENTAILED_PROVENANCE:()=>Tb,ENTAILED_SCM_SVF_PROVENANCE:()=>wd,ENTAILED_SVF1_PROVENANCE:()=>pd,ENTAILED_TYPE_PROVENANCE:()=>Cb,ON_PROPERTY_PREDICATE:()=>En,SCM_SVF_RULE:()=>bd,SCM_SVF_RULE_CONFIDENCE:()=>yd,SOME_VALUES_FROM_PREDICATE:()=>Sn,SUBCLASS_PREDICATE:()=>De,TYPE_PREDICATE:()=>Pt,buildCardinalityRestrictions:()=>gd,buildRelevanceFrontier:()=>cd,buildSubClassSuccessors:()=>Za,deriveDisjointViolations:()=>Nb,deriveSomeValuesFromApplication:()=>Pb,deriveSomeValuesFromSubsumption:()=>Mb,deriveSubClassClosure:()=>Ib,deriveSubClassClosureDelta:()=>Ob,deriveTypePropagation:()=>Lb,entailedTrustFrom:()=>IT,findConsistencyViolations:()=>zT,findIsaChain:()=>$d,proveCardinalityAtLeast:()=>MT,proveMaxCardinalityZeroDenial:()=>DT,retractSubClassOf:()=>GT,syllogise:()=>Db});function Rb(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function IT(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function ks(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Ib(e,{depth:t=32,budget:n=50,focus:s=null}={}){let o=new Set,r=new Map;for(let[u,d]of e||[])!u||!d||u===d||(o.add(`${u}${ze}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:ks(s),a=(u,d,f)=>!i||i.has(u)||i.has(d)||i.has(f),c=[],l=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[p,m]of r)for(let h of m){let g=r.get(h);if(g)for(let b of g){if(p===b)continue;let y=`${p}${ze}${b}`;o.has(y)||l.has(y)||a(p,h,b)&&d.push([p,h,b,y])}}if(!d.length)break;d.sort((p,m)=>p[0].localeCompare(m[0])||p[2].localeCompare(m[2])||p[1].localeCompare(m[1]));let f=!1;for(let[p,m,h,g]of d)if(!l.has(g)){if(c.length>=n)break;l.add(g),c.push({subject:p,object:h,via:m}),r.has(p)||r.set(p,new Set),r.get(p).add(h),f=!0}if(c.length>=n||!f)break}return c}function Ob(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[m,h]of e||[])!m||!h||m===h||(r.add(`${m}${ze}${h}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),a.has(h)||a.set(h,new Set),a.get(h).add(m));let c=[],l=new Set;for(let[m,h]of t||[]){if(!m||!h||m===h)continue;let g=`${m}${ze}${h}`;l.has(g)||(l.add(g),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:ks(o),d=(m,h,g)=>!u||u.has(m)||u.has(h)||u.has(g),f=[],p=new Set;for(let m=0;m<n&&c.length;m+=1){let h=[],g=($,E,R)=>{if($===R)return;let v=`${$}${ze}${R}`;r.has(v)||p.has(v)||d($,E,R)&&h.push([$,E,R,v])};for(let[$,E]of c){for(let R of i.get(E)||[])g($,E,R);for(let R of a.get($)||[])g(R,$,E)}if(!h.length)break;h.sort(($,E)=>$[0].localeCompare(E[0])||$[2].localeCompare(E[2])||$[1].localeCompare(E[1]));let b=!1,y=[];for(let[$,E,R,v]of h)if(!p.has(v)){if(f.length>=s)break;p.add(v),f.push({subject:$,object:R,via:E}),i.has($)||i.set($,new Set),i.get($).add(R),a.has(R)||a.set(R,new Set),a.get(R).add($),y.push([$,R]),b=!0}if(f.length>=s||!b)break;c=y}return f}function Qn(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function OT(e){return Qn((e||[]).map(([t,n])=>[n,t]))}function cd(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(Ys(l.predicate)?n.push([l.subject,l.object]):Ro(l.predicate)?s.push([l.subject,l.object]):gr(l.predicate)?o.set(l.subject,l.object):yi(l.predicate)&&r.set(l.subject,l.object));let i=OT(n),a=new Set;for(let l of t||[]){let u=V(l);if(u){a.add(u);for(let d of i(u))a.add(d)}}let c=new Set(a);for(let[l,u]of s)a.has(u)&&c.add(l);for(let[l,u]of r)o.has(l)&&a.has(u)&&c.add(l);return c}function Lb(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Qn(t),i=new Set,a=new Set;for(let[p,m]of o||[])p&&m&&i.add(`${p}${ze}${m}`);let c=s instanceof Set?s.size?s:null:ks(s),l=(p,m,h)=>!c||c.has(p)||c.has(m)||c.has(h),u=[];for(let[p,m]of e||[]){if(!p||!m)continue;let h=`${p}${ze}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===p)continue;let b=`${p}${ze}${g}`;i.has(b)||l(p,m,g)&&u.push([p,m,g,b])}}}u.sort((p,m)=>p[0].localeCompare(m[0])||p[2].localeCompare(m[2])||p[1].localeCompare(m[1]));let d=[],f=new Set;for(let[p,m,h,g]of u)if(!f.has(g)){if(d.length>=n)break;f.add(g),d.push({subject:p,object:h,via:m})}return d}function Nb(e,t,n,{budget:s=50,focus:o=null}={}){let r=Qn(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${ze}${h}`),a.add(`${h}${ze}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let c=new Set,l=o instanceof Set?o.size?o:null:ks(o),u=(m,h,g)=>!l||l.has(m)||l.has(h)||l.has(g),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let g=`${m}${ze}${h}`;if(!c.has(g)){c.add(g);for(let b of[h,...r(h)]){let y=i.get(b);if(y)for(let $ of y){if($===m)continue;let E=`${m}${ze}${$}`;a.has(E)||u(m,h,$)&&d.push([m,h,b,$,E])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let f=[],p=new Set;for(let[m,h,g,b,y]of d)if(!p.has(y)){if(f.length>=s)break;p.add(y),f.push({subject:m,object:b,viaType:h,viaClass:g})}return f}function Pb(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Qn(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${ze}${g.target}`;a.has(b)||a.set(b,new Set),a.get(b).add(g.restriction)}if(!a.size)return[];let c=new Set,l=new Map;for(let[g,b]of t||[])!g||!b||(c.add(`${g}${ze}${b}`),l.has(g)||l.set(g,new Set),l.get(g).add(b));let u=r instanceof Set?r.size?r:null:ks(r),d=(g,b,y)=>!u||u.has(g)||u.has(b)||u.has(y),f=new Set,p=[];for(let[g,b,y]of e||[]){if(!g||!b||!y)continue;let $=V(b),E=`${g}${ze}${$}${ze}${y}`;if(f.has(E))continue;f.add(E);let R=l.get(y);if(R)for(let v of R)for(let j of[v,...i(v)]){let k=a.get(`${$}${ze}${j}`);if(k)for(let w of k){if(g===w)continue;let S=`${g}${ze}${w}`;c.has(S)||d(g,y,w)&&p.push([g,b,$,y,v,j,w,S])}}}p.sort((g,b)=>g[0].localeCompare(b[0])||g[6].localeCompare(b[6])||g[1].localeCompare(b[1])||g[3].localeCompare(b[3]));let m=[],h=new Set;for(let[g,b,y,$,E,R,v,j]of p)if(!h.has(j)){if(m.length>=o)break;h.add(j),m.push({subject:g,object:v,viaProperty:b,viaPropertyKey:y,viaValue:$,viaType:E,viaTarget:R})}return m}function gd(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(gr(r.predicate))t.set(r.subject,r.object);else if(CT(r.predicate))s.set(r.subject,r.object);else{let i=NT[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==LT)continue;let c=s.get(r);c&&o.push({restriction:r,kind:i,n:a,onClass:c})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function Mb(e,t,{budget:n=50,focus:s=null}={}){let o=Qn(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=V(f.property);r.has(p)||r.set(p,[]),r.get(p).push({restriction:f.restriction,target:f.target})}let i=new Set;for(let[f,p]of t||[])f&&p&&i.add(`${f}${ze}${p}`);let a=s instanceof Set?s.size?s:null:ks(s),c=(f,p)=>!a||a.has(f)||a.has(p),l=[];for(let[,f]of r)if(!(f.length<2))for(let p of f)for(let m of f){if(p.restriction===m.restriction||p.target===m.target||!o(p.target).has(m.target))continue;let h=`${p.restriction}${ze}${m.restriction}`;i.has(h)||c(p.restriction,m.restriction)&&l.push([p.restriction,m.restriction,p.target,m.target,h])}l.sort((f,p)=>f[0].localeCompare(p[0])||f[1].localeCompare(p[1]));let u=[],d=new Set;for(let[f,p,m,h,g]of l)if(!d.has(g)){if(u.length>=n)break;d.add(g),u.push({subject:f,object:p,viaY1:m,viaY2:h})}return u}function Fb(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Qn(e),a=r instanceof Set?r.size?r:null:ks(r),c=f=>!a||a.has(n)||a.has(f),l=new Map;for(let[f,p]of e||[])!f||!p||(l.has(f)||l.set(f,new Set),l.get(f).add(p));let u=new Map((t||[]).map(f=>[f.restriction,f])),d=0;for(let f of[n,...i(n)]){if(d>=o)break;if(d+=1,!!c(f))for(let p of l.get(f)||[]){let m=u.get(p);if(m&&s(m))return{viaClass:f,viaRestriction:p,record:m}}}return null}function MT(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Fb(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function DT(e,t,n,s,o={}){if(!s)return null;let r=Fb(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function zT(e,t,n,{budget:s=50,focus:o=null}={}){let r=Qn(t),i=new Map;for(let[p,m]of n||[])!p||!m||p===m||(i.has(p)||i.set(p,new Set),i.get(p).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(p));if(!i.size)return[];let a=new Map;for(let[p,m]of e||[])!p||!m||(a.has(p)||a.set(p,new Set),a.get(p).add(m));let c=o instanceof Set?o.size?o:null:ks(o),l=p=>!c||c.has(p),u=[],d=new Set;for(let[p,m]of a){if(!l(p))continue;let h=[...m].sort();for(let g=0;g<h.length;g+=1)for(let b=g+1;b<h.length;b+=1){let[y,$]=[h[g],h[b]],E=[y,...r(y)],R=[$,...r($)],v=null;for(let k of E){let w=i.get(k);if(w){for(let S of R)if(w.has(S)){v=[k,S];break}if(v)break}}if(!v)continue;let j=`${p}${ze}${y}${ze}${$}`;d.has(j)||(d.add(j),u.push([p,y,$,v[0],v[1]]))}}u.sort((p,m)=>p[0].localeCompare(m[0])||p[1].localeCompare(m[1])||p[2].localeCompare(m[2]));let f=[];for(let[p,m,h,g,b]of u){if(f.length>=s)break;f.push({subject:p,classA:m,classB:h,viaA:g,viaB:b})}return f}async function Db(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=br,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=Rb(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await c(e),p=l(f),m=p.filter(C=>Ys(C.predicate)).map(C=>[C.subject,C.object]),h=p.filter(C=>Ro(C.predicate)).map(C=>[C.subject,C.object]),g=p.filter(C=>ko(C.predicate)).map(C=>[C.subject,C.object]),b=new Map,y=new Map,$=[];for(let C of p){let pe=String(C.predicate||"").trim().toLowerCase();gr(C.predicate)?b.set(C.subject,C.object):yi(C.predicate)?y.set(C.subject,C.object):hd.has(pe)||$.push([C.subject,C.predicate,C.object])}let E=[];for(let[C,pe]of b){let Le=y.get(C);Le&&E.push({restriction:C,property:pe,target:Le})}let R=ks(s),v=o&&R?cd(p,[...R]):R,j=v===null&&d?await a.loadSyllogiseState(e):null,k=new Set(p.map(C=>C.id)),w=Array.isArray(j?.factIds)?j.factIds.filter(C=>!k.has(C)):[],S=j&&Array.isArray(j.factIds)&&!w.length&&!i?"delta":"full",x=S==="delta"?new Set(j.factIds):null,A=S==="delta"?p.filter(C=>!x.has(C.id)):p,L=A.length,T=new Map;for(let C of p)T.set(`${C.subject}${ze}${C.predicate}${ze}${C.object}`,C.trust);let O=(C,pe,Le)=>T.get(`${C}${ze}${pe}${ze}${Le}`),_=(C,pe,Le)=>T.has(`${C}${ze}${pe}${ze}${Le}`),P=C=>C.filter(pe=>typeof pe=="number"),G=S==="delta"&&!A.length,J=S==="delta"?A.filter(C=>Ys(C.predicate)).map(C=>[C.subject,C.object]):[],q=S==="delta"?J.length?Ob(m,J,{depth:t,budget:n,focus:v}):[]:Ib(m,{depth:t,budget:n,focus:v}),z=m.concat(q.map(C=>[C.subject,C.object])),B=v,I=null;if(S==="delta"&&!G){let C=p.concat(q.map(Le=>({subject:Le.subject,predicate:De,object:Le.object}))),pe=[];for(let Le of A)pe.push(Le.subject,Le.object);I=cd(C,pe),B=I}let D=C=>!I||I.has(C),M=I?h.filter(([C,pe])=>D(C)||D(pe)):h,U=new Set;if(I)for(let C of A)ko(C.predicate)&&(U.add(C.subject),U.add(C.object));let W=I&&U.size?Qn(z):null,F=I?h.filter(([C,pe])=>D(C)||D(pe)||W&&[...W(pe)].some(Le=>U.has(Le))):h,Q=new Set;if(I){for(let C of A)if(gr(C.predicate)||yi(C.predicate)){let pe=b.get(C.subject);pe&&Q.add(V(pe))}}let Z=I?$.filter(([C,pe,Le])=>D(C)||D(Le)||Q.has(V(pe))):$,ce=Math.max(0,n-q.length),re=ce>0&&!G?Lb(M,z,{budget:ce,focus:B,presentTypeEdges:h}):[],X=Math.max(0,n-q.length-re.length),K=X>0&&!G?Nb(F,z,g,{budget:X,focus:B}):[],ne=Math.max(0,n-q.length-re.length-K.length),Y=ne>0&&E.length&&!G?Pb(Z,h,z,E,{budget:ne,focus:B}):[],je=Math.max(0,n-q.length-re.length-K.length-Y.length),Oe=je>0&&E.length>1&&!G?Mb(E,z,{budget:je,focus:B}):[],ue=new Map(E.map(C=>[C.restriction,C])),Ce=[...q.map(C=>({subject:C.subject,predicate:De,object:C.object,provenance:Tb,justification:[[ye(C.subject,De,C.via),ye(C.via,De,C.object)]]})),...re.map(C=>({subject:C.subject,predicate:Pt,object:C.object,provenance:Cb,justification:[[ye(C.subject,Pt,C.via),ye(C.via,De,C.object)]]})),...K.map(C=>{let pe=_(C.viaClass,hr,C.object),[Le,yn]=pe?[C.viaClass,C.object]:[C.object,C.viaClass],ds=P([O(C.subject,Pt,C.viaType),O(Le,hr,yn),...C.viaClass!==C.viaType?[O(C.viaType,De,C.viaClass)]:[]]);return{subject:C.subject,predicate:hr,object:C.object,provenance:ud,justification:[[ye(C.subject,Pt,C.viaType),ye(Le,hr,yn),...C.viaClass!==C.viaType?[ye(C.viaType,De,C.viaClass)]:[]]],...ds.length?{premiseTrusts:ds,ruleConfidence:dd}:{}}}),...Y.map(C=>{let pe=P([O(C.subject,C.viaProperty,C.viaValue),O(C.viaValue,Pt,C.viaType),O(C.object,En,C.viaPropertyKey),O(C.object,Sn,C.viaTarget),...C.viaType!==C.viaTarget?[O(C.viaType,De,C.viaTarget)]:[]]);return{subject:C.subject,predicate:Pt,object:C.object,provenance:pd,justification:[[ye(C.subject,C.viaProperty,C.viaValue),ye(C.viaValue,Pt,C.viaType),ye(C.object,En,C.viaPropertyKey),ye(C.object,Sn,C.viaTarget),...C.viaType!==C.viaTarget?[ye(C.viaType,De,C.viaTarget)]:[]]],...pe.length?{premiseTrusts:pe,ruleConfidence:md}:{}}}),...Oe.map(C=>{let pe=ue.get(C.subject),Le=ue.get(C.object),yn=P([pe&&O(C.subject,En,pe.property),O(C.subject,Sn,C.viaY1),Le&&O(C.object,En,Le.property),O(C.object,Sn,C.viaY2),O(C.viaY1,De,C.viaY2)]);return{subject:C.subject,predicate:De,object:C.object,provenance:wd,justification:[[...pe?[ye(C.subject,En,pe.property)]:[],ye(C.subject,Sn,C.viaY1),...Le?[ye(C.object,En,Le.property)]:[],ye(C.object,Sn,C.viaY2),ye(C.viaY1,De,C.viaY2)]],...yn.length?{premiseTrusts:yn,ruleConfidence:yd}:{}}})],Ue=Ce.map(C=>({id:ye(C.subject,C.predicate,C.object),subject:C.subject,predicate:C.predicate,object:C.object,environments:C.justification,write:C})),xe=Ub(p.concat(Ue.map(C=>({id:C.id,subject:C.subject,predicate:C.predicate,object:C.object})))),le=new Map(p.map(C=>[C.id,C])),ie=C=>Ys(C)||Ro(C)||ko(C),_e=C=>S!=="delta"||I!==null&&(I.has(C.subject)||I.has(C.object)),de=p.filter(C=>ie(C.predicate)&&zb(C.provenance)&&wi(C).length<r&&_e(C)).map(C=>({id:C.id,subject:C.subject,predicate:C.predicate,object:C.object,environments:wi(C),provenance:C.provenance})),at=[...Ue,...de].sort((C,pe)=>C.subject.localeCompare(pe.subject)||C.predicate.localeCompare(pe.predicate)||C.object.localeCompare(pe.object)),se=0,ke=!1,Rt=0;for(let C of at){if(Rt>=n){ke=!0;break}Rt+=1;let pe=xe(C,{maxEnvironments:r+1}),{kept:Le,truncated:yn}=BT(C.environments,pe,r);if(yn&&(ke=!0),!(Le.length<=C.environments.length)){if(se+=Le.length-C.environments.length,C.write){C.write.justification=Le;continue}Ce.push({subject:C.subject,predicate:C.predicate,object:C.object,justification:Le,...Bb(C.provenance,Le,ds=>le.get(ds)?.trust)||{}})}}let{ids:Be}=await u(e,Ce),Ct=[],Zt=0;for(let C of q)Ct.push({id:Be[Zt],subject:C.subject,object:C.object,via:C.via,rule:_b}),Zt+=1;for(let C of re)Ct.push({id:Be[Zt],subject:C.subject,object:C.object,via:C.via,rule:Ab}),Zt+=1;for(let C of K)Ct.push({id:Be[Zt],subject:C.subject,object:C.object,via:C.viaClass,rule:ld}),Zt+=1;for(let C of Y)Ct.push({id:Be[Zt],subject:C.subject,object:C.object,via:C.viaValue,rule:fd}),Zt+=1;for(let C of Oe)Ct.push({id:Be[Zt],subject:C.subject,object:C.object,via:C.viaY1,rule:bd}),Zt+=1;let aa=Ct.length>=n;if(v===null&&d&&!aa){let C=new Set(k);for(let pe of Be)C.add(pe);await a.saveSyllogiseState(e,{version:1,factIds:[...C].sort(),completedAt:new Date().toISOString()})}return{derived:Ct,count:Ct.length,budget:n,depth:t,truncated:aa,mode:S,deltaSize:L,environmentsAdded:se,alternatesTruncated:ke}}function zb(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function UT(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();Ys(u.predicate)?t.push([u.subject,u.object]):Ro(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):ko(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):gr(u.predicate)?o.set(u.subject,u.object):yi(u.predicate)?r.set(u.subject,u.object):hd.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([V(u.predicate),u.object]))}let a=Qn(t),c=(u,d)=>u!==d&&a(u).has(d),l=u=>{let d=o.get(u),f=r.get(u);return d&&f?{property:V(d),target:f}:null};return u=>{if(Ys(u.predicate)){if(c(u.subject,u.object))return!0;let d=l(u.subject),f=l(u.object);return!!(d&&f&&d.property===f.property&&c(d.target,f.target))}if(Ro(u.predicate)){for(let f of n.get(u.subject)||[])if(c(f,u.object))return!0;let d=l(u.object);if(d){for(let[f,p]of i.get(u.subject)||[])if(f===d.property){for(let m of n.get(p)||[])if(m===d.target||c(m,d.target))return!0}}return!1}if(ko(u.predicate)){for(let d of n.get(u.subject)||[])for(let f of[d,...a(d)])if(s.get(f)?.has(u.object))return!0;return!1}return!0}}function Ub(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,c=new Map,l=new Map;for(let p of e){if(!p||!p.subject||!p.predicate||!p.object)continue;p.id&&t.add(p.id);let m=String(p.predicate||"").trim().toLowerCase();Ys(p.predicate)?(n.push([p.subject,p.object]),s.has(p.subject)||s.set(p.subject,new Set),s.get(p.subject).add(p.object)):Ro(p.predicate)?(o.has(p.subject)||o.set(p.subject,new Set),o.get(p.subject).add(p.object)):ko(p.predicate)?(r.add(`${p.subject}${ze}${p.object}`),i.has(p.subject)||i.set(p.subject,new Set),i.get(p.subject).add(p.object),i.has(p.object)||i.set(p.object,new Set),i.get(p.object).add(p.subject)):gr(p.predicate)?a.set(p.subject,p.object):yi(p.predicate)?c.set(p.subject,p.object):hd.has(m)||(l.has(p.subject)||l.set(p.subject,[]),l.get(p.subject).push([p.predicate,p.object]))}let u=Qn(n),d=p=>s.get(p)||new Set,f=p=>{let m=a.get(p),h=c.get(p);return m&&h?{property:m,propertyKey:V(m),target:h}:null};return(p,{maxEnvironments:m=br}={})=>{let h=[],g=new Set,b=y=>{if(h.length>=m||p.id&&y.includes(p.id)||!y.every(E=>t.has(E)))return;let $=[...y].sort().join(" ");g.has($)||(g.add($),h.push(y))};if(Ys(p.predicate)){for(let y of[...d(p.subject)].sort()){if(h.length>=m)break;y===p.subject||y===p.object||d(y).has(p.object)&&b([ye(p.subject,De,y),ye(y,De,p.object)])}if(h.length<m){let y=f(p.subject),$=f(p.object);y&&$&&y.propertyKey===$.propertyKey&&y.target!==$.target&&d(y.target).has($.target)&&b([ye(p.subject,En,y.property),ye(p.subject,Sn,y.target),ye(p.object,En,$.property),ye(p.object,Sn,$.target),ye(y.target,De,$.target)])}return h}if(Ro(p.predicate)){for(let $ of[...o.get(p.subject)||[]].sort()){if(h.length>=m)break;$!==p.object&&d($).has(p.object)&&b([ye(p.subject,Pt,$),ye($,De,p.object)])}let y=f(p.object);if(y){let $=[...l.get(p.subject)||[]].filter(([E])=>V(E)===y.propertyKey).sort((E,R)=>E[0].localeCompare(R[0])||E[1].localeCompare(R[1]));for(let[E,R]of $){if(h.length>=m)break;for(let v of[...o.get(R)||[]].sort()){if(h.length>=m)break;v!==y.target&&!d(v).has(y.target)||b([ye(p.subject,E,R),ye(R,Pt,v),ye(p.object,En,y.propertyKey),ye(p.object,Sn,y.target),...v!==y.target?[ye(v,De,y.target)]:[]])}}}return h}if(ko(p.predicate)){let y=[];for(let $ of o.get(p.subject)||[])for(let E of[$,...u($)])(i.get(E)||new Set).has(p.object)&&y.push([$,E]);y.sort(($,E)=>$[0].localeCompare(E[0])||$[1].localeCompare(E[1]));for(let[$,E]of y){if(h.length>=m)break;let R=r.has(`${E}${ze}${p.object}`),[v,j]=R?[E,p.object]:[p.object,E];b([ye(p.subject,Pt,$),ye(v,hr,j),...E!==$?[ye($,De,E)]:[]])}return h}return h}}function BT(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function Bb(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=WT.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(l=>n(l)).filter(l=>typeof l=="number");if(a.length!==i.length)continue;let c=Math.min(...a);c>r&&(r=c,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function GT(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=br,store:i,sourceTags:a=[],predicate:c=De}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Rb(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),f=typeof i?.appendFacts=="function"?i.appendFacts:null,p=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,m=(a||[]).filter(Boolean);if(m.length&&!p)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=V(t),g=V(n),b=ye(h,c,g),y=await l(e),$=u(y),E=new Map($.map(_=>[_.id,_]));if(!E.has(b))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let R=E.get(b).sourceIds||[],v=m.map(_=>p(b,_).slice(b.length+1)),j=m.length?R.filter(_=>v.includes(_)):[],k=!m.length||j.length>0;if(m.length&&!k)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let w=m.length>0&&j.length<R.length,S=new Set([b]),x=[b],A=new Map,L=!1;if(!w){let _=$.filter(q=>wi(q).length&&zb(q.provenance)),P=new Map;for(let q of _)for(let z of wi(q))for(let B of z)P.has(B)||P.set(B,new Set),P.get(B).add(q.id);let G=0,J=[b];for(;G<o;G+=1){let q=new Set;for(let F of J)for(let Q of P.get(F)||[])S.has(Q)||q.add(Q);let z=[...q].map(F=>E.get(F)).sort((F,Q)=>F.subject.localeCompare(Q.subject)||F.predicate.localeCompare(Q.predicate)||F.object.localeCompare(Q.object));if(!z.length)break;let B=$.filter(F=>!S.has(F.id)&&!q.has(F.id)),I=new Set(B.map(F=>F.id)),D=Ub(B),M=UT(B),U=!1,W=!1;J=[];for(let F of z){if(S.size>=s){W=!0;break}let Q=wi(F),Z=Q.filter(re=>re.every(X=>I.has(X)));if(Z.length){Z.length!==Q.length&&A.set(F.id,Z);continue}let ce=D(F,{maxEnvironments:r});if(ce.length){A.set(F.id,ce);continue}M(F)||(S.add(F.id),x.push(F.id),J.push(F.id),U=!0)}if(W){L=!0;break}if(!U)break}!L&&G>=o&&(L=_.some(q=>!S.has(q.id)&&q.justification.some(z=>S.has(z))))}let T=m.length?[...j.map(_=>`${b}@${_}`),...x.slice(1)]:x,{removed:O}=await d(e,T);if(f){let _=[...A.entries()].filter(([P])=>!S.has(P)).sort((P,G)=>P[0].localeCompare(G[0])).map(([P,G])=>{let J=E.get(P);return{subject:J.subject,predicate:J.predicate,object:J.object,justification:G,...Bb(J.provenance,G,q=>E.get(q)?.trust)||{}}});_.length&&await f(e,_)}return{retracted:O,count:O.length,budget:s,depth:o,truncated:L,found:!0,...m.length?{ownRecord:!0,stillStands:w}:{}}}function Za(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function $d(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:Za(s),a=[];for(let[l,u]of n||[])l===e&&u&&a.push({node:u,path:[{subject:l,predicate:Pt,object:u}]});for(let l of i.get(e)||[])a.push({node:l,path:[{subject:e,predicate:De,object:l}]});let c=new Set([e]);for(let l=1;l<=o&&a.length;l+=1){for(let{node:d,path:f}of a)if(r.has(d))return f;if(l===o)break;let u=[];for(let{node:d,path:f}of a)if(!c.has(d)){c.add(d);for(let p of i.get(d)||[])c.has(p)||u.push({node:p,path:[...f,{subject:d,predicate:De,object:p}]})}a=u}return null}var De,_b,Tb,Pt,Ab,Cb,hr,ld,ud,dd,En,Sn,fd,pd,md,br,ze,Ys,Ro,ko,gr,yi,CT,hd,LT,NT,bd,wd,yd,PT,FT,wi,WT,At=N(()=>{nt();De="rdfs:subClassOf",_b="subClassOf",Tb=`entailed:${_b}`,Pt="rdf:type",Ab="type",Cb=`entailed:${Ab}`,hr="owl:disjointWith",ld="disjointWith",ud=`entailed:${ld}`,dd=.95,En="owl:onProperty",Sn="owl:someValuesFrom",fd="someValuesFrom",pd=`entailed:${fd}`,md=.95,br=4,ze="\u241F",Ys=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",Ro=e=>String(e||"").trim().toLowerCase()==="rdf:type",ko=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",gr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",yi=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",CT=e=>String(e||"").trim().toLowerCase()==="owl:onclass",hd=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);LT="has",NT={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};bd="someValuesFromSubsumption",wd=`entailed:${bd}`,yd=.95;PT=.95;FT=.95;wi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);WT=new Map([[ud,dd],[pd,md],[wd,yd]])});function vr(e){let t=String(e||""),n=Wb.get(t);return n||(t.startsWith(vd)?wr+t.slice(vd.length):t)}function Gb(e){let t=String(e||""),n=VT.get(t);return n||(t.startsWith(wr)?vd+t.slice(wr.length):null)}function qb(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=$d(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function nc(e,t,n,{maxHops:s=3}={}){let o=$r(e),r=$r(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=Hb(i),l=i.filter(b=>(b.predicate===tc||b.predicate===yr)&&r.has(b.object)),u=[];for(let b of l){let y=b.predicate===yr?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:y,hops:0,chain:null});continue}let $=qb(o,b.subject,a,c,s);$&&$.length&&u.push({fact:b,polarity:y,hops:$.length,chain:$})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Ed(o,r,i,{maxHops:s})};u.sort((b,y)=>b.hops-y.hops||(y.fact.trust||0)-(b.fact.trust||0));let d=u[0].hops,f=u.filter(b=>b.hops===d),p=f.filter(b=>b.polarity==="positive").map(b=>b.fact),m=f.filter(b=>b.polarity==="negative").map(b=>b.fact),h=m.length&&!p.length?"negative":"positive",g=u.find(b=>b.hops>d&&b.polarity!==h)||null;return{verdict:p.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:p,negative:m,chain:u[0].chain,overrides:g?{fact:g.fact,chain:g.chain}:null,baseRate:null}}function Ed(e,t,n,{maxHops:s=3}={}){let o=$r(e),r=$r(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===De||h.predicate===Pt),c=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!c.length)return null;let l=c[0],u=[...new Set(a.filter(h=>h.object===l&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let g=i.find(b=>b.subject===h&&r.has(b.object)&&(b.predicate===tc||b.predicate===yr));return g?{name:h,polarity:g.predicate===yr?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:m}=Hb(i);return{klass:l,kinds:u.length,positive:f.filter(h=>h.polarity==="positive"),negative:f.filter(h=>h.polarity==="negative"),unknown:f.filter(h=>h.polarity==="unknown"),chain:qb(o,l,p,m,s)}}function Sd(e,t,{exclude:n=[],maxHops:s=3}={}){let o=$r(e),r=$r(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==tc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),nc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(HT)}var wr,vd,ec,Wb,VT,Vb,tc,yr,xd,HT,$r,Hb,sc=N(()=>{At();wr="mgxneg:",vd="mgx:",ec="mgxneg:subClassOf",Wb=new Map([[De,ec]]),VT=new Map([...Wb].map(([e,t])=>[t,e]));Vb=e=>String(e||"").startsWith(wr),tc="mgx:capableOf",yr=vr(tc),xd=6,HT=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),$r=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),Hb=e=>{let t=e.filter(s=>s.predicate===Pt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===De).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:Za(n)}}});function oc(e){let t=String(e||"");return Rd.has(t)?jd:KT.has(t)||YT.test(t)?$i:XT.has(t)?Kb:kd}function JT(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(Jm.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function QT(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(JT(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function _d(e,t){let n=t===Kb;if(!n&&t!==$i)return null;let s=(e||[]).map(r=>({row:r,at:QT(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[c,l]=[String(r.row.object),String(i.row.object)];return c<l?-1:c>l?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var jd,$i,Kb,kd,qT,Rd,KT,YT,XT,Yb=N(()=>{sc();qn();jd="merge",$i="latest-observation-wins",Kb="first-claim-wins",kd="contradiction",qT=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],Rd=new Set(qT.flatMap(e=>[e,vr(e)])),KT=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),YT=/^mgx:has-exit-([a-z]+)$/,XT=new Set(["mgx:playedBy"])});function Ei(e){let t=String(e||""),n=t.indexOf(rc);return n<0?"":t.slice(n+rc.length)}function sA(e){let t=1,n=0;for(let s of e)t*=1-tA(s),n+=1;return n?nA(Math.min(1,1-t)):0}function ew(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function sw(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function ow(e,t="",n=""){let s=t,o=n;for(let r of e)s=tw(s,r.assertedAt),o=nw(o,r.assertedAt);return{earliest:s,latest:o}}function Id({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let c=[...new Set(o)].filter(Boolean).sort(),l=a?sA(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:ZT,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===xr?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:xi,key:"rollupCount",value:String(c.length)},{prop:Zn,key:"rollupEarliest",value:r},{prop:es,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:Er,key:"rollupPrior",value:String(l)}]]}}function rw({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort(sw).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=ow(i,Mt(s,Zn),Mt(s,es));return{rollup:Id({id:Td(e,t),sourceKey:`rollup:${t}`,template:Od(i[0].record||s),idsProp:xr,ids:[...cc(s),...i.map(u=>u.sourceId)],earliest:a,latest:c,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function iw({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort(sw),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=ow(i,Mt(s,Zn),Mt(s,es));return{rollup:Id({id:Ad(e,t),sourceKey:t,template:Od(i[0].record||s),idsProp:vi,ids:[...eA(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Ld(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Xs(s),r=o?xr:vi,i=a=>Cd(Mt(a,r));return Id({id:s,sourceKey:Mt(e,"mgx:sourceId")||Mt(t,"mgx:sourceId"),template:Od(Mt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:tw(Mt(e,Zn),Mt(t,Zn)),latest:nw(Mt(e,es),Mt(t,es)),priorFor:o?n:void 0})}function aw(e,t){if(!t)return!1;for(let n of e||[])if(cc(n).includes(t))return!0;return!1}var ZT,Xb,Jb,ic,Qb,xr,vi,xi,Zn,es,Er,rc,Zb,Td,Ad,Xs,Sr,ac,Mt,Cd,cc,eA,tA,nA,tw,nw,Od,Nd=N(()=>{ZT="Fact",Xb=64,Jb=8,ic=8,Qb=2,xr="mgx:rollupSourceIds",vi="mgx:rollupRecordIds",xi="mgx:rollupCount",Zn="mgx:rollupEarliest",es="mgx:rollupLatest",Er="mgx:rollupPrior",rc="@rollup:",Zb="#rollup",Td=(e,t)=>`${e}${rc}${t}`,Ad=(e,t)=>`${e}@${t}${Zb}`,Xs=e=>String(e||"").includes(rc),Sr=e=>String(e||"").endsWith(Zb),ac=e=>Xs(e)||Sr(e);Mt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Cd=e=>String(e||"").split(" ").filter(Boolean),cc=e=>Cd(Mt(e,xr)),eA=e=>Cd(Mt(e,vi)),tA=e=>Math.max(0,Math.min(1,Number(e)||0)),nA=e=>Number(e.toFixed(6));tw=(e,t)=>ew(e,t,Math.min),nw=(e,t)=>ew(e,t,Math.max);Od=e=>({label:e?.label||"",subject:Mt(e,"rdf:subject"),predicate:Mt(e,"rdf:predicate"),object:Mt(e,"rdf:object")})});function Dd(e){let t=String(e||"");return Fd(t)?t.slice(0,-fc.length):""}function cw(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function zd({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:gn,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:uc,key:"retractedRecordIds",value:i.join(" ")},{prop:Pd,key:"retractedCount",value:String(i.length)},{prop:dc,key:"retractedAt",value:o||""},...a.length?[{prop:Si,key:"provenance",value:a.join(" | ")}]:[]]}}function uw({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[..._o(o),...n].filter(Boolean);return a.length?zd({id:Md(e,t),sourceId:t,template:r||lw(o),ids:a,retractedAt:cw(To(o),s),tags:[...ji(jn(o,Si)),...ji(i)]}):null}function dw(e,t){let n=lw(jn(e,"rdf:subject")?e:t);return zd({id:e?.id||t?.id,sourceId:jn(e,"mgx:sourceId")||jn(t,"mgx:sourceId"),template:n,ids:[..._o(e),..._o(t)],retractedAt:cw(To(e),To(t)),tags:[...ji(jn(e,Si)),...ji(jn(t,Si))]})}function rA(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function iA(e,t,n=""){return!e||!t||!_o(e).includes(t)?!1:rA(n,To(e))}function pc(e,t,n=""){for(let s of e||[])if(iA(s,t,n))return!0;return!1}function aA(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function cA(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function mc(e){let t=Dd(e?.id);return t?{id:e.id,subject:t,predicate:lc,object:aA(To(e),_o(e)),provenance:jn(e,Si)}:null}function hc(e){if(!e||e.predicate!==lc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=cA(e.object);return o.length?zd({id:`${t}${fc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ji(e.provenance)}):null}var gn,lc,uc,dc,Pd,fc,Si,Md,Fd,jn,oA,ji,_o,To,lw,Ud=N(()=>{gn="Retraction",lc="mgx:retracted",uc="mgx:retractedRecordIds",dc="mgx:retractedAt",Pd="mgx:retractedCount",fc="#retracted",Si="mgx:factProvenance",Md=(e,t)=>`${e}@${t}${fc}`,Fd=e=>String(e||"").endsWith(fc);jn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",oA=e=>String(e||"").split(" ").filter(Boolean),ji=e=>String(e||"").split(" | ").filter(Boolean),_o=e=>oA(jn(e,uc)),To=e=>jn(e,dc);lw=e=>({label:e?.label||"",subject:jn(e,"rdf:subject"),predicate:jn(e,"rdf:predicate"),object:jn(e,"rdf:object")})});var lA,uA,dA,fA,Bd,oz,fw=N(()=>{qn();lA="mgx:worldName",uA="mgx:nodeName",dA="mgx:playedBy",fA="mgx:waved",Bd="mgx:invitedBy",oz=Object.freeze([lA,uA,dA,fA,Bd])});function gc(e){let t=new Set;for(let n of e||[])n?.predicate===Bd&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function Wd(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function bc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=Wd(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let c=s(a);r.set(a,new Set([...c||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(c=>r.get(c).has(a)))}var Gd=N(()=>{fw()});function Rs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function wA(e,t){(!e?.class||!pA.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function yA(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])ki(Rs(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=Rs(e,i);a!==void 0&&hA.test(a)&&t.push(`a Fact's ${i} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(a)})`)}let n=Rs(e,"mgx:factProvenance");n!==void 0&&!ki(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";gA(s)&&!mw.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=Rs(e,"mgx:sourceId");o!==void 0&&!ki(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=Rs(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);for(let i of bA){let a=Rs(e,i);if(a===void 0)continue;let c=a.split(" ").filter(Boolean);c.length||t.push(`${i}, when present, must name at least one record id`);for(let l of c)mw.test(l)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(l)})`)}}function $A(e,t){ki(Rs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=Rs(e,"mgx:ruleKind");if(!n||!pw.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...pw].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of mA[n])ki(Rs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function vA(e){let t=[];return wA(e,t),e?.class==="Fact"&&yA(e,t),e?.class==="Rule"&&$A(e,t),{ok:t.length===0,violations:t}}function Vd(e){let t=vA(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var pA,pw,mA,hA,mw,gA,bA,ki,hw=N(()=>{pA=new Set(["Utterance","Fact","Session","Source","Rule"]),pw=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),mA={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},hA=/[.!?]\s+\w/,mw=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,gA=e=>e.includes("@")||/#v\d/.test(e),bA=["mgx:supersedes","mgx:supersededBy"];ki=e=>typeof e=="string"&&e.trim().length>0});var gw={};Ot(gw,{access:()=>SA,appendFile:()=>RA,basename:()=>WA,copyFile:()=>LA,createInterface:()=>KA,createReadStream:()=>PA,createRequire:()=>xA,createWriteStream:()=>MA,default:()=>XA,dirname:()=>zA,existsSync:()=>FA,fileURLToPath:()=>VA,isAbsolute:()=>BA,join:()=>DA,mkdir:()=>_A,mkdtemp:()=>TA,randomBytes:()=>HA,readFile:()=>jA,readFileSync:()=>EA,readdir:()=>NA,rename:()=>AA,resolve:()=>UA,rm:()=>IA,sep:()=>GA,spawnSync:()=>qA,stat:()=>OA,tmpdir:()=>YA,unlink:()=>CA,writeFile:()=>kA});var wt,xA,EA,SA,jA,kA,RA,_A,TA,AA,CA,IA,OA,LA,NA,PA,MA,FA,DA,zA,UA,BA,WA,GA,VA,HA,qA,KA,YA,XA,bw=N(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},xA=wt("createRequire"),EA=wt("readFileSync"),SA=wt("access"),jA=wt("readFile"),kA=wt("writeFile"),RA=wt("appendFile"),_A=wt("mkdir"),TA=wt("mkdtemp"),AA=wt("rename"),CA=wt("unlink"),IA=wt("rm"),OA=wt("stat"),LA=wt("copyFile"),NA=wt("readdir"),PA=wt("createReadStream"),MA=wt("createWriteStream"),FA=()=>!1,DA=(...e)=>e.join("/"),zA=e=>String(e).replace(/\/[^/]*$/,""),UA=(...e)=>e.join("/"),BA=e=>String(e).startsWith("/"),WA=e=>String(e).split("/").pop(),GA="/",VA=e=>String(e),HA=wt("randomBytes"),qA=wt("spawnSync"),KA=wt("createInterface"),YA=()=>"/tmp",XA={}});var JA,Ri,Hd=N(()=>{JA=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Ri=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(JA);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function QA(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function ZA(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
|
|
86
86
|
`,i===t&&(o+=" ".repeat(r+n+2),o+=`^
|
|
87
|
-
`))}return o}var
|
|
87
|
+
`))}return o}var we,Ao=N(()=>{we=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=QA(n.toml,n.ptr),r=ZA(n.toml,s,o);super(`Invalid TOML document: ${t}
|
|
88
88
|
|
|
89
|
-
${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function
|
|
89
|
+
${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function wc(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
|
|
90
90
|
`?t++:e[t]==="\r"&&e[t+1]===`
|
|
91
|
-
`&&(t+=2));let i="",a=t,
|
|
92
|
-
`||n==="\r"&&e[
|
|
93
|
-
`))
|
|
94
|
-
`;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new
|
|
95
|
-
`,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function
|
|
91
|
+
`&&(t+=2));let i="",a=t,c=0;for(let l=t;l<e.length;l++)if(n=e[l],r&&(n===`
|
|
92
|
+
`||n==="\r"&&e[l+1]===`
|
|
93
|
+
`))c=c&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new we("control characters are not allowed in strings",{toml:e,ptr:l});if((!c||c===3)&&n===s&&(!r||e[l+1]===s&&e[l+2]===s))return r&&(e[l+3]===s&&l++,e[l+3]===s&&l++),[c?i:i+e.slice(a,l),l+(r?3:1)];if(!c)!o&&n==="\\"&&(i+=e.slice(a,a=l),c=1);else if(c===1)if(n==="x"||n==="u"||n==="U"){let u=0,d=n==="x"?2:n==="u"?4:8;for(let f=0;f<d;f++,l++){let p=e.charCodeAt(l+1),m=p>=48&&p<=57?p-48:p>=65&&p<=70?p-65+10:p>=97&&p<=102?p-97+10:-1;if(m<0)throw new we("invalid non-hex character in unicode escape",{toml:e,ptr:l+1});u=u<<4|m}if(u<0||u>1114111||u>=55296&&u<=57343)throw new we("invalid unicode escape",{toml:e,ptr:l});i+=String.fromCodePoint(u),a=l+1,c=0}else if(n===" "||n===" ")c=2;else{if(n==="b")i+="\b";else if(n==="t")i+=" ";else if(n==="n")i+=`
|
|
94
|
+
`;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new we("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new we("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new we("unfinished string",{toml:e,ptr:t})}function ww(e,t,n,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=eC.test(e);if(o||tC.test(e)){if(nC.test(e))throw new we("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new we("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new we("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new Ri(e);if(!r.isValid())throw new we("invalid value",{toml:t,ptr:n});return r}var eC,tC,nC,qd=N(()=>{Hd();Ao();eC=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,tC=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,nC=/^[+-]?0[0-9_]/});function yc(e,t=0,n=e.length){let s=e.indexOf(`
|
|
95
|
+
`,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function jr(e,t){for(let n=t;n<e.length;n++){let s=e[n];if(s===`
|
|
96
96
|
`)return n;if(s==="\r"&&e[n+1]===`
|
|
97
|
-
`)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new
|
|
97
|
+
`)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new we("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function ts(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
|
|
98
98
|
`||o==="\r"&&e[t+1]===`
|
|
99
|
-
`);)t++;if(s||o!=="#")break;t=
|
|
99
|
+
`);)t++;if(s||o!=="#")break;t=jr(e,t)}return t}function yw(e,t,n,s,o=!1){if(!s)return t=yc(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=yc(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
|
|
100
100
|
`||i==="\r"&&e[r+1]===`
|
|
101
|
-
`))return r}}throw new
|
|
102
|
-
`&&e[
|
|
103
|
-
`&&i!=="\r"){let a,
|
|
104
|
-
`&&r!=="\r"){let i=
|
|
105
|
-
`&&e[a]!=="\r")throw new
|
|
106
|
-
`)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Ft(t,r))}return s}async function _b(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await BT(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Ft(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Ft(s,String(n.graph_file))),n.graph_files!==void 0){let w=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=w.map(v=>Ft(s,String(v)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},l={};a.enabled!==void 0&&(l.enabled=a.enabled),a.limit!==void 0&&(l.limit=a.limit),a.capture_unknown_context!==void 0&&(l.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(l.unknownContextLimit=a.unknown_context_limit),Object.keys(l).length&&(o.seed=l),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let c=n.index||{},u={};c.languages!==void 0&&(u.languages=c.languages),c.exclude!==void 0&&(u.exclude=c.exclude),c.secret_exclude!==void 0&&(u.secretExclude=c.secret_exclude),c.history_depth!==void 0&&(u.historyDepth=c.history_depth),c.include_text!==void 0&&(u.includeText=c.include_text),c.include_structure!==void 0&&(u.includeStructure=c.include_structure),c.respect_gitignore!==void 0&&(u.respectGitignore=c.respect_gitignore),c.markdown_sections!==void 0&&(u.markdownSections=c.markdown_sections),c.vue!==void 0&&(u.vue=c.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},p={};d.score_gap_k!==void 0&&(p.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(p.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(p.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(p.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(p.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(p.beamSearch=d.beam_search),d.beam_width!==void 0&&(p.beamWidth=d.beam_width),d.prose_layers!==void 0&&(p.proseLayers=d.prose_layers);let f=d.expansion||{},h={};f.strategy!==void 0&&(h.strategy=f.strategy),f.nodes!==void 0&&(h.nodes=f.nodes),f.q!==void 0&&(h.q=f.q),f.depth!==void 0&&(h.depth=f.depth),Object.keys(h).length&&(p.expansion=h),Object.keys(p).length&&(o.tune=p);let m=n.telemetry||{};m.enabled!==void 0&&(o.telemetry={enabled:m.enabled});let b=n.memory||{},g={};b.retention_versions!==void 0&&(g.retentionVersions=b.retention_versions),b.backend!==void 0&&(g.backend=b.backend),Object.keys(g).length&&(o.memory=g);let y=[];for(let[w,v]of WT)n[w]&&n[w][v]!==void 0&&y.push(`${w}.${v}`);return o.unwired=y,o}function Ja(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:Ja(o,r,n)}return n}function Tb({args:e={},toml:t=null,defaults:n={}}={}){let s=Ja(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Ja(o):{},i=Ja(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),l={},c={};for(let u of a)u in i?(l[u]=i[u],c[u]="arg"):u in r?(l[u]=r[u],c[u]="tmct.toml"):(l[u]=s[u],c[u]="default");return{effective:l,sources:c}}var Qa,WT,ec=C(()=>{Tt();Ve();Xa();Qa="tmct.toml";WT=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Us={};qt(Us,{CANONICALISED_FROM_PROP:()=>jd,CAPABLE_OF_PREDICATE:()=>ZA,CHAIN_KEEP_DEPTH:()=>tb,CHAIN_ROLLUP_THRESHOLD:()=>La,CREATED_AT_PROP:()=>tt,DEFAULT_RETENTION:()=>wd,FACT_CLASS:()=>ft,GROUP_ROLLUP_THRESHOLD:()=>Zg,HAS_A_PREDICATE:()=>br,IN_REPLY_TO_PROP:()=>kd,MEMORY_DIR_REL:()=>pr,MEMORY_GRAPH_REL:()=>vd,MEMORY_MANIFEST_REL:()=>Qb,MEMORY_SESSION_CLASS:()=>Ed,MULTI_VALUED_PREDICATES:()=>eI,NODE_ID_REL:()=>Id,OPERATOR_SOURCE_ID:()=>tc,RETRACTED_AT_PROP:()=>Da,RETRACTED_COUNT_PROP:()=>Zu,RETRACTED_RECORD_IDS_PROP:()=>Fa,RETRACTION_CLASS:()=>cn,RETRACTION_PREDICATE:()=>Ma,ROLLUP_COUNT_PROP:()=>ri,ROLLUP_EARLIEST_PROP:()=>Un,ROLLUP_KEEP_PER_TYPE:()=>eb,ROLLUP_LATEST_PROP:()=>Bn,ROLLUP_PRIOR_PROP:()=>cr,ROLLUP_RECORD_IDS_PROP:()=>oi,ROLLUP_SOURCE_IDS_PROP:()=>ar,RULE_CLASS:()=>hr,RULE_KIND_ACTION_CONSTRAINT:()=>Fd,RULE_KIND_ACTION_EFFECT:()=>$i,RULE_KIND_ACTION_PRECOND:()=>ac,RULE_KIND_ACTION_SIGNATURE:()=>Md,RULE_KIND_COMPOSE2:()=>wi,RULE_KIND_FILTER:()=>yi,RULE_KIND_PROP:()=>gr,RULE_KIND_RECURSIVE:()=>Pd,SAID_IN_SESSION_PROP:()=>Sd,SOURCE_CLASS:()=>fr,SOURCE_RELIABILITY_PROP:()=>Lb,STATED_BY_PROP:()=>gn,SYLLOGISE_STATE_REL:()=>Ad,UPDATED_AT_PROP:()=>Rs,UTTERANCE_CLASS:()=>xd,admittedNodes:()=>Ga,appendCanonicalisedFromEdges:()=>PA,appendFact:()=>zA,appendFacts:()=>qn,appendRetractions:()=>YA,appendRule:()=>lc,appendUtterance:()=>NA,appendUtterances:()=>rw,applySeedPayload:()=>Mb,attachFactHeads:()=>Vb,chainRollupIdFor:()=>qu,cloneMemoryPayload:()=>Fb,closeSqliteMemoryStore:()=>Yb,createInMemoryStore:()=>gi,createSqliteMemoryStore:()=>Kb,emptyMemory:()=>mi,factGroupId:()=>Ut,factHeadsOf:()=>Hb,factIdForTriple:()=>we,factRecordIdForTag:()=>KT,factRecordIdsFor:()=>yo,findContradictions:()=>fw,findRuleByName:()=>Dd,findRulesByName:()=>VA,headRollupIdFor:()=>Hu,isChainRollupId:()=>lr,isHeadRollupId:()=>Ms,isMemoryOrSqliteHandle:()=>_d,isRetractionId:()=>td,isRollupId:()=>Na,loadMemory:()=>ct,loadNodeId:()=>EA,loadSyllogiseState:()=>vA,normFactPredicate:()=>hs,normFactTerm:()=>G,openConfiguredMemoryBackend:()=>zs,openExistingMemoryBackend:()=>rA,openMemoryBackend:()=>Td,peersToConvince:()=>id,provSourceClassFor:()=>jA,provenanceTagToSource:()=>ts,readFactRows:()=>ht,readObjectSupersessions:()=>nA,readOnlyMemorySnapshot:()=>iA,readRetractions:()=>KA,readRuleRows:()=>zd,removeFacts:()=>qA,resolveMemoryGraphFile:()=>pi,resolveRelationChase:()=>Ud,resolveRelationChaseReverse:()=>pw,retirableRetractions:()=>XA,retireRetractions:()=>JA,retractedAtOf:()=>mo,retractedRecordIds:()=>ho,retractionFromWire:()=>Wa,retractionIdFor:()=>ed,retractionScopeOf:()=>nd,retractionWireFact:()=>Ba,saveNodeId:()=>SA,saveSyllogiseState:()=>xA,snapshotMemory:()=>gA,stableRecordIds:()=>Va});function mi(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:HT.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function pi(e,t=null){if(Ds(e)||Vn(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?Z(e,vd):Z(e,pr,`graph.v${t}.json`)}function Ds(e){return!!e&&typeof e=="object"&&e.backend===Rd}function Vn(e){return!!e&&typeof e=="object"&&e.backend===Pb}function _d(e){return Ds(e)||Vn(e)}function gi(){return{backend:Rd,payload:mi()}}function Mb(e,t){t&&(e.payload={...e.payload,...t})}function Fb(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Db(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Od(ts(t));if(n)return n}return{id:bs,type:""}}function Ut(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function KT(e,t){return`${e}@${zb(t).id}`}function zb(e){return Od(ts(e))||{id:bs,type:""}}function Ub(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=zb(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(bs,{sourceId:bs,sourceType:"",tags:[]}),[...t.values()]}function gd(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=ts(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function mr(e,t="",n=Math.max){return gd(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function YT(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function Bb(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Db(n("mgx:factProvenance")),o=n(bi).split(" ").filter(Boolean)[0]||null,r=ii(e.id);return[e.id,Ut(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(wo)||s.id,r||s.type,Number(n(r?cr:zo))||0,n(tt),n(fi)||null,o,t]}function XT(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(ft))return;let t=e.prepare(Wb);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(ft))t.run(...Bb(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function JT(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Vb(e,t){return e&&t&&(e[Gb]=t),e}function ZT(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function qb(e,t,n,s){let o=e.prepare(QT),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=ws();for(let a of n){let l=t.groups.get(a);if(!l?.length){r.run(a),s?.delete(a);continue}let c=JT(Wd(a,l,t).assertions),u=rh(c).score;o.run(a,u,JSON.stringify(c),i),s?.set(a,{trustBase:u,inputs:c})}}function eA(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(ft))return;let n=Bd(Xb(e));t.exec("BEGIN IMMEDIATE");try{qb(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function tA(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=ws();for(let i of n){let[a,l]=i.split("\0");if(Ca(l)!==si)continue;let c=t.groupsByPair.get(i)||[];if(c.length<2)continue;let u=c.map(f=>{let h=Wd(f,t.groups.get(f),t);return h.trust=Hi(h.assertions).score,h});if(new Set(u.map(f=>f.object)).size<2)continue;let d=Vu(u,si)?.winner?.id;if(!d)continue;let p=s.get(a,l);p?.to_id!==d&&o.run(a,l,(p?.ord??-1)+1,p?.to_id||"",d,r)}}function nA(e,{subject:t,predicate:n}={}){if(!Vn(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function oA(){if(Cb)return;Cb=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function Kb(e){oA();let{DatabaseSync:t}=await Promise.resolve().then(()=>($b(),yb)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(qT),XT(n);let s={backend:Pb,db:n,dbPath:e};return eA(s),s}function Yb(e){Vn(e)&&e.db.close()}async function Td(e,t){if(t===Rd)return{dir:gi(),close:async()=>{}};let n=Z(e,".tmct","memory","graph.sqlite"),s=r=>dl(r).then(()=>!0,()=>!1);!await s(n)&&await s(Z(e,vd))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
|
|
107
|
-
`),await An(me(n),{recursive:!0});let o=await Kb(n);return{dir:o,close:async()=>Yb(o)}}async function rA(e,t=""){if(!e||typeof e!="string")return null;let n=Z(e,".tmct","memory","graph.sqlite");try{await dl(n)}catch{return null}return Td(e,t)}async function iA(e){if(!e)return null;let t=gi();return Mb(t,Fb(await ct(e))),t}async function zs(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(ec(),Ab));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return Td(e,n)}function aA(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=Xb(e),e.cachedFactHeads=ZT(e.db),e.cachedDataVersion=t),Vb(Rn(e.cachedPayload),e.cachedFactHeads)}function Xb(e){let t=e.db,n=mi(),s=(a,l)=>{let c=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return c?JSON.parse(c.v):l},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(l=>{let c={subject:l.subject,object:l.object,subjectLabel:l.subject_label,objectLabel:l.object_label};return l.extra&&Object.assign(c,JSON.parse(l.extra)),c})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function cA(e,t){let n=Rn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function lA(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function uA(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function dA(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Rn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function pA(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function fA(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function hA(e,t){let n=e.db,s=mi(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Rn(t.generated_at??s.generated_at),o.memory=Rn(t.memory??s.memory),o.prefixes=Rn(t.prefixes??s.prefixes),o.vocabulary=Rn(t.vocabulary??s.vocabulary),o.classes=Rn(t.classes??s.classes),o.proseIndex=Rn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),l=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,c=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare(Wb),d=new Set,p=new Set,f=new Set;for(let S of t.individuals||[]){d.add(S.id);let _=JSON.stringify(S),R=i.get(S.id);if(R&&R.json===_)continue;let T=R?R.ord:l++;c.run(S.id,T,S.class??null,S.label??null,_),S.class===ft&&(u.run(...Bb(S,_)),p.add(Ut(S.id)),f.add(bd(hi(S,"subject"),hi(S,"predicate")))),o&&cA(o,S)}let h=n.prepare("DELETE FROM individuals WHERE id = ?"),m=n.prepare("DELETE FROM facts WHERE id = ?"),b=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let S of n.prepare("SELECT id FROM individuals").all()){if(d.has(S.id))continue;let _=b.get(S.id);_&&(p.add(_.triple_hash),f.add(bd(_.subject,_.predicate))),h.run(S.id),m.run(S.id)}o&&lA(o,d);let g=n.prepare("SELECT ord FROM relations WHERE prop = ?"),w=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,v=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),k=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),$=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),x=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),E=new Set;for(let S of t.objectProperties||[]){E.add(S.prop);let _=k.all(S.prop),R=new Map(_.map(B=>[`${B.subject}\0${B.object}`,B])),T=new Set,M=o?uA(o,S.prop):null;for(let B of S.examples||[]){let X=`${B.subject}\0${B.object}`;T.add(X);let ae=Object.keys(B).filter(z=>!sA.has(z)),ie=ae.length?JSON.stringify(Object.fromEntries(ae.map(z=>[z,B[z]]))):null,te=R.get(X);te&&(te.subject_label??null)===(B.subjectLabel??null)&&(te.object_label??null)===(B.objectLabel??null)&&(te.extra??null)===(ie??null)||($.run(S.prop,B.subject,B.object,B.subjectLabel??null,B.objectLabel??null,ie),M&&dA(M,B,ae))}for(let B of R.keys()){if(T.has(B))continue;let[X,ae]=B.split("\0");x.run(S.prop,X,ae)}M&&pA(M,T);let I=Number.isFinite(S.count)?S.count:(S.examples||[]).length,D=g.get(S.prop)?.ord??w++;v.run(S.prop,D,S.predicate??null,I),M&&(M.predicate=S.predicate??null,M.count=I)}for(let S of n.prepare("SELECT prop FROM relations").all())E.has(S.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(S.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(S.prop));if(o&&fA(o,E),p.size){let S=Bd(t);qb(n,S,p,e.cachedFactHeads),tA(n,S,f)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Jb(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Tr(n,t),await Mi(n,e)}async function oc(e,t){await Jb(e,JSON.stringify(t))}async function gA(e,{retentionVersions:t}={}){if(_d(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a memory/sqlite handle has no on-disk graph.json to snapshot");let n=pi(e),s;try{s=await Te(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=mA(e),r;try{r=JSON.parse(await Te(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??wd}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??wd);let i=r.version,a=pi(e,i);await An(me(a),{recursive:!0}),await Jb(a,s),r.version=i+1;let l=null,c=i-r.retentionVersions;if(c>=0)try{await pl(pi(e,c)),l=c}catch(u){if(u?.code!=="ENOENT")throw u}return await oc(o,r),{skipped:!1,version:i,prunedVersion:l}}async function ct(e){if(Ds(e))return fd(e.payload);if(Vn(e))return fd(aA(e));let t;try{t=await Te(md(e),"utf8")}catch(n){if(n?.code==="ENOENT")return mi();throw n}return fd(JSON.parse(t))}function wA(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==ft||!bA.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=er(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function yA(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(l=>l?.prop===gn),n=new Map;for(let l of t?.examples||[]){if(!l?.subject)continue;let c=n.get(l.subject);c?c.push(l):n.set(l.subject,[l])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let l of e.individuals){if(l?.class!==ft||String(l.id||"").includes("@")){a.push(l);continue}let c=w=>(l.attributes||[]).find(v=>v?.prop===w)?.value||"",u=c("rdf:subject"),d=c("rdf:predicate"),p=c("rdf:object");if(!u||!d||!p){a.push(l);continue}let f=er(u,d,p),h=c(tt),m=c("mgx:factProvenance"),b=n.get(l.id)||[],g=m?Ub(m):[];for(let w of b)g.some(v=>v.sourceId===w.object)||g.push({sourceId:w.object,sourceType:"",tags:[]});g.length||g.push({sourceId:bs,sourceType:"",tags:[]});let y=[];for(let w of g){let v={id:`${f}@${w.sourceId}`,label:l.label,class:ft,derived_from:Rn(l.derived_from)||[],mentions:Rn(l.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:p},{prop:tt,key:"createdAt",value:mr(w.tags,h,Math.min)||h||ws()},{prop:wo,key:"sourceId",value:w.sourceId},...w.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:w.tags.join(" | ")}]:[],...c("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:c("mgx:hasProseTokens")}]:[],...c("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:c("mgx:factQuantifier")}]:[],...w.sourceType==="entailed"&&c("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:c("mgx:factJustification")}]:[]]};if(a.push(v),r.push(v),y.push(v.id),w.sourceId!==bs){let k=b.find($=>$?.object===w.sourceId);i.push({...k||{},subject:v.id,object:w.sourceId,subjectLabel:v.label,objectLabel:Ld(w.sourceId)})}}s.add(l.id),o.set(l.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(l=>!s.has(l?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:gn,count:i.length,examples:i}));for(let l of e.objectProperties||[]){if(l?.prop===gn||!l?.examples?.length)continue;let c=[];for(let u of l.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],p=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let f of d)for(let h of p)c.push({...u,subject:f,object:h})}l.examples=c,l.count=c.length}e.individuals=a,tw(e);for(let l of r)dr(e,l);return Hn(e),e}async function $A(e,t){if(Ds(e)){e.payload=t;return}if(Vn(e)){hA(e,t);return}await An(me(md(e)),{recursive:!0}),await oc(md(e),t)}async function vA(e){if(Ds(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(Vn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Zb);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Te(Z(e,Ad),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function xA(e,t){if(Ds(e)){e.syllogiseState=structuredClone(t);return}if(Vn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Zb,JSON.stringify(t));return}let n=Z(e,Ad);await An(me(n),{recursive:!0}),await oc(n,t)}async function EA(e){if(Ds(e))return e.nodeId||null;if(Vn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(ew);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Te(Z(e,Id),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function SA(e,t){if(Ds(e)){e.nodeId=t;return}if(Vn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(ew,JSON.stringify({nodeId:t}));return}let n=Z(e,Id);await An(me(n),{recursive:!0}),await oc(n,{nodeId:t})}function tw(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===fr&&n.set(a.id,a),a.class===cn&&$d(r,a),a.class===ft)){let l=Ut(a.id),c=o.get(l);c?c.push(a.id):o.set(l,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===gn);for(let a of i?.examples||[]){if(!a?.subject)continue;let l=s.get(a.subject);l?l.push(a.object):s.set(a.subject,[a.object])}return e[yd]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[yd]}function $d(e,t){let n=Ut(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function kA(e,t){let n=Bt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===cn&&Ut(s.id)===t)}async function $s(e,t){let n=await ct(e);tw(n);let s=await t(n)??n;return AA(s),CA(s),s.proseIndex=qf(s.individuals),await $A(e,s),s}function Cd(e,t){return e?.attributes?.find(n=>n?.prop===tt)?.value||t||ws()}function bn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Od(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${tc}:${e.sessionId}`:tc,type:"operator"};case"teach":return{id:e.sessionId?`${hd}:${e.sessionId}`:hd,type:"teach"};case"teachNode":return{id:`${Nb}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}:${e.article}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}:${e.article}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${ei(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function jA(e){return xl[e]||null}function RA(e,t,n){let s=Od(t);if(!s)return null;let o=Bt(e),r=o?o.individualsById.get(s.id):e.individuals.find(c=>c?.id===s.id),i=Cd(r,t?.createdAt||n),a={id:s.id,label:Ld(s.id),class:fr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:tt,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},l=ys(e,a);return o&&o.sourcesById.set(s.id,l),s.id}function ic(e){let t=Bt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===fr&&(n[s.id]=s);return n}function nw(e,t){let n=Bt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===gn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function _A(e,t,n=Date.now(),s={}){let o=nw(e,t.id),r=(t.attributes||[]).find(l=>l?.prop===tt)?.value||"",{score:i,inputs:a}=oh({sourceIds:o,createdAt:r},ic(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});bn(t,zo,"trustScore",String(i)),bn(t,Gi,"trustInputs",JSON.stringify(a)),bn(t,Rs,"updatedAt",new Date(n).toISOString())}function TA(e,t,n=Date.now(),s={}){let[o]=nw(e,t.id),r=o?ic(e)[o]:null,i=(r?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||"",a=Vi(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let c=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*c))}let l=(t.attributes||[]).find(c=>c?.prop===tt)?.value||"";bn(t,zo,"trustScore",String(a)),bn(t,Gi,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:l})),bn(t,Rs,"updatedAt",new Date(n).toISOString())}function sw(e,t,n,s){t?.class===ft?TA(e,t,n,s):_A(e,t,n,s)}function dr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===tt)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=ts(i);if(!a)continue;let l=RA(e,a,r);l&&sc(e,{predicate:"statedBy",prop:gn},{subject:t.id,object:l,subjectLabel:t.label,objectLabel:Ld(l)})}sw(e,t,n,s)}function AA(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===gn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==ft||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(dr(e,r,o),s=!0);s&&Hn(e)}function CA(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=ht(e),n=new Set;for(let a of fw(e))for(let l of a)n.add(l.id);let s=new Map;for(let a of t)for(let l of a.sourceIds){if(!IA(l))continue;let c=s.get(l)||{factsAsserted:0,factsContradicted:0};c.factsAsserted+=1,n.has(a.id)&&(c.factsContradicted+=1),s.set(l,c)}if(!s.size)return;let o=Bt(e);for(let[a,l]of s){let c=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);c&&(bn(c,Lb,"sourceReliability",String(ih(l))),bn(c,Rs,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===gn),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let l=o?o.individualsById.get(a):e.individuals.find(c=>c?.id===a);l&&sw(e,l)}}function OA(e,t,n){if(!Na(n?.id))return n;let s=ii(n.id);if(!s)return Ju(t,n);let o=ic(e);return Ju(t,n,{priorFor:r=>Vi(s,o[r])})}function Ob(e,t,n){return n?.class===cn?hb(t,n):OA(e,t,n)}function ys(e,t){let n=Bt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,Ob(e,o,t)),o.class===cn&&$d(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===cn&&$d(n.retractionsByGroup,t),t.class===ft){let r=Ut(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=Ob(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function sc(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(l=>l?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===gn?Bt(e):null;if(r){let l=r.statedByBySubject.get(s.subject);if(!l||!l.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||ws()}),o.count=o.examples.length,l?l.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(l=>l?.subject===s.subject&&l?.object===s.object)?.createdAt||s.createdAt||ws();if(o.examples=(o.examples||[]).filter(l=>!(l?.subject===s.subject&&l?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let l=r.statedByBySubject.get(s.subject)||[];l.includes(s.object)||l.push(s.object),r.statedByBySubject.set(s.subject,l)}}function Hn(e){let t=[Ed,xd,ft,fr,hr];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function LA(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:Ed,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:tt,key:"createdAt",value:n||ws()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function ow(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:l=""}){if(!VT.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let c=String(s||""),u=fs(n),d=`utt:${o}#${c}#${t}`,p=rc(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),f=Wi({doc:u}),h=e.individuals.find(y=>y?.id===d),m=Cd(h,l||c),b={id:d,label:p,class:xd,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:c},{prop:tt,key:"createdAt",value:m},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...f.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:f.join(" ")}]:[]]};ys(e,b);let g=LA(e,o,r);if(sc(e,{predicate:"saidInSession",prop:Sd},{subject:d,object:g,subjectLabel:p,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&sc(e,{predicate:"inReplyTo",prop:kd},{subject:d,object:a,subjectLabel:p,objectLabel:y.label})}return c&&c>String(e.generated_at||"")&&(e.generated_at=c),d}async function NA(e,t){let n;return await $s(e,s=>{n=ow(s,t),Hn(s)}),{id:n}}async function rw(e,t){let n=[];return t?.length?(await $s(e,s=>{for(let o of t)n.push(ow(s,o));Hn(s)}),{ids:n}):{ids:n}}async function PA(e,t){t?.length&&await $s(e,n=>{for(let s of t)for(let o of yo(n,s.factId))sc(n,{predicate:"canonicalisedFrom",prop:jd},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function yo(e,t){let n=Bt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===ft&&Ut(s.id)===t).map(s=>s.id)}function iw(e,t,n,s=""){let o=Ub(n);if(o.length===1&&o[0].sourceId===bs&&yo(e,t).length)return[];let r=kA(e,t);if(r.length&&(o=o.filter(a=>!Ua(r,`${t}@${a.sourceId}`,mr(a.tags,s))),!o.length))return o;let i=MA(e,t);return i.length?o.filter(a=>!ub(i,a.sourceId)):o}function MA(e,t){let n=Bt(e),s=n?n.factRecordsByGroup.get(t):yo(e,t),o=[];for(let r of s||[]){if(!Ms(r))continue;let i=Fs(e,r);i&&o.push(i)}return o}function aw(e,t,{quantifier:n,environments:s}){let o=yo(e,t).map(i=>Fs(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===bi)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(l=>l?.prop==="mgx:factJustification"));for(let a of i.length?i:o)bn(a,"mgx:factJustification","justification",s.map(l=>l.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(bn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function FA(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===nc)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function cw(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:l,createdAt:c,observedAt:u,quantifier:d,environments:p}=t,f=`${n}@${l.sourceId}`,h=Bt(e),m=h?h.individualsById.get(f):e.individuals.find(_=>_?.id===f),b=_=>(m?.attributes||[]).find(R=>R?.prop===_)?.value||"",g=b("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:gd(l.tags),observedAt:u},w=null,v=l.tags,k=y.assertedAt||c||ws(),$=u,x=[],E=d;if(m){let _={assertedAt:gd(g),observedAt:b(fi)};YT(y,_)?(w={head:m,id:`${f}#v${FA(m)}`},x=[w.id]):(v=[...new Set([...g,...l.tags])],k=b(tt)||k,$=u||b(fi),x=b(nc).split(" ").filter(Boolean)),E=d||b("mgx:factQuantifier")}return{candidate:{id:f,label:i,class:ft,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:tt,key:"createdAt",value:k},{prop:wo,key:"sourceId",value:l.sourceId},...v.length?[{prop:"mgx:factProvenance",key:"provenance",value:v.join(" | ")}]:[],...$?[{prop:fi,key:"observedAt",value:$}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...E?[{prop:"mgx:factQuantifier",key:"quantifier",value:E}]:[],...p?[{prop:"mgx:factJustification",key:"justification",value:p.map(_=>_.join(" ")).join(" | ")}]:[],...x.length?[{prop:nc,key:"supersedes",value:x.join(" ")}]:[]]},demote:w}}function DA(e,t){let n=`${t}@${bs}`,s=Bt(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function lw(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${bs}`)||DA(e,Ut(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};bn(o,bi,"supersededBy",t.id),ys(e,o),s.push(o.id)}return ys(e,t),s.push(t.id),s}function Fs(e,t){let n=Bt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function Nd(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Bt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Ut(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function uw(e,t){let n=Bt(e),s=(n?n.factRecordsByGroup.get(t):yo(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=Fs(e,u);if(!d)continue;let p=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(Ms(u)){i.set(ii(u),d);continue}if(lr(u)){a.set(p(wo),d);continue}let f=p("mgx:factProvenance"),h=Db(f),m=f.split(" | ").filter(Boolean),b={id:u,sourceId:p(wo)||h.id,assertedAt:mr(m,p(tt)),record:d};if(p(bi)){let y=r.get(b.sourceId);y?y.push(b):r.set(b.sourceId,[b]);continue}if(!h.type)continue;let g=o.get(h.type);g?g.push(b):o.set(h.type,[b])}let l=ic(e),c=[];for(let[u,d]of o){let p=cb({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:f=>Vi(u,l[f])});if(p){ys(e,p.rollup),c.push(...p.absorbed);for(let f of p.absorbedSourceIds){for(let m of r.get(f)||[])c.push(m.id);r.delete(f);let h=a.get(f);h&&c.push(h.id),a.delete(f)}}}for(let[u,d]of r){let p=lb({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!p)continue;ys(e,p.rollup),c.push(...p.absorbed);let f=Fs(e,p.rewire);f&&bn(f,nc,"supersedes",p.rollup.id)}return c}async function zA(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:l,ruleConfidence:c}={}){let u=G(t),d=hs(n),p=G(s);if(!u||!d||!p)throw new Error("a fact needs subject, predicate and object");let f=er(u,d,p),h=`${u} ${d} ${p}`,m=Wi({doc:h}),b=fs(a);return await $s(e,async g=>{let y=iw(g,f,fs(o),r);for(let w of y.length?[]:aw(g,f,{quantifier:b}))dr(g,Fs(g,w),void 0,{premiseTrusts:l,ruleConfidence:c});for(let w of y){let v=cw(g,{groupId:f,s:u,p:d,o:p,label:rc(h),tokens:m,group:w,createdAt:r,observedAt:i,quantifier:b});await cd(v.candidate);for(let k of lw(g,v))dr(g,Fs(g,k),void 0,k===v.candidate.id?{premiseTrusts:l,ruleConfidence:c}:void 0)}Nd(g,uw(g,f)),Hn(g)}),{id:f}}function UA(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function qn(e,t){let n=[],s=0;for(let r of t||[]){let i=G(r?.subject),a=hs(r?.predicate),l=G(r?.object);if(!i||!a||!l){s+=1;continue}let c=`${i} ${a} ${l}`;n.push({id:er(i,a,l),s:i,p:a,o:l,text:c,tokens:Wi({doc:c}),provenance:fs(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:fs(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:UA(r?.justification)})}let o=[];return n.length?(await $s(e,r=>{let i=[],a=new Set,l=new Map;for(let u of n){let d=iw(r,u.id,u.provenance,u.createdAt);for(let p of d.length?[]:aw(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(p)||(a.add(p),i.push(p)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&l.set(p,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let p of d){let f=cw(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:rc(u.text),tokens:u.tokens,group:p,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let h of lw(r,f))a.has(h)||(a.add(h),i.push(h));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&l.set(f.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)dr(r,Fs(r,u),void 0,l.get(u));let c=[];for(let u of new Set(o))c.push(...uw(r,u));Nd(r,c),Hn(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function lc(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=dw[n];if(!i)throw new Error(`a rule kind must be one of ${BA.join(", ")}, got ${JSON.stringify(n)}`);let a=G(t);if(!a)throw new Error("a rule needs a name");let l=WA[n]||new Set,c=i.map(([f])=>G(s?.[f])),u=i.filter(([f],h)=>!l.has(f)&&!c[h]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([f])=>f).join(" + ")}`);if(n===$i){let f=c[i.findIndex(([m])=>m==="objectRole")],h=c[i.findIndex(([m])=>m==="value")];if(!f&&!h)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=GA(n,a,c),p=rc(`${a} = ${n}(${c.join(", ")})`);return await $s(e,async f=>{let h=f.individuals.find(w=>w?.id===d),m=h?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",b=[...new Set([...m.split(" | "),fs(o)].filter(Boolean))],g=Cd(h,r),y={id:d,label:p,class:hr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:cc,key:"ruleName",value:a},{prop:gr,key:"ruleKind",value:n},...i.map(([w,v],k)=>({prop:v,key:w,value:c[k],skip:!c[k]&&l.has(w)})).filter(w=>!w.skip).map(({skip:w,...v})=>v),{prop:tt,key:"createdAt",value:g},...b.length?[{prop:"mgx:factProvenance",key:"provenance",value:b.join(" | ")}]:[]]};await cd(y),ys(f,y),dr(f,f.individuals.find(w=>w?.id===d)),Hn(f)}),{id:d}}function Dd(e,t){let n=G(t);return(e?.individuals||[]).find(s=>s?.class===hr&&(s.attributes||[]).find(o=>o?.prop===cc)?.value===n)}function VA(e,t){let n=G(t),s=o=>(o.attributes||[]).find(r=>r?.prop===gr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===hr&&(o.attributes||[]).find(r=>r?.prop===cc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function zd(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==hr)continue;let s=a=>(n.attributes||[]).find(l=>l?.prop===a)?.value,o=s(gr),r=dw[o];if(!r)continue;let i={};for(let[a,l]of r)i[a]=s(l)??"";t.push({id:n.id,name:s(cc)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function Ud(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:l,byTrust:c,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:p}=o,f=String(t||"").trim().toLowerCase(),h=l(G,n),m=l(G,s),b=r(f).filter(w=>h.has(w.fact.subject)&&m.has(w.fact.object));if(b.length){let w=b.slice().sort((v,k)=>c(v.fact,k.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let g=Dd(e,f),y=g?.attributes?.find(w=>w.prop===gr)?.value;if(g&&y===wi){let w=g.attributes.find(M=>M.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(M=>M.prop==="mgx:ruleBase2")?.value,k=G(n),$=G(s);if(!w||!v||!k||!$)return null;let _=p({entity:k,hopsTaken:0},M=>M.hopsTaken===2&&M.entity===$,M=>{if(M.hopsTaken>=2)return[];let I=M.hopsTaken===0?w:v;return r(I).filter(D=>D.fact.subject===M.entity).map(D=>({action:D,nextState:{entity:D.fact.object,hopsTaken:M.hopsTaken+1}}))},{maxDepth:2,stateKey:M=>`${M.entity}#${M.hopsTaken}`});if(!_)return null;let R=new Set,T=[];for(let M of _.actions){T.push(i(M.fact));for(let I of M.aliasFacts){let D=I.id||`${I.subject}|${I.predicate}|${I.object}`;R.has(D)||(R.add(D),T.push(`${a(I)}${I.provenance?` (source: ${I.provenance})`:""}`))}}return{citation:T}}if(g&&y===yi){let w=g.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!w||!v)return null;let k=await Ud(e,w,n,s,o);if(!k)return null;let $=G(n),x=G(v),E=u.find(S=>S.predicate===d&&S.subject===$&&G(S.object)===x);return E?{citation:[...k.citation,i(E)]}:null}return null}async function pw(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:l,rows:c,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,p=String(t||"").trim().toLowerCase(),f=a(G,n),h=o(p).filter(g=>f.has(g.fact.object));if(h.length){let g=new Map;for(let y of h)g.has(y.fact.subject)||g.set(y.fact.subject,[]),g.get(y.fact.subject).push(y);return[...g.entries()].map(([y,w])=>{let v=w.slice().sort((k,$)=>l(k.fact,$.fact))[0];return{subject:y,citation:[r(v.fact),...v.aliasFacts.map(k=>`${i(k)}${k.provenance?` (source: ${k.provenance})`:""}`)]}})}let m=Dd(e,p),b=m?.attributes?.find(g=>g.prop===gr)?.value;if(m&&b===wi){let g=m.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,y=m.attributes.find(x=>x.prop==="mgx:ruleBase2")?.value,w=G(n);return!g||!y||!w?[]:d({entity:w,hopsTaken:0},x=>{if(x.hopsTaken>=2)return[];let E=x.hopsTaken===0?y:g;return o(E).filter(S=>S.fact.object===x.entity).map(S=>({action:S,nextState:{entity:S.fact.subject,hopsTaken:x.hopsTaken+1}}))},{maxDepth:2,stateKey:x=>`${x.entity}#${x.hopsTaken}`}).filter(x=>x.node.hopsTaken===2).map(({node:x,path:E})=>{let S=new Set,_=[];for(let R of E.actions.slice().reverse()){_.push(r(R.fact));for(let T of R.aliasFacts){let M=T.id||`${T.subject}|${T.predicate}|${T.object}`;S.has(M)||(S.add(M),_.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:x.entity,citation:_}})}if(m&&b===yi){let g=m.attributes.find($=>$.prop==="mgx:ruleBase1")?.value,y=m.attributes.find($=>$.prop==="mgx:ruleFilterProperty")?.value;if(!g||!y)return[];let w=await pw(e,g,n,s),v=G(y),k=[];for(let $ of w){let x=G($.subject),E=c.find(S=>S.predicate===u&&S.subject===x&&G(S.object)===v);E&&k.push({subject:$.subject,citation:[...$.citation,r(E)]})}return k}return[]}function ht(e,t={}){let n=Bd(e),s=Hb(e),o=[];for(let[r,i]of n.groups){let a=Wd(r,i,n),l=s?.get(r);a.trust=Hi(l?l.inputs:a.assertions,t).score,o.push(a)}return o}function Bd(e){let t=e?.individuals||[],n=new Map(t.filter(l=>l?.class===fr).map(l=>[l.id,l])),s=(e?.objectProperties||[]).find(l=>l?.prop===gn),o=new Map;for(let l of s?.examples||[])o.has(l.subject)||o.set(l.subject,[]),o.get(l.subject).push(l.object);let r=new Map,i=new Map;for(let l of t){if(l?.class===cn){let d=Ut(l.id),p=i.get(d);p?p.push(l):i.set(d,[l]);continue}if(l?.class!==ft||(l.attributes||[]).some(d=>d?.prop===bi)||lr(l.id))continue;let c=Ut(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}for(let[l,c]of i){let u=r.get(l);if(!u)continue;let d=u.filter(p=>!Ua(c,p.id,mr(Gn(p,"mgx:factProvenance").split(" | ").filter(Boolean),Gn(p,tt))));d.length!==u.length&&(d.length?r.set(l,d):r.delete(l))}let a=new Map;for(let[l,c]of r){c.sort((p,f)=>p.id<f.id?-1:p.id>f.id?1:0);let u=bd(hi(c[0],"subject"),hi(c[0],"predicate")),d=a.get(u);d?d.push(l):a.set(u,[l])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:l=>(n.get(l)?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||""}}function Wd(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=Gn,i=hi,a=[],l=[],c=[],u=new Set,d=[],p=new Set,f="";for(let b of t){if(Ms(b.id)){let x=ii(b.id),E=Pa(b);for(let S of E)l.includes(S)||(l.push(S),x&&c.push(x));a.push({id:b.id,sourceId:"",sourceType:x,provenance:"",createdAt:r(b,Un),ownTrust:Number(r(b,cr))||0,assertedAt:r(b,Bn),rollup:{count:Number(r(b,ri))||E.length,sourceIds:E,earliest:r(b,Un),latest:r(b,Bn)}});continue}let g=r(b,"mgx:factProvenance").split(" | ").filter(Boolean);for(let x of g)u.add(x);let[y]=s.get(b.id)||[],w=y||r(b,wo),v=o(w);y&&!l.includes(y)&&(l.push(y),v&&c.push(v));let k=r(b,tt),$=r(b,fi);a.push({id:b.id,sourceId:w,sourceType:v,provenance:g.join(" | "),createdAt:k,...$?{observedAt:$}:{},ownTrust:Number(r(b,zo))||0,assertedAt:mr(g,k)}),f=f||i(b,"quantifier");for(let x of i(b,"justification").split(" | ")){let E=x.split(" ").filter(Boolean);if(!E.length)continue;let S=E.join(" ");p.has(S)||(p.add(S),d.push(E))}}let h=[],m=new Set;for(let b of d)for(let g of b)m.has(g)||(m.add(g),h.push(g));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:f,sourceIds:l,sourceTypes:c,environments:d,justification:h,assertions:a}}function HA(e){let t=Gn(e,wo);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function qA(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||ws();return await $s(e,l=>{let c=new Set,u=new Set,d=new Map;l.individuals=(l.individuals||[]).filter(p=>{if(p?.class!==ft)return!0;let f=Ut(p.id),h=o.has(p.id)?p.id:o.has(f)?f:"";if(!h)return!0;u.add(h),c.add(p.id);let m=HA(p),b=`${f}\0${m}`,g=Gn(p,"mgx:factProvenance"),y=d.get(b);return y?(y.ids.push(p.id),g&&y.tags.push(g)):d.set(b,{groupId:f,sourceId:m,ids:[p.id],tags:g?[g]:[],template:{label:p.label||"",subject:Gn(p,"rdf:subject"),predicate:Gn(p,"rdf:predicate"),object:Gn(p,"rdf:object")}}),!1});for(let p of u)r.push(p);if(r.length){for(let p of c)i.push(p);for(let p of l.objectProperties||[]){let f=p.examples||[];p.examples=f.filter(h=>!c.has(h?.subject)&&!c.has(h?.object)),p.count=p.examples.length}for(let p of d.values()){let f=fb({groupId:p.groupId,sourceId:p.sourceId,recordIds:p.ids,retractedAt:a,template:p.template,provenance:[...p.tags,n].filter(Boolean).join(" | ")});f&&ys(l,f)}Hn(l)}}),{removed:r,records:i}}function KA(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==cn)continue;let s=Ba(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function YA(e,t){let n=[];for(let o of t||[]){let r=Wa(o);r&&n.push(r)}let s=[];return n.length?(await $s(e,o=>{let r=new Map;for(let a of n){let l=ys(o,a),c=Ut(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}let i=new Set;for(let[a,l]of r)for(let c of yo(o,a)){let u=Fs(o,c);if(!u)continue;let d=Gn(u,"mgx:factProvenance").split(" | ").filter(Boolean);Ua(l,c,mr(d,Gn(u,tt)))&&i.add(c)}if(i.size){Nd(o,i);for(let a of i)s.push(a)}Hn(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function XA(e,{self:t="",acknowledgedBy:n=null}={}){let s=Ga(ht(e)),o=[];for(let r of e?.individuals||[])r?.class===cn&&r.id&&o.push(r.id);return{roster:s,retirable:Va({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function JA(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await $s(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==cn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Bt(o);if(i)for(let a of r){i.individualsById.delete(a);let l=Ut(a),c=(i.retractionsByGroup.get(l)||[]).filter(u=>!r.has(u.id));c.length?i.retractionsByGroup.set(l,c):i.retractionsByGroup.delete(l)}Hn(o)}),{retired:s}):{retired:s}}function fw(e,{floor:t=QA}={}){let n=ht(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(Ca(r.predicate)===Bu)continue;let i=`${r.subject} ${r.predicate}`;s.has(i)||s.set(i,[]),s.get(i).push(r)}let o=[];for(let r of s.values()){if(new Set(r.map(a=>a.object)).size<2)continue;let i=Ca(r[0].predicate);i!==Wu&&!Vu(r,i).contested||o.push(r.slice().sort((a,l)=>l.trust-a.trust||a.object.localeCompare(l.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var pr,vd,xd,ft,Ed,fr,hr,Sd,kd,GT,gn,jd,Lb,tc,hd,Nb,VT,Ib,HT,md,Rd,Pb,qT,bs,fi,wo,nc,bi,Wb,Gn,hi,bd,Gb,Hb,QT,sA,Cb,Rn,Qb,wd,mA,fd,bA,Ad,Zb,Id,ew,yd,Bt,rc,ws,Ld,IA,wi,yi,Pd,Md,ac,$i,Fd,BA,cc,gr,dw,WA,GA,QA,br,ZA,eI,Ge=C(()=>{Tt();Ve();js();Lt();Lt();ns();Qg();ns();Ia();Qu();od();ad();wb();Qu();od();ad();pr=Z(".tmct","memory"),vd=Z(pr,"graph.json"),xd="Utterance",ft="Fact",Ed="Session",fr="Source",hr="Rule",Sd="mgx:saidInSession",kd="mgx:inReplyTo",GT="mgx:derivedFrom",gn="mgx:statedBy",jd="mgx:canonicalisedFrom",Lb="mgx:sourceReliability",tc="src:operator-chat",hd="src:teach-chat",Nb="src:teach-node",VT=new Set(["visitor","tmct"]),Ib=48,HT=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:Sd,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:kd,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:tt,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:Rs,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:GT,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:gn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:jd,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:zo,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:Gi,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:sr,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];md=e=>pi(e),Rd="memory",Pb="sqlite";qT=`
|
|
101
|
+
`))return r}}throw new we("cannot find end of structure",{toml:e,ptr:t})}var $c=N(()=>{Ao();});function sC(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(jr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function _i(e,t,n,s,o){if(s===0)throw new we("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?vw(e,t,s,o):$w(e,t,s,o);if(n){if(l=ts(e,l),e[l]===",")l++;else if(e[l]!==n)throw new we("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=wc(e,t);if(n){if(l=ts(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
|
|
102
|
+
`&&e[l]!=="\r")throw new we("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=yw(e,t,",",n),a=sC(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new we("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=ts(e,t+a[1]),e[i]===","&&i++),[ww(a[0],e,t,o),i]}var Kd=N(()=>{qd();Yd();$c();Ao();});function vc(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new we("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new we("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=wc(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=yc(l);if(u>-1)throw new we("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new we("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new we("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{s=e.indexOf(".",t);let a=e.slice(t,s<0||s>r?r:s);if(!oC.test(a))throw new we("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(s+1&&s<r);return[o,ts(e,r+1,!0,!0)]}function $w(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new we("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=jr(e,t);else if(i!==" "&&i!==" "&&i!==`
|
|
103
|
+
`&&i!=="\r"){let a,c=o,l=!1,[u,d]=vc(e,t-1);for(let m=0;m<u.length;m++){if(m&&(c=l?c[a]:c[a]={}),a=u[m],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||r.has(c[a])))throw new we("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new we("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=_i(e,d,"}",n-1,s);r.add(f),c[a]=f,t=p}}if(!i)throw new we("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function vw(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new we("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=jr(e,t);else if(r!==" "&&r!==" "&&r!==`
|
|
104
|
+
`&&r!=="\r"){let i=_i(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new we("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var oC,Yd=N(()=>{qd();Kd();$c();Ao();oC=/^[a-zA-Z0-9-_]+[ \t]*$/});function xw(e,t,n,s){let o=t,r=n,i,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(o=a?o[i]:o[i]={},r=(c=r[i]).c,s===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[l],(a=Object.hasOwn(o,i))&&r[i]?.t===0&&r[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,writable:!0})),r[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(c=r[i],c.t!==s&&!(s===1&&c.t===3)||(s===2&&(c.d||(c.d=!0,o[i]=[]),o[i].push(o={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,c.c]}function Co(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=ts(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=vc(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new we("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=xw(l[0],s,o,c?2:1);if(!u)throw new we("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=l[1]}else{let c=vc(e,a),l=xw(c[0],r,i,0);if(!l)throw new we("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=_i(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=ts(e,a,!0),e[a]&&e[a]!==`
|
|
105
|
+
`&&e[a]!=="\r")throw new we("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ts(e,a)}return s}var Ew=N(()=>{Yd();Kd();$c();Ao();});var Sw=N(()=>{});var xc=N(()=>{Ew();Sw();Hd();Ao();});var Xd={};Ot(Xd,{CONFIG_FILE:()=>Sc,loadTomlConfig:()=>jc,mergeEffective:()=>kw,normalizeConfig:()=>jw});async function jc(e,{file:t}={}){let n=t||te(e,Sc),s;try{s=await Ae(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return Co(s)}catch(o){throw new Error(`Invalid ${Sc} at ${n}: ${o&&o.message?o.message:o}`)}}async function rC(e,t){let n;if(Array.isArray(e))n=e;else{let o=Ut(t,String(e));n=(await Ae(o,"utf8")).split(`
|
|
106
|
+
`)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Ut(t,r))}return s}async function jw(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await rC(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Ut(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Ut(s,String(n.graph_file))),n.graph_files!==void 0){let $=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=$.map(E=>Ut(s,String(E)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},c={};a.enabled!==void 0&&(c.enabled=a.enabled),a.limit!==void 0&&(c.limit=a.limit),a.capture_unknown_context!==void 0&&(c.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(c.unknownContextLimit=a.unknown_context_limit),Object.keys(c).length&&(o.seed=c),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let l=n.index||{},u={};l.languages!==void 0&&(u.languages=l.languages),l.exclude!==void 0&&(u.exclude=l.exclude),l.secret_exclude!==void 0&&(u.secretExclude=l.secret_exclude),l.history_depth!==void 0&&(u.historyDepth=l.history_depth),l.include_text!==void 0&&(u.includeText=l.include_text),l.include_structure!==void 0&&(u.includeStructure=l.include_structure),l.respect_gitignore!==void 0&&(u.respectGitignore=l.respect_gitignore),l.markdown_sections!==void 0&&(u.markdownSections=l.markdown_sections),l.vue!==void 0&&(u.vue=l.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},f={};d.score_gap_k!==void 0&&(f.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(f.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(f.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(f.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(f.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(f.beamSearch=d.beam_search),d.beam_width!==void 0&&(f.beamWidth=d.beam_width),d.prose_layers!==void 0&&(f.proseLayers=d.prose_layers);let p=d.expansion||{},m={};p.strategy!==void 0&&(m.strategy=p.strategy),p.nodes!==void 0&&(m.nodes=p.nodes),p.q!==void 0&&(m.q=p.q),p.depth!==void 0&&(m.depth=p.depth),Object.keys(m).length&&(f.expansion=m),Object.keys(f).length&&(o.tune=f);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let g=n.memory||{},b={};g.retention_versions!==void 0&&(b.retentionVersions=g.retention_versions),g.backend!==void 0&&(b.backend=g.backend),Object.keys(b).length&&(o.memory=b);let y=[];for(let[$,E]of iC)n[$]&&n[$][E]!==void 0&&y.push(`${$}.${E}`);return o.unwired=y,o}function Ec(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:Ec(o,r,n)}return n}function kw({args:e={},toml:t=null,defaults:n={}}={}){let s=Ec(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Ec(o):{},i=Ec(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),c={},l={};for(let u of a)u in i?(c[u]=i[u],l[u]="arg"):u in r?(c[u]=r[u],l[u]="tmct.toml"):(c[u]=s[u],l[u]="default");return{effective:c,sources:l}}var Sc,iC,Ti=N(()=>{Lt();Ye();xc();Sc="tmct.toml";iC=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var eo={};Ot(eo,{CANONICALISED_FROM_PROP:()=>df,CAPABLE_OF_PREDICATE:()=>hI,CHAIN_KEEP_DEPTH:()=>Qb,CHAIN_ROLLUP_THRESHOLD:()=>ic,CREATED_AT_PROP:()=>it,DEFAULT_RETENTION:()=>nf,FACT_CLASS:()=>yt,GROUP_ROLLUP_THRESHOLD:()=>Xb,HAS_A_PREDICATE:()=>Ir,IN_REPLY_TO_PROP:()=>uf,MEMORY_DIR_REL:()=>Rr,MEMORY_GRAPH_REL:()=>rf,MEMORY_MANIFEST_REL:()=>Kw,MEMORY_SESSION_CLASS:()=>cf,MULTI_VALUED_PREDICATES:()=>gI,NODE_ID_REL:()=>gf,OPERATOR_SOURCE_ID:()=>kc,RETRACTED_AT_PROP:()=>dc,RETRACTED_COUNT_PROP:()=>Pd,RETRACTED_RECORD_IDS_PROP:()=>uc,RETRACTION_CLASS:()=>gn,RETRACTION_PREDICATE:()=>lc,ROLLUP_COUNT_PROP:()=>xi,ROLLUP_EARLIEST_PROP:()=>Zn,ROLLUP_KEEP_PER_TYPE:()=>Jb,ROLLUP_LATEST_PROP:()=>es,ROLLUP_PRIOR_PROP:()=>Er,ROLLUP_RECORD_IDS_PROP:()=>vi,ROLLUP_SOURCE_IDS_PROP:()=>xr,RULE_CLASS:()=>Tr,RULE_KIND_ACTION_CONSTRAINT:()=>Ef,RULE_KIND_ACTION_EFFECT:()=>Fi,RULE_KIND_ACTION_PRECOND:()=>Ic,RULE_KIND_ACTION_SIGNATURE:()=>xf,RULE_KIND_COMPOSE2:()=>Pi,RULE_KIND_FILTER:()=>Mi,RULE_KIND_PROP:()=>Cr,RULE_KIND_RECURSIVE:()=>vf,SAID_IN_SESSION_PROP:()=>lf,SOURCE_CLASS:()=>_r,SOURCE_RELIABILITY_PROP:()=>Aw,STATED_BY_PROP:()=>kn,SYLLOGISE_STATE_REL:()=>hf,UPDATED_AT_PROP:()=>zs,UTTERANCE_CLASS:()=>af,admittedNodes:()=>gc,appendCanonicalisedFromEdges:()=>ZC,appendFact:()=>ay,appendFacts:()=>rs,appendRetractions:()=>dI,appendRule:()=>Lc,appendUtterance:()=>QC,appendUtterances:()=>ty,applySeedPayload:()=>Ow,attachFactHeads:()=>Uw,chainRollupIdFor:()=>Ad,cloneMemoryPayload:()=>Lw,closeSqliteMemoryStore:()=>Vw,createInMemoryStore:()=>Li,createSqliteMemoryStore:()=>Gw,emptyMemory:()=>Oi,factGroupId:()=>Yt,factHeadsOf:()=>Bw,factIdForTriple:()=>ye,factRecordIdForTag:()=>dC,factRecordIdsFor:()=>Oo,findContradictions:()=>uy,findRuleByName:()=>Sf,findRulesByName:()=>aI,headRollupIdFor:()=>Td,isChainRollupId:()=>Sr,isHeadRollupId:()=>Xs,isMemoryOrSqliteHandle:()=>pf,isRetractionId:()=>Fd,isRollupId:()=>ac,loadMemory:()=>ut,loadNodeId:()=>zC,loadSyllogiseState:()=>FC,normFactPredicate:()=>Jn,normFactTerm:()=>V,openConfiguredMemoryBackend:()=>Zs,openExistingMemoryBackend:()=>xC,openMemoryBackend:()=>mf,peersToConvince:()=>Wd,provSourceClassFor:()=>WC,provenanceTagToSource:()=>Hn,readFactRows:()=>mt,readObjectSupersessions:()=>yC,readOnlyMemorySnapshot:()=>EC,readRetractions:()=>uI,readRuleRows:()=>jf,removeFacts:()=>lI,resolveMemoryGraphFile:()=>Ai,resolveRelationChase:()=>kf,resolveRelationChaseReverse:()=>ly,retirableRetractions:()=>fI,retireRetractions:()=>pI,retractedAtOf:()=>To,retractedRecordIds:()=>_o,retractionFromWire:()=>hc,retractionIdFor:()=>Md,retractionScopeOf:()=>Dd,retractionWireFact:()=>mc,saveNodeId:()=>UC,saveSyllogiseState:()=>DC,snapshotMemory:()=>OC,stableRecordIds:()=>bc});function Oi(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:lC.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function Ai(e,t=null){if(Qs(e)||ss(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?te(e,rf):te(e,Rr,`graph.v${t}.json`)}function Qs(e){return!!e&&typeof e=="object"&&e.backend===ff}function ss(e){return!!e&&typeof e=="object"&&e.backend===Iw}function pf(e){return Qs(e)||ss(e)}function Li(){return{backend:ff,payload:Oi()}}function Ow(e,t){t&&(e.payload={...e.payload,...t})}function Lw(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Nw(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=wf(Hn(t));if(n)return n}return{id:_s,type:""}}function Yt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function dC(e,t){return`${e}@${Pw(t).id}`}function Pw(e){return wf(Hn(e))||{id:_s,type:""}}function Mw(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=Pw(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(_s,{sourceId:_s,sourceType:"",tags:[]}),[...t.values()]}function ef(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Hn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function Ar(e,t="",n=Math.max){return ef(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function fC(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function Fw(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Nw(n("mgx:factProvenance")),o=n(Ni).split(" ").filter(Boolean)[0]||null,r=Ei(e.id);return[e.id,Yt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(Io)||s.id,r||s.type,Number(n(r?Er:tr))||0,n(it),n(Ci)||null,o,t]}function pC(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(yt))return;let t=e.prepare(Dw);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(yt))t.run(...Fw(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function mC(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Uw(e,t){return e&&t&&(e[zw]=t),e}function gC(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function Ww(e,t,n,s){let o=e.prepare(hC),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Ts();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=mC(_f(a,c,t).assertions),u=nh(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function bC(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(yt))return;let n=Rf(Hw(e));t.exec("BEGIN IMMEDIATE");try{Ww(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function wC(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=Ts();for(let i of n){let[a,c]=i.split("\0");if(oc(c)!==$i)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(p=>{let m=_f(p,t.groups.get(p),t);return m.trust=wa(m.assertions).score,m});if(new Set(u.map(p=>p.object)).size<2)continue;let d=_d(u,$i)?.winner?.id;if(!d)continue;let f=s.get(a,c);f?.to_id!==d&&o.run(a,c,(f?.ord??-1)+1,f?.to_id||"",d,r)}}function yC(e,{subject:t,predicate:n}={}){if(!ss(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function vC(){if(_w)return;_w=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function Gw(e){vC();let{DatabaseSync:t}=await Promise.resolve().then(()=>(bw(),gw)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(uC),pC(n);let s={backend:Iw,db:n,dbPath:e};return bC(s),s}function Vw(e){ss(e)&&e.db.close()}async function mf(e,t){if(t===ff)return{dir:Li(),close:async()=>{}};let n=te(e,".tmct","memory","graph.sqlite"),s=r=>Vl(r).then(()=>!0,()=>!1);!await s(n)&&await s(te(e,rf))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
|
|
107
|
+
`),await Un(be(n),{recursive:!0});let o=await Gw(n);return{dir:o,close:async()=>Vw(o)}}async function xC(e,t=""){if(!e||typeof e!="string")return null;let n=te(e,".tmct","memory","graph.sqlite");try{await Vl(n)}catch{return null}return mf(e,t)}async function EC(e){if(!e)return null;let t=Li();return Ow(t,Lw(await ut(e))),t}async function Zs(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Ti(),Xd));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return mf(e,n)}function SC(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=Hw(e),e.cachedFactHeads=gC(e.db),e.cachedDataVersion=t),Uw(Fn(e.cachedPayload),e.cachedFactHeads)}function Hw(e){let t=e.db,n=Oi(),s=(a,c)=>{let l=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return l?JSON.parse(l.v):c},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(c=>{let l={subject:c.subject,object:c.object,subjectLabel:c.subject_label,objectLabel:c.object_label};return c.extra&&Object.assign(l,JSON.parse(c.extra)),l})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function jC(e,t){let n=Fn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function kC(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function RC(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function _C(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Fn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function TC(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function AC(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function CC(e,t){let n=e.db,s=Oi(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Fn(t.generated_at??s.generated_at),o.memory=Fn(t.memory??s.memory),o.prefixes=Fn(t.prefixes??s.prefixes),o.vocabulary=Fn(t.vocabulary??s.vocabulary),o.classes=Fn(t.classes??s.classes),o.proseIndex=Fn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),c=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,l=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare(Dw),d=new Set,f=new Set,p=new Set;for(let w of t.individuals||[]){d.add(w.id);let S=JSON.stringify(w),x=i.get(w.id);if(x&&x.json===S)continue;let A=x?x.ord:c++;l.run(w.id,A,w.class??null,w.label??null,S),w.class===yt&&(u.run(...Fw(w,S)),f.add(Yt(w.id)),p.add(tf(Ii(w,"subject"),Ii(w,"predicate")))),o&&jC(o,w)}let m=n.prepare("DELETE FROM individuals WHERE id = ?"),h=n.prepare("DELETE FROM facts WHERE id = ?"),g=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let w of n.prepare("SELECT id FROM individuals").all()){if(d.has(w.id))continue;let S=g.get(w.id);S&&(f.add(S.triple_hash),p.add(tf(S.subject,S.predicate))),m.run(w.id),h.run(w.id)}o&&kC(o,d);let b=n.prepare("SELECT ord FROM relations WHERE prop = ?"),$=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,E=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),R=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),v=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),j=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),k=new Set;for(let w of t.objectProperties||[]){k.add(w.prop);let S=R.all(w.prop),x=new Map(S.map(_=>[`${_.subject}\0${_.object}`,_])),A=new Set,L=o?RC(o,w.prop):null;for(let _ of w.examples||[]){let P=`${_.subject}\0${_.object}`;A.add(P);let G=Object.keys(_).filter(B=>!$C.has(B)),J=G.length?JSON.stringify(Object.fromEntries(G.map(B=>[B,_[B]]))):null,q=x.get(P);q&&(q.subject_label??null)===(_.subjectLabel??null)&&(q.object_label??null)===(_.objectLabel??null)&&(q.extra??null)===(J??null)||(v.run(w.prop,_.subject,_.object,_.subjectLabel??null,_.objectLabel??null,J),L&&_C(L,_,G))}for(let _ of x.keys()){if(A.has(_))continue;let[P,G]=_.split("\0");j.run(w.prop,P,G)}L&&TC(L,A);let T=Number.isFinite(w.count)?w.count:(w.examples||[]).length,O=b.get(w.prop)?.ord??$++;E.run(w.prop,O,w.predicate??null,T),L&&(L.predicate=w.predicate??null,L.count=T)}for(let w of n.prepare("SELECT prop FROM relations").all())k.has(w.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(w.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(w.prop));if(o&&AC(o,k),f.size){let w=Rf(t);Ww(n,w,f,e.cachedFactHeads),wC(n,w,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function qw(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await qo(n,t),await la(n,e)}async function Tc(e,t){await qw(e,JSON.stringify(t))}async function OC(e,{retentionVersions:t}={}){if(pf(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a memory/sqlite handle has no on-disk graph.json to snapshot");let n=Ai(e),s;try{s=await Ae(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=IC(e),r;try{r=JSON.parse(await Ae(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??nf}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??nf);let i=r.version,a=Ai(e,i);await Un(be(a),{recursive:!0}),await qw(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await Hl(Ai(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Tc(o,r),{skipped:!1,version:i,prunedVersion:c}}async function ut(e){if(Qs(e))return Jd(e.payload);if(ss(e))return Jd(SC(e));let t;try{t=await Ae(Zd(e),"utf8")}catch(n){if(n?.code==="ENOENT")return Oi();throw n}return Jd(JSON.parse(t))}function NC(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==yt||!LC.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=jo(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function PC(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===kn),n=new Map;for(let c of t?.examples||[]){if(!c?.subject)continue;let l=n.get(c.subject);l?l.push(c):n.set(c.subject,[c])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let c of e.individuals){if(c?.class!==yt||String(c.id||"").includes("@")){a.push(c);continue}let l=$=>(c.attributes||[]).find(E=>E?.prop===$)?.value||"",u=l("rdf:subject"),d=l("rdf:predicate"),f=l("rdf:object");if(!u||!d||!f){a.push(c);continue}let p=jo(u,d,f),m=l(it),h=l("mgx:factProvenance"),g=n.get(c.id)||[],b=h?Mw(h):[];for(let $ of g)b.some(E=>E.sourceId===$.object)||b.push({sourceId:$.object,sourceType:"",tags:[]});b.length||b.push({sourceId:_s,sourceType:"",tags:[]});let y=[];for(let $ of b){let E={id:`${p}@${$.sourceId}`,label:c.label,class:yt,derived_from:Fn(c.derived_from)||[],mentions:Fn(c.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:f},{prop:it,key:"createdAt",value:Ar($.tags,m,Math.min)||m||Ts()},{prop:Io,key:"sourceId",value:$.sourceId},...$.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:$.tags.join(" | ")}]:[],...l("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:l("mgx:hasProseTokens")}]:[],...l("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:l("mgx:factQuantifier")}]:[],...$.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(E),r.push(E),y.push(E.id),$.sourceId!==_s){let R=g.find(v=>v?.object===$.sourceId);i.push({...R||{},subject:E.id,object:$.sourceId,subjectLabel:E.label,objectLabel:yf($.sourceId)})}}s.add(c.id),o.set(c.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(c=>!s.has(c?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:kn,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===kn||!c?.examples?.length)continue;let l=[];for(let u of c.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],f=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let p of d)for(let m of f)l.push({...u,subject:p,object:m})}c.examples=l,c.count=l.length}e.individuals=a,Jw(e);for(let c of r)kr(e,c);return os(e),e}async function MC(e,t){if(Qs(e)){e.payload=t;return}if(ss(e)){CC(e,t);return}await Un(be(Zd(e)),{recursive:!0}),await Tc(Zd(e),t)}async function FC(e){if(Qs(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(ss(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Yw);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Ae(te(e,hf),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function DC(e,t){if(Qs(e)){e.syllogiseState=structuredClone(t);return}if(ss(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Yw,JSON.stringify(t));return}let n=te(e,hf);await Un(be(n),{recursive:!0}),await Tc(n,t)}async function zC(e){if(Qs(e))return e.nodeId||null;if(ss(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Xw);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Ae(te(e,gf),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function UC(e,t){if(Qs(e)){e.nodeId=t;return}if(ss(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Xw,JSON.stringify({nodeId:t}));return}let n=te(e,gf);await Un(be(n),{recursive:!0}),await Tc(n,{nodeId:t})}function Jw(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===_r&&n.set(a.id,a),a.class===gn&&of(r,a),a.class===yt)){let c=Yt(a.id),l=o.get(c);l?l.push(a.id):o.set(c,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===kn);for(let a of i?.examples||[]){if(!a?.subject)continue;let c=s.get(a.subject);c?c.push(a.object):s.set(a.subject,[a.object])}return e[sf]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[sf]}function of(e,t){let n=Yt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function BC(e,t){let n=Xt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===gn&&Yt(s.id)===t)}async function Cs(e,t){let n=await ut(e);Jw(n);let s=await t(n)??n;return qC(s),YC(s),s.proseIndex=Gm(s.individuals),await MC(e,s),s}function bf(e,t){return e?.attributes?.find(n=>n?.prop===it)?.value||t||Ts()}function Rn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function wf(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${kc}:${e.sessionId}`:kc,type:"operator"};case"teach":return{id:e.sessionId?`${Qd}:${e.sessionId}`:Qd,type:"teach"};case"teachNode":return{id:`${Cw}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}:${e.article}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}:${e.article}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${bi(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function WC(e){return nu[e]||null}function GC(e,t,n){let s=wf(t);if(!s)return null;let o=Xt(e),r=o?o.individualsById.get(s.id):e.individuals.find(l=>l?.id===s.id),i=bf(r,t?.createdAt||n),a={id:s.id,label:yf(s.id),class:_r,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:it,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},c=As(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Cc(e){let t=Xt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===_r&&(n[s.id]=s);return n}function Qw(e,t){let n=Xt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===kn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function VC(e,t,n=Date.now(),s={}){let o=Qw(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===it)?.value||"",{score:i,inputs:a}=th({sourceIds:o,createdAt:r},Cc(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});Rn(t,tr,"trustScore",String(i)),Rn(t,ga,"trustInputs",JSON.stringify(a)),Rn(t,zs,"updatedAt",new Date(n).toISOString())}function HC(e,t,n=Date.now(),s={}){let[o]=Qw(e,t.id),r=o?Cc(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=ba(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let l=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*l))}let c=(t.attributes||[]).find(l=>l?.prop===it)?.value||"";Rn(t,tr,"trustScore",String(a)),Rn(t,ga,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),Rn(t,zs,"updatedAt",new Date(n).toISOString())}function Zw(e,t,n,s){t?.class===yt?HC(e,t,n,s):VC(e,t,n,s)}function kr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===it)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Hn(i);if(!a)continue;let c=GC(e,a,r);c&&_c(e,{predicate:"statedBy",prop:kn},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:yf(c)})}Zw(e,t,n,s)}function qC(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===kn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==yt||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(kr(e,r,o),s=!0);s&&os(e)}function YC(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=mt(e),n=new Set;for(let a of uy(e))for(let c of a)n.add(c.id);let s=new Map;for(let a of t)for(let c of a.sourceIds){if(!KC(c))continue;let l=s.get(c)||{factsAsserted:0,factsContradicted:0};l.factsAsserted+=1,n.has(a.id)&&(l.factsContradicted+=1),s.set(c,l)}if(!s.size)return;let o=Xt(e);for(let[a,c]of s){let l=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);l&&(Rn(l,Aw,"sourceReliability",String(sh(c))),Rn(l,zs,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===kn),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let c=o?o.individualsById.get(a):e.individuals.find(l=>l?.id===a);c&&Zw(e,c)}}function XC(e,t,n){if(!ac(n?.id))return n;let s=Ei(n.id);if(!s)return Ld(t,n);let o=Cc(e);return Ld(t,n,{priorFor:r=>ba(s,o[r])})}function Tw(e,t,n){return n?.class===gn?dw(t,n):XC(e,t,n)}function As(e,t){let n=Xt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,Tw(e,o,t)),o.class===gn&&of(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===gn&&of(n.retractionsByGroup,t),t.class===yt){let r=Yt(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=Tw(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function _c(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(c=>c?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===kn?Xt(e):null;if(r){let c=r.statedByBySubject.get(s.subject);if(!c||!c.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||Ts()}),o.count=o.examples.length,c?c.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(c=>c?.subject===s.subject&&c?.object===s.object)?.createdAt||s.createdAt||Ts();if(o.examples=(o.examples||[]).filter(c=>!(c?.subject===s.subject&&c?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let c=r.statedByBySubject.get(s.subject)||[];c.includes(s.object)||c.push(s.object),r.statedByBySubject.set(s.subject,c)}}function os(e){let t=[cf,af,yt,_r,Tr];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function JC(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:cf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:it,key:"createdAt",value:n||Ts()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function ey(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!cC.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let l=String(s||""),u=js(n),d=`utt:${o}#${l}#${t}`,f=Ac(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=ha({doc:u}),m=e.individuals.find(y=>y?.id===d),h=bf(m,c||l),g={id:d,label:f,class:af,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:l},{prop:it,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...p.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:p.join(" ")}]:[]]};As(e,g);let b=JC(e,o,r);if(_c(e,{predicate:"saidInSession",prop:lf},{subject:d,object:b,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find($=>$?.id===a);y&&_c(e,{predicate:"inReplyTo",prop:uf},{subject:d,object:a,subjectLabel:f,objectLabel:y.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function QC(e,t){let n;return await Cs(e,s=>{n=ey(s,t),os(s)}),{id:n}}async function ty(e,t){let n=[];return t?.length?(await Cs(e,s=>{for(let o of t)n.push(ey(s,o));os(s)}),{ids:n}):{ids:n}}async function ZC(e,t){t?.length&&await Cs(e,n=>{for(let s of t)for(let o of Oo(n,s.factId))_c(n,{predicate:"canonicalisedFrom",prop:df},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function Oo(e,t){let n=Xt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===yt&&Yt(s.id)===t).map(s=>s.id)}function ny(e,t,n,s=""){let o=Mw(n);if(o.length===1&&o[0].sourceId===_s&&Oo(e,t).length)return[];let r=BC(e,t);if(r.length&&(o=o.filter(a=>!pc(r,`${t}@${a.sourceId}`,Ar(a.tags,s))),!o.length))return o;let i=eI(e,t);return i.length?o.filter(a=>!aw(i,a.sourceId)):o}function eI(e,t){let n=Xt(e),s=n?n.factRecordsByGroup.get(t):Oo(e,t),o=[];for(let r of s||[]){if(!Xs(r))continue;let i=Js(e,r);i&&o.push(i)}return o}function sy(e,t,{quantifier:n,environments:s}){let o=Oo(e,t).map(i=>Js(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===Ni)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(c=>c?.prop==="mgx:factJustification"));for(let a of i.length?i:o)Rn(a,"mgx:factJustification","justification",s.map(c=>c.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(Rn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function tI(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Rc)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function oy(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:c,createdAt:l,observedAt:u,quantifier:d,environments:f}=t,p=`${n}@${c.sourceId}`,m=Xt(e),h=m?m.individualsById.get(p):e.individuals.find(S=>S?.id===p),g=S=>(h?.attributes||[]).find(x=>x?.prop===S)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:ef(c.tags),observedAt:u},$=null,E=c.tags,R=y.assertedAt||l||Ts(),v=u,j=[],k=d;if(h){let S={assertedAt:ef(b),observedAt:g(Ci)};fC(y,S)?($={head:h,id:`${p}#v${tI(h)}`},j=[$.id]):(E=[...new Set([...b,...c.tags])],R=g(it)||R,v=u||g(Ci),j=g(Rc).split(" ").filter(Boolean)),k=d||g("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:yt,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:it,key:"createdAt",value:R},{prop:Io,key:"sourceId",value:c.sourceId},...E.length?[{prop:"mgx:factProvenance",key:"provenance",value:E.join(" | ")}]:[],...v?[{prop:Ci,key:"observedAt",value:v}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...k?[{prop:"mgx:factQuantifier",key:"quantifier",value:k}]:[],...f?[{prop:"mgx:factJustification",key:"justification",value:f.map(S=>S.join(" ")).join(" | ")}]:[],...j.length?[{prop:Rc,key:"supersedes",value:j.join(" ")}]:[]]},demote:$}}function nI(e,t){let n=`${t}@${_s}`,s=Xt(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function ry(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${_s}`)||nI(e,Yt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};Rn(o,Ni,"supersededBy",t.id),As(e,o),s.push(o.id)}return As(e,t),s.push(t.id),s}function Js(e,t){let n=Xt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function $f(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Xt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Yt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function iy(e,t){let n=Xt(e),s=(n?n.factRecordsByGroup.get(t):Oo(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=Js(e,u);if(!d)continue;let f=y=>(d.attributes||[]).find($=>$?.prop===y)?.value||"";if(Xs(u)){i.set(Ei(u),d);continue}if(Sr(u)){a.set(f(Io),d);continue}let p=f("mgx:factProvenance"),m=Nw(p),h=p.split(" | ").filter(Boolean),g={id:u,sourceId:f(Io)||m.id,assertedAt:Ar(h,f(it)),record:d};if(f(Ni)){let y=r.get(g.sourceId);y?y.push(g):r.set(g.sourceId,[g]);continue}if(!m.type)continue;let b=o.get(m.type);b?b.push(g):o.set(m.type,[g])}let c=Cc(e),l=[];for(let[u,d]of o){let f=rw({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>ba(u,c[p])});if(f){As(e,f.rollup),l.push(...f.absorbed);for(let p of f.absorbedSourceIds){for(let h of r.get(p)||[])l.push(h.id);r.delete(p);let m=a.get(p);m&&l.push(m.id),a.delete(p)}}}for(let[u,d]of r){let f=iw({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;As(e,f.rollup),l.push(...f.absorbed);let p=Js(e,f.rewire);p&&Rn(p,Rc,"supersedes",f.rollup.id)}return l}async function ay(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:c,ruleConfidence:l}={}){let u=V(t),d=Jn(n),f=V(s);if(!u||!d||!f)throw new Error("a fact needs subject, predicate and object");let p=jo(u,d,f),m=`${u} ${d} ${f}`,h=ha({doc:m}),g=js(a);return await Cs(e,async b=>{let y=ny(b,p,js(o),r);for(let $ of y.length?[]:sy(b,p,{quantifier:g}))kr(b,Js(b,$),void 0,{premiseTrusts:c,ruleConfidence:l});for(let $ of y){let E=oy(b,{groupId:p,s:u,p:d,o:f,label:Ac(m),tokens:h,group:$,createdAt:r,observedAt:i,quantifier:g});await Vd(E.candidate);for(let R of ry(b,E))kr(b,Js(b,R),void 0,R===E.candidate.id?{premiseTrusts:c,ruleConfidence:l}:void 0)}$f(b,iy(b,p)),os(b)}),{id:p}}function sI(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function rs(e,t){let n=[],s=0;for(let r of t||[]){let i=V(r?.subject),a=Jn(r?.predicate),c=V(r?.object);if(!i||!a||!c){s+=1;continue}let l=`${i} ${a} ${c}`;n.push({id:jo(i,a,c),s:i,p:a,o:c,text:l,tokens:ha({doc:l}),provenance:js(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:js(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:sI(r?.justification)})}let o=[];return n.length?(await Cs(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=ny(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:sy(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(f)||(a.add(f),i.push(f)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(f,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let f of d){let p=oy(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Ac(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let m of ry(r,p))a.has(m)||(a.add(m),i.push(m));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(p.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)kr(r,Js(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...iy(r,u));$f(r,l),os(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Lc(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=cy[n];if(!i)throw new Error(`a rule kind must be one of ${oI.join(", ")}, got ${JSON.stringify(n)}`);let a=V(t);if(!a)throw new Error("a rule needs a name");let c=rI[n]||new Set,l=i.map(([p])=>V(s?.[p])),u=i.filter(([p],m)=>!c.has(p)&&!l[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([p])=>p).join(" + ")}`);if(n===Fi){let p=l[i.findIndex(([h])=>h==="objectRole")],m=l[i.findIndex(([h])=>h==="value")];if(!p&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=iI(n,a,l),f=Ac(`${a} = ${n}(${l.join(", ")})`);return await Cs(e,async p=>{let m=p.individuals.find($=>$?.id===d),h=m?.attributes?.find($=>$?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),js(o)].filter(Boolean))],b=bf(m,r),y={id:d,label:f,class:Tr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Oc,key:"ruleName",value:a},{prop:Cr,key:"ruleKind",value:n},...i.map(([$,E],R)=>({prop:E,key:$,value:l[R],skip:!l[R]&&c.has($)})).filter($=>!$.skip).map(({skip:$,...E})=>E),{prop:it,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await Vd(y),As(p,y),kr(p,p.individuals.find($=>$?.id===d)),os(p)}),{id:d}}function Sf(e,t){let n=V(t);return(e?.individuals||[]).find(s=>s?.class===Tr&&(s.attributes||[]).find(o=>o?.prop===Oc)?.value===n)}function aI(e,t){let n=V(t),s=o=>(o.attributes||[]).find(r=>r?.prop===Cr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===Tr&&(o.attributes||[]).find(r=>r?.prop===Oc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function jf(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Tr)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(Cr),r=cy[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Oc)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function kf(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:c,byTrust:l,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:f}=o,p=String(t||"").trim().toLowerCase(),m=c(V,n),h=c(V,s),g=r(p).filter($=>m.has($.fact.subject)&&h.has($.fact.object));if(g.length){let $=g.slice().sort((E,R)=>l(E.fact,R.fact))[0];return{citation:[i($.fact),...$.aliasFacts.map(E=>`${a(E)}${E.provenance?` (source: ${E.provenance})`:""}`)]}}let b=Sf(e,p),y=b?.attributes?.find($=>$.prop===Cr)?.value;if(b&&y===Pi){let $=b.attributes.find(L=>L.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(L=>L.prop==="mgx:ruleBase2")?.value,R=V(n),v=V(s);if(!$||!E||!R||!v)return null;let S=f({entity:R,hopsTaken:0},L=>L.hopsTaken===2&&L.entity===v,L=>{if(L.hopsTaken>=2)return[];let T=L.hopsTaken===0?$:E;return r(T).filter(O=>O.fact.subject===L.entity).map(O=>({action:O,nextState:{entity:O.fact.object,hopsTaken:L.hopsTaken+1}}))},{maxDepth:2,stateKey:L=>`${L.entity}#${L.hopsTaken}`});if(!S)return null;let x=new Set,A=[];for(let L of S.actions){A.push(i(L.fact));for(let T of L.aliasFacts){let O=T.id||`${T.subject}|${T.predicate}|${T.object}`;x.has(O)||(x.add(O),A.push(`${a(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{citation:A}}if(b&&y===Mi){let $=b.attributes.find(w=>w.prop==="mgx:ruleBase1")?.value,E=b.attributes.find(w=>w.prop==="mgx:ruleFilterProperty")?.value;if(!$||!E)return null;let R=await kf(e,$,n,s,o);if(!R)return null;let v=V(n),j=V(E),k=u.find(w=>w.predicate===d&&w.subject===v&&V(w.object)===j);return k?{citation:[...R.citation,i(k)]}:null}return null}async function ly(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:c,rows:l,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,f=String(t||"").trim().toLowerCase(),p=a(V,n),m=o(f).filter(b=>p.has(b.fact.object));if(m.length){let b=new Map;for(let y of m)b.has(y.fact.subject)||b.set(y.fact.subject,[]),b.get(y.fact.subject).push(y);return[...b.entries()].map(([y,$])=>{let E=$.slice().sort((R,v)=>c(R.fact,v.fact))[0];return{subject:y,citation:[r(E.fact),...E.aliasFacts.map(R=>`${i(R)}${R.provenance?` (source: ${R.provenance})`:""}`)]}})}let h=Sf(e,f),g=h?.attributes?.find(b=>b.prop===Cr)?.value;if(h&&g===Pi){let b=h.attributes.find(j=>j.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(j=>j.prop==="mgx:ruleBase2")?.value,$=V(n);return!b||!y||!$?[]:d({entity:$,hopsTaken:0},j=>{if(j.hopsTaken>=2)return[];let k=j.hopsTaken===0?y:b;return o(k).filter(w=>w.fact.object===j.entity).map(w=>({action:w,nextState:{entity:w.fact.subject,hopsTaken:j.hopsTaken+1}}))},{maxDepth:2,stateKey:j=>`${j.entity}#${j.hopsTaken}`}).filter(j=>j.node.hopsTaken===2).map(({node:j,path:k})=>{let w=new Set,S=[];for(let x of k.actions.slice().reverse()){S.push(r(x.fact));for(let A of x.aliasFacts){let L=A.id||`${A.subject}|${A.predicate}|${A.object}`;w.has(L)||(w.add(L),S.push(`${i(A)}${A.provenance?` (source: ${A.provenance})`:""}`))}}return{subject:j.entity,citation:S}})}if(h&&g===Mi){let b=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!b||!y)return[];let $=await ly(e,b,n,s),E=V(y),R=[];for(let v of $){let j=V(v.subject),k=l.find(w=>w.predicate===u&&w.subject===j&&V(w.object)===E);k&&R.push({subject:v.subject,citation:[...v.citation,r(k)]})}return R}return[]}function mt(e,t={}){let n=Rf(e),s=Bw(e),o=[];for(let[r,i]of n.groups){let a=_f(r,i,n),c=s?.get(r);a.trust=wa(c?c.inputs:a.assertions,t).score,o.push(a)}return o}function Rf(e){let t=e?.individuals||[],n=new Map(t.filter(c=>c?.class===_r).map(c=>[c.id,c])),s=(e?.objectProperties||[]).find(c=>c?.prop===kn),o=new Map;for(let c of s?.examples||[])o.has(c.subject)||o.set(c.subject,[]),o.get(c.subject).push(c.object);let r=new Map,i=new Map;for(let c of t){if(c?.class===gn){let d=Yt(c.id),f=i.get(d);f?f.push(c):i.set(d,[c]);continue}if(c?.class!==yt||(c.attributes||[]).some(d=>d?.prop===Ni)||Sr(c.id))continue;let l=Yt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}for(let[c,l]of i){let u=r.get(c);if(!u)continue;let d=u.filter(f=>!pc(l,f.id,Ar(ns(f,"mgx:factProvenance").split(" | ").filter(Boolean),ns(f,it))));d.length!==u.length&&(d.length?r.set(c,d):r.delete(c))}let a=new Map;for(let[c,l]of r){l.sort((f,p)=>f.id<p.id?-1:f.id>p.id?1:0);let u=tf(Ii(l[0],"subject"),Ii(l[0],"predicate")),d=a.get(u);d?d.push(c):a.set(u,[c])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:c=>(n.get(c)?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||""}}function _f(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=ns,i=Ii,a=[],c=[],l=[],u=new Set,d=[],f=new Set,p="";for(let g of t){if(Xs(g.id)){let j=Ei(g.id),k=cc(g);for(let w of k)c.includes(w)||(c.push(w),j&&l.push(j));a.push({id:g.id,sourceId:"",sourceType:j,provenance:"",createdAt:r(g,Zn),ownTrust:Number(r(g,Er))||0,assertedAt:r(g,es),rollup:{count:Number(r(g,xi))||k.length,sourceIds:k,earliest:r(g,Zn),latest:r(g,es)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let j of b)u.add(j);let[y]=s.get(g.id)||[],$=y||r(g,Io),E=o($);y&&!c.includes(y)&&(c.push(y),E&&l.push(E));let R=r(g,it),v=r(g,Ci);a.push({id:g.id,sourceId:$,sourceType:E,provenance:b.join(" | "),createdAt:R,...v?{observedAt:v}:{},ownTrust:Number(r(g,tr))||0,assertedAt:Ar(b,R)}),p=p||i(g,"quantifier");for(let j of i(g,"justification").split(" | ")){let k=j.split(" ").filter(Boolean);if(!k.length)continue;let w=k.join(" ");f.has(w)||(f.add(w),d.push(k))}}let m=[],h=new Set;for(let g of d)for(let b of g)h.has(b)||(h.add(b),m.push(b));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:p,sourceIds:c,sourceTypes:l,environments:d,justification:m,assertions:a}}function cI(e){let t=ns(e,Io);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function lI(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||Ts();return await Cs(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(f=>{if(f?.class!==yt)return!0;let p=Yt(f.id),m=o.has(f.id)?f.id:o.has(p)?p:"";if(!m)return!0;u.add(m),l.add(f.id);let h=cI(f),g=`${p}\0${h}`,b=ns(f,"mgx:factProvenance"),y=d.get(g);return y?(y.ids.push(f.id),b&&y.tags.push(b)):d.set(g,{groupId:p,sourceId:h,ids:[f.id],tags:b?[b]:[],template:{label:f.label||"",subject:ns(f,"rdf:subject"),predicate:ns(f,"rdf:predicate"),object:ns(f,"rdf:object")}}),!1});for(let f of u)r.push(f);if(r.length){for(let f of l)i.push(f);for(let f of c.objectProperties||[]){let p=f.examples||[];f.examples=p.filter(m=>!l.has(m?.subject)&&!l.has(m?.object)),f.count=f.examples.length}for(let f of d.values()){let p=uw({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&As(c,p)}os(c)}}),{removed:r,records:i}}function uI(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==gn)continue;let s=mc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function dI(e,t){let n=[];for(let o of t||[]){let r=hc(o);r&&n.push(r)}let s=[];return n.length?(await Cs(e,o=>{let r=new Map;for(let a of n){let c=As(o,a),l=Yt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}let i=new Set;for(let[a,c]of r)for(let l of Oo(o,a)){let u=Js(o,l);if(!u)continue;let d=ns(u,"mgx:factProvenance").split(" | ").filter(Boolean);pc(c,l,Ar(d,ns(u,it)))&&i.add(l)}if(i.size){$f(o,i);for(let a of i)s.push(a)}os(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function fI(e,{self:t="",acknowledgedBy:n=null}={}){let s=gc(mt(e)),o=[];for(let r of e?.individuals||[])r?.class===gn&&r.id&&o.push(r.id);return{roster:s,retirable:bc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function pI(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Cs(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==gn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Xt(o);if(i)for(let a of r){i.individualsById.delete(a);let c=Yt(a),l=(i.retractionsByGroup.get(c)||[]).filter(u=>!r.has(u.id));l.length?i.retractionsByGroup.set(c,l):i.retractionsByGroup.delete(c)}os(o)}),{retired:s}):{retired:s}}function uy(e,{floor:t=mI}={}){let n=mt(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(oc(r.predicate)===jd)continue;let i=`${r.subject} ${r.predicate}`;s.has(i)||s.set(i,[]),s.get(i).push(r)}let o=[];for(let r of s.values()){if(new Set(r.map(a=>a.object)).size<2)continue;let i=oc(r[0].predicate);i!==kd&&!_d(r,i).contested||o.push(r.slice().sort((a,c)=>c.trust-a.trust||a.object.localeCompare(c.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var Rr,rf,af,yt,cf,_r,Tr,lf,uf,aC,kn,df,Aw,kc,Qd,Cw,cC,Rw,lC,Zd,ff,Iw,uC,_s,Ci,Io,Rc,Ni,Dw,ns,Ii,tf,zw,Bw,hC,$C,_w,Fn,Kw,nf,IC,Jd,LC,hf,Yw,gf,Xw,sf,Xt,Ac,Ts,yf,KC,Pi,Mi,vf,xf,Ic,Fi,Ef,oI,Oc,Cr,cy,rI,iI,mI,Ir,hI,gI,qe=N(()=>{Lt();Ye();Ds();nt();nt();qn();Yb();qn();sc();Nd();Ud();Gd();hw();Nd();Ud();Gd();Rr=te(".tmct","memory"),rf=te(Rr,"graph.json"),af="Utterance",yt="Fact",cf="Session",_r="Source",Tr="Rule",lf="mgx:saidInSession",uf="mgx:inReplyTo",aC="mgx:derivedFrom",kn="mgx:statedBy",df="mgx:canonicalisedFrom",Aw="mgx:sourceReliability",kc="src:operator-chat",Qd="src:teach-chat",Cw="src:teach-node",cC=new Set(["visitor","tmct"]),Rw=48,lC=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:lf,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:uf,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:it,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:zs,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:aC,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:kn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:df,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:tr,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:ga,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:wr,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];Zd=e=>Ai(e),ff="memory",Iw="sqlite";uC=`
|
|
108
108
|
CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v TEXT NOT NULL);
|
|
109
109
|
CREATE TABLE IF NOT EXISTS individuals (id TEXT PRIMARY KEY, ord INTEGER NOT NULL, class TEXT, label TEXT, json TEXT NOT NULL);
|
|
110
110
|
CREATE TABLE IF NOT EXISTS relations (prop TEXT PRIMARY KEY, ord INTEGER NOT NULL, predicate TEXT, count INTEGER);
|
|
@@ -143,89 +143,89 @@ CREATE TABLE IF NOT EXISTS fact_object_supersessions (
|
|
|
143
143
|
recorded_at TEXT NOT NULL,
|
|
144
144
|
PRIMARY KEY (subject, predicate, ord)
|
|
145
145
|
);
|
|
146
|
-
`,
|
|
147
|
-
\u2026+${o.length
|
|
146
|
+
`,_s="src:none",Ci="mgx:observedAt",Io="mgx:sourceId",Rc="mgx:supersedes",Ni="mgx:supersededBy";Dw="INSERT OR REPLACE INTO facts(id, triple_hash, subject, predicate, object, source_id, source_type, trust_score, created_at, observed_at, superseded_by, json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";ns=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Ii=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",tf=(e,t)=>`${e}\0${t}`;zw=Symbol("materialised fact_heads index");Bw=e=>e?.[zw]||null,hC="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";$C=new Set(["subject","object","subjectLabel","objectLabel"]),_w=!1;Fn=e=>e===void 0?e:structuredClone(e);Kw=te(Rr,"manifest.json"),nf=5,IC=e=>te(e,Kw);Jd=e=>PC(NC(e)),LC=/^fact:[0-9a-f]{8}$/;hf=te(Rr,"syllogise-state.json"),Yw="syllogiseState";gf=te(Rr,"node-id.json"),Xw="nodeId";sf=Symbol("mutateMemory lookup index");Xt=e=>e?.[sf]||null;Ac=e=>e.length>Rw?e.slice(0,Rw-1)+"\u2026":e,Ts=()=>new Date().toISOString();yf=e=>String(e).replace(/^src:/,"");KC=e=>typeof e=="string"&&(e.startsWith(`${kc}:`)||e.startsWith(`${Qd}:`)||e.startsWith(`${Cw}:`));Pi="compose2",Mi="filter",vf="recursive",xf="action-signature",Ic="action-precond",Fi="action-effect",Ef="action-constraint",oI=Object.freeze([Pi,Mi,vf,xf,Ic,Fi,Ef]),Oc="mgx:ruleName",Cr="mgx:ruleKind",cy={[Pi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[Mi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[vf]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[xf]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Ic]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[Fi]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Ef]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},rI={[Ic]:new Set(["value","negate"]),[Fi]:new Set(["objectRole","value"])},iI=(e,t,n)=>`rule:${bi([e,t,...n].join("\0"))}`;mI=.5,Ir="mgx:hasA",hI="mgx:capableOf",gI=Rd});async function _n(e,t=null){try{if(t)return mt(await ut(t));let{dir:n,close:s}=await Zs(be(be(e.graphFile)));try{return mt(await ut(n))}finally{await s()}}catch{return[]}}function fy(e){let t=[...new Set(e.map(s=>s.provenance).filter(Boolean))];return t.length?`provenance: ${t.slice(0,2).join("; ")}${t.length>2?`, +${t.length-2} more source(s)`:""}`:"provenance: memory/corpus facts"}function Nc(e,t){let n=V(t),s=e.filter(a=>dy.has(a.predicate)&&a.object===n);if(!s.length)return null;let o=[...new Set(s.map(a=>a.subject))].sort(),r=o.slice(0,Lo),i=o.length>Lo?`
|
|
147
|
+
\u2026+${o.length-Lo} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
|
|
148
148
|
${r.join(`
|
|
149
149
|
`)}${i}
|
|
150
|
-
(${
|
|
151
|
-
`)}var
|
|
152
|
-
\u2026 (truncated to ${
|
|
153
|
-
(other matches: ${i.map(
|
|
154
|
-
${
|
|
155
|
-
${
|
|
156
|
-
`),data:o})}var Iw=C(()=>{Kt();pc();vo();Ke();Vd.ownsGraphLoad=!0});function gI(e,t){let n=[];for(let s of t||[])s?.predicate===sI&&G(s.subject)===e&&n.push(G(s.object));return n}function fc(e,t){let n=G(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of gI(i,t))s.has(a)||o.push(a)}}return r}var sI,oI,rI,iI,aI,cI,lI,uI,dI,pI,fI,hI,mI,Cw,Hd=C(()=>{Lt();sI="rdfs:subClassOf",oI='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',rI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',iI='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',aI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',cI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',lI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',uI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',dI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',pI='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',fI='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',hI='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',mI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',Cw=Object.freeze({spider:oI,fly:rI,egg:iI,poodle:aI,dog:cI,animal:lI,room:uI,furniture:dI,portable:pI,person:fI,adventurer:hI,container:mI})});function bI(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function Ow(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of bI(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var Lw=C(()=>{});function wI(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function yI(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function Fw(e){return yI(e).filter(t=>t?.property&&t.value!==void 0)}function $I(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function vI(e,t){let n=null,s=0;for(let o of e){let r=Fw(o);r.length<=s||$I(r,t)&&(n=o,s=r.length)}return n}function xI(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function Nw(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(l=>l.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,l.object));if(!i)continue;let a=xI(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function EI(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function Pw(e,t){let n=t;for(let s of EI(e))n=n.split(s).join("");return n}function Mw(e,t,n){let s=wI(e,n),o=vI(s,t);if(o&&!o.parameters)return o.svg;if(o)return Pw(o,Nw(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let l=Nw(a,t);if(l)return l}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?Pw(i,i.svg):null}function SI(e,t,n,s,o,r){for(let a of fc(e,t)){let l=Mw(a,n,s);if(l)return l;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Mw(r,n,s);return i||o[r]}function Dw(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=SI(e,t,n,s,o,r);return i?Ow(a,i):a}var ED,SD,qd=C(()=>{Hd();Lw();ED=Object.freeze(["left","half-left","half-right","right"]),SD=Object.freeze(["moving"])});function vi(e){for(let t of e||[])if(t?.predicate===kI&&Object.prototype.hasOwnProperty.call(zw,t.object))return zw[t.object];return 1}var kI,zw,Kd=C(()=>{kI="mgx:hasProperty",zw=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function Uw(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},l=a.resolveSpriteAsset;if(typeof l!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let c=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],p=a.rootFallback||"animal",f=a.classAncestorChain,h=a.sizeScaleFor,m=a.expressionPalette,b=[];r&&b.push({predicate:n,object:r}),i&&b.push({predicate:s,object:i});let g={rootFallback:p};a.instanceKey&&(g.instanceKey=a.instanceKey);let y=l(o,d,b,c,u,g),w=_=>l(_,[],b,c,{},{rootFallback:_}),v=_=>Object.prototype.hasOwnProperty.call(u,_),k=(_,R)=>{let T=c.filter(D=>D&&Array.isArray(D.classes)&&D.classes.indexOf(_)>=0),I=T.find(D=>D.svg===R)||T.find(D=>!D.match&&D.parameters)||null;return I?{classes:I.classes.slice(),parameters:Object.keys(I.parameters||{}).sort(),match:I.match||null}:null},$=null,x=null;if(typeof f=="function"){$=[];for(let _ of f(o,d)){let R=w(_);if($.push({term:_,template:!!R,registry:v(_)}),R){x={term:_,via:"template",hops:$.length-1,root:!1,template:k(_,R)};break}if(v(_)){x={term:_,via:"registry",hops:$.length-1,root:!1,template:null};break}}if(!x){let _=w(p);$.push({term:p,template:!!_,registry:v(p),root:!0}),x={term:p,via:_?"template":"registry",hops:$.length-1,root:!0,template:_?k(p,_):null}}}let E=a.instanceKey?l(o,d,b,c,u,{rootFallback:p}):y,S=r?l(o,d,b.filter(_=>_.predicate!==n),c,u,{rootFallback:p}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof h=="function"?h(b):1,sizeKnown:i&&typeof h=="function"?h([{predicate:s,object:i}])!==1:null,expressionKnown:r&&m?Object.prototype.hasOwnProperty.call(m,r):null,expressionApplied:r?E!==S:null,rootFallback:p,fellBackToRoot:x?!!x.root:null,chain:$,matched:x}}var Bw=C(()=>{});var Ww,Gw,jI,TD,Vw=C(()=>{qd();Ww="icon tier",Gw="sprite tier",jI=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),TD=Object.freeze(Object.values(jI).map(e=>e.predicate))});var Hw,qw=C(()=>{Hw=()=>[]});var Kw,Yw=C(()=>{Kw=()=>[]});function AI(){let e=Kw();return e.length?{templates:e,tier:Gw}:{templates:Hw(),tier:Ww}}function Xw(e){return e.map(t=>t.term).join(" -> ")}async function Yd(e,{config:t,memoryBackend:n=null}){let s=st(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(ks,o))throw new Ae(`"${o}" is not a sprite expression. The palette holds: ${_I().join(", ")}.`);if(r&&!TI(r))throw new Ae(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=AI(),l=await wn(t,n),c=Uw({class:s,expression:o,size:r},{factRows:l,templates:i,spriteRegistry:Cw,resolveSpriteAsset:Dw,classAncestorChain:fc,sizeScaleFor:vi,expressionPalette:ks});if(!c.svg||c.fellBackToRoot)throw new Ae(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${Xw(c.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!c.expressionApplied)throw new Ae(`the ${a} draws "${s}" (matched at "${c.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,c.matched.hops===0?`matched at "${c.matched.term}", the class itself, via its own ${c.matched.via}`:`matched at "${c.matched.term}", ${c.matched.hops} hop(s) up the ancestor chain, via its ${c.matched.via}`,`ancestor chain walked: ${Xw(c.chain)}`];return c.matched.template?.parameters.length&&d.push(`template parameters: ${c.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${c.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${c.svg.length} characters of SVG markup`),Ns({content:d.join(`
|
|
157
|
-
`),data:{class:
|
|
150
|
+
(${fy(s)})`}function Pc(e,t){let n=V(t),s=e.filter(a=>dy.has(a.predicate)&&(a.subject===n||a.object===n));if(!s.length)return null;let o=[...new Set(s.filter(a=>a.subject===n).map(a=>a.object))],r=[...new Set(s.filter(a=>a.object===n).map(a=>a.subject))].sort(),i=[`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts.`];if(o.length&&i.push(`is a: ${o.slice(0,Lo).join(", ")}`),r.length){let a=r.length>Lo?`, +${r.length-Lo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,Lo).join(", ")}${a}`)}return i.push(`(${fy(s)})`),i.join(`
|
|
151
|
+
`)}var dy,Lo,No=N(()=>{Ye();qe();dy=new Set(["rdfs:subClassOf","rdf:type"]),Lo=40});async function py(e,{graph:t,svc:n,config:s}){let o=lt(e,"symbol"),{match:r,candidates:i}=hn(n.graph,o);if(r)return fu(t,r,{candidates:i});let a=Pc(await _n(s),o);if(a)return a;Nt(n,o,"symbol")}var my=N(()=>{Me();No();Qe()});async function hy(e,{graph:t,svc:n,repoRoot:s}){let o=lt(e,"symbol"),{match:r,candidates:i}=Nt(n,o,"symbol"),a=Bt(r);if(!a)throw new Ie(`"${r.label}" (${r.class||"Entity"}) has no source span in the graph \u2014 it is likely a module. Use tmct_describe for its contents, then tmct_snippet one of the functions/classes it defines.`);let c;try{c=await Ss({readFile:Ae,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:gi})}catch(g){throw g instanceof Ie?g:new Ie(`could not read ${a.path} (${g?.code||g?.message||g})`)}let{text:l,truncated:u}=c,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,f=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,p=u?`
|
|
152
|
+
\u2026 (truncated to ${gi} lines; full span ${d})`:"",m=i.length?`
|
|
153
|
+
(other matches: ${i.map(g=>g.label).join(", ")})`:"",h=hu(t,r);return`${f}
|
|
154
|
+
${l}${p}${h?`
|
|
155
|
+
${h}`:""}${m}`}var gy=N(()=>{Lt();Kt();Ha();Me();Qe()});var by,wy=N(()=>{Me();Qe();by=pt(Ch)});function yy(e,{graph:t,svc:n}){let{match:s}=Nt(n,lt(e,"module"),"module");return $h(t,s)}var $y=N(()=>{Me();Qe()});async function vy(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Ie("query is required");let r=Th(t,s,{kind:o,decorator:String(e?.decorator||"").trim(),name:String(e?.name||"").trim(),toolNamePrefix:n?.toolNamePrefix});if(!o&&/^no module matches/.test(r)){let i=Pc(await _n(n),s);if(i)return i}return r}var xy=N(()=>{Kt();Me();No()});async function Ey(e,{graph:t,svc:n,config:s}){let o=lt(e,"class"),{match:r}=hn(n.graph,o);if(r)return Ah(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Nc(await _n(s),o);if(i)return i;Nt(n,o,"class")}var Sy=N(()=>{Me();No();Qe()});async function jy(e,{graph:t,svc:n,config:s}){let o=lt(e,"class"),{match:r}=hn(n.graph,o);if(r)return Ih(t,r);let i=Nc(await _n(s),o);if(i)return i;Nt(n,o,"class")}var ky=N(()=>{Me();No();Qe()});function Ry(e,{conceptBase:t="concept:",relationMap:n=wI}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=g=>{r.has(g)||r.set(g,g)},a=g=>{let b=g;for(;r.get(b)!==b;)b=r.get(b);for(;r.get(g)!==b;){let y=r.get(g);r.set(g,b),g=y}return b},c=(g,b)=>{let y=a(g),$=a(b);y!==$&&(y<$?r.set($,y):r.set(y,$))},l=[];for(let g of e){let b=g.predicate;if(!s.has(b)&&!o.has(b))continue;let y=V(g.subject),$=V(g.object);!y||!$||(i(y),i($),s.has(b)?c(y,$):l.push({s:y,o:$}))}let u=g=>t+g.replace(/ /g,"_"),d=new Map;for(let g of r.keys()){let b=a(g);d.has(b)||d.set(b,new Set),d.get(b).add(g)}let f=[];for(let[g,b]of d){let y=[...b].sort();f.push({id:u(g),prefLabel:g,altLabels:y.filter($=>$!==g)})}f.sort((g,b)=>g.id<b.id?-1:g.id>b.id?1:0);let p=new Set,m=[];for(let{s:g,o:b}of l){let y=u(a(g)),$=u(a(b));if(y===$)continue;let E=y<$?`${y}\0${$}`:`${$}\0${y}`;p.has(E)||(p.add(E),m.push({subject:y,object:$}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:f,related:m,conceptIdForTerm:g=>{let b=V(g);return r.has(b)?u(a(b)):null},namespace:bI}}function Tf(e,t,n={}){let s=Ry(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=V(t),c=[i.prefLabel,...i.altLabels].filter(u=>u!==a),l=s.related.filter(u=>u.subject===o||u.object===o).map(u=>r.get(u.subject===o?u.object:u.subject)).filter(Boolean);return{conceptId:o,prefLabel:i.prefLabel,altLabels:i.altLabels,synonyms:c,related:l}}var bI,wI,Mc=N(()=>{nt();bI="http://www.w3.org/2004/02/skos/core#",wI={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Af(e,{config:t,memoryBackend:n=null}){let s=lt(e,"term"),o=Tf(await _n(t,n),s);if(!o)throw new Ie(`no synonym or related facts for "${s}" in the memory graph. This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).`);let r=[`${o.prefLabel} [${o.conceptId}]`];return o.synonyms.length&&r.push(`synonyms (skos:altLabel): ${o.synonyms.join(", ")}`),o.related.length&&r.push(`related (skos:related): ${o.related.map(i=>i.prefLabel).join(", ")}`),r.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)"),Ks({content:r.join(`
|
|
156
|
+
`),data:o})}var _y=N(()=>{Kt();Mc();No();Qe();Af.ownsGraphLoad=!0});function II(e,t){let n=[];for(let s of t||[])s?.predicate===yI&&V(s.subject)===e&&n.push(V(s.object));return n}function Fc(e,t){let n=V(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of II(i,t))s.has(a)||o.push(a)}}return r}var yI,$I,vI,xI,EI,SI,jI,kI,RI,_I,TI,AI,CI,Ty,Cf=N(()=>{nt();yI="rdfs:subClassOf",$I='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',vI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',xI='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',EI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',SI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',jI='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',kI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',RI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',_I='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',TI='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',AI='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',CI='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',Ty=Object.freeze({spider:$I,fly:vI,egg:xI,poodle:EI,dog:SI,animal:jI,room:kI,furniture:RI,portable:_I,person:TI,adventurer:AI,container:CI})});function OI(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function Ay(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of OI(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var Cy=N(()=>{});function LI(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function NI(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function Ny(e){return NI(e).filter(t=>t?.property&&t.value!==void 0)}function PI(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function MI(e,t){let n=null,s=0;for(let o of e){let r=Ny(o);r.length<=s||PI(r,t)&&(n=o,s=r.length)}return n}function FI(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function Iy(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(c=>c.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,c.object));if(!i)continue;let a=FI(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function DI(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function Oy(e,t){let n=t;for(let s of DI(e))n=n.split(s).join("");return n}function Ly(e,t,n){let s=LI(e,n),o=MI(s,t);if(o&&!o.parameters)return o.svg;if(o)return Oy(o,Iy(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=Iy(a,t);if(c)return c}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?Oy(i,i.svg):null}function zI(e,t,n,s,o,r){for(let a of Fc(e,t)){let c=Ly(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Ly(r,n,s);return i||o[r]}function Py(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=zI(e,t,n,s,o,r);return i?Ay(a,i):a}var KU,YU,If=N(()=>{Cf();Cy();KU=Object.freeze(["left","half-left","half-right","right"]),YU=Object.freeze(["moving"])});function Di(e){for(let t of e||[])if(t?.predicate===UI&&Object.prototype.hasOwnProperty.call(My,t.object))return My[t.object];return 1}var UI,My,Of=N(()=>{UI="mgx:hasProperty",My=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function Fy(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},c=a.resolveSpriteAsset;if(typeof c!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let l=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],f=a.rootFallback||"animal",p=a.classAncestorChain,m=a.sizeScaleFor,h=a.expressionPalette,g=[];r&&g.push({predicate:n,object:r}),i&&g.push({predicate:s,object:i});let b={rootFallback:f};a.instanceKey&&(b.instanceKey=a.instanceKey);let y=c(o,d,g,l,u,b),$=S=>c(S,[],g,l,{},{rootFallback:S}),E=S=>Object.prototype.hasOwnProperty.call(u,S),R=(S,x)=>{let A=l.filter(O=>O&&Array.isArray(O.classes)&&O.classes.indexOf(S)>=0),T=A.find(O=>O.svg===x)||A.find(O=>!O.match&&O.parameters)||null;return T?{classes:T.classes.slice(),parameters:Object.keys(T.parameters||{}).sort(),match:T.match||null}:null},v=null,j=null;if(typeof p=="function"){v=[];for(let S of p(o,d)){let x=$(S);if(v.push({term:S,template:!!x,registry:E(S)}),x){j={term:S,via:"template",hops:v.length-1,root:!1,template:R(S,x)};break}if(E(S)){j={term:S,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!j){let S=$(f);v.push({term:f,template:!!S,registry:E(f),root:!0}),j={term:f,via:S?"template":"registry",hops:v.length-1,root:!0,template:S?R(f,S):null}}}let k=a.instanceKey?c(o,d,g,l,u,{rootFallback:f}):y,w=r?c(o,d,g.filter(S=>S.predicate!==n),l,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof m=="function"?m(g):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?k!==w:null,rootFallback:f,fellBackToRoot:j?!!j.root:null,chain:v,matched:j}}var Dy=N(()=>{});var zy,Uy,BI,eB,By=N(()=>{If();zy="icon tier",Uy="sprite tier",BI=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),eB=Object.freeze(Object.values(BI).map(e=>e.predicate))});var Wy,Gy=N(()=>{Wy=()=>[]});var Vy,Hy=N(()=>{Vy=()=>[]});function HI(){let e=Vy();return e.length?{templates:e,tier:Uy}:{templates:Wy(),tier:zy}}function qy(e){return e.map(t=>t.term).join(" -> ")}async function Lf(e,{config:t,memoryBackend:n=null}){let s=lt(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Fs,o))throw new Ie(`"${o}" is not a sprite expression. The palette holds: ${GI().join(", ")}.`);if(r&&!VI(r))throw new Ie(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=HI(),c=await _n(t,n),l=Fy({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:Ty,resolveSpriteAsset:Py,classAncestorChain:Fc,sizeScaleFor:Di,expressionPalette:Fs});if(!l.svg||l.fellBackToRoot)throw new Ie(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${qy(l.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!l.expressionApplied)throw new Ie(`the ${a} draws "${s}" (matched at "${l.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,l.matched.hops===0?`matched at "${l.matched.term}", the class itself, via its own ${l.matched.via}`:`matched at "${l.matched.term}", ${l.matched.hops} hop(s) up the ancestor chain, via its ${l.matched.via}`,`ancestor chain walked: ${qy(l.chain)}`];return l.matched.template?.parameters.length&&d.push(`template parameters: ${l.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${l.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${l.svg.length} characters of SVG markup`),Ks({content:d.join(`
|
|
157
|
+
`),data:{class:l.class,expression:l.expression,size:l.size,tier:a,scale:l.scale,svg:l.svg,chain:l.chain,matched:l.matched,expressionApplied:l.expressionApplied}})}var WI,GI,VI,Ky=N(()=>{Kt();Cf();If();pa();Of();Dy();By();Gy();Hy();No();Qe();WI="mgx:hasProperty",GI=()=>Object.keys(Fs).sort(),VI=e=>!!e&&Di([{predicate:WI,object:String(e)}])!==1;Lf.ownsGraphLoad=!0});function Yy(e,{graph:t}){return Oh(t,{pkg:String(e?.package||"").trim()})}var Xy=N(()=>{Me()});function Jy(e,{graph:t,svc:n}){let{match:s}=Nt(n,lt(e,"module"),"module");return eg(t,s)}var Qy=N(()=>{Me();Qe()});function Zy(e,{graph:t,codeDomainActive:n=null}){return Ph(t,{codeDomainActive:n})}var e$=N(()=>{Me()});function n$(e,t){return Ks({content:e,data:t,text:`${e}${t$}${JSON.stringify(t,null,2)}`})}function s$(e,{graph:t}){let{content:n,tmct_ask:s}=Hs(t,lt(e,"query"));return n$(n,s)}var t$,Dc=N(()=>{Yn();Qe();t$=`
|
|
158
158
|
|
|
159
159
|
---tmct_ask---
|
|
160
|
-
`});var
|
|
160
|
+
`});var o$,r$=N(()=>{Me();Qe();o$=pt(Nh)});var i$,a$=N(()=>{Me();Qe();i$=pt(Mh)});var c$,l$=N(()=>{Me();Qe();c$=pt(Gh)});var u$,d$=N(()=>{Me();Qe();u$=pt(Hh)});var f$,p$=N(()=>{Me();Qe();f$=pt(qh)});var m$,h$=N(()=>{Me();Qe();m$=pt(Dh)});var g$,b$=N(()=>{Me();Qe();g$=pt(zh)});var w$,y$=N(()=>{Me();Qe();w$=pt(Bh)});var $$,v$=N(()=>{Me();Qe();$$=pt(Zh)});function qI(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function KI(e){let t=(e||[]).map(qI);return t.map(n=>JSON.stringify(n)).join(`
|
|
161
161
|
`)+(t.length?`
|
|
162
|
-
`:"")}function
|
|
162
|
+
`:"")}function x$(e){return KI(mt(e))}var E$=N(()=>{qe()});async function Nf(e,{config:t,memoryBackend:n=null}){let s=n?null:await Zs(be(be(t.graphFile))),o=n||s.dir;try{return x$(await ut(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var S$=N(()=>{E$();Ye();qe();Nf.ownsGraphLoad=!0});async function Pf(e,{config:t,ingest:n}){let s=String(e?.text??"");if(!s.trim())return"(nothing to ingest \u2014 pass some text)";if(typeof n!="function")return"(ingest isn't wired into this context \u2014 invoke tmct_ingest through the CLI `cli` route or the chat surface)";let o=e?.optimistic===!0,{dir:r,close:i}=await Zs(be(be(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0}),c=a.extracted.length+a.optimistic.length,l=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${c} fact(s) grounded.`;return Ks({content:c?`${l}
|
|
163
163
|
${a.canonical.join(`
|
|
164
|
-
`)}`:
|
|
165
|
-
`);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(
|
|
166
|
-
`);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(l=>l.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:np(i)})}}return{patterns:n,synonyms:s}}var DI,Oy,Ly,Ny,NI,Py,tp,PI,xi,wc=C(()=>{Tt();Bs();Ve();DI={},Oy=Z(me(Pt(DI.url)),"..","..",".."),Ly=Z(Oy,"data","templates","responses.jsonl"),Ny=Z(Oy,"data","phrasebook","software-phrases.txt"),NI=new Set(["terse","friendly","technical"]),Py=/\{([A-Za-z][A-Za-z0-9]*)\}/g,tp=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));PI={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};xi=null});function UI(e,t={}){let n=zI.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function BI(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>UI(s,t))):1}function Qe(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:BI(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var zI,Uy=C(()=>{zI=/^src:corpus:(.+)$/});var bt,RU,wr,_U,TU,AU,IU,CU,OU,LU,NU,PU,MU,FU,DU,By,WI,zU,UU,BU,xo=C(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},RU=bt("createRequire"),wr=bt("readFileSync"),_U=bt("access"),TU=bt("readFile"),AU=bt("writeFile"),IU=bt("appendFile"),CU=bt("mkdir"),OU=bt("mkdtemp"),LU=bt("rename"),NU=bt("unlink"),PU=bt("rm"),MU=bt("stat"),FU=bt("copyFile"),DU=bt("readdir"),By=bt("createReadStream"),WI=bt("createWriteStream"),zU=bt("randomBytes"),UU=bt("spawnSync"),BU=bt("createInterface")});function Wy(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function qI(e=VI){let t=bo(wr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function rp(){if(yc===null)try{yc=qI()}catch{yc=[]}return yc}var KI,GI,VI,HI,YU,yc,ip=C(()=>{xo();Bs();Ve();Xa();wc();KI={},GI=me(Pt(KI.url)),VI=Z(GI,"..","..","data","templates","grammar-rules.toml"),HI=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),YU=Object.freeze(new Set(HI.filter(e=>e!=="prose")));yc=null});function YI(){if(Ei!==void 0)return Ei;try{let e=Gy?Gy():XI();Ei=e&&e.winkNLP&&e.model?e:null}catch{Ei=null}return Ei}function XI(){let e=process.getBuiltinModule("node:module").createRequire(JI.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function ap(){if(yr!==void 0)return yr;let e=YI();if(!e)return yr=null,null;try{yr=e.winkNLP(e.model)}catch{yr=null}return yr}var JI,Gy,Ei,yr,cp=C(()=>{JI={}});var Vy=C(()=>{cp()});var qy,Hy=C(()=>{qy={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var t$={};qt(t$,{CODE_REF_SHAPE:()=>xc,DETERMINERS:()=>up,OF_CLASSIFIER_HEADS:()=>Xy,OF_PARTITIVE_HEADS:()=>Jy,QUANTIFIERS:()=>dp,classify:()=>mp,loadLexicon:()=>_n,lookupAdjective:()=>vc,lookupNoun:()=>Kn,lookupProperName:()=>Si,lookupVerb:()=>$c,numberOf:()=>pp,predicateOf:()=>fp,readsAsIndividualName:()=>hp,thirdPerson:()=>Qy,withProperNames:()=>e$});function pp(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):ZI[t]??null}function Qy(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function fp(e,t=Yy){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${Qy(e.lemma)}${n}`}function Zy(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function Ky(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!eC.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!tC.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function _n(e,t=Yy){if(!e&&lp.has(t))return lp.get(t);let n=qy,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return Ky(s,n),e?(Ky(s,e),s):(lp.set(t,s),s)}function e$(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function Kn(e,t,n={}){return nC(e,t,n)[0]??null}function nC(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,l=c=>{c&&!a.has(c.lemma)&&(a.add(c.lemma),i.push(c))};if(r){let c=e.nouns.get(r)??null;return n.singularOnly&&o?(l(o),l(c)):(l(c),l(o)),i}for(let c of Zy(s))l(e.nouns.get(c));return i}function $c(e,t){return sC(e,t)[0]??null}function sC(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of Zy(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function vc(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function Si(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function hp(e,t){let n=String(e??"");if(!n)return!1;if(Si(t,n)||xc.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=Kn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function mp(e,t=_n()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(up[s])return{pos:"determiner",type:up[s]};if(dp[s])return{pos:"quantifier",type:dp[s]};let o=pp(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=Si(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=Kn(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=$c(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:fp(a,t.ns),...a.prep?{prep:a.prep}:{}};let l=vc(t,s);return l?{pos:"adjective",type:l.type,lemma:l.lemma}:null}var Yy,up,dp,Xy,Jy,ZI,eC,tC,lp,xc,Ws=C(()=>{Hy();Yy="tmct:",up=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),dp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),Xy=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Jy=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),ZI=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});eC=new Set(["data","object"]),tC=new Set(["subclass","data"]);lp=new Map;xc=/[./\\#:@]/});var oB,rB,iB,oC,aB,cB,lB,n$=C(()=>{Pn();Pe();oB=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),rB=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),iB=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),oC=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),aB=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),cB=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),lB=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function ki(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function Sc(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function iC(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function o$(e,t){let n=Kn(t,e);return n?G(n.lemma):e}function r$(e,t){let n=iC(String(e??"")).match(rC);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(aC.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),p=d&&o$(d,t);if(p&&(lC.has(p)||uC.has(p))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&cC.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=o$(i,t);if(s$.has(i)||s$.has(a))return null;let l=Kn(t,i);if(!l)return null;let c=G(l.lemma);return s&&(!/s$/.test(i)||G(i)===c)?null:c}var Ec,rC,aC,s$,cC,lC,uC,$r=C(()=>{Lt();Ws();n$();Ec=400;rC=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;aC=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),s$=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),cC=new Set(["a","an","the"]),lC=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),uC=new Set(["either","one","each","both","any"])});var kc,jc=C(()=>{kc=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var dC,xB,i$=C(()=>{xo();jc();Bs();Ve();$r();dC={},xB=Z(me(Pt(dC.url)),"..","..","..")});function fC(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return pC.includes(e.predicate)}function a$(e){return ki(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(fC):!1}function ji(e,t){return`research:${e}:${G(t)}`}function Rc(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");hC.set(e.name,{name:e.name,create:e.create})}var pC,hC,jB,RB,Ri=C(()=>{Lt();$r();pC=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);hC=new Map;jB=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),RB=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function _c({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1,validators:i=null}={}){let a=e??((...$)=>globalThis.fetch(...$)),l=new Map,c=0,u=0,d=!1,p=()=>{if(!o)return null;let $={"Api-User-Agent":o};return typeof document>"u"&&($["User-Agent"]=o),$};function f($){let x=Number($)*1e3;u=Date.now()+Math.max(x||0,s)}function h($){let x=i?.get($);if(!x)return null;let E={};return x.etag&&(E["If-None-Match"]=x.etag),x.lastModified&&(E["If-Modified-Since"]=x.lastModified),Object.keys(E).length?E:null}function m($,x){if(!i)return;let E=x.headers?.get?.("etag")??"",S=x.headers?.get?.("last-modified")??"";if(!E&&!S)return;let _=i.get($)??{};i.set($,{etag:E||_.etag||"",lastModified:S||_.lastModified||""})}async function b($,{asJson:x}){let E=typeof AbortController=="function"?new AbortController:null,S=E?setTimeout(()=>E.abort(),t):null;try{let _={};E&&(_.signal=E.signal);let R={...p()??{},...h($)??{}};Object.keys(R).length&&(_.headers=R);let T=await a($,_);if(T.status===429)return f(T.headers?.get?.("retry-after")),null;if(T.status===304)return i?{notModified:!0}:null;if(!T.ok)return null;if(m($,T),x){let M=await T.json();return M?.error?.code==="maxlag"?(f(T.headers?.get?.("retry-after")),null):M}return await T.text()}catch{return null}finally{S!==null&&clearTimeout(S)}}async function g($){return b($,{asJson:!0})}async function y($){return b($,{asJson:!1})}let w=()=>Math.max(u,c+n);async function v(){for(;;){let $=Date.now();if(!d&&$>=w())return c=$,d=!0,!0;if(!r)return!1;await new Promise(x=>setTimeout(x,Math.max(w()-$,25)))}}async function k($,x,{remember:E=!0}={}){if(l.has($))return l.get($);if(!await v())return null;let S=null;try{S=await x()}catch{S=null}finally{d=!1}return E&&l.set($,S),S}return{fetchJson:g,fetchText:y,cachedFetch:k}}var gp=C(()=>{});function yC({fetchImpl:e,origin:t=mC,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=wC,waitForSlot:i=!1,sourceName:a=bC}={}){let l=_c({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function c(p,f){let h=Array.isArray(f?.[1])?f[1]:[];for(let m of h){let b=G(m);if(b===p||b.startsWith(p))return String(m)}return null}async function u(p,f){let h=await l.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(f.replace(/ /g,"_"))}`);if(!h)return null;let m=String(h.extract??""),b=Number(h.revision),g={term:p,title:String(h.title??f),text:m,summary:Sc(m,Ec),url:String(h.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(f.replace(/ /g,"_"))}`),revid:b},y=o;if(!y)try{y=_n()}catch{y=null}let w=y?r$(m,y):null;return w&&(g.isa=w),ki(g)?g:null}async function d(p){let f=await l.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(p)}&limit=3`),h=f?c(p,f):null;return h?u(p,h):null}return{name:a,origin:t,provenanceTag(p){return ji(a,p)},async lookup(p){let f=String(p??"");return f?l.cachedFetch(f,()=>d(f)):null},async pageByTitle(p){let f=String(p??"").trim();return f?l.cachedFetch(`title\0${G(f)}`,()=>u(G(f),f)):null},async linkedTitles(p,{limit:f=25}={}){let h=String(p??"").trim();if(!h)return null;let m=await l.cachedFetch(`links\0${G(h)}`,async()=>{let g=(await l.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(h)}§ion=0`))?.parse?.links;if(!Array.isArray(g))return null;let y=new Set,w=[];for(let v of g){if(!v||v.ns!==0||v.exists===!1)continue;let k=String(v.title??v["*"]??"").trim(),$=G(k);!k||!$||y.has($)||(y.add($),w.push(k))}return w});return Array.isArray(m)?m.slice(0,Math.max(0,f)):null}}}function $C(e={}){return yC({origin:gC,sourceName:l$,waitForSlot:!0,...e})}var mC,gC,bC,l$,wC,u$=C(()=>{Lt();Ws();$r();Ri();gp();mC="https://en.wikipedia.org",gC="https://simple.wikipedia.org",bC="wikipedia-live",l$="simple-wikipedia",wC="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";Rc({name:l$,create:$C})});function TC(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!p$.test(r))continue;let i=G(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function AC(e){let t=[];for(let[n,s]of Object.entries(kC)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=_C)return t;if(r>=RC)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let l=String(a?.datavalue?.value?.id??"");p$.test(l)&&(t.push({property:n,predicate:s,id:l}),r+=1)}}return t}function IC(e,t,n){for(let s of jC)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function CC({fetchImpl:e,origin:t=vC,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=SC,waitForSlot:r=!1,sourceName:i=d$}={}){let a=_c({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),l=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(5),...d})}`;async function c(d){let p=new Map;if(!d.length)return p;let f=await a.fetchJson(l({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[h,m]of Object.entries(f?.entities??{})){let b=G(m?.labels?.en?.value??"");b&&p.set(h,b)}return p}async function u(d){let p=await a.fetchJson(l({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),f=p?TC(d,p):null;if(!f)return null;let m=(await a.fetchJson(l({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:f})))?.entities?.[f];if(!m)return null;let b=AC(m),g=await c(b.map(E=>E.id)),y=ji(i,d),w=[],v=new Set;for(let E of b){let S=g.get(E.id);!S||S===d||v.has(`${E.predicate}\0${S}`)||(v.add(`${E.predicate}\0${S}`),w.push({subject:d,predicate:E.predicate,object:S,provenance:y}))}let k=String(m.descriptions?.en?.value??""),$={term:d,title:String(m.labels?.en?.value??""),text:k,summary:Sc(k,Ec),url:`${t}/wiki/${f}`,revid:Number(m.lastrevid),source:xC,licence:EC},x=IC(b,g,d);return x&&($.isa=x),w.length&&($.facts=w),a$($)?$:null}return{name:i,origin:t,provenanceTag(d){return ji(i,d)},async lookup(d){let p=G(d??"");return p?a.cachedFetch(p,()=>u(p)):null}}}function OC(e={}){return CC({waitForSlot:!0,...e})}var vC,d$,xC,EC,SC,kC,jC,RC,_C,p$,f$=C(()=>{Lt();$r();Ri();gp();vC="https://www.wikidata.org",d$="wikidata",xC="Wikidata",EC="CC0 1.0",SC="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",kC=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),jC=["P279","P31"],RC=3,_C=12,p$=/^Q[1-9][0-9]*$/;Rc({name:d$,create:OC})});var LC,NC,qB,yp=C(()=>{Lt();Ws();qo();Ri();LC=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),NC=["this","is","about","the"],qB=NC.length});var h$=C(()=>{Tt();Ve()});var $p=C(()=>{Lt()});var PC,cW,m$=C(()=>{xo();jc();Bs();Ve();$p();Lt();PC={},cW=Z(me(Pt(PC.url)),"..","..","..")});var uW,dW,pW,g$=C(()=>{uW=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),dW=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),pW=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var mW,b$=C(()=>{fn();mW=Object.freeze({inline:"inline",enumerated:"enumerated"})});var w$,Ac,Ic=C(()=>{w$=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),Ac=new Set([...w$,"property","concept","idea","content"])});function _i(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Cc(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let l=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(FC);if(!l.length)break;let c=o?l.filter(d=>d===o||xp(d,t).has(o)):[];a=(c.length?c:l)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function xp(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function Ep(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,Ep(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function DC(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function zC(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let l=xp(e,n),c=xp(t,n);if(l.has(t)||c.has(e))return{distinct:!1,reason:"subsumes",lcs:l.has(t)?t:e};if(s.size)for(let m of l){let b=s.get(m);if(b){for(let g of c)if(b.has(g))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...l].filter(m=>c.has(m));if(!u.length)return l.size<2||c.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=m=>Ep(m,n,o,new Set),p=u[0],f=d(p);for(let m of u){let b=d(m);(b>f||b===f&&m<p)&&(p=m,f=b)}if(f<=i)return{distinct:!0,reason:"root-subsumer",lcs:p};if(a){let m=a.get(p);return typeof m=="number"&&m<r?{distinct:!0,reason:"low-ic",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}return 2*f/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}function Oc(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],l=n||_i(t),c=DC(s),u=new Map,d=new Map(a.map(y=>[y,y])),p=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},f=(y,w)=>{let v=p(y),k=p(w);v!==k&&d.set(v<k?k:v,v<k?v:k)},h=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let v=zC(a[y],a[w],l,c,u,{threshold:o,rootDepth:r,icByTerm:i});h.push({a:a[y],b:a[w],...v}),v.distinct||f(a[y],a[w])}let m=new Map;for(let y of a){let w=p(y);m.has(w)||m.set(w,[]),m.get(w).push(y)}let b=y=>Ep(y,l,u,new Set),g=[...m.values()].map(y=>{let w=[...y].sort(),v=w[0],k=b(v);for(let $ of w){let x=b($);x>k&&(k=x,v=$)}return{objects:w,label:v}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:g.length>1,clusters:g,pairs:h}}var FC,Lc=C(()=>{Nt();Ic();FC=(e,t)=>e<t?-1:e>t?1:0});function Sp(e){return typeof e=="string"&&UC.test(e)}function y$(e){return!!e&&typeof e=="object"&&Eo(e.s)}function kp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&Sp(e.world)&&Eo(e.subject)&&Eo(e.predicate)&&Eo(e.object)}function jp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!Sp(e.world)||!Eo(e.name)||!WC.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(Eo)}function Rp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&Sp(e.world)&&Eo(e.opening)}function $$(e){return kp(e)||jp(e)||Rp(e)}function v$(e){let t=e||[],n=t.filter(c=>c.predicate===GC).sort((c,u)=>`${c.subject}\0${c.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(c=>c.predicate==="rdf:type").map(c=>c.subject)),o=new Map;for(let c of t)c.predicate==="mgx:located-in"&&o.set(c.subject,c.object);let r=(c,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===c&&o.get(d.subject)===u),i=t.find(c=>typeof c.world=="string"&&c.kind==="fact"),a=(c,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:c,predicate:u,object:d}),l=[];for(let c of n){let u=c.subject,d=c.object;if(r(d,u))continue;let p=d,f=1;for(;s.has(p);)f+=1,p=`${d}-${f}`;s.add(p),l.push(a(p,"rdf:type",d)),l.push(a(p,"rdf:type","portable")),l.push(a(p,"mgx:located-in",u))}return l.length?[...t,...l]:t}var UC,BC,WC,Eo,GC,So=C(()=>{UC=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,BC=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),WC=new Set(BC),Eo=e=>typeof e=="string"&&e.trim()!=="";GC="mgx:default-contains"});var Nc=C(()=>{});var VC,HC,qC,KC,YC,XC,JC,QC,ZC,eO,tO,nO,sO,oO,rO,iO,aO,kW,cO,x$,jW,RW,E$=C(()=>{Ws();Go();VC="subClassOf",HC="typeAssertion",qC="relation",KC="someValuesFrom",YC="cardinality",XC="disjointWith",JC="possessive",QC="adjective",ZC="capability",eO="union",tO="complement",nO="negativeType",sO="enumeration",oO="differentFrom",rO="bareExistential",iO="transitiveRole",aO="inverseRole",kW=Object.freeze([VC,HC,qC,KC,YC,XC,JC,QC,ZC,eO,tO,nO,sO,oO,rO,iO,aO]),cO=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),x$=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),jW=Math.max(...[...x$.keys()].map(e=>e.split(" ").length)),RW=[...new Set([...cO,...[...x$.keys()].map(e=>e.split(" ")[0])])]});var ko=C(()=>{});var _p=C(()=>{Pe();Pn();ko()});function _t({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Gs.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var lO,Gs,xe,uO,jo,ot,Wt,en,dO,S$,Rt,pO,fO,k$,LW,NW,PW,vr=C(()=>{lO=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Gs=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),xe=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),uO=Object.freeze([xe.MemoryTerm]),jo=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ot=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Gs.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Wt=()=>Object.freeze({type:Gs.Precondition,pred:jo.graphLoaded}),en=(e,t)=>Object.freeze({type:Gs.Precondition,pred:jo.resolves,param:e,as:t}),dO=e=>Object.freeze({type:Gs.Precondition,pred:jo.anyPresent,params:Object.freeze([...e])}),S$=()=>Object.freeze({type:Gs.Precondition,pred:jo.memoryFacts}),Rt=(e,t=null)=>Object.freeze({type:Gs.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});pO=Object.freeze([_t({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ot("query",xe.Query,{required:!1,note:"required unless a kind filter is given"}),ot("kind",xe.Kind,{required:!1}),ot("name",xe.Query,{required:!1}),ot("decorator",xe.Query,{required:!1})],preconditions:[Wt(),dO(["query","kind"])],add:[Rt("matches","query")]}),_t({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("description","symbol")]}),_t({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("signature","symbol")]}),_t({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ot("module",xe.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Wt(),en("module",xe.Symbol)],add:[Rt("impact","module")]}),_t({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ot("class",xe.Class,{arg:"class"})],preconditions:[Wt(),en("class",xe.Class)],add:[Rt("members","class")]}),_t({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ot("class",xe.Class,{arg:"class"})],preconditions:[Wt(),en("class",xe.Class)],add:[Rt("subclasses","class")]}),_t({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ot("module",xe.Module)],preconditions:[Wt(),en("module",xe.Module)],add:[Rt("exports","module")]}),_t({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("callers","symbol")]}),_t({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("callees","symbol")]}),_t({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("calls","symbol")]}),_t({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("tests","symbol")]}),_t({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Wt()],add:[Rt("untested",null)]}),_t({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("history","symbol")]}),_t({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ot("symbol",xe.Symbol)],preconditions:[Wt(),en("symbol",xe.Symbol)],add:[Rt("cochanges","symbol")]}),_t({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ot("package",xe.Package,{required:!1})],preconditions:[Wt()],add:[Rt("architecture","package")]}),_t({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[ot("term",xe.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[S$(),en("term",xe.MemoryTerm)],add:[Rt("related","term")]}),_t({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[ot("class",xe.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),ot("expression",xe.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ot("size",xe.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[S$(),en("class",xe.MemoryTerm)],add:[Rt("sprite","class")]})]),fO=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),k$=pO,LW=fO(k$),NW=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),PW=Object.freeze({prefixes:lO,vocab:Gs,kinds:xe,precond:jo,get capabilities(){return k$}})});var Tp=C(()=>{vr()});var Ap=C(()=>{ns()});var Ip=C(()=>{vr()});function wO(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(ks,n)&&(t.expression=n),!t.size&&vi([{predicate:bO,object:n}])!==1&&(t.size=n);return t}var oG,rG,iG,aG,bO,cG,Cp=C(()=>{Pn();On();pc();Lt();Pe();Ui();Kd();vr();Ip();oG=new RegExp(`\\b(?:${Object.keys(In).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),rG=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),iG=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),aG=Object.freeze({}),bO="mgx:hasProperty";cG=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:wO},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var _$=C(()=>{});var $O,T$=C(()=>{Cp();vr();Ip();_$();Pn();$O=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var Pc=C(()=>{Nc();Ap();Cp();T$();vr();Tp()});function EO(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||Z(xO,"corpus","worlds")}function A$(e){try{return kc(wr(e))}catch{return null}}function I$(e){if(Lp.has(e))return Lp.get(e);let t=null,n=A$(Z(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return Lp.set(e,t),t}function SO(e,t){let n=I$(e);if(!n)return null;let s=n[String(t??"")];if(!y$(s))return null;let o=`${e}\0${t}`;if(Np.has(o))return Np.get(o);let r=null,i=A$(Z(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],l=[],c=null;for(let u of i.toString("utf8").split(`
|
|
167
|
-
`))if(u.trim())try{let d=JSON.parse(u);if(
|
|
168
|
-
:root { color-scheme: light dark; ${
|
|
169
|
-
@media (prefers-color-scheme: dark) { :root { ${
|
|
170
|
-
:root[data-theme="dark"] { ${
|
|
171
|
-
:root[data-theme="light"] { ${
|
|
172
|
-
`});var U$=C(()=>{Mp()});var B$=C(()=>{Mp()});var G$=C(()=>{Ge();So();fn();Er()});var H$=C(()=>{_s();Ge();Nc();Pc();Er()});var Dp,MO,FO,DO,zO,UO,BO,NH,PH,Er=C(()=>{So();Nc();E$();Ws();gc();_p();Tp();Pc();Ap();Mc();Ge();D$();U$();B$();G$();H$();Dp="mgx:world-epoch",MO=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),FO=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),DO="mgx:is-open",zO="mgx:hasMass",UO="mgx:knows-about",BO="mgx:display-name",NH=new Set([...MO,...FO,DO,zO,UO,BO,"rdf:type",Dp]),PH=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var Sr,FH,DH,zH,UH,BH,WH,Vs=C(()=>{Sr=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),FH=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),DH=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),zH=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),UH=Object.freeze({teach:"teach"}),BH=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),WH=Object.freeze({max_depth:"maxDepth"})});var K$,WO,Uc,GO,VO,Y$,X$,HO,qO,HH,KO,YO,J$=C(()=>{Vs();K$="spider-fly",WO=10,Uc=Object.freeze({x:2,y:2}),GO=1,VO=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),Y$=(e,t)=>`cell-${e}-${t}`,X$=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),HO=(e,t)=>X$(e,t,Uc.x,Uc.y)<=GO,qO=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),HH=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),KO="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",YO=Object.freeze({name:K$,gridSize:WO,opening:KO,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:HO,webHomeCell:Y$(Uc.x,Uc.y)})});var Q$,nv,YH,XH,JH,zp,Z$,ev,tv,Up,QH,ZH,Bc=C(()=>{Vs();Q$=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),nv=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),YH=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),XH=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),JH=Object.freeze([Q$.spawnedFood,Q$.placedFood]),zp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),Z$=zp({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),ev=zp({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),tv=zp({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),Up=Object.freeze({[Z$.name]:Z$,[ev.name]:ev,[tv.name]:tv}),QH=Object.freeze(Object.keys(Up)),ZH=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var sv=C(()=>{});var ov=C(()=>{});var Ai,vq,nL,sL,oL,rL,iL,aL,cL,lL,uL,dL,pL,fL,hL,mL,gL,bL,wL,xq,Bp=C(()=>{Bc();sv();_s();Ge();So();ov();Lt();Vs();Er();Ai=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),vq=Object.freeze(["predator","prey"]),nL="mgx:currently-in",sL="mgx:hasMass",oL="mgx:feels",rL="mgx:facing",iL="mgx:driven-facing",aL="mgx:eaten-by",cL="mgx:starved",lL="mgx:placed-by",uL="mgx:model",dL="mgx:rotation",pL="mgx:carrying",fL="mgx:prey-eaten",hL="mgx:web-built-at-turn",mL="mgx:laid-at-turn",gL="mgx:hatched-into",bL="mgx:turn-played",wL=new Set([nL,sL,oL,rL,iL,aL,cL,lL,uL,dL,bL,pL,fL,hL,mL,gL,"rdf:type",Dp]),xq=Object.freeze([...wL].sort())});var zq,Uq,iv=C(()=>{J$();Bc();Bp();So();Mc();Ge();Vs();zq=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),Uq=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var rK,iK,aK,cK,lK,uK,xL,EL,SL,kL,av,cv,jL,dK,pK,lv=C(()=>{Bc();Bp();Er();fn();So();Mc();Ge();Vs();rK=Ai.predator.kind,iK=Ai.prey.kind,aK=Ai.food.spawnedKind,cK=Ai.food.placedKind,lK=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),uK=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),xL="mgx:currently-in",EL="mgx:hasMass",SL="mgx:feels",kL="mgx:facing",av="(fox|goblin|crumb|morsel)(?:-(\\d+))?",cv="(fox|goblin)(?:-(\\d+))?",jL="(crumb|morsel)(?:-(\\d+))?",dK=[{kind:"placement",predicate:xL,re:new RegExp(`^(?:the\\s+)?${av}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:EL,re:new RegExp(`^(?:the\\s+)?${av}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:SL,re:new RegExp(`^(?:the\\s+)?${cv}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:kL,re:new RegExp(`^(?:the\\s+)?${cv}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],pK=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${jL}\\s+there[.!\\s]*$`,"i")});var wt,hK,mK,gK,bK,wK,yK,$K,vK,xK,EK,SK,kK,jK,RK,_K,TK,AK,IK,CK,uv=C(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},hK=wt("createRequire"),mK=wt("readFileSync"),gK=wt("access"),bK=wt("readFile"),wK=wt("writeFile"),yK=wt("appendFile"),$K=wt("mkdir"),vK=wt("mkdtemp"),xK=wt("rename"),EK=wt("unlink"),SK=wt("rm"),kK=wt("stat"),jK=wt("copyFile"),RK=wt("readdir"),_K=wt("createReadStream"),TK=wt("createWriteStream"),AK=wt("randomBytes"),IK=wt("spawnSync"),CK=wt("createInterface")});var yt,LK,NK,PK,MK,FK,DK,zK,UK,BK,WK,GK,VK,HK,qK,KK,YK,XK,JK,RL,dv=C(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},LK=yt("createRequire"),NK=yt("readFileSync"),PK=yt("access"),MK=yt("readFile"),FK=yt("writeFile"),DK=yt("appendFile"),zK=yt("mkdir"),UK=yt("mkdtemp"),BK=yt("rename"),WK=yt("unlink"),GK=yt("rm"),VK=yt("stat"),HK=yt("copyFile"),qK=yt("readdir"),KK=yt("createReadStream"),YK=yt("createWriteStream"),XK=yt("randomBytes"),JK=yt("spawnSync"),RL=yt("createInterface")});var $t,ZK,eY,tY,nY,sY,oY,rY,iY,aY,cY,lY,uY,dY,pY,fY,hY,mY,pv,gY,Wp=C(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},ZK=$t("createRequire"),eY=$t("readFileSync"),tY=$t("access"),nY=$t("readFile"),sY=$t("writeFile"),oY=$t("appendFile"),rY=$t("mkdir"),iY=$t("mkdtemp"),aY=$t("rename"),cY=$t("unlink"),lY=$t("rm"),uY=$t("stat"),dY=$t("copyFile"),pY=$t("readdir"),fY=$t("createReadStream"),hY=$t("createWriteStream"),mY=$t("randomBytes"),pv=$t("spawnSync"),gY=$t("createInterface")});var fv=C(()=>{Wp();Ve();Tt();Ve();ec();Kt()});var hv=C(()=>{});var _L,mv=C(()=>{Tt();Ve();Ge();hv();_L=Z(".tmct","sessions")});var bv=C(()=>{Tt();Ve();bc()});var wv,Wc,yv=C(()=>{wv=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),Wc=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var vt,FY,DY,zY,UY,BY,WY,GY,VY,HY,qY,KY,YY,XY,JY,QY,ZY,e3,t3,$v,vv=C(()=>{vt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},FY=vt("createRequire"),DY=vt("readFileSync"),zY=vt("access"),UY=vt("readFile"),BY=vt("writeFile"),WY=vt("appendFile"),GY=vt("mkdir"),VY=vt("mkdtemp"),HY=vt("rename"),qY=vt("unlink"),KY=vt("rm"),YY=vt("stat"),XY=vt("copyFile"),JY=vt("readdir"),QY=vt("createReadStream"),ZY=vt("createWriteStream"),e3=vt("randomBytes"),t3=vt("spawnSync"),$v=vt("createInterface")});var jv={};qt(jv,{CONTEXT_PASSAGE_PREDICATE:()=>Ev,CO_OCCURS_PREDICATE:()=>Gc,ingestUnknownFromAssertions:()=>IL,knownTermsFrom:()=>Sv,passageFor:()=>kv});function Sv(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==ft)continue;let o=a=>(s.attributes||[]).find(l=>l?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(G(r)),i&&n.add(G(i))}for(let s of t||[])s?.subject&&n.add(G(s.subject)),s?.object&&n.add(G(s.object));return n}function kv(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=Hs(e?.start),o=Hs(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function AL(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<xv;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let l of a)if(!(TL.has(l)||r.has(l)||n.has(l))&&t.has(l)&&(o.push(l),r.add(l),o.length>=xv))break}return o}async function IL(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await ct(e),l=Sv(a,s),c=new Set,u=[];for(let f of t){if(c.size>=i)break;let h=n.get(f.rel);if(!h||h.ace!=="none")continue;let m=Hs(f.start),b=Hs(f.end);if(!m||!b)continue;let g=G(m),y=G(b),w=!l.has(g),v=!l.has(y);if(!w&&!v)continue;let k=kv(f,h);if(!k)continue;let $=[[m,b,w],[b,m,v]];for(let[x,E,S]of $){if(!S||c.size>=i)continue;let _=G(x);if(c.has(_))continue;let R=`${r} ${f.rel}`;u.push({subject:x,predicate:Ev,object:k,provenance:R}),u.push({subject:x,predicate:Gc,object:E,provenance:R});let T=AL(k,l,new Set([g,y]));for(let M of T)u.push({subject:x,predicate:Gc,object:M,provenance:R});c.add(_),l.add(_)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await qn(e,u),p=u.filter(f=>f.predicate===Gc).length;return{captured:c.size,linked:p,appended:d.appended,skipped:d.skipped}}var Ev,Gc,TL,xv,Rv=C(()=>{Ge();Vc();Ev="mgx:contextPassage",Gc="mgx:coOccursWith",TL=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),xv=3});var _v={};qt(_v,{MAP_FILE:()=>Ci,SEON_CONCEPTS_FILE:()=>Hc,SEON_DEFINITIONS_FILE:()=>CL,SLICE_FILE:()=>Ii,TIER2_DIR:()=>Yn,TIER2_MANIFEST_FILE:()=>OL,WORDNET_DIR:()=>Oi,loadMap:()=>Kc,loadSlice:()=>qc,seedMemory:()=>NL,termText:()=>Hs,toFacts:()=>Yc});async function qc(e=Ii){let t=$v({input:By(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function Kc(e=Ci){let n=bo(await Te(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!LL.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function Yc(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=Hs(o.start),a=Hs(o.end);if(!i||!a)continue;let l=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${l} ${o.rel}`})}return s}async function NL(e,{limit:t,slicePath:n=Ii,mapPath:s=Ci,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[l,c]=await Promise.all([qc(n),Kc(s)]),u=Yc(l,c,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map((w,v)=>[w,v]));u=u.slice().sort((w,v)=>(y.get(w.predicate)??o.length)-(y.get(v.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,w,v)=>`${G(y)} ${w} ${G(v)}`,p=new Set,f=await ct(e);for(let y of f.individuals||[]){if(y?.class!=="Fact")continue;let w=v=>(y.attributes||[]).find(k=>k.key===v)?.value;p.add(d(w("subject"),w("predicate"),w("object")))}let h=0,m=[];for(let y of u){let w=d(y.subject,y.predicate,y.object);if(p.has(w)){h+=1;continue}p.add(w),m.push(y)}let b=await qn(e,m),g;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(Rv(),jv));g=await y(e,{assertions:l,map:c,mappedFacts:u,memory:f,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:b.appended,skipped:h+b.skipped,total:u.length,...g?{unknown:g}:{}}}var PL,kr,Ii,Ci,Hc,CL,Yn,OL,Oi,p3,LL,Hs,Vc=C(()=>{xo();Tt();vv();Bs();Ve();Xa();Ge();PL={},kr=Z(me(Pt(PL.url)),"..","..",".."),Ii=Z(kr,"corpus","conceptnet","slice.jsonl"),Ci=Z(kr,"src","adapters","corpus","conceptnet-map.toml"),Hc=Z(kr,"corpus","domains","code","concepts.jsonl"),CL=Z(kr,"corpus","domains","code","definitions.jsonl"),Yn=Z(kr,"corpus","tier2"),OL=Z(Yn,"manifest.json"),Oi=Z(kr,"corpus","wordnet"),p3=Z(Oi,"manifest.json"),LL=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);Hs=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var Lv={};qt(Lv,{BUILTIN_EXTENSIONS:()=>zL,EXTENSION_KINDS:()=>Xc,activeDomainPacks:()=>Kp,defaultCodeDomainPacks:()=>Ov,defaultCodeLaneVocab:()=>Cv,mergedLaneVocab:()=>qp,mergedLexiconExtra:()=>Iv,resolveExtensions:()=>Av,seedActiveCorpusEntries:()=>WL,validateExtensionEntry:()=>Tv,validateExtensionPack:()=>VL});function Jc(){return{seon:{kind:"corpus",active:!1,corpusPath:Hc,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Hc,provenancePrefix:"corpus:seon",vocabPath:FL,vocabData:wv,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:Ii,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:DL},human:{kind:"corpus",active:!0,corpusPath:Z(Yn,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:Z(Yn,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:Z(Yn,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:Z(Yn,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Gp,vocabData:Wc,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:Z(Yn,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Gp,vocabData:Wc,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:Z(Yn,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Gp,vocabData:Wc,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:Z(Yn,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:Z(Oi,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:Z(Oi,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:Z(ML,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function Tv(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Xc.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Xc.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function BL(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Xc.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=UL(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function Av(e,{configFile:t}={}){let n=e?await Za(e,t?{file:t}:{}):null,s=Jc(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let p of i){let f=BL(p,s[p]||null,o[p]||{},e||process.cwd());Tv(p,f),a.set(p,f)}let l={};for(let[p,f]of Object.entries(r)){if(typeof f!="number"||!Number.isFinite(f))throw new Error(`[bias] "${p}": bias must be a finite number, got ${JSON.stringify(f)}`);l[p]=f}let u=["seon","conceptnet",...[...a.keys()].filter(p=>p!=="seon"&&p!=="conceptnet").sort()].filter(p=>a.has(p));return{entries:new Map(u.map(p=>[p,a.get(p)])),biasByBundle:l}}async function WL(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(Vc(),_v)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,l=0,c=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let f=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:f.appended,skipped:f.skipped,total:f.total},a+=f.appended,l+=f.skipped,c+=f.total}catch(f){i[u]={appended:0,skipped:0,total:0,error:f&&f.message?f.message:String(f)}}return{appended:a,skipped:l,total:c,perBundle:i}}async function Iv(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Te(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function qp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Te(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function Cv(){if(!Vp){let e={...Jc().code,active:!0};Vp=qp(new Map([["code",e]]),{})}return Vp}async function GL(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Te(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function Kp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await GL(o.name,o.entry));return s}function Ov(){if(!Hp){let e={...Jc().code,active:!0};Hp=Kp(new Map([["code",e]]),{})}return Hp}async function VL(e,t){let n=[],s=o=>o&&(ul(o)?o:Ft(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await qc(o),i=await Kc(s(t.mapPath)||Ci),a=Yc(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(Ws(),t$)),i=JSON.parse(await Te(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(wc(),zy)),i=await r(o),a=[...i.keys()].filter(l=>!l.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Te(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,l=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:l}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var Yp,ML,FL,Gp,Xc,DL,zL,UL,Vp,Hp,Xp=C(()=>{Ve();Tt();Bs();yv();ec();Vc();Yp={},ML=Z(me(Pt(Yp.url)),"..","..","corpus","namenet"),FL=Z(me(Pt(Yp.url)),"..","..","corpus","domains","code","vocab.json"),Gp=Z(me(Pt(Yp.url)),"..","..","corpus","tier2","vocab-empty.json"),Xc=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),DL=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];zL=Object.freeze(Jc());UL=(e,t)=>{if(t==null)return;let n=String(t);return ul(n)?n:Ft(e,n)};Vp=null;Hp=null});var Nv=C(()=>{});var Pv=C(()=>{Ve();xo();Tt();uv();dv();Wp();Kt();fv();Pe();mv();bc();bv();Pr();Xp();Qc();Vs();gc();Pc();yp();Ri();Nv()});var Mv={};qt(Mv,{proseLemma:()=>qL});function qL(){if(Ro!==void 0)return Ro;try{let e=ap();if(!e)return Ro=null,Ro;let t=e.its,n=new Map;Ro=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{Ro=null}return Ro}var Ro,Fv=C(()=>{cp()});var Dv={};qt(Dv,{digestTermFromRows:()=>XL,loadDigestStructureTable:()=>YL,readDigestStructures:()=>KL});var KL,YL,XL,zv=C(()=>{KL=()=>null,YL=()=>null,XL=()=>null});function uf(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Zc(e.entityType)}`;if(t==="list")return`list/enumerate ${Zc(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Zc(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return uf(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&yn[o]?yn[o]:`filter/traverse ${Zc(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&yn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?yn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function bf(e){let t=new Map;for(let n of e)t.has(Wv(n))||t.set(Wv(n),n);return t}function Zp(e,t=To){let n=[],s=[];for(let l of e)l.predicate===t&&(s.push([l.subject,l.object]),_o(l)&&n.push([l.subject,l.object]));let o=new Map,r=new Map,i=new Set,a=(l,c,u)=>{!c||!u||c===u||(l.has(c)||l.set(c,new Set),l.get(c).add(u))};for(let[l,c]of s)a(r,l,c),c&&i.add(c);for(let[l,c]of n)a(o,l,c);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function ef(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function oN(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function rN(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Fv(),Mv)),s=n();return s?oN(t,s(t)):t}catch{return t}}function yf(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||iN.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function sf(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return br;if(t==="can")return"mgx:capableOf";try{let n=await rN(t);return n==="have"?br:hs(`mgx:${n}`)}catch{return hs(`mgx:${t}`)}}function fN(e,t){let n=String(t||"").match(pN);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function Li(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Pn(),Sg)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function Hv(e){return e.predicate===nN&&e.object==="transitiveproperty"}function yN(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function bx(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:s|x|z|ch|sh|o)es$/i.test(t)?t.slice(0,-2):t.replace(/s$/i,"")}function wx(e){if(Ao[e])return Ao[e];let t=String(e||""),n=qg(t);if(n){let a=wx(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[l,...c]=a.split(" ");return["does not",bx(l),...c].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${$f})-([a-z]+)$`,"i").exec(t);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(t);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(t);return i?`${yN(i[1])}${i[2]?` ${i[2]}`:""}`:e}function rf(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function vN(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of $N)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function Jn(e){return e.replace(/#node:[0-9a-f]+/g,"")}function se(e){let t=e.provenance?` (source: ${Jn(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Gt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Gt(e)}${t}`:e.provenance.includes("corpus:")?`${Gt(e)}${t}`:e.provenance.includes("reference:")?`${Gt(e)}${t}`:`i learned: ${Gt(e)}${t}`}function qv(e,t,n,{toward:s=null}={}){let o=se(e);if(!Xn.has(e.predicate)||!n.has(e.subject))return o;let r=Cc(e.object,t,{cap:6,stopAt:Ac,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(xN);return a?o.slice(0,a.index)+i+a[0]:o+i}function Kv(e,t,n,{indent:s=""}={}){let o=t.filter(k=>k.predicate===To).map(k=>[k.subject,k.object]),r=_i(o),i=e.map(k=>`${s}${qv(k,r,n)}`),a=e.filter(k=>Xn.has(k.predicate)&&n.has(k.subject)),l=[...new Set(a.map(k=>k.object))];if(l.length<2)return{lines:i,grouped:null};let c=t.filter(k=>k.predicate==="owl:disjointWith").map(k=>[k.subject,k.object]),{split:u,clusters:d}=Oc(l,{parents:r,disjointEdges:c});if(!u)return{lines:i,grouped:null};let p=a[0].subject,f=new Map;for(let k of d)for(let $ of k.objects)f.set($,k);let h=e.filter(k=>!(Xn.has(k.predicate)&&n.has(k.subject))),m=[],b=[],g=0,y=k=>{let $=qv(k,r,n);return g<Se?(g+=1,`${s}${$}`):(b.push($),null)};for(let k of d){let $=a.filter(x=>f.get(x.object)===k).map(y).filter(Boolean);$.length&&m.push(`${s}${p}, the ${k.label}:
|
|
173
|
-
${
|
|
174
|
-
`)}`)}if(
|
|
175
|
-
${
|
|
176
|
-
`)}`)}let
|
|
177
|
-
${s}\u2026and ${
|
|
178
|
-
`)
|
|
179
|
-
`:"",
|
|
164
|
+
`)}`:l,data:{...a,grounded:c}})}finally{await i()}}var j$=N(()=>{Ye();qe();Qe();Pf.ownsGraphLoad=!0});var YI,k$=N(()=>{ad();kb();my();gy();wy();$y();xy();Sy();ky();_y();Ky();Xy();Qy();e$();Dc();r$();a$();l$();d$();p$();h$();b$();y$();v$();S$();j$();YI=Object.freeze({tmct_context:id,tmct_context_more:jb,tmct_describe:py,tmct_snippet:hy,tmct_signature:by,tmct_impact:yy,tmct_search:vy,tmct_members:Ey,tmct_subclasses:jy,tmct_related:Af,tmct_sprite:Lf,tmct_architecture:Yy,tmct_exports:Jy,tmct_untested:Zy,tmct_ask:s$,tmct_tests_for:o$,tmct_history:i$,tmct_file_history:c$,tmct_method_history:u$,tmct_class_history:f$,tmct_callers:m$,tmct_callees:g$,tmct_calls:w$,tmct_cochanges:$$,tmct_export:Nf,tmct_ingest:Pf})});var Mf=N(()=>{});var zc,Ff=N(()=>{zc=()=>({relations:[],constructions:[]})});var R$,_$=N(()=>{Lt();Ye();Dm();Kt();Zr();Yn();Ya();Xa();k$();Dc();Qe();cr();Pa();Mf();Ff();Xa();ad();Dc();Ma(void 0);Na(zc);R$=Fm.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Is,zf=N(()=>{Is=Object.freeze({"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in","mgx:pursues":"pursues","mgx:evades":"evades","mgx:consumes":"eats","mgx:vision-radius":"sees within","mgx:guards":"guards"})});var oW,rW,iW,Uc=N(()=>{oW=Object.freeze(["entity","set","event","measure"]),rW=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),iW=Object.freeze({it:Object.freeze(["entity","event","measure"]),this:Object.freeze(["entity","event","measure"]),that:Object.freeze(["entity","event","measure"]),"this one":Object.freeze(["entity","event","measure"]),"that one":Object.freeze(["entity","event","measure"]),those:Object.freeze(["set"]),them:Object.freeze(["set"]),these:Object.freeze(["set"]),here:Object.freeze(["entity"])})});var $t,cW,lW,uW,dW,fW,pW,mW,hW,gW,bW,wW,yW,$W,vW,xW,EW,XI,SW,jW,T$=N(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},cW=$t("createRequire"),lW=$t("readFileSync"),uW=$t("access"),dW=$t("readFile"),fW=$t("writeFile"),pW=$t("appendFile"),mW=$t("mkdir"),hW=$t("mkdtemp"),gW=$t("rename"),bW=$t("unlink"),wW=$t("rm"),yW=$t("stat"),$W=$t("copyFile"),vW=$t("readdir"),xW=$t("createReadStream"),EW=$t("createWriteStream"),XI=$t("randomBytes"),SW=$t("spawnSync"),jW=$t("createInterface")});var Bc=N(()=>{T$()});var vt,TW,AW,CW,IW,OW,LW,NW,PW,MW,FW,DW,zW,UW,BW,WW,GW,qt,VW,HW,qW,to=N(()=>{vt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},TW=vt("createRequire"),AW=vt("readFileSync"),CW=vt("access"),IW=vt("readFile"),OW=vt("writeFile"),LW=vt("appendFile"),NW=vt("mkdir"),PW=vt("mkdtemp"),MW=vt("rename"),FW=vt("unlink"),DW=vt("rm"),zW=vt("stat"),UW=vt("copyFile"),BW=vt("readdir"),WW=vt("createReadStream"),GW=vt("createWriteStream"),qt=e=>String(e),VW=vt("randomBytes"),HW=vt("spawnSync"),qW=vt("createInterface")});var M$={};Ot(M$,{PHRASEBOOK_FILE:()=>I$,TECHNICAL_SLOTS:()=>Uf,TEMPLATES_FILE:()=>C$,flatten:()=>Wf,loadPhrasebook:()=>eO,loadTemplates:()=>Gf,loadTemplatesMerged:()=>ZI,render:()=>P$,renderSegments:()=>N$,slotKind:()=>L$,slotsOf:()=>Bf});function Bf(e){let t=[];for(let n of String(e).matchAll(O$))t.includes(n[1])||t.push(n[1]);return t}function L$(e){return QI[e]||"entity"}function Wf(e){let t="";for(let n of e)t+=n.text;return t}function N$(e,t={},n=zi){if(!n)throw new Error("renderSegments() before loadTemplates() \u2014 load the template library first");let s=n.get(e);if(!s)throw new Error(`unknown template id "${e}"`);let o=s.slots.filter(u=>t[u]===void 0||t[u]===null);if(o.length)throw new Error(`template "${e}" missing slot${o.length>1?"s":""}: ${o.join(", ")}`);let r=s.template,i=new RegExp(O$.source,"g"),a=[],c=0,l;for(;(l=i.exec(r))!==null;)l.index>c&&a.push({type:"prose",text:r.slice(c,l.index)}),a.push({type:L$(l[1]),text:String(t[l[1]])}),c=l.index+l[0].length;return c<r.length&&a.push({type:"prose",text:r.slice(c)}),a}async function Gf(e=C$){let t=await Ae(e,"utf8"),n=new Map,s=t.split(`
|
|
165
|
+
`);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(c){throw new Error(`${e}:${o+1}: not valid JSON: ${c.message}`)}for(let c of["id","class","template","register"])if(typeof i[c]!="string"||!i[c])throw new Error(`${e}:${o+1}: missing/empty "${c}"`);if(!JI.has(i.register))throw new Error(`${e}:${o+1}: register must be terse|friendly|technical, got "${i.register}"`);if(n.has(i.id))throw new Error(`${e}:${o+1}: duplicate template id "${i.id}"`);let a=Bf(i.template);if(i.register==="technical"){let c=a.filter(l=>!Uf.has(l));if(c.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${c.length>1?"s":""}: ${c.join(", ")} (allowed: ${[...Uf].join(", ")})`);if(!a.includes("provenance"))throw new Error(`${e}:${o+1}: technical template "${i.id}" must carry a {provenance} fill (an advanced claim always shows its source)`)}n.set(i.id,{...i,slots:a})}return zi=n,n}async function ZI(e=[]){let t=zi,n=new Map;try{for(let s of e){let o=await Gf(s);for(let[r,i]of o){if(!r.includes(":"))throw new Error(`${s}: extension-pack template id "${r}" is not namespaced ("<packname>:<id>")`);if(n.has(r))throw new Error(`${s}: duplicate template id "${r}" already loaded from an earlier path`);n.set(r,i)}}}finally{zi=t}return n}function P$(e,t={},n=zi){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Wf(N$(e,t,n))}async function eO(e=I$){let t=await Ae(e,"utf8"),n=[],s=[],o=t.split(`
|
|
166
|
+
`);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(c=>c.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:Bf(i)})}}return{patterns:n,synonyms:s}}var tO,A$,C$,I$,JI,O$,Uf,QI,zi,Wc=N(()=>{Lt();to();Ye();tO={},A$=te(be(qt(tO.url)),"..","..",".."),C$=te(A$,"data","templates","responses.jsonl"),I$=te(A$,"data","phrasebook","software-phrases.txt"),JI=new Set(["terse","friendly","technical"]),O$=/\{([A-Za-z][A-Za-z0-9]*)\}/g,Uf=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));QI={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};zi=null});function sO(e,t={}){let n=nO.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function oO(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>sO(s,t))):1}function st(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:oO(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var nO,F$=N(()=>{nO=/^src:corpus:(.+)$/});var xt,ZW,Or,eG,tG,nG,sG,oG,rG,iG,aG,cG,lG,uG,dG,D$,rO,fG,pG,mG,Po=N(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},ZW=xt("createRequire"),Or=xt("readFileSync"),eG=xt("access"),tG=xt("readFile"),nG=xt("writeFile"),sG=xt("appendFile"),oG=xt("mkdir"),rG=xt("mkdtemp"),iG=xt("rename"),aG=xt("unlink"),cG=xt("rm"),lG=xt("stat"),uG=xt("copyFile"),dG=xt("readdir"),D$=xt("createReadStream"),rO=xt("createWriteStream"),fG=xt("randomBytes"),pG=xt("spawnSync"),mG=xt("createInterface")});function Vf(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function lO(e=aO){let t=Co(Or(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Vc(){if(Gc===null)try{Gc=lO()}catch{Gc=[]}return Gc}var uO,iO,aO,cO,vG,Gc,Hc=N(()=>{Po();to();Ye();xc();Wc();uO={},iO=be(qt(uO.url)),aO=te(iO,"..","..","data","templates","grammar-rules.toml"),cO=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),vG=Object.freeze(new Set(cO.filter(e=>e!=="prose")));Gc=null});function dO(){if(Ui!==void 0)return Ui;try{let e=z$?z$():fO();Ui=e&&e.winkNLP&&e.model?e:null}catch{Ui=null}return Ui}function fO(){let e=process.getBuiltinModule("node:module").createRequire(pO.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function qc(){if(Lr!==void 0)return Lr;let e=dO();if(!e)return Lr=null,null;try{Lr=e.winkNLP(e.model)}catch{Lr=null}return Lr}var pO,z$,Ui,Lr,Kc=N(()=>{pO={}});var Yc=N(()=>{Kc()});var B$,U$=N(()=>{B$={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var K$={};Ot(K$,{CODE_REF_SHAPE:()=>Jc,DETERMINERS:()=>qf,OF_CLASSIFIER_HEADS:()=>Yf,OF_PARTITIVE_HEADS:()=>Xf,QUANTIFIERS:()=>Kf,classify:()=>Qf,loadLexicon:()=>bn,lookupAdjective:()=>Wi,lookupNoun:()=>Tn,lookupProperName:()=>Nr,lookupVerb:()=>Bi,numberOf:()=>Jf,predicateOf:()=>Xc,readsAsIndividualName:()=>Qc,thirdPerson:()=>V$,withProperNames:()=>q$});function Jf(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):hO[t]??null}function V$(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function Xc(e,t=G$){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${V$(e.lemma)}${n}`}function H$(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function W$(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!gO.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!bO.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function bn(e,t=G$){if(!e&&Hf.has(t))return Hf.get(t);let n=B$,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return W$(s,n),e?(W$(s,e),s):(Hf.set(t,s),s)}function q$(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function Tn(e,t,n={}){return wO(e,t,n)[0]??null}function wO(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,c=l=>{l&&!a.has(l.lemma)&&(a.add(l.lemma),i.push(l))};if(r){let l=e.nouns.get(r)??null;return n.singularOnly&&o?(c(o),c(l)):(c(l),c(o)),i}for(let l of H$(s))c(e.nouns.get(l));return i}function Bi(e,t){return yO(e,t)[0]??null}function yO(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of H$(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Wi(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function Nr(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function Qc(e,t){let n=String(e??"");if(!n)return!1;if(Nr(t,n)||Jc.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=Tn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function Qf(e,t=bn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(qf[s])return{pos:"determiner",type:qf[s]};if(Kf[s])return{pos:"quantifier",type:Kf[s]};let o=Jf(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=Nr(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=Tn(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=Bi(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:Xc(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Wi(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var G$,qf,Kf,Yf,Xf,hO,gO,bO,Hf,Jc,is=N(()=>{U$();G$="tmct:",qf=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),Kf=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),Yf=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Xf=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),hO=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});gO=new Set(["data","object"]),bO=new Set(["subclass","data"]);Hf=new Map;Jc=/[./\\#:@]/});var AG,CG,IG,$O,OG,LG,NG,Y$=N(()=>{Yn();Me();AG=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),CG=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),IG=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),$O=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),OG=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),LG=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),NG=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function Gi(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function el(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function xO(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function J$(e,t){let n=Tn(t,e);return n?V(n.lemma):e}function Q$(e,t){let n=xO(String(e??"")).match(vO);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(EO.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),f=d&&J$(d,t);if(f&&(jO.has(f)||kO.has(f))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&SO.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=J$(i,t);if(X$.has(i)||X$.has(a))return null;let c=Tn(t,i);if(!c)return null;let l=V(c.lemma);return s&&(!/s$/.test(i)||V(i)===l)?null:l}var Zc,vO,EO,X$,SO,jO,kO,Pr=N(()=>{nt();is();Y$();Zc=400;vO=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;EO=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),X$=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),SO=new Set(["a","an","the"]),jO=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),kO=new Set(["either","one","each","both","any"])});var tl,nl=N(()=>{tl=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var RO,KG,Z$=N(()=>{Po();nl();to();Ye();Pr();RO={},KG=te(be(qt(RO.url)),"..","..","..")});function TO(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return _O.includes(e.predicate)}function ev(e){return Gi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(TO):!1}function Vi(e,t){return`research:${e}:${V(t)}`}function sl(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");AO.set(e.name,{name:e.name,create:e.create})}var _O,AO,QG,ZG,Mr=N(()=>{nt();Pr();_O=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);AO=new Map;QG=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),ZG=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function Hi({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1,validators:i=null}={}){let a=e??((...v)=>globalThis.fetch(...v)),c=new Map,l=0,u=0,d=!1,f=()=>{if(!o)return null;let v={"Api-User-Agent":o};return typeof document>"u"&&(v["User-Agent"]=o),v};function p(v){let j=Number(v)*1e3;u=Date.now()+Math.max(j||0,s)}function m(v){let j=i?.get(v);if(!j)return null;let k={};return j.etag&&(k["If-None-Match"]=j.etag),j.lastModified&&(k["If-Modified-Since"]=j.lastModified),Object.keys(k).length?k:null}function h(v,j){if(!i)return;let k=j.headers?.get?.("etag")??"",w=j.headers?.get?.("last-modified")??"";if(!k&&!w)return;let S=i.get(v)??{};i.set(v,{etag:k||S.etag||"",lastModified:w||S.lastModified||""})}async function g(v,{asJson:j}){let k=typeof AbortController=="function"?new AbortController:null,w=k?setTimeout(()=>k.abort(),t):null;try{let S={};k&&(S.signal=k.signal);let x={...f()??{},...m(v)??{}};Object.keys(x).length&&(S.headers=x);let A=await a(v,S);if(A.status===429)return p(A.headers?.get?.("retry-after")),null;if(A.status===304)return i?{notModified:!0}:null;if(!A.ok)return null;if(h(v,A),j){let L=await A.json();return L?.error?.code==="maxlag"?(p(A.headers?.get?.("retry-after")),null):L}return await A.text()}catch{return null}finally{w!==null&&clearTimeout(w)}}async function b(v){return g(v,{asJson:!0})}async function y(v){return g(v,{asJson:!1})}let $=()=>Math.max(u,l+n);async function E(){for(;;){let v=Date.now();if(!d&&v>=$())return l=v,d=!0,!0;if(!r)return!1;await new Promise(j=>setTimeout(j,Math.max($()-v,25)))}}async function R(v,j,{remember:k=!0}={}){if(c.has(v))return c.get(v);if(!await E())return null;let w=null;try{w=await j()}catch{w=null}finally{d=!1}return k&&c.set(v,w),w}return{fetchJson:b,fetchText:y,cachedFetch:R}}var qi=N(()=>{});function NO({fetchImpl:e,origin:t=CO,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=LO,waitForSlot:i=!1,sourceName:a=OO}={}){let c=Hi({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function l(f,p){let m=Array.isArray(p?.[1])?p[1]:[];for(let h of m){let g=V(h);if(g===f||g.startsWith(f))return String(h)}return null}async function u(f,p){let m=await c.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(p.replace(/ /g,"_"))}`);if(!m)return null;let h=String(m.extract??""),g=Number(m.revision),b={term:f,title:String(m.title??p),text:h,summary:el(h,Zc),url:String(m.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(p.replace(/ /g,"_"))}`),revid:g},y=o;if(!y)try{y=bn()}catch{y=null}let $=y?Q$(h,y):null;return $&&(b.isa=$),Gi(b)?b:null}async function d(f){let p=await c.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(f)}&limit=3`),m=p?l(f,p):null;return m?u(f,m):null}return{name:a,origin:t,provenanceTag(f){return Vi(a,f)},async lookup(f){let p=String(f??"");return p?c.cachedFetch(p,()=>d(p)):null},async pageByTitle(f){let p=String(f??"").trim();return p?c.cachedFetch(`title\0${V(p)}`,()=>u(V(p),p)):null},async linkedTitles(f,{limit:p=25}={}){let m=String(f??"").trim();if(!m)return null;let h=await c.cachedFetch(`links\0${V(m)}`,async()=>{let b=(await c.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(m)}§ion=0`))?.parse?.links;if(!Array.isArray(b))return null;let y=new Set,$=[];for(let E of b){if(!E||E.ns!==0||E.exists===!1)continue;let R=String(E.title??E["*"]??"").trim(),v=V(R);!R||!v||y.has(v)||(y.add(v),$.push(R))}return $});return Array.isArray(h)?h.slice(0,Math.max(0,p)):null}}}function PO(e={}){return NO({origin:IO,sourceName:nv,waitForSlot:!0,...e})}var CO,IO,OO,nv,LO,sv=N(()=>{nt();is();Pr();Mr();qi();CO="https://en.wikipedia.org",IO="https://simple.wikipedia.org",OO="wikipedia-live",nv="simple-wikipedia",LO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";sl({name:nv,create:PO})});function VO(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!rv.test(r))continue;let i=V(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function HO(e){let t=[];for(let[n,s]of Object.entries(UO)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=GO)return t;if(r>=WO)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");rv.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function qO(e,t,n){for(let s of BO)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function KO({fetchImpl:e,origin:t=MO,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=zO,waitForSlot:r=!1,sourceName:i=ov}={}){let a=Hi({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),c=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(5),...d})}`;async function l(d){let f=new Map;if(!d.length)return f;let p=await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[m,h]of Object.entries(p?.entities??{})){let g=V(h?.labels?.en?.value??"");g&&f.set(m,g)}return f}async function u(d){let f=await a.fetchJson(c({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),p=f?VO(d,f):null;if(!p)return null;let h=(await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:p})))?.entities?.[p];if(!h)return null;let g=HO(h),b=await l(g.map(k=>k.id)),y=Vi(i,d),$=[],E=new Set;for(let k of g){let w=b.get(k.id);!w||w===d||E.has(`${k.predicate}\0${w}`)||(E.add(`${k.predicate}\0${w}`),$.push({subject:d,predicate:k.predicate,object:w,provenance:y}))}let R=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:R,summary:el(R,Zc),url:`${t}/wiki/${p}`,revid:Number(h.lastrevid),source:FO,licence:DO},j=qO(g,b,d);return j&&(v.isa=j),$.length&&(v.facts=$),ev(v)?v:null}return{name:i,origin:t,provenanceTag(d){return Vi(i,d)},async lookup(d){let f=V(d??"");return f?a.cachedFetch(f,()=>u(f)):null}}}function YO(e={}){return KO({waitForSlot:!0,...e})}var MO,ov,FO,DO,zO,UO,BO,WO,GO,rv,iv=N(()=>{nt();Pr();Mr();qi();MO="https://www.wikidata.org",ov="wikidata",FO="Wikidata",DO="CC0 1.0",zO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",UO=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),BO=["P279","P31"],WO=3,GO=12,rv=/^Q[1-9][0-9]*$/;sl({name:ov,create:YO})});var XO,JO,yV,Zf=N(()=>{nt();is();cr();Mr();XO=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),JO=["this","is","about","the"],yV=JO.length});var av=N(()=>{Lt();Ye()});var ep,il,Ki=N(()=>{ep=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),il=new Set([...ep,"property","concept","idea","content"])});var cv=N(()=>{nt();zf();Ki()});var lv=N(()=>{nt()});var uv=N(()=>{nt()});var QO,dv,fv,pv,BV,mv=N(()=>{uv();qi();QO=250,dv=Object.freeze([{id:"wikimedia-featured",name:"Wikimedia featured feed",kind:"contemporary",format:"wikimedia-feed",url:"https://api.wikimedia.org/feed/v1/wikipedia/en/featured",homepage:"https://www.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"hacker-news",name:"Hacker News",kind:"contemporary",format:"hn",url:"https://hacker-news.firebaseio.com/v0",homepage:"https://news.ycombinator.com/",licence:"user-submitted, discussion linked",browserVerified:"2026-08-08",minIntervalMs:QO,enabledByDefault:!0},{id:"usgs-quakes",name:"USGS earthquakes",kind:"contemporary",format:"usgs",url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",homepage:"https://earthquake.usgs.gov/",licence:"US public domain",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"nyt-world",name:"NYT World News",kind:"contemporary",format:"rss",url:"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",homepage:"https://www.nytimes.com/section/world",licence:"personal use with attribution",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1},{id:"wikinews-published",name:"Wikinews",kind:"contemporary",format:"mediawiki",url:"https://en.wikinews.org/w/api.php",homepage:"https://en.wikinews.org/",licence:"CC BY 2.5",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1},{id:"simple-wikipedia",name:"Simple English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://simple.wikipedia.org",homepage:"https://simple.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wikidata",name:"Wikidata",kind:"kb",format:"wikidata",url:"https://www.wikidata.org",homepage:"https://www.wikidata.org/",licence:"CC0 1.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"wiktionary",name:"Wiktionary",kind:"kb",format:"wiktionary",url:"https://en.wiktionary.org",homepage:"https://en.wiktionary.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!0},{id:"dbpedia-lookup",name:"DBpedia Lookup",kind:"kb",format:"dbpedia-lookup",url:"https://lookup.dbpedia.org",homepage:"https://www.dbpedia.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1},{id:"english-wikipedia",name:"English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://en.wikipedia.org",homepage:"https://en.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:2e3,enabledByDefault:!1}]),fv=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes"]),pv=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),BV=new Map(dv.map(e=>[e.id,e]))});var Et,GV,VV,HV,qV,KV,YV,XV,JV,QV,ZV,eH,tH,nH,sH,oH,rH,iH,aH,cH,tp=N(()=>{Et=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},GV=Et("createRequire"),VV=Et("readFileSync"),HV=Et("access"),qV=Et("readFile"),KV=Et("writeFile"),YV=Et("appendFile"),XV=Et("mkdir"),JV=Et("mkdtemp"),QV=Et("rename"),ZV=Et("unlink"),eH=Et("rm"),tH=Et("stat"),nH=Et("copyFile"),sH=Et("readdir"),oH=Et("createReadStream"),rH=Et("createWriteStream"),iH=Et("randomBytes"),aH=Et("spawnSync"),cH=Et("createInterface")});var hv=N(()=>{});var gv=N(()=>{Lt();tp();Ye();Yi();Hc();Yc();qe();Kt();hv();nt();Kc();is()});var oq,rq,iq,aq,sp=N(()=>{nt();cv();lv();At();is();qn();mv();qi();Mr();gv();Yc();oq=Object.freeze({sources:fv,kbSources:pv,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),rq=6*36e5,iq=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),aq=ms.teach});var op=N(()=>{nt()});var oL,yq,bv=N(()=>{Po();nl();to();Ye();op();nt();oL={},yq=te(be(qt(oL.url)),"..","..","..")});var vq,xq,Eq,wv=N(()=>{vq=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),xq=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),Eq=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var kq,iL,Rq,yv=N(()=>{vn();kq=Object.freeze({inline:"inline",enumerated:"enumerated"}),iL=new Set(["in","on","at","for","with","from","of","into","onto"]),Rq=new Set([...iL,"to","behind","before","near","next","along","alongside","under","over","between","among","during","without","about","by","as","like","that","if","when","while","being","because","since","until","so","and","but","or","immediately","likely","usually","normally","currently","is","are","was","were","do","does","did","has","have","had","will","would","could","should","might","must","can"])});function Xi(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function al(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let c=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(aL);if(!c.length)break;let l=o?c.filter(d=>d===o||ip(d,t).has(o)):[];a=(l.length?l:c)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function ip(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function ap(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,ap(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function cL(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function lL(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=ip(e,n),l=ip(t,n);if(c.has(t)||l.has(e))return{distinct:!1,reason:"subsumes",lcs:c.has(t)?t:e};if(s.size)for(let h of c){let g=s.get(h);if(g){for(let b of l)if(g.has(b))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...c].filter(h=>l.has(h));if(!u.length)return c.size<2||l.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=h=>ap(h,n,o,new Set),f=u[0],p=d(f);for(let h of u){let g=d(h);(g>p||g===p&&h<f)&&(f=h,p=g)}if(p<=i)return{distinct:!0,reason:"root-subsumer",lcs:f};if(a){let h=a.get(f);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:f}:{distinct:!1,reason:"shared-lineage",lcs:f}}return 2*p/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:f}:{distinct:!1,reason:"shared-lineage",lcs:f}}function cl(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],c=n||Xi(t),l=cL(s),u=new Map,d=new Map(a.map(y=>[y,y])),f=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},p=(y,$)=>{let E=f(y),R=f($);E!==R&&d.set(E<R?R:E,E<R?E:R)},m=[];for(let y=0;y<a.length;y+=1)for(let $=y+1;$<a.length;$+=1){let E=lL(a[y],a[$],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[y],b:a[$],...E}),E.distinct||p(a[y],a[$])}let h=new Map;for(let y of a){let $=f(y);h.has($)||h.set($,[]),h.get($).push(y)}let g=y=>ap(y,c,u,new Set),b=[...h.values()].map(y=>{let $=[...y].sort(),E=$[0],R=g(E);for(let v of $){let j=g(v);j>R&&(R=j,E=v)}return{objects:$,label:E}}).sort((y,$)=>y.label.localeCompare($.label));return{split:b.length>1,clusters:b,pairs:m}}var aL,ll=N(()=>{At();Ki();aL=(e,t)=>e<t?-1:e>t?1:0});function cp(e){return typeof e=="string"&&uL.test(e)}function $v(e){return!!e&&typeof e=="object"&&Mo(e.s)}function lp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&cp(e.world)&&Mo(e.subject)&&Mo(e.predicate)&&Mo(e.object)}function up(e){if(!e||typeof e!="object"||e.kind!=="rule"||!cp(e.world)||!Mo(e.name)||!fL.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(Mo)}function dp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&cp(e.world)&&Mo(e.opening)}function vv(e){return lp(e)||up(e)||dp(e)}function xv(e){let t=e||[],n=t.filter(l=>l.predicate===pL).sort((l,u)=>`${l.subject}\0${l.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(l=>l.predicate==="rdf:type").map(l=>l.subject)),o=new Map;for(let l of t)l.predicate==="mgx:located-in"&&o.set(l.subject,l.object);let r=(l,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===l&&o.get(d.subject)===u),i=t.find(l=>typeof l.world=="string"&&l.kind==="fact"),a=(l,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:l,predicate:u,object:d}),c=[];for(let l of n){let u=l.subject,d=l.object;if(r(d,u))continue;let f=d,p=1;for(;s.has(f);)p+=1,f=`${d}-${p}`;s.add(f),c.push(a(f,"rdf:type",d)),c.push(a(f,"rdf:type","portable")),c.push(a(f,"mgx:located-in",u))}return c.length?[...t,...c]:t}var uL,dL,fL,Mo,pL,Fo=N(()=>{uL=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,dL=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),fL=new Set(dL),Mo=e=>typeof e=="string"&&e.trim()!=="";pL="mgx:default-contains"});var Oq,Lq,Nq,ul=N(()=>{Oq=Object.freeze(["mgx:consumes","mgx:display-name","mgx:evades","mgx:guards","mgx:hasMass","mgx:is-predator","mgx:mass-drain-per-turn","mgx:model","mgx:pursues","mgx:vision-radius"]),Lq=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),Nq=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var dl=N(()=>{});var mL,hL,gL,bL,wL,yL,$L,vL,xL,EL,SL,jL,kL,RL,_L,TL,AL,zq,CL,Ev,Uq,Bq,Sv=N(()=>{is();rr();mL="subClassOf",hL="typeAssertion",gL="relation",bL="someValuesFrom",wL="cardinality",yL="disjointWith",$L="possessive",vL="adjective",xL="capability",EL="union",SL="complement",jL="negativeType",kL="enumeration",RL="differentFrom",_L="bareExistential",TL="transitiveRole",AL="inverseRole",zq=Object.freeze([mL,hL,gL,bL,wL,yL,$L,vL,xL,EL,SL,jL,kL,RL,_L,TL,AL]),CL=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Ev=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),Uq=Math.max(...[...Ev.keys()].map(e=>e.split(" ").length)),Bq=[...new Set([...CL,...[...Ev.keys()].map(e=>e.split(" ")[0])])]});var Do=N(()=>{});var fp=N(()=>{Me();Yn();Do()});function Dt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:no.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var IL,no,ve,OL,zo,dt,Jt,cn,LL,jv,Ft,NL,PL,kv,Yq,Xq,Jq,Fr=N(()=>{IL=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),no=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),ve=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),OL=Object.freeze([ve.MemoryTerm]),zo=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),dt=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:no.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Jt=()=>Object.freeze({type:no.Precondition,pred:zo.graphLoaded}),cn=(e,t)=>Object.freeze({type:no.Precondition,pred:zo.resolves,param:e,as:t}),LL=e=>Object.freeze({type:no.Precondition,pred:zo.anyPresent,params:Object.freeze([...e])}),jv=()=>Object.freeze({type:no.Precondition,pred:zo.memoryFacts}),Ft=(e,t=null)=>Object.freeze({type:no.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});NL=Object.freeze([Dt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[dt("query",ve.Query,{required:!1,note:"required unless a kind filter is given"}),dt("kind",ve.Kind,{required:!1}),dt("name",ve.Query,{required:!1}),dt("decorator",ve.Query,{required:!1})],preconditions:[Jt(),LL(["query","kind"])],add:[Ft("matches","query")]}),Dt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("description","symbol")]}),Dt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("signature","symbol")]}),Dt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[dt("module",ve.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Jt(),cn("module",ve.Symbol)],add:[Ft("impact","module")]}),Dt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[dt("class",ve.Class,{arg:"class"})],preconditions:[Jt(),cn("class",ve.Class)],add:[Ft("members","class")]}),Dt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[dt("class",ve.Class,{arg:"class"})],preconditions:[Jt(),cn("class",ve.Class)],add:[Ft("subclasses","class")]}),Dt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[dt("module",ve.Module)],preconditions:[Jt(),cn("module",ve.Module)],add:[Ft("exports","module")]}),Dt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("callers","symbol")]}),Dt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("callees","symbol")]}),Dt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("calls","symbol")]}),Dt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("tests","symbol")]}),Dt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Jt()],add:[Ft("untested",null)]}),Dt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("history","symbol")]}),Dt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[dt("symbol",ve.Symbol)],preconditions:[Jt(),cn("symbol",ve.Symbol)],add:[Ft("cochanges","symbol")]}),Dt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[dt("package",ve.Package,{required:!1})],preconditions:[Jt()],add:[Ft("architecture","package")]}),Dt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[dt("term",ve.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[jv(),cn("term",ve.MemoryTerm)],add:[Ft("related","term")]}),Dt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[dt("class",ve.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),dt("expression",ve.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),dt("size",ve.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[jv(),cn("class",ve.MemoryTerm)],add:[Ft("sprite","class")]})]),PL=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),kv=NL,Yq=PL(kv),Xq=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),Jq=Object.freeze({prefixes:IL,vocab:no,kinds:ve,precond:zo,get capabilities(){return kv}})});var pp=N(()=>{Fr()});var mp=N(()=>{qn()});var hp=N(()=>{Fr()});function UL(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(Fs,n)&&(t.expression=n),!t.size&&Di([{predicate:zL,object:n}])!==1&&(t.size=n);return t}var yK,$K,vK,xK,zL,EK,gp=N(()=>{Yn();Gn();Mc();nt();Me();pa();Of();Fr();hp();yK=new RegExp(`\\b(?:${Object.keys(Bn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),$K=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),vK=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),xK=Object.freeze({}),zL="mgx:hasProperty";EK=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:UL},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var Tv=N(()=>{});var WL,Av=N(()=>{gp();Fr();hp();Tv();Yn();WL=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var fl=N(()=>{dl();mp();gp();Av();Fr();pp()});function HL(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||te(VL,"corpus","worlds")}function Cv(e){try{return tl(Or(e))}catch{return null}}function Iv(e){if(wp.has(e))return wp.get(e);let t=null,n=Cv(te(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return wp.set(e,t),t}function qL(e,t){let n=Iv(e);if(!n)return null;let s=n[String(t??"")];if(!$v(s))return null;let o=`${e}\0${t}`;if(yp.has(o))return yp.get(o);let r=null,i=Cv(te(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],c=[],l=null;for(let u of i.toString("utf8").split(`
|
|
167
|
+
`))if(u.trim())try{let d=JSON.parse(u);if(!vv(d)||d.world!==t)continue;lp(d)?a.push(d):up(d)?c.push(d):dp(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:xv(a),rules:c,meta:l})}return yp.set(o,r),r}var YL,VL,wp,yp,KL,qK,pl=N(()=>{Po();nl();to();Ye();Fo();YL={},VL=te(be(qt(YL.url)),"..","..","..");wp=new Map,yp=new Map;KL=e=>({list:async()=>{let t=Iv(e());return t?Object.keys(t).sort():null},load:async t=>qL(e(),t)}),qK=KL(()=>HL())});var nY,Ov=N(()=>{Lt();Ye();Ds();ei();qn();qe();nY=te(".tmct","memory","blocks")});var Lv=N(()=>{Do()});var Pv=N(()=>{Ds();ei();Do()});var $p=N(()=>{Ds();ei();Do()});var Mv=N(()=>{$p();Ds();Us();Do()});var Fv=N(()=>{});var Dv=N(()=>{Lv();Pv();$p();Mv();Fv();Do()});var zv=N(()=>{Ov();qe();Ya();Hc();Dv();fp()});var Uv=N(()=>{vn();rr()});function Dr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function hl(e){let t=n=>ZL.map((s,o)=>`--${n}-t${o+1}: ${Dr(e[n],s)};`).join(" ");return[`--bg: ${e.bg}; --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --card: ${e.card};`,`--taught: ${e.taught}; --corpus: ${e.corpus}; --entail: ${e.entail}; --alert: ${e.alert};`,t("taught"),t("corpus"),t("entail"),`--taught-soft: ${Dr(e.taught,.12)}; --corpus-soft: ${Dr(e.corpus,.12)};`,`--entail-soft: ${Dr(e.entail,.14)}; --alert-soft: ${Dr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${Dr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var ml,ZL,QY,vp=N(()=>{Uv();ml=Object.freeze({light:Object.freeze({bg:"#F7F6F2",ink:"#23272B",muted:"#6E7168",line:"#DDD9D0",card:"#FFFFFF",taught:"#2E7D4F",corpus:"#5A80AC",entail:"#B07C2E",alert:"#B0503F",popRimAlpha:.66,popShadow:"0 1px 1.2px rgba(0, 0, 0, .30)"}),dark:Object.freeze({bg:"#15181C",ink:"#E7E5DF",muted:"#9A9E95",line:"#2B3036",card:"#1C2126",taught:"#5FBE8B",corpus:"#6C93BF",entail:"#D9A554",alert:"#D08070",popRimAlpha:.45,popShadow:"0 1px 1.4px rgba(0, 0, 0, .55)"})}),ZL=[.35,.65,1];QY=`
|
|
168
|
+
:root { color-scheme: light dark; ${hl(ml.light)} }
|
|
169
|
+
@media (prefers-color-scheme: dark) { :root { ${hl(ml.dark)} } }
|
|
170
|
+
:root[data-theme="dark"] { ${hl(ml.dark)} }
|
|
171
|
+
:root[data-theme="light"] { ${hl(ml.light)} }
|
|
172
|
+
`});var Bv=N(()=>{vp()});var Wv=N(()=>{vp()});var Vv=N(()=>{qe();Fo();vn();zr()});var qv=N(()=>{Us();qe();dl();fl();zr()});var Ep,aN,cN,lN,uN,dN,fN,J3,Q3,zr=N(()=>{Fo();ul();dl();Sv();is();Uc();fp();pp();fl();mp();pl();qe();zv();Bv();Wv();Vv();qv();Ep="mgx:world-epoch",aN=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),cN=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),lN="mgx:is-open",uN="mgx:hasMass",dN="mgx:knows-about",fN="mgx:display-name",J3=new Set([...aN,...cN,lN,uN,dN,fN,"rdf:type",Ep]),Q3=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var Ur,e5,t5,n5,s5,o5,r5,so=N(()=>{Ur=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),e5=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),t5=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),n5=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),s5=Object.freeze({teach:"teach"}),o5=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),r5=Object.freeze({max_depth:"maxDepth"})});var Yv,pN,bl,mN,hN,Xv,Jv,gN,bN,c5,wN,yN,Qv=N(()=>{so();Yv="spider-fly",pN=10,bl=Object.freeze({x:2,y:2}),mN=1,hN=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),Xv=(e,t)=>`cell-${e}-${t}`,Jv=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),gN=(e,t)=>Jv(e,t,bl.x,bl.y)<=mN,bN=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),c5=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),wN="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",yN=Object.freeze({name:Yv,gridSize:pN,opening:wN,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:gN,webHomeCell:Xv(bl.x,bl.y)})});var Zv,sx,d5,f5,p5,Sp,ex,tx,nx,jp,m5,h5,wl=N(()=>{so();Zv=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),sx=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),d5=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),f5=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),p5=Object.freeze([Zv.spawnedFood,Zv.placedFood]),Sp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),ex=Sp({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),tx=Sp({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),nx=Sp({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),jp=Object.freeze({[ex.name]:ex,[tx.name]:tx,[nx.name]:nx}),m5=Object.freeze(Object.keys(jp)),h5=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var ox=N(()=>{});var rx=N(()=>{});var Qi,B5,RN,_N,TN,AN,CN,IN,ON,LN,NN,PN,MN,FN,DN,zN,UN,BN,WN,W5,kp=N(()=>{wl();ox();Us();qe();Fo();rx();nt();so();ul();zr();Qi=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),B5=Object.freeze(["predator","prey"]),RN="mgx:currently-in",_N="mgx:hasMass",TN="mgx:feels",AN="mgx:facing",CN="mgx:driven-facing",IN="mgx:eaten-by",ON="mgx:starved",LN="mgx:placed-by",NN="mgx:model",PN="mgx:rotation",MN="mgx:carrying",FN="mgx:prey-eaten",DN="mgx:web-built-at-turn",zN="mgx:laid-at-turn",UN="mgx:hatched-into",BN="mgx:turn-played",WN=new Set([RN,_N,TN,AN,CN,IN,ON,LN,NN,PN,BN,MN,FN,DN,zN,UN,"rdf:type",Ep]),W5=Object.freeze([...WN].sort())});var a4,c4,ax=N(()=>{Qv();wl();kp();Fo();pl();qe();so();a4=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),c4=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var R4,_4,T4,A4,C4,I4,qN,KN,YN,XN,cx,lx,JN,O4,L4,ux=N(()=>{wl();kp();zr();vn();Fo();pl();qe();so();ul();R4=Qi.predator.kind,_4=Qi.prey.kind,T4=Qi.food.spawnedKind,A4=Qi.food.placedKind,C4=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),I4=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),qN="mgx:currently-in",KN="mgx:hasMass",YN="mgx:feels",XN="mgx:facing",cx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",lx="(fox|goblin)(?:-(\\d+))?",JN="(crumb|morsel)(?:-(\\d+))?",O4=[{kind:"placement",predicate:qN,re:new RegExp(`^(?:the\\s+)?${cx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:KN,re:new RegExp(`^(?:the\\s+)?${cx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:YN,re:new RegExp(`^(?:the\\s+)?${lx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:XN,re:new RegExp(`^(?:the\\s+)?${lx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],L4=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${JN}\\s+there[.!\\s]*$`,"i")});var St,P4,M4,F4,D4,z4,U4,B4,W4,G4,V4,H4,q4,K4,Y4,X4,J4,Q4,Z4,QN,dx=N(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},P4=St("createRequire"),M4=St("readFileSync"),F4=St("access"),D4=St("readFile"),z4=St("writeFile"),U4=St("appendFile"),B4=St("mkdir"),W4=St("mkdtemp"),G4=St("rename"),V4=St("unlink"),H4=St("rm"),q4=St("stat"),K4=St("copyFile"),Y4=St("readdir"),X4=St("createReadStream"),J4=St("createWriteStream"),Q4=St("randomBytes"),Z4=St("spawnSync"),QN=St("createInterface")});var jt,tX,nX,sX,oX,rX,iX,aX,cX,lX,uX,dX,fX,pX,mX,hX,gX,bX,fx,wX,Rp=N(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},tX=jt("createRequire"),nX=jt("readFileSync"),sX=jt("access"),oX=jt("readFile"),rX=jt("writeFile"),iX=jt("appendFile"),aX=jt("mkdir"),cX=jt("mkdtemp"),lX=jt("rename"),uX=jt("unlink"),dX=jt("rm"),fX=jt("stat"),pX=jt("copyFile"),mX=jt("readdir"),hX=jt("createReadStream"),gX=jt("createWriteStream"),bX=jt("randomBytes"),fx=jt("spawnSync"),wX=jt("createInterface")});var px=N(()=>{Rp();Ye();Lt();Ye();Ti();Kt()});var mx=N(()=>{});var ZN,hx=N(()=>{Lt();Ye();qe();mx();ZN=te(".tmct","sessions")});var gx=N(()=>{Lt();Ye();Bc()});var bx,yl,wx=N(()=>{bx=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),yl=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var kt,DX,zX,UX,BX,WX,GX,VX,HX,qX,KX,YX,XX,JX,QX,ZX,e8,t8,n8,yx,$x=N(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},DX=kt("createRequire"),zX=kt("readFileSync"),UX=kt("access"),BX=kt("readFile"),WX=kt("writeFile"),GX=kt("appendFile"),VX=kt("mkdir"),HX=kt("mkdtemp"),qX=kt("rename"),KX=kt("unlink"),YX=kt("rm"),XX=kt("stat"),JX=kt("copyFile"),QX=kt("readdir"),ZX=kt("createReadStream"),e8=kt("createWriteStream"),t8=kt("randomBytes"),n8=kt("spawnSync"),yx=kt("createInterface")});var jx={};Ot(jx,{CONTEXT_PASSAGE_PREDICATE:()=>xx,CO_OCCURS_PREDICATE:()=>$l,ingestUnknownFromAssertions:()=>n0,knownTermsFrom:()=>Ex,passageFor:()=>Sx});function Ex(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==yt)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(V(r)),i&&n.add(V(i))}for(let s of t||[])s?.subject&&n.add(V(s.subject)),s?.object&&n.add(V(s.object));return n}function Sx(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=oo(e?.start),o=oo(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function t0(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<vx;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(e0.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=vx))break}return o}async function n0(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await ut(e),c=Ex(a,s),l=new Set,u=[];for(let p of t){if(l.size>=i)break;let m=n.get(p.rel);if(!m||m.ace!=="none")continue;let h=oo(p.start),g=oo(p.end);if(!h||!g)continue;let b=V(h),y=V(g),$=!c.has(b),E=!c.has(y);if(!$&&!E)continue;let R=Sx(p,m);if(!R)continue;let v=[[h,g,$],[g,h,E]];for(let[j,k,w]of v){if(!w||l.size>=i)continue;let S=V(j);if(l.has(S))continue;let x=`${r} ${p.rel}`;u.push({subject:j,predicate:xx,object:R,provenance:x}),u.push({subject:j,predicate:$l,object:k,provenance:x});let A=t0(R,c,new Set([b,y]));for(let L of A)u.push({subject:j,predicate:$l,object:L,provenance:x});l.add(S),c.add(S)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await rs(e,u),f=u.filter(p=>p.predicate===$l).length;return{captured:l.size,linked:f,appended:d.appended,skipped:d.skipped}}var xx,$l,e0,vx,kx=N(()=>{qe();vl();xx="mgx:contextPassage",$l="mgx:coOccursWith",e0=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),vx=3});var Rx={};Ot(Rx,{MAP_FILE:()=>ea,SEON_CONCEPTS_FILE:()=>xl,SEON_DEFINITIONS_FILE:()=>s0,SLICE_FILE:()=>Zi,TIER2_DIR:()=>as,TIER2_MANIFEST_FILE:()=>o0,WORDNET_DIR:()=>ta,loadMap:()=>Sl,loadSlice:()=>El,seedMemory:()=>i0,termText:()=>oo,toFacts:()=>jl});async function El(e=Zi){let t=yx({input:D$(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function Sl(e=ea){let n=Co(await Ae(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!r0.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function jl(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=oo(o.start),a=oo(o.end);if(!i||!a)continue;let c=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${c} ${o.rel}`})}return s}async function i0(e,{limit:t,slicePath:n=Zi,mapPath:s=ea,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([El(n),Sl(s)]),u=jl(c,l,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map(($,E)=>[$,E]));u=u.slice().sort(($,E)=>(y.get($.predicate)??o.length)-(y.get(E.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,$,E)=>`${V(y)} ${$} ${V(E)}`,f=new Set,p=await ut(e);for(let y of p.individuals||[]){if(y?.class!=="Fact")continue;let $=E=>(y.attributes||[]).find(R=>R.key===E)?.value;f.add(d($("subject"),$("predicate"),$("object")))}let m=0,h=[];for(let y of u){let $=d(y.subject,y.predicate,y.object);if(f.has($)){m+=1;continue}f.add($),h.push(y)}let g=await rs(e,h),b;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(kx(),jx));b=await y(e,{assertions:c,map:l,mappedFacts:u,memory:p,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:g.appended,skipped:m+g.skipped,total:u.length,...b?{unknown:b}:{}}}var a0,Br,Zi,ea,xl,s0,as,o0,ta,p8,r0,oo,vl=N(()=>{Po();Lt();$x();to();Ye();xc();qe();a0={},Br=te(be(qt(a0.url)),"..","..",".."),Zi=te(Br,"corpus","conceptnet","slice.jsonl"),ea=te(Br,"src","adapters","corpus","conceptnet-map.toml"),xl=te(Br,"corpus","domains","code","concepts.jsonl"),s0=te(Br,"corpus","domains","code","definitions.jsonl"),as=te(Br,"corpus","tier2"),o0=te(as,"manifest.json"),ta=te(Br,"corpus","wordnet"),p8=te(ta,"manifest.json"),r0=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);oo=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var Ox={};Ot(Ox,{BUILTIN_EXTENSIONS:()=>d0,EXTENSION_KINDS:()=>kl,activeDomainPacks:()=>Ip,defaultCodeDomainPacks:()=>Ix,defaultCodeLaneVocab:()=>Cx,mergedLaneVocab:()=>Cp,mergedLexiconExtra:()=>Ax,resolveExtensions:()=>Tx,seedActiveCorpusEntries:()=>m0,validateExtensionEntry:()=>_x,validateExtensionPack:()=>g0});function Rl(){return{seon:{kind:"corpus",active:!1,corpusPath:xl,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:xl,provenancePrefix:"corpus:seon",vocabPath:l0,vocabData:bx,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:Zi,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:u0},human:{kind:"corpus",active:!0,corpusPath:te(as,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:te(as,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:te(as,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:te(as,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:_p,vocabData:yl,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:te(as,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:_p,vocabData:yl,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:te(as,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:_p,vocabData:yl,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:te(as,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:te(ta,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:te(ta,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:te(c0,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function _x(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!kl.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${kl.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function p0(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${kl.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=f0(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function Tx(e,{configFile:t}={}){let n=e?await jc(e,t?{file:t}:{}):null,s=Rl(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let f of i){let p=p0(f,s[f]||null,o[f]||{},e||process.cwd());_x(f,p),a.set(f,p)}let c={};for(let[f,p]of Object.entries(r)){if(typeof p!="number"||!Number.isFinite(p))throw new Error(`[bias] "${f}": bias must be a finite number, got ${JSON.stringify(p)}`);c[f]=p}let u=["seon","conceptnet",...[...a.keys()].filter(f=>f!=="seon"&&f!=="conceptnet").sort()].filter(f=>a.has(f));return{entries:new Map(u.map(f=>[f,a.get(f)])),biasByBundle:c}}async function m0(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(vl(),Rx)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,c=0,l=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let p=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:p.appended,skipped:p.skipped,total:p.total},a+=p.appended,c+=p.skipped,l+=p.total}catch(p){i[u]={appended:0,skipped:0,total:0,error:p&&p.message?p.message:String(p)}}return{appended:a,skipped:c,total:l,perBundle:i}}async function Ax(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Ae(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function Cp(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Ae(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function Cx(){if(!Tp){let e={...Rl().code,active:!0};Tp=Cp(new Map([["code",e]]),{})}return Tp}async function h0(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Ae(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function Ip(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await h0(o.name,o.entry));return s}function Ix(){if(!Ap){let e={...Rl().code,active:!0};Ap=Ip(new Map([["code",e]]),{})}return Ap}async function g0(e,t){let n=[],s=o=>o&&(Gl(o)?o:Ut(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await El(o),i=await Sl(s(t.mapPath)||ea),a=jl(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(is(),K$)),i=JSON.parse(await Ae(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(Wc(),M$)),i=await r(o),a=[...i.keys()].filter(c=>!c.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Ae(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,c=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:c}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var Op,c0,l0,_p,kl,u0,d0,f0,Tp,Ap,Lp=N(()=>{Ye();Lt();to();wx();Ti();vl();Op={},c0=te(be(qt(Op.url)),"..","..","corpus","namenet"),l0=te(be(qt(Op.url)),"..","..","corpus","domains","code","vocab.json"),_p=te(be(qt(Op.url)),"..","..","corpus","tier2","vocab-empty.json"),kl=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),u0=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];d0=Object.freeze(Rl());f0=(e,t)=>{if(t==null)return;let n=String(t);return Gl(n)?n:Ut(e,n)};Tp=null;Ap=null});var Lx=N(()=>{});var Nx=N(()=>{Ye();Po();Lt();tp();dx();Rp();Kt();px();Me();hx();Bc();gx();Zr();Lp();Yi();so();Uc();fl();Zf();sp();Mr();Lx()});var Px={};Ot(Px,{proseLemma:()=>y0});function y0(){if(Uo!==void 0)return Uo;try{let e=qc();if(!e)return Uo=null,Uo;let t=e.its,n=new Map;Uo=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{Uo=null}return Uo}var Uo,Mx=N(()=>{Kc()});var Fx={};Ot(Fx,{digestTermFromRows:()=>x0,loadDigestStructureTable:()=>v0,readDigestStructures:()=>$0});var $0,v0,x0,Dx=N(()=>{$0=()=>null,v0=()=>null,x0=()=>null});var Qx={};Ot(Qx,{DEFAULT_MODULE_HOPS:()=>Mp,DEFAULT_PROVE_BRANCHES:()=>Vx,DEFAULT_PROVE_NODES:()=>Hx,DEFAULT_PROVE_STEPS:()=>Gx,TABLEAU_RULE_CONFIDENCE:()=>T0,buildTableauKb:()=>X0,canonicalKey:()=>Ve,extractTableauModule:()=>Z0,findTableauViolations:()=>Q0,isSatisfiable:()=>Dp,proveEntailment:()=>q0,proveSubsumption:()=>K0,toNNF:()=>ln});function Ve(e){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("canonicalKey: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return"top";case"bot":return"bot";case"atom":return`atom(${e.name})`;case"nom":return`nom(${e.ind})`;case"not":return`not(${Ve(e.c)})`;case"and":return`and(${e.cs.map(Ve).sort().join(",")})`;case"or":return`or(${e.cs.map(Ve).sort().join(",")})`;case"some":return`some(${e.r},${Ve(e.c)})`;case"all":return`all(${e.r},${Ve(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${Ve(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${Ve(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function na(e,t){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("toNNF: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return t?{t:"bot"}:{t:"top"};case"bot":return t?{t:"top"}:{t:"bot"};case"atom":return t?{t:"not",c:{t:"atom",name:e.name}}:{t:"atom",name:e.name};case"nom":return t?{t:"not",c:{t:"nom",ind:e.ind}}:{t:"nom",ind:e.ind};case"not":return na(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>na(o,t));return s.sort((o,r)=>Ve(o).localeCompare(Ve(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=na(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=na(e.c,!1);return t?e.t==="atLeast"?{t:"atMost",n:e.n-1,r:e.r,c:n}:{t:"atLeast",n:e.n+1,r:e.r,c:n}:{t:e.t,n:e.n,r:e.r,c:n}}default:throw new TypeError(`toNNF: unknown expression tag "${e.t}"`)}}function ln(e){return na(e,!1)}function zt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function Pp(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function j0(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function R0(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function _0(e,t){let n=R0((e||[]).map(([o,r])=>[r,o])),s=new Map;for(let o of t)s.set(o,new Set([o,...n(o)]));return s}function zx(e,t,n){if(t===n)return!0;let s=e&&e.roleClosure?e.roleClosure.get(n):null;return s?s.has(t):!1}function Al(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&zx(t,r.r,s))o.push({to:r.to,fromFacts:r.fromFacts});else if(r.to===n){let i=t&&t.inverseOf?t.inverseOf.get(r.r):null;i&&zx(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function _l(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!A0.test(t)}function sa(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function C0(e,t,n,s){if(t===n)return;let o=sa(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,zt(r?[...r,...s]:s))}function qx(e,t,n,s){return n===s?!1:_l(t,n)&&_l(t,s)?!0:e.inequalityFrom.has(sa(n,s))}function Kx(e,t,n){let s=e.inequalityFrom.get(sa(t,n));return s?s.slice():[]}function I0(e,t,n){let s=_l(e,t),o=_l(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function Yx(e,t,n,s){if(n===s)return n;let[o,r]=I0(t,n,s),i=e.nodes.get(o),a=e.nodes.get(r);if(!i||!a)return o;for(let[d,{expr:f,from:p}]of a.labels){let m=i.labels.get(d);i.labels.set(d,{expr:f,from:m?zt([...m.from,...p]):p.slice()})}let c=[],l=new Map;for(let d of e.edges){let f=d.from===r?o:d.from,p=d.to===r?o:d.to,m=`${f}\u241F${d.r}\u241F${p}`,h=l.get(m);if(h)h.fromFacts=zt([...h.fromFacts,...d.fromFacts]);else{let g={from:f,r:d.r,to:p,fromFacts:d.fromFacts.slice()};l.set(m,g),c.push(g)}}e.edges=c;for(let d of e.nodes.values())d.parent===r&&(d.parent=o);let u=new Map;for(let[d,f]of e.inequalityFrom){let[p,m]=d.split("\u241F"),h=p===r?o:p,g=m===r?o:m;if(h===g)continue;let b=sa(h,g),y=u.get(b);u.set(b,y?zt([...y,...f]):f)}return e.inequalityFrom=u,e.nodes.delete(r),o}function Fp(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Dn(e,t,n){let s=Ve(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:zt(n)}),!0)}function Wr(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Tl(e){if(e.labels.has("bot"))return{nodeId:e.id,keyA:"bot",keyB:"bot",premises:e.labels.get("bot").from.slice()};let t=[...e.labels.keys()].sort();for(let n of t){let{expr:s,from:o}=e.labels.get(n),r=Ve(ln(cs(s)));if(r<=n)continue;let i=e.labels.get(r);if(i)return{nodeId:e.id,keyA:n,keyB:r,premises:zt([...o,...i.from])}}return null}function Bx(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function Xx(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?Bx(t,e.id):null,i=e.parent;for(;i;){let a=t.nodes.get(i);if(!a)break;if(s.length===a.labels.size&&s.every(c=>a.labels.has(c))){if(!o)return!0;let c=Bx(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function Wx(e){let t=new Map;for(let[n,s]of e.nodes)t.set(n,{id:s.id,labels:new Map(s.labels),parent:s.parent,branchedOn:new Set(s.branchedOn),appliedAxioms:new Set(s.appliedAxioms),successorCount:s.successorCount});return{nodes:t,edges:e.edges.slice(),closed:!1,clash:null,inequalityFrom:new Map(e.inequalityFrom)}}function O0(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of Wr(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Dn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function L0(e,t){let n=new Map;for(let o of e.nodes.values())for(let r of o.labels.keys())r.startsWith("nom(")&&(n.has(r)||n.set(r,[]),n.get(r).push(o.id));let s=[...n.keys()].sort();for(let o of s){let r=[...new Set(n.get(o))].sort();if(r.length<2)continue;let[i,a]=r;if(qx(e,t,i,a)){let c=e.nodes.get(i).labels.get(o)?.from||[],l=e.nodes.get(a).labels.get(o)?.from||[];return{kind:"clash",clash:{nodeId:i,keyA:o,keyB:`merge(${i},${a})`,premises:zt([...c,...l,...Kx(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function N0(e,t){let n=t&&t.transitiveRoles instanceof Set?t.transitiveRoles:null;for(let s of e.nodes.values())for(let[,{expr:o,from:r}]of Wr(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Al(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Dn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Dn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function P0(e,t){for(let n of e.nodes.values())for(let s=0;s<t.axioms.length;s+=1){if(n.appliedAxioms.has(s))continue;let o=t.axioms[s];if(n.appliedAxioms.add(s),Dn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function M0(e,t){if(Ve(t)==="bot")return[];let n=Ve(ln(cs(t))),s=e.labels.get(n);return s?s.from:null}function F0(e){for(let t of e.nodes.values())for(let[n,{expr:s,from:o}]of Wr(t)){if(s.t!=="or"||t.branchedOn.has(n))continue;let r=[...s.cs].sort((l,u)=>Ve(l).localeCompare(Ve(u)));if(r.some(l=>t.labels.has(Ve(l)))){t.branchedOn.add(n);continue}let i=r.map(l=>({c:l,clashFrom:M0(t,l)})),a=i.filter(l=>l.clashFrom===null).map(l=>l.c),c=i.filter(l=>l.clashFrom!==null).flatMap(l=>l.clashFrom);return a.length===0?{kind:"clash",clash:{nodeId:t.id,keyA:Ve(r[0]),keyB:Ve(ln(cs(r[0]))),premises:zt([...o,...c])}}:a.length===1?(t.branchedOn.add(n),Dn(t,a[0],[...o,...c]),{kind:"applied",touched:[t.id]}):(t.branchedOn.add(n),{kind:"split",node:t,from:o,disjuncts:a})}return{kind:"none"}}function D0(e,t){for(let n of e.nodes.values())if(!Xx(n,e,t))for(let[,{expr:s,from:o}]of Wr(n)){if(s.t!=="some")continue;let r=Ve(s.c);if(Al(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=Fp(`${n.id}.${n.successorCount}`,n.id);return Dn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()}),{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function z0(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Wr(n)){if(o.t!=="atMost")continue;let i=Ve(o.c),a=[...new Set(Al(e,t,n.id,o.r).map(u=>u.to))].filter(u=>e.nodes.get(u)?.labels.has(i)).sort();if(a.length<=o.n)continue;let c=[];for(let u=0;u<a.length;u+=1)for(let d=u+1;d<a.length;d+=1)c.push([a[u],a[d]]);if(c.length===0){let u=e.nodes.get(a[0])?.labels.get(i)?.from||[];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`witness(${a[0]})`,premises:zt([...r,...u])}}}let l=c.filter(([u,d])=>!qx(e,t,u,d));if(l.length===0){let[u,d]=c[0];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`merge(${u},${d})`,premises:zt([...r,...Kx(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function U0(e,t){for(let n of e.nodes.values())if(!Xx(n,e,t))for(let[,{expr:s,from:o}]of Wr(n)){if(s.t!=="atLeast")continue;let r=Ve(s.c),i=[...new Set(Al(e,t,n.id,s.r).map(c=>c.to))].filter(c=>e.nodes.get(c)?.labels.has(r)).sort();if(i.length>=s.n)continue;n.successorCount+=1;let a=Fp(`${n.id}.${n.successorCount}`,n.id);Dn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()});for(let c of i)C0(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function B0(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Tl(s);if(o)return o}return null}function Bo(e,t){let n=B0(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function W0(e,t){let n=O0(e);if(n.applied)return Bo(e,n.touched);let s=N0(e,t);if(s.applied)return Bo(e,s.touched);let o=L0(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=Yx(e,t,o.a,o.b);return Bo(e,[u])}let r=P0(e,t);if(r.applied)return Bo(e,r.touched);let i=F0(e);if(i.kind==="clash")return i;if(i.kind==="applied")return Bo(e,i.touched);if(i.kind==="split")return i;let a=z0(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=U0(e,t);if(c.applied)return Bo(e,c.touched);let l=D0(e,t);return l.applied?Bo(e,l.touched):{kind:"done"}}function G0(e){let t=[...e.nodes.values()].map(s=>({id:s.id,parent:s.parent,labels:[...s.labels.entries()].sort((o,r)=>o[0].localeCompare(r[0])).map(([,{expr:o,from:r}])=>({expr:o,from:r}))})),n=e.edges.map(({from:s,r:o,to:r,fromFacts:i})=>({from:s,r:o,to:r,fromFacts:i.slice()}));return{nodes:t,edges:n}}function V0(e,t,n){let s=Pp(n.maxSteps,Gx),o=Pp(n.maxBranches,Vx),r=Pp(n.maxNodes,Hx),i=[e],a=0,c=1,l=[];for(;i.length;){let u=i.pop();if(u.closed){l.push(u.clash);continue}if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};for(;;){let d=W0(u,t);if(d.kind==="clash"){l.push(d.clash);break}if(d.kind==="applied"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};continue}if(d.kind==="split"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let f=d.disjuncts.map(p=>{let m=Wx(u),h=m.nodes.get(d.node.id);Dn(h,p,d.from);let g=Tl(h);return g&&(m.closed=!0,m.clash=g),m});for(let p=f.length-1;p>=0;p-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(f[p])}break}if(d.kind==="split-merge"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let f=d.pairs.map(([p,m])=>{let h=Wx(u),g=Yx(h,t,p,m),b=h.nodes.get(g),y=b&&Tl(b);return y&&(h.closed=!0,h.clash=y),h});for(let p=f.length-1;p>=0;p-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(f[p])}break}return{status:"satisfiable",model:G0(u),steps:a,branches:c}}if(c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c}}return{status:"unsatisfiable",clashes:l,steps:a,branches:c}}function H0(e,t){let n=new Map,s=r=>(n.has(r)||n.set(r,Fp(r,null)),n.get(r));for(let r of e.individuals||[])s(r);for(let r of e.assertions||[])Dn(s(r.ind),r.expr,r.from);for(let r of t||[])!r||!r.ind||!r.expr||Dn(s(r.ind),ln(r.expr),r.from||[]);for(let[r,i]of e.nominalIndividuals||[])Dn(s(r),{t:"nom",ind:r},i);let o=new Map;for(let r of e.differentFrom||[]){if(!r||!r.a||!r.b||r.a===r.b)continue;let i=sa(r.a,r.b),a=o.get(i);o.set(i,zt(a?[...a,...r.from]:r.from))}return{nodes:n,edges:[],closed:!1,clash:null,inequalityFrom:o}}function Dp(e,t=[],n={}){let s=H0(e,t);for(let r of s.nodes.values()){let i=Tl(r);if(i){s.closed=!0,s.clash=i;break}}let o=V0(s,e,n);return o.status==="exhausted"?{satisfiable:null,exhausted:o.reason,steps:o.steps,branches:o.branches}:o.status==="satisfiable"?{satisfiable:!0,model:o.model,steps:o.steps,branches:o.branches}:{satisfiable:!1,closedClashes:o.clashes,steps:o.steps,branches:o.branches}}function Jx(e,t,n){let s=Dp(e,t,n);return s.satisfiable===null?{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches}:s.satisfiable===!1?{status:"proved",premises:zt(s.closedClashes.flatMap(r=>r?.premises||[])),steps:s.steps,branches:s.branches}:{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function q0(e,t,n,s={}){return Jx(e,[{ind:t,expr:ln(cs(n)),from:[]}],s)}function K0(e,t,n,s={}){let o=ln(E0([Ke(t),cs(Ke(n))]));return Jx(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function Y0(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function X0(e){let t=Array.isArray(e)?e.filter(_=>_&&_.subject&&_.predicate):[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map,a=new Map,c=new Map,l=[],u=[],d=[],f=[],p=new Set,m=[],h=[],g=[],b=(_,P,G)=>{_.has(P)||_.set(P,[]),_.get(P).push(G)};for(let _ of t){let P=String(_.predicate).trim().toLowerCase();P==="owl:onproperty"?n.set(_.subject,{object:_.object,id:_.id}):P==="owl:somevaluesfrom"?s.set(_.subject,{object:_.object,id:_.id}):P==="owl:onclass"?o.set(_.subject,{object:_.object,id:_.id}):P==="owl:mincardinality"?r.set(_.subject,{kind:"min",n:Number(_.object),id:_.id}):P==="owl:maxcardinality"?r.set(_.subject,{kind:"max",n:Number(_.object),id:_.id}):P==="owl:cardinality"?r.set(_.subject,{kind:"exact",n:Number(_.object),id:_.id}):P==="rdfs:subclassof"?l.push(_):P==="owl:disjointwith"?u.push(_):P==="rdf:type"?(d.push(_),String(_.object||"").toLowerCase()==="transitiveproperty"&&p.add(_.subject)):P==="mgxneg:subclassof"?f.push(_):P==="owl:unionof"?b(i,_.subject,_):P==="owl:complementof"?a.set(_.subject,_):P==="rdfs:subpropertyof"?m.push(_):P==="owl:differentfrom"?h.push(_):P==="owl:oneof"?b(c,_.subject,_):P==="owl:inverseof"&&g.push(_)}let y=new Set;for(let _ of d){let P=String(_.object||"").toLowerCase();Ux.has(P)||y.add(_.subject)}let $=_=>k0.test(_)||y.has(_),E=(_,P,G)=>({sub:_,sup:P,from:zt(G),disjunction:ln(Np([cs(_),P]))}),R=[],v=[];for(let _ of l){let P=_.object;if(!n.has(P)){R.push(E(Ke(_.subject),Ke(P),[_.id]));continue}let G=n.get(P),J=s.get(P);if(J){R.push(E(Ke(_.subject),S0(G.object,Ke(J.object)),[_.id,G.id,J.id]));continue}let q=r.get(P),z=o.get(P);if(q&&z){let B=[_.id,G.id,z.id,q.id];q.kind==="min"?R.push(E(Ke(_.subject),{t:"atLeast",n:q.n,r:G.object,c:Ke(z.object)},B)):q.kind==="max"?R.push(E(Ke(_.subject),{t:"atMost",n:q.n,r:G.object,c:Ke(z.object)},B)):q.kind==="exact"&&(R.push(E(Ke(_.subject),{t:"atLeast",n:q.n,r:G.object,c:Ke(z.object)},B)),R.push(E(Ke(_.subject),{t:"atMost",n:q.n,r:G.object,c:Ke(z.object)},B)))}}for(let _ of u)$(_.subject)?v.push({ind:_.subject,expr:ln(cs(Ke(_.object))),from:[_.id]}):R.push(E(Ke(_.subject),ln(cs(Ke(_.object))),[_.id]));for(let _ of d)Ux.has(String(_.object||"").toLowerCase())||v.push({ind:_.subject,expr:Ke(_.object),from:[_.id]});for(let _ of f)v.push({ind:_.subject,expr:ln(cs(Ke(_.object))),from:[_.id]});for(let[_,P]of i){let G=[...P].sort((B,I)=>String(B.object).localeCompare(String(I.object))),J=G.map(B=>Ke(B.object)),q=G.map(B=>B.id),z=ln(Np(J));R.push(E(Ke(_),z,q)),R.push(E(z,Ke(_),q))}for(let[_,P]of a){let G=ln(cs(Ke(P.object)));R.push(E(Ke(_),G,[P.id])),R.push(E(G,Ke(_),[P.id]))}let j=new Map;for(let[_,P]of c){let G=[...P].sort((z,B)=>String(z.object).localeCompare(String(B.object))),J=G.map(z=>({t:"nom",ind:z.object})),q=G.map(z=>z.id);R.push(E(Ke(_),ln(Np(J)),q));for(let z of G){R.push(E({t:"nom",ind:z.object},Ke(_),[z.id]));let B=j.get(z.object);j.set(z.object,B?zt([...B,z.id]):[z.id])}}let k=h.map(_=>({a:_.subject,b:_.object,from:[_.id]})).sort((_,P)=>_.a.localeCompare(P.a)||_.b.localeCompare(P.b)),w=new Map;for(let _ of g)w.set(_.subject,_.object),w.has(_.object)||w.set(_.object,_.subject);let S=new Set;for(let{object:_}of n.values())S.add(_);let x=m.map(_=>[_.subject,_.object]).sort((_,P)=>_[0].localeCompare(P[0])||_[1].localeCompare(P[1])),A=new Set([...S,...x.flat(),...w.keys(),...w.values()]),L=_0(x,A);R.sort((_,P)=>Ve(_.sub).localeCompare(Ve(P.sub))||Ve(_.sup).localeCompare(Ve(P.sup))||_.from.join(",").localeCompare(P.from.join(","))),v.sort((_,P)=>_.ind.localeCompare(P.ind)||Ve(_.expr).localeCompare(Ve(P.expr)));let T=[...new Set(v.map(_=>_.ind))].sort(),O=new Set(T);return{axioms:R,assertions:v,roles:[...S].sort(),individuals:T,transitiveRoles:p,roleClosure:L,namedIndividuals:O,nominalIndividuals:j,differentFrom:k,inverseOf:w}}function J0(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf}}function Q0(e,t=null,n={}){let s=[...new Set(Array.isArray(t)&&t.length?t:e.individuals||[])].sort(),o=[];for(let r of s){let i=J0(e,r);if(!i.assertions.length)continue;let a=Dp(i,[],n);if(a.satisfiable===null||a.satisfiable===!0)continue;let c=zt(a.closedClashes.flatMap(l=>l?.premises||[]));o.push({subject:r,premises:c,kind:Y0(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function ro(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function Z0(e,t,{hops:n=Mp}={}){let s=Array.isArray(e)?e.filter(w=>w&&w.subject&&w.predicate):[],o=j0(n,Mp),r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=new Map;for(let w of s){let S=String(w.predicate).trim().toLowerCase();S==="rdfs:subclassof"?(ro(r,w.subject,w.object),ro(i,w.object,w.subject)):S==="owl:onproperty"?a.set(w.subject,w.object):S==="owl:somevaluesfrom"||S==="owl:onclass"?(c.set(w.subject,w.object),ro(l,w.object,w.subject)):S==="owl:unionof"?(ro(u,w.subject,w.object),ro(d,w.object,w.subject)):S==="owl:complementof"?(f.set(w.subject,w.object),ro(p,w.object,w.subject)):S==="owl:oneof"&&(ro(m,w.subject,w.object),ro(h,w.object,w.subject))}let g=new Map;function b(w){if(g.has(w))return g.get(w);let S=new Set,x=[...r.get(w)||[],...i.get(w)||[]];for(;x.length;){let A=x.pop();if(!S.has(A)){S.add(A);for(let L of r.get(A)||[])S.has(L)||x.push(L);for(let L of i.get(A)||[])S.has(L)||x.push(L)}}return g.set(w,S),S}let y=new Set,$=new Map,E=[];function R(w,S){if(!w)return;let x=$.get(w);x!==void 0&&x>=S||($.set(w,S),E.push({term:w,hopsLeft:S}))}let v=[...new Set((Array.isArray(t)?t:[]).map(w=>V(w)).filter(Boolean))];for(let w of v)R(w,o);let j=0;for(;j<E.length;){let{term:w,hopsLeft:S}=E[j];if(j+=1,$.get(w)===S){y.add(w);for(let x of b(w))y.add(x),R(x,S);if(!(S<=0)){c.has(w)&&R(c.get(w),o);for(let x of l.get(w)||[])R(x,o);for(let x of u.get(w)||[])R(x,S-1);for(let x of d.get(w)||[])R(x,S-1);f.has(w)&&R(f.get(w),S-1);for(let x of p.get(w)||[])R(x,S-1);for(let x of m.get(w)||[])R(x,S-1);for(let x of h.get(w)||[])R(x,S-1)}}}let k=new Set;for(let[w,S]of a)y.has(w)&&k.add(S);return s.filter(w=>{if(y.has(w.subject)||y.has(w.object))return!0;let S=String(w.predicate).trim().toLowerCase();return S==="rdfs:subpropertyof"||S==="owl:inverseof"||S==="rdf:type"&&String(w.object).toLowerCase()==="transitiveproperty"?k.has(w.subject):!1})}var Ke,cs,E0,Np,S0,k0,Ux,Gx,Vx,Hx,T0,Mp,A0,Zx=N(()=>{nt();Ke=e=>({t:"atom",name:e}),cs=e=>({t:"not",c:e}),E0=e=>({t:"and",cs:e}),Np=e=>({t:"or",cs:e}),S0=(e,t)=>({t:"some",r:e,c:t});k0=/[./\\#:@]/;Ux=new Set(["restriction","transitiveproperty","class"]),Gx=5e3,Vx=256,Hx=512,T0=.95,Mp=4,A0=/\.\d+$/});var rE={};Ot(rE,{BOT:()=>un,DEFAULT_EL_BUDGET:()=>Gp,DEFAULT_EL_ROUNDS:()=>Vp,EL_RESTRICTION_RULE:()=>Wp,EL_RULE_CONFIDENCE:()=>zp,EL_SUBSUMPTION_RULE:()=>Bp,ENTAILED_EL_PROVENANCE:()=>sE,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>ra,TOP:()=>io,classifyEl:()=>p1,elGoalAxioms:()=>tE,elGoalFor:()=>nE,elUnsatisfiableClasses:()=>f1,normalizeElTBox:()=>Up,proveElSubsumption:()=>d1,saturateEl:()=>Cl});function e1(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function t1(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Up(e,{budget:t=500}={}){let s=[...(Array.isArray(e)?e:[]).filter(w=>w&&w.id&&w.subject&&w.predicate&&w.object!==void 0&&w.object!==null)].sort((w,S)=>String(w.id).localeCompare(String(S.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=w=>{w&&w!==io&&w!==un&&i.add(w)},l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=[],h=[],g=new Map,b=[];for(let w of r){if(w.subject===io||w.subject===un||w.object===io||w.object===un)continue;let S=w.predicate;o1(S)?(l.set(w.subject,w),c(w.subject)):r1(S)?(u.set(w.subject,w),c(w.subject),c(w.object)):i1(S)?(d.set(w.subject,w),c(w.subject),c(w.object)):u1(S)?(f.set(w.subject,w),c(w.subject)):a1(S)?(p.has(w.subject)||p.set(w.subject,[]),p.get(w.subject).push(w),c(w.subject),c(w.object)):eE(S)?(m.push(w),c(w.subject),c(w.object)):s1(S)?(h.push(w),c(w.subject),c(w.object)):n1(S)&&w.object==="transitiveproperty"?(g.has(w.subject)||g.set(w.subject,w),a.add(w.subject)):c1(S)&&(b.push(w),a.add(w.subject),a.add(w.object))}let y=new Set([...l.keys()].filter(w=>u.has(w))),$=new Map;for(let w of y)$.set(w,{role:l.get(w).object,filler:u.get(w).object});let E=new Map;for(let w of gd(r))w.kind!=="min"&&w.kind!=="exactly"||w.n>=1&&(y.has(w.restriction)||!l.has(w.restriction)||!d.has(w.restriction)||!f.has(w.restriction)||(E.set(w.restriction,w.onClass),$.set(w.restriction,{role:"has",filler:w.onClass})));let R=new Set(p.keys()),v=[],j=new Map;for(let w of m){let S=w.subject,x=w.object;if(R.has(S)){j.has(S)||j.set(S,w);continue}if(y.has(x)){let{role:A,filler:L}=$.get(x),T=l.get(x),O=u.get(x);v.push({form:"someRight",sub:S,role:A,filler:L,from:[w.id,T.id,O.id]}),v.push({form:"someLeft",role:A,filler:L,sup:x,from:[T.id,O.id]});continue}if(E.has(x)){let A=E.get(x),L=l.get(x),T=d.get(x),O=f.get(x);v.push({form:"someRight",sub:S,role:"has",filler:A,from:[w.id,L.id,T.id,O.id]}),v.push({form:"someLeft",role:"has",filler:A,sup:x,from:[L.id,T.id,O.id]});continue}v.push({form:"sub",sub:S,sup:x,from:[w.id]})}for(let[w,S]of p){let x=j.get(w);if(!x)continue;let A=new Map;for(let _ of S)A.has(_.object)||A.set(_.object,_);let L=[...A.keys()].sort();if(L.length<2)continue;let T=L[0],O=[A.get(L[0]).id];for(let _=1;_<L.length;_+=1){let P=L[_],G=_===L.length-1,J=G?x.object:`${T}-and-${P}`,q=[T,P].sort(),z=A.get(P).id,B=G?[...O,z,x.id]:[...O,z];v.push({form:"and",subs:q,sup:J,from:B}),O=[...O,z],T=J}}for(let w of h)v.push({form:"and",subs:[w.subject,w.object].sort(),sup:un,from:[w.id]});let k=[];for(let w of[...g.keys()].sort())k.push({kind:"transitive",role:w,from:[g.get(w).id]});for(let w of[...b].sort((S,x)=>`${S.subject}${ae}${S.object}`.localeCompare(`${x.subject}${ae}${x.object}`)))k.push({kind:"sub",sub:w.subject,sup:w.object,from:[w.id]});return{axioms:v,roleAxioms:k,concepts:i,roles:a,restrictionOf:$,truncated:o}}function Cl(e,{budget:t=2e3,rounds:n=64,focus:s=null}={}){let o=e?.axioms||[],r=e?.roleAxioms||[],i=[...e?.concepts||[]].sort(),a=s instanceof Set?s.size?s:null:t1(s),c=(...x)=>!a||x.some(A=>a.has(A)),l=new Map,u=new Map,d=new Map,f=new Map;for(let x of o)if(x.form==="sub")l.has(x.sub)||l.set(x.sub,[]),l.get(x.sub).push({sup:x.sup,from:x.from});else if(x.form==="and"){let[A,L]=x.subs;for(let[T,O]of[[A,L],[L,A]])u.has(T)||u.set(T,[]),u.get(T).push({other:O,sup:x.sup,from:x.from})}else if(x.form==="someRight")d.has(x.sub)||d.set(x.sub,[]),d.get(x.sub).push({role:x.role,filler:x.filler,from:x.from});else if(x.form==="someLeft"){let A=`${x.role}${ae}${x.filler}`;f.has(A)||f.set(A,[]),f.get(A).push({sup:x.sup,from:x.from})}let p=new Map,m=new Set,h=new Map;for(let x of r)x.kind==="sub"?(p.has(x.sub)||p.set(x.sub,[]),p.get(x.sub).push({sup:x.sup,from:x.from})):x.kind==="transitive"&&(m.add(x.role),h.has(x.role)||h.set(x.role,x.from));let g=new Map;for(let x of i)g.set(x,new Set([x,io]));let b=new Map,y=new Map,$=new Map,E=(x,A)=>x===A?[]:y.get(`${x}${ae}${A}`)||[],R=(x,A)=>$.get(`${x}${ae}${A}`)||[],v=(...x)=>{let A=new Set,L=[];for(let T of x)for(let O of T||[])!O||A.has(O)||(A.add(O),L.push(O));return L},j=0,k=!1,w=0;for(let x=0;x<n;x+=1){w+=1;let A=[];for(let[T,O]of g)for(let _ of O)for(let{sup:P,from:G}of l.get(_)||[])O.has(P)||c(T,_,P)&&A.push({kind:"sub",A:T,X:P,from:v(E(T,_),G),sortKey:`1${ae}${T}${ae}${P}${ae}${_}`});for(let[T,O]of g)for(let _ of O)for(let{other:P,sup:G,from:J}of u.get(_)||[])O.has(P)&&(O.has(G)||c(T,_,P,G)&&A.push({kind:"sub",A:T,X:G,from:v(E(T,_),E(T,P),J),sortKey:`2${ae}${T}${ae}${G}${ae}${[_,P].sort().join(ae)}`}));for(let[T,O]of g)for(let _ of O)for(let{role:P,filler:G,from:J}of d.get(_)||[]){let q=`${T}${ae}${G}`;(b.get(P)||oa).has(q)||c(T,_,G)&&A.push({kind:"role",role:P,A:T,B:G,from:v(E(T,_),J),sortKey:`3${ae}${P}${ae}${T}${ae}${G}${ae}${_}`})}for(let[T,O]of b)for(let _ of O){let[P,G]=_.split(ae),J=g.get(G)||oa;for(let q of J)for(let{sup:z,from:B}of f.get(`${T}${ae}${q}`)||[]){let I=g.get(P);!I||I.has(z)||c(P,G,q,z)&&A.push({kind:"sub",A:P,X:z,from:v(R(T,_),E(G,q),B),sortKey:`4${ae}${P}${ae}${z}${ae}${T}${ae}${G}${ae}${q}`})}}for(let[T,O]of b)for(let _ of O){let[P,G]=_.split(ae);if(!(g.get(G)||oa).has(un))continue;let J=g.get(P);!J||J.has(un)||c(P,G)&&A.push({kind:"sub",A:P,X:un,from:v(R(T,_),E(G,un)),sortKey:`5${ae}${P}${ae}${T}${ae}${G}`})}for(let[T,O]of b)for(let{sup:_,from:P}of p.get(T)||[])for(let G of O){if((b.get(_)||oa).has(G))continue;let[J,q]=G.split(ae);c(J,q)&&A.push({kind:"role",role:_,A:J,B:q,from:v(R(T,G),P),sortKey:`6${ae}${_}${ae}${J}${ae}${q}${ae}${T}`})}for(let T of[...m].sort()){let O=b.get(T);if(O)for(let _ of O){let[P,G]=_.split(ae);for(let J of O){let[q,z]=J.split(ae);if(q!==G)continue;let B=`${P}${ae}${z}`;O.has(B)||c(P,G,z)&&A.push({kind:"role",role:T,A:P,B:z,from:v(R(T,_),R(T,J),h.get(T)),sortKey:`7${ae}${T}${ae}${P}${ae}${z}${ae}${G}`})}}}if(!A.length){k=!0;break}A.sort((T,O)=>T.sortKey<O.sortKey?-1:T.sortKey>O.sortKey?1:0);let L=!1;for(let T of A){if(j>=t)break;if(T.kind==="sub"){let O=g.get(T.A);if(!O||O.has(T.X))continue;O.add(T.X),y.set(`${T.A}${ae}${T.X}`,T.from),j+=1,L=!0}else{b.has(T.role)||b.set(T.role,new Set);let O=b.get(T.role),_=`${T.A}${ae}${T.B}`;if(O.has(_))continue;O.add(_),$.set(`${T.role}${ae}${_}`,T.from),j+=1,L=!0}}if(j>=t)break;if(!L){k=!0;break}}let S=[...g.entries()].filter(([,x])=>x.has(un)).map(([x])=>x).sort();return{subsumers:g,roleEdges:b,unsatisfiable:S,derivationOf:y,rounds:w,truncated:!k}}function tE(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${ae}${a.filler}${ae}${a.sub}`,u=`${c.role}${ae}${c.filler}${ae}${c.sub}`;return l<u?-1:l>u?1:0}),r=[],i=new Set;for(let a of o){let l=[...t?.get(a.filler)||new Set([a.filler,io])].filter(u=>u!==io&&u!==un).sort();for(let u of l){let d=`some-${a.role}-${u}`;if(!i.has(d)&&(i.add(d),r.push({form:"someLeft",role:a.role,filler:u,sup:d,from:[]}),r.length>=n))return r}}return r}function nE(e,t){let n=V(e),s=V(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function d1(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=V(t),a=Up(e,{budget:o}),{axiom:c,name:l}=nE(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},f=Cl(d,{budget:o,rounds:r});return(f.subsumers.get(i)||oa).has(l)?{proved:!0,premises:f.derivationOf.get(`${i}${ae}${l}`)||[]}:{proved:!1,exhausted:f.truncated}}function oE(e,{budget:t=Gp,rounds:n=Vp,focus:s=null}={}){let o=Up(e,{budget:t}),r=Cl(o,{budget:t,rounds:n,focus:s}),i=tE(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Cl(c,{budget:t,rounds:n,focus:s}),u=o.truncated||r.truncated||l.truncated;return{normalized:o,goals:i,goalInfo:a,finalPass:l,truncated:u}}function f1(e,t={}){let{finalPass:n,truncated:s}=oE(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${ae}${un}`)||[],truncated:s}}async function p1(e,{budget:t=Gp,rounds:n=Vp,focus:s=null,maxEnvironments:o=br,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=e1(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:f,goalInfo:p,finalPass:m,truncated:h}=oE(u,{budget:t,rounds:n,focus:s}),g=new Map;for(let S of u)g.set(`${S.subject}${ae}${S.predicate}${ae}${S.object}`,S.trust);let b=new Map(u.map(S=>[S.id,S])),y=S=>(S||[]).map(x=>b.get(x)?.trust).filter(x=>typeof x=="number"),$=new Set(u.filter(S=>eE(S.predicate)).map(S=>`${S.subject}${ae}${S.object}`)),E=[],R=[],v=new Set,j=[...m.subsumers.keys()].sort();for(let S of j){let x=m.subsumers.get(S);if(x.has(un))continue;let A=[...x].filter(L=>L!==S&&L!==io&&L!==un).sort();for(let L of A){let T=`${S}${ae}${L}`;if($.has(T))continue;let O=m.derivationOf.get(T)||[],_=p.get(L);if(_){v.has(L)||(v.add(L),E.push({subject:L,predicate:Pt,object:"owl:Restriction",provenance:ra,justification:[O]}),E.push({subject:L,predicate:En,object:_.role,provenance:ra,justification:[O]}),E.push({subject:L,predicate:Sn,object:_.filler,provenance:ra,justification:[O]}));let P=y(O),G=E.length;E.push({subject:S,predicate:De,object:L,provenance:ra,justification:[O],...P.length?{premiseTrusts:P,ruleConfidence:zp}:{}}),R.push({toWriteIndex:G,subject:S,object:L,rule:Wp})}else if(d.concepts.has(L)){let P=y(O),G=E.length;E.push({subject:S,predicate:De,object:L,provenance:sE,justification:[O],...P.length?{premiseTrusts:P,ruleConfidence:zp}:{}}),R.push({toWriteIndex:G,subject:S,object:L,rule:Bp})}}}let{ids:k}=await c(e,E),w=R.map(S=>({id:k[S.toWriteIndex],subject:S.subject,object:S.object,rule:S.rule}));return{derived:w,count:w.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:f.length}}var ae,io,un,Os,eE,n1,s1,o1,r1,i1,a1,c1,l1,u1,oa,Bp,sE,Wp,ra,zp,Gp,Vp,iE=N(()=>{nt();At();ae="\u241F",io="top",un="bot";Os=e=>String(e||"").trim().toLowerCase(),eE=e=>Os(e)==="rdfs:subclassof",n1=e=>Os(e)==="rdf:type",s1=e=>Os(e)==="owl:disjointwith",o1=e=>Os(e)==="owl:onproperty",r1=e=>Os(e)==="owl:somevaluesfrom",i1=e=>Os(e)==="owl:onclass",a1=e=>Os(e)==="owl:intersectionof",c1=e=>Os(e)==="rdfs:subpropertyof",l1=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),u1=e=>l1.has(Os(e));oa=new Set;Bp="elSubsumption",sE=`entailed:${Bp}`,Wp="elRestriction",ra=`entailed:${Wp}`,zp=.95,Gp=2e3,Vp=64});var aE={};Ot(aE,{DEFAULT_REASONING_CONFIG:()=>Hp,resolveReasoningConfig:()=>g1});function h1(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function g1(e){let t=e?.reasoning||{},n={...Hp};for(let[s,o]of Object.entries(m1))t[s]!==void 0&&(n[o]=h1(t[s],Hp[o]));return n}var Hp,m1,cE=N(()=>{Hp=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512}),m1=Object.freeze({syllogise_budget:"syllogiseBudget",syllogise_depth:"syllogiseDepth",classify_budget:"classifyBudget",classify_rounds:"classifyRounds",max_environments:"maxEnvironments",prove_steps:"proveSteps",prove_branches:"proveBranches",prove_nodes:"proveNodes"})});function om(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Il(e.entityType)}`;if(t==="list")return`list/enumerate ${Il(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Il(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return om(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&An[o]?An[o]:`filter/traverse ${Il(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&An[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?An[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function dm(e){let t=new Map;for(let n of e)t.has(dE(n))||t.set(dE(n),n);return t}function Yp(e,t=Go){let n=[],s=[];for(let c of e)c.predicate===t&&(s.push([c.subject,c.object]),Wo(c)&&n.push([c.subject,c.object]));let o=new Map,r=new Map,i=new Set,a=(c,l,u)=>{!l||!u||l===u||(c.has(l)||c.set(l,new Set),c.get(l).add(u))};for(let[c,l]of s)a(r,c,l),l&&i.add(l);for(let[c,l]of n)a(o,c,l);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function Xp(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function S1(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function j1(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Mx(),Px)),s=n();return s?S1(t,s(t)):t}catch{return t}}function pm(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||k1.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function Pl(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return Ir;if(t==="can")return"mgx:capableOf";try{let n=await j1(t);return n==="have"?Ir:Jn(`mgx:${n}`)}catch{return Jn(`mgx:${t}`)}}function O1(e,t){let n=String(t||"").match(I1);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function ia(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Yn(),$b)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function mE(e){return e.predicate===x1&&e.object==="transitiveproperty"}function D1(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function gm(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:s|x|z|ch|sh|o)es$/i.test(t)?t.slice(0,-2):t.replace(/s$/i,"")}function DE(e){if(Is[e])return Is[e];let t=String(e||""),n=Gb(t);if(n){let a=DE(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[c,...l]=a.split(" ");return["does not",gm(c),...l].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${mm})-([a-z]+)$`,"i").exec(t);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(t);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(t);return i?`${D1(i[1])}${i[2]?` ${i[2]}`:""}`:e}function em(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function U1(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of z1)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function us(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${us(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Qt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Qt(e)}${t}`:e.provenance.includes("corpus:")?`${Qt(e)}${t}`:e.provenance.includes("reference:")?`${Qt(e)}${t}`:`i learned: ${Qt(e)}${t}`}function hE(e,t,n,{toward:s=null}={}){let o=oe(e);if(!ls.has(e.predicate)||!n.has(e.subject))return o;let r=al(e.object,t,{cap:6,stopAt:il,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(B1);return a?o.slice(0,a.index)+i+a[0]:o+i}function gE(e,t,n,{indent:s=""}={}){let o=t.filter(R=>R.predicate===Go).map(R=>[R.subject,R.object]),r=Xi(o),i=e.map(R=>`${s}${hE(R,r,n)}`),a=e.filter(R=>ls.has(R.predicate)&&n.has(R.subject)),c=[...new Set(a.map(R=>R.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(R=>R.predicate==="owl:disjointWith").map(R=>[R.subject,R.object]),{split:u,clusters:d}=cl(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let R of d)for(let v of R.objects)p.set(v,R);let m=e.filter(R=>!(ls.has(R.predicate)&&n.has(R.subject))),h=[],g=[],b=0,y=R=>{let v=hE(R,r,n);return b<Se?(b+=1,`${s}${v}`):(g.push(v),null)};for(let R of d){let v=a.filter(j=>p.get(j.object)===R).map(y).filter(Boolean);v.length&&h.push(`${s}${f}, the ${R.label}:
|
|
173
|
+
${v.join(`
|
|
174
|
+
`)}`)}if(m.length){let R=m.map(y).filter(Boolean);R.length&&h.push(`${s}also about ${f}:
|
|
175
|
+
${R.join(`
|
|
176
|
+
`)}`)}let $=g.length?`
|
|
177
|
+
${s}\u2026and ${g.length} more \u2014 say 'more' to see them.`:"",E={text:h.join(`
|
|
178
|
+
`)+$,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:E}}async function G1(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Dx(),Fx)))}catch{return null}let r;try{r=o(e,t,n)}catch{return null}if(!r||!r.paragraphs.length)return null;let i=[...new Set((r.sources||[]).map(u=>u.provenance).filter(Boolean))],a=i.length?`(sources: ${i.join("; ")})
|
|
179
|
+
`:"",c=`Say 'show the facts' for all ${s.length} stored facts.`;return{text:`${r.paragraphs.join(`
|
|
180
180
|
|
|
181
181
|
`)}
|
|
182
182
|
|
|
183
|
-
${a}${
|
|
184
|
-
${[...i.negative,...i.positive].map(
|
|
185
|
-
`)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let
|
|
183
|
+
${a}${c}`,pending:{items:s,noun:"facts"}}}function Gr(e){let t=Vc().find(n=>n.kind==="article");return t&&Vf(String(e||""),t)?"an":"a"}function zE(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${oe(e)}; ${oe(t)}. To settle it, say "forget that ${e.subject} is ${Gr(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function V1(e,t){let n=s=>`${Qt(s)}${s.provenance?` (source: ${us(s.provenance)})`:""}`;return{text:`you've told me both ${n(e)} and ${n(t)} \u2014 together those contradict, and I won't derive an answer from an inconsistency. To settle it, say "forget that ${e.subject} is ${Gr(e.object)} ${e.object}".`,replace:!0}}function Ol(e){let t=o=>`${Qt(o)}${o.provenance?` (source: ${us(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function tm(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(qe(),eo)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=i=>(o.attributes||[]).find(a=>a.key===i)?.value||"";s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance")})}return s}catch{return[]}}async function ot(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(qe(),eo)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function H1(e){if(!Ll)try{Ll=bn().nounPlurals}catch{Ll=new Map}return Ll.get(e)??null}function Ml(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return Tn(bn(),t)?.lemma||t}catch{return t}}function q1(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Ml(e);let n=Ml(pm(t[1]));return`${Gr(n)} ${n}`}function ee(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(K1,"").trim();r&&r!==n&&o.add(r);for(let i of o){s.add(i),i.endsWith("es")&&s.add(i.slice(0,-2)),i.endsWith("s")&&s.add(i.slice(0,-1));let a=H1(i);a&&s.add(e(a))}return s}function bE(e,t,n){for(let s of e)for(let o of t){let r=n(s,o);if(r)return r}return null}function WE(e,t=null){let n=Fl(e),s=n.match(Y1);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(J1);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function im(e){let t=String(e||"").replace(eP,"");if(t!==e){let s=t.match(ao);if(s)return s}let n=String(e||"").match(tP);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(ao):null}function sP(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>ls.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=ee(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=ee(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function cm(e){return String(e||"").replace(/^(?:can't|cannot|can not|cant)\s+/i,"can ").replace(/^(?:doesn't|does not)\s+/i,"does ").replace(/^(?:don't|do not)\s+/i,"do ").replace(/^(?:didn't|did not)\s+/i,"did ").replace(/\s+(?:not|never)\s+/i," ").replace(/\s+/g," ").trim()}function yE(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function yP(e,t){let n=(e||[]).map(s=>t.find(o=>o.predicate===s.predicate&&o.subject===s.subject&&o.object===s.object));return!n.length||!n.every(Boolean)?null:n.map(s=>`${Qt(s)}${s.provenance?` (source: ${us(s.provenance)})`:""}`).join("; ")}function vE(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=nc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?yP(c,n):null;return l?` \u2014 via: ${l}`:""};if(i.verdict==="both")return{text:`I have both, at the same level of detail \u2014 my sources disagree, so I won't pick:
|
|
184
|
+
${[...i.negative,...i.positive].map(oe).join(`
|
|
185
|
+
`)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let c=i.verdict==="no"?i.negative[0]:i.positive[0],l=`${i.verdict} \u2014 ${oe(c)}${a(i.chain)}`;return i.overrides&&(l+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${oe(i.overrides.fact)}`),{text:l,replace:!0}}return null}function xE(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=Ed(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,c=`I don't know if ${e} can ${t}.`;if(i.positive.length||i.negative.length){let u=[`${i.positive.length} can ${t}`,`${i.negative.length} cannot`,`${i.unknown.length} I have nothing on`].join(", "),d=[...i.positive,...i.negative].slice(0,xd).map(f=>oe(f.fact));return{text:`${c} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
|
|
186
186
|
${d.join(`
|
|
187
|
-
`)}`,replace:!0,miss:!0}}let
|
|
188
|
-
${u.map(
|
|
189
|
-
`)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(
|
|
190
|
-
\u2026and ${
|
|
191
|
-
`)+
|
|
192
|
-
\u2026and ${
|
|
193
|
-
`)+
|
|
194
|
-
\u2026and ${
|
|
195
|
-
`)+
|
|
196
|
-
\u2026and ${
|
|
197
|
-
`)+
|
|
198
|
-
\u2026and ${
|
|
199
|
-
`)+
|
|
200
|
-
\u2026and ${
|
|
201
|
-
`)+
|
|
202
|
-
\u2026and ${
|
|
203
|
-
`)+
|
|
204
|
-
\u2026and ${
|
|
205
|
-
`)+
|
|
206
|
-
\u2026and ${
|
|
207
|
-
`)+
|
|
208
|
-
\u2026and ${
|
|
209
|
-
`)+
|
|
210
|
-
`)+
|
|
211
|
-
\u2026and ${
|
|
212
|
-
`)+
|
|
213
|
-
\u2026and ${
|
|
214
|
-
`)+
|
|
215
|
-
\u2026and ${
|
|
216
|
-
`)+
|
|
217
|
-
\u2026and ${
|
|
218
|
-
`)+
|
|
219
|
-
${
|
|
220
|
-
\u2026and ${
|
|
221
|
-
${
|
|
222
|
-
`)}${
|
|
223
|
-
\u2026and ${
|
|
224
|
-
`)+
|
|
225
|
-
`),replace:!0}:
|
|
226
|
-
\u2026and ${
|
|
227
|
-
`)+
|
|
228
|
-
`),replace:!0}}}return null}}let y=c.match(Xv),w=c.match(qs)||pf(c)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(qs);if(w){let A=J(l,on(w[2])),N=r&&vs.test(w[1].trim())?r:w[1],O=new Set(J(l,N));if([...O].some(W=>A.has(W))){let W=on(w[2]).trim();return{text:`yes \u2014 ${jr(W)} ${W} is ${jr(W)} ${W}, trivially: every kind is a kind of itself.`,replace:!0}}let P=await v0(o,N);if(P)for(let W of J(l,P))O.add(W);let{findIsaChain:F,buildSubClassSuccessors:L,deriveDisjointViolations:K,SUBCLASS_PREDICATE:Y,TYPE_PREDICATE:ne,DISJOINT_PREDICATE:re}=await Promise.resolve().then(()=>(Nt(),Zt)),Q=_o,H=p.filter(W=>W.predicate===Y&&Q(W)),ee=p.filter(W=>W.predicate===ne&&Q(W)),q=H.map(W=>[W.subject,W.object]),be=ee.map(W=>[W.subject,W.object]),Oe=p.filter(W=>W.predicate===Y),le=p.filter(W=>W.predicate===ne),je=le.map(W=>[W.subject,W.object]),Me=Oe.map(W=>[W.subject,W.object]),ye=L(q),ce=L(Me),oe=d.filter(W=>W.predicate===re&&Q(W)),Re=oe.map(W=>[W.subject,W.object]),V=oe.length?K(je.concat(Me),Me,Re,{budget:20,focus:new Set([...O,...A])}):[],$e=W=>{let ve=V.find(Le=>Le.subject===W&&A.has(Le.object));if(!ve)return null;let fe=p.filter(Le=>A.has(Le.object)&&(Le.subject===ve.viaClass||Le.subject===ve.subject)).sort(f)[0],Ee=oe.find(Le=>Le.subject===ve.viaClass&&Le.object===ve.object||Le.subject===ve.object&&Le.object===ve.viaClass);return!fe||!Ee?null:kN(fe,Ee)},rt=p.filter(W=>O.has(W.subject)&&A.has(W.object)).sort(f)[0],Ie=d.filter(W=>W.predicate===_a&&O.has(W.subject)&&A.has(W.object)).sort(f)[0],Vt=oe.find(W=>O.has(W.subject)&&A.has(W.object)||O.has(W.object)&&A.has(W.subject));if(rt&&!Ie){let W=$e(rt.subject);if(W)return W}let Mt=yx(rt,Ie||Vt);if(Mt)return Mt;if(oe.length){let W=Ee=>{let Le=new Set(Ee),St=new Set(Ee);for(let Ne=0;Ne<8&&St.size;Ne+=1){let he=new Set;for(let[De,Ys]of Me)St.has(De)&&!Le.has(Ys)&&he.add(Ys);if(!he.size)break;for(let De of he)Le.add(De);St=he}return Le},ve=W(A),fe=V.find(Ee=>O.has(Ee.subject)&&ve.has(Ee.object)&&!W([Ee.viaClass]).has(Ee.object)&&!W([Ee.object]).has(Ee.viaClass));if(fe){let Ee=p.filter(he=>O.has(he.subject)&&he.object===fe.viaClass).sort(f)[0],Le=oe.find(he=>he.subject===fe.viaClass&&he.object===fe.object||he.subject===fe.object&&he.object===fe.viaClass),St=!A.has(fe.object),Ne=St?p.filter(he=>A.has(he.subject)&&he.object===fe.object).sort(f)[0]:null;if(Ee&&Le&&(!St||Ne)){let he=on(w[2]).trim();return{text:`no \u2014 ${[Ee,...Ne?[Ne]:[]].map(se).join("; ")}; and ${Gt(Le)}${Le.provenance?` (source: ${Jn(Le.provenance)})`:""} \u2014 so ${N} can never be ${jr(he)} ${he}.`,replace:!0}}}}let tn=await Li(o,N);if(tn){let W=new Map;for(let fe of nl(o,tn.id))for(let Ee of J(l,fe.label))!O.has(Ee)&&!W.has(Ee)&&W.set(Ee,fe.label);let ve=p.filter(fe=>W.has(fe.subject)&&A.has(fe.object)).sort(f)[0];if(ve)return{text:`yes \u2014 the code graph says ${tn.label} inherits ${W.get(ve.subject)}, and ${se(ve)}`,replace:!0}}let un=W=>(W.predicate===Y?H:ee).find(ve=>ve.subject===W.subject&&ve.object===W.object);for(let W of O){let ve=F(W,A,be,ye,{maxHops:2});if(!ve)continue;let fe=$e(W);if(fe)return fe;let Ee=ve.map(un);if(Ee.every(Boolean))return{text:`yes \u2014 ${el(Ee)}`,replace:!0}}let Ni=W=>(W.predicate===Y?Oe:le).find(ve=>ve.subject===W.subject&&ve.object===W.object);for(let W of O){let ve=F(W,A,je,ce,{maxHops:2});if(!ve)continue;let fe=$e(W);if(fe)return fe;let Ee=ve.map(Ni);if(Ee.every(Boolean)&&Ee.some(Q))return{text:`yes \u2014 ${el(Ee)}`,replace:!0}}let j=N.match(/^(.*\S)\s+not$/i),de=j&&[j[0],r&&vs.test(j[1].trim())?r:j[1]];if(de){let W=J(l,de[1]),ve=A,fe=p.filter(Ne=>W.has(Ne.subject)&&ve.has(Ne.object)).sort(f)[0];if(fe)return{text:`no \u2014 ${se(fe)}`,replace:!0};let Ee=oe.find(Ne=>W.has(Ne.subject)&&ve.has(Ne.object)||W.has(Ne.object)&&ve.has(Ne.subject));if(Ee)return{text:`yes \u2014 ${se(Ee)}`,replace:!0};let Le=de[1].trim(),St=on(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Le} and ${St}. If no ${Le} is a ${St}, teach me: "no ${Le} is a ${St}".`,replace:!0,miss:!0}}if(oe.length){let W=K(be.concat(q),q,Re,{budget:10});for(let ve of O){let fe=W.find(Ne=>Ne.subject===ve&&A.has(Ne.object));if(!fe)continue;let Ee=ee.concat(H).find(Ne=>Ne.subject===fe.subject&&Ne.object===fe.viaType),Le=oe.find(Ne=>Ne.subject===fe.viaClass&&Ne.object===fe.object||Ne.subject===fe.object&&Ne.object===fe.viaClass),St=[Ee,Le].filter(Boolean).map(se);return{text:`no \u2014 ${St.length?St.join("; "):`${fe.viaClass} and ${fe.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Ce,ON_PROPERTY_PREDICATE:dn,SOME_VALUES_FROM_PREDICATE:Qn,deriveSomeValuesFromSubsumption:Vx,ENTAILED_SCM_SVF_PROVENANCE:Hx,SCM_SVF_RULE_CONFIDENCE:qx,entailedTrustFrom:Ef}=await Promise.resolve().then(()=>(Nt(),Zt)),Sf=d.filter(W=>W.predicate===dn&&Q(W)),kf=d.filter(W=>W.predicate===Qn&&Q(W));if(Sf.length&&kf.length){let W=new Map(kf.map(he=>[he.subject,he.object])),ve=Sf.map(he=>({restriction:he.subject,property:he.object,target:W.get(he.subject)})).filter(he=>he.target),fe=new Set([Y,ne,re,dn,Qn,"owl:intersectionOf"]),Ee=d.filter(he=>Q(he)&&!fe.has(he.predicate)),Le=Ee.map(he=>[he.subject,he.predicate,he.object]),St=Ce(Le,be,q,ve,{budget:10});for(let he of O){let De=St.find(vn=>vn.subject===he&&A.has(vn.object));if(!De)continue;let Ys=Ee.find(vn=>vn.subject===De.subject&&vn.predicate===De.viaProperty&&vn.object===De.viaValue),Xs=ee.find(vn=>vn.subject===De.viaValue&&vn.object===De.viaType),_r=[Ys,Xs].filter(Boolean).map(se);return{text:`yes \u2014 ${_r.length?_r.join("; "):`${De.subject} ${De.viaProperty} ${De.viaValue}, and ${De.viaValue} is a ${De.viaType}.`}`,replace:!0}}let Ne=ve.length>1?Vx(ve,q,{budget:10}):[];if(Ne.length){let he=L(q.concat(Ne.map(_e=>[_e.subject,_e.object]))),De=new Map(ve.map(_e=>[_e.restriction,_e])),Ys=new Map;for(let _e of d)Ys.set(`${_e.subject}\0${_e.predicate}\0${_e.object}`,_e.trust);let Xs=(_e,Tn,Ht)=>Ys.get(`${_e}\0${Tn}\0${Ht}`),_r=new Map;for(let _e of Ne){let Tn=De.get(_e.subject),Ht=De.get(_e.object),nn=[Tn&&Xs(_e.subject,dn,Tn.property),Xs(_e.subject,Qn,_e.viaY1),Ht&&Xs(_e.object,dn,Ht.property),Xs(_e.object,Qn,_e.viaY2),Xs(_e.viaY1,Y,_e.viaY2)].filter(Xx=>typeof Xx=="number"),Pi=Ef(nn,qx);Pi!==null&&_r.set(`${_e.subject}\0${_e.object}`,Pi)}let vn=_e=>{if(_e.predicate!==Y)return ee.find(nn=>nn.subject===_e.subject&&nn.object===_e.object);let Tn=H.find(nn=>nn.subject===_e.subject&&nn.object===_e.object);if(Tn)return Tn;let Ht=Ne.find(nn=>nn.subject===_e.subject&&nn.object===_e.object);return Ht?{subject:Ht.subject,predicate:Y,object:Ht.object,provenance:Hx,trust:_r.get(`${Ht.subject}\0${Ht.object}`)}:void 0};for(let _e of O){let Tn=F(_e,A,be,he,{maxHops:3});if(!Tn)continue;let Ht=Tn.map(vn);if(Ht.every(Boolean)){let nn=Ef(Ht.map(Pi=>Pi.trust),1);return{text:`yes \u2014 ${el(Ht)}`,replace:!0,...nn!==null?{trust:nn}:{}}}}}}let Kx=J(l,N),ll=p.filter(W=>Kx.has(W.subject)).sort(f),$n=N.trim(),Ks=on(w[2]).trim(),Yx=[...O].some(W=>F(W,A,be,ye,{maxHops:ON}));if(ll.length){let W=ll.slice(0,3).map(se).join("; "),{ON_PROPERTY_PREDICATE:ve,SOME_VALUES_FROM_PREDICATE:fe}=await Promise.resolve().then(()=>(Nt(),Zt)),Ee=new Set,Le=new Set;for(let De of d)De.predicate===ve?Ee.add(De.subject):De.predicate===fe&&Le.add(De.subject);let St=new Set([...Ee].filter(De=>Le.has(De))),he=ll.some(De=>St.has(De.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${$n}", then ask me again.`:Yx?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${$n}", then ask me again.`:`If it's true, teach me: "${$n} is a kind of ${Ks}". If it isn't, teach me: "no ${$n} is a ${Ks}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${$n} is a ${Ks}. I do know: ${W}. ${he}`,replace:!0,miss:!0}}let jf=p.filter(W=>O.has(W.object)&&A.has(W.subject)).sort(f)[0];return jf?{text:`I can't confirm that \u2014 what I know runs the other way: ${se(jf)}. A kind doesn't reverse. If it's true, teach me: "every ${$n} is a ${Ks}". If it isn't, teach me: "no ${$n} is a ${Ks}".`,replace:!0,miss:!0}:!tn&&!P&&!JL($n)&&!d.some(W=>O.has(W.subject)||O.has(W.object))?{text:`I can't confirm that \u2014 I don't know "${$n}" at all yet. If it's true, teach me: "${$n} is a kind of ${Ks}". If it isn't, teach me: "no ${$n} is a ${Ks}".`,replace:!0,miss:!0}:null}let v=c.match(p0);if(v){let[,A,N,O]=v,{SUBCLASS_PREDICATE:P,ON_PROPERTY_PREDICATE:F,buildCardinalityRestrictions:L,proveCardinalityAtLeast:K,CARDINALITY_RULE_CONFIDENCE:Y,entailedTrustFrom:ne}=await Promise.resolve().then(()=>(Nt(),Zt)),re=_o,Q=p.filter(q=>q.predicate===P&&re(q)).map(q=>[q.subject,q.object]),H=d.filter(q=>(q.predicate===F||sx.has(q.predicate))&&re(q)),ee=L(H);if(ee.length){let q=J(l,A.trim()),be=J(l,O.trim()),Oe=Number(N),le=Yv(q,be,(je,Me)=>K(Q,ee,je,Me,Oe,{}));if(le){let je=d.find(V=>V.predicate===P&&V.subject===le.viaClass&&V.object===le.viaRestriction),Me=je?.provenance?` (source: ${Jn(je.provenance)})`:"",ye=le.kind==="exactly"?"exactly":"at least",ce=(V,$e)=>`${V}${$e===1?"":"s"}`,oe=[je?.trust,...H.filter(V=>V.subject===le.viaRestriction).map(V=>V.trust),...le.viaClass!==le.subject?[p.find(V=>V.predicate===P&&V.subject===le.subject&&V.object===le.viaClass)?.trust]:[]].filter(V=>typeof V=="number"),Re=ne(oe,Y);return{text:`yes \u2014 every ${le.viaClass} has ${ye} ${le.n} ${ce(le.object,le.n)}${Me}, so at least ${Oe} follows.`,replace:!0,...Re!==null?{trust:Re}:{}}}}}let k=c.match(f0);if(k){let[,A,N]=k,{SUBCLASS_PREDICATE:O,ON_PROPERTY_PREDICATE:P,buildCardinalityRestrictions:F,proveMaxCardinalityZeroDenial:L,CAX_MAXC0_RULE_CONFIDENCE:K,entailedTrustFrom:Y}=await Promise.resolve().then(()=>(Nt(),Zt)),ne=_o,re=p.filter(ee=>ee.predicate===O&&ne(ee)).map(ee=>[ee.subject,ee.object]),Q=d.filter(ee=>(ee.predicate===P||sx.has(ee.predicate))&&ne(ee)),H=F(Q);if(H.length){let ee=J(l,A.trim()),q=J(l,N.trim()),be=Yv(ee,q,(Oe,le)=>L(re,H,Oe,le,{}));if(be){let Oe=d.find(ye=>ye.predicate===O&&ye.subject===be.viaClass&&ye.object===be.viaRestriction),le=Oe?.provenance?` (source: ${Jn(Oe.provenance)})`:"",je=[Oe?.trust,...Q.filter(ye=>ye.subject===be.viaRestriction).map(ye=>ye.trust),...be.viaClass!==be.subject?[p.find(ye=>ye.predicate===O&&ye.subject===be.subject&&ye.object===be.viaClass)?.trust]:[]].filter(ye=>typeof ye=="number"),Me=Y(je,K);return{text:`no \u2014 every ${be.viaClass} has at most 0 ${be.object}${le}.`,replace:!0,...Me!==null?{trust:Me}:{}}}}}let $=c.match(h0);if($){let A=J(l,$[1]),N=d.filter(O=>O.predicate===Jp&&A.has(O.subject)).sort(f);return N.length?h(N):null}let x=u.match(m0);if(x){let[,A,N]=x,O=J(l,A.trim()),P=J(l,N.replace(/^an?\s+/i,"").trim()),F=d.filter(L=>L.predicate===Jp&&P.has(L.subject)&&O.has(L.object)).sort(f)[0];return F?{text:`yes \u2014 ${se(F)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} owns/maintains ${N.trim()}.`,replace:!0}}let E=u.match(g0);if(E){let[,A,N]=E,O=J(l,A.replace(/^an?\s+/i,"").trim()),P=J(l,N.trim()),F=d.filter(L=>L.predicate===Jp&&O.has(L.subject)&&P.has(L.object)).sort(f)[0];return F?{text:`yes \u2014 ${se(F)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} is owned by ${N.trim()}.`,replace:!0}}let S=u.match(b0);if(S){let[,A,N]=S,O=J(l,A.trim()),P=J(l,`${N.trim()} method`),F=d.filter(L=>L.predicate===br&&O.has(L.subject)&&P.has(L.object)).sort(f)[0];return F?{text:`yes \u2014 ${se(F)}`,replace:!0}:null}let _=u.match(w0);if(_){let A=J(l,_[1].trim()),N=d.filter(O=>O.predicate===br&&A.has(O.subject)&&/ method$/.test(O.object)).sort(f);return N.length?h(N):null}let R=u.match(ox);if(R){let A=R[1].trim(),N=ix.test(A)||rx.test(A)?null:vs.test(A)?r||null:A,O=R[2].trim().toLowerCase();if(N){let P=J(l,N),F=new Map,L=null;if(o){let H=await Li(o,N);if(L=H,H)for(let ee of nl(o,H.id))for(let q of J(l,ee.label))!P.has(q)&&!F.has(q)&&F.set(q,ee.label),P.add(q)}let K=H=>H.predicate===Qp&&l(H.object)===O||H.predicate===`tmct:${O}`&&H.object==="true",Y=l(N).split(/\s+/).filter(H=>H.length>=4&&!$x.has(H)),ne=H=>Y.some(ee=>new Set(String(H.subject||"").split(/\s+/)).has(ee)),re=H=>P.has(H.subject)||Y.length&&ne(H),Q=d.filter(H=>re(H)&&K(H)).sort(f)[0];if(Q){let H=F.get(Q.subject);return{text:H?`yes \u2014 the code graph says ${L.label} inherits ${H}, and ${se(Q)}`:`yes \u2014 ${se(Q)}`,replace:!0}}{let{findIsaChain:H,SUBCLASS_PREDICATE:ee,TYPE_PREDICATE:q}=await Promise.resolve().then(()=>(Nt(),Zt)),be=_o,Oe=d.filter(oe=>oe.predicate===ee&&be(oe)),le=d.filter(oe=>oe.predicate===q&&be(oe)),je=Oe.map(oe=>[oe.subject,oe.object]),Me=le.map(oe=>[oe.subject,oe.object]),ye=oe=>(oe.predicate===ee?Oe:le).find(Re=>Re.subject===oe.subject&&Re.object===oe.object),ce=J(l,O);for(let oe of P){let Re=H(oe,ce,Me,je,{maxHops:2});if(!Re)continue;let V=Re.map(ye);if(V.every(Boolean))return{text:`yes \u2014 ${el(V)}`,replace:!0}}}if(d.some(re)&&!n?.parsed)return/^there\b/i.test(N)||y0.test(O)?null:{text:`I don't have a fact saying ${RN(N)} is ${O}.`,replace:!0};if(!n?.parsed&&!Gv.test(O))return ax(N,O)}}let T=hf(c).match(uN);if(T&&!nf.test(c)){let[,A,N,O]=T,P=N.toLowerCase();if(!tf.test(P)&&!of.test(P)){let F=A.trim(),L=fN(await sf(P),O),K=L.object.replace(/^an?\s+/i,"").trim();if(F&&K){let Y=L.predicate,ne=J(l,F),re=J(l,K),Q=[Y,ir(Y)],H=d.filter(q=>Q.includes(q.predicate)&&ne.has(q.subject)&&re.has(q.object)).sort(f)[0];if(H)return{text:`${Kg(H.predicate)?"no":"yes"} \u2014 ${se(H)}`,replace:!0,generalVerbQuery:!0};let ee=d.filter(q=>Q.includes(q.predicate)&&ne.has(q.subject));if(ee.length){let q=ee.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Gt({subject:F,predicate:Y,object:K})}. I do know: ${q}.`,replace:!0,miss:!0}}return null}}}let M=c.match(dN);if(M&&!nf.test(c)){let[,A,N]=M,[O,P]=N.toLowerCase().split(/\s+/);if(!tf.test(O)&&!of.test(O)){let F=A.trim();if(F){let L=await sf(O);P&&/^mgx:[a-z]+$/.test(L)&&(L=`${L}-${P}`);let K=J(l,F),Y=[L,ir(L)],ne=Qe(d.filter(re=>Y.includes(re.predicate)&&K.has(re.subject)),i);if(ne.length)return{...h(ne),generalVerbQuery:!0}}}}let I=c.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(I&&!nf.test(c)){let[,A,N,O]=I,P=A.toLowerCase();if(!tf.test(P)&&!of.test(P)&&!lN.test(P)){let F=await sf(P);/^mgx:[a-z]+$/.test(F)&&(F=`${F}-${N.toLowerCase()}`);let L=J(l,O.replace(/^(?:an?|the)\s+/i,"").trim()),K=Qe(d.filter(Y=>Y.predicate===F&&L.has(Y.object)),i);if(K.length)return{...h(K),generalVerbQuery:!0}}}let D=c.match(u0);if(D){let A=J(l,D[1]),N=Qe(d.filter(Y=>A.has(Y.subject)||A.has(Y.object)),i);if(!N.length)return null;let O=A.has(N[0].subject)?N[0].subject:N[0].object,P=N.map(Y=>` ${se(Y)}`),F=P.slice(0,Se),L=P.slice(Se),K=L.length?`
|
|
229
|
-
\u2026and ${
|
|
230
|
-
${
|
|
231
|
-
`)}${K}`,replace:!0,...L.length?{pending:{items:L.map(Y=>Y.trim()),noun:"facts"}}:{}}}let B=n?.parsed?.shape==="meta"?n.parsed.object:null,X=!1,ae=c.match(d0);if(ae)B=ae[1],X=!0;else if(!B&&!n?.parsed){let A=c.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);A&&(B=A[1])}if(!B)return null;let ie=J(l,B),te=Qe(p.filter(A=>ie.has(A.subject)),i),U=Qe(p.filter(A=>ie.has(A.object)),i),z=X?te.length?te:U:U.length?U:te;return z.length?h(z):null}function cf(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}var gf,JL,yn,Zc,Uv,cx,O5,QL,L5,Bv,ZL,N5,lx,ux,dx,eN,Wv,P5,M5,F5,D5,z5,wf,U5,tN,Be,Jp,Qp,To,nN,sN,_o,B5,W5,G5,V5,H5,q5,K5,Y5,X5,J5,Q5,Z5,eX,tX,nX,sX,oX,rX,Gv,iN,rl,aN,iX,aX,$f,px,cX,lX,uX,dX,cN,pX,tf,nf,lN,fX,uN,dN,of,pN,hN,hX,fx,hx,mN,mX,gX,mx,bX,wX,yX,gN,$X,bN,Rr,vX,xX,EX,gx,SX,kX,wN,jX,RX,_X,TX,Ao,Vv,vf,Gt,$N,xN,EN,tl,_N,$x,AX,df,vx,TN,AN,ol,IN,CN,qs,Xn,ON,LN,NN,ff,Xv,PN,Se,FN,DN,zN,UN,BN,WN,GN,VN,HN,qN,KN,YN,XN,JN,QN,Qv,Ex,e0,t0,s0,o0,r0,i0,a0,tx,c0,u0,d0,p0,f0,sx,h0,m0,g0,b0,w0,ox,vs,y0,rx,ix,ax,$0,x0,E0,IX,Rx,k0,j0,CX,lf,mf,R0,OX,LX,_x,NX,PX,MX,FX,DX,il,zX,UX,BX,WX,_0,GX,VX,Qc=C(()=>{Ve();Iy();Kt();Pe();Pn();gc();bc();Pr();wc();Uy();Ge();Ia();ip();Vy();On();fn();qo();ua();Qd();Zd();Go();Ws();Gl();$r();i$();u$();f$();yp();h$();$p();m$();g$();b$();Lc();Ic();pc();Er();iv();lv();Vs();Pv();da(void 0);la(mc);gf=new Set(["it","this","that","here"]),JL=e=>gf.has(String(e||"").trim().toLowerCase()),yn={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Zc=e=>e?`${String(e).toLowerCase()}(s)`:"entities",Uv="look up a taught fact about a subject/verb/object";cx={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},O5=new Set(["stats","memory","focus",...Object.keys(cx)]),QL=new Set(["have","has","holds","hold"]),L5=new RegExp(`\\b(?:${[...Object.keys(ue),...Object.keys(Ss)].filter(e=>!QL.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),Bv=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,ZL=(e,t)=>{let n=Bv(e),s=Bv(t);return n<s?-1:n>s?1:0},N5=new Set([...Ay.map(e=>e.name),...Object.values(cx).map(e=>e.tool)]),lx=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),ux=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),dx=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),eN=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),Wv=e=>e.replace(/(.)\1+/g,"$1");P5=bf(lx),M5=bf(ux),F5=bf(dx),D5=new RegExp(`^(?:${[...eN].map(Ye).join("|")})\\s+(.+)$`,"i"),z5=[...lx,...ux,...dx,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],wf="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",U5=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${wf})\\s+than\\s+(.+)$`,"i"),tN=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${wf})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Be="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Jp="mgx:ownedBy",Qp="mgx:hasProperty",To="rdfs:subClassOf",nN="rdf:type",sN=new Set(["operator","teach","entailed"]),_o=e=>!!e.sourceTypes?.some(t=>sN.has(t));B5=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),W5=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),G5=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Be})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),V5=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${wf})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),H5=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Be})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),q5=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");K5=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Be})\\s+([\\w-]+)[.!?]*$`,"i"),Y5=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Be})\\s+([\\w-]+)[.!?]*$`,"i"),X5=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Be})\\s+([\\w-]+)[.!?]*$`,"i"),J5=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Be})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),Q5=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Be})\\s+([\\w-]+)[?.!]*$`,"i"),Z5=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Be})\\s+([\\w-]+)[?.!]*$`,"i"),eX=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Be})\\s+([\\w-]+)$`,"i"),tX=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${Be})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),nX=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Be})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),sX=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Be})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),oX=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Be})\\s+(.+?)[?.!\\s]*$`,"i"),rX=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Be}))?[?.!\\s]*$`,"i"),Gv=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,iN=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);rl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",aN="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",iX=new RegExp(`^(.+?)\\s+(${aN})\\s+(.+)$`,"i"),aX=new RegExp(`^([\\w'-]+)\\s+${rl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),$f="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",px="with|to|from|by|of|in|on|for|as|about|into",cX=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${rl}(${$f})\\s+(${px})\\s+(.+)$`,"i"),lX=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${$f})\\s+(${px})\\s+(.+)$`,"i"),uX=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Be})\\s+(.+?)[.!?]*$`,"i"),dX=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Be})\\s+(.+?)[.!?]*$`,"i"),cN="(?:just\\s+)?(?:one|another)\\s+more|another",pX=new RegExp(`^(?:${cN})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Be})\\s+(.+?)[.!?]*$`,"i"),tf=/^(?:is|are|am|owns|maintains)$/i,nf=/\b(?:is|are|am|owns|maintains)\b/i,lN=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),fX=new RegExp(`^(?:${to.filter(e=>!/\s/.test(e)).join("|")})$`,"i");uN=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${rl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),dN=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${rl}([a-z]+(?:\\s+(?:${Be}))?)[?.!\\s]*$`,"i"),of=/^(?:be|own|maintain)$/i,pN=new RegExp(`^(${Be})\\s+(.+)$`,"i");hN=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],hX=new RegExp(`^(?:${hN.join("|")})\\b\\s*,?\\s+`,"i"),fx=Object.freeze(["you","i","it","they","he","she","we"]),hx=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),mN=Object.freeze([...hx,...fx]),mX=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${mN.join("|")})\\s+\\S+`,"i"),gX=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${fx.join("|")})\\s+(?:is|are|am|was|were)|(${hx.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),mx="forget|unlearn|delete|remove",bX=new RegExp(`^(?:${mx})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),wX=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Be})\\s+([\\w-]+)$`,"i"),yX=new RegExp(`^(?:${mx})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Be})\\s+([\\w-]+)$`,"i"),gN="collection|set|group|family",$X=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${gN})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),bN=Object.freeze(["mgx:memberOf","mgx:partOf"]),Rr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",vX=new RegExp(`^what\\s+does\\s+(.+?)${Rr}\\s+do${Rr}\\??$`,"i"),xX=new RegExp(`^what\\s+(.+?)${Rr}\\s+does${Rr}\\??$`,"i"),EX=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Rr}\\s+do${Rr}\\??$`,"i"),gx="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",SX=new RegExp(`^who\\s+(?:is|was)\\s+${gx}$`,"i"),kX=new RegExp(`^what\\s+(?:did|has)\\s+${gx}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),wN="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",jX=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${wN}\\b`,"i"),RX=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),_X=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});TX=new Set([...Object.keys(ue).flatMap(e=>e.split(/[\s-]+/)),...sn,...xn,"owns","maintains"].filter(e=>e.length>=3)),Ao={"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in"},Vv=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);vf=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Gt=e=>`${e.subject} ${wx(e.predicate)} ${e.object}`;$N=Object.entries(Ao).filter(([e])=>!vf.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);xN=/ \(source: [^)]*\)$/;EN=8;tl=null;_N=/^(?:every|each|all|any)\s+/i;$x=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),AX=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),df=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,vx=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,TN=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,AN=/^(who|what)'?s\s+/i,ol=e=>String(e).replace(AN,(t,n)=>`${n} is `),IN=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;CN=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,qs=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,Xn=new Set(["rdfs:subClassOf","rdf:type"]),ON=6,LN=/^why\s+(?=(?:is|are)\b)/i,NN=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;ff=new Set(["kind","sort","type","subclass","superclass"]),Xv=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,PN=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,Se=32;FN=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,DN=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,zN=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,UN=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,BN=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,WN=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,GN=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,VN=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,HN=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Be})\\s+(.+?)\\s*[?.!]*$`,"i"),qN=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,KN=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,YN=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,XN=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,JN=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,QN=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;Qv=e=>String(e||"").replace(/\s+/g," ").trim();Ex="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",e0=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${Ex})[?.!\\s]*$`,"i"),t0=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${Ex})\\s+([\\w'-]+)[?.!\\s]*$`,"i");s0=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),o0=Object.entries(Ao).filter(([e])=>!s0.has(e)&&!vf.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Ye(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),r0=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),i0=new Set(["mgx:partOf","mgx:memberOf"]),a0=Object.entries(Ao).filter(([e])=>!r0.has(e)&&!vf.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=Ye(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[bx(s),...o].map(Ye).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),tx=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,c0=new Set(["changed","change","changes","updated","modified","happened","occurred"]);u0=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,d0=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,p0=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,f0=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,sx=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),h0=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,m0=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,g0=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,b0=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,w0=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,ox=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,vs=/^(?:it|this|that)$/i,y0=/^(?:it|them|this|that|in|on|of|to|at)$/i,rx=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,ix=/^(?:you|i|they|he|she|we)\b/i,ax=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${sl(e)} is ${t}".`,replace:!0}),$0=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;x0=/inherit|supertype|subclass|extend|specializ/i,E0=8;IX=new RegExp(`\\b(?:${[...gf].join("|")})\\b`,"i"),Rx=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,k0=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,j0=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;CX=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(He).join("|")})$`,"i"),lf="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",mf="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",R0=`(?:\\s+${mf})?`,OX=[new RegExp(`^${lf}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${R0}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${lf}architecture\\s+(?:${mf}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${lf}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${mf}(?:\\s+here)?\\??$`,"i")],LX={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:yn.contains,subclasses:yn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:yn.calls,callees:yn.calls,tests:yn.tests,untested:yn.tests,history:yn.touches,exports:yn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it"},_x="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",NX=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${_x}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),PX=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${_x}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),MX=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),FX=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),DX=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),il="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",zX=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${il}\\s*\\??$`,"i"),UX=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${il}\\s*\\??$`,"i"),BX=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${il}\\s*\\??$`,"i"),WX=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${il}\\s*[.!]*$`,"i"),_0=Object.freeze([...gf].filter(e=>e!=="here").concat("they")),GX=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${_0.join("|")})\\b(\\s+\\S.*)?$`,"i"),VX=Z(".tmct","memory","corpus-seed.json")});Qc();Ge();ns();Lc();var al={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var Ix=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Io=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),cl=e=>Ix[e]||"other",A0=e=>Math.max(0,Math.min(1,e));function Tx(e){let t=(e.sourceTypes||[]).map(n=>so[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:so.entailed}function I0(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function Ax(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function Cx(e,t,n={},s={}){let o={...al,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter($=>$&&$.object&&$.object!==e),a=[],l=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,c=[];for(let $ of i){if(cl($.predicate)==="isa"){let x=Ax($.object,n);if(l&&x>o.uninformativeClassMaxShare){a.push({row:$,family:"isa",reason:"uninformative-class",share:x});continue}}c.push($)}let u=c.filter($=>cl($.predicate)==="isa").map($=>$.object),d=Oc(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),p=new Map,f=new Map;for(let $ of d.clusters){let x=0;for(let E of $.objects){f.set(E,$.label);let S=c.find(_=>_.object===E&&cl(_.predicate)==="isa");x+=S?Tx(S):0}p.set($.label,x)}let h=null,m=-1;for(let[$,x]of[...p].sort((E,S)=>E[0].localeCompare(S[0])))x>m&&(m=x,h=$);let b=[];for(let $ of c){let x=cl($.predicate),E=Tx($),S={provenance:E};if(I0($)&&(E-=o.entailedDepthPenalty,S.entailed=!0),x==="isa"){let R=.6+.4*(1-Ax($.object,n));E*=R,S.informativeness=R;let T=f.get($.object);h&&T&&T!==h&&(E-=o.minoritySensePenalty,S.minoritySense=T)}E=A0(E),b.push({row:$,family:x,score:E,reasons:S})}let g=[];for(let $ of b)$.score<o.minScore?a.push({row:$.row,family:$.family,reason:"below-floor",score:$.score}):g.push($);let y=new Map;for(let $ of g)y.has($.family)||y.set($.family,[]),y.get($.family).push($);for(let $ of y.values())$.sort((x,E)=>E.score-x.score||x.row.object.localeCompare(E.row.object));let w=Io.filter($=>y.has($)).concat([...y.keys()].filter($=>!Io.includes($)).sort()),v=[],k=!1;for(;v.length<r&&!k;){k=!0;for(let $ of w){let x=y.get($);if(x&&x.length&&(v.push(x.shift()),k=!1,v.length>=r))break}}for(let $ of w)for(let x of y.get($)||[])a.push({row:x.row,family:x.family,reason:"over-budget",score:x.score});return v.sort(($,x)=>{let E=Io.indexOf($.family),S=Io.indexOf(x.family);return E-S||x.score-$.score||$.row.object.localeCompare(x.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:h}}}ha();Lt();var C0=new Set(["isa","location","partOf","capableOf","usedFor"]),O0=new Set(["single","several","chained","group","closer"]),Ox=(e,t)=>`${e}:${t}`;function xf(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!C0.has(n.family)||typeof n.form!="string"||!O0.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=Ox(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var Co=e=>`${Ko(e)} ${e}`;function L0(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Co(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Gr(s.map(Co))}`:n}function N0(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(l=>String(l||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:Yo(o),A_TERM:Co(o),A_TERM_CAP:Yo(Co(o)),TERMS:fa(o),TERMS_CAP:Yo(fa(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Co(a):"",OBJECT:i,A_OBJECT:i?Co(i):"",OBJECTS_A:Gr(r.map(Co)),OBJECTS_PLURAL:Gr(r.map(fa)),OBJECTS_RAW:Gr(r),CHAIN:L0(n&&n.length?n:r.slice(0,1))}}function P0(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function xs(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(Ox(t,i)):null,l=a?a.templates:null;if(!l||!l.length)return null;let c=s.variantSeed??"",u=ka(`${r}|${t}|${i}|${c}`)%l.length,d=s.objectsOverride||o.map(f=>f.object),p=P0(l[u],N0(r,d,s.chain,s.parent));return p?{text:p,rows:o,family:t,form:i}:null}ha();var M0=Io.filter(e=>e!=="isa"&&e!=="other");function F0(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function Lx(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function D0(e,t){let n=l=>(t?.[l.object]||[])[1]||null,s=new Map;for(let l of e||[]){let c=n(l);c&&s.set(c,(s.get(c)||0)+1)}let o=new Map,r=[],i=[];for(let l of e||[]){let c=n(l);c&&s.get(c)>=2?(o.has(c)||(o.set(c,[]),r.push(c)),o.get(c).push(l)):i.push(l)}let a=r.map(l=>({parent:l,rows:o.get(l)}));return i.length&&a.push({parent:null,rows:i}),a}function z0(e,t,n){let s=new Map,o=new Map;for(let l of t||[]){let c=e?.[l.object];if(!Array.isArray(c)||c.length<2)continue;let u=c[c.length-1];!u||u===l.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(l))}let r=[...s.keys()].sort((l,c)=>s.get(c)-s.get(l)||l.localeCompare(c)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let l of r)for(let c of o.get(l)||[])a.has(c.id)||(a.add(c.id),i.push(c));return{roots:r,rows:i}}function U0(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let p=t[e[0].object],f=p&&p.length>1?"chained":"single",h=xs(s,"isa",e,{term:n,form:f,chain:p});return h&&r.push({...h,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let p=xs(s,"isa",e,{term:n,form:"several"});return p&&r.push({...p,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),l=xs(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});l&&r.push({...l,role:"names-term",paragraph:"definition"});let c=[];for(let p of D0(a,t))for(let f of Lx(p.rows,o.maxObjectsPerBodySentence))c.push({parent:p.parent,rows:f});if(c.length>o.maxBodySentences){let p=c.slice(0,o.maxBodySentences),f=p[p.length-1];for(let h of c.slice(o.maxBodySentences))f.rows=f.rows.concat(h.rows);f.parent=null,c=p}for(let p of c){let f=p.parent?xs(s,"isa",p.rows,{term:n,form:"group",parent:p.parent,variantSeed:p.parent}):xs(s,"isa",p.rows,{term:n,form:"several",variantSeed:n});f&&r.push({...f,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=z0(t,e,o.closerRootCount);if(u.length){let p=xs(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});p&&r.push({...p,role:"closes-isa",paragraph:"definition"})}return r}function B0(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Yo(`${Ko(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function W0(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function Nx(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...al,...n.config||{}},a=F0(e?.selected||[]),l=[];for(let u of U0(a.get("isa")||[],r,s,t,i))l.push(u);for(let u of M0){let d=a.get(u);if(!(!d||!d.length))for(let p of Lx(d,i.maxObjectsPerBodySentence)){let f=xs(t,u,p,{term:s});f&&l.push({...f,role:"describes",paragraph:"description"})}}B0(l,s);let c=new Map;for(let u of l)for(let d of u.rows)c.has(d.id)||c.set(d.id,d);return{term:s,sentences:l,paragraphs:W0(l,o),provenanceRows:[...c.values()]}}var G0=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function V0(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var H0=Object.freeze({facts:"show the facts",chains:"show the chains"});function q0(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:H0,facts:n.map(G0),factCount:n.length,chains:s}}function Px(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:V0(t?.provenanceRows||[]),detail:q0(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function Mx(e,t,n={},s=new Map,o={}){let r=Cx(e,t,n,o),i=Nx(r,s,o);return Px(r,i,o)}Lc();Ic();var Fx=new Set(["rdfs:subClassOf","rdf:type"]);function Dx(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(Fx.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function zx(e,t,n=6){let s=_i(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=Cc(r,s,{cap:n,stopAt:Ac});i.length>1&&(o[r]=i)}return o}function Ux(e){let t=[],n=new Set;for(let s of e||[])!s||!Fx.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Ge();Qc();function K0(e,t,n,s,o={}){let r=xf(s||[]);if(!r||r.size===0)return null;let i=t||[],a=Dx(n||i),l=zx(a.subClassEdges,Ux(i));return Mx(e,i,a,r,{...o,chains:l})}function Bx(e,t,n,s={}){let o=ht(e||{individuals:[],objectProperties:[]}),r=J(G,t),i=o.filter(l=>r.has(l.subject));if(!i.length)return null;let a=K0(t,i,o,n,s);return Y0(a)}function Y0(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var X0="no session is open on this page yet \u2014 await tmct.open() first",Wx=Symbol.for("tmct.surface.fallback");function Gx({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[Wx])return a;let l=null,c=()=>{if(!l)throw new Error(X0);return l},u={async open(...d){return l=await e(...d),l},get session(){return l},async turn(d,p){let f=c();return s?s(d,p,f):typeof f.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:f.turn(d,p)},async ask(d,p){return t?t(d,p,c()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,p){return n?n(d,p,c()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[Wx]=r,i.tmct=u,u}function J0({payload:e=null}={}){let t=gi();return e&&(t.payload=e),{memoryDir:t}}async function Q0(e,t,n){let s=null;try{s=await Sx(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await jx(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}Gx({open:J0,ask:Q0,page:{normFactTerm:G,digestTermFromPayloadBrowser:Bx},fallback:!0});})();
|
|
187
|
+
`)}`,replace:!0,miss:!0}}let l=Sd(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,xd),d=l.slice(u.length);return{text:`${c} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${l.length} thing${l.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
|
|
188
|
+
${u.map(oe).join(`
|
|
189
|
+
`)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(oe),noun:"facts"}}:{}}}return{text:`${c} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function xP(e){let t=String(e||"").toLowerCase().trim().replace(/\s+/g," ");if(t==="best")return"better";if(t==="worst")return"worse";let n=t.match(/^(most|least)\s+([a-z][\w-]*)$/);return n?`${n[1]==="most"?"more":"less"} ${n[2]}`:/[a-z]est$/.test(t)&&t.length>4?`${t.slice(0,-3)}er`:null}function wn(e){let t=new Set,n=[];for(let s of e){let o=`${s.subject}|${s.predicate}|${s.object}`;t.has(o)||(t.add(o),n.push(s))}return n}async function VE(e,t,n,s,o={},r=null,i=null){return HE(await AP(e,t,n,s,o,r,i),n,t)}function HE(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=om(t?.parsed);if(!o&&e.generalVerbQuery&&(o=lE),!o){let r=s.match(rm),i=r?null:Fl(s).match(BE)||WE(s),a=r?r[2]:i?i[1]:null;a&&!am.has(a.toLowerCase())&&(o=lE)}if(!o){let r=s.match(KE);r&&(o=om({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function SE(e,t,n,s,o=null){let{ON_PROPERTY_PREDICATE:r,SOME_VALUES_FROM_PREDICATE:i}=await Promise.resolve().then(()=>(At(),rn)),a=await ot(e,t),c=new Map,l=new Map;for(let f of a)f.predicate===r?c.set(f.subject,f.object):f.predicate===i&&l.set(f.subject,f.object);let u=a.filter(f=>f.predicate===Go&&n.has(f.subject)&&c.has(f.object)&&l.has(f.object)),d=u.filter(f=>s.has(l.get(f.object))).sort((f,p)=>f.object.localeCompare(p.object))[0];if(d){let f=new Map(a.map(h=>[h.id,h])),p=(d.justification||[]).map(h=>f.get(h)).filter(h=>h&&h.predicate===Go);return{text:`yes \u2014 ${(p.length?p:[d]).map(oe).join("; ")}`,replace:!0}}return u.length&&o?{text:`I can't confirm that \u2014 nothing I remember composes to it yet. Run "/classify ${o}", then ask me again.`,replace:!0,miss:!0}:null}async function TP(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(Zx(),Qx)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(iE(),rE)),a=e.filter(h=>h.predicate==="rdf:type"&&t.has(h.subject)).map(h=>h.object),c=[...new Set([...t,...a])],l=s(e,c),u=new Map(l.map(h=>[h.id,h])),d=o(l),f=d.individuals.filter(h=>t.has(h));if(f.length){let h={maxSteps:n.proveSteps,maxBranches:n.proveBranches,maxNodes:n.proveNodes},g=r(d,f,h)[0];if(g){let b=g.premises.map(y=>u.get(y)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 what I've been told about ${g.subject} is inconsistent: ${b||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`}}let p=i(l,{budget:n.classifyBudget,rounds:n.classifyRounds,focus:new Set(c)}),m=p.unsatisfiable.find(h=>t.has(h)||a.includes(h));if(m){let h=p.premisesOf(m).map(g=>u.get(g)).filter(Boolean).map(oe).join("; ");return`I can't answer that \u2014 "${m}" can never have any members: ${h||"its own subclass chain is unsatisfiable"}. I'd need one of those retracted before I can answer honestly.`}return null}async function AP(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(qe(),eo)))}catch{return null}let l=String(t).trim(),u=l.match(lP);if(u){let z=ee(a,u[1]),B=(await ot(e,r)).filter(I=>I.predicate==="mgx:usedFor"&&z.has(I.object));if(B.length){let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
190
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
191
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}for(let{predicate:z,re:B}of SP){let I=l.match(B);if(!I)continue;let D=ee(a,I[1]),M=(await ot(e,r)).filter(ce=>ce.predicate===z&&D.has(ce.object));if(!M.length)continue;let W=st(wn(M),o).map(oe),F=W.slice(0,Se),Q=W.slice(Se),Z=Q.length?`
|
|
192
|
+
\u2026and ${Q.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
|
|
193
|
+
`)+Z,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}let d=l.match($P),f=d?null:l.match(vP),p=d?d[1]:f?.[2],m=d?d[2]:f?.[1],h=p&&m?xP(m):null;if(h){let z=`mgx:${h.replace(/\s+/g,"-")}-than`,B=await ot(e,r),I=ee(a,p),D=[...I].sort((W,F)=>W.length-F.length)[0],M=W=>I.has(W)||W.startsWith(`${D}-`)||W.startsWith(`${D} `)||B.some(F=>ls.has(F.predicate)&&F.subject===W&&I.has(F.object)),U=wn(B.filter(W=>W.predicate===z&&Wo(W))).filter(W=>W.subject!==W.object&&M(W.subject)&&M(W.object));if(U.length){let W=new Set,F=new Map;for(let X of U)W.add(X.subject),W.add(X.object),F.set(X.object,(F.get(X.object)||0)+1),F.has(X.subject)||F.set(X.subject,F.get(X.subject)||0);let Q=new Map(F),Z=[],ce=null;for(;Q.size;){let X=[...Q.keys()].filter(ne=>Q.get(ne)===0);if(X.length!==1){ce=X.length===0?{text:`I can't order the ${D}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${D} from what I know \u2014 nothing compares ${X[0]} and ${X[1]}. Teach me, e.g. "${X[0]} is ${h} than ${X[1]}".`,replace:!0,miss:!0};break}let K=X[0];Z.push(K),Q.delete(K);for(let ne of U)ne.subject===K&&Q.has(ne.object)&&Q.set(ne.object,Q.get(ne.object)-1)}if(ce)return ce;let re=Z.slice(0,-1).map((X,K)=>U.find(ne=>ne.subject===X&&ne.object===Z[K+1]));if(re.every(Boolean)){let X=re.map(K=>`${Qt(K)}${K.provenance?` (source: ${us(K.provenance)})`:""}`).join("; ");return{text:`${Z[0]} \u2014 ${X}; so ${Z[0]} is the ${m} ${D}`,replace:!0}}}}let g=s?l.match(uP)||l.match(dP):null;if(g){let z=ee(a,g[1]),B=(await ot(e,r)).filter(I=>Ko(I.predicate)!==null&&z.has(I.subject));if(B.length){let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
194
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
195
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}let b=l.match(fP);if(b){let z=b[1].toLowerCase(),B=ee(a,b[2].replace(/^(?:an?|the)\s+/i,"").trim()),I=(await ot(e,r)).filter(D=>Ko(D.predicate)===z&&B.has(D.object));if(I.length){let M=st(wn(I),o).map(oe),U=M.slice(0,Se),W=M.slice(Se),F=W.length?`
|
|
196
|
+
\u2026and ${W.length} more \u2014 say 'more' to see them.`:"";return{text:U.join(`
|
|
197
|
+
`)+F,replace:!0,...W.length?{pending:{items:W,noun:"facts"}}:{}}}}{let z=l.match(pP),B=z?z[2]:b&&["in","inside"].includes(b[1].toLowerCase())?b[2]:null;if(B!=null){let I=z&&z[1].toLowerCase()==="parts"?["mgx:partOf"]:M1,D=ee(a,B.replace(/^(?:an?|the)\s+/i,"").trim()),M=(await ot(e,r)).filter(U=>I.includes(U.predicate)&&D.has(U.object)).sort(y1);if(M.length){let W=st(wn(M),o).map(oe),F=W.slice(0,Se),Q=W.slice(Se),Z=Q.length?`
|
|
198
|
+
\u2026and ${Q.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
|
|
199
|
+
`)+Z,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}}}let y=l.match(mP);if(y){let z=y[3].toLowerCase(),B=ee(a,y[2]),I=new Set([...ee(a,y[1])].map(M=>c(`mgx:${z}-${M.replace(/\s+/g,"-")}`))),D=(await ot(e,r)).filter(M=>I.has(c(M.predicate))&&B.has(a(M.subject)));if(D.length){let U=st(wn(D),o).map(oe),W=U.slice(0,Se),F=U.slice(Se),Q=F.length?`
|
|
200
|
+
\u2026and ${F.length} more \u2014 say 'more' to see them.`:"";return{text:W.join(`
|
|
201
|
+
`)+Q,replace:!0,...F.length?{pending:{items:F,noun:"facts"}}:{}}}}let $=n?.parsed?.shape==="meta"?n.parsed.object:null,E=n?.parsed&&n.parsed.node!=="miss";if(!$&&s&&!E&&!EE.test(l)){let z=l.match(KE)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);z&&($=Ps(z[1]))}if(!$&&s){let z=l.match(qP);z&&($=Ps(pn(z[1].trim())))}if(!$&&n?.ambiguous&&Array.isArray(n.candidateParses)){let z=n.candidateParses.find(B=>B?.shape==="meta"&&B.object);z&&($=Ps(String(z.object)))}if($){let z=U1($),{predicate:B}=z,I=z.subject.replace(/^(?:the|an?)\s+/i,"").trim()||z.subject,D=!1;if(B&&Ls.test(I)){if(!i){let Y=String(Is[B]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${I.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${Y?` ${Y}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}I=i,D=!0}let M=ee(a,I),U=await ot(e,r);if(!U.some(Y=>M.has(Y.subject)||M.has(Y.object))){let Y=sP(I,U,a);Y&&(I=Y,M=ee(a,I))}let W=(await ot(e,r)).filter(Y=>M.has(Y.subject)&&!pE.has(Y.predicate)&&!mE(Y)),F=B?W.filter(Y=>c(Y.predicate)===B):W;if(!B&&F.length&&!F.some(nm)&&(F=[]),!F.length){if(B&&(W.length||D))return{text:`I don't have any "${Is[B]}" facts about ${I}.`,replace:s,...W.length?{}:{miss:!0}};if(!B){let Y=st((await ot(e,r)).filter(je=>M.has(je.object)),o);if(Y.length&&!Y.some(nm)&&(Y=[]),Y.length){let je=Y.map(oe),Oe=je.slice(0,Se),ue=je.slice(Se),Ce=ue.length?`
|
|
202
|
+
\u2026and ${ue.length} more \u2014 say 'more' to see them.`:"";return{text:Oe.join(`
|
|
203
|
+
`)+Ce,replace:s,...ue.length?{pending:{items:ue,noun:"facts"}}:{}}}}return null}F=st(F,o);let Q=await ot(e,r),{lines:Z,grouped:ce}=gE(F,Q,M),re=!B&&Z.length>W1?await G1(I,F,Q,Z):null;if(re)return{...re,replace:s};if(ce)return{...ce,replace:s};let X=Z.slice(0,Se),K=Z.slice(Se),ne=K.length?`
|
|
204
|
+
\u2026and ${K.length} more \u2014 say 'more' to see them.`:"";return{text:X.join(`
|
|
205
|
+
`)+ne,replace:s,...K.length?{pending:{items:K,noun:"facts"}}:{}}}if(!s)return null;let R=l.match(v1);if(R){let B=`mgx:${R[2].toLowerCase().replace(/\s+/g,"-")}-than`,I=await tm(e),D=re=>{let X=re.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ls.test(X)?i:X},M=D(R[1]),U=D(R[3]),W=ee(a,M),F=ee(a,U),Q=I.find(re=>re.predicate===B&&W.has(re.subject)&&F.has(re.object));if(Q){let re=I.find(K=>K.predicate===B&&W.has(K.object)&&F.has(K.subject)),X=re?` \u2014 though you also told me the opposite: ${oe(re)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(Q)}${X}`,replace:!0}}let Z=I.filter(re=>re.predicate===B&&(W.has(re.subject)||W.has(re.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${Z.length?` I do know: ${Z.slice(0,3).map(oe).join("; ")}.`:""} If it's true, teach me: "${M} is ${R[2].toLowerCase()} than ${U}".`,replace:!0,miss:!0}}for(let{predicate:z,phrase:B,re:I}of RP){let D=l.match(I);if(!D)continue;let M=await tm(e),U=ee(a,D[1]),W=ee(a,D[2]),F=M.find(X=>X.predicate===z&&U.has(X.subject)&&W.has(X.object));if(F)return{text:`yes \u2014 ${oe(F)}`,replace:!0};let[Q]=B.split(" "),Z=await Pl(gm(Q));if(Z!==z){let X=Z.replace(/^mgx:/,"mgxneg:");if(M.some(K=>(K.predicate===Z||K.predicate===X)&&U.has(K.subject)))continue}let ce=kP.has(z)?` If it's true, teach me: "${D[1]} ${B} ${D[2]}".`:"",re=M.filter(X=>X.predicate===z&&U.has(X.subject));if(re.length){let X=re.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${D[1]} ${B} ${D[2]}. I do know: ${X}.${ce}`,replace:!0,miss:!0}}if(!n?.parsed&&M.some(X=>U.has(X.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${D[1]} ${B} ${D[2]}.${ce}`,replace:!0,miss:!0};break}let v=l.match(ao)||im(l);if(v){let z=ee(a,v[1]),B=ee(a,v[2]),I=await ot(e,r),D=F=>z.has(F.subject)&&B.has(F.object),{DISJOINT_PREDICATE:M}=await Promise.resolve().then(()=>(At(),rn)),U=F=>z.has(F.subject)||z.has(F.object)||B.has(F.subject)||B.has(F.object);return I.some(F=>F.predicate===M&&Wo(F)&&U(F))?null:zE(I.find(F=>ls.has(F.predicate)&&D(F)),I.find(F=>F.predicate===ec&&D(F)))}let j=cm(l),k=j.match(oP);if(k){let z=await ot(e,r),B=k[1],I=vE(k[2],k[3],z);if(I&&j!==$E(l)&&(I=yE(I)),I&&B)return{text:`I can't speak for ${B.trim()} ${k[2]} \u2014 what I remember is generic, not universal. ${I.text}.`,replace:!0};if(I)return I;let D=ee(a,k[2]),M=z.filter(U=>U.predicate==="mgx:capableOf"&&D.has(U.subject));if(M.length){let U=M.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${k[2]} can ${k[3]}. I do know: ${U}. If it's true, teach me: "a ${M[0].subject} can ${k[3]}".`,replace:!0,miss:!0}}return xE(k[2],k[3],z)}let w=l.match(rP);if(w){let z=ee(a,w[1]),B=ee(a,w[2]),I=new Set(["mgx:hasA","tmct:has"]),D=await tm(e),M=Q=>D.find(Z=>I.has(Z.predicate)&&Q.has(Z.subject)&&B.has(Z.object)),U=M(z);if(U)return{text:`yes \u2014 ${oe(U)}`,replace:!0};let W=[{terms:z,chain:[]}],F=new Set;for(let Q=0;Q<4;Q+=1){let Z=[];for(let{terms:ce,chain:re}of W){let X=D.filter(K=>ls.has(K.predicate)&&ce.has(K.subject)&&!F.has(K.object));for(let K of X){if(F.has(K.object))continue;F.add(K.object);let ne=[...re,K],Y=M(ee(a,K.object));if(Y)return{text:`yes \u2014 ${[...ne.map(oe),oe(Y)].join("; ")}`,replace:!0};Z.push({terms:ee(a,K.object),chain:ne})}}if(!Z.length)break;W=Z}return SE(e,r,z,B,w[1].trim())}let S=l.match(iP);if(S){let z=ee(a,S[1]),B=ee(a,S[3]),I=await SE(e,r,z,B,S[1].trim());if(I)return I}let x=cm(l),A=x.match(hP);if(A){let z=await ot(e,r),B=!!A[1],I=ee(a,A[2]),D=ee(a,A[3]),M=vE(A[2],A[3],z);if(M&&x!==$E(l)&&(M=yE(M)),M&&B)return{text:`I can't speak for ${A[1].trim()} ${A[2]} \u2014 what I remember is generic, not universal. ${M.text}.`,replace:!0};if(M)return M;if(s){let U=z.filter(F=>F.predicate==="mgx:capableOf"&&I.has(F.subject));if(U.length){let F=U.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${A[2]} can ${A[3]}. I do know: ${F}. If it's true, teach me: "a ${U[0].subject} can ${A[3]}".`,replace:!0,miss:!0}}let W=xE(A[2],A[3],z);if(W)return W;if(!/\s/.test(A[2].trim())&&!z.some(F=>I.has(F.subject)||I.has(F.object))){let F=pm(Ml(A[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${A[2]}" yet. Teach me "a ${F} can ${A[3]}" (or "a ${F} cannot ${A[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let L=l.match(aP);if(L){let z=ee(a,L[1]),B=(await ot(e,r)).filter(F=>(F.predicate==="mgx:capableOf"||F.predicate===yr)&&z.has(F.subject));if(!B.length)return null;let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
206
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
207
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}let T=l.match(wP);if(T){let z=ee(a,T[1]),B=ee(a,T[2]),I=await ot(e,r),D=wn(I.filter(M=>M.predicate==="mgx:capableOf"&&B.has(M.object))).filter(M=>nc(new Set([M.subject]),B,I).verdict==="yes");if(D.length){let{findIsaChain:M,buildSubClassSuccessors:U,SUBCLASS_PREDICATE:W,TYPE_PREDICATE:F}=await Promise.resolve().then(()=>(At(),rn)),Q=I.filter(le=>le.predicate===W),Z=I.filter(le=>le.predicate===F),ce=Q.map(le=>[le.subject,le.object]),re=Z.map(le=>[le.subject,le.object]),X=U(ce),K=le=>(le.predicate===W?Q:Z).find(ie=>ie.subject===le.subject&&ie.object===le.object),ne=new Map,Y=D.filter(le=>z.has(le.subject)?!0:(ne.has(le.subject)||ne.set(le.subject,M(le.subject,z,re,X,{maxHops:3})),!!ne.get(le.subject))),Oe=st(Y.length?Y:D,o).map(le=>{let ie=Y.length?ne.get(le.subject):null;if(!ie||ie.length<2)return oe(le);let _e=ie.map(K);if(!_e.every(Boolean))return oe(le);let de=_e.map(at=>`${Qt(at)}${at.provenance?` (source: ${us(at.provenance)})`:""}`).join("; ");return`${oe(le)} \u2014 via: ${de}`}),ue=Oe.slice(0,Se),Ce=Oe.slice(Se),Ue=Ce.length?`
|
|
208
|
+
\u2026and ${Ce.length} more \u2014 say 'more' to see them.`:"";return{text:(Y.length?"":`nothing I remember ties these to "${T[1]}", but:
|
|
209
|
+
`)+ue.join(`
|
|
210
|
+
`)+Ue,replace:!0,...Ce.length?{pending:{items:Ce,noun:"facts"}}:{}}}}let O=l.match(bP);if(O&&O[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let z=ee(a,O[1]),B=(await ot(e,r)).filter(I=>I.predicate==="mgxneg:capableOf"&&z.has(I.object));if(B.length){let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
211
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
212
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${O[1].trim()}.`,replace:!0,miss:!0}}let _=l.match(gP);if(_&&_[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let z=ee(a,_[1]),B=Sd(z,await ot(e,r));if(B.length){let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
213
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
214
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}let P=l.match(cP);if(P&&!_P.has(P[1].trim().split(/\s+/)[0]?.toLowerCase())){let z=ee(a,P[1]),B=(await ot(e,r)).filter(F=>F.predicate==="mgx:hasA"&&z.has(F.object));if(!B.length)return null;let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
215
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
216
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}let G=l.match(EE),J=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:G?.[1];if(J){let z=ee(a,J),B=(await ot(e,r)).filter(F=>ls.has(F.predicate)&&z.has(F.object));if(!B.length)return null;let D=st(wn(B),o).map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
217
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
218
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}let q=l.match(nP);if(q){let z=ee(a,q[1]),B=await ot(e,r),I=se=>!String(se.provenance||"").includes("corpus:")&&!String(se.provenance||"").includes("web:"),D=B.filter(se=>ls.has(se.predicate)&&I(se)),M=new Set,U=z;for(let se=0;se<8&&U.size;se+=1){let ke=new Set;for(let Be of D)U.has(Be.object)&&!M.has(Be.subject)&&ke.add(Be.subject);if(!ke.size)break;for(let Be of ke)M.add(Be);let Rt=new Set;for(let Be of ke)for(let Ct of ee(a,Be))Rt.add(Ct);U=Rt}let W=B.filter(se=>z.has(se.subject)||z.has(se.object)||M.has(se.subject));if(!W.length){let se=a(q[1]).split(/\s+/).filter(ke=>ke.length>=4&&!UE.has(ke));if(se.length){let ke=Be=>new Set(String(Be||"").split(/\s+/)),Rt=Be=>{let Ct=ke(Be);return se.some(Zt=>Ct.has(Zt))};W=B.filter(Be=>Rt(Be.subject)||Rt(Be.object))}}W=W.filter(se=>!pE.has(se.predicate)&&!mE(se));let F=W.length>0&&!W.some(nm);if(!W.length)return null;let{findConsistencyViolations:Q,TYPE_PREDICATE:Z,SUBCLASS_PREDICATE:ce,DISJOINT_PREDICATE:re}=await Promise.resolve().then(()=>(At(),rn)),X=se=>!se.provenance?.includes("corpus:")&&!se.provenance?.includes("web:"),K=B.filter(se=>se.predicate===Z&&X(se)).map(se=>[se.subject,se.object]),ne=B.filter(se=>se.predicate===ce&&X(se)).map(se=>[se.subject,se.object]),Y=B.filter(se=>se.predicate===re&&X(se)).map(se=>[se.subject,se.object]);if(Y.length){let ke=Q(K,ne,Y,{focus:z,budget:5}).find(Rt=>z.has(Rt.subject));if(ke)return{text:`I can't answer that \u2014 what I've been told about ${ke.subject} is inconsistent: it's taught to be both ${ke.classA} and ${ke.classB}, but ${ke.viaA} and ${ke.viaB} are disjoint (${ke.viaA} owl:disjointWith ${ke.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let je=await KP(e),Oe=await TP(B,z,je);if(Oe)return{text:Oe,replace:!0};let ue=W.find(se=>z.has(se.subject)||z.has(se.object)),Ce=ue?z.has(ue.subject)?ue.subject:ue.object:q[1].trim(),Ue=W.some(se=>M.has(se.subject)&&!z.has(se.subject)&&!z.has(se.object));W=st(W,o);let xe=`${W.length} remembered fact${W.length===1?"":"s"} about ${Ce}${Ue?" (including its known subtypes)":""}:`,{lines:le,grouped:ie}=gE(W,B,z,{indent:" "});if(ie)return{...ie,text:`${xe}
|
|
219
|
+
${ie.text}`,...F?{weakOnly:!0}:{}};let _e=le.slice(0,Se),de=le.slice(Se),at=de.length?`
|
|
220
|
+
\u2026and ${de.length} more \u2014 say 'more' to see them.`:"";return{text:`${xe}
|
|
221
|
+
${_e.join(`
|
|
222
|
+
`)}${at}`,replace:!0,...de.length?{pending:{items:de.map(se=>se.trim()),noun:"facts"}}:{},...F?{weakOnly:!0}:{}}}return null}async function BP(e,t){let n=await ia(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(i=>i?.id===n.id))?.class;if(!s)return null;let{defaultCodeLaneVocab:o}=await Promise.resolve().then(()=>(Lp(),Ox)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Nl(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<GP;r+=1){let i=null;for(let a of e.relations||[])if(WP.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(c=>c?.subject===o)||null,i))break;if(!i||s.has(i.object))break;s.add(i.object),n.push({id:i.object,label:i.objectLabel||i.object}),o=i.object}return n}async function qE(e,t,n,s,o=null,r=null,i={},a=null){return HE(await VP(e,t,n,s,o,r,i,a),n,t)}async function VP(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(qe(),eo)))}catch{return null}let l=String(t).trim();if(o){let I=l.match(ao);if(I){let D=await ia(o,I[1]);if(D){let M=ee(c,pn(I[2])),U=Nl(o,D.id).find(F=>[...ee(c,F.label)].some(Q=>M.has(Q)));if(U)return{text:`yes \u2014 the code graph says ${D.label} inherits ${U.label}.`,replace:!0};let W=await ia(o,pn(I[2]));if(W&&Nl(o,W.id).some(F=>F.id===D.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${W.label} inherits ${D.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=l.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await ot(e,a);if(!d.length){if(!ao.test(u)&&!rm.test(u)){let D=u.match(kE);if(D){let M=D[1].trim(),U=Ls.test(M)?r||null:M;if(U&&!/^there\b/i.test(U)&&!n?.parsed&&!_E.test(M)&&!RE.test(M)&&!fE.test(D[2].trim()))return TE(U,D[2].trim().toLowerCase())}}let I=u.match(ao)||im(l);if(!(I&&!/^there\b/i.test(I[1].trim())||wE.test(l)))return null}let f=d.filter(I=>ls.has(I.predicate)),p=(I,D)=>D.trust-I.trust,m=I=>{let D=I.map(oe),M=D.slice(0,Se),U=D.slice(Se),W=U.length?`
|
|
223
|
+
\u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
|
|
224
|
+
`)+W,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}};if(UP.test(l)){let I=st(f.length?f:d,i);return I.length?m(I):null}let h=u.match(rm);if(h){let I=h[1].trim(),D=Ls.test(I)?r||null:I,M=h[2].trim().toLowerCase(),U=h[3].trim();if(D&&!am.has(M)){let W=Yp(d),{findIsaChain:F}=await Promise.resolve().then(()=>(At(),rn)),Q=Oe=>{let ue=String(Oe||"").trim().toLowerCase(),Ce=[];for(let Ue of d){let xe=em(Ue.predicate);if(!xe)continue;if(xe===ue){Ce.push({fact:Ue,aliasFacts:[]});continue}let le=Xp(F,xe,new Set([ue]),W,{maxHops:2});if(!le)continue;let ie=le.map(_e=>d.find(de=>de.predicate===Go&&de.subject===_e.subject&&de.object===_e.object));ie.every(Boolean)&&Ce.push({fact:Ue,aliasFacts:ie})}return Ce},{loadMemory:Z,findRuleByName:ce,resolveRelationChase:re}=await Promise.resolve().then(()=>(qe(),eo)),{findActionPath:X}=await Promise.resolve().then(()=>(Us(),va)),K=await Z(e),Y=await re(K,M,D,U,{relationFactsFor:Q,renderFactLine:oe,factPhrase:Qt,factTermVariants:ee,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Kp,findActionPath:X});return Y?{text:`yes \u2014 ${Y.citation.join("; ")}`,replace:!0}:Q(M).length>0||!!ce(K,M)?{text:`I know the '${M}' relation, but I can't confirm ${D} is the ${M} of ${U} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${M}' yet.`,replace:!0}}}let g=Fl(u).match(BE)||WE(u,I=>{let D=ee(c,I);return d.some(M=>D.has(M.subject)||D.has(M.object))});if(g){let I=g[1].trim().toLowerCase(),D=g[2].trim(),M=Ls.test(D)?r||null:D;if(M&&!am.has(I)){let U=Yp(d),{findIsaChain:W}=await Promise.resolve().then(()=>(At(),rn)),F=Oe=>{let ue=String(Oe||"").trim().toLowerCase(),Ce=[];for(let Ue of d){let xe=em(Ue.predicate);if(!xe)continue;if(xe===ue){Ce.push({fact:Ue,aliasFacts:[]});continue}let le=Xp(W,xe,new Set([ue]),U,{maxHops:2});if(!le)continue;let ie=le.map(_e=>d.find(de=>de.predicate===Go&&de.subject===_e.subject&&de.object===_e.object));ie.every(Boolean)&&Ce.push({fact:Ue,aliasFacts:ie})}return Ce},{loadMemory:Q,findRuleByName:Z,resolveRelationChaseReverse:ce}=await Promise.resolve().then(()=>(qe(),eo)),re=await Q(e),{findReachableSet:X}=await Promise.resolve().then(()=>(Us(),va)),ne=await ce(re,I,M,{relationFactsFor:F,renderFactLine:oe,factPhrase:Qt,factTermVariants:ee,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Kp,findReachableSet:X});return ne.length?{text:ne.map(ue=>`${ue.subject} \u2014 ${ue.citation.join("; ")}`).join(`
|
|
225
|
+
`),replace:!0}:F(I).length>0||!!Z(re,I)?{text:/^what\b/i.test(Fl(u))?`I don't know what the ${I} of ${M} is from what you've told me.`:`I don't know anyone who is the ${I} of ${M} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${I}' yet.`,replace:!0}}}{let I=u.match(HP);if(I){let D=ee(c,I[1]),M=st(d.filter(U=>D.has(U.subject)||D.has(U.object)),i);if(M.length){let U=M.map(oe),W=U.slice(0,Se),F=U.slice(Se),Q=F.length?`
|
|
226
|
+
\u2026and ${F.length} more \u2014 say 'more' to see them.`:"";return{text:W.join(`
|
|
227
|
+
`)+Q,replace:!0,...F.length?{pending:{items:F,noun:"facts"}}:{}}}}}let b=u.match(Q1);if(b){let I=pm(b[1].trim().toLowerCase()),D=b[2].trim(),M=Ls.test(D)?r||null:D;if(M){let{loadMemory:U,findRuleByName:W,RULE_KIND_PROP:F,RULE_KIND_RECURSIVE:Q}=await Promise.resolve().then(()=>(qe(),eo)),Z=await U(e),ce=W(Z,I),re=ce?.attributes?.find(X=>X.prop===F)?.value;if(ce&&re===Q){let X=ce.attributes.find(Y=>Y.prop==="mgx:ruleBaseCase")?.value,K=ce.attributes.find(Y=>Y.prop==="mgx:ruleRecStep")?.value,ne=c(M);if(X&&K&&ne){let Y=Yp(d),{findIsaChain:je}=await Promise.resolve().then(()=>(At(),rn)),Oe=le=>{let ie=String(le||"").trim().toLowerCase(),_e=[];for(let de of d){let at=em(de.predicate);if(!at)continue;if(at===ie){_e.push({fact:de,aliasFacts:[]});continue}let se=Xp(je,at,new Set([ie]),Y,{maxHops:2});if(!se)continue;let ke=se.map(Rt=>d.find(Be=>Be.predicate===Go&&Be.subject===Rt.subject&&Be.object===Rt.object));ke.every(Boolean)&&_e.push({fact:de,aliasFacts:ke})}return _e},{findReachableSet:ue}=await Promise.resolve().then(()=>(Us(),va)),xe=ue({entity:ne,hop:0},le=>{let ie=le.hop===0?X:K;return Oe(ie).filter(_e=>_e.fact.subject===le.entity).map(_e=>({action:_e,nextState:{entity:_e.fact.object,hop:le.hop+1}}))},{maxDepth:20,stateKey:le=>le.entity});if(xe.length)return{text:xe.map(({node:ie,path:_e})=>{let de=new Set,at=[];for(let se of _e.actions){at.push(oe(se.fact));for(let ke of se.aliasFacts){let Rt=ke.id||`${ke.subject}|${ke.predicate}|${ke.object}`;de.has(Rt)||(de.add(Rt),at.push(`${Qt(ke)}${ke.provenance?` (source: ${us(ke.provenance)})`:""}`))}}return`${ie.entity} \u2014 ${at.join("; ")}`}).join(`
|
|
228
|
+
`),replace:!0}}}return null}}let y=l.match(wE),$=l.match(ao)||im(l)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(ao);if($){let I=ee(c,pn($[2])),D=r&&Ls.test($[1].trim())?r:$[1],M=new Set(ee(c,D));if([...M].some(H=>I.has(H))){let H=pn($[2]).trim();return{text:`yes \u2014 ${Gr(H)} ${H} is ${Gr(H)} ${H}, trivially: every kind is a kind of itself.`,replace:!0}}let U=await BP(o,D);if(U)for(let H of ee(c,U))M.add(H);let{findIsaChain:W,buildSubClassSuccessors:F,deriveDisjointViolations:Q,SUBCLASS_PREDICATE:Z,TYPE_PREDICATE:ce,DISJOINT_PREDICATE:re}=await Promise.resolve().then(()=>(At(),rn)),X=Wo,K=f.filter(H=>H.predicate===Z&&X(H)),ne=f.filter(H=>H.predicate===ce&&X(H)),Y=K.map(H=>[H.subject,H.object]),je=ne.map(H=>[H.subject,H.object]),Oe=f.filter(H=>H.predicate===Z),ue=f.filter(H=>H.predicate===ce),Ce=ue.map(H=>[H.subject,H.object]),Ue=Oe.map(H=>[H.subject,H.object]),xe=F(Y),le=F(Ue),ie=d.filter(H=>H.predicate===re&&X(H)),_e=ie.map(H=>[H.subject,H.object]),de=ie.length?Q(Ce.concat(Ue),Ue,_e,{budget:20,focus:new Set([...M,...I])}):[],at=H=>{let $e=de.find(Ne=>Ne.subject===H&&I.has(Ne.object));if(!$e)return null;let he=f.filter(Ne=>I.has(Ne.object)&&(Ne.subject===$e.viaClass||Ne.subject===$e.subject)).sort(p)[0],Ee=ie.find(Ne=>Ne.subject===$e.viaClass&&Ne.object===$e.object||Ne.subject===$e.object&&Ne.object===$e.viaClass);return!he||!Ee?null:V1(he,Ee)},se=f.filter(H=>M.has(H.subject)&&I.has(H.object)).sort(p)[0],ke=d.filter(H=>H.predicate===ec&&M.has(H.subject)&&I.has(H.object)).sort(p)[0],Rt=ie.find(H=>M.has(H.subject)&&I.has(H.object)||M.has(H.object)&&I.has(H.subject));if(se&&!ke){let H=at(se.subject);if(H)return H}let Be=zE(se,ke||Rt);if(Be)return Be;if(ie.length){let H=Ee=>{let Ne=new Set(Ee),It=new Set(Ee);for(let Pe=0;Pe<8&&It.size;Pe+=1){let ge=new Set;for(let[We,lo]of Ue)It.has(We)&&!Ne.has(lo)&&ge.add(lo);if(!ge.size)break;for(let We of ge)Ne.add(We);It=ge}return Ne},$e=H(I),he=de.find(Ee=>M.has(Ee.subject)&&$e.has(Ee.object)&&!H([Ee.viaClass]).has(Ee.object)&&!H([Ee.object]).has(Ee.viaClass));if(he){let Ee=f.filter(ge=>M.has(ge.subject)&&ge.object===he.viaClass).sort(p)[0],Ne=ie.find(ge=>ge.subject===he.viaClass&&ge.object===he.object||ge.subject===he.object&&ge.object===he.viaClass),It=!I.has(he.object),Pe=It?f.filter(ge=>I.has(ge.subject)&&ge.object===he.object).sort(p)[0]:null;if(Ee&&Ne&&(!It||Pe)){let ge=pn($[2]).trim();return{text:`no \u2014 ${[Ee,...Pe?[Pe]:[]].map(oe).join("; ")}; and ${Qt(Ne)}${Ne.provenance?` (source: ${us(Ne.provenance)})`:""} \u2014 so ${D} can never be ${Gr(ge)} ${ge}.`,replace:!0}}}}let Ct=await ia(o,D);if(Ct){let H=new Map;for(let he of Nl(o,Ct.id))for(let Ee of ee(c,he.label))!M.has(Ee)&&!H.has(Ee)&&H.set(Ee,he.label);let $e=f.filter(he=>H.has(he.subject)&&I.has(he.object)).sort(p)[0];if($e)return{text:`yes \u2014 the code graph says ${Ct.label} inherits ${H.get($e.subject)}, and ${oe($e)}`,replace:!0}}let Zt=H=>(H.predicate===Z?K:ne).find($e=>$e.subject===H.subject&&$e.object===H.object);for(let H of M){let $e=W(H,I,je,xe,{maxHops:2});if(!$e)continue;let he=at(H);if(he)return he;let Ee=$e.map(Zt);if(Ee.every(Boolean))return{text:`yes \u2014 ${Ol(Ee)}`,replace:!0}}let aa=H=>(H.predicate===Z?Oe:ue).find($e=>$e.subject===H.subject&&$e.object===H.object);for(let H of M){let $e=W(H,I,Ce,le,{maxHops:2});if(!$e)continue;let he=at(H);if(he)return he;let Ee=$e.map(aa);if(Ee.every(Boolean)&&Ee.some(X))return{text:`yes \u2014 ${Ol(Ee)}`,replace:!0}}let C=D.match(/^(.*\S)\s+not$/i),pe=C&&[C[0],r&&Ls.test(C[1].trim())?r:C[1]];if(pe){let H=ee(c,pe[1]),$e=I,he=f.filter(Pe=>H.has(Pe.subject)&&$e.has(Pe.object)).sort(p)[0];if(he)return{text:`no \u2014 ${oe(he)}`,replace:!0};let Ee=ie.find(Pe=>H.has(Pe.subject)&&$e.has(Pe.object)||H.has(Pe.object)&&$e.has(Pe.subject));if(Ee)return{text:`yes \u2014 ${oe(Ee)}`,replace:!0};let Ne=pe[1].trim(),It=pn($[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Ne} and ${It}. If no ${Ne} is a ${It}, teach me: "no ${Ne} is a ${It}".`,replace:!0,miss:!0}}if(ie.length){let H=Q(je.concat(Y),Y,_e,{budget:10});for(let $e of M){let he=H.find(Pe=>Pe.subject===$e&&I.has(Pe.object));if(!he)continue;let Ee=ne.concat(K).find(Pe=>Pe.subject===he.subject&&Pe.object===he.viaType),Ne=ie.find(Pe=>Pe.subject===he.viaClass&&Pe.object===he.object||Pe.subject===he.object&&Pe.object===he.viaClass),It=[Ee,Ne].filter(Boolean).map(oe);return{text:`no \u2014 ${It.length?It.join("; "):`${he.viaClass} and ${he.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Le,ON_PROPERTY_PREDICATE:yn,SOME_VALUES_FROM_PREDICATE:ds,deriveSomeValuesFromSubsumption:fS,ENTAILED_SCM_SVF_PROVENANCE:pS,SCM_SVF_RULE_CONFIDENCE:mS,entailedTrustFrom:wm}=await Promise.resolve().then(()=>(At(),rn)),ym=d.filter(H=>H.predicate===yn&&X(H)),$m=d.filter(H=>H.predicate===ds&&X(H));if(ym.length&&$m.length){let H=new Map($m.map(ge=>[ge.subject,ge.object])),$e=ym.map(ge=>({restriction:ge.subject,property:ge.object,target:H.get(ge.subject)})).filter(ge=>ge.target),he=new Set([Z,ce,re,yn,ds,"owl:intersectionOf"]),Ee=d.filter(ge=>X(ge)&&!he.has(ge.predicate)),Ne=Ee.map(ge=>[ge.subject,ge.predicate,ge.object]),It=Le(Ne,je,Y,$e,{budget:10});for(let ge of M){let We=It.find(In=>In.subject===ge&&I.has(In.object));if(!We)continue;let lo=Ee.find(In=>In.subject===We.subject&&In.predicate===We.viaProperty&&In.object===We.viaValue),uo=ne.find(In=>In.subject===We.viaValue&&In.object===We.viaType),Hr=[lo,uo].filter(Boolean).map(oe);return{text:`yes \u2014 ${Hr.length?Hr.join("; "):`${We.subject} ${We.viaProperty} ${We.viaValue}, and ${We.viaValue} is a ${We.viaType}.`}`,replace:!0}}let Pe=$e.length>1?fS($e,Y,{budget:10}):[];if(Pe.length){let ge=F(Y.concat(Pe.map(Te=>[Te.subject,Te.object]))),We=new Map($e.map(Te=>[Te.restriction,Te])),lo=new Map;for(let Te of d)lo.set(`${Te.subject}\0${Te.predicate}\0${Te.object}`,Te.trust);let uo=(Te,zn,en)=>lo.get(`${Te}\0${zn}\0${en}`),Hr=new Map;for(let Te of Pe){let zn=We.get(Te.subject),en=We.get(Te.object),dn=[zn&&uo(Te.subject,yn,zn.property),uo(Te.subject,ds,Te.viaY1),en&&uo(Te.object,yn,en.property),uo(Te.object,ds,Te.viaY2),uo(Te.viaY1,Z,Te.viaY2)].filter(bS=>typeof bS=="number"),ca=wm(dn,mS);ca!==null&&Hr.set(`${Te.subject}\0${Te.object}`,ca)}let In=Te=>{if(Te.predicate!==Z)return ne.find(dn=>dn.subject===Te.subject&&dn.object===Te.object);let zn=K.find(dn=>dn.subject===Te.subject&&dn.object===Te.object);if(zn)return zn;let en=Pe.find(dn=>dn.subject===Te.subject&&dn.object===Te.object);return en?{subject:en.subject,predicate:Z,object:en.object,provenance:pS,trust:Hr.get(`${en.subject}\0${en.object}`)}:void 0};for(let Te of M){let zn=W(Te,I,je,ge,{maxHops:3});if(!zn)continue;let en=zn.map(In);if(en.every(Boolean)){let dn=wm(en.map(ca=>ca.trust),1);return{text:`yes \u2014 ${Ol(en)}`,replace:!0,...dn!==null?{trust:dn}:{}}}}}}let hS=ee(c,D),Wl=f.filter(H=>hS.has(H.subject)).sort(p),Cn=D.trim(),co=pn($[2]).trim(),gS=[...M].some(H=>W(H,I,je,xe,{maxHops:Z1}));if(Wl.length){let H=Wl.slice(0,3).map(oe).join("; "),{ON_PROPERTY_PREDICATE:$e,SOME_VALUES_FROM_PREDICATE:he}=await Promise.resolve().then(()=>(At(),rn)),Ee=new Set,Ne=new Set;for(let We of d)We.predicate===$e?Ee.add(We.subject):We.predicate===he&&Ne.add(We.subject);let It=new Set([...Ee].filter(We=>Ne.has(We))),ge=Wl.some(We=>It.has(We.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${Cn}", then ask me again.`:gS?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Cn}", then ask me again.`:`If it's true, teach me: "${Cn} is a kind of ${co}". If it isn't, teach me: "no ${Cn} is a ${co}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Cn} is a ${co}. I do know: ${H}. ${ge}`,replace:!0,miss:!0}}let vm=f.filter(H=>M.has(H.object)&&I.has(H.subject)).sort(p)[0];return vm?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(vm)}. A kind doesn't reverse. If it's true, teach me: "every ${Cn} is a ${co}". If it isn't, teach me: "no ${Cn} is a ${co}".`,replace:!0,miss:!0}:!Ct&&!U&&!b1(Cn)&&!d.some(H=>M.has(H.subject)||M.has(H.object))?{text:`I can't confirm that \u2014 I don't know "${Cn}" at all yet. If it's true, teach me: "${Cn} is a kind of ${co}". If it isn't, teach me: "no ${Cn} is a ${co}".`,replace:!0,miss:!0}:null}let E=l.match(OP);if(E){let[,I,D,M]=E,{SUBCLASS_PREDICATE:U,ON_PROPERTY_PREDICATE:W,buildCardinalityRestrictions:F,proveCardinalityAtLeast:Q,CARDINALITY_RULE_CONFIDENCE:Z,entailedTrustFrom:ce}=await Promise.resolve().then(()=>(At(),rn)),re=Wo,X=f.filter(Y=>Y.predicate===U&&re(Y)).map(Y=>[Y.subject,Y.object]),K=d.filter(Y=>(Y.predicate===W||jE.has(Y.predicate))&&re(Y)),ne=F(K);if(ne.length){let Y=ee(c,I.trim()),je=ee(c,M.trim()),Oe=Number(D),ue=bE(Y,je,(Ce,Ue)=>Q(X,ne,Ce,Ue,Oe,{}));if(ue){let Ce=d.find(de=>de.predicate===U&&de.subject===ue.viaClass&&de.object===ue.viaRestriction),Ue=Ce?.provenance?` (source: ${us(Ce.provenance)})`:"",xe=ue.kind==="exactly"?"exactly":"at least",le=(de,at)=>`${de}${at===1?"":"s"}`,ie=[Ce?.trust,...K.filter(de=>de.subject===ue.viaRestriction).map(de=>de.trust),...ue.viaClass!==ue.subject?[f.find(de=>de.predicate===U&&de.subject===ue.subject&&de.object===ue.viaClass)?.trust]:[]].filter(de=>typeof de=="number"),_e=ce(ie,Z);return{text:`yes \u2014 every ${ue.viaClass} has ${xe} ${ue.n} ${le(ue.object,ue.n)}${Ue}, so at least ${Oe} follows.`,replace:!0,..._e!==null?{trust:_e}:{}}}}}let R=l.match(LP);if(R){let[,I,D]=R,{SUBCLASS_PREDICATE:M,ON_PROPERTY_PREDICATE:U,buildCardinalityRestrictions:W,proveMaxCardinalityZeroDenial:F,CAX_MAXC0_RULE_CONFIDENCE:Q,entailedTrustFrom:Z}=await Promise.resolve().then(()=>(At(),rn)),ce=Wo,re=f.filter(ne=>ne.predicate===M&&ce(ne)).map(ne=>[ne.subject,ne.object]),X=d.filter(ne=>(ne.predicate===U||jE.has(ne.predicate))&&ce(ne)),K=W(X);if(K.length){let ne=ee(c,I.trim()),Y=ee(c,D.trim()),je=bE(ne,Y,(Oe,ue)=>F(re,K,Oe,ue,{}));if(je){let Oe=d.find(xe=>xe.predicate===M&&xe.subject===je.viaClass&&xe.object===je.viaRestriction),ue=Oe?.provenance?` (source: ${us(Oe.provenance)})`:"",Ce=[Oe?.trust,...X.filter(xe=>xe.subject===je.viaRestriction).map(xe=>xe.trust),...je.viaClass!==je.subject?[f.find(xe=>xe.predicate===M&&xe.subject===je.subject&&xe.object===je.viaClass)?.trust]:[]].filter(xe=>typeof xe=="number"),Ue=Z(Ce,Q);return{text:`no \u2014 every ${je.viaClass} has at most 0 ${je.object}${ue}.`,replace:!0,...Ue!==null?{trust:Ue}:{}}}}}let v=l.match(NP);if(v){let I=ee(c,v[1]),D=d.filter(M=>M.predicate===qp&&I.has(M.subject)).sort(p);return D.length?m(D):null}let j=u.match(PP);if(j){let[,I,D]=j,M=ee(c,I.trim()),U=ee(c,D.replace(/^an?\s+/i,"").trim()),W=d.filter(F=>F.predicate===qp&&U.has(F.subject)&&M.has(F.object)).sort(p)[0];return W?{text:`yes \u2014 ${oe(W)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} owns/maintains ${D.trim()}.`,replace:!0}}let k=u.match(MP);if(k){let[,I,D]=k,M=ee(c,I.replace(/^an?\s+/i,"").trim()),U=ee(c,D.trim()),W=d.filter(F=>F.predicate===qp&&M.has(F.subject)&&U.has(F.object)).sort(p)[0];return W?{text:`yes \u2014 ${oe(W)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} is owned by ${D.trim()}.`,replace:!0}}let w=u.match(FP);if(w){let[,I,D]=w,M=ee(c,I.trim()),U=ee(c,`${D.trim()} method`),W=d.filter(F=>F.predicate===Ir&&M.has(F.subject)&&U.has(F.object)).sort(p)[0];return W?{text:`yes \u2014 ${oe(W)}`,replace:!0}:null}let S=u.match(DP);if(S){let I=ee(c,S[1].trim()),D=d.filter(M=>M.predicate===Ir&&I.has(M.subject)&&/ method$/.test(M.object)).sort(p);return D.length?m(D):null}let x=u.match(kE);if(x){let I=x[1].trim(),D=_E.test(I)||RE.test(I)?null:Ls.test(I)?r||null:I,M=x[2].trim().toLowerCase();if(D){let U=ee(c,D),W=new Map,F=null;if(o){let K=await ia(o,D);if(F=K,K)for(let ne of Nl(o,K.id))for(let Y of ee(c,ne.label))!U.has(Y)&&!W.has(Y)&&W.set(Y,ne.label),U.add(Y)}let Q=K=>K.predicate===Kp&&c(K.object)===M||K.predicate===`tmct:${M}`&&K.object==="true",Z=c(D).split(/\s+/).filter(K=>K.length>=4&&!UE.has(K)),ce=K=>Z.some(ne=>new Set(String(K.subject||"").split(/\s+/)).has(ne)),re=K=>U.has(K.subject)||Z.length&&ce(K),X=d.filter(K=>re(K)&&Q(K)).sort(p)[0];if(X){let K=W.get(X.subject);return{text:K?`yes \u2014 the code graph says ${F.label} inherits ${K}, and ${oe(X)}`:`yes \u2014 ${oe(X)}`,replace:!0}}{let{findIsaChain:K,SUBCLASS_PREDICATE:ne,TYPE_PREDICATE:Y}=await Promise.resolve().then(()=>(At(),rn)),je=Wo,Oe=d.filter(ie=>ie.predicate===ne&&je(ie)),ue=d.filter(ie=>ie.predicate===Y&&je(ie)),Ce=Oe.map(ie=>[ie.subject,ie.object]),Ue=ue.map(ie=>[ie.subject,ie.object]),xe=ie=>(ie.predicate===ne?Oe:ue).find(_e=>_e.subject===ie.subject&&_e.object===ie.object),le=ee(c,M);for(let ie of U){let _e=K(ie,le,Ue,Ce,{maxHops:2});if(!_e)continue;let de=_e.map(xe);if(de.every(Boolean))return{text:`yes \u2014 ${Ol(de)}`,replace:!0}}}if(d.some(re)&&!n?.parsed)return/^there\b/i.test(D)||zP.test(M)?null:{text:`I don't have a fact saying ${q1(D)} is ${M}.`,replace:!0};if(!n?.parsed&&!fE.test(M))return TE(D,M)}}let A=cm(l).match(A1);if(A&&!Qp.test(l)){let[,I,D,M]=A,U=D.toLowerCase();if(!Jp.test(U)&&!Zp.test(U)){let W=I.trim(),F=O1(await Pl(U),M),Q=F.object.replace(/^an?\s+/i,"").trim();if(W&&Q){let Z=F.predicate,ce=ee(c,W),re=ee(c,Q),X=[Z,vr(Z)],K=d.filter(Y=>X.includes(Y.predicate)&&ce.has(Y.subject)&&re.has(Y.object)).sort(p)[0];if(K)return{text:`${Vb(K.predicate)?"no":"yes"} \u2014 ${oe(K)}`,replace:!0,generalVerbQuery:!0};let ne=d.filter(Y=>X.includes(Y.predicate)&&ce.has(Y.subject));if(ne.length){let Y=ne.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Qt({subject:W,predicate:Z,object:Q})}. I do know: ${Y}.`,replace:!0,miss:!0}}return null}}}let L=l.match(C1);if(L&&!Qp.test(l)){let[,I,D]=L,[M,U]=D.toLowerCase().split(/\s+/);if(!Jp.test(M)&&!Zp.test(M)){let W=I.trim();if(W){let F=await Pl(M);U&&/^mgx:[a-z]+$/.test(F)&&(F=`${F}-${U}`);let Q=ee(c,W),Z=[F,vr(F)],ce=st(d.filter(re=>Z.includes(re.predicate)&&Q.has(re.subject)),i);if(ce.length)return{...m(ce),generalVerbQuery:!0}}}}let T=l.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(T&&!Qp.test(l)){let[,I,D,M]=T,U=I.toLowerCase();if(!Jp.test(U)&&!Zp.test(U)&&!T1.test(U)){let W=await Pl(U);/^mgx:[a-z]+$/.test(W)&&(W=`${W}-${D.toLowerCase()}`);let F=ee(c,M.replace(/^(?:an?|the)\s+/i,"").trim()),Q=st(d.filter(Z=>Z.predicate===W&&F.has(Z.object)),i);if(Q.length)return{...m(Q),generalVerbQuery:!0}}}let O=l.match(CP);if(O){let I=ee(c,O[1]),D=st(d.filter(Z=>I.has(Z.subject)||I.has(Z.object)),i);if(!D.length)return null;let M=I.has(D[0].subject)?D[0].subject:D[0].object,U=D.map(Z=>` ${oe(Z)}`),W=U.slice(0,Se),F=U.slice(Se),Q=F.length?`
|
|
229
|
+
\u2026and ${F.length} more \u2014 say 'more' to see them.`:"";return{text:`${D.length} remembered fact${D.length===1?"":"s"} about ${M}:
|
|
230
|
+
${W.join(`
|
|
231
|
+
`)}${Q}`,replace:!0,...F.length?{pending:{items:F.map(Z=>Z.trim()),noun:"facts"}}:{}}}let _=n?.parsed?.shape==="meta"?n.parsed.object:null,P=!1,G=l.match(IP);if(G)_=G[1],P=!0;else if(!_&&!n?.parsed){let I=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);I&&(_=I[1])}if(!_)return null;let J=ee(c,_),q=st(f.filter(I=>J.has(I.subject)),i),z=st(f.filter(I=>J.has(I.object)),i),B=P?q.length?q:z:z.length?z:q;return B.length?m(B):null}function nm(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function KP(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(cE(),aE));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(Ti(),Xd)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}var um,b1,An,Il,lE,AE,DJ,w1,zJ,uE,y1,UJ,CE,IE,OE,$1,dE,BJ,WJ,GJ,VJ,HJ,fm,qJ,v1,He,qp,Kp,Go,x1,E1,Wo,KJ,YJ,XJ,JJ,QJ,ZJ,e9,t9,n9,s9,o9,r9,i9,a9,c9,l9,u9,d9,fE,k1,Dl,R1,f9,p9,mm,LE,m9,h9,g9,b9,_1,w9,Jp,Qp,T1,y9,A1,C1,Zp,I1,L1,$9,NE,PE,N1,v9,x9,ME,E9,S9,j9,P1,k9,M1,Vr,R9,_9,T9,FE,A9,C9,F1,I9,O9,L9,N9,pE,hm,Qt,z1,B1,W1,Ll,K1,UE,P9,rm,BE,Y1,X1,Fl,J1,Q1,ao,ls,Z1,eP,tP,am,wE,nP,Se,oP,rP,iP,aP,cP,lP,uP,dP,fP,pP,mP,hP,gP,bP,wP,$E,GE,$P,vP,EP,SP,jP,kP,RP,EE,_P,CP,IP,OP,LP,jE,NP,PP,MP,FP,DP,kE,Ls,zP,RE,_E,TE,UP,WP,GP,M9,KE,HP,qP,F9,sm,lm,YP,D9,z9,YE,U9,B9,W9,G9,V9,zl,H9,q9,K9,Y9,XP,X9,J9,Yi=N(()=>{Ye();_$();Kt();Me();Yn();zf();Uc();Bc();Zr();Wc();F$();qe();sc();Hc();Yc();Gn();vn();cr();Pa();Mf();Ff();rr();is();ju();Pr();Z$();sv();iv();Zf();av();sp();op();bv();wv();yv();ll();Ki();Mc();zr();ax();ux();so();Nx();Ma(void 0);Na(zc);um=new Set(["it","this","that","here"]),b1=e=>um.has(String(e||"").trim().toLowerCase()),An={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Il=e=>e?`${String(e).toLowerCase()}(s)`:"entities",lE="look up a taught fact about a subject/verb/object";AE={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},DJ=new Set(["stats","memory","focus",...Object.keys(AE)]),w1=new Set(["have","has","holds","hold"]),zJ=new RegExp(`\\b(?:${[...Object.keys(fe),...Object.keys(Ms)].filter(e=>!w1.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),uE=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,y1=(e,t)=>{let n=uE(e),s=uE(t);return n<s?-1:n>s?1:0},UJ=new Set([...R$.map(e=>e.name),...Object.values(AE).map(e=>e.tool)]),CE=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),IE=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),OE=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),$1=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),dE=e=>e.replace(/(.)\1+/g,"$1");BJ=dm(CE),WJ=dm(IE),GJ=dm(OE),VJ=new RegExp(`^(?:${[...$1].map(Ze).join("|")})\\s+(.+)$`,"i"),HJ=[...CE,...IE,...OE,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],fm="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",qJ=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${fm})\\s+than\\s+(.+)$`,"i"),v1=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${fm})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),He="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",qp="mgx:ownedBy",Kp="mgx:hasProperty",Go="rdfs:subClassOf",x1="rdf:type",E1=new Set(["operator","teach","entailed"]),Wo=e=>!!e.sourceTypes?.some(t=>E1.has(t));KJ=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),YJ=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),XJ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${He})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),JJ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${fm})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),QJ=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${He})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),ZJ=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");e9=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${He})\\s+([\\w-]+)[.!?]*$`,"i"),t9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${He})\\s+([\\w-]+)[.!?]*$`,"i"),n9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${He})\\s+([\\w-]+)[.!?]*$`,"i"),s9=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${He})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),o9=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${He})\\s+([\\w-]+)[?.!]*$`,"i"),r9=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${He})\\s+([\\w-]+)[?.!]*$`,"i"),i9=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${He})\\s+([\\w-]+)$`,"i"),a9=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${He})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),c9=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${He})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),l9=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${He})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),u9=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${He})\\s+(.+?)[?.!\\s]*$`,"i"),d9=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${He}))?[?.!\\s]*$`,"i"),fE=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,k1=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);Dl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",R1="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",f9=new RegExp(`^(.+?)\\s+(${R1})\\s+(.+)$`,"i"),p9=new RegExp(`^([\\w'-]+)\\s+${Dl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),mm="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",LE="with|to|from|by|of|in|on|for|as|about|into",m9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Dl}(${mm})\\s+(${LE})\\s+(.+)$`,"i"),h9=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${mm})\\s+(${LE})\\s+(.+)$`,"i"),g9=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${He})\\s+(.+?)[.!?]*$`,"i"),b9=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${He})\\s+(.+?)[.!?]*$`,"i"),_1="(?:just\\s+)?(?:one|another)\\s+more|another",w9=new RegExp(`^(?:${_1})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${He})\\s+(.+?)[.!?]*$`,"i"),Jp=/^(?:is|are|am|owns|maintains)$/i,Qp=/\b(?:is|are|am|owns|maintains)\b/i,T1=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),y9=new RegExp(`^(?:${go.filter(e=>!/\s/.test(e)).join("|")})$`,"i");A1=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Dl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),C1=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Dl}([a-z]+(?:\\s+(?:${He}))?)[?.!\\s]*$`,"i"),Zp=/^(?:be|own|maintain)$/i,I1=new RegExp(`^(${He})\\s+(.+)$`,"i");L1=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],$9=new RegExp(`^(?:${L1.join("|")})\\b\\s*,?\\s+`,"i"),NE=Object.freeze(["you","i","it","they","he","she","we"]),PE=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),N1=Object.freeze([...PE,...NE]),v9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${N1.join("|")})\\s+\\S+`,"i"),x9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${NE.join("|")})\\s+(?:is|are|am|was|were)|(${PE.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),ME="forget|unlearn|delete|remove",E9=new RegExp(`^(?:${ME})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),S9=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${He})\\s+([\\w-]+)$`,"i"),j9=new RegExp(`^(?:${ME})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${He})\\s+([\\w-]+)$`,"i"),P1="collection|set|group|family",k9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${P1})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),M1=Object.freeze(["mgx:memberOf","mgx:partOf"]),Vr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",R9=new RegExp(`^what\\s+does\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),_9=new RegExp(`^what\\s+(.+?)${Vr}\\s+does${Vr}\\??$`,"i"),T9=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),FE="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",A9=new RegExp(`^who\\s+(?:is|was)\\s+${FE}$`,"i"),C9=new RegExp(`^what\\s+(?:did|has)\\s+${FE}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),F1="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",I9=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${F1}\\b`,"i"),O9=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),L9=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});N9=new Set([...Object.keys(fe).flatMap(e=>e.split(/[\s-]+/)),...fn,...On,"owns","maintains"].filter(e=>e.length>=3)),pE=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);hm=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Qt=e=>`${e.subject} ${DE(e.predicate)} ${e.object}`;z1=Object.entries(Is).filter(([e])=>!hm.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);B1=/ \(source: [^)]*\)$/;W1=8;Ll=null;K1=/^(?:every|each|all|any)\s+/i;UE=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),P9=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),rm=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,BE=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Y1=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,X1=/^(who|what)'?s\s+/i,Fl=e=>String(e).replace(X1,(t,n)=>`${n} is `),J1=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;Q1=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,ao=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,ls=new Set(["rdfs:subClassOf","rdf:type"]),Z1=6,eP=/^why\s+(?=(?:is|are)\b)/i,tP=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;am=new Set(["kind","sort","type","subclass","superclass"]),wE=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,nP=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,Se=32;oP=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,rP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,iP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,aP=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,cP=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,lP=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,uP=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,dP=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,fP=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${He})\\s+(.+?)\\s*[?.!]*$`,"i"),pP=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,mP=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,hP=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,gP=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,bP=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,wP=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;$E=e=>String(e||"").replace(/\s+/g," ").trim();GE="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",$P=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${GE})[?.!\\s]*$`,"i"),vP=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${GE})\\s+([\\w'-]+)[?.!\\s]*$`,"i");EP=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),SP=Object.entries(Is).filter(([e])=>!EP.has(e)&&!hm.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Ze(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),jP=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),kP=new Set(["mgx:partOf","mgx:memberOf"]),RP=Object.entries(Is).filter(([e])=>!jP.has(e)&&!hm.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=Ze(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[gm(s),...o].map(Ze).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),EE=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,_P=new Set(["changed","change","changes","updated","modified","happened","occurred"]);CP=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,IP=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,OP=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,LP=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,jE=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),NP=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,PP=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,MP=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,FP=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,DP=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,kE=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ls=/^(?:it|this|that)$/i,zP=/^(?:it|them|this|that|in|on|of|to|at)$/i,RE=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,_E=/^(?:you|i|they|he|she|we)\b/i,TE=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Ml(e)} is ${t}".`,replace:!0}),UP=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;WP=/inherit|supertype|subclass|extend|specializ/i,GP=8;M9=new RegExp(`\\b(?:${[...um].join("|")})\\b`,"i"),KE=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,HP=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,qP=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;F9=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Xe).join("|")})$`,"i"),sm="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",lm="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",YP=`(?:\\s+${lm})?`,D9=[new RegExp(`^${sm}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${YP}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${sm}architecture\\s+(?:${lm}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${sm}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${lm}(?:\\s+here)?\\??$`,"i")],z9={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:An.contains,subclasses:An.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:An.calls,callees:An.calls,tests:An.tests,untested:An.tests,history:An.touches,exports:An.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it",news:"surface or work the news feed built over this graph"},YE="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",U9=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${YE}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),B9=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${YE}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),W9=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),G9=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),V9=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),zl="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",H9=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${zl}\\s*\\??$`,"i"),q9=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${zl}\\s*\\??$`,"i"),K9=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${zl}\\s*\\??$`,"i"),Y9=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${zl}\\s*[.!]*$`,"i"),XP=Object.freeze([...um].filter(e=>e!=="here").concat("they")),X9=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${XP.join("|")})\\b(\\s+\\S.*)?$`,"i"),J9=te(".tmct","memory","corpus-seed.json")});Yi();qe();qn();ll();var Ul={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var QE=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Vo=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Bl=e=>QE[e]||"other",QP=e=>Math.max(0,Math.min(1,e));function XE(e){let t=(e.sourceTypes||[]).map(n=>ms[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:ms.entailed}function ZP(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function JE(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function ZE(e,t,n={},s={}){let o={...Ul,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter(v=>v&&v.object&&v.object!==e),a=[],c=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,l=[];for(let v of i){if(Bl(v.predicate)==="isa"){let j=JE(v.object,n);if(c&&j>o.uninformativeClassMaxShare){a.push({row:v,family:"isa",reason:"uninformative-class",share:j});continue}}l.push(v)}let u=l.filter(v=>Bl(v.predicate)==="isa").map(v=>v.object),d=cl(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let v of d.clusters){let j=0;for(let k of v.objects){p.set(k,v.label);let w=l.find(S=>S.object===k&&Bl(S.predicate)==="isa");j+=w?XE(w):0}f.set(v.label,j)}let m=null,h=-1;for(let[v,j]of[...f].sort((k,w)=>k[0].localeCompare(w[0])))j>h&&(h=j,m=v);let g=[];for(let v of l){let j=Bl(v.predicate),k=XE(v),w={provenance:k};if(ZP(v)&&(k-=o.entailedDepthPenalty,w.entailed=!0),j==="isa"){let x=.6+.4*(1-JE(v.object,n));k*=x,w.informativeness=x;let A=p.get(v.object);m&&A&&A!==m&&(k-=o.minoritySensePenalty,w.minoritySense=A)}k=QP(k),g.push({row:v,family:j,score:k,reasons:w})}let b=[];for(let v of g)v.score<o.minScore?a.push({row:v.row,family:v.family,reason:"below-floor",score:v.score}):b.push(v);let y=new Map;for(let v of b)y.has(v.family)||y.set(v.family,[]),y.get(v.family).push(v);for(let v of y.values())v.sort((j,k)=>k.score-j.score||j.row.object.localeCompare(k.row.object));let $=Vo.filter(v=>y.has(v)).concat([...y.keys()].filter(v=>!Vo.includes(v)).sort()),E=[],R=!1;for(;E.length<r&&!R;){R=!0;for(let v of $){let j=y.get(v);if(j&&j.length&&(E.push(j.shift()),R=!1,E.length>=r))break}}for(let v of $)for(let j of y.get(v)||[])a.push({row:j.row,family:j.family,reason:"over-budget",score:j.score});return E.sort((v,j)=>{let k=Vo.indexOf(v.family),w=Vo.indexOf(j.family);return k-w||j.score-v.score||v.row.object.localeCompare(j.row.object)}),{term:e,selected:E,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}za();nt();var eM=new Set(["isa","location","partOf","capableOf","usedFor"]),tM=new Set(["single","several","chained","group","closer"]),eS=(e,t)=>`${e}:${t}`;function bm(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!eM.has(n.family)||typeof n.form!="string"||!tM.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=eS(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var Ho=e=>`${lr(e)} ${e}`;function nM(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Ho(t[0]),s=t.slice(1);return s.length?`${n}, and so ${ai(s.map(Ho))}`:n}function sM(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(c=>String(c||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:ur(o),A_TERM:Ho(o),A_TERM_CAP:ur(Ho(o)),TERMS:Da(o),TERMS_CAP:ur(Da(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Ho(a):"",OBJECT:i,A_OBJECT:i?Ho(i):"",OBJECTS_A:ai(r.map(Ho)),OBJECTS_PLURAL:ai(r.map(Da)),OBJECTS_RAW:ai(r),CHAIN:nM(n&&n.length?n:r.slice(0,1))}}function oM(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function Ns(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(eS(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=Ja(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(p=>p.object),f=oM(c[u],sM(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}za();var rM=Vo.filter(e=>e!=="isa"&&e!=="other");function iM(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function tS(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function aM(e,t){let n=c=>(t?.[c.object]||[])[1]||null,s=new Map;for(let c of e||[]){let l=n(c);l&&s.set(l,(s.get(l)||0)+1)}let o=new Map,r=[],i=[];for(let c of e||[]){let l=n(c);l&&s.get(l)>=2?(o.has(l)||(o.set(l,[]),r.push(l)),o.get(l).push(c)):i.push(c)}let a=r.map(c=>({parent:c,rows:o.get(c)}));return i.length&&a.push({parent:null,rows:i}),a}function cM(e,t,n){let s=new Map,o=new Map;for(let c of t||[]){let l=e?.[c.object];if(!Array.isArray(l)||l.length<2)continue;let u=l[l.length-1];!u||u===c.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(c))}let r=[...s.keys()].sort((c,l)=>s.get(l)-s.get(c)||c.localeCompare(l)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let c of r)for(let l of o.get(c)||[])a.has(l.id)||(a.add(l.id),i.push(l));return{roots:r,rows:i}}function lM(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let f=t[e[0].object],p=f&&f.length>1?"chained":"single",m=Ns(s,"isa",e,{term:n,form:p,chain:f});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let f=Ns(s,"isa",e,{term:n,form:"several"});return f&&r.push({...f,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),c=Ns(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});c&&r.push({...c,role:"names-term",paragraph:"definition"});let l=[];for(let f of aM(a,t))for(let p of tS(f.rows,o.maxObjectsPerBodySentence))l.push({parent:f.parent,rows:p});if(l.length>o.maxBodySentences){let f=l.slice(0,o.maxBodySentences),p=f[f.length-1];for(let m of l.slice(o.maxBodySentences))p.rows=p.rows.concat(m.rows);p.parent=null,l=f}for(let f of l){let p=f.parent?Ns(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):Ns(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=cM(t,e,o.closerRootCount);if(u.length){let f=Ns(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});f&&r.push({...f,role:"closes-isa",paragraph:"definition"})}return r}function uM(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=ur(`${lr(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function dM(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function nS(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Ul,...n.config||{}},a=iM(e?.selected||[]),c=[];for(let u of lM(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of rM){let d=a.get(u);if(!(!d||!d.length))for(let f of tS(d,i.maxObjectsPerBodySentence)){let p=Ns(t,u,f,{term:s});p&&c.push({...p,role:"describes",paragraph:"description"})}}uM(c,s);let l=new Map;for(let u of c)for(let d of u.rows)l.has(d.id)||l.set(d.id,d);return{term:s,sentences:c,paragraphs:dM(c,o),provenanceRows:[...l.values()]}}var fM=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function pM(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var mM=Object.freeze({facts:"show the facts",chains:"show the chains"});function hM(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:mM,facts:n.map(fM),factCount:n.length,chains:s}}function sS(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:pM(t?.provenanceRows||[]),detail:hM(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function oS(e,t,n={},s=new Map,o={}){let r=ZE(e,t,n,o),i=nS(r,s,o);return sS(r,i,o)}ll();Ki();var rS=new Set(["rdfs:subClassOf","rdf:type"]);function iS(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(rS.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function aS(e,t,n=6){let s=Xi(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=al(r,s,{cap:n,stopAt:il});i.length>1&&(o[r]=i)}return o}function cS(e){let t=[],n=new Set;for(let s of e||[])!s||!rS.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}qe();Yi();function gM(e,t,n,s,o={}){let r=bm(s||[]);if(!r||r.size===0)return null;let i=t||[],a=iS(n||i),c=aS(a.subClassEdges,cS(i));return oS(e,i,a,r,{...o,chains:c})}function lS(e,t,n,s={}){let o=mt(e||{individuals:[],objectProperties:[]}),r=ee(V,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=gM(t,i,o,n,s);return bM(a)}function bM(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var wM="no session is open on this page yet \u2014 await tmct.open() first",uS=Symbol.for("tmct.surface.fallback");function dS({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[uS])return a;let c=null,l=()=>{if(!c)throw new Error(wM);return c},u={async open(...d){return c=await e(...d),c},get session(){return c},async turn(d,f){let p=l();return s?s(d,f,p):typeof p.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:p.turn(d,f)},async ask(d,f){return t?t(d,f,l()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,f){return n?n(d,f,l()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[uS]=r,i.tmct=u,u}function yM({payload:e=null}={}){let t=Li();return e&&(t.payload=e),{memoryDir:t}}async function $M(e,t,n){let s=null;try{s=await VE(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await qE(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}dS({open:yM,ask:$M,page:{normFactTerm:V,digestTermFromPayloadBrowser:lS},fallback:!0});})();
|