@polycode-projects/the-mechanical-code-talker 5.0.33 → 5.0.34

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.
@@ -1,15 +1,15 @@
1
- (()=>{var IS=Object.defineProperty;var M=(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)IS(e,n,{get:t[n],enumerable:!0})};var bt,YM,XM,JM,QM,ZM,eF,tF,nF,sF,oF,rF,iF,aF,cF,lF,uF,ne,we,Ut,Ql,Cm,dF,fF,pF,Xe=M(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},YM=bt("createRequire"),XM=bt("readFileSync"),JM=bt("access"),QM=bt("readFile"),ZM=bt("writeFile"),eF=bt("appendFile"),tF=bt("mkdir"),nF=bt("mkdtemp"),sF=bt("rename"),oF=bt("unlink"),rF=bt("rm"),iF=bt("stat"),aF=bt("copyFile"),cF=bt("readdir"),lF=bt("createReadStream"),uF=bt("createWriteStream"),ne=(...e)=>e.join("/"),we=e=>String(e).replace(/\/[^/]*$/,""),Ut=(...e)=>e.join("/"),Ql=e=>String(e).startsWith("/"),Cm="/",dF=bt("randomBytes"),fF=bt("spawnSync"),pF=bt("createInterface")});var wt,hF,gF,Zl,Ae,Ko,OS,Dn,Im,da,eu,Om,NS,bF,LS,wF,yF,$F,vF,xF,Nt=M(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},hF=wt("createRequire"),gF=wt("readFileSync"),Zl=wt("access"),Ae=wt("readFile"),Ko=wt("writeFile"),OS=wt("appendFile"),Dn=wt("mkdir"),Im=wt("mkdtemp"),da=wt("rename"),eu=wt("unlink"),Om=wt("rm"),NS=wt("stat"),bF=wt("copyFile"),LS=wt("readdir"),wF=wt("createReadStream"),yF=wt("createWriteStream"),$F=wt("randomBytes"),vF=wt("spawnSync"),xF=wt("createInterface")});function Yo(e){let t=MS.exec(String(e||""));return t?t[1].toLowerCase():null}function fa(e){return String(e||"").replace(FS,"$1")}function zs(e){return e.replace(DS,"").trim()}function fn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(US,"").trim();if(s=s.replace(WS,"").trim(),s===t)break;t=s}return t}var Nm,qr,fo,Lm,Pm,PS,MS,Kr,dn,tu,FS,Cn,nu,DS,zS,US,BS,WS,pe,Yr,pa,GS,Mm,Qe,pn,Us,Fm,su,ou,ru,Dm,Xr,po,zm,Um,mo,ms,hs,Xo,at,Bm,ho,go,zn,Un,Wm,Jr,Jo,ma,Qo,Gm,Bn=M(()=>{Nm=["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",...Nm]},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"})}),Lm=Object.freeze(Object.fromEntries(Object.entries(fo).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Pm=Object.freeze(Object.values(fo).map(e=>e.predicate)),PS=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),MS=new RegExp(`^mgx:[a-z]+-(${PS.join("|")})$`,"i");Kr=Object.freeze([...Nm,"is the superclass of","are the superclass of","is the parent class of"]),dn=Object.freeze(["defined","declared","located","implemented"]),tu=Object.freeze(["now","currently","right now","at the moment","these days","today"]),FS=new RegExp(`\\s+(?:${[...tu].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Cn=Object.freeze(["mentioned","referenced"]),nu=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),DS=new RegExp(`\\s+(?:${nu.join("|")})\\s*[?.!]*$`,"i");zS=Object.freeze(["then","though","too"]),US=new RegExp(`\\s+(?:${zS.join("|")})\\s*[?.!]*$`,"i"),BS=Object.freeze(["please explain","explain"]),WS=new RegExp(`,\\s*(?:${BS.join("|")})\\s*[?.!]*$`,"i");pe=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"])),pa=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),GS=e=>!Kr.includes(e),Mm=Object.freeze([...new Set(Object.keys(pe).filter(GS).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Qe=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"}),pn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Us=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"}),Fm=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"}}),su=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"}),ou=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"}),ru=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"}),Dm=/\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"]),zm=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]}`}]),Um=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"]),ms=Object.freeze(["that","which","who"]),hs=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Xo=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"}),at=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}}),Bm=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"]),zn=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"}),Un=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"}}),Wm=Object.freeze({tests:"Module",test:"Module"}),Jr=Object.freeze(["those","them","these"]),Jo=Object.freeze(["contains","defines"]),ma=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"]),Qo=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Gm=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 Ze,Bs,ha=M(()=>{Ze="#000000",Bs=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Ze}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Ze}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Ze}" 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="${Ze}" 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="${Ze}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var VS,yn,Vm,Hm,iu,qm,_F,TF,Km=M(()=>{Bn();ha();VS=()=>Object.keys(Bs).sort(),yn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Vm=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Hm=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),iu=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:dn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:yn("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:yn("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:Vm("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:Hm("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:Hm("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:VS(),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:Vm("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:yn("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:yn("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:yn("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:yn("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:yn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:yn("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:yn("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:yn("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:yn("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:yn("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}}]),qm=iu.filter(e=>e.tier==="hot"),_F=iu.filter(e=>e.tier==="cold"),TF=Object.freeze(iu.map(e=>e.name))});var Ym,Ie,Kt=M(()=>{Xe();Ym=ne(".tmct","graph.json"),Ie=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function HS(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 Xm(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})=>HS(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 Jm=M(()=>{});var er={};Ot(er,{clearCache:()=>qS,emptyEntities:()=>au,fetchEntities:()=>JS,registerProvider:()=>KS});function qS(){Zo=null,Qr=null}function KS(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=ga;return ga=e??null,Zo=null,t}function au(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function YS(e){let t;try{t=await Ae(e,"utf8")}catch(n){if(n?.code==="ENOENT")return au();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 XS(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 YS(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Xm(s);return Qr={key:n,payload:o},o}async function JS(e){if(ga){let s;try{s=await ga(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 XS(e);if(Zo&&Zo.file===e.graphFile)return Zo.payload;let t;try{t=await Ae(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return au();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 Zo={file:e.graphFile,payload:n},n}var Zo,Qr,ga,Zr=M(()=>{Nt();Kt();Jm();Zo=null,Qr=null,ga=null});function Wn(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<=Qm)}function cu(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>Qm||QS.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=ZS))break;return t}function ba({name:e,doc:t}={}){return[...new Set([...Wn(e),...cu(t)])].sort()}function Zm(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([...Wn(t),...cu(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 eh(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 QS,Qm,ZS,Ws=M(()=>{QS=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+/)),Qm=40,ZS=120});function th(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 ej(e){if(!e.startsWith(sh))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(nh);if(o<0)return null;let r=n.slice(o+nh.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(sh.length,o),createdAt:s}:null}function Gn(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:nj(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",...th(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=ej(s);return o||{kind:"teach",...th(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 ch(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return rh;let n=Number(t);return Number.isFinite(n)?Math.max(lu,Math.min(ah,n)):rh}function lh(e,t=Date.now(),n=sj){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return oh+(1-oh)*Math.pow(.5,o/n)}function uh(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=oj(m);if(!h)continue;i.push(h);let g=(gs[h]??0)*ch(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=lh(e?.createdAt,s,n.halfLifeMs),d=tr(Math.min(1,c*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:tr(u)};return{score:d,inputs:f}}function ya(e,t){let n=(gs[e]??0)*ch(t);return tr(Math.max(0,Math.min(1,n)))}function rj(e){if(e==="operator")return 1;let t=gs[e];return t===void 0?1:(t+1)/2}function $a(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=lh(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:tr(c)})}let i=1;for(let[a,c]of o){let l=Math.max(rj(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?tr(Math.min(1,1-i)):0,inputs:r}}function dh(e){return $a(e,{halfLifeMs:ij})}function fh({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+aj),i=(o*r+1)/2;return tr(lu+(ah-lu)*i)}var nr,wa,ct,Gs,nh,sh,tj,nj,gs,uu,ih,sj,oh,lu,ah,rh,tr,oj,ij,aj,Vn=M(()=>{nr="mgx:trustScore",wa="mgx:trustInputs",ct="mgx:createdAt",Gs="mgx:updatedAt";nh="#node:",sh="peer:";tj="wikipedia-live",nj=e=>e===tj?"referenceLive":"reference";gs=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),uu=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"}}),ih=new Set(Object.entries(uu).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),sj=720*60*60*1e3,oh=.9,lu=.5,ah=1.5,rh=1,tr=(e,t=6)=>Number(e.toFixed(t)),oj=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";ij=1/0;aj=19});var wo,du=M(()=>{wo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function fu(e,t){return Math.log(1+e/(1+t))}var ei=M(()=>{});var xa={};Ot(xa,{bfsLevels:()=>va,findActionPath:()=>ti,findReachableSet:()=>pu});function ph(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function mh(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 ti(e,t,n,{maxDepth:s=50,stateKey:o=ph}={}){if(t(e))return{actions:[],states:[e]};let r=mh(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 pu(e,t,{maxDepth:n=50,stateKey:s=ph}={}){let o=mh(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*va(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 bs=M(()=>{});function Sa(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 ni(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function vs(e){let t=String(e?.prop||"").toLowerCase();if(hh[t])return hh[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 ys(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function mu(e){let t=ys(e).split("/");return t[t.length-1]}function cj(e){return(e?.derived_from||[]).filter(_h).length}function gh(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+cj(e)}function mn(e,t){let n=ys(t);if(!n)return{match:null,candidates:[]};let s=mu(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=ys(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(mu(a)===s||mu(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||gh(a.ind)-gh(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 lj(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 bh(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function $s(e){let t=e||"Entity",n=Wn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function yt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function $u(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${$s(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(_h);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}=lj(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(` ${bh(c)} (${l.length}) \u2192 ${yt(l.map(u=>u.objectLabel||u.object),wh)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${bh(c)} (${l.length}) by ${yt(l.map(u=>u.subjectLabel||u.subject),wh)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${yt(a,uj)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${$s(c.class)})`).join(", ")}`),e.truncated.length&&s.push(dj(e)),s.join(`
2
- `)}function dj(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 or(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=vs(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=ws(e,l.subject),d=ws(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 va(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 Th(e,t,{maxDepth:n=8}={}){let s=or(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>=fj){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,hu)){let u=l.tests.length?`tests: ${yt(l.tests,pj)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>hu&&o.push(` \u2026+${a.length-hu} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=vs({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 Ah(e){let t=new Map;for(let n of e.relations)if(vs(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 $h(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Lh(e,t,n=null){let s=n||(i=>ws(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 _e(e,i))r(s(a.subject),s(a.object));return o}function Yj(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*Dj&&f.length<n?f.push([m,h]):p.length<yh&&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<Bj&&i.length;l++){let u=new Map,d=[];for(let f of Wj){let p=Lh(e,f),m=new Map;for(let[b,$]of i)for(let y of p.get(b)||[])o.has(y)&&m.set(y,Math.max(m.get(y)||0,$));let[h,g]=r(m);for(let[b,$]of h)u.set(b,Math.max(u.get(b)||0,$));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*zj,m.score*Uj),c.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,yh).filter(([f])=>!c.has(f)))}}function Xj(e,t=[],{depth:n=Ih,q:s=Nh,nodeLimit:o=Oh,kinds:r=Gj,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=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 f=t.length>0&&d>0,p=new Set(c??u.keys());if(!p.size)return[];let m=Lh(e,r,a),h=S=>m.get(S)?.size||0,g=[],b=(S,A)=>S.hop!==A.hop?S.hop<A.hop:S.deg!==A.deg?S.deg<A.deg:S.id<A.id,$=(S,A)=>{let w=g[S];g[S]=g[A],g[A]=w},y=S=>{g.push(S);let A=g.length-1;for(;A>0;){let w=A-1>>1;if(b(g[A],g[w]))$(A,w),A=w;else break}},x=()=>{let S=g[0],A=g.pop();if(g.length){g[0]=A;let w=0;for(;;){let T=2*w+1,O=2*w+2,R=w;if(T<g.length&&b(g[T],g[R])&&(R=T),O<g.length&&b(g[O],g[R])&&(R=O),R===w)break;$(w,R),w=R}}return S},C=new Set(p);for(let S of p)y({id:S,hop:0,deg:h(S)});let v=null,j=0,E=[];for(;g.length&&j<o;){let S=x();if(E.push({id:S.id,hop:S.hop}),!p.has(S.id)){if(f){let T=d*Vj*Math.pow(Hj,S.hop-1),O=u.get(S.id);if(O)O.score+=Math.min(T*qj,O.score*Kj);else{let R=e.byId?.get?.(S.id);if(R&&i(R)){v||(v=Ah(e));let k=v.get(R.id)||[],L={ind:R,score:T,defineCount:k.length,matching:[],density:0};t.push(L),u.set(S.id,L)}}}j++}if(S.hop>=n||S.hop>0&&h(S.id)>l)continue;let A=[];for(let T of m.get(S.id)||[]){if(C.has(T))continue;let O=e.byId?.get?.(T);!O||!i(O)||A.push({id:T,deg:h(T)})}if(!A.length)continue;A.sort((T,O)=>T.deg-O.deg||(T.id<O.id?-1:T.id>O.id?1:0));let w=Math.max(1,Math.floor(s*A.length));for(let T=0;T<w;T++){let O=A[T];C.add(O.id),y({id:O.id,hop:S.hop+1,deg:O.deg})}}return E}function Ph(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=Ah(e),m=[];for(let x of e.individuals){if((x.class||"")!=="Module")continue;let C=String(x.label),v=C.toLowerCase(),j=p.get(x.id)||[],E=new Set(j.map(w=>w.toLowerCase())),S=new Set;for(let w of j)for(let T of $h(w))S.add(T);let A=u?String((x.attributes||[]).find(w=>w.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:x,label:C,labelLc:v,defines:j,symSet:E,symComps:S,dotted:A})}let h=m.length||1,g=new Map,b=x=>{let C=0;for(let v of m)(v.labelLc.includes(x)||v.symComps.has(x)||v.symSet.has(x))&&C++;return C},$=x=>(g.has(x)||g.set(x,fu(h,b(x))),g.get(x));for(let x of t)$(x);let y=[];for(let x of m){let C=0,v=0,j=0,E=[];for(let O of t){let R=g.get(O)||0;R&&(x.symSet.has(O)?(C+=R*Ch,j++):x.symComps.has(O)&&(E.push(R),j++),x.labelLc.includes(O)&&(v+=R*hj))}E.sort((O,R)=>R-O);let S=0;for(let O=0;O<Math.min(E.length,bj);O++)S+=E[O]*gj;let A=C+v+S;if(!A)continue;s&&(wo(x.labelLc)||vj(x.labelLc))?A*=$j:wo(x.labelLc)&&(A*=.4);let w=x.defines.filter(O=>{let R=O.toLowerCase(),k=$h(O);return t.some(L=>R===L||k.has(L))}),T=x.defines.length?j/x.defines.length:0;y.push({ind:x.ind,score:A,defineCount:x.defines.length,matching:w,density:T})}if(u&&d&&y.length){let x=String(d).toLowerCase(),C=S=>S!=null&&/[a-z0-9_./]/.test(S),v=S=>{for(let A=x.indexOf(S);A!==-1;A=x.indexOf(S,A+1))if(!C(x[A-1])&&!C(x[A+S.length]))return!0;return!1},j=new Map(m.map(S=>[S.ind.id,S])),E=0;for(let S of y)E=Math.max(E,S.score);for(let S of y){let A=j.get(S.ind.id);if(!A)continue;let w=0;for(let T of new Set([A.dotted,A.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<Lj||!v(T))continue;let O=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map($).sort((k,L)=>L-k),R=0;for(let k=0;k<Math.min(O.length,Pj);k++)R+=O[k]*Nj;w=Math.max(w,R)}w&&(S.score+=Math.min(w*Mj,E*Fj))}}if(y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of _e(e,"imports"))!x.has(v.subject)&&!x.has(v.object)||(C.has(v.subject)||C.set(v.subject,new Set),C.has(v.object)||C.set(v.object,new Set),C.get(v.subject).add(v.object),C.get(v.object).add(v.subject));for(let v of y){let j=0;for(let E of C.get(v.ind.id)||[])j=Math.max(j,x.get(E)||0);v.score+=Math.min(j*wj,v.score*yj)}}if(o&&y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of["calls","callsSymbol"])for(let j of _e(e,v)){let E=ws(e,j.subject),S=ws(e,j.object);!E||!S||E===S||!x.has(E)&&!x.has(S)||(C.has(E)||C.set(E,new Set),C.has(S)||C.set(S,new Set),C.get(E).add(S),C.get(S).add(E))}for(let v of y){let j=0;for(let E of C.get(v.ind.id)||[])j=Math.max(j,x.get(E)||0);v.score+=Math.min(j*xj,v.score*Ej)}}if(r&&y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&C.set(String(v.label),v);for(let v of y){if(!kj(v.ind.label))continue;let j=0;for(let E of _e(e,"inherits")){if(ws(e,E.subject)!==v.ind.id||!Rj(E.objectLabel))continue;let A=ws(e,E.object);if(!A){let w=C.get(String(E.objectLabel||""));w&&(A=Hn(e,w))}A&&(j=Math.max(j,x.get(A)||0))}v.score+=Math.min(j*Sj,v.score*jj)}}if(c&&y.length&&e.proseIndex){let x=bo(e.proseIndex,t.join(" "),{limit:Aj});if(x.length){let C=new Map;for(let{id:v,score:j}of x){let E=ws(e,v);E&&C.set(E,(C.get(E)||0)+j)}for(let v of y){let j=C.get(v.ind.id)||0;j&&(v.score+=Math.min(j*_j,v.score*Tj))}}}if(l&&y.length&&e.proseIndex){let x=new Map(y.map(j=>[j.ind.id,j])),C=new Map(m.map(j=>[j.ind.id,j])),v=new Map;for(let j of new Set(t)){let E=g.get(j)||0;if(!E)continue;let{ids:S}=eh(e.proseIndex,j);if(!S.length)continue;let A=new Set;for(let w of S){let T=ws(e,w);if(!T||A.has(T)||(A.add(T),!x.has(T)))continue;let O=C.get(T);O&&(O.symSet.has(j)||O.symComps.has(j)||O.labelLc.includes(j))||v.set(T,(v.get(T)||0)+E*Oj)}}for(let j of y){let E=v.get(j.ind.id)||0;E&&(j.score+=Math.min(E*Cj,j.score*Ij))}}return i&&y.length>1&&Yj(e,y,f),a&&y.length&&Xj(e,y,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:Ih,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:Nh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Oh}),y.sort((x,C)=>C.score-x.score||C.density-x.density||x.defineCount-C.defineCount||String(x.ind.label).length-String(C.ind.label).length),y}function Mh(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 Ph(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Qj(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 vu(e,{now:t=Date.now}={}){let n=String(e);if(n.length>vh)return{error:`name pattern is ${n.length} characters; the limit is ${vh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Qj(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>xh)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${xh}.`};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()+Eh;else if(t()>a)throw new Ea(`name pattern "${n}" exceeded its ${Eh}ms matching budget.`);return i.test(String(c).slice(0,Jj))}}}function Fh(e,t,{limit:n=ja,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=vu(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return sk(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof Ea)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=Ph(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: ${yt([...new Set(g)],mj)}`:"";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(`
1
+ (()=>{var OS=Object.defineProperty;var M=(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)OS(e,n,{get:t[n],enumerable:!0})};var bt,YM,XM,JM,QM,ZM,eF,tF,nF,sF,oF,rF,iF,aF,cF,lF,uF,ne,we,Ut,Ql,Cm,dF,fF,pF,Xe=M(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},YM=bt("createRequire"),XM=bt("readFileSync"),JM=bt("access"),QM=bt("readFile"),ZM=bt("writeFile"),eF=bt("appendFile"),tF=bt("mkdir"),nF=bt("mkdtemp"),sF=bt("rename"),oF=bt("unlink"),rF=bt("rm"),iF=bt("stat"),aF=bt("copyFile"),cF=bt("readdir"),lF=bt("createReadStream"),uF=bt("createWriteStream"),ne=(...e)=>e.join("/"),we=e=>String(e).replace(/\/[^/]*$/,""),Ut=(...e)=>e.join("/"),Ql=e=>String(e).startsWith("/"),Cm="/",dF=bt("randomBytes"),fF=bt("spawnSync"),pF=bt("createInterface")});var wt,hF,gF,Zl,Ae,Ko,NS,Dn,Im,da,eu,Om,LS,bF,PS,wF,yF,$F,vF,xF,Nt=M(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},hF=wt("createRequire"),gF=wt("readFileSync"),Zl=wt("access"),Ae=wt("readFile"),Ko=wt("writeFile"),NS=wt("appendFile"),Dn=wt("mkdir"),Im=wt("mkdtemp"),da=wt("rename"),eu=wt("unlink"),Om=wt("rm"),LS=wt("stat"),bF=wt("copyFile"),PS=wt("readdir"),wF=wt("createReadStream"),yF=wt("createWriteStream"),$F=wt("randomBytes"),vF=wt("spawnSync"),xF=wt("createInterface")});function Yo(e){let t=FS.exec(String(e||""));return t?t[1].toLowerCase():null}function fa(e){return String(e||"").replace(DS,"$1")}function zs(e){return e.replace(zS,"").trim()}function fn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(BS,"").trim();if(s=s.replace(GS,"").trim(),s===t)break;t=s}return t}var Nm,qr,fo,Lm,Pm,MS,FS,Kr,dn,tu,DS,Cn,nu,zS,US,BS,WS,GS,pe,Yr,pa,VS,Mm,Qe,pn,Us,Fm,su,ou,ru,Dm,Xr,po,zm,Um,mo,ms,hs,Xo,at,Bm,ho,go,zn,Un,Wm,Jr,Jo,ma,Qo,Gm,Bn=M(()=>{Nm=["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",...Nm]},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"})}),Lm=Object.freeze(Object.fromEntries(Object.entries(fo).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),Pm=Object.freeze(Object.values(fo).map(e=>e.predicate)),MS=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),FS=new RegExp(`^mgx:[a-z]+-(${MS.join("|")})$`,"i");Kr=Object.freeze([...Nm,"is the superclass of","are the superclass of","is the parent class of"]),dn=Object.freeze(["defined","declared","located","implemented"]),tu=Object.freeze(["now","currently","right now","at the moment","these days","today"]),DS=new RegExp(`\\s+(?:${[...tu].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Cn=Object.freeze(["mentioned","referenced"]),nu=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),zS=new RegExp(`\\s+(?:${nu.join("|")})\\s*[?.!]*$`,"i");US=Object.freeze(["then","though","too"]),BS=new RegExp(`\\s+(?:${US.join("|")})\\s*[?.!]*$`,"i"),WS=Object.freeze(["please explain","explain"]),GS=new RegExp(`,\\s*(?:${WS.join("|")})\\s*[?.!]*$`,"i");pe=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"])),pa=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),VS=e=>!Kr.includes(e),Mm=Object.freeze([...new Set(Object.keys(pe).filter(VS).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Qe=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"}),pn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),Us=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"}),Fm=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"}}),su=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"}),ou=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"}),ru=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"}),Dm=/\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"]),zm=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]}`}]),Um=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"]),ms=Object.freeze(["that","which","who"]),hs=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Xo=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"}),at=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}}),Bm=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"]),zn=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"}),Un=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"}}),Wm=Object.freeze({tests:"Module",test:"Module"}),Jr=Object.freeze(["those","them","these"]),Jo=Object.freeze(["contains","defines"]),ma=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"]),Qo=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Gm=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 Ze,Bs,ha=M(()=>{Ze="#000000",Bs=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Ze}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Ze}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Ze}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Ze}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Ze}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Ze}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ze}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Ze}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Ze}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Ze}" 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="${Ze}" 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="${Ze}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var HS,yn,Vm,Hm,iu,qm,_F,TF,Km=M(()=>{Bn();ha();HS=()=>Object.keys(Bs).sort(),yn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Vm=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Hm=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),iu=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:dn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:yn("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:yn("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:Vm("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:Hm("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:Hm("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:HS(),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:Vm("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:yn("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:yn("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:yn("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:yn("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:yn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:yn("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:yn("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:yn("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:yn("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:yn("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}}]),qm=iu.filter(e=>e.tier==="hot"),_F=iu.filter(e=>e.tier==="cold"),TF=Object.freeze(iu.map(e=>e.name))});var Ym,Ie,Kt=M(()=>{Xe();Ym=ne(".tmct","graph.json"),Ie=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function qS(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 Xm(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})=>qS(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 Jm=M(()=>{});var er={};Ot(er,{clearCache:()=>KS,emptyEntities:()=>au,fetchEntities:()=>QS,registerProvider:()=>YS});function KS(){Zo=null,Qr=null}function YS(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=ga;return ga=e??null,Zo=null,t}function au(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function XS(e){let t;try{t=await Ae(e,"utf8")}catch(n){if(n?.code==="ENOENT")return au();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 JS(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 XS(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Xm(s);return Qr={key:n,payload:o},o}async function QS(e){if(ga){let s;try{s=await ga(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 JS(e);if(Zo&&Zo.file===e.graphFile)return Zo.payload;let t;try{t=await Ae(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return au();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 Zo={file:e.graphFile,payload:n},n}var Zo,Qr,ga,Zr=M(()=>{Nt();Kt();Jm();Zo=null,Qr=null,ga=null});function Wn(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<=Qm)}function cu(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>Qm||ZS.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=ej))break;return t}function ba({name:e,doc:t}={}){return[...new Set([...Wn(e),...cu(t)])].sort()}function Zm(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([...Wn(t),...cu(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 eh(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 ZS,Qm,ej,Ws=M(()=>{ZS=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+/)),Qm=40,ej=120});function th(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 tj(e){if(!e.startsWith(sh))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(nh);if(o<0)return null;let r=n.slice(o+nh.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(sh.length,o),createdAt:s}:null}function Gn(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:sj(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",...th(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=tj(s);return o||{kind:"teach",...th(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 ch(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return rh;let n=Number(t);return Number.isFinite(n)?Math.max(lu,Math.min(ah,n)):rh}function lh(e,t=Date.now(),n=oj){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return oh+(1-oh)*Math.pow(.5,o/n)}function uh(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=rj(m);if(!h)continue;i.push(h);let g=(gs[h]??0)*ch(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=lh(e?.createdAt,s,n.halfLifeMs),d=tr(Math.min(1,c*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:tr(u)};return{score:d,inputs:f}}function ya(e,t){let n=(gs[e]??0)*ch(t);return tr(Math.max(0,Math.min(1,n)))}function ij(e){if(e==="operator")return 1;let t=gs[e];return t===void 0?1:(t+1)/2}function $a(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=lh(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:tr(c)})}let i=1;for(let[a,c]of o){let l=Math.max(ij(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?tr(Math.min(1,1-i)):0,inputs:r}}function dh(e){return $a(e,{halfLifeMs:aj})}function fh({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+cj),i=(o*r+1)/2;return tr(lu+(ah-lu)*i)}var nr,wa,ct,Gs,nh,sh,nj,sj,gs,uu,ih,oj,oh,lu,ah,rh,tr,rj,aj,cj,Vn=M(()=>{nr="mgx:trustScore",wa="mgx:trustInputs",ct="mgx:createdAt",Gs="mgx:updatedAt";nh="#node:",sh="peer:";nj="wikipedia-live",sj=e=>e===nj?"referenceLive":"reference";gs=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),uu=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"}}),ih=new Set(Object.entries(uu).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),oj=720*60*60*1e3,oh=.9,lu=.5,ah=1.5,rh=1,tr=(e,t=6)=>Number(e.toFixed(t)),rj=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";aj=1/0;cj=19});var wo,du=M(()=>{wo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function fu(e,t){return Math.log(1+e/(1+t))}var ei=M(()=>{});var xa={};Ot(xa,{bfsLevels:()=>va,findActionPath:()=>ti,findReachableSet:()=>pu});function ph(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function mh(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 ti(e,t,n,{maxDepth:s=50,stateKey:o=ph}={}){if(t(e))return{actions:[],states:[e]};let r=mh(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 pu(e,t,{maxDepth:n=50,stateKey:s=ph}={}){let o=mh(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*va(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 bs=M(()=>{});function Sa(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 ni(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function vs(e){let t=String(e?.prop||"").toLowerCase();if(hh[t])return hh[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 ys(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function mu(e){let t=ys(e).split("/");return t[t.length-1]}function lj(e){return(e?.derived_from||[]).filter(_h).length}function gh(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+lj(e)}function mn(e,t){let n=ys(t);if(!n)return{match:null,candidates:[]};let s=mu(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=ys(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(mu(a)===s||mu(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||gh(a.ind)-gh(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 uj(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 bh(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function $s(e){let t=e||"Entity",n=Wn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function yt(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function $u(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${$s(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(_h);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}=uj(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(` ${bh(c)} (${l.length}) \u2192 ${yt(l.map(u=>u.objectLabel||u.object),wh)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${bh(c)} (${l.length}) by ${yt(l.map(u=>u.subjectLabel||u.subject),wh)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${yt(a,dj)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${$s(c.class)})`).join(", ")}`),e.truncated.length&&s.push(fj(e)),s.join(`
2
+ `)}function fj(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 or(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=vs(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=ws(e,l.subject),d=ws(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 va(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 Th(e,t,{maxDepth:n=8}={}){let s=or(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>=pj){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,hu)){let u=l.tests.length?`tests: ${yt(l.tests,mj)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>hu&&o.push(` \u2026+${a.length-hu} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=vs({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 Ah(e){let t=new Map;for(let n of e.relations)if(vs(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 $h(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Lh(e,t,n=null){let s=n||(i=>ws(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 _e(e,i))r(s(a.subject),s(a.object));return o}function Xj(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*zj&&f.length<n?f.push([m,h]):p.length<yh&&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<Wj&&i.length;l++){let u=new Map,d=[];for(let f of Gj){let p=Lh(e,f),m=new Map;for(let[b,$]of i)for(let y of p.get(b)||[])o.has(y)&&m.set(y,Math.max(m.get(y)||0,$));let[h,g]=r(m);for(let[b,$]of h)u.set(b,Math.max(u.get(b)||0,$));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*Uj,m.score*Bj),c.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,yh).filter(([f])=>!c.has(f)))}}function Jj(e,t=[],{depth:n=Ih,q:s=Nh,nodeLimit:o=Oh,kinds:r=Vj,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=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 f=t.length>0&&d>0,p=new Set(c??u.keys());if(!p.size)return[];let m=Lh(e,r,a),h=S=>m.get(S)?.size||0,g=[],b=(S,A)=>S.hop!==A.hop?S.hop<A.hop:S.deg!==A.deg?S.deg<A.deg:S.id<A.id,$=(S,A)=>{let w=g[S];g[S]=g[A],g[A]=w},y=S=>{g.push(S);let A=g.length-1;for(;A>0;){let w=A-1>>1;if(b(g[A],g[w]))$(A,w),A=w;else break}},x=()=>{let S=g[0],A=g.pop();if(g.length){g[0]=A;let w=0;for(;;){let T=2*w+1,O=2*w+2,R=w;if(T<g.length&&b(g[T],g[R])&&(R=T),O<g.length&&b(g[O],g[R])&&(R=O),R===w)break;$(w,R),w=R}}return S},C=new Set(p);for(let S of p)y({id:S,hop:0,deg:h(S)});let v=null,j=0,E=[];for(;g.length&&j<o;){let S=x();if(E.push({id:S.id,hop:S.hop}),!p.has(S.id)){if(f){let T=d*Hj*Math.pow(qj,S.hop-1),O=u.get(S.id);if(O)O.score+=Math.min(T*Kj,O.score*Yj);else{let R=e.byId?.get?.(S.id);if(R&&i(R)){v||(v=Ah(e));let k=v.get(R.id)||[],L={ind:R,score:T,defineCount:k.length,matching:[],density:0};t.push(L),u.set(S.id,L)}}}j++}if(S.hop>=n||S.hop>0&&h(S.id)>l)continue;let A=[];for(let T of m.get(S.id)||[]){if(C.has(T))continue;let O=e.byId?.get?.(T);!O||!i(O)||A.push({id:T,deg:h(T)})}if(!A.length)continue;A.sort((T,O)=>T.deg-O.deg||(T.id<O.id?-1:T.id>O.id?1:0));let w=Math.max(1,Math.floor(s*A.length));for(let T=0;T<w;T++){let O=A[T];C.add(O.id),y({id:O.id,hop:S.hop+1,deg:O.deg})}}return E}function Ph(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=Ah(e),m=[];for(let x of e.individuals){if((x.class||"")!=="Module")continue;let C=String(x.label),v=C.toLowerCase(),j=p.get(x.id)||[],E=new Set(j.map(w=>w.toLowerCase())),S=new Set;for(let w of j)for(let T of $h(w))S.add(T);let A=u?String((x.attributes||[]).find(w=>w.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:x,label:C,labelLc:v,defines:j,symSet:E,symComps:S,dotted:A})}let h=m.length||1,g=new Map,b=x=>{let C=0;for(let v of m)(v.labelLc.includes(x)||v.symComps.has(x)||v.symSet.has(x))&&C++;return C},$=x=>(g.has(x)||g.set(x,fu(h,b(x))),g.get(x));for(let x of t)$(x);let y=[];for(let x of m){let C=0,v=0,j=0,E=[];for(let O of t){let R=g.get(O)||0;R&&(x.symSet.has(O)?(C+=R*Ch,j++):x.symComps.has(O)&&(E.push(R),j++),x.labelLc.includes(O)&&(v+=R*gj))}E.sort((O,R)=>R-O);let S=0;for(let O=0;O<Math.min(E.length,wj);O++)S+=E[O]*bj;let A=C+v+S;if(!A)continue;s&&(wo(x.labelLc)||xj(x.labelLc))?A*=vj:wo(x.labelLc)&&(A*=.4);let w=x.defines.filter(O=>{let R=O.toLowerCase(),k=$h(O);return t.some(L=>R===L||k.has(L))}),T=x.defines.length?j/x.defines.length:0;y.push({ind:x.ind,score:A,defineCount:x.defines.length,matching:w,density:T})}if(u&&d&&y.length){let x=String(d).toLowerCase(),C=S=>S!=null&&/[a-z0-9_./]/.test(S),v=S=>{for(let A=x.indexOf(S);A!==-1;A=x.indexOf(S,A+1))if(!C(x[A-1])&&!C(x[A+S.length]))return!0;return!1},j=new Map(m.map(S=>[S.ind.id,S])),E=0;for(let S of y)E=Math.max(E,S.score);for(let S of y){let A=j.get(S.ind.id);if(!A)continue;let w=0;for(let T of new Set([A.dotted,A.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<Pj||!v(T))continue;let O=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map($).sort((k,L)=>L-k),R=0;for(let k=0;k<Math.min(O.length,Mj);k++)R+=O[k]*Lj;w=Math.max(w,R)}w&&(S.score+=Math.min(w*Fj,E*Dj))}}if(y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of _e(e,"imports"))!x.has(v.subject)&&!x.has(v.object)||(C.has(v.subject)||C.set(v.subject,new Set),C.has(v.object)||C.set(v.object,new Set),C.get(v.subject).add(v.object),C.get(v.object).add(v.subject));for(let v of y){let j=0;for(let E of C.get(v.ind.id)||[])j=Math.max(j,x.get(E)||0);v.score+=Math.min(j*yj,v.score*$j)}}if(o&&y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of["calls","callsSymbol"])for(let j of _e(e,v)){let E=ws(e,j.subject),S=ws(e,j.object);!E||!S||E===S||!x.has(E)&&!x.has(S)||(C.has(E)||C.set(E,new Set),C.has(S)||C.set(S,new Set),C.get(E).add(S),C.get(S).add(E))}for(let v of y){let j=0;for(let E of C.get(v.ind.id)||[])j=Math.max(j,x.get(E)||0);v.score+=Math.min(j*Ej,v.score*Sj)}}if(r&&y.length>1){let x=new Map(y.map(v=>[v.ind.id,v.score])),C=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&C.set(String(v.label),v);for(let v of y){if(!Rj(v.ind.label))continue;let j=0;for(let E of _e(e,"inherits")){if(ws(e,E.subject)!==v.ind.id||!_j(E.objectLabel))continue;let A=ws(e,E.object);if(!A){let w=C.get(String(E.objectLabel||""));w&&(A=Hn(e,w))}A&&(j=Math.max(j,x.get(A)||0))}v.score+=Math.min(j*jj,v.score*kj)}}if(c&&y.length&&e.proseIndex){let x=bo(e.proseIndex,t.join(" "),{limit:Cj});if(x.length){let C=new Map;for(let{id:v,score:j}of x){let E=ws(e,v);E&&C.set(E,(C.get(E)||0)+j)}for(let v of y){let j=C.get(v.ind.id)||0;j&&(v.score+=Math.min(j*Tj,v.score*Aj))}}}if(l&&y.length&&e.proseIndex){let x=new Map(y.map(j=>[j.ind.id,j])),C=new Map(m.map(j=>[j.ind.id,j])),v=new Map;for(let j of new Set(t)){let E=g.get(j)||0;if(!E)continue;let{ids:S}=eh(e.proseIndex,j);if(!S.length)continue;let A=new Set;for(let w of S){let T=ws(e,w);if(!T||A.has(T)||(A.add(T),!x.has(T)))continue;let O=C.get(T);O&&(O.symSet.has(j)||O.symComps.has(j)||O.labelLc.includes(j))||v.set(T,(v.get(T)||0)+E*Nj)}}for(let j of y){let E=v.get(j.ind.id)||0;E&&(j.score+=Math.min(E*Ij,j.score*Oj))}}return i&&y.length>1&&Xj(e,y,f),a&&y.length&&Jj(e,y,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:Ih,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:Nh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:Oh}),y.sort((x,C)=>C.score-x.score||C.density-x.density||x.defineCount-C.defineCount||String(x.ind.label).length-String(C.ind.label).length),y}function Mh(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 Ph(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Zj(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 vu(e,{now:t=Date.now}={}){let n=String(e);if(n.length>vh)return{error:`name pattern is ${n.length} characters; the limit is ${vh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Zj(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>xh)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${xh}.`};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()+Eh;else if(t()>a)throw new Ea(`name pattern "${n}" exceeded its ${Eh}ms matching budget.`);return i.test(String(c).slice(0,Qj))}}}function Fh(e,t,{limit:n=ja,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=vu(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return ok(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof Ea)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=Ph(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: ${yt([...new Set(g)],hj)}`:"";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
4
  `)}function _e(e,t){let n=Sh.get(e);n||(n=new Map,Sh.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(vs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function ws(e,t){let n=e.byId?.get?.(t);if(n)return Hn(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Hn(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 xu(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function sr(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function Dh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${$s(t.class)} (id: ${t.id})`],o=_e(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
5
  `);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=xu(c?Bt(c):null),u=c?sr(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${yt(r,jh)}`),i.length&&s.push(`attributes (${i.length}): ${yt(i,jh)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
6
  `)}function zh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Bt(t),o=[`${t.label} \u2014 ${$s(t.class)}${xu(s)}`],r=qe(t,"params"),i=qe(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];qe(t,"isStatic")&&a.push("static"),qe(t,"isAbstract")&&a.push("abstract"),qe(t,"isConstant")&&a.push("constant");let c=qe(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=sr(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=qe(t,"raises");u&&o.push(`raises: ${u}`);let d=qe(t,"catches");d&&o.push(`catches: ${d}`);let f=qe(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=qe(t,"value");p&&o.push(`value: ${p}`);let m=qe(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
7
  `)}function Uh(e,t){let n=_e(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 ${$s(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${yt(s,kh)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of va(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}): ${yt(c,kh)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
- `)}function ka(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 Ra(e,t=""){let n=ys(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||ys(s.label).startsWith(n)))}function Bh(e,{pkg:t=""}={}){let n=ys(t),s=Ra(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=ka(s),r=new Map;for(let u of _e(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,ek).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): ${yt(c.map(([u,d])=>`${u} (${d})`),Zj)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
8
+ `)}function ka(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 Ra(e,t=""){let n=ys(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||ys(s.label).startsWith(n)))}function Bh(e,{pkg:t=""}={}){let n=ys(t),s=Ra(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=ka(s),r=new Map;for(let u of _e(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,tk).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): ${yt(c.map(([u,d])=>`${u} (${d})`),ek)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
9
9
  `)}function Gh(e,t){let n=Hn(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(_e(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
10
  ${yt(o,Wh,`
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
- ${tk}`}function Vh(e,{codeDomainActive:t=null}={}){let n=t??ni(e)>0,s=new Set,o=new Set;for(let a of _e(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?ni(e)===0?`no modules to check for test coverage in this index. ${yu}`:"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:
12
+ ${nk}`}function Vh(e,{codeDomainActive:t=null}={}){let n=t??ni(e)>0,s=new Set,o=new Set;for(let a of _e(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?ni(e)===0?`no modules to check for test coverage in this index. ${yu}`:"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
13
  ${yt(i,Wh,`
14
14
  `)}`:"every source module has at least one covering test module."}function Hh(e,t){let n=Hn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${yt(o,tn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Kh(e,t,{toolNamePrefix:n="tmct_"}={}){if(qh.has(t.class)){let i=[...new Set(_e(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
15
  ${yt(i,si,`
@@ -19,7 +19,7 @@ ${tk}`}function Vh(e,{codeDomainActive:t=null}={}){let n=t??ni(e)>0,s=new Set,o=
19
19
  ${yt(r,si,`
20
20
  `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=Hn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(_e(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
21
  ${yt(o,si,`
22
- `)}`:`${s}: no recorded callees.`}function Xh(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 Eu(e,t){if(!t?.id)return"";let n=_e(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${yt(n.map(s=>Xh(e,s)),nk)}`:""}function Jh(e,t){let n=_e(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${$s(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=>Xh(e,o));return`${t.label} \u2014 ${$s(t.class)} calls ${n.length} in-repo symbol(s):
22
+ `)}`:`${s}: no recorded callees.`}function Xh(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 Eu(e,t){if(!t?.id)return"";let n=_e(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${yt(n.map(s=>Xh(e,s)),sk)}`:""}function Jh(e,t){let n=_e(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${$s(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=>Xh(e,o));return`${t.label} \u2014 ${$s(t.class)} calls ${n.length} in-repo symbol(s):
23
23
  ${yt(s,si,`
24
24
  `)}`}function Qh(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=qe(s,"commitDate")||qe(s,"date"),i=qe(s,"commitAuthor")||qe(s,"author"),a=qe(s,"commitMessage")||qe(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function Zh(e,t){let n=Hn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(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=>` ${Qh(e,a.subject,a.subjectLabel)}`),i=o.length>tn?`
25
25
  \u2026+${o.length-tn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
@@ -27,8 +27,8 @@ ${r.join(`
27
27
  `)}${i}`}function eg(e,t){let n=_e(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${$s(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=>` ${Qh(e,r.subject,r.subjectLabel)}`),o=n.length>tn?`
28
28
  \u2026+${n.length-tn} more`:"";return`${t.label} \u2014 ${$s(t.class)}: touched by ${n.length} commit(s):
29
29
  ${s.join(`
30
- `)}${o}`}function tg(e,t){return eg(e,t)}function ng(e,t){return eg(e,t)}function Su(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=sg[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!sr(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 sk(e,t,{limit:n=ja,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!sg[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=Su(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}${xu(Bt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
- `)}function pk(e){return{paramCount:_a(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function mk(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>_a(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:fk(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function hk(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(_a(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 gk(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of gu(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(gu(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(Rh(n)),d=s?.start??null;for(let f of e){let p=gu(f.decorators).some(b=>l.has(b))?1:0,m=Rh(f.label).filter(b=>u.has(b)).length,h=hk(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 rr(e,t){let n=Hn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=_e(e,"defines").filter(w=>w.subject===n),r=new Map;for(let w of _e(e,"callsSymbol"))r.has(w.subject)||r.set(w.subject,new Set),r.get(w.subject).add(w.object);let i=[],a=[],c=0;for(let w of o){let T=e.byId.get(w.object);if(!T)continue;let O=T.class||"",R=Bt(T);O==="GlobalVariable"?(a.push({label:T.label,value:(T.attributes||[]).find(k=>k.key==="value")?.value||"",site:R}),R&&(c=Math.max(c,R.end))):(O==="Function"||O==="Class")&&(i.push({id:T.id,label:T.label,class:O,site:R,decorators:sr(T),raises:qe(T,"raises"),doc:qe(T,"doc"),params:qe(T,"params"),returns:qe(T,"returns"),callees:r.get(T.id)||new Set}),R&&(c=Math.max(c,R.end)))}let l=Bt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:sr(t),raises:qe(t,"raises"),params:qe(t,"params"),returns:qe(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?pk(u):mk(i);i=gk(i,u||{label:t.label},f);let p=u?null:i.find(w=>w.site&&w.label!==t.label)||null,m=[...new Set(_e(e,"tests").filter(w=>w.object===n).map(w=>w.subjectLabel||w.subject))].slice(0,ak),h=ag(e,n).slice(0,ik),g=_e(e,"reexports").filter(w=>w.subject===n).map(w=>w.objectLabel||w.object).slice(0,20),b=qe(e.byId.get(n),"all"),$=_e(e,"contains"),y=null;(t.class||"")==="Class"?y=t.id:(t.class||"")==="Method"&&(y=$.find(w=>w.object===t.id)?.subject||null);let x=null;if(y){let w=e.byId.get(y),T=$.filter(O=>O.subject===y).map(O=>{let R=e.byId.get(O.object);return{label:O.objectLabel||R?.label||O.object,class:R?.class||"",site:R?Bt(R):null,decorators:R?sr(R):"",params:R?qe(R,"params"):"",returns:R?qe(R,"returns"):"",raises:R?qe(R,"raises"):""}}).slice(0,rk);x={className:w?.label||String(y).replace(/^fn:.*#/,""),members:T,total:$.filter(O=>O.subject===y).length}}let C=null;for(let w of[...i,...a])w.site&&(!C||w.site.start>C.start)&&(C=w.site);let v=C?{start:C.start,end:C.end}:null,j=u||p,E=j?.id?e.byId.get(j.id):null,S=E?Eu(e,E):"",A=[];if(j?.callees)for(let w of j.callees){let T=e.byId.get(w),O=T?Bt(T):null;if(O&&A.push({label:T.label,site:O}),A.length>=dk)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:x,insertion:c,insertionRegion:v,calleeBodies:A,callHint:S,siblingCap:ok}}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 og(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 Ta(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=_a(s.params);(i>ck||a>lk||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)>=uk;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:yo(o),topup:o!=="TINY"}}function rg(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
30
+ `)}${o}`}function tg(e,t){return eg(e,t)}function ng(e,t){return eg(e,t)}function Su(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=sg[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!sr(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 ok(e,t,{limit:n=ja,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!sg[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=Su(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}${xu(Bt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
+ `)}function mk(e){return{paramCount:_a(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function hk(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>_a(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:pk(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function gk(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(_a(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 bk(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of gu(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(gu(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(Rh(n)),d=s?.start??null;for(let f of e){let p=gu(f.decorators).some(b=>l.has(b))?1:0,m=Rh(f.label).filter(b=>u.has(b)).length,h=gk(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 rr(e,t){let n=Hn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=_e(e,"defines").filter(w=>w.subject===n),r=new Map;for(let w of _e(e,"callsSymbol"))r.has(w.subject)||r.set(w.subject,new Set),r.get(w.subject).add(w.object);let i=[],a=[],c=0;for(let w of o){let T=e.byId.get(w.object);if(!T)continue;let O=T.class||"",R=Bt(T);O==="GlobalVariable"?(a.push({label:T.label,value:(T.attributes||[]).find(k=>k.key==="value")?.value||"",site:R}),R&&(c=Math.max(c,R.end))):(O==="Function"||O==="Class")&&(i.push({id:T.id,label:T.label,class:O,site:R,decorators:sr(T),raises:qe(T,"raises"),doc:qe(T,"doc"),params:qe(T,"params"),returns:qe(T,"returns"),callees:r.get(T.id)||new Set}),R&&(c=Math.max(c,R.end)))}let l=Bt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:sr(t),raises:qe(t,"raises"),params:qe(t,"params"),returns:qe(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?mk(u):hk(i);i=bk(i,u||{label:t.label},f);let p=u?null:i.find(w=>w.site&&w.label!==t.label)||null,m=[...new Set(_e(e,"tests").filter(w=>w.object===n).map(w=>w.subjectLabel||w.subject))].slice(0,ck),h=ag(e,n).slice(0,ak),g=_e(e,"reexports").filter(w=>w.subject===n).map(w=>w.objectLabel||w.object).slice(0,20),b=qe(e.byId.get(n),"all"),$=_e(e,"contains"),y=null;(t.class||"")==="Class"?y=t.id:(t.class||"")==="Method"&&(y=$.find(w=>w.object===t.id)?.subject||null);let x=null;if(y){let w=e.byId.get(y),T=$.filter(O=>O.subject===y).map(O=>{let R=e.byId.get(O.object);return{label:O.objectLabel||R?.label||O.object,class:R?.class||"",site:R?Bt(R):null,decorators:R?sr(R):"",params:R?qe(R,"params"):"",returns:R?qe(R,"returns"):"",raises:R?qe(R,"raises"):""}}).slice(0,ik);x={className:w?.label||String(y).replace(/^fn:.*#/,""),members:T,total:$.filter(O=>O.subject===y).length}}let C=null;for(let w of[...i,...a])w.site&&(!C||w.site.start>C.start)&&(C=w.site);let v=C?{start:C.start,end:C.end}:null,j=u||p,E=j?.id?e.byId.get(j.id):null,S=E?Eu(e,E):"",A=[];if(j?.callees)for(let w of j.callees){let T=e.byId.get(w),O=T?Bt(T):null;if(O&&A.push({label:T.label,site:O}),A.length>=fk)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:x,insertion:c,insertionRegion:v,calleeBodies:A,callHint:S,siblingCap:rk}}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 og(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 Ta(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=_a(s.params);(i>lk||a>uk||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)>=dk;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:yo(o),topup:o!=="TINY"}}function rg(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(`
@@ -51,22 +51,22 @@ ${s.join(`
51
51
  \u2026+${o.length-bu} more`:"")}function lg(e,t){let n=Hn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=_e(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,wu).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
53
  `)}`+(o.length>wu?`
54
- \u2026+${o.length-wu} more`:"")}var yu,hh,_h,wh,uj,fj,hu,pj,ja,mj,hj,gj,Ch,bj,wj,yj,$j,vj,xj,Ej,Sj,jj,kj,Rj,_j,Tj,Aj,Cj,Ij,Oj,Nj,Lj,Pj,Mj,Fj,Dj,zj,Uj,yh,Bj,Wj,Ih,Oh,Nh,Gj,Vj,Hj,qj,Kj,vh,xh,Jj,Eh,Ea,Sh,jh,kh,si,qe,Zj,ek,Wh,tk,tn,qh,nk,sg,ok,rk,ik,ak,ck,lk,uk,dk,gu,Rh,_a,fk,bu,wu,Me=M(()=>{Ws();Vn();du();ei();bs();yu="This store holds no code index, so it records no modules or commits to look through.",hh={"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"};_h=e=>/^(git|turn):/.test(String(e||""));wh=30,uj=8;fj=2,hu=25,pj=3;ja=10,mj=8,hj=3,gj=2,Ch=5,bj=4,wj=.2,yj=.35,$j=.15,vj=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),xj=.2,Ej=.35,Sj=.2,jj=.35,kj=e=>/\.cs$/i.test(e),Rj=e=>/^I[A-Z]/.test(String(e||"")),_j=.2,Tj=.35,Aj=50,Cj=.2,Ij=.35,Oj=.5,Nj=Ch,Lj=3,Pj=4,Mj=1,Fj=.9,Dj=.5,zj=.2,Uj=.35,yh=4,Bj=2,Wj=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],Ih=3,Oh=12,Nh=.9,Gj=["imports","calls","callsSymbol","inherits"],Vj=.5,Hj=.6,qj=.2,Kj=.35;vh=128,xh=4,Jj=64,Eh=250,Ea=class extends Error{};Sh=new WeakMap;jh=40,kh=40,si=30;qe=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";Zj=25,ek=15;Wh=40,tk="tests edges are recorded module to module, so this is module-grain coverage.";tn=15;qh=new Set(["Function","Method"]);nk=8;sg={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};ok=8,rk=16,ik=4,ak=6,ck=12,lk=2,uk=8,dk=3,gu=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),Rh=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),_a=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},fk=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};bu=20;wu=40});function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gg(e){let t=String(e||"");return ug&&(t=t.replace(ug," ")),t.replace(/\s+/g," ").trim()}function bg(e){let t=String(e||"");t=t.replace(Lk," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(Ak);if(o&&(t=o[1].trim()),o=t.match(Ck),o&&(t=o[1].trim()),o=t.match(dg),o&&(t=o[1].trim()),o=t.match(fg),o&&(t=o[1].trim()),o=t.match(pg),o&&(t=o[1].trim()),o=t.match(Nk),o&&(t=o[1].trim()),o=t.match(mg),o&&(t=o[1].trim()),o=t.match(Pk),o&&(t=o[1].trim()),o=t.match(Mk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Fk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Dk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(zk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Uk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Bk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Wk),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(Gk),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(Vk),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(Hk),o){let r=o[1].trim();Tk(r)||(t=!qk.test(r)&&(kk.test(r)||Vs.test(r))?r:`describe ${r}`)}if(o=t.match(Kk),o){let r=o[1].trim();(Vs.test(r)||Yk.test(r)||mg.test(r)||dg.test(r)||pg.test(r)||fg.test(r)||Xk.test(r))&&(t=r)}if(t===s)break}return t}function aR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(rR);if(o&&(t=o[1].trim()),o=t.match(iR),o&&(t=o[1].trim()),t===s)break}return t}function lR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(cR);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function fR(e){let t=String(e||""),n=t.match(dR);if(n){let o=yg[n[1].toLowerCase()],r=wg[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match($g);return s?`which modules transitively import ${s[1].trim()}`:t}function Ca(e){return String(e||"").replace(wk,t=>su[t.toLowerCase()])}function $o(e){let t=Ca(e);return t=t.replace(yk,n=>ou[n.toLowerCase()]),t=t.replace($k,n=>ru[n.toLowerCase()]),t=t.replace(vk,"with"),t=t.replace(xk,(n,s)=>`${s} for`),t=t.replace(Ek,(n,s)=>`for ${s}`),t=t.replace(Sk,(n,s)=>s),t=t.replace(pR,"$1$2"),t=t.replace(Dm,"$1ing"),t=bg(t),t=lR(t),t=aR(t),t=fR(t),t=gg(t),t=fn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function ri(e){for(let t of[...Um,...zm]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function ku(e){for(let t of mR){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function vg(e){let t=String(e||"").match(hR);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var bk,wk,hg,yk,$k,vk,xk,Ek,Sk,jk,ug,kk,Vs,Rk,_k,Tk,oi,Ak,Ck,Ik,Ok,dg,fg,pg,Nk,Lk,Pk,Mk,Fk,Dk,zk,Uk,Bk,Wk,Gk,Vk,Hk,qk,Kk,Yk,Xk,mg,Aa,Jk,Qk,Zk,eR,tR,nR,sR,XF,ju,oR,JF,QF,ZF,rR,iR,cR,wg,yg,uR,dR,$g,pR,mR,hR,lt,nn,he,$n=M(()=>{Bn();bk=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(tt).join("|")+")\\b","gi"),wk=bk(su),hg=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(tt).join("|")+")\\b(?!\\.[a-z0-9])","gi"),yk=hg(ou),$k=hg(ru),vk=/(?<=^|\s)w\/(?=\s|$)/gi,xk=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Ek=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,Sk=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,jk=Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|"),ug=Xr.length?new RegExp("\\b("+[...Xr].sort((e,t)=>t.length-e.length).map(tt).join("|")+")\\b\\s*,?","gi"):null;kk=new RegExp("\\b(?:"+Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|")+")\\b","i"),Vs=/^(?:which|what|who|whose|where|when|why|how)\b/i,Rk=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),_k=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,Tk=e=>{if(_k.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return Rk.has((t[t.length-1]||"").toLowerCase())},oi="[,.;:!]|\u2014|\u2013|-",Ak=/^(?: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,Ck=/^(?: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,Ik="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",Ok="(?:just\\s+)?(?:one|another)\\s+more",dg=new RegExp(`^(?:(?:${Ik})[\\s,]+|(?:${Ok})\\s*(?:${oi})\\s*)+(.+)$`,"i"),fg=/^(?: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,pg=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,Nk=/^(?:please[\s,]+)+(.+)$/i,Lk=/,?\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,Pk=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,Mk=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,Fk=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,Dk=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,zk=/^do\s+you\s+know\s+(.+?)\??$/i,Uk=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,Bk=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,Wk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,Gk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,Vk=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,Hk=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,qk=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,Kk=/^(?:and|also|so|then|now|but)\s+(.+)$/i,Yk=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,Xk=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,mg=/^(?:(?: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;Aa=e=>[...e].sort((t,n)=>n.length-t.length).map(tt).join("|"),Jk=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),Qk=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),Zk=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),eR=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"]),tR=`(?:${Aa(Jk)})(?:\\s+(?:${Aa(Qk)}))?\\s*(?:${oi})\\s*`,nR=`(?:${Aa(Zk)})\\s*(?:(?:${oi})\\s*|\\s+)`,sR=`(?:${Aa(eR)})\\s*(?:${oi})\\s*`,XF=new RegExp(`^(?:sorry\\s*(?:${oi})?\\s*)?(?:${tR}|${nR}|${sR})+`,"i"),ju="what|who|which|where|when|why|how",oR="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",JF=new RegExp(`\\b(?:an?|the)?\\s*(?:${ju})\\s*\\?\\s*$`,"i"),QF=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${ju})\\b`,"i"),ZF=new RegExp(`\\b(?:${ju})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${oR})\\b`,"i"),rR=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,iR=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;cR=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;wg=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),yg=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),uR="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",dR=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(yg).join("|")+")\\s+("+Object.keys(wg).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+uR+")\\??$","i"),$g=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;pR=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${tu.map(tt).join("|")})(\\s*[?.!]*)$`,"i");mR=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+(?:${nu.map(tt).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+(${jk})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);hR=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");lt=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),he=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var Eg,xg=M(()=>{Eg={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 xs(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)&&!lt.has(e)&&!Ru.has(e)}function kg(e){return yR(e)?null:Ia(e,jg,Es(e))}function Ia(e,t,n=Es(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=xs(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 bR,Es,Ru,Sg,jg,wR,yR,ir=M(()=>{Bn();xg();$n();bR=["used"];Es=e=>e.length<=5?1:2,Ru=new Set([...Object.keys(pe),...Object.keys(Qe),...Object.keys(pn),...bR].flatMap(e=>e.split(" "))),Sg=4,jg=[...new Set([...Object.keys(pe),...Object.keys(pn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=Sg))],wR=new Set(Eg.words),yR=e=>wR.has(e)});function ar(e){for(let t of ER){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Oa,$R,vR,xR,Tu,ER,Rg,Na=M(()=>{Bn();$n();Oa=Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|"),$R=Object.keys(Qe).sort((e,t)=>t.length-e.length).map(tt).join("|"),vR=Object.keys(pn).sort((e,t)=>t.length-e.length).map(tt).join("|"),xR=mo.slice().sort((e,t)=>t.length-e.length).map(tt).join("|"),Tu=(e,t)=>e==="defines"&&Yr.has(t),ER=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Oa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=pe[t];if(Tu(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+(${$R})\\s+(?:(${vR})\\s+)?(${Oa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=pe[t];return Tu(n,t)?null:{shape:"reverse",entityType:Qe[e[1].toLowerCase()],modifier:e[2]?pn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Oa})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=pe[t];return Tu(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+(?:${xR})\\??$`,"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=fn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Qe[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&Mm.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:zs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Cn.map(tt).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+(?:${dn.map(tt).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+)?(${Oa})\\??$`,"i"),build:e=>pe[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()})}];Rg={id:"grammar",class:"graph-query",run(e){let t=ar(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function _g(e){let t=e.trim().split(/\s+/);return t.length>1&&pa.has(t[0].toLowerCase())}function RR(e){return pe[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 ai(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(E=>E.toLowerCase());if(s.includes("where")&&!Wt(s,pe)){let E=s.some(w=>Cn.includes(w)),S=new Set([...dn,...Cn]),A=n.filter((w,T)=>!lt.has(s[T])&&!S.has(s[T])).join(" ").trim();if(A){let w=E?"mentions":"where";return{shape:w,entityType:null,modifier:"direct",kind:w,object:A}}}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?pe[s[E-1]]:null)==="touches"){let A=n.slice(1,E-1).filter((w,T)=>!lt.has(s[1+T])).join(" ").trim();if(A)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:A}}}let r=s,i=Wt(s,pe);if(!i&&t){let E=s.map(S=>{if(!_u(S))return S;let A=t.lemma(S);return Ru.has(A)?A:S});i=Wt(E,pe),i&&(r=E)}let a=null;if(!i){let E=s.map(S=>S.length>=4&&_u(S)&&kg(S)||S);if(i=Wt(E,pe),i){r=E;let S=s.slice(i.start,i.end).findIndex((w,T)=>w!==E[i.start+T]),A=i.start+Math.max(S,0);a={from:s[A],to:E[A]}}}let c=!1;if(!i)for(let E=0;E<s.length;E+=1){let S=Us[s[E]];if(!(S&&s[E]==="used"&&s[E+1]==="for")&&S&&s.slice(0,E).some(A=>ii.has(A))){i={kind:S,start:E,end:E+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&Us[s[i.start]]&&s.slice(0,i.start).some(E=>ii.has(E))&&(c=!0);let l=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 w=n.slice(E+2).filter((T,O)=>!lt.has(s[E+2+O])).join(" ").trim();if(w)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:w})}}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(pe)){if(S!==i.kind)continue;let A=E.split(" "),w=i.end;if(A.every((T,O)=>r[w+O]===T)){d({start:w,end:w+A.length});break}}let f=Wt(r,Qe,u);d(f);let p=Wt(r,pn,u);d(p);let m=(E,S)=>n.slice(E,S).filter((A,w)=>!u.has(E+w)&&!lt.has(s[E+w])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);c&&!s.includes("by")&&kR.has(g.toLowerCase())&&(g="");let b=i.kind,$=f?Qe[r.slice(f.start,f.end).join(" ")]:null,y=p?pn[r.slice(p.start,p.end).join(" ")]:"direct";if(b==="touches"&&s.includes("when")){let E=h||g;if(E)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:E})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let E=h||g;if(E)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:E})}let x=s.indexOf("by"),C=s.slice(0,i.start).findIndex(E=>ii.has(E)),v=C>=0,j=v&&C>x;if(x>=0&&!u.has(x)&&v){let E=(w,T)=>n.slice(w,T).filter((O,R)=>{let k=w+R,L=s[k];return!u.has(k)&&!lt.has(L)&&L!=="by"&&!ii.has(L)&&!SR.has(L)&&!jR.has(L)}).join(" ").trim(),[S,A]=j?[E(C+1,n.length),E(x+1,C)]:[E(0,x),E(x+1,n.length)];if(S&&A)return b==="defines"&&Yr.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:A,object:S});if(A)return l({shape:"forward",entityType:$,modifier:y,kind:b,object:A});if(S)return l({shape:"reverse",entityType:$,modifier:y,kind:b,object:S})}if(c&&x<0&&g&&s[i.start]==="called")return null;if(h&&g){let E=r.slice(i.start,i.end).join(" ");if(b==="defines"&&Yr.has(E)||b==="calls"&&(_g(g)||RR(h)))return null;let S=h,A=g;return Kr.includes(E)&&([S,A]=[A,S]),l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:S,object:A})}if(g){if(b==="calls"&&_g(g))return null;let E=f&&f.start>=i.end?null:$;return l({shape:"reverse",entityType:E,modifier:y,kind:b,object:g})}if(b==="inherits"&&!h&&f&&f.start===i.end){let E=r.slice(f.start,f.end).join(" ");if(E)return l({shape:"reverse",entityType:null,modifier:y,kind:b,object:E})}if(h&&!g&&v&&i.end-i.start===1&&Us[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 E=ii.has(s[0]);return l({shape:"reverse",entityType:$,modifier:y,kind:b,object:h,...E?{polar:!0}:{}})}return h?l({shape:"forward",entityType:$,modifier:"direct",kind:b,object:h}):null}var ii,SR,jR,kR,Tg,La=M(()=>{Bn();$n();ir();ii=new Set(["is","are","was","were","be","been","being","get","gets","got"]),SR=new Set(["which","what","who","whom","whose"]),jR=new Set(hs.map(e=>e.toLowerCase())),kR=new Set(["recently","lately","yet","already","ever","again"]);Tg={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=ai(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function TR(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)||Ag.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function AR(e,t=null){let n=nn(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!Ag.has(a)&&(_R.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=TR(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var Ag,_R,Cg,Ig=M(()=>{Bn();$n();Na();La();Ag=new Set([...lt,...he(po),...he(Object.keys(pe)),...he(Object.keys(Qe)),...he(Object.keys(pn)),...he(Object.keys(at)),...he(ho),...he(go),...he(Object.keys(zn)),...he(Object.keys(Un)),...he(Object.keys(Xo)),...he(hs),...he(Jr),...he(mo),...he(dn),...he(Cn),...he(ms),...he(Object.keys(Qo))]),_R=new Set([...he(Xr),...he(ma)]);Cg={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(ar(e))return null;let{text:n,dropped:s,maybeNoise:o}=AR(e,t.nlp||null);if(!s.length||!n)return null;let r=ar(n)||ai(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 Og=M(()=>{});var Pa,Ma=M(()=>{Pa=()=>{}});function Lg(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?cr(e.subject)===cr(t.subject)&&cr(e.object)===cr(t.object):cr(e.object)===cr(t.object)}function Au(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=>!Pg(l))&&(n=n.filter(l=>!Pg(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=>Lg(m.parsed,f.parsed)&&m.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),Ng(f.parsed)<Ng(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=>Lg(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function OR(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 Mg(e,{describe:t=OR,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 cr,CR,Ng,IR,Pg,Cu=M(()=>{cr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),CR=/^\s*(?:the|a|an)\s+/i,Ng=e=>[e?.subject,e?.object].filter(t=>CR.test(String(t||""))).length;IR=new Set(["fuzzy","lemma","spell"]),Pg=e=>IR.has(e.via)});function Fa(e){Iu=e}function Da(){return typeof Iu=="function"?Iu():null}var Iu,lr=M(()=>{Iu=null});function zg(e,t={},n=LR){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 NR,LR,Ug=M(()=>{$n();Na();La();Ig();Og();Ma();Cu();lr();NR=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],LR=[Rg,Tg,Cg,...NR]});function ur(e){return PR.test(String(e||"").trim())?"an":"a"}function za(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 dr(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function ci(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 PR,Ua=M(()=>{PR=/^[aeiou]/i});var li,Ou=M(()=>{li=(e,t,n)=>n});var Tb={};Ot(Tb,{DYNAMIC_TAIL_OK_RE:()=>cd,applyNegationFrames:()=>ri,ask:()=>Ys,classDisplayName:()=>Ss,degreeMetric:()=>$b,metaFallbackEntityAnswer:()=>pb,normalizeQuery:()=>$o,parseQuery:()=>So,parseQueryFull:()=>Ku,render:()=>On,rephraseHint:()=>nd,resolveObject:()=>Nn,traverse:()=>sn,worldRelationGraphPayload:()=>AT});function st(e,t){let n=Bg.get(e);n||(n=new Map,Bg.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(vs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Fe(e,t){let[n,s]=Du[e]||["result","results"];return t===1?n:s}function hi(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 Ss(e){let t=String(e||"");if(typeof Wn=="function"){let n=Wn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function vo(e){return FR[e]||e}function WR(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||BR.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return he(mo).includes(o)?t:e}function HR(e,t){if(!e||e.shape!=="where"||e.altObject||!GR.test(t))return e;let n=fa(t),s=fa(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)||lt.has(i)||pe[i]||i.endsWith("ing"))return o;let a=nn(n).map(l=>l.toLowerCase());for(;a.length&&VR.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 Ku(e,{nlp:t}).parsed}function Ku(e,{nlp:t=void 0}={}){let n=t===void 0?Da():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=ku(ri($o(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=KR(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Au(zg(o,{nlp:n,raw:s}));return i?{parsed:HR(WR(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Uu(e,t){return t.length&&ob.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function mr(e,t){return ar(e)||ai(e,t)}function KR(e,t){let n=nn(e),s=n.map(o=>o.toLowerCase());return m_(n,s)||g_(n,s)||QR(n,s,t)||ib(e,t,0)||b_(n,s,t)||e_(n,s,t)||a_(n,s,t,0)||l_(n,s)||f_(n,s,t)||w_(n,s,t)||v_(n,s,t)||E_(n,s,t,0)||$_(n,s,t,0)||Ju(n,s,t,0)||n_(n,s,t)||XR(n,s)||db(n,s,t,0)}function XR(e,t){let n=0;YR.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?Fm[`${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 Wa(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function QR(e,t,n){if(!["do","does","did"].includes(t[0])||!JR.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,pe);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)&&!lt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=hr(`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:Wa(o,{op:"difference",kind:"set",ast:d})}}function ib(e,t,n=0){let s=vg(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=>at[d]))return Wa(r,{op:"difference",kind:"qual",filters:a});let c=Wt(a,pe);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)&&!lt.has(a[f])&&a[f]!=="from").length)return Wa(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=hr(`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"}:Wa(r,{op:"difference",kind:"set",ast:u})}function e_(e,t,n){let s=0;for(;s<t.length&&ZR.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,pe);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!lt.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function Xu(e,t){let n=new Set;for(let s of t)for(let o of st(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function ab(e,t){let n=Gt(t),s=n.filter(r=>!nb.has(r)),o=Xu(e,s.length?s:n);return o.size===1?[...o][0]:null}function hr(e,t,n){if(n>sb)return{node:"miss",reason:"too deep to resolve"};let s=ib(e,t,n);if(s)return s;let o=nn(e),r=o.map(l=>l.toLowerCase()),i=Ju(o,r,t,n);if(i)return i;let a=db(o,r,t,n);if(a)return a;let c=mr(e,t);return c?{node:"clause",clause:c}:null}function Ju(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=ms.includes(t[o]),i=!r&&rb(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=>at[f.toLowerCase()]))continue;let l=mr([...c,zu].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=hr(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 n_(e,t,n){for(let s=0;s<t.length;s+=1){if(!t_.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!pe[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),zu,...e.slice(s+1)],a=mr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===zu&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function a_(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!s_.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(o_.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&&r_.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&i_.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>ms.includes(d)))return null;let c=Yu.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=hr(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 l_(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!c_.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 d_(e){let t=new Set,n=[];for(let s of e){if(!s||!u_.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function f_(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=p_(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=d_(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function p_(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&qR.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>at[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=mr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function m_(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 h_(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=zs(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 g_(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(at[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&&Us[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&&!Bm.has(u))return null}let r=h_(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 b_(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=mr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function w_(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&&at[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=>!lt.has(d)&&!cb.has(d)),u;if(l){let d=hr(`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 $_(e,t,n,s){let o=0,r=!1,i=null;for(let $ of lb){let y=$.split(" ");if(t.slice(0,y.length).join(" ")===$){i=$,o=y.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&Qu.has(t[o]);)o+=1;let a=[];for(;o<t.length&&at[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])&&!pe[t[o]]&&!hs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ub}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some($=>!lt.has($)&&!cb.has($)),p=t.slice(o),m=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),m=m.slice(1));let h=r&&y_.has(p[0]);if(r&&(f&&!h||d.length===0))return null;let g,b=!1;if(f){let $=h?m:d,y=hr(`which ${[...a,u,...$].join(" ")}`,n,(s||0)+1);if(!y||y.node==="miss")return{node:"miss",reason:y&&y.reason||"the list filter didn't parse"};g=y,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 v_(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(zn[h]){s=zn[h],o=m;break}if(zn[t[m]]){s=zn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(Un[t[m]]){r=Un[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(Un[t[m]]){r=Un[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=Un.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?Wm[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 E_(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Qu.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&&x_.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=>ms.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!pe[t[o]]&&!hs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ub}`}:null}function S_(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Qu.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(ms.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 j_(e,t,n,s,o,r){let{branches:i,ops:a}=Ga(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],f=d.map($=>$.toLowerCase()),p=u===0?"intersection":a[u-1],m=Uu(d,f);if(m.blc.length&&m.blc.every($=>at[$])){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,pe);g?c=d.slice(g.start,g.end):c&&(h=[...c,...d]);let b=fb(`${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 db(e,t,n,s){let o=S_(e,t);if(o){let{entityType:A,term:w,relIdx:T}=o,O=t.slice(T+1),R=e.slice(T+1);if(!O.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let k=j_(A,`which ${t[T-1]}`,O,R,n,s+1);if(k.miss)return{node:"miss",reason:k.miss};let L=[{op:"seed",kind:"set",ast:{node:"find",entityType:A,term:w}},...k.atoms];return L.length===1?L[0].ast:{node:"boolean",entityType:A,atoms:L}}let r=0;for(;r<t.length&&Yu.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&at[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?Vt(t[r]):null;if(!c){let A=r+1<t.length?Vt(t[r+1]):null;if(Wg.has(t[r])&&A&&A.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(ob.has(t[r])){let w=r+1;w<t.length&&(t[w]==="the"||t[w]==="a"||t[w]==="an")&&(w+=1);let T=w+1<t.length?Vt(t[w+1]):null;if(Wg.has(t[w])&&T&&T.entityType==="Commit"&&w+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&A&&/^[a-z]+$/.test(t[r])&&!pe[t[r]]&&!lt.has(t[r])&&!id.has(t[r])?{node:"find",entityType:A.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&&ms.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&&rb(d[0]),g=f.length>0&&Ga(d,f).branches.some(A=>{let{blc:w}=Uu(A,A.map(T=>T.toLowerCase()));return w.length&&w.every(T=>at[T])}),b=f.length>0?Ga(d,f).branches:[],$=!1;if(b.length>1){let A=b[0].map(T=>T.toLowerCase()),w=Wt(A,pe);w&&w.start===0&&($=b.slice(1).every(T=>{let O=T.map(k=>k.toLowerCase()),R=Wt(O,pe);return R&&R.start===0?R.kind===w.kind:!R}))}let y=!1;if(b.length>1){let A=b[0].map(T=>T.toLowerCase()),w=Wt(A,pe);w&&w.start===0&&(y=b.slice(1).every(T=>{let O=T.map(k=>k.toLowerCase()),R=Wt(O,pe);return!!R&&R.start===0&&R.end-R.start===1}))}if(!(a.length||p||m||h||g||$||y))return null;if(!f.length){let A={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:A,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let x=c.placeholder?"what":`which ${u}`,{branches:C,ops:v}=Ga(d,f),j=null,E=[];for(let A=0;A<C.length;A+=1){let w=C[A],T=w.map(V=>V.toLowerCase()),O=A===0?"seed":v[A-1],R=Uu(w,T);if(R.blc.length&&R.blc.every(V=>at[V])){E.push({op:O,kind:"qual",filters:R.blc});continue}if(T[0]==="of"||T[0]==="in"){E.push({op:O,kind:"set",ast:{node:"membership",entityType:l,term:w.slice(1).join(" ")}});continue}let k=w,L=Wt(T,pe);L?j=w.slice(L.start,L.end):j&&(k=[...j,...w]);let B=fb(`${x} ${k.join(" ")}`,n,s+1);if(!B||B.node==="miss")return{node:"miss",reason:B&&B.reason||"a clause in the combination didn't parse"};E.push({op:O,kind:"set",ast:B})}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:l,atoms:E},a.length&&(S={node:"qualifier",filters:a,inner:S,entityType:l}),S}function fb(e,t,n){if(n>sb)return{node:"miss",reason:"too deep to resolve"};let s=nn(e),o=s.map(a=>a.toLowerCase()),r=Ju(s,o,t,n);if(r)return r;let i=mr(e,t);return i?{node:"clause",clause:i}:null}function Ga(e,t){let n=Object.keys(Xo).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(Xo[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 Zu(e,t,n,s){let o=fr[t];if(o&&Ks.has(n)){let u=st(e,o).filter(d=>s.has(d.object));return ks(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Ks.has(e.byId.get(u)?.class))?[...Gt(t),o]:Gt(t)).flatMap(u=>st(e,u)).filter(u=>s.has(u.object)),c=ks(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")?sd(e,new Set(c.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function R_(e,t){let n=new Set(Zu(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=k_.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function fi(e,t,n){let s=Gt(t).flatMap(o=>st(e,o)).filter(o=>n.has(o.subject));return ks(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ks(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 __(e,t){let n=ys(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&ys(o.label).startsWith(s))}function Bu(e){let t=Gg.get(e);if(t)return t;let n=new Set;for(let i of st(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 st(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of st(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Gg.set(e,t),t}function pr(e,t){return t?t.class==="Module"?t.id:Bu(e).moduleOfSymbol.get(t.id)||null:null}function pb(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>T_.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=pr(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?`, ${li("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 Wu(e,t,n){let s=ks(Jo.flatMap(o=>fi(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function ed(e,t,n=null){let s=js(e,t,n);if(!(s.match&&s.tier===1)){let o=__(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 mb(e,t,n,s,o){let r=o||(()=>!0),i=Wu(e,t,s).filter(r);if(i.length||!gb(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of hb(e,t)){let c=e.byId.get(a);if(!c)continue;let l=Wu(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=Bu(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=pr(e,t),o=Bu(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 td(e){return st(e,"inherits")}function Gu(e,t){return td(e).filter(n=>n.object===t).map(n=>n.subject)}function Vg(e,t){return td(e).filter(n=>n.subject===t).map(n=>n.object)}function A_(e,t){let n=new Set,s=[...Gu(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Gu(e,o))n.has(r)||s.push(r)}}return n}function hb(e,t){let n=new Set,s=[...Vg(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Vg(e,o))n.has(r)||s.push(r)}}return n}function gb(e,t){let n=Hg.get(e);if(n||(n=new Map,Hg.set(e,n)),n.has(t))return n.get(t);let s=td(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 qg(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 Yg(e){return e.slice().sort((t,n)=>Kg[n.via]-Kg[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Xg(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Es(n);if(xs(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of Eo(e.label))if(xs(o,n,s)<=s)return!0;return!1}function bb(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=gb(e,t),i=[];for(let c of s){let l=qg(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...A_(e,c.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!qg(f,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:Yg(i),broad:[]};let a=new Map;for(let c of s)for(let l of hb(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&Xg(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Gu(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Xg(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Yg([...a.values()])}}function C_(e){return[...ka(Ra(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function vn(e,t,n){switch(t.node){case"clause":return sn(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?C_(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=bb(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Gt(t.kind).flatMap(o=>st(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=js(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=ab(e,t.kind);if(!o)return[];let r=new Set(fi(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(vn(e,t.inner,n).map(o=>o.id));return Zu(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(vn(e,t.inner,n).map(o=>o.id));return fi(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=ed(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 ks(Jo.flatMap(c=>fi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=mb(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?vb(e,t,n).matches:vn(e,t.inner,n).filter(o=>t.filters.every(r=>xo(e,o,at[r])));case"boolean":return wb(e,t,n);case"anaphora":return yb(e,t,n).matches;default:return[]}}function wb(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=vn(e,o.ast,n);continue}if(o.kind==="qual"){let i=c=>o.filters.every(l=>xo(e,c,at[l])),a=c=>o.filters.every(l=>{let u=I_(at[l]);return u?xo(e,c,u):!xo(e,c,at[l])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(vn(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 vn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function O_(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=Nn(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 yb(e,t,n){let o=O_(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,at[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=Nn(e,i.clause.object);if(!d.match)r=[];else{let f=fr[i.clause.kind],p=[...Gt(i.clause.kind),...f?[f]:[]],m=new Set(p.flatMap(h=>st(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=hi(l,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:l,referents:u}}function $b(e,t,n){let s=n.kind==="*"?N_:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of st(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 L_(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 M_(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(P_.test(s))r=s;else{let{match:u,ambiguous:d}=Nn(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 F_(e,t,n){let s=vn(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=Zu(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 D_(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(st(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:$b(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?hi(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 vb(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,at[h])):null,a=m=>hi(r,m,"membership"),c=ed(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=ks(Jo.flatMap(g=>fi(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}=mb(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 z_(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=Nn(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=Nn(e,s,{expectedClass:n}),c=!r||a.match&&pr(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?sd(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 U_(e,t,n){let s=pr(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Wu(e,n.id).some(o=>o.id===t.id)}function B_(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=js(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=ed(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!U_(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,at[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 W_(e,t,n){let s=Nn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=vn(e,{node:"allOfClass",entityType:t.entityType},n),r=wb(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 G_(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(vn(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 V_(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return z_(e,t);if(t.node==="qualCheck")return B_(e,t,n);if(t.node==="universal")return W_(e,t,n);if(t.node==="count"){let i=G_(e,t.base,n);return i?{compositeKind:"count",count:R_(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:vn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:vn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return RT(e,t);if(t.node==="superlative")return D_(e,t);if(t.node==="temporal")return F_(e,t,n);if(t.node==="recentCommits")return L_(e);if(t.node==="commitFilter")return M_(e,t);if(t.node==="anaphora")return yb(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return vb(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=bb(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=vn(e,t,n),o=t.entityType||null,r=hi(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function xb(){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 H_(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=mi(e);return n?`${t} in ${n}`:t}function Vu(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(Vu):Array.isArray(e.filters)&&e.filters.some(t=>at[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(Vu)}function q_(e,t){return!["Function","Method"].includes(t)||!Vu(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 K_(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})`:""}. ${xb()}.`,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=mi(i),c=i.class==="Module"?"":a?`, ${li("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 ${Hs(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=zR(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}: ${Hs(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>nt?` \u2014 narrow with "${Fe(t.entityType,2)} in <module>"`:"";return{content:`${Hs(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=In(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)})`:""}. ${qs(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}: ${Hs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${Hs(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?H_(t.matches[0]):Hs(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:`${Hs(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. ${qs(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. ${qs(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=q_(e,t.entityType)||qs(n);return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${Hs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function nd(){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). `+xb()}function qs(e=null){return e&&ni(e)===0?yu:`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 Ha(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 Eb(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function Y_(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function ui(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($=>$.class==="Commit"&&(String($.id).toLowerCase().startsWith(`commit:${g}`)||String($.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 $=ui(e,b,{expectedClass:n});$.match&&!$.ambiguous&&g.add($.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 $=String(b.label||"").toLowerCase();b.class==="Module"?$.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs($.length-o.length)}):$.includes(o)?d.push({ind:b,score:2e3-Math.abs($.length-o.length)}):$.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs($.length-o.length)})}}else{let g=[...Eo(s)],b=o.split(/\s+/).find(v=>v.includes("/")),$=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,x=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,C=x?Y_(s):null;for(let v of r){let j=String(v.label||"").toLowerCase(),E=j.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(E===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(E.startsWith(o)||E.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(E.length-o.length)});continue}if(x){let w=Eb(v.label);if(w&&w===C){d.push({ind:v,score:5e3});continue}let T=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if(w&&T&&C.length>=4&&w.includes(C)){d.push({ind:v,score:2e3-Math.abs(w.length-C.length)});continue}}if(v.class==="Module"){let w=Ha(o);if(w!==o&&w===Ha(E)){let T=Es(o);if(xs(E,o,T)>T){d.push({ind:v,score:3e3-Math.abs(E.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 S=Eo(v.label),A=g.filter(w=>S.has(w)).length;A>0&&(!$||S.has($))&&d.push({ind:v,score:A/g.length*Lu})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,$=b.filter(x=>x.score===g.score),y=g.score>=Lu?b.filter(x=>x.score>=Lu):b;return{match:g.ind,candidates:y.slice(0,4).map(x=>x.ind),tier:3,ambiguous:$.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,$=e.byId.get(g.id);if($){let y=b.filter(x=>x.score===g.score);if(m={match:$,candidates:b.slice(0,4).map(x=>e.byId.get(x.id)).filter(Boolean),tier:4,ambiguous:y.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=Es(o),b=g+1,$=[];for(let y of r){let x=xs(String(y.label||"").toLowerCase(),o,g);if(x>0)for(let C of Eo(y.label)){if(x<=0)break;x=Math.min(x,xs(C,o,g))}x<b?(b=x,$=[y]):x===b&&x<=g&&$.push(y)}if(b<=g&&$.length===1)return{match:$[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&$.length>1&&!m){let[y,...x]=$;return{match:y,candidates:x.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Pu(e,t){let n=Eb(t),s=[...Eo(t)],o=[];for(let r of Eo(e))n.includes(r)||s.some(i=>Ha(i)===Ha(r))||Va.has(r)||kb.has(r)||o.push(r);return o}function Ba(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(Pu(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Pu(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:In(s.slice(0,4).map(r=>r.label))}:e}let n=Pu(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function Nn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(X_,"").trim(),i=r.match(J_);if(i){let a=r.slice(0,i.index).trim(),c=Qe[i[1].toLowerCase()];if(a&&c){let l=Ba(ui(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ba(ui(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ba(ui(e,t,n),t)}return Ba(ui(e,t,n),t)}function js(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 Nn(e,t)}function sd(e,t,n){let s=[];for(let o of st(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 Q_(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Ks.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>st(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&Ks.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 nT(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&od.has(Jg(s.label))).map(s=>({ind:s,named:n.has(Jg(s.label))?1:0,depth:String(s.label).split("/").length,fixture:tT(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 sT(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function rd(e){return(e?.attributes||[]).find(t=>oT.has(t.prop))?.value||null}function rT(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${ur(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 V_(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let R=t.candidates.map(k=>{let L=sn(e,k,{contextId:n,prev:s});return{parsed:k,result:L,rendered:On(k,L,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:R}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let R=String(t.object||"").trim(),k=R.toLowerCase(),L=(e.individuals||[]).find(B=>{if(!rd(B))return!1;if(String(B.label).toLowerCase()===k)return!0;let V=(B.attributes||[]).find(K=>K.key==="token")?.value;return V&&String(V).toLowerCase()===k});if(!L){let B=pb(e,R);return B?{matches:[B.hit],objMatch:B.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:B.text,traversal:`schema lookup for "${R}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${R}"`,ambiguous:!1}}return{matches:[L],objMatch:L,candidates:[],traversal:`schema lookup for "${R}"`,ambiguous:!1}}if(r==="mentions"){let R=String(t.object||"").trim();return{matches:(typeof bo=="function"?bo(e.proseIndex,R):[]).map(B=>e.byId.get(B.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${R}"`}}if(r==="where"&&Z_.test(String(t.object||"").trim())){let R=nT(e,t.object);return{matches:R,objMatch:R[0]||null,candidates:R.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...od].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!sT(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 R=js(e,t.subject,n),k=js(e,t.object,n);if(!R.match||!k.match||R.ambiguous||k.ambiguous)return{matches:[],objMatch:k.match,candidates:k.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(R.unresolvedPronoun||k.unresolvedPronoun)};let[L,B]=[R.match,k.match];i==="touches"&&B.class==="Commit"&&L.class!=="Commit"&&([L,B]=[B,L]);let V=fr[i],K=[...new Set(V?[...Gt(i),V]:Gt(i))],Y=K.flatMap(_=>st(e,_)).filter(_=>_.subject===L.id&&_.object===B.id);return{matches:Y,answer:t.negated?Y.length===0:Y.length>0,objMatch:k.match,subjMatch:R.match,candidates:[],traversal:`${K.join("+")} edge from ${L.label} to ${B.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=js(e,t.object,n),t.altObject&&t.altObject!==t.object){let R=js(e,t.altObject,n),k=!!c.match&&!c.ambiguous,L=!!R.match&&!R.ambiguous;!k&&L?c=R:k&&L&&c.match.id!==R.match.id&&(c={...c,ambiguous:!0,candidates:[R.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let R=B=>B.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),k=R(String(t.object||"").trim().toLowerCase()),L=(e.individuals||[]).find(B=>{if(B.class!=="Module"||B.id===c.match.id)return!1;let V=String(B.label||"").toLowerCase().split("/").pop();return V!==R(V)&&R(V)===k});L&&(c={...c,ambiguous:!0,candidates:[L,...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 k=ks([l,...u||[]]).slice(0,nt).map(L=>{let B=sn(e,t,{contextId:n,prev:s,pinnedObjMatch:L});return{candidate:L,result:B,rendered:On(t,B,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:k}}if(r==="where"){let R=(l.attributes||[]).find(k=>k.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whereShape:!0,site:R,traversal:R?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let R=B=>String((B.attributes||[]).find(V=>V.key==="date")?.value||""),k;if(l.class==="Commit")k=[l];else{let B=["touches","touchesSymbol"].flatMap(K=>st(e,K)).filter(K=>K.object===l.id),V=new Set;k=[];for(let K of B){if(V.has(K.subject))continue;V.add(K.subject);let Y=e.byId.get(K.subject);Y&&Y.class==="Commit"&&k.push(Y)}k.sort((K,Y)=>R(Y).localeCompare(R(K)))}let L=k.length&&R(k[0])?[{kind:"event",class:"Commit",label:k[0].label,ids:[k[0].id],attrs:{date:R(k[0]).slice(0,10)},lane:"when"}]:[];return{matches:k,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:L,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let R=K=>String((K.attributes||[]).find(Y=>Y.key==="date")?.value||""),k=["touches","touchesSymbol"].flatMap(K=>st(e,K)).filter(K=>K.object===l.id),L=new Set,B=[];for(let K of k){if(L.has(K.subject))continue;L.add(K.subject);let Y=e.byId.get(K.subject);Y&&Y.class==="Commit"&&B.push(Y)}B.sort((K,Y)=>R(Y).localeCompare(R(K)));let V=B.length&&R(B[0])?[{kind:"event",class:"Commit",label:B[0].label,ids:[B[0].id],attrs:{date:R(B[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:B,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:V,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return Q_(e,l,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let R=fr[i],L=!!(R&&l.class&&Ks.has(l.class))?[...new Set([...Gt(i),R])]:Gt(i);if(a&&a!=="Change"){let P=Xu(e,L),W=Nu[a];if(P.size&&!P.has(a)&&!(W&&P.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...P],traversal:`${L.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${Ss(a)})`}}let V=L.flatMap(P=>st(e,P)).filter(P=>P.subject===l.id).map(P=>e.byId.get(P.object)).filter(Boolean),K=ks(V),Y=K,_="";if(a&&a!=="Change"){Y=K.filter(W=>W.class===a);let P=Nu[a];if(!Y.length&&P){let W=K.filter(F=>F.class===P);W.length&&(Y=W,_=`, widened to ${P} subjects (no ${a} recorded)`)}}return{matches:Y,objMatch:l,candidates:u,traversal:`${L.join("+")} edges where subject = ${l.label}${_}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:or(e,l,{maxDepth:Qg}).flat().map(L=>e.byId.get(L.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${Qg})`};let g=fr[i]||Gt(i).find(R=>nb.has(R))||null,b=!!(l.class&&Ks.has(l.class));if(g&&(Ks.has(a)||b)){let R=st(e,g).filter(_=>_.object===l.id),k=ks(R.map(_=>e.byId.get(_.subject)).filter(Boolean)),L=!a||a==="Change"?k:k.filter(_=>_.class===a),B="",V=Nu[a];if(!L.length&&V){let _=k.filter(P=>P.class===V);_.length&&(L=_,B=`, widened to ${V} subjects (no ${a} recorded)`)}let K=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!st(e,"contains").some(_=>_.subject===l.id),Y=K?e.byId.get(pr(e,l)||""):null;if(L.length||!(K&&Y))return{matches:L,objMatch:l,candidates:u,traversal:`${g} edges where object = ${l.label}${B}`,ambiguous:d,matchedVia:p}}let $=l,y=u,x=d,C=p,v="",j=ab(e,i);if(j&&$.class&&$.class!==j){let R=Nn(e,t.object,{expectedClass:j});if(R.match&&!R.ambiguous)$=R.match,y=R.candidates,x=R.ambiguous,C=R.matchedVia;else if(j==="Module"){let k=pr(e,$),L=k&&e.byId.get(k);if(L)v=`, refined from ${$.label} to its containing module`,$=L;else return{matches:[],objMatch:$,candidates:y,ambiguous:x,matchedVia:C,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ss($.class)} ${$.label} (grain mismatch: this "${i}" question needs a ${Ss(j)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:$,candidates:y,ambiguous:x,matchedVia:C,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ss($.class)} ${$.label} (grain mismatch: this "${i}" question needs a ${Ss(j)})`}}let E=Gt(i).flatMap(R=>st(e,R)).filter(R=>R.object===$.id);i==="cochange"&&(E=E.concat(Gt(i).flatMap(R=>st(e,R)).filter(R=>R.subject===$.id).map(R=>({...R,subject:R.object,object:R.subject}))));let S="";if(!E.length&&$.class){let R=`ext:${String($.label).toLowerCase()}`;E=Gt(i).flatMap(k=>st(e,k)).filter(k=>String(k.object).toLowerCase()===R),E.length&&(S=` (by name, via unresolved ${R} references)`)}let A=[],w=new Set;for(let R of E){let k=e.byId.get(R.subject);k&&!w.has(k.id)&&(w.add(k.id),A.push(k))}let T,O="";if(!a||a==="Change")T=A;else{let R=A.filter(k=>k.class===a);if(R.length)T=R;else if(a!=="Module"&&A.some(k=>k.class==="Module")){let k=new Set(A.filter(L=>L.class==="Module").map(L=>L.id));T=sd(e,k,a),O=`, then ${Ss(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:$,candidates:y,traversal:`${Gt(i).join("+")} edges where object = ${$.label}${S}${O}${v}`,ambiguous:x,matchedVia:C}}function mi(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 Mu(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function iT(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function In(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function di(e){let t=e.object??e.subject??"?";return`${e.entityType?Fe(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Hu(e){return qr[e]?.bare||e}function aT(e){let t=Hu(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function cT(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 ${Hu(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 ${Hu(o.kind)} ${JSON.stringify(String(r))}`}function Sb(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(di).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Sb(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?cT(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 On(e,t,n=null){let s=jb(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function jb(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${nd()}`,miss:!0,ambiguous:!1};if(e.node)return K_(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
54
+ \u2026+${o.length-wu} more`:"")}var yu,hh,_h,wh,dj,pj,hu,mj,ja,hj,gj,bj,Ch,wj,yj,$j,vj,xj,Ej,Sj,jj,kj,Rj,_j,Tj,Aj,Cj,Ij,Oj,Nj,Lj,Pj,Mj,Fj,Dj,zj,Uj,Bj,yh,Wj,Gj,Ih,Oh,Nh,Vj,Hj,qj,Kj,Yj,vh,xh,Qj,Eh,Ea,Sh,jh,kh,si,qe,ek,tk,Wh,nk,tn,qh,sk,sg,rk,ik,ak,ck,lk,uk,dk,fk,gu,Rh,_a,pk,bu,wu,Me=M(()=>{Ws();Vn();du();ei();bs();yu="This store holds no code index, so it records no modules or commits to look through.",hh={"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"};_h=e=>/^(git|turn):/.test(String(e||""));wh=30,dj=8;pj=2,hu=25,mj=3;ja=10,hj=8,gj=3,bj=2,Ch=5,wj=4,yj=.2,$j=.35,vj=.15,xj=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),Ej=.2,Sj=.35,jj=.2,kj=.35,Rj=e=>/\.cs$/i.test(e),_j=e=>/^I[A-Z]/.test(String(e||"")),Tj=.2,Aj=.35,Cj=50,Ij=.2,Oj=.35,Nj=.5,Lj=Ch,Pj=3,Mj=4,Fj=1,Dj=.9,zj=.5,Uj=.2,Bj=.35,yh=4,Wj=2,Gj=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],Ih=3,Oh=12,Nh=.9,Vj=["imports","calls","callsSymbol","inherits"],Hj=.5,qj=.6,Kj=.2,Yj=.35;vh=128,xh=4,Qj=64,Eh=250,Ea=class extends Error{};Sh=new WeakMap;jh=40,kh=40,si=30;qe=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";ek=25,tk=15;Wh=40,nk="tests edges are recorded module to module, so this is module-grain coverage.";tn=15;qh=new Set(["Function","Method"]);sk=8;sg={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};rk=8,ik=16,ak=4,ck=6,lk=12,uk=2,dk=8,fk=3,gu=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),Rh=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),_a=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},pk=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};bu=20;wu=40});function tt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gg(e){let t=String(e||"");return ug&&(t=t.replace(ug," ")),t.replace(/\s+/g," ").trim()}function bg(e){let t=String(e||"");t=t.replace(Pk," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(Ck);if(o&&(t=o[1].trim()),o=t.match(Ik),o&&(t=o[1].trim()),o=t.match(dg),o&&(t=o[1].trim()),o=t.match(fg),o&&(t=o[1].trim()),o=t.match(pg),o&&(t=o[1].trim()),o=t.match(Lk),o&&(t=o[1].trim()),o=t.match(mg),o&&(t=o[1].trim()),o=t.match(Mk),o&&(t=o[1].trim()),o=t.match(Fk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Dk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(zk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Uk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Bk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Wk),o&&Vs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Gk),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(Vk),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(Hk),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(qk),o){let r=o[1].trim();Ak(r)||(t=!Kk.test(r)&&(Rk.test(r)||Vs.test(r))?r:`describe ${r}`)}if(o=t.match(Yk),o){let r=o[1].trim();(Vs.test(r)||Xk.test(r)||mg.test(r)||dg.test(r)||pg.test(r)||fg.test(r)||Jk.test(r))&&(t=r)}if(t===s)break}return t}function cR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(iR);if(o&&(t=o[1].trim()),o=t.match(aR),o&&(t=o[1].trim()),t===s)break}return t}function uR(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(lR);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function pR(e){let t=String(e||""),n=t.match(fR);if(n){let o=yg[n[1].toLowerCase()],r=wg[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match($g);return s?`which modules transitively import ${s[1].trim()}`:t}function Ca(e){return String(e||"").replace(yk,t=>su[t.toLowerCase()])}function $o(e){let t=Ca(e);return t=t.replace($k,n=>ou[n.toLowerCase()]),t=t.replace(vk,n=>ru[n.toLowerCase()]),t=t.replace(xk,"with"),t=t.replace(Ek,(n,s)=>`${s} for`),t=t.replace(Sk,(n,s)=>`for ${s}`),t=t.replace(jk,(n,s)=>s),t=t.replace(mR,"$1$2"),t=t.replace(Dm,"$1ing"),t=bg(t),t=uR(t),t=cR(t),t=pR(t),t=gg(t),t=fn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function ri(e){for(let t of[...Um,...zm]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function ku(e){for(let t of hR){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function vg(e){let t=String(e||"").match(gR);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var wk,yk,hg,$k,vk,xk,Ek,Sk,jk,kk,ug,Rk,Vs,_k,Tk,Ak,oi,Ck,Ik,Ok,Nk,dg,fg,pg,Lk,Pk,Mk,Fk,Dk,zk,Uk,Bk,Wk,Gk,Vk,Hk,qk,Kk,Yk,Xk,Jk,mg,Aa,Qk,Zk,eR,tR,nR,sR,oR,XF,ju,rR,JF,QF,ZF,iR,aR,lR,wg,yg,dR,fR,$g,mR,hR,gR,lt,nn,he,$n=M(()=>{Bn();wk=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(tt).join("|")+")\\b","gi"),yk=wk(su),hg=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(tt).join("|")+")\\b(?!\\.[a-z0-9])","gi"),$k=hg(ou),vk=hg(ru),xk=/(?<=^|\s)w\/(?=\s|$)/gi,Ek=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Sk=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,jk=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,kk=Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|"),ug=Xr.length?new RegExp("\\b("+[...Xr].sort((e,t)=>t.length-e.length).map(tt).join("|")+")\\b\\s*,?","gi"):null;Rk=new RegExp("\\b(?:"+Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|")+")\\b","i"),Vs=/^(?:which|what|who|whose|where|when|why|how)\b/i,_k=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),Tk=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,Ak=e=>{if(Tk.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return _k.has((t[t.length-1]||"").toLowerCase())},oi="[,.;:!]|\u2014|\u2013|-",Ck=/^(?: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,Ik=/^(?: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,Ok="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",Nk="(?:just\\s+)?(?:one|another)\\s+more",dg=new RegExp(`^(?:(?:${Ok})[\\s,]+|(?:${Nk})\\s*(?:${oi})\\s*)+(.+)$`,"i"),fg=/^(?: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,pg=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,Lk=/^(?:please[\s,]+)+(.+)$/i,Pk=/,?\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,Mk=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,Fk=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,Dk=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,zk=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,Uk=/^do\s+you\s+know\s+(.+?)\??$/i,Bk=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,Wk=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,Gk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,Vk=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,Hk=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,qk=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,Kk=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,Yk=/^(?:and|also|so|then|now|but)\s+(.+)$/i,Xk=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,Jk=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,mg=/^(?:(?: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;Aa=e=>[...e].sort((t,n)=>n.length-t.length).map(tt).join("|"),Qk=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),Zk=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),eR=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),tR=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"]),nR=`(?:${Aa(Qk)})(?:\\s+(?:${Aa(Zk)}))?\\s*(?:${oi})\\s*`,sR=`(?:${Aa(eR)})\\s*(?:(?:${oi})\\s*|\\s+)`,oR=`(?:${Aa(tR)})\\s*(?:${oi})\\s*`,XF=new RegExp(`^(?:sorry\\s*(?:${oi})?\\s*)?(?:${nR}|${sR}|${oR})+`,"i"),ju="what|who|which|where|when|why|how",rR="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",JF=new RegExp(`\\b(?:an?|the)?\\s*(?:${ju})\\s*\\?\\s*$`,"i"),QF=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${ju})\\b`,"i"),ZF=new RegExp(`\\b(?:${ju})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${rR})\\b`,"i"),iR=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,aR=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;lR=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;wg=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),yg=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),dR="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",fR=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(yg).join("|")+")\\s+("+Object.keys(wg).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+dR+")\\??$","i"),$g=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;mR=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${tu.map(tt).join("|")})(\\s*[?.!]*)$`,"i");hR=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+(?:${nu.map(tt).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+(${kk})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);gR=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");lt=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),he=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var Eg,xg=M(()=>{Eg={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 xs(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)&&!lt.has(e)&&!Ru.has(e)}function kg(e){return $R(e)?null:Ia(e,jg,Es(e))}function Ia(e,t,n=Es(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=xs(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 wR,Es,Ru,Sg,jg,yR,$R,ir=M(()=>{Bn();xg();$n();wR=["used"];Es=e=>e.length<=5?1:2,Ru=new Set([...Object.keys(pe),...Object.keys(Qe),...Object.keys(pn),...wR].flatMap(e=>e.split(" "))),Sg=4,jg=[...new Set([...Object.keys(pe),...Object.keys(pn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=Sg))],yR=new Set(Eg.words),$R=e=>yR.has(e)});function ar(e){for(let t of SR){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Oa,vR,xR,ER,Tu,SR,Rg,Na=M(()=>{Bn();$n();Oa=Object.keys(pe).sort((e,t)=>t.length-e.length).map(tt).join("|"),vR=Object.keys(Qe).sort((e,t)=>t.length-e.length).map(tt).join("|"),xR=Object.keys(pn).sort((e,t)=>t.length-e.length).map(tt).join("|"),ER=mo.slice().sort((e,t)=>t.length-e.length).map(tt).join("|"),Tu=(e,t)=>e==="defines"&&Yr.has(t),SR=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Oa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=pe[t];if(Tu(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+(${vR})\\s+(?:(${xR})\\s+)?(${Oa})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=pe[t];return Tu(n,t)?null:{shape:"reverse",entityType:Qe[e[1].toLowerCase()],modifier:e[2]?pn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Oa})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=pe[t];return Tu(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+(?:${ER})\\??$`,"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=fn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Qe[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&Mm.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:zs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Cn.map(tt).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+(?:${dn.map(tt).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+)?(${Oa})\\??$`,"i"),build:e=>pe[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()})}];Rg={id:"grammar",class:"graph-query",run(e){let t=ar(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function _g(e){let t=e.trim().split(/\s+/);return t.length>1&&pa.has(t[0].toLowerCase())}function _R(e){return pe[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 ai(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(E=>E.toLowerCase());if(s.includes("where")&&!Wt(s,pe)){let E=s.some(w=>Cn.includes(w)),S=new Set([...dn,...Cn]),A=n.filter((w,T)=>!lt.has(s[T])&&!S.has(s[T])).join(" ").trim();if(A){let w=E?"mentions":"where";return{shape:w,entityType:null,modifier:"direct",kind:w,object:A}}}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?pe[s[E-1]]:null)==="touches"){let A=n.slice(1,E-1).filter((w,T)=>!lt.has(s[1+T])).join(" ").trim();if(A)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:A}}}let r=s,i=Wt(s,pe);if(!i&&t){let E=s.map(S=>{if(!_u(S))return S;let A=t.lemma(S);return Ru.has(A)?A:S});i=Wt(E,pe),i&&(r=E)}let a=null;if(!i){let E=s.map(S=>S.length>=4&&_u(S)&&kg(S)||S);if(i=Wt(E,pe),i){r=E;let S=s.slice(i.start,i.end).findIndex((w,T)=>w!==E[i.start+T]),A=i.start+Math.max(S,0);a={from:s[A],to:E[A]}}}let c=!1;if(!i)for(let E=0;E<s.length;E+=1){let S=Us[s[E]];if(!(S&&s[E]==="used"&&s[E+1]==="for")&&S&&s.slice(0,E).some(A=>ii.has(A))){i={kind:S,start:E,end:E+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&Us[s[i.start]]&&s.slice(0,i.start).some(E=>ii.has(E))&&(c=!0);let l=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 w=n.slice(E+2).filter((T,O)=>!lt.has(s[E+2+O])).join(" ").trim();if(w)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:w})}}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(pe)){if(S!==i.kind)continue;let A=E.split(" "),w=i.end;if(A.every((T,O)=>r[w+O]===T)){d({start:w,end:w+A.length});break}}let f=Wt(r,Qe,u);d(f);let p=Wt(r,pn,u);d(p);let m=(E,S)=>n.slice(E,S).filter((A,w)=>!u.has(E+w)&&!lt.has(s[E+w])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);c&&!s.includes("by")&&RR.has(g.toLowerCase())&&(g="");let b=i.kind,$=f?Qe[r.slice(f.start,f.end).join(" ")]:null,y=p?pn[r.slice(p.start,p.end).join(" ")]:"direct";if(b==="touches"&&s.includes("when")){let E=h||g;if(E)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:E})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let E=h||g;if(E)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:E})}let x=s.indexOf("by"),C=s.slice(0,i.start).findIndex(E=>ii.has(E)),v=C>=0,j=v&&C>x;if(x>=0&&!u.has(x)&&v){let E=(w,T)=>n.slice(w,T).filter((O,R)=>{let k=w+R,L=s[k];return!u.has(k)&&!lt.has(L)&&L!=="by"&&!ii.has(L)&&!jR.has(L)&&!kR.has(L)}).join(" ").trim(),[S,A]=j?[E(C+1,n.length),E(x+1,C)]:[E(0,x),E(x+1,n.length)];if(S&&A)return b==="defines"&&Yr.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:A,object:S});if(A)return l({shape:"forward",entityType:$,modifier:y,kind:b,object:A});if(S)return l({shape:"reverse",entityType:$,modifier:y,kind:b,object:S})}if(c&&x<0&&g&&s[i.start]==="called")return null;if(h&&g){let E=r.slice(i.start,i.end).join(" ");if(b==="defines"&&Yr.has(E)||b==="calls"&&(_g(g)||_R(h)))return null;let S=h,A=g;return Kr.includes(E)&&([S,A]=[A,S]),l({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:S,object:A})}if(g){if(b==="calls"&&_g(g))return null;let E=f&&f.start>=i.end?null:$;return l({shape:"reverse",entityType:E,modifier:y,kind:b,object:g})}if(b==="inherits"&&!h&&f&&f.start===i.end){let E=r.slice(f.start,f.end).join(" ");if(E)return l({shape:"reverse",entityType:null,modifier:y,kind:b,object:E})}if(h&&!g&&v&&i.end-i.start===1&&Us[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 E=ii.has(s[0]);return l({shape:"reverse",entityType:$,modifier:y,kind:b,object:h,...E?{polar:!0}:{}})}return h?l({shape:"forward",entityType:$,modifier:"direct",kind:b,object:h}):null}var ii,jR,kR,RR,Tg,La=M(()=>{Bn();$n();ir();ii=new Set(["is","are","was","were","be","been","being","get","gets","got"]),jR=new Set(["which","what","who","whom","whose"]),kR=new Set(hs.map(e=>e.toLowerCase())),RR=new Set(["recently","lately","yet","already","ever","again"]);Tg={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=ai(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function AR(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)||Ag.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function CR(e,t=null){let n=nn(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!Ag.has(a)&&(TR.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=AR(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var Ag,TR,Cg,Ig=M(()=>{Bn();$n();Na();La();Ag=new Set([...lt,...he(po),...he(Object.keys(pe)),...he(Object.keys(Qe)),...he(Object.keys(pn)),...he(Object.keys(at)),...he(ho),...he(go),...he(Object.keys(zn)),...he(Object.keys(Un)),...he(Object.keys(Xo)),...he(hs),...he(Jr),...he(mo),...he(dn),...he(Cn),...he(ms),...he(Object.keys(Qo))]),TR=new Set([...he(Xr),...he(ma)]);Cg={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(ar(e))return null;let{text:n,dropped:s,maybeNoise:o}=CR(e,t.nlp||null);if(!s.length||!n)return null;let r=ar(n)||ai(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 Og=M(()=>{});var Pa,Ma=M(()=>{Pa=()=>{}});function Lg(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?cr(e.subject)===cr(t.subject)&&cr(e.object)===cr(t.object):cr(e.object)===cr(t.object)}function Au(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=>!Pg(l))&&(n=n.filter(l=>!Pg(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=>Lg(m.parsed,f.parsed)&&m.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),Ng(f.parsed)<Ng(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=>Lg(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function NR(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 Mg(e,{describe:t=NR,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 cr,IR,Ng,OR,Pg,Cu=M(()=>{cr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),IR=/^\s*(?:the|a|an)\s+/i,Ng=e=>[e?.subject,e?.object].filter(t=>IR.test(String(t||""))).length;OR=new Set(["fuzzy","lemma","spell"]),Pg=e=>OR.has(e.via)});function Fa(e){Iu=e}function Da(){return typeof Iu=="function"?Iu():null}var Iu,lr=M(()=>{Iu=null});function zg(e,t={},n=PR){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 LR,PR,Ug=M(()=>{$n();Na();La();Ig();Og();Ma();Cu();lr();LR=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],PR=[Rg,Tg,Cg,...LR]});function ur(e){return MR.test(String(e||"").trim())?"an":"a"}function za(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 dr(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function ci(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 MR,Ua=M(()=>{MR=/^[aeiou]/i});var li,Ou=M(()=>{li=(e,t,n)=>n});var Tb={};Ot(Tb,{DYNAMIC_TAIL_OK_RE:()=>cd,applyNegationFrames:()=>ri,ask:()=>Ys,classDisplayName:()=>Ss,degreeMetric:()=>$b,metaFallbackEntityAnswer:()=>pb,normalizeQuery:()=>$o,parseQuery:()=>So,parseQueryFull:()=>Ku,render:()=>On,rephraseHint:()=>nd,resolveObject:()=>Nn,traverse:()=>sn,worldRelationGraphPayload:()=>CT});function st(e,t){let n=Bg.get(e);n||(n=new Map,Bg.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(vs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Fe(e,t){let[n,s]=Du[e]||["result","results"];return t===1?n:s}function hi(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 Ss(e){let t=String(e||"");if(typeof Wn=="function"){let n=Wn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function vo(e){return DR[e]||e}function GR(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||WR.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return he(mo).includes(o)?t:e}function qR(e,t){if(!e||e.shape!=="where"||e.altObject||!VR.test(t))return e;let n=fa(t),s=fa(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)||lt.has(i)||pe[i]||i.endsWith("ing"))return o;let a=nn(n).map(l=>l.toLowerCase());for(;a.length&&HR.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 Ku(e,{nlp:t}).parsed}function Ku(e,{nlp:t=void 0}={}){let n=t===void 0?Da():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=ku(ri($o(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=YR(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Au(zg(o,{nlp:n,raw:s}));return i?{parsed:qR(GR(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Uu(e,t){return t.length&&ob.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function mr(e,t){return ar(e)||ai(e,t)}function YR(e,t){let n=nn(e),s=n.map(o=>o.toLowerCase());return h_(n,s)||b_(n,s)||ZR(n,s,t)||ib(e,t,0)||w_(n,s,t)||t_(n,s,t)||c_(n,s,t,0)||u_(n,s)||p_(n,s,t)||y_(n,s,t)||x_(n,s,t)||S_(n,s,t,0)||v_(n,s,t,0)||Ju(n,s,t,0)||s_(n,s,t)||JR(n,s)||db(n,s,t,0)}function JR(e,t){let n=0;XR.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?Fm[`${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 Wa(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function ZR(e,t,n){if(!["do","does","did"].includes(t[0])||!QR.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,pe);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)&&!lt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=hr(`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:Wa(o,{op:"difference",kind:"set",ast:d})}}function ib(e,t,n=0){let s=vg(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=>at[d]))return Wa(r,{op:"difference",kind:"qual",filters:a});let c=Wt(a,pe);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)&&!lt.has(a[f])&&a[f]!=="from").length)return Wa(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=hr(`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"}:Wa(r,{op:"difference",kind:"set",ast:u})}function t_(e,t,n){let s=0;for(;s<t.length&&e_.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,pe);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!lt.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function Xu(e,t){let n=new Set;for(let s of t)for(let o of st(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function ab(e,t){let n=Gt(t),s=n.filter(r=>!nb.has(r)),o=Xu(e,s.length?s:n);return o.size===1?[...o][0]:null}function hr(e,t,n){if(n>sb)return{node:"miss",reason:"too deep to resolve"};let s=ib(e,t,n);if(s)return s;let o=nn(e),r=o.map(l=>l.toLowerCase()),i=Ju(o,r,t,n);if(i)return i;let a=db(o,r,t,n);if(a)return a;let c=mr(e,t);return c?{node:"clause",clause:c}:null}function Ju(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=ms.includes(t[o]),i=!r&&rb(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=>at[f.toLowerCase()]))continue;let l=mr([...c,zu].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=hr(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 s_(e,t,n){for(let s=0;s<t.length;s+=1){if(!n_.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!pe[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),zu,...e.slice(s+1)],a=mr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===zu&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function c_(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!o_.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(r_.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&&i_.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&a_.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>ms.includes(d)))return null;let c=Yu.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=hr(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 u_(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!l_.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 f_(e){let t=new Set,n=[];for(let s of e){if(!s||!d_.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function p_(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=m_(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=f_(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function m_(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&KR.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>at[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=mr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function h_(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 g_(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=zs(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 b_(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(at[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&&Us[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&&!Bm.has(u))return null}let r=g_(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 w_(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=mr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function y_(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&&at[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=>!lt.has(d)&&!cb.has(d)),u;if(l){let d=hr(`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 v_(e,t,n,s){let o=0,r=!1,i=null;for(let $ of lb){let y=$.split(" ");if(t.slice(0,y.length).join(" ")===$){i=$,o=y.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&Qu.has(t[o]);)o+=1;let a=[];for(;o<t.length&&at[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])&&!pe[t[o]]&&!hs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ub}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some($=>!lt.has($)&&!cb.has($)),p=t.slice(o),m=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),m=m.slice(1));let h=r&&$_.has(p[0]);if(r&&(f&&!h||d.length===0))return null;let g,b=!1;if(f){let $=h?m:d,y=hr(`which ${[...a,u,...$].join(" ")}`,n,(s||0)+1);if(!y||y.node==="miss")return{node:"miss",reason:y&&y.reason||"the list filter didn't parse"};g=y,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 x_(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(zn[h]){s=zn[h],o=m;break}if(zn[t[m]]){s=zn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(Un[t[m]]){r=Un[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(Un[t[m]]){r=Un[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=Un.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?Wm[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 S_(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Qu.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&&E_.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=>ms.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!pe[t[o]]&&!hs.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ub}`}:null}function j_(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Qu.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(ms.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 k_(e,t,n,s,o,r){let{branches:i,ops:a}=Ga(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],f=d.map($=>$.toLowerCase()),p=u===0?"intersection":a[u-1],m=Uu(d,f);if(m.blc.length&&m.blc.every($=>at[$])){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,pe);g?c=d.slice(g.start,g.end):c&&(h=[...c,...d]);let b=fb(`${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 db(e,t,n,s){let o=j_(e,t);if(o){let{entityType:A,term:w,relIdx:T}=o,O=t.slice(T+1),R=e.slice(T+1);if(!O.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let k=k_(A,`which ${t[T-1]}`,O,R,n,s+1);if(k.miss)return{node:"miss",reason:k.miss};let L=[{op:"seed",kind:"set",ast:{node:"find",entityType:A,term:w}},...k.atoms];return L.length===1?L[0].ast:{node:"boolean",entityType:A,atoms:L}}let r=0;for(;r<t.length&&Yu.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&at[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?Vt(t[r]):null;if(!c){let A=r+1<t.length?Vt(t[r+1]):null;if(Wg.has(t[r])&&A&&A.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(ob.has(t[r])){let w=r+1;w<t.length&&(t[w]==="the"||t[w]==="a"||t[w]==="an")&&(w+=1);let T=w+1<t.length?Vt(t[w+1]):null;if(Wg.has(t[w])&&T&&T.entityType==="Commit"&&w+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&A&&/^[a-z]+$/.test(t[r])&&!pe[t[r]]&&!lt.has(t[r])&&!id.has(t[r])?{node:"find",entityType:A.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&&ms.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&&rb(d[0]),g=f.length>0&&Ga(d,f).branches.some(A=>{let{blc:w}=Uu(A,A.map(T=>T.toLowerCase()));return w.length&&w.every(T=>at[T])}),b=f.length>0?Ga(d,f).branches:[],$=!1;if(b.length>1){let A=b[0].map(T=>T.toLowerCase()),w=Wt(A,pe);w&&w.start===0&&($=b.slice(1).every(T=>{let O=T.map(k=>k.toLowerCase()),R=Wt(O,pe);return R&&R.start===0?R.kind===w.kind:!R}))}let y=!1;if(b.length>1){let A=b[0].map(T=>T.toLowerCase()),w=Wt(A,pe);w&&w.start===0&&(y=b.slice(1).every(T=>{let O=T.map(k=>k.toLowerCase()),R=Wt(O,pe);return!!R&&R.start===0&&R.end-R.start===1}))}if(!(a.length||p||m||h||g||$||y))return null;if(!f.length){let A={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:A,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let x=c.placeholder?"what":`which ${u}`,{branches:C,ops:v}=Ga(d,f),j=null,E=[];for(let A=0;A<C.length;A+=1){let w=C[A],T=w.map(V=>V.toLowerCase()),O=A===0?"seed":v[A-1],R=Uu(w,T);if(R.blc.length&&R.blc.every(V=>at[V])){E.push({op:O,kind:"qual",filters:R.blc});continue}if(T[0]==="of"||T[0]==="in"){E.push({op:O,kind:"set",ast:{node:"membership",entityType:l,term:w.slice(1).join(" ")}});continue}let k=w,L=Wt(T,pe);L?j=w.slice(L.start,L.end):j&&(k=[...j,...w]);let B=fb(`${x} ${k.join(" ")}`,n,s+1);if(!B||B.node==="miss")return{node:"miss",reason:B&&B.reason||"a clause in the combination didn't parse"};E.push({op:O,kind:"set",ast:B})}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:l,atoms:E},a.length&&(S={node:"qualifier",filters:a,inner:S,entityType:l}),S}function fb(e,t,n){if(n>sb)return{node:"miss",reason:"too deep to resolve"};let s=nn(e),o=s.map(a=>a.toLowerCase()),r=Ju(s,o,t,n);if(r)return r;let i=mr(e,t);return i?{node:"clause",clause:i}:null}function Ga(e,t){let n=Object.keys(Xo).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(Xo[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 Zu(e,t,n,s){let o=fr[t];if(o&&Ks.has(n)){let u=st(e,o).filter(d=>s.has(d.object));return ks(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Ks.has(e.byId.get(u)?.class))?[...Gt(t),o]:Gt(t)).flatMap(u=>st(e,u)).filter(u=>s.has(u.object)),c=ks(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")?sd(e,new Set(c.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function __(e,t){let n=new Set(Zu(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=R_.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function fi(e,t,n){let s=Gt(t).flatMap(o=>st(e,o)).filter(o=>n.has(o.subject));return ks(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ks(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 T_(e,t){let n=ys(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&ys(o.label).startsWith(s))}function Bu(e){let t=Gg.get(e);if(t)return t;let n=new Set;for(let i of st(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 st(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of st(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Gg.set(e,t),t}function pr(e,t){return t?t.class==="Module"?t.id:Bu(e).moduleOfSymbol.get(t.id)||null:null}function pb(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>A_.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=pr(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?`, ${li("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 Wu(e,t,n){let s=ks(Jo.flatMap(o=>fi(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function ed(e,t,n=null){let s=js(e,t,n);if(!(s.match&&s.tier===1)){let o=T_(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 mb(e,t,n,s,o){let r=o||(()=>!0),i=Wu(e,t,s).filter(r);if(i.length||!gb(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of hb(e,t)){let c=e.byId.get(a);if(!c)continue;let l=Wu(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=Bu(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=pr(e,t),o=Bu(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 td(e){return st(e,"inherits")}function Gu(e,t){return td(e).filter(n=>n.object===t).map(n=>n.subject)}function Vg(e,t){return td(e).filter(n=>n.subject===t).map(n=>n.object)}function C_(e,t){let n=new Set,s=[...Gu(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Gu(e,o))n.has(r)||s.push(r)}}return n}function hb(e,t){let n=new Set,s=[...Vg(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Vg(e,o))n.has(r)||s.push(r)}}return n}function gb(e,t){let n=Hg.get(e);if(n||(n=new Map,Hg.set(e,n)),n.has(t))return n.get(t);let s=td(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 qg(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 Yg(e){return e.slice().sort((t,n)=>Kg[n.via]-Kg[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Xg(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Es(n);if(xs(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of Eo(e.label))if(xs(o,n,s)<=s)return!0;return!1}function bb(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=gb(e,t),i=[];for(let c of s){let l=qg(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...C_(e,c.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!qg(f,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:Yg(i),broad:[]};let a=new Map;for(let c of s)for(let l of hb(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&Xg(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Gu(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Xg(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Yg([...a.values()])}}function I_(e){return[...ka(Ra(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function vn(e,t,n){switch(t.node){case"clause":return sn(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?I_(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=bb(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Gt(t.kind).flatMap(o=>st(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=js(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=ab(e,t.kind);if(!o)return[];let r=new Set(fi(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(vn(e,t.inner,n).map(o=>o.id));return Zu(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(vn(e,t.inner,n).map(o=>o.id));return fi(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=ed(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 ks(Jo.flatMap(c=>fi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=mb(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?vb(e,t,n).matches:vn(e,t.inner,n).filter(o=>t.filters.every(r=>xo(e,o,at[r])));case"boolean":return wb(e,t,n);case"anaphora":return yb(e,t,n).matches;default:return[]}}function wb(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=vn(e,o.ast,n);continue}if(o.kind==="qual"){let i=c=>o.filters.every(l=>xo(e,c,at[l])),a=c=>o.filters.every(l=>{let u=O_(at[l]);return u?xo(e,c,u):!xo(e,c,at[l])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(vn(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 vn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function N_(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=Nn(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 yb(e,t,n){let o=N_(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,at[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=Nn(e,i.clause.object);if(!d.match)r=[];else{let f=fr[i.clause.kind],p=[...Gt(i.clause.kind),...f?[f]:[]],m=new Set(p.flatMap(h=>st(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=hi(l,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:l,referents:u}}function $b(e,t,n){let s=n.kind==="*"?L_:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of st(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 P_(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 F_(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(M_.test(s))r=s;else{let{match:u,ambiguous:d}=Nn(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 D_(e,t,n){let s=vn(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=Zu(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 z_(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(st(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:$b(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?hi(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 vb(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,at[h])):null,a=m=>hi(r,m,"membership"),c=ed(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=ks(Jo.flatMap(g=>fi(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}=mb(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 U_(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=Nn(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=Nn(e,s,{expectedClass:n}),c=!r||a.match&&pr(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?sd(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 B_(e,t,n){let s=pr(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Wu(e,n.id).some(o=>o.id===t.id)}function W_(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=js(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=ed(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!B_(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,at[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 G_(e,t,n){let s=Nn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=vn(e,{node:"allOfClass",entityType:t.entityType},n),r=wb(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 V_(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(vn(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 H_(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return U_(e,t);if(t.node==="qualCheck")return W_(e,t,n);if(t.node==="universal")return G_(e,t,n);if(t.node==="count"){let i=V_(e,t.base,n);return i?{compositeKind:"count",count:__(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:vn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:vn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return _T(e,t);if(t.node==="superlative")return z_(e,t);if(t.node==="temporal")return D_(e,t,n);if(t.node==="recentCommits")return P_(e);if(t.node==="commitFilter")return F_(e,t);if(t.node==="anaphora")return yb(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return vb(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=bb(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=vn(e,t,n),o=t.entityType||null,r=hi(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function xb(){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 q_(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=mi(e);return n?`${t} in ${n}`:t}function Vu(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(Vu):Array.isArray(e.filters)&&e.filters.some(t=>at[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(Vu)}function K_(e,t){return!["Function","Method"].includes(t)||!Vu(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 Y_(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})`:""}. ${xb()}.`,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=mi(i),c=i.class==="Module"?"":a?`, ${li("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 ${Hs(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=UR(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}: ${Hs(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>nt?` \u2014 narrow with "${Fe(t.entityType,2)} in <module>"`:"";return{content:`${Hs(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=In(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)})`:""}. ${qs(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}: ${Hs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${Hs(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?q_(t.matches[0]):Hs(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:`${Hs(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. ${qs(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. ${qs(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=K_(e,t.entityType)||qs(n);return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${Hs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function nd(){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). `+xb()}function qs(e=null){return e&&ni(e)===0?yu:`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 Ha(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 Eb(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function X_(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function ui(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($=>$.class==="Commit"&&(String($.id).toLowerCase().startsWith(`commit:${g}`)||String($.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 $=ui(e,b,{expectedClass:n});$.match&&!$.ambiguous&&g.add($.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 $=String(b.label||"").toLowerCase();b.class==="Module"?$.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs($.length-o.length)}):$.includes(o)?d.push({ind:b,score:2e3-Math.abs($.length-o.length)}):$.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs($.length-o.length)})}}else{let g=[...Eo(s)],b=o.split(/\s+/).find(v=>v.includes("/")),$=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,x=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,C=x?X_(s):null;for(let v of r){let j=String(v.label||"").toLowerCase(),E=j.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(E===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(E.startsWith(o)||E.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(E.length-o.length)});continue}if(x){let w=Eb(v.label);if(w&&w===C){d.push({ind:v,score:5e3});continue}let T=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if(w&&T&&C.length>=4&&w.includes(C)){d.push({ind:v,score:2e3-Math.abs(w.length-C.length)});continue}}if(v.class==="Module"){let w=Ha(o);if(w!==o&&w===Ha(E)){let T=Es(o);if(xs(E,o,T)>T){d.push({ind:v,score:3e3-Math.abs(E.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 S=Eo(v.label),A=g.filter(w=>S.has(w)).length;A>0&&(!$||S.has($))&&d.push({ind:v,score:A/g.length*Lu})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,$=b.filter(x=>x.score===g.score),y=g.score>=Lu?b.filter(x=>x.score>=Lu):b;return{match:g.ind,candidates:y.slice(0,4).map(x=>x.ind),tier:3,ambiguous:$.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,$=e.byId.get(g.id);if($){let y=b.filter(x=>x.score===g.score);if(m={match:$,candidates:b.slice(0,4).map(x=>e.byId.get(x.id)).filter(Boolean),tier:4,ambiguous:y.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=Es(o),b=g+1,$=[];for(let y of r){let x=xs(String(y.label||"").toLowerCase(),o,g);if(x>0)for(let C of Eo(y.label)){if(x<=0)break;x=Math.min(x,xs(C,o,g))}x<b?(b=x,$=[y]):x===b&&x<=g&&$.push(y)}if(b<=g&&$.length===1)return{match:$[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&$.length>1&&!m){let[y,...x]=$;return{match:y,candidates:x.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Pu(e,t){let n=Eb(t),s=[...Eo(t)],o=[];for(let r of Eo(e))n.includes(r)||s.some(i=>Ha(i)===Ha(r))||Va.has(r)||kb.has(r)||o.push(r);return o}function Ba(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(Pu(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Pu(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:In(s.slice(0,4).map(r=>r.label))}:e}let n=Pu(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function Nn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(J_,"").trim(),i=r.match(Q_);if(i){let a=r.slice(0,i.index).trim(),c=Qe[i[1].toLowerCase()];if(a&&c){let l=Ba(ui(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ba(ui(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ba(ui(e,t,n),t)}return Ba(ui(e,t,n),t)}function js(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 Nn(e,t)}function sd(e,t,n){let s=[];for(let o of st(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 Z_(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Ks.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>st(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&Ks.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 sT(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&od.has(Jg(s.label))).map(s=>({ind:s,named:n.has(Jg(s.label))?1:0,depth:String(s.label).split("/").length,fixture:nT(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 oT(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function rd(e){return(e?.attributes||[]).find(t=>rT.has(t.prop))?.value||null}function iT(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${ur(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 H_(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let R=t.candidates.map(k=>{let L=sn(e,k,{contextId:n,prev:s});return{parsed:k,result:L,rendered:On(k,L,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:R}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let R=String(t.object||"").trim(),k=R.toLowerCase(),L=(e.individuals||[]).find(B=>{if(!rd(B))return!1;if(String(B.label).toLowerCase()===k)return!0;let V=(B.attributes||[]).find(K=>K.key==="token")?.value;return V&&String(V).toLowerCase()===k});if(!L){let B=pb(e,R);return B?{matches:[B.hit],objMatch:B.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:B.text,traversal:`schema lookup for "${R}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${R}"`,ambiguous:!1}}return{matches:[L],objMatch:L,candidates:[],traversal:`schema lookup for "${R}"`,ambiguous:!1}}if(r==="mentions"){let R=String(t.object||"").trim();return{matches:(typeof bo=="function"?bo(e.proseIndex,R):[]).map(B=>e.byId.get(B.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${R}"`}}if(r==="where"&&eT.test(String(t.object||"").trim())){let R=sT(e,t.object);return{matches:R,objMatch:R[0]||null,candidates:R.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...od].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!oT(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 R=js(e,t.subject,n),k=js(e,t.object,n);if(!R.match||!k.match||R.ambiguous||k.ambiguous)return{matches:[],objMatch:k.match,candidates:k.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(R.unresolvedPronoun||k.unresolvedPronoun)};let[L,B]=[R.match,k.match];i==="touches"&&B.class==="Commit"&&L.class!=="Commit"&&([L,B]=[B,L]);let V=fr[i],K=[...new Set(V?[...Gt(i),V]:Gt(i))],Y=K.flatMap(_=>st(e,_)).filter(_=>_.subject===L.id&&_.object===B.id);return{matches:Y,answer:t.negated?Y.length===0:Y.length>0,objMatch:k.match,subjMatch:R.match,candidates:[],traversal:`${K.join("+")} edge from ${L.label} to ${B.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=js(e,t.object,n),t.altObject&&t.altObject!==t.object){let R=js(e,t.altObject,n),k=!!c.match&&!c.ambiguous,L=!!R.match&&!R.ambiguous;!k&&L?c=R:k&&L&&c.match.id!==R.match.id&&(c={...c,ambiguous:!0,candidates:[R.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let R=B=>B.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),k=R(String(t.object||"").trim().toLowerCase()),L=(e.individuals||[]).find(B=>{if(B.class!=="Module"||B.id===c.match.id)return!1;let V=String(B.label||"").toLowerCase().split("/").pop();return V!==R(V)&&R(V)===k});L&&(c={...c,ambiguous:!0,candidates:[L,...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 k=ks([l,...u||[]]).slice(0,nt).map(L=>{let B=sn(e,t,{contextId:n,prev:s,pinnedObjMatch:L});return{candidate:L,result:B,rendered:On(t,B,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:k}}if(r==="where"){let R=(l.attributes||[]).find(k=>k.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whereShape:!0,site:R,traversal:R?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let R=B=>String((B.attributes||[]).find(V=>V.key==="date")?.value||""),k;if(l.class==="Commit")k=[l];else{let B=["touches","touchesSymbol"].flatMap(K=>st(e,K)).filter(K=>K.object===l.id),V=new Set;k=[];for(let K of B){if(V.has(K.subject))continue;V.add(K.subject);let Y=e.byId.get(K.subject);Y&&Y.class==="Commit"&&k.push(Y)}k.sort((K,Y)=>R(Y).localeCompare(R(K)))}let L=k.length&&R(k[0])?[{kind:"event",class:"Commit",label:k[0].label,ids:[k[0].id],attrs:{date:R(k[0]).slice(0,10)},lane:"when"}]:[];return{matches:k,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:L,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let R=K=>String((K.attributes||[]).find(Y=>Y.key==="date")?.value||""),k=["touches","touchesSymbol"].flatMap(K=>st(e,K)).filter(K=>K.object===l.id),L=new Set,B=[];for(let K of k){if(L.has(K.subject))continue;L.add(K.subject);let Y=e.byId.get(K.subject);Y&&Y.class==="Commit"&&B.push(Y)}B.sort((K,Y)=>R(Y).localeCompare(R(K)));let V=B.length&&R(B[0])?[{kind:"event",class:"Commit",label:B[0].label,ids:[B[0].id],attrs:{date:R(B[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:B,objMatch:l,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:V,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return Z_(e,l,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let R=fr[i],L=!!(R&&l.class&&Ks.has(l.class))?[...new Set([...Gt(i),R])]:Gt(i);if(a&&a!=="Change"){let P=Xu(e,L),W=Nu[a];if(P.size&&!P.has(a)&&!(W&&P.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...P],traversal:`${L.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${Ss(a)})`}}let V=L.flatMap(P=>st(e,P)).filter(P=>P.subject===l.id).map(P=>e.byId.get(P.object)).filter(Boolean),K=ks(V),Y=K,_="";if(a&&a!=="Change"){Y=K.filter(W=>W.class===a);let P=Nu[a];if(!Y.length&&P){let W=K.filter(F=>F.class===P);W.length&&(Y=W,_=`, widened to ${P} subjects (no ${a} recorded)`)}}return{matches:Y,objMatch:l,candidates:u,traversal:`${L.join("+")} edges where subject = ${l.label}${_}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:or(e,l,{maxDepth:Qg}).flat().map(L=>e.byId.get(L.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${Qg})`};let g=fr[i]||Gt(i).find(R=>nb.has(R))||null,b=!!(l.class&&Ks.has(l.class));if(g&&(Ks.has(a)||b)){let R=st(e,g).filter(_=>_.object===l.id),k=ks(R.map(_=>e.byId.get(_.subject)).filter(Boolean)),L=!a||a==="Change"?k:k.filter(_=>_.class===a),B="",V=Nu[a];if(!L.length&&V){let _=k.filter(P=>P.class===V);_.length&&(L=_,B=`, widened to ${V} subjects (no ${a} recorded)`)}let K=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!st(e,"contains").some(_=>_.subject===l.id),Y=K?e.byId.get(pr(e,l)||""):null;if(L.length||!(K&&Y))return{matches:L,objMatch:l,candidates:u,traversal:`${g} edges where object = ${l.label}${B}`,ambiguous:d,matchedVia:p}}let $=l,y=u,x=d,C=p,v="",j=ab(e,i);if(j&&$.class&&$.class!==j){let R=Nn(e,t.object,{expectedClass:j});if(R.match&&!R.ambiguous)$=R.match,y=R.candidates,x=R.ambiguous,C=R.matchedVia;else if(j==="Module"){let k=pr(e,$),L=k&&e.byId.get(k);if(L)v=`, refined from ${$.label} to its containing module`,$=L;else return{matches:[],objMatch:$,candidates:y,ambiguous:x,matchedVia:C,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ss($.class)} ${$.label} (grain mismatch: this "${i}" question needs a ${Ss(j)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:$,candidates:y,ambiguous:x,matchedVia:C,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ss($.class)} ${$.label} (grain mismatch: this "${i}" question needs a ${Ss(j)})`}}let E=Gt(i).flatMap(R=>st(e,R)).filter(R=>R.object===$.id);i==="cochange"&&(E=E.concat(Gt(i).flatMap(R=>st(e,R)).filter(R=>R.subject===$.id).map(R=>({...R,subject:R.object,object:R.subject}))));let S="";if(!E.length&&$.class){let R=`ext:${String($.label).toLowerCase()}`;E=Gt(i).flatMap(k=>st(e,k)).filter(k=>String(k.object).toLowerCase()===R),E.length&&(S=` (by name, via unresolved ${R} references)`)}let A=[],w=new Set;for(let R of E){let k=e.byId.get(R.subject);k&&!w.has(k.id)&&(w.add(k.id),A.push(k))}let T,O="";if(!a||a==="Change")T=A;else{let R=A.filter(k=>k.class===a);if(R.length)T=R;else if(a!=="Module"&&A.some(k=>k.class==="Module")){let k=new Set(A.filter(L=>L.class==="Module").map(L=>L.id));T=sd(e,k,a),O=`, then ${Ss(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:$,candidates:y,traversal:`${Gt(i).join("+")} edges where object = ${$.label}${S}${O}${v}`,ambiguous:x,matchedVia:C}}function mi(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 Mu(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function aT(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function In(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function di(e){let t=e.object??e.subject??"?";return`${e.entityType?Fe(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Hu(e){return qr[e]?.bare||e}function cT(e){let t=Hu(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function lT(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 ${Hu(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 ${Hu(o.kind)} ${JSON.stringify(String(r))}`}function Sb(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(di).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Sb(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?lT(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 On(e,t,n=null){let s=jb(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function jb(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${nd()}`,miss:!0,ambiguous:!1};if(e.node)return Y_(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
55
  ${t.branches.map((c,l)=>`${l+1}) as ${di(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(di),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${di(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(di),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 ${In(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=rd(t.objMatch)||"";return{content:`${t.objMatch.label} is ${rT(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,nt).map(c=>`${c.label} (${Fe(c.class,1)})`),a=t.matches.length>nt?`, \u2026and ${t.matches.length-nt} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${In(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 ${In([...od])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,nt).map(d=>d.label),l=a.length>nt?`, \u2026and ${a.length-nt} more`:"",u=a.length?` \u2014 also matched: ${In(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&&Du[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=In(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. ${qs(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=y=>!["Commit","Session","Source","Utterance"].includes(y?.class),$=i.filter(b);$.length&&(i=$,a?.length&&(a=a.filter(y=>b(y.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),$=new Set(Wn(String(e.object||"")).filter(j=>j.length>=3)),y=new Set(i.map(j=>j.id)),x=null,C=0,v=1/0;if($.size)for(let j of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(j.class)||y.has(j.id))continue;let E=Wn(String(j.label)).filter(A=>$.has(A)).length;if(!E||E<C)continue;let S=xs(String(j.label).toLowerCase(),b,8);(E>C||S<v)&&(x=j,C=E,v=S)}if(x&&(i=[...i,x],a)){let j=sn(n,e,{pinnedObjMatch:x});a=[...a,{candidate:x,result:j,rendered:On(e,j,n)}]}}let c=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,l=c?Du[c]?Fe(c,1):Ss(c):"module",u=i.slice(0,nt).map(b=>b.label),d=i.length>nt?`, \u2026and ${i.length-nt} more`:"",f=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${In(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${tt(p)}\\b`,"gi"):null,h=b=>{let $=String(b.candidate.label||"");return!m||!$?b.rendered.content:b.rendered.content.split($).map(y=>y.replace(m,$)).join($)};return{content:a&&a.length?`${f}
57
+ (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(di),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${di(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(di),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 ${In(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=rd(t.objMatch)||"";return{content:`${t.objMatch.label} is ${iT(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,nt).map(c=>`${c.label} (${Fe(c.class,1)})`),a=t.matches.length>nt?`, \u2026and ${t.matches.length-nt} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${In(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 ${In([...od])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,nt).map(d=>d.label),l=a.length>nt?`, \u2026and ${a.length-nt} more`:"",u=a.length?` \u2014 also matched: ${In(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&&Du[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=In(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. ${qs(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=y=>!["Commit","Session","Source","Utterance"].includes(y?.class),$=i.filter(b);$.length&&(i=$,a?.length&&(a=a.filter(y=>b(y.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),$=new Set(Wn(String(e.object||"")).filter(j=>j.length>=3)),y=new Set(i.map(j=>j.id)),x=null,C=0,v=1/0;if($.size)for(let j of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(j.class)||y.has(j.id))continue;let E=Wn(String(j.label)).filter(A=>$.has(A)).length;if(!E||E<C)continue;let S=xs(String(j.label).toLowerCase(),b,8);(E>C||S<v)&&(x=j,C=E,v=S)}if(x&&(i=[...i,x],a)){let j=sn(n,e,{pinnedObjMatch:x});a=[...a,{candidate:x,result:j,rendered:On(e,j,n)}]}}let c=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,l=c?Du[c]?Fe(c,1):Ss(c):"module",u=i.slice(0,nt).map(b=>b.label),d=i.length>nt?`, \u2026and ${i.length-nt} more`:"",f=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${In(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${tt(p)}\\b`,"gi"):null,h=b=>{let $=String(b.candidate.label||"");return!m||!$?b.rendered.content:b.rendered.content.split($).map(y=>y.replace(m,$)).join($)};return{content:a&&a.length?`${f}
58
58
  ${a.map((b,$)=>`${$+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:`${Mu(i)} is defined in ${a[1]} at ${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}let c=mi(i);return c?{content:`${Mu(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. ${qs(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} ${li("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. ${qs(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,nt)){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)} ${In(d)}`),l=t.matches.length>nt?`; \u2026and ${t.matches.length-nt} 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(Jo.includes(e.kind)&&n&&t.objMatch)for(let c of Jo){if(c===e.kind)continue;let l={...e,kind:c},u=sn(n,l,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return jb(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(UR,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?Fe(e.entityType,2):(()=>{let c=[...Xu(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}. ${qs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${aT(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=>!Ks.has(i.class))){let i=t.matches.slice(0,nt).map(c=>c.class==="Commit"?iT(c):c.label),a=t.matches.length>nt?`, \u2026and ${t.matches.length-nt} 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,nt)){let a=mi(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Mu(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=In(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>nt?` \u2026and ${t.matches.length-nt} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Rb(e){if(e.length<4||dT.has(e))return null;let t=Es(e),n=t+1,s=null,o=!1;for(let r of uT){let i=xs(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 Zg(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!rd(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Rb(n);return!!s&&s!==n&&!!Qe[s]}function _b(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=js(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Zg(s,t.object))return!1;if(t.shape==="ask"){let o=js(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Zg(o,t.subject))}return!0}function fT(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Gm.includes(t)}function pT(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=ri($o(String(t||""))),i=nn(r);if(!i.length)return null;let a=[],c=[],l=w=>{let T=Nn(e,w);return!!T.match&&T.tier!=null&&T.tier<=2},u=w=>{let T=Nn(e,w);return!!T.match&&T.tier!=null&&T.tier<=3},d=w=>{let T=String(w||"").trim().toLowerCase();return po.includes(T)?!0:nn(T).some(O=>{let R=O.toLowerCase();return!Va.has(R)&&!qu.has(R)})},f=new Set(["reverse","forward","where","when","ask"]),p=w=>{let T=w.join(" "),O=So(T,{nlp:n});return _b(e,O,s)!==!0||O&&!O.node&&f.has(O.shape)&&(O.object!=null&&!d(O.object)||O.shape==="ask"&&O.subject!=null&&!d(O.subject))||On(O,sn(e,O,{contextId:s,prev:o}),e).miss?null:{parsed:O,text:T}},m=w=>({parsed:w.parsed,from:r,to:w.text,dropped:[...a],steps:c}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let w=-1;for(let R=0;R<i.length;R+=1){let k=i[R].toLowerCase();if(id.has(k)&&!Va.has(k)&&!l(i[R])){w=R;break}}if(w<0)break;let T=i[w];i=i.filter((R,k)=>k!==w),a.push(T),c.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let O=p(i);if(O)return m(O)}let b=So(i.join(" "),{nlp:n}),$=new Set;if(b&&!b.node&&f.has(b.shape))for(let w of[b.object,b.subject])for(let T of nn(String(w||"").toLowerCase()))$.add(T);let y=[],x=[],C=[];for(let w of i){let T=w.toLowerCase();if(!/^[a-z]+$/.test(T)||Va.has(T)||qu.has(T)||u(w)){y.push(w);continue}let R=Rb(T);if(R&&R!==T){y.push(R),C.push(`${w}\u2192${R}`);continue}if($.has(T)){y.push(w);continue}x.push(w)}if((C.length||x.length)&&y.length){i=y,a.push(...x),C.length&&c.push(`fuzzy-correct ${JSON.stringify(C)} \u2192 "${i.join(" ")}"`),x.length&&c.push(`drop unmatched ${JSON.stringify(x)} \u2192 "${i.join(" ")}"`);let w=p(i);if(w)return m(w)}let v=!1,j=i.map(w=>{let T=w.toLowerCase();return Qo[T]&&!u(w)?(v=!0,Qo[T]):w});if(v){c.push(`normalise synonyms \u2192 "${j.join(" ")}"`);let w=p(j);if(w)return m(w)}let E=nn(r).map(w=>w.toLowerCase()),S=[],A=[];for(let w of E){if(kb.has(w))continue;let T=Qe[w];T&&T!=="Change"?S.push(w):A.push(w)}if(S.length===1&&A.length===0){let w=p(["count",S[0]]);if(w)return c.push(`bare kind "${S[0]}" \u2192 count`),m(w)}return null}function hT(e,t){let n=String(t||"");if(!e||!eb.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(eb,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return mT.test(a)?`${a} touched`:i}function gT(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 ad(e,t){let n=gT(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function yT(e,t){let n=String(t||"").trim(),s=n.match(bT),o=s?null:n.match(wT),r=s||o;if(!r||!cd.test(r[2]||"")||Qe[r[1].toLowerCase()])return null;let i=ad(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 $T(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=ad(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function ST(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 jT(e,t){let n=fa(String(t||"").trim()),s=n.match(vT),o=s?Lm[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(xT)?.[1]||n.match(ET)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:fo[o].predicate},a=$T(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=ST(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function kT(e,t){return fo[e].matchesLocativePredicates?Yo(pi(t.prop))||Yo(pi(t.predicate)):null}function RT(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=fo[t.relation],r=pi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=pi(l.prop),d=pi(l.predicate),f=u===r||d===r,p=f?null:kT(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 Fu(e){let t=_T.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 AT(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Fu(a.subject).base,String(a.object));let s=new Set(Pm),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}=Fu(a.subject),d=n.get(c)||t(c);if(!d)continue;let f=`${a.predicate}\0${c}`;TT(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:Fu(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 OT(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=ad(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 Ys(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(fT(t))return{content:nd(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=hT(e,t);let r=Ku(t,{nlp:s}),i=r.parsed,a=i,c=null;if(_b(e,i,n)===!1){let f=pT(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=On(a,l,e);if(tb(e,a,l,u)){let f=yT(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=On(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(tb(e,a,l,u)){let f=jT(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=On(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Ca(String(t||"")).trim().match(CT)?.[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=On(m,l,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=$o(String(t||"")).match(IT)?.[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=On(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=On(p.parsed,m,e);return h.miss?null:{a:p,text:h.content}}).filter(Boolean);if(f.length){let p=Mg(f.map(m=>m.a),{answerFor:m=>f.find(h=>h.a===m)?.text||null});d=`${d}
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:`${Mu(i)} is defined in ${a[1]} at ${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}let c=mi(i);return c?{content:`${Mu(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. ${qs(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} ${li("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. ${qs(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,nt)){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)} ${In(d)}`),l=t.matches.length>nt?`; \u2026and ${t.matches.length-nt} 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(Jo.includes(e.kind)&&n&&t.objMatch)for(let c of Jo){if(c===e.kind)continue;let l={...e,kind:c},u=sn(n,l,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return jb(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(BR,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?Fe(e.entityType,2):(()=>{let c=[...Xu(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}. ${qs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${cT(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=>!Ks.has(i.class))){let i=t.matches.slice(0,nt).map(c=>c.class==="Commit"?aT(c):c.label),a=t.matches.length>nt?`, \u2026and ${t.matches.length-nt} 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,nt)){let a=mi(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Mu(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=In(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>nt?` \u2026and ${t.matches.length-nt} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Rb(e){if(e.length<4||fT.has(e))return null;let t=Es(e),n=t+1,s=null,o=!1;for(let r of dT){let i=xs(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 Zg(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!rd(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Rb(n);return!!s&&s!==n&&!!Qe[s]}function _b(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=js(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Zg(s,t.object))return!1;if(t.shape==="ask"){let o=js(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Zg(o,t.subject))}return!0}function pT(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Gm.includes(t)}function mT(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=ri($o(String(t||""))),i=nn(r);if(!i.length)return null;let a=[],c=[],l=w=>{let T=Nn(e,w);return!!T.match&&T.tier!=null&&T.tier<=2},u=w=>{let T=Nn(e,w);return!!T.match&&T.tier!=null&&T.tier<=3},d=w=>{let T=String(w||"").trim().toLowerCase();return po.includes(T)?!0:nn(T).some(O=>{let R=O.toLowerCase();return!Va.has(R)&&!qu.has(R)})},f=new Set(["reverse","forward","where","when","ask"]),p=w=>{let T=w.join(" "),O=So(T,{nlp:n});return _b(e,O,s)!==!0||O&&!O.node&&f.has(O.shape)&&(O.object!=null&&!d(O.object)||O.shape==="ask"&&O.subject!=null&&!d(O.subject))||On(O,sn(e,O,{contextId:s,prev:o}),e).miss?null:{parsed:O,text:T}},m=w=>({parsed:w.parsed,from:r,to:w.text,dropped:[...a],steps:c}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let w=-1;for(let R=0;R<i.length;R+=1){let k=i[R].toLowerCase();if(id.has(k)&&!Va.has(k)&&!l(i[R])){w=R;break}}if(w<0)break;let T=i[w];i=i.filter((R,k)=>k!==w),a.push(T),c.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let O=p(i);if(O)return m(O)}let b=So(i.join(" "),{nlp:n}),$=new Set;if(b&&!b.node&&f.has(b.shape))for(let w of[b.object,b.subject])for(let T of nn(String(w||"").toLowerCase()))$.add(T);let y=[],x=[],C=[];for(let w of i){let T=w.toLowerCase();if(!/^[a-z]+$/.test(T)||Va.has(T)||qu.has(T)||u(w)){y.push(w);continue}let R=Rb(T);if(R&&R!==T){y.push(R),C.push(`${w}\u2192${R}`);continue}if($.has(T)){y.push(w);continue}x.push(w)}if((C.length||x.length)&&y.length){i=y,a.push(...x),C.length&&c.push(`fuzzy-correct ${JSON.stringify(C)} \u2192 "${i.join(" ")}"`),x.length&&c.push(`drop unmatched ${JSON.stringify(x)} \u2192 "${i.join(" ")}"`);let w=p(i);if(w)return m(w)}let v=!1,j=i.map(w=>{let T=w.toLowerCase();return Qo[T]&&!u(w)?(v=!0,Qo[T]):w});if(v){c.push(`normalise synonyms \u2192 "${j.join(" ")}"`);let w=p(j);if(w)return m(w)}let E=nn(r).map(w=>w.toLowerCase()),S=[],A=[];for(let w of E){if(kb.has(w))continue;let T=Qe[w];T&&T!=="Change"?S.push(w):A.push(w)}if(S.length===1&&A.length===0){let w=p(["count",S[0]]);if(w)return c.push(`bare kind "${S[0]}" \u2192 count`),m(w)}return null}function gT(e,t){let n=String(t||"");if(!e||!eb.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(eb,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return hT.test(a)?`${a} touched`:i}function bT(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 ad(e,t){let n=bT(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function $T(e,t){let n=String(t||"").trim(),s=n.match(wT),o=s?null:n.match(yT),r=s||o;if(!r||!cd.test(r[2]||"")||Qe[r[1].toLowerCase()])return null;let i=ad(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 vT(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=ad(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function jT(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 kT(e,t){let n=fa(String(t||"").trim()),s=n.match(xT),o=s?Lm[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(ET)?.[1]||n.match(ST)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:fo[o].predicate},a=vT(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=jT(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function RT(e,t){return fo[e].matchesLocativePredicates?Yo(pi(t.prop))||Yo(pi(t.predicate)):null}function _T(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=fo[t.relation],r=pi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=pi(l.prop),d=pi(l.predicate),f=u===r||d===r,p=f?null:RT(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 Fu(e){let t=TT.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 CT(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Fu(a.subject).base,String(a.object));let s=new Set(Pm),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}=Fu(a.subject),d=n.get(c)||t(c);if(!d)continue;let f=`${a.predicate}\0${c}`;AT(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:Fu(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 NT(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=ad(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 Ys(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(pT(t))return{content:nd(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=gT(e,t);let r=Ku(t,{nlp:s}),i=r.parsed,a=i,c=null;if(_b(e,i,n)===!1){let f=mT(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=On(a,l,e);if(tb(e,a,l,u)){let f=$T(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=On(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(tb(e,a,l,u)){let f=kT(e,t);if(f){let p=sn(e,f,{contextId:n,prev:o}),m=On(f,p,e);m.miss||(a=f,l=p,u=m,c=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Ca(String(t||"")).trim().match(IT)?.[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=On(m,l,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=$o(String(t||"")).match(OT)?.[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=On(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=On(p.parsed,m,e);return h.miss?null:{a:p,text:h.content}}).filter(Boolean);if(f.length){let p=Mg(f.map(m=>m.a),{answerFor:m=>f.find(h=>h.a===m)?.text||null});d=`${d}
60
60
  ${p.join(`
61
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:hi(a.entityType,l.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:Sb(a),matches:(l.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?mi(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 Bg,fr,Ks,Nu,MR,Gt,nb,nt,Du,FR,DR,zR,UR,BR,GR,VR,sb,zu,qR,Yu,ob,Vt,rb,YR,JR,ZR,t_,s_,o_,r_,i_,c_,u_,cb,Qu,lb,ub,y_,x_,Wg,k_,Gg,T_,Hg,Kg,I_,N_,P_,Hs,Lu,X_,J_,Z_,od,eT,Jg,tT,Qg,oT,Va,qu,id,kb,lT,uT,dT,eb,mT,bT,wT,cd,vT,xT,ET,pi,_T,TT,CT,IT,tb,qn=M(()=>{Me();du();Bn();$n();ir();Na();La();Ug();Cu();Ws();Ua();Ou();lr();Bg=new WeakMap;fr={calls:"callsSymbol",touches:"touchesSymbol"},Ks=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Nu={Function:"Method",Method:"Function"},MR={uses:["imports","calls","callsSymbol"]},Gt=e=>MR[e]||[e],nb=new Set(Object.values(fr)),nt=12,Du={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"]};FR={cochange:"cochanges",reexports:"export"};DR={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"},zR=e=>DR[e]||vo(e),UR=new RegExp(`^(?:${Object.keys(pe).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),BR=new Set(["imports"]);GR=/^where\s+(?:does|do|did)\s+/i,VR=new Set(he(dn));sb=4,zu="zzinnerset",qR=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Yu=new Set(["which","what","who","list","show","find","give","me","us","all"]),ob=new Set(["are","is","was","were"]);Vt=e=>Qe[e]?{entityType:Qe[e],placeholder:!1}:hs.includes(e)?{entityType:null,placeholder:!0}:null,rb=e=>!!pe[e]&&e.endsWith("ing");YR=new Set(["which","the","all"]);JR=new Set(["all","every","each"]);ZR=new Set(["what","which","thing","things","one","ones","stuff"]);t_=new Set(["those","them"]);s_=new Set(["did","was","were","do","does","has","have","had"]),o_=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),r_=new Set(["last","recently","ever","get","got","been","then","now","already"]),i_=new Set(["the","a","an","all","those","these","any"]);c_=new Set(["since","before","after","on"]);u_=/\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/;cb=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Qu=new Set(["the","a","an","all","me","us"]),lb=[...go].sort((e,t)=>t.split(" ").length-e.split(" ").length),ub="functions, classes, methods, modules, packages, attributes, variables, or commits",y_=new Set(["in","inside","under"]);x_=new Set(["called","named","about","like","containing","matching","with"]);Wg=new Set(["recent","latest","newest"]);k_=/^git:(.+)$/i;Gg=new WeakMap;T_=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Hg=new WeakMap;Kg={label:3,chain:2,attr:1};I_=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;N_=["imports","calls","callsSymbol","inherits","contains","tests"];P_=/^\d{4}-\d{2}-\d{2}$/;Hs=e=>In(e.slice(0,nt).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>nt?`, \u2026and ${e.length-nt} more`:"");Lu=10;X_=/^(?:the|a|an)\s+/i,J_=new RegExp(`\\s+(${Object.keys(Qe).join("|")})$`,"i");Z_=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,od=new Set(["index","main","app","server","cli","__main__"]),eT=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Jg=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),tT=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>eT.has(t));Qg=8,oT=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);Va=new Set([...he(Object.keys(pe)),...he(Object.keys(Qe)),...he(Object.keys(pn)),...he(Object.keys(at)),...he(ho),...he(Object.keys(zn)),...he(Object.keys(Un)),...he(Object.keys(Xo)),...he(hs),...he(Jr),...he(mo),...he(dn),...he(Cn),...he(ms),...he(Object.keys(Qo)),...he([...pa])]),qu=new Set([...lt,...Yu,...po]),id=new Set(he(ma)),kb=new Set([...id,...qu]),lT=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],uT=[...new Set([...he(Object.keys(pe)),...Object.keys(Qe),...lT])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!lt.has(e)),dT=new Set(["impact","impacts","impacted"]);eb=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,mT=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;bT=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,wT=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,cd=/^(?: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;vT=new RegExp(`^(?:${lb.map(tt).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),xT=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,ET=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;pi=e=>String(e||"").toLowerCase();_T=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;TT=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;CT=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,IT=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;tb=(e,t,n,s)=>s.ambiguous?OT(e,t,n):!!s.miss});function Xs(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(`
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:hi(a.entityType,l.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:Sb(a),matches:(l.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?mi(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 Bg,fr,Ks,Nu,FR,Gt,nb,nt,Du,DR,zR,UR,BR,WR,VR,HR,sb,zu,KR,Yu,ob,Vt,rb,XR,QR,e_,n_,o_,r_,i_,a_,l_,d_,cb,Qu,lb,ub,$_,E_,Wg,R_,Gg,A_,Hg,Kg,O_,L_,M_,Hs,Lu,J_,Q_,eT,od,tT,Jg,nT,Qg,rT,Va,qu,id,kb,uT,dT,fT,eb,hT,wT,yT,cd,xT,ET,ST,pi,TT,AT,IT,OT,tb,qn=M(()=>{Me();du();Bn();$n();ir();Na();La();Ug();Cu();Ws();Ua();Ou();lr();Bg=new WeakMap;fr={calls:"callsSymbol",touches:"touchesSymbol"},Ks=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Nu={Function:"Method",Method:"Function"},FR={uses:["imports","calls","callsSymbol"]},Gt=e=>FR[e]||[e],nb=new Set(Object.values(fr)),nt=12,Du={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"]};DR={cochange:"cochanges",reexports:"export"};zR={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"},UR=e=>zR[e]||vo(e),BR=new RegExp(`^(?:${Object.keys(pe).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),WR=new Set(["imports"]);VR=/^where\s+(?:does|do|did)\s+/i,HR=new Set(he(dn));sb=4,zu="zzinnerset",KR=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Yu=new Set(["which","what","who","list","show","find","give","me","us","all"]),ob=new Set(["are","is","was","were"]);Vt=e=>Qe[e]?{entityType:Qe[e],placeholder:!1}:hs.includes(e)?{entityType:null,placeholder:!0}:null,rb=e=>!!pe[e]&&e.endsWith("ing");XR=new Set(["which","the","all"]);QR=new Set(["all","every","each"]);e_=new Set(["what","which","thing","things","one","ones","stuff"]);n_=new Set(["those","them"]);o_=new Set(["did","was","were","do","does","has","have","had"]),r_=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),i_=new Set(["last","recently","ever","get","got","been","then","now","already"]),a_=new Set(["the","a","an","all","those","these","any"]);l_=new Set(["since","before","after","on"]);d_=/\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/;cb=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Qu=new Set(["the","a","an","all","me","us"]),lb=[...go].sort((e,t)=>t.split(" ").length-e.split(" ").length),ub="functions, classes, methods, modules, packages, attributes, variables, or commits",$_=new Set(["in","inside","under"]);E_=new Set(["called","named","about","like","containing","matching","with"]);Wg=new Set(["recent","latest","newest"]);R_=/^git:(.+)$/i;Gg=new WeakMap;A_=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Hg=new WeakMap;Kg={label:3,chain:2,attr:1};O_=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;L_=["imports","calls","callsSymbol","inherits","contains","tests"];M_=/^\d{4}-\d{2}-\d{2}$/;Hs=e=>In(e.slice(0,nt).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>nt?`, \u2026and ${e.length-nt} more`:"");Lu=10;J_=/^(?:the|a|an)\s+/i,Q_=new RegExp(`\\s+(${Object.keys(Qe).join("|")})$`,"i");eT=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,od=new Set(["index","main","app","server","cli","__main__"]),tT=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Jg=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),nT=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>tT.has(t));Qg=8,rT=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);Va=new Set([...he(Object.keys(pe)),...he(Object.keys(Qe)),...he(Object.keys(pn)),...he(Object.keys(at)),...he(ho),...he(Object.keys(zn)),...he(Object.keys(Un)),...he(Object.keys(Xo)),...he(hs),...he(Jr),...he(mo),...he(dn),...he(Cn),...he(ms),...he(Object.keys(Qo)),...he([...pa])]),qu=new Set([...lt,...Yu,...po]),id=new Set(he(ma)),kb=new Set([...id,...qu]),uT=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],dT=[...new Set([...he(Object.keys(pe)),...Object.keys(Qe),...uT])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!lt.has(e)),fT=new Set(["impact","impacts","impacted"]);eb=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,hT=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;wT=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,yT=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,cd=/^(?: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;xT=new RegExp(`^(?:${lb.map(tt).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),ET=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,ST=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;pi=e=>String(e||"").toLowerCase();TT=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;AT=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;IT=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,OT=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;tb=(e,t,n,s)=>s.ambiguous?NT(e,t,n):!!s.miss});function Xs(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
63
  `);return{start:o,end:r,text:a,truncated:i}}async function Rs({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+Cm))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,...Xs(l,s,o,r)}}var qa=M(()=>{Xe();Kt()});function _t(e){return{ok:!0,value:e}}function Tt(e,{detail:t="",term:n=null}={}){if(!pt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Kn(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 Ka(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 ud,NT,pt,dd,YD,Ab,fd,LT,Ln,ld,Ht,XD,Cb=M(()=>{ud="1.1.0",NT="urn:tmct:core",pt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),dd=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),YD=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"}),Ab=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),fd=Object.freeze(Object.values(Ab).flat()),LT=Object.freeze(new Set(Ab.source));Ln="Individual",ld="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",XD=Object.freeze({version:ud,ontology:NT,missReasons:Object.values(pt),edgeKinds:[...dd],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: ${Ln}, candidates: ${Ln}[] }`,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: ${Ln}, out: ${ld}[], incoming: ${ld}[] }`,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: ${Ln}[], attributes: ${Ln}[] }`,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: ${Ln}[], subclasses: ${Ln}[], levels: Array<${Ln}[]> }`,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: ${Ln}[] }`,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: ${ld}[] }`,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: ${Ln}[] }`,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: ${Ln}[] }`,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 PT(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(Ka(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(Ka(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function MT(e,t){for(let n of e.relations)if(vs(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function DT(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Rs({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(`
64
+ `);return s==null||o==null?{lines:l}:{lines:l,...Xs(l,s,o,r)}}var qa=M(()=>{Xe();Kt()});function _t(e){return{ok:!0,value:e}}function Tt(e,{detail:t="",term:n=null}={}){if(!pt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Kn(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 Ka(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 ud,LT,pt,dd,YD,Ab,fd,PT,Ln,ld,Ht,XD,Cb=M(()=>{ud="1.1.0",LT="urn:tmct:core",pt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),dd=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),YD=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"}),Ab=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),fd=Object.freeze(Object.values(Ab).flat()),PT=Object.freeze(new Set(Ab.source));Ln="Individual",ld="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",XD=Object.freeze({version:ud,ontology:LT,missReasons:Object.values(pt),edgeKinds:[...dd],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: ${Ln}, candidates: ${Ln}[] }`,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: ${Ln}, out: ${ld}[], incoming: ${ld}[] }`,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: ${Ln}[], attributes: ${Ln}[] }`,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: ${Ln}[], subclasses: ${Ln}[], levels: Array<${Ln}[]> }`,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: ${Ln}[] }`,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: ${ld}[] }`,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: ${Ln}[] }`,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: ${Ln}[] }`,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 MT(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(Ka(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(Ka(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function FT(e,t){for(let n of e.relations)if(vs(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function zT(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Rs({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
65
  ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(Xs(o,i,a,pd).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(Xs(o,i,a,pd).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=FT;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 Rs({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=Xs(u,c,a.site.end,i);r.push(`
66
+ ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(Xs(o,i,a,pd).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=DT;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 Rs({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=Xs(u,c,a.site.end,i);r.push(`
67
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 Ya(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:ud,capabilities:[...fd],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=mn(e,String(l??""));return u?_t({match:Kn(u),candidates:d.map(Kn)}):Tt(pt.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return Tt(pt.UNRESOLVED_TERM,{term:l});let{out:d,incoming:f}=PT(e,l);return _t({individual:Kn(u),out:d,incoming:f})},members(l){if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let d=_e(e,"contains").filter(m=>m.subject===l),f=[],p=[];for(let m of d){let h=i.get(m.object),g=h?Kn(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(pt.UNRESOLVED_TERM,{term:l});let d=_e(e,"inherits"),f=d.filter($=>$.subject===l).map($=>i.get($.object)?Kn(i.get($.object)):{id:$.object,label:$.objectLabel||$.object,class:"Class",attributes:[]}),p=new Map;for(let $ of d)p.has($.object)||p.set($.object,[]),p.get($.object).push($.subject);let m=new Set([l]),h=[],g=[],b=[l];for(let $=0;$<8&&b.length;$+=1){let y=[],x=[];for(let C of b)for(let v of p.get(C)||[]){if(m.has(v))continue;m.add(v);let j=i.get(v),E=j?Kn(j):{id:v,label:v,class:"Class",attributes:[]};h.push(E),x.push(E),y.push(v)}x.length&&g.push(x),b=y}return _t({bases:f,subclasses:h,levels:g})},exports(l){if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let f=_e(e,"reexports").filter(p=>p.subject===l).map(p=>i.get(p.object)?Kn(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(pt.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(!dd.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let m=MT(e,u),h=_e(e,u).filter(g=>g.subject===l).map(g=>Ka(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(pt.UNRESOLVED_TERM,{term:l});let f=u==null?or(e,d):or(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(pt.UNRESOLVED_TERM,{term:l});let d=Bt(u);if(!c.sourceAccess)return Tt(pt.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(pt.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let f=await Rs({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:pd});return _t({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return Tt(pt.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=mn(e,String(l??""));if(!d)return Tt(pt.UNRESOLVED_TERM,{term:String(l??"")});let f=rr(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}=Ta(f,e,{});let g=ig(f,h);if(!c.sourceAccess)return _t({text:g,tier:m});let b=await DT(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 $=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";f.set($,(f.get($)||0)+1)}let p=new Set(d.map(b=>b.id)),m=new Map;for(let b of _e(e,"imports"))p.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,$)=>$[1]-b[1]).map(([b,$])=>({id:b,label:i.get(b)?.label||b,importers:$})),g=[...f.entries()].sort((b,$)=>$[1]-b[1]);return _t({modules:d.length,packages:g,hubs:h})},untested(){let l=new Set(_e(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(Kn);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(pt.UNRESOLVED_TERM,{term:l});let d=[..._e(e,"touches"),..._e(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=ja,offset:m=0}={}){let h=String(l||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),$=String(f||"").trim().toLowerCase(),y;if(g&&g!=="module"){let C=null;if(b){let j=vu(b);if(j.error)return Tt(pt.UNRESOLVED_TERM,{term:b,detail:j.error});C=j}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{y=Su(e,v,{kind:g,decFilter:$,nameRe:C}).map(j=>j.ind)}catch(j){return Tt(pt.UNRESOLVED_TERM,{term:b,detail:String(j?.message||j)})}}else{let C=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&C.set(v.label,v);y=Mh(e,h).map(({path:v})=>C.get(v)).filter(Boolean)}let x=y.slice(m,m+p).map(Kn);return _t({results:x})},ask(l){if(typeof r!="function")return Tt(pt.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 fd){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=>(Ib(o,l,performance.now()-f,m),m)):(Ib(o,l,performance.now()-f,p),p)})}return c}function Ib(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:zT(s)})}catch{}}function zT(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,pd,FT,Xa=M(()=>{Me();qa();Cb();on=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;pd=200,FT=120});async function gi(e,t){let n=await t.fetchEntities(e),s=Sa(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 Ja=M(()=>{Kt();Me()});function Js({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function ut(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Ie(`${t} is required`);return n}function Lt(e,t,n){let{match:s,candidates:o}=mn(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 bi,mt,et=M(()=>{Kt();Me();bi=200;mt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Lt(s,ut(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Ob(e,{config:t,source:n=er,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 gi(t,n),f=we(we(t.graphFile)),p=Ya(d,{sourceAccess:!0,repoRoot:f,readFile:Ae,tel:o,ask:Ys}),{match:m}=Lt(p,r,"symbol"),h=rr(d,m),g,b,$=!1;a||i==="min"?(g="TINY",b=yo("TINY")):l||i==="full"?(g="FULL",b=yo("FULL"),$=!0):{tier:g,mask:b,topup:$}=Ta(h,d,{untuned:c}),s&&!l&&(b=og(b));let y=null;if(h.moduleLabel)try{({lines:y}=await Rs({readFile:Ae,repoRoot:f,path:h.moduleLabel}))}catch{y=null}let x=j=>y&&y[j-1]!=null?y[j-1].trim():"",C=(j,E)=>Xs(y,j,E,bi).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&&y){let{start:j,end:E}=h.anchor.site;v.push(`
68
+ `)}function Ya(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:ud,capabilities:[...fd],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=mn(e,String(l??""));return u?_t({match:Kn(u),candidates:d.map(Kn)}):Tt(pt.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return Tt(pt.UNRESOLVED_TERM,{term:l});let{out:d,incoming:f}=MT(e,l);return _t({individual:Kn(u),out:d,incoming:f})},members(l){if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let d=_e(e,"contains").filter(m=>m.subject===l),f=[],p=[];for(let m of d){let h=i.get(m.object),g=h?Kn(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(pt.UNRESOLVED_TERM,{term:l});let d=_e(e,"inherits"),f=d.filter($=>$.subject===l).map($=>i.get($.object)?Kn(i.get($.object)):{id:$.object,label:$.objectLabel||$.object,class:"Class",attributes:[]}),p=new Map;for(let $ of d)p.has($.object)||p.set($.object,[]),p.get($.object).push($.subject);let m=new Set([l]),h=[],g=[],b=[l];for(let $=0;$<8&&b.length;$+=1){let y=[],x=[];for(let C of b)for(let v of p.get(C)||[]){if(m.has(v))continue;m.add(v);let j=i.get(v),E=j?Kn(j):{id:v,label:v,class:"Class",attributes:[]};h.push(E),x.push(E),y.push(v)}x.length&&g.push(x),b=y}return _t({bases:f,subclasses:h,levels:g})},exports(l){if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let f=_e(e,"reexports").filter(p=>p.subject===l).map(p=>i.get(p.object)?Kn(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(pt.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(!dd.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return Tt(pt.UNRESOLVED_TERM,{term:l});let m=FT(e,u),h=_e(e,u).filter(g=>g.subject===l).map(g=>Ka(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(pt.UNRESOLVED_TERM,{term:l});let f=u==null?or(e,d):or(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(pt.UNRESOLVED_TERM,{term:l});let d=Bt(u);if(!c.sourceAccess)return Tt(pt.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(pt.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let f=await Rs({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:pd});return _t({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return Tt(pt.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=mn(e,String(l??""));if(!d)return Tt(pt.UNRESOLVED_TERM,{term:String(l??"")});let f=rr(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}=Ta(f,e,{});let g=ig(f,h);if(!c.sourceAccess)return _t({text:g,tier:m});let b=await zT(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 $=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";f.set($,(f.get($)||0)+1)}let p=new Set(d.map(b=>b.id)),m=new Map;for(let b of _e(e,"imports"))p.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,$)=>$[1]-b[1]).map(([b,$])=>({id:b,label:i.get(b)?.label||b,importers:$})),g=[...f.entries()].sort((b,$)=>$[1]-b[1]);return _t({modules:d.length,packages:g,hubs:h})},untested(){let l=new Set(_e(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(Kn);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(pt.UNRESOLVED_TERM,{term:l});let d=[..._e(e,"touches"),..._e(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=ja,offset:m=0}={}){let h=String(l||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),$=String(f||"").trim().toLowerCase(),y;if(g&&g!=="module"){let C=null;if(b){let j=vu(b);if(j.error)return Tt(pt.UNRESOLVED_TERM,{term:b,detail:j.error});C=j}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{y=Su(e,v,{kind:g,decFilter:$,nameRe:C}).map(j=>j.ind)}catch(j){return Tt(pt.UNRESOLVED_TERM,{term:b,detail:String(j?.message||j)})}}else{let C=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&C.set(v.label,v);y=Mh(e,h).map(({path:v})=>C.get(v)).filter(Boolean)}let x=y.slice(m,m+p).map(Kn);return _t({results:x})},ask(l){if(typeof r!="function")return Tt(pt.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 fd){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=>(Ib(o,l,performance.now()-f,m),m)):(Ib(o,l,performance.now()-f,p),p)})}return c}function Ib(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:UT(s)})}catch{}}function UT(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,pd,DT,Xa=M(()=>{Me();qa();Cb();on=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;pd=200,DT=120});async function gi(e,t){let n=await t.fetchEntities(e),s=Sa(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 Ja=M(()=>{Kt();Me()});function Js({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function ut(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Ie(`${t} is required`);return n}function Lt(e,t,n){let{match:s,candidates:o}=mn(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 bi,mt,et=M(()=>{Kt();Me();bi=200;mt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Lt(s,ut(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Ob(e,{config:t,source:n=er,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 gi(t,n),f=we(we(t.graphFile)),p=Ya(d,{sourceAccess:!0,repoRoot:f,readFile:Ae,tel:o,ask:Ys}),{match:m}=Lt(p,r,"symbol"),h=rr(d,m),g,b,$=!1;a||i==="min"?(g="TINY",b=yo("TINY")):l||i==="full"?(g="FULL",b=yo("FULL"),$=!0):{tier:g,mask:b,topup:$}=Ta(h,d,{untuned:c}),s&&!l&&(b=og(b));let y=null;if(h.moduleLabel)try{({lines:y}=await Rs({readFile:Ae,repoRoot:f,path:h.moduleLabel}))}catch{y=null}let x=j=>y&&y[j-1]!=null?y[j-1].trim():"",C=(j,E)=>Xs(y,j,E,bi).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&&y){let{start:j,end:E}=h.anchor.site;v.push(`
70
70
  ## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${j}-${E}`),v.push(C(j,E)),h.callHint&&v.push(h.callHint)}if(b.registration&&h.globals.length){v.push(`
71
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&&y){let{start:j,end:E}=h.exemplar.site,S=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";v.push(`
72
72
  ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${S} @ ${h.moduleLabel}:${j}-${E}`),v.push(C(j,E)),h.callHint&&v.push(h.callHint)}if(b.inlinedCallees&&h.calleeBodies.length&&y){let j=120;for(let E of h.calleeBodies){if(j<=0)break;let S=E.site.start,w=E.site.path===h.moduleLabel&&y?y:await Rs({readFile:Ae,repoRoot:f,path:E.site.path}).then(O=>O.lines).catch(()=>null);if(!w)continue;let T=Xs(w,S,E.site.end,j);v.push(`
@@ -82,29 +82,29 @@ ${b}`:g,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toL
82
82
  ## covering tests: ${h.tests.join(", ")}`),b.cochange&&h.cochange&&h.cochange.length&&v.push(`
83
83
  ## usually changed together (consider editing these too): ${h.cochange.map(j=>`${j.label} (\xD7${j.weight})`).join(", ")}`),v.push(`
84
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:$}}async function md(e,{config:t,source:n,tel:s}){return(await Ob(e,{config:t,source:n,tel:s})).text}var hd=M(()=>{Nt();Xe();Kt();qa();Zr();Me();qn();Xa();Ja();et();md.ownsGraphLoad=!0});function Nb(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"symbol"),"symbol");return rg(rr(t,s))}var Lb=M(()=>{Me();et()});function Qa(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 wi(e){return Qa(e).toString(16).padStart(8,"0")}function Za(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 y=0;y<16;y+=1)i[y]=o.getUint32(u+y*4);for(let y=16;y<64;y+=1){let x=a(i[y-15],7)^a(i[y-15],18)^i[y-15]>>>3,C=a(i[y-2],17)^a(i[y-2],19)^i[y-2]>>>10;i[y]=i[y-16]+x+i[y-7]+C>>>0}let[d,f,p,m,h,g,b,$]=r;for(let y=0;y<64;y+=1){let x=a(h,6)^a(h,11)^a(h,25),C=h&g^~h&b,v=$+x+C+UT[y]+i[y]>>>0,j=a(d,2)^a(d,13)^a(d,22),E=d&f^d&p^f&p,S=j+E>>>0;$=b,b=g,g=h,h=m+v>>>0,m=p,p=f,f=d,d=v+S>>>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]+$>>>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 BT(e,t){let n=Za(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function H(e){let t=_s(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 Yn(e){let t=_s(e);return GT.get(t)??t}function $e(e,t,n){return jo(H(e),Yn(t),H(n))}var UT,WT,_s,GT,jo,ot=M(()=>{UT=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]);WT=2e3,_s=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,WT);GT=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:${BT(`${e}\0${t}\0${n}`,8)}`});var rn={};Ot(rn,{CARDINALITY_RULE_CONFIDENCE:()=>XT,CAX_DW_RULE:()=>bd,CAX_DW_RULE_CONFIDENCE:()=>yd,CAX_MAXC0_RULE_CONFIDENCE:()=>QT,CLS_SVF1_RULE:()=>$d,CLS_SVF1_RULE_CONFIDENCE:()=>xd,DEFAULT_MAX_ENVIRONMENTS:()=>wr,DISJOINT_PREDICATE:()=>gr,ENTAILED_DISJOINT_PROVENANCE:()=>wd,ENTAILED_PROVENANCE:()=>Fb,ENTAILED_SCM_SVF_PROVENANCE:()=>kd,ENTAILED_SVF1_PROVENANCE:()=>vd,ENTAILED_TYPE_PROVENANCE:()=>zb,ON_PROPERTY_PREDICATE:()=>xn,SCM_SVF_RULE:()=>jd,SCM_SVF_RULE_CONFIDENCE:()=>Rd,SOME_VALUES_FROM_PREDICATE:()=>En,SUBCLASS_PREDICATE:()=>ze,TYPE_PREDICATE:()=>Pt,buildCardinalityRestrictions:()=>Sd,buildRelevanceFrontier:()=>gd,buildSubClassSuccessors:()=>ec,deriveDisjointViolations:()=>Gb,deriveSomeValuesFromApplication:()=>Vb,deriveSomeValuesFromSubsumption:()=>Hb,deriveSubClassClosure:()=>Ub,deriveSubClassClosureDelta:()=>Bb,deriveTypePropagation:()=>Wb,entailedTrustFrom:()=>HT,findConsistencyViolations:()=>eA,findIsaChain:()=>_d,proveCardinalityAtLeast:()=>JT,proveMaxCardinalityZeroDenial:()=>ZT,retractSubClassOf:()=>oA,syllogise:()=>Kb});function Pb(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 HT(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 Ts(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=H(s);o&&n.add(o)}return n.size?n:null}function Ub(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}${Ue}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:Ts(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 $=`${p}${Ue}${b}`;o.has($)||l.has($)||a(p,h,b)&&d.push([p,h,b,$])}}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 Bb(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}${Ue}${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}${Ue}${h}`;l.has(g)||(l.add(g),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:Ts(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=(y,x,C)=>{if(y===C)return;let v=`${y}${Ue}${C}`;r.has(v)||p.has(v)||d(y,x,C)&&h.push([y,x,C,v])};for(let[y,x]of c){for(let C of i.get(x)||[])g(y,x,C);for(let C of a.get(y)||[])g(C,y,x)}if(!h.length)break;h.sort((y,x)=>y[0].localeCompare(x[0])||y[2].localeCompare(x[2])||y[1].localeCompare(x[1]));let b=!1,$=[];for(let[y,x,C,v]of h)if(!p.has(v)){if(f.length>=s)break;p.add(v),f.push({subject:y,object:C,via:x}),i.has(y)||i.set(y,new Set),i.get(y).add(C),a.has(C)||a.set(C,new Set),a.get(C).add(y),$.push([y,C]),b=!0}if(f.length>=s||!b)break;c=$}return f}function Xn(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 qT(e){return Xn((e||[]).map(([t,n])=>[n,t]))}function gd(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(Qs(l.predicate)?n.push([l.subject,l.object]):Ro(l.predicate)?s.push([l.subject,l.object]):br(l.predicate)?o.set(l.subject,l.object):$i(l.predicate)&&r.set(l.subject,l.object));let i=qT(n),a=new Set;for(let l of t||[]){let u=H(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 Wb(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Xn(t),i=new Set,a=new Set;for(let[p,m]of o||[])p&&m&&i.add(`${p}${Ue}${m}`);let c=s instanceof Set?s.size?s:null:Ts(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}${Ue}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===p)continue;let b=`${p}${Ue}${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 Gb(e,t,n,{budget:s=50,focus:o=null}={}){let r=Xn(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${Ue}${h}`),a.add(`${h}${Ue}${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:Ts(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}${Ue}${h}`;if(!c.has(g)){c.add(g);for(let b of[h,...r(h)]){let $=i.get(b);if($)for(let y of $){if(y===m)continue;let x=`${m}${Ue}${y}`;a.has(x)||u(m,h,y)&&d.push([m,h,b,y,x])}}}}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,$]of d)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:m,object:b,viaType:h,viaClass:g})}return f}function Vb(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Xn(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${Ue}${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}${Ue}${b}`),l.has(g)||l.set(g,new Set),l.get(g).add(b));let u=r instanceof Set?r.size?r:null:Ts(r),d=(g,b,$)=>!u||u.has(g)||u.has(b)||u.has($),f=new Set,p=[];for(let[g,b,$]of e||[]){if(!g||!b||!$)continue;let y=H(b),x=`${g}${Ue}${y}${Ue}${$}`;if(f.has(x))continue;f.add(x);let C=l.get($);if(C)for(let v of C)for(let j of[v,...i(v)]){let E=a.get(`${y}${Ue}${j}`);if(E)for(let S of E){if(g===S)continue;let A=`${g}${Ue}${S}`;c.has(A)||d(g,$,S)&&p.push([g,b,y,$,v,j,S,A])}}}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,x,C,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:$,viaValue:y,viaType:x,viaTarget:C})}return m}function Sd(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(br(r.predicate))t.set(r.subject,r.object);else if(VT(r.predicate))s.set(r.subject,r.object);else{let i=YT[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)!==KT)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 Hb(e,t,{budget:n=50,focus:s=null}={}){let o=Xn(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=H(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}${Ue}${p}`);let a=s instanceof Set?s.size?s:null:Ts(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}${Ue}${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 qb(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Xn(e),a=r instanceof Set?r.size?r:null:Ts(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 JT(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=qb(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 ZT(e,t,n,s,o={}){if(!s)return null;let r=qb(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 eA(e,t,n,{budget:s=50,focus:o=null}={}){let r=Xn(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:Ts(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]],x=[$,...r($)],C=[y,...r(y)],v=null;for(let E of x){let S=i.get(E);if(S){for(let A of C)if(S.has(A)){v=[E,A];break}if(v)break}}if(!v)continue;let j=`${p}${Ue}${$}${Ue}${y}`;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 Kb(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=wr,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=Pb(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await c(e),p=l(f),m=p.filter(I=>Qs(I.predicate)).map(I=>[I.subject,I.object]),h=p.filter(I=>Ro(I.predicate)).map(I=>[I.subject,I.object]),g=p.filter(I=>ko(I.predicate)).map(I=>[I.subject,I.object]),b=new Map,$=new Map,y=[];for(let I of p){let fe=String(I.predicate||"").trim().toLowerCase();br(I.predicate)?b.set(I.subject,I.object):$i(I.predicate)?$.set(I.subject,I.object):Ed.has(fe)||y.push([I.subject,I.predicate,I.object])}let x=[];for(let[I,fe]of b){let Ce=$.get(I);Ce&&x.push({restriction:I,property:fe,target:Ce})}let C=Ts(s),v=o&&C?gd(p,[...C]):C,j=v===null&&d?await a.loadSyllogiseState(e):null,E=new Set(p.map(I=>I.id)),S=Array.isArray(j?.factIds)?j.factIds.filter(I=>!E.has(I)):[],A=j&&Array.isArray(j.factIds)&&!S.length&&!i?"delta":"full",w=A==="delta"?new Set(j.factIds):null,T=A==="delta"?p.filter(I=>!w.has(I.id)):p,O=T.length,R=new Map;for(let I of p)R.set(`${I.subject}${Ue}${I.predicate}${Ue}${I.object}`,I.trust);let k=(I,fe,Ce)=>R.get(`${I}${Ue}${fe}${Ue}${Ce}`),L=(I,fe,Ce)=>R.has(`${I}${Ue}${fe}${Ue}${Ce}`),B=I=>I.filter(fe=>typeof fe=="number"),V=A==="delta"&&!T.length,K=A==="delta"?T.filter(I=>Qs(I.predicate)).map(I=>[I.subject,I.object]):[],Y=A==="delta"?K.length?Bb(m,K,{depth:t,budget:n,focus:v}):[]:Ub(m,{depth:t,budget:n,focus:v}),_=m.concat(Y.map(I=>[I.subject,I.object])),P=v,W=null;if(A==="delta"&&!V){let I=p.concat(Y.map(Ce=>({subject:Ce.subject,predicate:ze,object:Ce.object}))),fe=[];for(let Ce of T)fe.push(Ce.subject,Ce.object);W=gd(I,fe),P=W}let F=I=>!W||W.has(I),z=W?h.filter(([I,fe])=>F(I)||F(fe)):h,N=new Set;if(W)for(let I of T)ko(I.predicate)&&(N.add(I.subject),N.add(I.object));let D=W&&N.size?Xn(_):null,U=W?h.filter(([I,fe])=>F(I)||F(fe)||D&&[...D(fe)].some(Ce=>N.has(Ce))):h,G=new Set;if(W){for(let I of T)if(br(I.predicate)||$i(I.predicate)){let fe=b.get(I.subject);fe&&G.add(H(fe))}}let Z=W?y.filter(([I,fe,Ce])=>F(I)||F(Ce)||G.has(H(fe))):y,re=Math.max(0,n-Y.length),ie=re>0&&!V?Wb(z,_,{budget:re,focus:P,presentTypeEdges:h}):[],J=Math.max(0,n-Y.length-ie.length),ee=J>0&&!V?Gb(U,_,g,{budget:J,focus:P}):[],te=Math.max(0,n-Y.length-ie.length-ee.length),Q=te>0&&x.length&&!V?Vb(Z,h,_,x,{budget:te,focus:P}):[],ce=Math.max(0,n-Y.length-ie.length-ee.length-Q.length),ke=ce>0&&x.length>1&&!V?Hb(x,_,{budget:ce,focus:P}):[],Re=new Map(x.map(I=>[I.restriction,I])),de=[...Y.map(I=>({subject:I.subject,predicate:ze,object:I.object,provenance:Fb,justification:[[$e(I.subject,ze,I.via),$e(I.via,ze,I.object)]]})),...ie.map(I=>({subject:I.subject,predicate:Pt,object:I.object,provenance:zb,justification:[[$e(I.subject,Pt,I.via),$e(I.via,ze,I.object)]]})),...ee.map(I=>{let fe=L(I.viaClass,gr,I.object),[Ce,fs]=fe?[I.viaClass,I.object]:[I.object,I.viaClass],ps=B([k(I.subject,Pt,I.viaType),k(Ce,gr,fs),...I.viaClass!==I.viaType?[k(I.viaType,ze,I.viaClass)]:[]]);return{subject:I.subject,predicate:gr,object:I.object,provenance:wd,justification:[[$e(I.subject,Pt,I.viaType),$e(Ce,gr,fs),...I.viaClass!==I.viaType?[$e(I.viaType,ze,I.viaClass)]:[]]],...ps.length?{premiseTrusts:ps,ruleConfidence:yd}:{}}}),...Q.map(I=>{let fe=B([k(I.subject,I.viaProperty,I.viaValue),k(I.viaValue,Pt,I.viaType),k(I.object,xn,I.viaPropertyKey),k(I.object,En,I.viaTarget),...I.viaType!==I.viaTarget?[k(I.viaType,ze,I.viaTarget)]:[]]);return{subject:I.subject,predicate:Pt,object:I.object,provenance:vd,justification:[[$e(I.subject,I.viaProperty,I.viaValue),$e(I.viaValue,Pt,I.viaType),$e(I.object,xn,I.viaPropertyKey),$e(I.object,En,I.viaTarget),...I.viaType!==I.viaTarget?[$e(I.viaType,ze,I.viaTarget)]:[]]],...fe.length?{premiseTrusts:fe,ruleConfidence:xd}:{}}}),...ke.map(I=>{let fe=Re.get(I.subject),Ce=Re.get(I.object),fs=B([fe&&k(I.subject,xn,fe.property),k(I.subject,En,I.viaY1),Ce&&k(I.object,xn,Ce.property),k(I.object,En,I.viaY2),k(I.viaY1,ze,I.viaY2)]);return{subject:I.subject,predicate:ze,object:I.object,provenance:kd,justification:[[...fe?[$e(I.subject,xn,fe.property)]:[],$e(I.subject,En,I.viaY1),...Ce?[$e(I.object,xn,Ce.property)]:[],$e(I.object,En,I.viaY2),$e(I.viaY1,ze,I.viaY2)]],...fs.length?{premiseTrusts:fs,ruleConfidence:Rd}:{}}})],Ge=de.map(I=>({id:$e(I.subject,I.predicate,I.object),subject:I.subject,predicate:I.predicate,object:I.object,environments:I.justification,write:I})),Ve=Xb(p.concat(Ge.map(I=>({id:I.id,subject:I.subject,predicate:I.predicate,object:I.object})))),ae=new Map(p.map(I=>[I.id,I])),Oe=I=>Qs(I)||Ro(I)||ko(I),ue=I=>A!=="delta"||W!==null&&(W.has(I.subject)||W.has(I.object)),Ee=p.filter(I=>Oe(I.predicate)&&Yb(I.provenance)&&yi(I).length<r&&ue(I)).map(I=>({id:I.id,subject:I.subject,predicate:I.predicate,object:I.object,environments:yi(I),provenance:I.provenance})),me=[...Ge,...Ee].sort((I,fe)=>I.subject.localeCompare(fe.subject)||I.predicate.localeCompare(fe.predicate)||I.object.localeCompare(fe.object)),se=0,Ne=!1,Je=0;for(let I of me){if(Je>=n){Ne=!0;break}Je+=1;let fe=Ve(I,{maxEnvironments:r+1}),{kept:Ce,truncated:fs}=nA(I.environments,fe,r);if(fs&&(Ne=!0),!(Ce.length<=I.environments.length)){if(se+=Ce.length-I.environments.length,I.write){I.write.justification=Ce;continue}de.push({subject:I.subject,predicate:I.predicate,object:I.object,justification:Ce,...Jb(I.provenance,Ce,ps=>ae.get(ps)?.trust)||{}})}}let{ids:Be}=await u(e,de),gt=[],Ct=0;for(let I of Y)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.via,rule:Mb}),Ct+=1;for(let I of ie)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.via,rule:Db}),Ct+=1;for(let I of ee)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaClass,rule:bd}),Ct+=1;for(let I of Q)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaValue,rule:$d}),Ct+=1;for(let I of ke)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaY1,rule:jd}),Ct+=1;let ca=gt.length>=n;if(v===null&&d&&!ca){let I=new Set(E);for(let fe of Be)I.add(fe);await a.saveSyllogiseState(e,{version:1,factIds:[...I].sort(),completedAt:new Date().toISOString()})}return{derived:gt,count:gt.length,budget:n,depth:t,truncated:ca,mode:A,deltaSize:O,environmentsAdded:se,alternatesTruncated:Ne}}function Yb(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function tA(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();Qs(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)):br(u.predicate)?o.set(u.subject,u.object):$i(u.predicate)?r.set(u.subject,u.object):Ed.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([H(u.predicate),u.object]))}let a=Xn(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:H(d),target:f}:null};return u=>{if(Qs(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 Xb(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();Qs(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}${Ue}${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)):br(p.predicate)?a.set(p.subject,p.object):$i(p.predicate)?c.set(p.subject,p.object):Ed.has(m)||(l.has(p.subject)||l.set(p.subject,[]),l.get(p.subject).push([p.predicate,p.object]))}let u=Xn(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:H(m),target:h}:null};return(p,{maxEnvironments:m=wr}={})=>{let h=[],g=new Set,b=$=>{if(h.length>=m||p.id&&$.includes(p.id)||!$.every(x=>t.has(x)))return;let y=[...$].sort().join(" ");g.has(y)||(g.add(y),h.push($))};if(Qs(p.predicate)){for(let $ of[...d(p.subject)].sort()){if(h.length>=m)break;$===p.subject||$===p.object||d($).has(p.object)&&b([$e(p.subject,ze,$),$e($,ze,p.object)])}if(h.length<m){let $=f(p.subject),y=f(p.object);$&&y&&$.propertyKey===y.propertyKey&&$.target!==y.target&&d($.target).has(y.target)&&b([$e(p.subject,xn,$.property),$e(p.subject,En,$.target),$e(p.object,xn,y.property),$e(p.object,En,y.target),$e($.target,ze,y.target)])}return h}if(Ro(p.predicate)){for(let y of[...o.get(p.subject)||[]].sort()){if(h.length>=m)break;y!==p.object&&d(y).has(p.object)&&b([$e(p.subject,Pt,y),$e(y,ze,p.object)])}let $=f(p.object);if($){let y=[...l.get(p.subject)||[]].filter(([x])=>H(x)===$.propertyKey).sort((x,C)=>x[0].localeCompare(C[0])||x[1].localeCompare(C[1]));for(let[x,C]of y){if(h.length>=m)break;for(let v of[...o.get(C)||[]].sort()){if(h.length>=m)break;v!==$.target&&!d(v).has($.target)||b([$e(p.subject,x,C),$e(C,Pt,v),$e(p.object,xn,$.propertyKey),$e(p.object,En,$.target),...v!==$.target?[$e(v,ze,$.target)]:[]])}}}return h}if(ko(p.predicate)){let $=[];for(let y of o.get(p.subject)||[])for(let x of[y,...u(y)])(i.get(x)||new Set).has(p.object)&&$.push([y,x]);$.sort((y,x)=>y[0].localeCompare(x[0])||y[1].localeCompare(x[1]));for(let[y,x]of $){if(h.length>=m)break;let C=r.has(`${x}${Ue}${p.object}`),[v,j]=C?[x,p.object]:[p.object,x];b([$e(p.subject,Pt,y),$e(v,gr,j),...x!==y?[$e(y,ze,x)]:[]])}return h}return h}}function nA(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 Jb(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=sA.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 oA(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=wr,store:i,sourceTags:a=[],predicate:c=ze}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Pb(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=H(t),g=H(n),b=$e(h,c,g),$=await l(e),y=u($),x=new Map(y.map(L=>[L.id,L]));if(!x.has(b))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let C=x.get(b).sourceIds||[],v=m.map(L=>p(b,L).slice(b.length+1)),j=m.length?C.filter(L=>v.includes(L)):[],E=!m.length||j.length>0;if(m.length&&!E)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=m.length>0&&j.length<C.length,A=new Set([b]),w=[b],T=new Map,O=!1;if(!S){let L=y.filter(Y=>yi(Y).length&&Yb(Y.provenance)),B=new Map;for(let Y of L)for(let _ of yi(Y))for(let P of _)B.has(P)||B.set(P,new Set),B.get(P).add(Y.id);let V=0,K=[b];for(;V<o;V+=1){let Y=new Set;for(let U of K)for(let G of B.get(U)||[])A.has(G)||Y.add(G);let _=[...Y].map(U=>x.get(U)).sort((U,G)=>U.subject.localeCompare(G.subject)||U.predicate.localeCompare(G.predicate)||U.object.localeCompare(G.object));if(!_.length)break;let P=y.filter(U=>!A.has(U.id)&&!Y.has(U.id)),W=new Set(P.map(U=>U.id)),F=Xb(P),z=tA(P),N=!1,D=!1;K=[];for(let U of _){if(A.size>=s){D=!0;break}let G=yi(U),Z=G.filter(ie=>ie.every(J=>W.has(J)));if(Z.length){Z.length!==G.length&&T.set(U.id,Z);continue}let re=F(U,{maxEnvironments:r});if(re.length){T.set(U.id,re);continue}z(U)||(A.add(U.id),w.push(U.id),K.push(U.id),N=!0)}if(D){O=!0;break}if(!N)break}!O&&V>=o&&(O=L.some(Y=>!A.has(Y.id)&&Y.justification.some(_=>A.has(_))))}let R=m.length?[...j.map(L=>`${b}@${L}`),...w.slice(1)]:w,{removed:k}=await d(e,R);if(f){let L=[...T.entries()].filter(([B])=>!A.has(B)).sort((B,V)=>B[0].localeCompare(V[0])).map(([B,V])=>{let K=x.get(B);return{subject:K.subject,predicate:K.predicate,object:K.object,justification:V,...Jb(K.provenance,V,Y=>x.get(Y)?.trust)||{}}});L.length&&await f(e,L)}return{retracted:k,count:k.length,budget:s,depth:o,truncated:O,found:!0,...m.length?{ownRecord:!0,stillStands:S}:{}}}function ec(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:ec(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:ze,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:ze,object:p}]})}a=u}return null}var ze,Mb,Fb,Pt,Db,zb,gr,bd,wd,yd,xn,En,$d,vd,xd,wr,Ue,Qs,Ro,ko,br,$i,VT,Ed,KT,YT,jd,kd,Rd,XT,QT,yi,sA,At=M(()=>{ot();ze="rdfs:subClassOf",Mb="subClassOf",Fb=`entailed:${Mb}`,Pt="rdf:type",Db="type",zb=`entailed:${Db}`,gr="owl:disjointWith",bd="disjointWith",wd=`entailed:${bd}`,yd=.95,xn="owl:onProperty",En="owl:someValuesFrom",$d="someValuesFrom",vd=`entailed:${$d}`,xd=.95,wr=4,Ue="\u241F",Qs=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",Ro=e=>String(e||"").trim().toLowerCase()==="rdf:type",ko=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",br=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",$i=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",VT=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Ed=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);KT="has",YT={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};jd="someValuesFromSubsumption",kd=`entailed:${jd}`,Rd=.95;XT=.95;QT=.95;yi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);sA=new Map([[wd,yd],[vd,xd],[kd,Rd]])});function xr(e){let t=String(e||""),n=Qb.get(t);return n||(t.startsWith(Td)?yr+t.slice(Td.length):t)}function Zb(e){let t=String(e||""),n=rA.get(t);return n||(t.startsWith(yr)?Td+t.slice(yr.length):null)}function nw(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 sc(e,t,n,{maxHops:s=3}={}){let o=vr(e),r=vr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=tw(i),l=i.filter(b=>(b.predicate===nc||b.predicate===$r)&&r.has(b.object)),u=[];for(let b of l){let $=b.predicate===$r?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:$,hops:0,chain:null});continue}let y=nw(o,b.subject,a,c,s);y&&y.length&&u.push({fact:b,polarity:$,hops:y.length,chain:y})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Cd(o,r,i,{maxHops:s})};u.sort((b,$)=>b.hops-$.hops||($.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 Cd(e,t,n,{maxHops:s=3}={}){let o=vr(e),r=vr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===ze||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===nc||b.predicate===$r));return g?{name:h,polarity:g.predicate===$r?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:m}=tw(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:nw(o,l,p,m,s)}}function Id(e,t,{exclude:n=[],maxHops:s=3}={}){let o=vr(e),r=vr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==nc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),sc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(iA)}var yr,Td,tc,Qb,rA,ew,nc,$r,Ad,iA,vr,tw,oc=M(()=>{At();yr="mgxneg:",Td="mgx:",tc="mgxneg:subClassOf",Qb=new Map([[ze,tc]]),rA=new Map([...Qb].map(([e,t])=>[t,e]));ew=e=>String(e||"").startsWith(yr),nc="mgx:capableOf",$r=xr(nc),Ad=6,iA=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),vr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),tw=e=>{let t=e.filter(s=>s.predicate===Pt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===ze).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:ec(n)}}});function rc(e){let t=String(e||"");return Ld.has(t)?Od:cA.has(t)||lA.test(t)?vi:uA.has(t)?sw:Nd}function dA(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(ih.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function fA(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(dA(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Pd(e,t){let n=t===sw;if(!n&&t!==vi)return null;let s=(e||[]).map(r=>({row:r,at:fA(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 Od,vi,sw,Nd,aA,Ld,cA,lA,uA,ow=M(()=>{oc();Vn();Od="merge",vi="latest-observation-wins",sw="first-claim-wins",Nd="contradiction",aA=["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"],Ld=new Set(aA.flatMap(e=>[e,xr(e)])),cA=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"]),lA=/^mgx:has-exit-([a-z]+)$/,uA=new Set(["mgx:playedBy"])});function Si(e){let t=String(e||""),n=t.indexOf(ic);return n<0?"":t.slice(n+ic.length)}function bA(e){let t=1,n=0;for(let s of e)t*=1-hA(s),n+=1;return n?gA(Math.min(1,1-t)):0}function lw(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 fw(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 pw(e,t="",n=""){let s=t,o=n;for(let r of e)s=uw(s,r.assertedAt),o=dw(o,r.assertedAt);return{earliest:s,latest:o}}function zd({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?bA(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:pA,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===Er?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:Ei,key:"rollupCount",value:String(c.length)},{prop:Jn,key:"rollupEarliest",value:r},{prop:Qn,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:Sr,key:"rollupPrior",value:String(l)}]]}}function mw({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(fw).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=pw(i,Mt(s,Jn),Mt(s,Qn));return{rollup:zd({id:Md(e,t),sourceKey:`rollup:${t}`,template:Ud(i[0].record||s),idsProp:Er,ids:[...lc(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 hw({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(fw),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=pw(i,Mt(s,Jn),Mt(s,Qn));return{rollup:zd({id:Fd(e,t),sourceKey:t,template:Ud(i[0].record||s),idsProp:xi,ids:[...mA(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Bd(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Zs(s),r=o?Er:xi,i=a=>Dd(Mt(a,r));return zd({id:s,sourceKey:Mt(e,"mgx:sourceId")||Mt(t,"mgx:sourceId"),template:Ud(Mt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:uw(Mt(e,Jn),Mt(t,Jn)),latest:dw(Mt(e,Qn),Mt(t,Qn)),priorFor:o?n:void 0})}function gw(e,t){if(!t)return!1;for(let n of e||[])if(lc(n).includes(t))return!0;return!1}var pA,rw,iw,ac,aw,Er,xi,Ei,Jn,Qn,Sr,ic,cw,Md,Fd,Zs,jr,cc,Mt,Dd,lc,mA,hA,gA,uw,dw,Ud,Wd=M(()=>{pA="Fact",rw=64,iw=8,ac=8,aw=2,Er="mgx:rollupSourceIds",xi="mgx:rollupRecordIds",Ei="mgx:rollupCount",Jn="mgx:rollupEarliest",Qn="mgx:rollupLatest",Sr="mgx:rollupPrior",ic="@rollup:",cw="#rollup",Md=(e,t)=>`${e}${ic}${t}`,Fd=(e,t)=>`${e}@${t}${cw}`,Zs=e=>String(e||"").includes(ic),jr=e=>String(e||"").endsWith(cw),cc=e=>Zs(e)||jr(e);Mt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Dd=e=>String(e||"").split(" ").filter(Boolean),lc=e=>Dd(Mt(e,Er)),mA=e=>Dd(Mt(e,xi)),hA=e=>Math.max(0,Math.min(1,Number(e)||0)),gA=e=>Number(e.toFixed(6));uw=(e,t)=>lw(e,t,Math.min),dw=(e,t)=>lw(e,t,Math.max);Ud=e=>({label:e?.label||"",subject:Mt(e,"rdf:subject"),predicate:Mt(e,"rdf:predicate"),object:Mt(e,"rdf:object")})});function qd(e){let t=String(e||"");return Hd(t)?t.slice(0,-pc.length):""}function bw(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 Kd({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:hn,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:dc,key:"retractedRecordIds",value:i.join(" ")},{prop:Gd,key:"retractedCount",value:String(i.length)},{prop:fc,key:"retractedAt",value:o||""},...a.length?[{prop:ji,key:"provenance",value:a.join(" | ")}]:[]]}}function yw({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?Kd({id:Vd(e,t),sourceId:t,template:r||ww(o),ids:a,retractedAt:bw(To(o),s),tags:[...ki(Sn(o,ji)),...ki(i)]}):null}function $w(e,t){let n=ww(Sn(e,"rdf:subject")?e:t);return Kd({id:e?.id||t?.id,sourceId:Sn(e,"mgx:sourceId")||Sn(t,"mgx:sourceId"),template:n,ids:[..._o(e),..._o(t)],retractedAt:bw(To(e),To(t)),tags:[...ki(Sn(e,ji)),...ki(Sn(t,ji))]})}function yA(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function $A(e,t,n=""){return!e||!t||!_o(e).includes(t)?!1:yA(n,To(e))}function mc(e,t,n=""){for(let s of e||[])if($A(s,t,n))return!0;return!1}function vA(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function xA(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 hc(e){let t=qd(e?.id);return t?{id:e.id,subject:t,predicate:uc,object:vA(To(e),_o(e)),provenance:Sn(e,ji)}:null}function gc(e){if(!e||e.predicate!==uc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=xA(e.object);return o.length?Kd({id:`${t}${pc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ki(e.provenance)}):null}var hn,uc,dc,fc,Gd,pc,ji,Vd,Hd,Sn,wA,ki,_o,To,ww,Yd=M(()=>{hn="Retraction",uc="mgx:retracted",dc="mgx:retractedRecordIds",fc="mgx:retractedAt",Gd="mgx:retractedCount",pc="#retracted",ji="mgx:factProvenance",Vd=(e,t)=>`${e}@${t}${pc}`,Hd=e=>String(e||"").endsWith(pc);Sn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",wA=e=>String(e||"").split(" ").filter(Boolean),ki=e=>String(e||"").split(" | ").filter(Boolean),_o=e=>wA(Sn(e,dc)),To=e=>Sn(e,fc);ww=e=>({label:e?.label||"",subject:Sn(e,"rdf:subject"),predicate:Sn(e,"rdf:predicate"),object:Sn(e,"rdf:object")})});var EA,SA,jA,kA,Xd,Cz,vw=M(()=>{Vn();EA="mgx:worldName",SA="mgx:nodeName",jA="mgx:playedBy",kA="mgx:waved",Xd="mgx:invitedBy",Cz=Object.freeze([EA,SA,jA,kA,Xd])});function bc(e){let t=new Set;for(let n of e||[])n?.predicate===Xd&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function Jd(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function wc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=Jd(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 Qd=M(()=>{vw()});function As(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function IA(e,t){(!e?.class||!RA.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function OA(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Ri(As(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=As(e,i);a!==void 0&&TA.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=As(e,"mgx:factProvenance");n!==void 0&&!Ri(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";AA(s)&&!Ew.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=As(e,"mgx:sourceId");o!==void 0&&!Ri(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=As(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 CA){let a=As(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)Ew.test(l)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(l)})`)}}function NA(e,t){Ri(As(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=As(e,"mgx:ruleKind");if(!n||!xw.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...xw].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of _A[n])Ri(As(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function LA(e){let t=[];return IA(e,t),e?.class==="Fact"&&OA(e,t),e?.class==="Rule"&&NA(e,t),{ok:t.length===0,violations:t}}function Zd(e){let t=LA(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 RA,xw,_A,TA,Ew,AA,CA,Ri,Sw=M(()=>{RA=new Set(["Utterance","Fact","Session","Source","Rule"]),xw=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),_A={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"]},TA=/[.!?]\s+\w/,Ew=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,AA=e=>e.includes("@")||/#v\d/.test(e),CA=["mgx:supersedes","mgx:supersededBy"];Ri=e=>typeof e=="string"&&e.trim().length>0});var jw={};Ot(jw,{access:()=>FA,appendFile:()=>UA,basename:()=>sC,copyFile:()=>KA,createInterface:()=>cC,createReadStream:()=>XA,createRequire:()=>PA,createWriteStream:()=>JA,default:()=>uC,dirname:()=>eC,existsSync:()=>QA,fileURLToPath:()=>rC,isAbsolute:()=>nC,join:()=>ZA,mkdir:()=>BA,mkdtemp:()=>WA,randomBytes:()=>iC,readFile:()=>DA,readFileSync:()=>MA,readdir:()=>YA,rename:()=>GA,resolve:()=>tC,rm:()=>HA,sep:()=>oC,spawnSync:()=>aC,stat:()=>qA,tmpdir:()=>lC,unlink:()=>VA,writeFile:()=>zA});var $t,PA,MA,FA,DA,zA,UA,BA,WA,GA,VA,HA,qA,KA,YA,XA,JA,QA,ZA,eC,tC,nC,sC,oC,rC,iC,aC,cC,lC,uC,kw=M(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},PA=$t("createRequire"),MA=$t("readFileSync"),FA=$t("access"),DA=$t("readFile"),zA=$t("writeFile"),UA=$t("appendFile"),BA=$t("mkdir"),WA=$t("mkdtemp"),GA=$t("rename"),VA=$t("unlink"),HA=$t("rm"),qA=$t("stat"),KA=$t("copyFile"),YA=$t("readdir"),XA=$t("createReadStream"),JA=$t("createWriteStream"),QA=()=>!1,ZA=(...e)=>e.join("/"),eC=e=>String(e).replace(/\/[^/]*$/,""),tC=(...e)=>e.join("/"),nC=e=>String(e).startsWith("/"),sC=e=>String(e).split("/").pop(),oC="/",rC=e=>String(e),iC=$t("randomBytes"),aC=$t("spawnSync"),cC=$t("createInterface"),lC=()=>"/tmp",uC={}});var dC,_i,ef=M(()=>{dC=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,_i=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(dC);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 fC(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function pC(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+=`
85
+ `),tier:g,topup:$}}async function md(e,{config:t,source:n,tel:s}){return(await Ob(e,{config:t,source:n,tel:s})).text}var hd=M(()=>{Nt();Xe();Kt();qa();Zr();Me();qn();Xa();Ja();et();md.ownsGraphLoad=!0});function Nb(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"symbol"),"symbol");return rg(rr(t,s))}var Lb=M(()=>{Me();et()});function Qa(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 wi(e){return Qa(e).toString(16).padStart(8,"0")}function Za(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 y=0;y<16;y+=1)i[y]=o.getUint32(u+y*4);for(let y=16;y<64;y+=1){let x=a(i[y-15],7)^a(i[y-15],18)^i[y-15]>>>3,C=a(i[y-2],17)^a(i[y-2],19)^i[y-2]>>>10;i[y]=i[y-16]+x+i[y-7]+C>>>0}let[d,f,p,m,h,g,b,$]=r;for(let y=0;y<64;y+=1){let x=a(h,6)^a(h,11)^a(h,25),C=h&g^~h&b,v=$+x+C+BT[y]+i[y]>>>0,j=a(d,2)^a(d,13)^a(d,22),E=d&f^d&p^f&p,S=j+E>>>0;$=b,b=g,g=h,h=m+v>>>0,m=p,p=f,f=d,d=v+S>>>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]+$>>>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 WT(e,t){let n=Za(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function H(e){let t=_s(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 Yn(e){let t=_s(e);return VT.get(t)??t}function $e(e,t,n){return jo(H(e),Yn(t),H(n))}var BT,GT,_s,VT,jo,ot=M(()=>{BT=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]);GT=2e3,_s=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,GT);VT=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:${WT(`${e}\0${t}\0${n}`,8)}`});var rn={};Ot(rn,{CARDINALITY_RULE_CONFIDENCE:()=>JT,CAX_DW_RULE:()=>bd,CAX_DW_RULE_CONFIDENCE:()=>yd,CAX_MAXC0_RULE_CONFIDENCE:()=>ZT,CLS_SVF1_RULE:()=>$d,CLS_SVF1_RULE_CONFIDENCE:()=>xd,DEFAULT_MAX_ENVIRONMENTS:()=>wr,DISJOINT_PREDICATE:()=>gr,ENTAILED_DISJOINT_PROVENANCE:()=>wd,ENTAILED_PROVENANCE:()=>Fb,ENTAILED_SCM_SVF_PROVENANCE:()=>kd,ENTAILED_SVF1_PROVENANCE:()=>vd,ENTAILED_TYPE_PROVENANCE:()=>zb,ON_PROPERTY_PREDICATE:()=>xn,SCM_SVF_RULE:()=>jd,SCM_SVF_RULE_CONFIDENCE:()=>Rd,SOME_VALUES_FROM_PREDICATE:()=>En,SUBCLASS_PREDICATE:()=>ze,TYPE_PREDICATE:()=>Pt,buildCardinalityRestrictions:()=>Sd,buildRelevanceFrontier:()=>gd,buildSubClassSuccessors:()=>ec,deriveDisjointViolations:()=>Gb,deriveSomeValuesFromApplication:()=>Vb,deriveSomeValuesFromSubsumption:()=>Hb,deriveSubClassClosure:()=>Ub,deriveSubClassClosureDelta:()=>Bb,deriveTypePropagation:()=>Wb,entailedTrustFrom:()=>qT,findConsistencyViolations:()=>tA,findIsaChain:()=>_d,proveCardinalityAtLeast:()=>QT,proveMaxCardinalityZeroDenial:()=>eA,retractSubClassOf:()=>rA,syllogise:()=>Kb});function Pb(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 qT(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 Ts(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=H(s);o&&n.add(o)}return n.size?n:null}function Ub(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}${Ue}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:Ts(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 $=`${p}${Ue}${b}`;o.has($)||l.has($)||a(p,h,b)&&d.push([p,h,b,$])}}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 Bb(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}${Ue}${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}${Ue}${h}`;l.has(g)||(l.add(g),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:Ts(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=(y,x,C)=>{if(y===C)return;let v=`${y}${Ue}${C}`;r.has(v)||p.has(v)||d(y,x,C)&&h.push([y,x,C,v])};for(let[y,x]of c){for(let C of i.get(x)||[])g(y,x,C);for(let C of a.get(y)||[])g(C,y,x)}if(!h.length)break;h.sort((y,x)=>y[0].localeCompare(x[0])||y[2].localeCompare(x[2])||y[1].localeCompare(x[1]));let b=!1,$=[];for(let[y,x,C,v]of h)if(!p.has(v)){if(f.length>=s)break;p.add(v),f.push({subject:y,object:C,via:x}),i.has(y)||i.set(y,new Set),i.get(y).add(C),a.has(C)||a.set(C,new Set),a.get(C).add(y),$.push([y,C]),b=!0}if(f.length>=s||!b)break;c=$}return f}function Xn(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 KT(e){return Xn((e||[]).map(([t,n])=>[n,t]))}function gd(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(Qs(l.predicate)?n.push([l.subject,l.object]):Ro(l.predicate)?s.push([l.subject,l.object]):br(l.predicate)?o.set(l.subject,l.object):$i(l.predicate)&&r.set(l.subject,l.object));let i=KT(n),a=new Set;for(let l of t||[]){let u=H(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 Wb(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Xn(t),i=new Set,a=new Set;for(let[p,m]of o||[])p&&m&&i.add(`${p}${Ue}${m}`);let c=s instanceof Set?s.size?s:null:Ts(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}${Ue}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===p)continue;let b=`${p}${Ue}${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 Gb(e,t,n,{budget:s=50,focus:o=null}={}){let r=Xn(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${Ue}${h}`),a.add(`${h}${Ue}${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:Ts(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}${Ue}${h}`;if(!c.has(g)){c.add(g);for(let b of[h,...r(h)]){let $=i.get(b);if($)for(let y of $){if(y===m)continue;let x=`${m}${Ue}${y}`;a.has(x)||u(m,h,y)&&d.push([m,h,b,y,x])}}}}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,$]of d)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:m,object:b,viaType:h,viaClass:g})}return f}function Vb(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Xn(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${Ue}${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}${Ue}${b}`),l.has(g)||l.set(g,new Set),l.get(g).add(b));let u=r instanceof Set?r.size?r:null:Ts(r),d=(g,b,$)=>!u||u.has(g)||u.has(b)||u.has($),f=new Set,p=[];for(let[g,b,$]of e||[]){if(!g||!b||!$)continue;let y=H(b),x=`${g}${Ue}${y}${Ue}${$}`;if(f.has(x))continue;f.add(x);let C=l.get($);if(C)for(let v of C)for(let j of[v,...i(v)]){let E=a.get(`${y}${Ue}${j}`);if(E)for(let S of E){if(g===S)continue;let A=`${g}${Ue}${S}`;c.has(A)||d(g,$,S)&&p.push([g,b,y,$,v,j,S,A])}}}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,x,C,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:$,viaValue:y,viaType:x,viaTarget:C})}return m}function Sd(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(br(r.predicate))t.set(r.subject,r.object);else if(HT(r.predicate))s.set(r.subject,r.object);else{let i=XT[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)!==YT)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 Hb(e,t,{budget:n=50,focus:s=null}={}){let o=Xn(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=H(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}${Ue}${p}`);let a=s instanceof Set?s.size?s:null:Ts(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}${Ue}${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 qb(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Xn(e),a=r instanceof Set?r.size?r:null:Ts(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 QT(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=qb(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 eA(e,t,n,s,o={}){if(!s)return null;let r=qb(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 tA(e,t,n,{budget:s=50,focus:o=null}={}){let r=Xn(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:Ts(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]],x=[$,...r($)],C=[y,...r(y)],v=null;for(let E of x){let S=i.get(E);if(S){for(let A of C)if(S.has(A)){v=[E,A];break}if(v)break}}if(!v)continue;let j=`${p}${Ue}${$}${Ue}${y}`;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 Kb(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=wr,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=Pb(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await c(e),p=l(f),m=p.filter(I=>Qs(I.predicate)).map(I=>[I.subject,I.object]),h=p.filter(I=>Ro(I.predicate)).map(I=>[I.subject,I.object]),g=p.filter(I=>ko(I.predicate)).map(I=>[I.subject,I.object]),b=new Map,$=new Map,y=[];for(let I of p){let fe=String(I.predicate||"").trim().toLowerCase();br(I.predicate)?b.set(I.subject,I.object):$i(I.predicate)?$.set(I.subject,I.object):Ed.has(fe)||y.push([I.subject,I.predicate,I.object])}let x=[];for(let[I,fe]of b){let Ce=$.get(I);Ce&&x.push({restriction:I,property:fe,target:Ce})}let C=Ts(s),v=o&&C?gd(p,[...C]):C,j=v===null&&d?await a.loadSyllogiseState(e):null,E=new Set(p.map(I=>I.id)),S=Array.isArray(j?.factIds)?j.factIds.filter(I=>!E.has(I)):[],A=j&&Array.isArray(j.factIds)&&!S.length&&!i?"delta":"full",w=A==="delta"?new Set(j.factIds):null,T=A==="delta"?p.filter(I=>!w.has(I.id)):p,O=T.length,R=new Map;for(let I of p)R.set(`${I.subject}${Ue}${I.predicate}${Ue}${I.object}`,I.trust);let k=(I,fe,Ce)=>R.get(`${I}${Ue}${fe}${Ue}${Ce}`),L=(I,fe,Ce)=>R.has(`${I}${Ue}${fe}${Ue}${Ce}`),B=I=>I.filter(fe=>typeof fe=="number"),V=A==="delta"&&!T.length,K=A==="delta"?T.filter(I=>Qs(I.predicate)).map(I=>[I.subject,I.object]):[],Y=A==="delta"?K.length?Bb(m,K,{depth:t,budget:n,focus:v}):[]:Ub(m,{depth:t,budget:n,focus:v}),_=m.concat(Y.map(I=>[I.subject,I.object])),P=v,W=null;if(A==="delta"&&!V){let I=p.concat(Y.map(Ce=>({subject:Ce.subject,predicate:ze,object:Ce.object}))),fe=[];for(let Ce of T)fe.push(Ce.subject,Ce.object);W=gd(I,fe),P=W}let F=I=>!W||W.has(I),z=W?h.filter(([I,fe])=>F(I)||F(fe)):h,N=new Set;if(W)for(let I of T)ko(I.predicate)&&(N.add(I.subject),N.add(I.object));let D=W&&N.size?Xn(_):null,U=W?h.filter(([I,fe])=>F(I)||F(fe)||D&&[...D(fe)].some(Ce=>N.has(Ce))):h,G=new Set;if(W){for(let I of T)if(br(I.predicate)||$i(I.predicate)){let fe=b.get(I.subject);fe&&G.add(H(fe))}}let Z=W?y.filter(([I,fe,Ce])=>F(I)||F(Ce)||G.has(H(fe))):y,re=Math.max(0,n-Y.length),ie=re>0&&!V?Wb(z,_,{budget:re,focus:P,presentTypeEdges:h}):[],J=Math.max(0,n-Y.length-ie.length),ee=J>0&&!V?Gb(U,_,g,{budget:J,focus:P}):[],te=Math.max(0,n-Y.length-ie.length-ee.length),Q=te>0&&x.length&&!V?Vb(Z,h,_,x,{budget:te,focus:P}):[],ce=Math.max(0,n-Y.length-ie.length-ee.length-Q.length),ke=ce>0&&x.length>1&&!V?Hb(x,_,{budget:ce,focus:P}):[],Re=new Map(x.map(I=>[I.restriction,I])),de=[...Y.map(I=>({subject:I.subject,predicate:ze,object:I.object,provenance:Fb,justification:[[$e(I.subject,ze,I.via),$e(I.via,ze,I.object)]]})),...ie.map(I=>({subject:I.subject,predicate:Pt,object:I.object,provenance:zb,justification:[[$e(I.subject,Pt,I.via),$e(I.via,ze,I.object)]]})),...ee.map(I=>{let fe=L(I.viaClass,gr,I.object),[Ce,fs]=fe?[I.viaClass,I.object]:[I.object,I.viaClass],ps=B([k(I.subject,Pt,I.viaType),k(Ce,gr,fs),...I.viaClass!==I.viaType?[k(I.viaType,ze,I.viaClass)]:[]]);return{subject:I.subject,predicate:gr,object:I.object,provenance:wd,justification:[[$e(I.subject,Pt,I.viaType),$e(Ce,gr,fs),...I.viaClass!==I.viaType?[$e(I.viaType,ze,I.viaClass)]:[]]],...ps.length?{premiseTrusts:ps,ruleConfidence:yd}:{}}}),...Q.map(I=>{let fe=B([k(I.subject,I.viaProperty,I.viaValue),k(I.viaValue,Pt,I.viaType),k(I.object,xn,I.viaPropertyKey),k(I.object,En,I.viaTarget),...I.viaType!==I.viaTarget?[k(I.viaType,ze,I.viaTarget)]:[]]);return{subject:I.subject,predicate:Pt,object:I.object,provenance:vd,justification:[[$e(I.subject,I.viaProperty,I.viaValue),$e(I.viaValue,Pt,I.viaType),$e(I.object,xn,I.viaPropertyKey),$e(I.object,En,I.viaTarget),...I.viaType!==I.viaTarget?[$e(I.viaType,ze,I.viaTarget)]:[]]],...fe.length?{premiseTrusts:fe,ruleConfidence:xd}:{}}}),...ke.map(I=>{let fe=Re.get(I.subject),Ce=Re.get(I.object),fs=B([fe&&k(I.subject,xn,fe.property),k(I.subject,En,I.viaY1),Ce&&k(I.object,xn,Ce.property),k(I.object,En,I.viaY2),k(I.viaY1,ze,I.viaY2)]);return{subject:I.subject,predicate:ze,object:I.object,provenance:kd,justification:[[...fe?[$e(I.subject,xn,fe.property)]:[],$e(I.subject,En,I.viaY1),...Ce?[$e(I.object,xn,Ce.property)]:[],$e(I.object,En,I.viaY2),$e(I.viaY1,ze,I.viaY2)]],...fs.length?{premiseTrusts:fs,ruleConfidence:Rd}:{}}})],Ge=de.map(I=>({id:$e(I.subject,I.predicate,I.object),subject:I.subject,predicate:I.predicate,object:I.object,environments:I.justification,write:I})),Ve=Xb(p.concat(Ge.map(I=>({id:I.id,subject:I.subject,predicate:I.predicate,object:I.object})))),ae=new Map(p.map(I=>[I.id,I])),Oe=I=>Qs(I)||Ro(I)||ko(I),ue=I=>A!=="delta"||W!==null&&(W.has(I.subject)||W.has(I.object)),Ee=p.filter(I=>Oe(I.predicate)&&Yb(I.provenance)&&yi(I).length<r&&ue(I)).map(I=>({id:I.id,subject:I.subject,predicate:I.predicate,object:I.object,environments:yi(I),provenance:I.provenance})),me=[...Ge,...Ee].sort((I,fe)=>I.subject.localeCompare(fe.subject)||I.predicate.localeCompare(fe.predicate)||I.object.localeCompare(fe.object)),se=0,Ne=!1,Je=0;for(let I of me){if(Je>=n){Ne=!0;break}Je+=1;let fe=Ve(I,{maxEnvironments:r+1}),{kept:Ce,truncated:fs}=sA(I.environments,fe,r);if(fs&&(Ne=!0),!(Ce.length<=I.environments.length)){if(se+=Ce.length-I.environments.length,I.write){I.write.justification=Ce;continue}de.push({subject:I.subject,predicate:I.predicate,object:I.object,justification:Ce,...Jb(I.provenance,Ce,ps=>ae.get(ps)?.trust)||{}})}}let{ids:Be}=await u(e,de),gt=[],Ct=0;for(let I of Y)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.via,rule:Mb}),Ct+=1;for(let I of ie)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.via,rule:Db}),Ct+=1;for(let I of ee)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaClass,rule:bd}),Ct+=1;for(let I of Q)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaValue,rule:$d}),Ct+=1;for(let I of ke)gt.push({id:Be[Ct],subject:I.subject,object:I.object,via:I.viaY1,rule:jd}),Ct+=1;let ca=gt.length>=n;if(v===null&&d&&!ca){let I=new Set(E);for(let fe of Be)I.add(fe);await a.saveSyllogiseState(e,{version:1,factIds:[...I].sort(),completedAt:new Date().toISOString()})}return{derived:gt,count:gt.length,budget:n,depth:t,truncated:ca,mode:A,deltaSize:O,environmentsAdded:se,alternatesTruncated:Ne}}function Yb(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function nA(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();Qs(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)):br(u.predicate)?o.set(u.subject,u.object):$i(u.predicate)?r.set(u.subject,u.object):Ed.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([H(u.predicate),u.object]))}let a=Xn(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:H(d),target:f}:null};return u=>{if(Qs(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 Xb(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();Qs(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}${Ue}${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)):br(p.predicate)?a.set(p.subject,p.object):$i(p.predicate)?c.set(p.subject,p.object):Ed.has(m)||(l.has(p.subject)||l.set(p.subject,[]),l.get(p.subject).push([p.predicate,p.object]))}let u=Xn(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:H(m),target:h}:null};return(p,{maxEnvironments:m=wr}={})=>{let h=[],g=new Set,b=$=>{if(h.length>=m||p.id&&$.includes(p.id)||!$.every(x=>t.has(x)))return;let y=[...$].sort().join(" ");g.has(y)||(g.add(y),h.push($))};if(Qs(p.predicate)){for(let $ of[...d(p.subject)].sort()){if(h.length>=m)break;$===p.subject||$===p.object||d($).has(p.object)&&b([$e(p.subject,ze,$),$e($,ze,p.object)])}if(h.length<m){let $=f(p.subject),y=f(p.object);$&&y&&$.propertyKey===y.propertyKey&&$.target!==y.target&&d($.target).has(y.target)&&b([$e(p.subject,xn,$.property),$e(p.subject,En,$.target),$e(p.object,xn,y.property),$e(p.object,En,y.target),$e($.target,ze,y.target)])}return h}if(Ro(p.predicate)){for(let y of[...o.get(p.subject)||[]].sort()){if(h.length>=m)break;y!==p.object&&d(y).has(p.object)&&b([$e(p.subject,Pt,y),$e(y,ze,p.object)])}let $=f(p.object);if($){let y=[...l.get(p.subject)||[]].filter(([x])=>H(x)===$.propertyKey).sort((x,C)=>x[0].localeCompare(C[0])||x[1].localeCompare(C[1]));for(let[x,C]of y){if(h.length>=m)break;for(let v of[...o.get(C)||[]].sort()){if(h.length>=m)break;v!==$.target&&!d(v).has($.target)||b([$e(p.subject,x,C),$e(C,Pt,v),$e(p.object,xn,$.propertyKey),$e(p.object,En,$.target),...v!==$.target?[$e(v,ze,$.target)]:[]])}}}return h}if(ko(p.predicate)){let $=[];for(let y of o.get(p.subject)||[])for(let x of[y,...u(y)])(i.get(x)||new Set).has(p.object)&&$.push([y,x]);$.sort((y,x)=>y[0].localeCompare(x[0])||y[1].localeCompare(x[1]));for(let[y,x]of $){if(h.length>=m)break;let C=r.has(`${x}${Ue}${p.object}`),[v,j]=C?[x,p.object]:[p.object,x];b([$e(p.subject,Pt,y),$e(v,gr,j),...x!==y?[$e(y,ze,x)]:[]])}return h}return h}}function sA(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 Jb(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=oA.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 rA(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=wr,store:i,sourceTags:a=[],predicate:c=ze}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Pb(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=H(t),g=H(n),b=$e(h,c,g),$=await l(e),y=u($),x=new Map(y.map(L=>[L.id,L]));if(!x.has(b))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let C=x.get(b).sourceIds||[],v=m.map(L=>p(b,L).slice(b.length+1)),j=m.length?C.filter(L=>v.includes(L)):[],E=!m.length||j.length>0;if(m.length&&!E)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=m.length>0&&j.length<C.length,A=new Set([b]),w=[b],T=new Map,O=!1;if(!S){let L=y.filter(Y=>yi(Y).length&&Yb(Y.provenance)),B=new Map;for(let Y of L)for(let _ of yi(Y))for(let P of _)B.has(P)||B.set(P,new Set),B.get(P).add(Y.id);let V=0,K=[b];for(;V<o;V+=1){let Y=new Set;for(let U of K)for(let G of B.get(U)||[])A.has(G)||Y.add(G);let _=[...Y].map(U=>x.get(U)).sort((U,G)=>U.subject.localeCompare(G.subject)||U.predicate.localeCompare(G.predicate)||U.object.localeCompare(G.object));if(!_.length)break;let P=y.filter(U=>!A.has(U.id)&&!Y.has(U.id)),W=new Set(P.map(U=>U.id)),F=Xb(P),z=nA(P),N=!1,D=!1;K=[];for(let U of _){if(A.size>=s){D=!0;break}let G=yi(U),Z=G.filter(ie=>ie.every(J=>W.has(J)));if(Z.length){Z.length!==G.length&&T.set(U.id,Z);continue}let re=F(U,{maxEnvironments:r});if(re.length){T.set(U.id,re);continue}z(U)||(A.add(U.id),w.push(U.id),K.push(U.id),N=!0)}if(D){O=!0;break}if(!N)break}!O&&V>=o&&(O=L.some(Y=>!A.has(Y.id)&&Y.justification.some(_=>A.has(_))))}let R=m.length?[...j.map(L=>`${b}@${L}`),...w.slice(1)]:w,{removed:k}=await d(e,R);if(f){let L=[...T.entries()].filter(([B])=>!A.has(B)).sort((B,V)=>B[0].localeCompare(V[0])).map(([B,V])=>{let K=x.get(B);return{subject:K.subject,predicate:K.predicate,object:K.object,justification:V,...Jb(K.provenance,V,Y=>x.get(Y)?.trust)||{}}});L.length&&await f(e,L)}return{retracted:k,count:k.length,budget:s,depth:o,truncated:O,found:!0,...m.length?{ownRecord:!0,stillStands:S}:{}}}function ec(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:ec(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:ze,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:ze,object:p}]})}a=u}return null}var ze,Mb,Fb,Pt,Db,zb,gr,bd,wd,yd,xn,En,$d,vd,xd,wr,Ue,Qs,Ro,ko,br,$i,HT,Ed,YT,XT,jd,kd,Rd,JT,ZT,yi,oA,At=M(()=>{ot();ze="rdfs:subClassOf",Mb="subClassOf",Fb=`entailed:${Mb}`,Pt="rdf:type",Db="type",zb=`entailed:${Db}`,gr="owl:disjointWith",bd="disjointWith",wd=`entailed:${bd}`,yd=.95,xn="owl:onProperty",En="owl:someValuesFrom",$d="someValuesFrom",vd=`entailed:${$d}`,xd=.95,wr=4,Ue="\u241F",Qs=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",Ro=e=>String(e||"").trim().toLowerCase()==="rdf:type",ko=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",br=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",$i=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",HT=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Ed=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);YT="has",XT={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};jd="someValuesFromSubsumption",kd=`entailed:${jd}`,Rd=.95;JT=.95;ZT=.95;yi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);oA=new Map([[wd,yd],[vd,xd],[kd,Rd]])});function xr(e){let t=String(e||""),n=Qb.get(t);return n||(t.startsWith(Td)?yr+t.slice(Td.length):t)}function Zb(e){let t=String(e||""),n=iA.get(t);return n||(t.startsWith(yr)?Td+t.slice(yr.length):null)}function nw(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 sc(e,t,n,{maxHops:s=3}={}){let o=vr(e),r=vr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=tw(i),l=i.filter(b=>(b.predicate===nc||b.predicate===$r)&&r.has(b.object)),u=[];for(let b of l){let $=b.predicate===$r?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:$,hops:0,chain:null});continue}let y=nw(o,b.subject,a,c,s);y&&y.length&&u.push({fact:b,polarity:$,hops:y.length,chain:y})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Cd(o,r,i,{maxHops:s})};u.sort((b,$)=>b.hops-$.hops||($.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 Cd(e,t,n,{maxHops:s=3}={}){let o=vr(e),r=vr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===ze||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===nc||b.predicate===$r));return g?{name:h,polarity:g.predicate===$r?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:m}=tw(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:nw(o,l,p,m,s)}}function Id(e,t,{exclude:n=[],maxHops:s=3}={}){let o=vr(e),r=vr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==nc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),sc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(aA)}var yr,Td,tc,Qb,iA,ew,nc,$r,Ad,aA,vr,tw,oc=M(()=>{At();yr="mgxneg:",Td="mgx:",tc="mgxneg:subClassOf",Qb=new Map([[ze,tc]]),iA=new Map([...Qb].map(([e,t])=>[t,e]));ew=e=>String(e||"").startsWith(yr),nc="mgx:capableOf",$r=xr(nc),Ad=6,aA=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),vr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),tw=e=>{let t=e.filter(s=>s.predicate===Pt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===ze).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:ec(n)}}});function rc(e){let t=String(e||"");return Ld.has(t)?Od:lA.has(t)||uA.test(t)?vi:dA.has(t)?sw:Nd}function fA(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(ih.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function pA(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(fA(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Pd(e,t){let n=t===sw;if(!n&&t!==vi)return null;let s=(e||[]).map(r=>({row:r,at:pA(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 Od,vi,sw,Nd,cA,Ld,lA,uA,dA,ow=M(()=>{oc();Vn();Od="merge",vi="latest-observation-wins",sw="first-claim-wins",Nd="contradiction",cA=["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"],Ld=new Set(cA.flatMap(e=>[e,xr(e)])),lA=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"]),uA=/^mgx:has-exit-([a-z]+)$/,dA=new Set(["mgx:playedBy"])});function Si(e){let t=String(e||""),n=t.indexOf(ic);return n<0?"":t.slice(n+ic.length)}function wA(e){let t=1,n=0;for(let s of e)t*=1-gA(s),n+=1;return n?bA(Math.min(1,1-t)):0}function lw(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 fw(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 pw(e,t="",n=""){let s=t,o=n;for(let r of e)s=uw(s,r.assertedAt),o=dw(o,r.assertedAt);return{earliest:s,latest:o}}function zd({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?wA(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:mA,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===Er?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:Ei,key:"rollupCount",value:String(c.length)},{prop:Jn,key:"rollupEarliest",value:r},{prop:Qn,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:Sr,key:"rollupPrior",value:String(l)}]]}}function mw({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(fw).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=pw(i,Mt(s,Jn),Mt(s,Qn));return{rollup:zd({id:Md(e,t),sourceKey:`rollup:${t}`,template:Ud(i[0].record||s),idsProp:Er,ids:[...lc(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 hw({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(fw),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=pw(i,Mt(s,Jn),Mt(s,Qn));return{rollup:zd({id:Fd(e,t),sourceKey:t,template:Ud(i[0].record||s),idsProp:xi,ids:[...hA(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Bd(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Zs(s),r=o?Er:xi,i=a=>Dd(Mt(a,r));return zd({id:s,sourceKey:Mt(e,"mgx:sourceId")||Mt(t,"mgx:sourceId"),template:Ud(Mt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:uw(Mt(e,Jn),Mt(t,Jn)),latest:dw(Mt(e,Qn),Mt(t,Qn)),priorFor:o?n:void 0})}function gw(e,t){if(!t)return!1;for(let n of e||[])if(lc(n).includes(t))return!0;return!1}var mA,rw,iw,ac,aw,Er,xi,Ei,Jn,Qn,Sr,ic,cw,Md,Fd,Zs,jr,cc,Mt,Dd,lc,hA,gA,bA,uw,dw,Ud,Wd=M(()=>{mA="Fact",rw=64,iw=8,ac=8,aw=2,Er="mgx:rollupSourceIds",xi="mgx:rollupRecordIds",Ei="mgx:rollupCount",Jn="mgx:rollupEarliest",Qn="mgx:rollupLatest",Sr="mgx:rollupPrior",ic="@rollup:",cw="#rollup",Md=(e,t)=>`${e}${ic}${t}`,Fd=(e,t)=>`${e}@${t}${cw}`,Zs=e=>String(e||"").includes(ic),jr=e=>String(e||"").endsWith(cw),cc=e=>Zs(e)||jr(e);Mt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Dd=e=>String(e||"").split(" ").filter(Boolean),lc=e=>Dd(Mt(e,Er)),hA=e=>Dd(Mt(e,xi)),gA=e=>Math.max(0,Math.min(1,Number(e)||0)),bA=e=>Number(e.toFixed(6));uw=(e,t)=>lw(e,t,Math.min),dw=(e,t)=>lw(e,t,Math.max);Ud=e=>({label:e?.label||"",subject:Mt(e,"rdf:subject"),predicate:Mt(e,"rdf:predicate"),object:Mt(e,"rdf:object")})});function qd(e){let t=String(e||"");return Hd(t)?t.slice(0,-pc.length):""}function bw(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 Kd({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:hn,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:dc,key:"retractedRecordIds",value:i.join(" ")},{prop:Gd,key:"retractedCount",value:String(i.length)},{prop:fc,key:"retractedAt",value:o||""},...a.length?[{prop:ji,key:"provenance",value:a.join(" | ")}]:[]]}}function yw({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?Kd({id:Vd(e,t),sourceId:t,template:r||ww(o),ids:a,retractedAt:bw(To(o),s),tags:[...ki(Sn(o,ji)),...ki(i)]}):null}function $w(e,t){let n=ww(Sn(e,"rdf:subject")?e:t);return Kd({id:e?.id||t?.id,sourceId:Sn(e,"mgx:sourceId")||Sn(t,"mgx:sourceId"),template:n,ids:[..._o(e),..._o(t)],retractedAt:bw(To(e),To(t)),tags:[...ki(Sn(e,ji)),...ki(Sn(t,ji))]})}function $A(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function vA(e,t,n=""){return!e||!t||!_o(e).includes(t)?!1:$A(n,To(e))}function mc(e,t,n=""){for(let s of e||[])if(vA(s,t,n))return!0;return!1}function xA(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function EA(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 hc(e){let t=qd(e?.id);return t?{id:e.id,subject:t,predicate:uc,object:xA(To(e),_o(e)),provenance:Sn(e,ji)}:null}function gc(e){if(!e||e.predicate!==uc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=EA(e.object);return o.length?Kd({id:`${t}${pc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ki(e.provenance)}):null}var hn,uc,dc,fc,Gd,pc,ji,Vd,Hd,Sn,yA,ki,_o,To,ww,Yd=M(()=>{hn="Retraction",uc="mgx:retracted",dc="mgx:retractedRecordIds",fc="mgx:retractedAt",Gd="mgx:retractedCount",pc="#retracted",ji="mgx:factProvenance",Vd=(e,t)=>`${e}@${t}${pc}`,Hd=e=>String(e||"").endsWith(pc);Sn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",yA=e=>String(e||"").split(" ").filter(Boolean),ki=e=>String(e||"").split(" | ").filter(Boolean),_o=e=>yA(Sn(e,dc)),To=e=>Sn(e,fc);ww=e=>({label:e?.label||"",subject:Sn(e,"rdf:subject"),predicate:Sn(e,"rdf:predicate"),object:Sn(e,"rdf:object")})});var SA,jA,kA,RA,Xd,Cz,vw=M(()=>{Vn();SA="mgx:worldName",jA="mgx:nodeName",kA="mgx:playedBy",RA="mgx:waved",Xd="mgx:invitedBy",Cz=Object.freeze([SA,jA,kA,RA,Xd])});function bc(e){let t=new Set;for(let n of e||[])n?.predicate===Xd&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function Jd(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function wc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=Jd(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 Qd=M(()=>{vw()});function As(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function OA(e,t){(!e?.class||!_A.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function NA(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Ri(As(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=As(e,i);a!==void 0&&AA.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=As(e,"mgx:factProvenance");n!==void 0&&!Ri(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";CA(s)&&!Ew.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=As(e,"mgx:sourceId");o!==void 0&&!Ri(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=As(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 IA){let a=As(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)Ew.test(l)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(l)})`)}}function LA(e,t){Ri(As(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=As(e,"mgx:ruleKind");if(!n||!xw.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...xw].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of TA[n])Ri(As(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function PA(e){let t=[];return OA(e,t),e?.class==="Fact"&&NA(e,t),e?.class==="Rule"&&LA(e,t),{ok:t.length===0,violations:t}}function Zd(e){let t=PA(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 _A,xw,TA,AA,Ew,CA,IA,Ri,Sw=M(()=>{_A=new Set(["Utterance","Fact","Session","Source","Rule"]),xw=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),TA={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"]},AA=/[.!?]\s+\w/,Ew=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,CA=e=>e.includes("@")||/#v\d/.test(e),IA=["mgx:supersedes","mgx:supersededBy"];Ri=e=>typeof e=="string"&&e.trim().length>0});var jw={};Ot(jw,{access:()=>DA,appendFile:()=>BA,basename:()=>oC,copyFile:()=>YA,createInterface:()=>lC,createReadStream:()=>JA,createRequire:()=>MA,createWriteStream:()=>QA,default:()=>dC,dirname:()=>tC,existsSync:()=>ZA,fileURLToPath:()=>iC,isAbsolute:()=>sC,join:()=>eC,mkdir:()=>WA,mkdtemp:()=>GA,randomBytes:()=>aC,readFile:()=>zA,readFileSync:()=>FA,readdir:()=>XA,rename:()=>VA,resolve:()=>nC,rm:()=>qA,sep:()=>rC,spawnSync:()=>cC,stat:()=>KA,tmpdir:()=>uC,unlink:()=>HA,writeFile:()=>UA});var $t,MA,FA,DA,zA,UA,BA,WA,GA,VA,HA,qA,KA,YA,XA,JA,QA,ZA,eC,tC,nC,sC,oC,rC,iC,aC,cC,lC,uC,dC,kw=M(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},MA=$t("createRequire"),FA=$t("readFileSync"),DA=$t("access"),zA=$t("readFile"),UA=$t("writeFile"),BA=$t("appendFile"),WA=$t("mkdir"),GA=$t("mkdtemp"),VA=$t("rename"),HA=$t("unlink"),qA=$t("rm"),KA=$t("stat"),YA=$t("copyFile"),XA=$t("readdir"),JA=$t("createReadStream"),QA=$t("createWriteStream"),ZA=()=>!1,eC=(...e)=>e.join("/"),tC=e=>String(e).replace(/\/[^/]*$/,""),nC=(...e)=>e.join("/"),sC=e=>String(e).startsWith("/"),oC=e=>String(e).split("/").pop(),rC="/",iC=e=>String(e),aC=$t("randomBytes"),cC=$t("spawnSync"),lC=$t("createInterface"),uC=()=>"/tmp",dC={}});var fC,_i,ef=M(()=>{fC=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,_i=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(fC);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 pC(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function mC(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 ye,Ao=M(()=>{ye=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=fC(n.toml,n.ptr),r=pC(n.toml,s,o);super(`Invalid TOML document: ${t}
87
+ `))}return o}var ye,Ao=M(()=>{ye=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=pC(n.toml,n.ptr),r=mC(n.toml,s,o);super(`Invalid TOML document: ${t}
88
88
 
89
89
  ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function yc(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
91
  `&&(t+=2));let i="",a=t,c=0;for(let l=t;l<e.length;l++)if(n=e[l],r&&(n===`
92
92
  `||n==="\r"&&e[l+1]===`
93
93
  `))c=c&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new ye("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 ye("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 ye("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 ye("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new ye("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new ye("unfinished string",{toml:e,ptr:t})}function Rw(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=mC.test(e);if(o||hC.test(e)){if(gC.test(e))throw new ye("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new ye("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new ye("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new _i(e);if(!r.isValid())throw new ye("invalid value",{toml:t,ptr:n});return r}var mC,hC,gC,tf=M(()=>{ef();Ao();mC=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,hC=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,gC=/^[+-]?0[0-9_]/});function $c(e,t=0,n=e.length){let s=e.indexOf(`
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 ye("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new ye("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new ye("unfinished string",{toml:e,ptr:t})}function Rw(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=hC.test(e);if(o||gC.test(e)){if(bC.test(e))throw new ye("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new ye("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new ye("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new _i(e);if(!r.isValid())throw new ye("invalid value",{toml:t,ptr:n});return r}var hC,gC,bC,tf=M(()=>{ef();Ao();hC=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,gC=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,bC=/^[+-]?0[0-9_]/});function $c(e,t=0,n=e.length){let s=e.indexOf(`
95
95
  `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function kr(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
97
  `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new ye("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function Zn(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
98
98
  `||o==="\r"&&e[t+1]===`
99
99
  `);)t++;if(s||o!=="#")break;t=kr(e,t)}return t}function _w(e,t,n,s,o=!1){if(!s)return t=$c(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=$c(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 ye("cannot find end of structure",{toml:e,ptr:t})}var vc=M(()=>{Ao();});function bC(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(kr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function Ti(e,t,n,s,o){if(s===0)throw new ye("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?Aw(e,t,s,o):Tw(e,t,s,o);if(n){if(l=Zn(e,l),e[l]===",")l++;else if(e[l]!==n)throw new ye("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=yc(e,t);if(n){if(l=Zn(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
- `&&e[l]!=="\r")throw new ye("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=_w(e,t,",",n),a=bC(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new ye("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=Zn(e,t+a[1]),e[i]===","&&i++),[Rw(a[0],e,t,o),i]}var nf=M(()=>{tf();sf();vc();Ao();});function xc(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new ye("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 ye("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=yc(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=$c(l);if(u>-1)throw new ye("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new ye("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new ye("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(!wC.test(a))throw new ye("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,Zn(e,r+1,!0,!0)]}function Tw(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new ye("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=kr(e,t);else if(i!==" "&&i!==" "&&i!==`
101
+ `))return r}}throw new ye("cannot find end of structure",{toml:e,ptr:t})}var vc=M(()=>{Ao();});function wC(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(kr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function Ti(e,t,n,s,o){if(s===0)throw new ye("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?Aw(e,t,s,o):Tw(e,t,s,o);if(n){if(l=Zn(e,l),e[l]===",")l++;else if(e[l]!==n)throw new ye("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=yc(e,t);if(n){if(l=Zn(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
+ `&&e[l]!=="\r")throw new ye("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=_w(e,t,",",n),a=wC(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new ye("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=Zn(e,t+a[1]),e[i]===","&&i++),[Rw(a[0],e,t,o),i]}var nf=M(()=>{tf();sf();vc();Ao();});function xc(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new ye("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 ye("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=yc(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=$c(l);if(u>-1)throw new ye("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new ye("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new ye("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(!yC.test(a))throw new ye("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,Zn(e,r+1,!0,!0)]}function Tw(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new ye("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=kr(e,t);else if(i!==" "&&i!==" "&&i!==`
103
103
  `&&i!=="\r"){let a,c=o,l=!1,[u,d]=xc(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 ye("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 ye("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=Ti(e,d,"}",n-1,s);r.add(f),c[a]=f,t=p}}if(!i)throw new ye("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function Aw(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new ye("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=kr(e,t);else if(r!==" "&&r!==" "&&r!==`
104
- `&&r!=="\r"){let i=Ti(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new ye("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var wC,sf=M(()=>{tf();nf();vc();Ao();wC=/^[a-zA-Z0-9-_]+[ \t]*$/});function Cw(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=Zn(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=xc(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new ye("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=Cw(l[0],s,o,c?2:1);if(!u)throw new ye("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=xc(e,a),l=Cw(c[0],r,i,0);if(!l)throw new ye("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=Ti(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=Zn(e,a,!0),e[a]&&e[a]!==`
105
- `&&e[a]!=="\r")throw new ye("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=Zn(e,a)}return s}var Iw=M(()=>{sf();nf();vc();Ao();});var Ow=M(()=>{});var Ec=M(()=>{Iw();Ow();ef();Ao();});var of={};Ot(of,{CONFIG_FILE:()=>jc,loadTomlConfig:()=>kc,mergeEffective:()=>Lw,normalizeConfig:()=>Nw});async function kc(e,{file:t}={}){let n=t||ne(e,jc),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 ${jc} at ${n}: ${o&&o.message?o.message:o}`)}}async function yC(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 Nw(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await yC(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 y=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=y.map(x=>Ut(s,String(x)))}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 $=[];for(let[y,x]of $C)n[y]&&n[y][x]!==void 0&&$.push(`${y}.${x}`);return o.unwired=$,o}function Sc(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:Sc(o,r,n)}return n}function Lw({args:e={},toml:t=null,defaults:n={}}={}){let s=Sc(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Sc(o):{},i=Sc(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 jc,$C,Ai=M(()=>{Nt();Xe();Ec();jc="tmct.toml";$C=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ls={};Ot(Ls,{CANONICALISED_FROM_PROP:()=>yf,CAPABLE_OF_PREDICATE:()=>TI,CHAIN_KEEP_DEPTH:()=>aw,CHAIN_ROLLUP_THRESHOLD:()=>ac,CREATED_AT_PROP:()=>ct,DEFAULT_RETENTION:()=>df,FACT_CLASS:()=>vt,GROUP_ROLLUP_THRESHOLD:()=>rw,HAS_A_PREDICATE:()=>Or,IN_REPLY_TO_PROP:()=>wf,MEMORY_DIR_REL:()=>_r,MEMORY_GRAPH_REL:()=>mf,MEMORY_MANIFEST_REL:()=>sy,MEMORY_SESSION_CLASS:()=>gf,MULTI_VALUED_PREDICATES:()=>AI,NODE_ID_REL:()=>Sf,OPERATOR_SOURCE_ID:()=>Rc,RETRACTED_AT_PROP:()=>fc,RETRACTED_COUNT_PROP:()=>Gd,RETRACTED_RECORD_IDS_PROP:()=>dc,RETRACTION_CLASS:()=>hn,RETRACTION_PREDICATE:()=>uc,ROLLUP_COUNT_PROP:()=>Ei,ROLLUP_EARLIEST_PROP:()=>Jn,ROLLUP_KEEP_PER_TYPE:()=>iw,ROLLUP_LATEST_PROP:()=>Qn,ROLLUP_PRIOR_PROP:()=>Sr,ROLLUP_RECORD_IDS_PROP:()=>xi,ROLLUP_SOURCE_IDS_PROP:()=>Er,RULE_CLASS:()=>Ar,RULE_KIND_ACTION_CONSTRAINT:()=>Cf,RULE_KIND_ACTION_EFFECT:()=>Di,RULE_KIND_ACTION_PRECOND:()=>Oc,RULE_KIND_ACTION_SIGNATURE:()=>Af,RULE_KIND_COMPOSE2:()=>Mi,RULE_KIND_FILTER:()=>Fi,RULE_KIND_PROP:()=>Ir,RULE_KIND_RECURSIVE:()=>Tf,SAID_IN_SESSION_PROP:()=>bf,SOURCE_CLASS:()=>Tr,SOURCE_RELIABILITY_PROP:()=>Dw,STATED_BY_PROP:()=>jn,SYLLOGISE_STATE_REL:()=>Ef,UPDATED_AT_PROP:()=>Gs,UTTERANCE_CLASS:()=>hf,admittedNodes:()=>bc,appendCanonicalisedFromEdges:()=>pI,appendFact:()=>gy,appendFacts:()=>ss,appendRetractions:()=>jI,appendRule:()=>Lc,appendUtterance:()=>fI,appendUtterances:()=>uy,applySeedPayload:()=>Bw,attachFactHeads:()=>Xw,chainRollupIdFor:()=>Fd,cloneMemoryPayload:()=>Ww,closeSqliteMemoryStore:()=>ey,createInMemoryStore:()=>Li,createSqliteMemoryStore:()=>Zw,emptyMemory:()=>Ni,factGroupId:()=>Yt,factHeadsOf:()=>Jw,factIdForTriple:()=>$e,factRecordIdForTag:()=>jC,factRecordIdsFor:()=>Oo,findContradictions:()=>yy,findRuleByName:()=>If,findRulesByName:()=>vI,headRollupIdFor:()=>Md,isChainRollupId:()=>jr,isHeadRollupId:()=>Zs,isMemoryOrSqliteHandle:()=>vf,isRetractionId:()=>Hd,isRollupId:()=>cc,loadMemory:()=>dt,loadNodeId:()=>eI,loadSyllogiseState:()=>QC,normFactPredicate:()=>Yn,normFactTerm:()=>H,openConfiguredMemoryBackend:()=>no,openExistingMemoryBackend:()=>PC,openMemoryBackend:()=>xf,peersToConvince:()=>Jd,provSourceClassFor:()=>sI,provenanceTagToSource:()=>Gn,readFactRows:()=>ht,readObjectSupersessions:()=>OC,readOnlyMemorySnapshot:()=>MC,readRetractions:()=>SI,readRuleRows:()=>Pc,removeFacts:()=>EI,resolveMemoryGraphFile:()=>Ci,resolveRelationChase:()=>Of,resolveRelationChaseReverse:()=>wy,retirableRetractions:()=>kI,retireRetractions:()=>RI,retractedAtOf:()=>To,retractedRecordIds:()=>_o,retractionFromWire:()=>gc,retractionIdFor:()=>Vd,retractionScopeOf:()=>qd,retractionWireFact:()=>hc,saveNodeId:()=>tI,saveSyllogiseState:()=>ZC,snapshotMemory:()=>qC,stableRecordIds:()=>wc});function Ni(){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:EC.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function Ci(e,t=null){if(to(e)||ts(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?ne(e,mf):ne(e,_r,`graph.v${t}.json`)}function to(e){return!!e&&typeof e=="object"&&e.backend===$f}function ts(e){return!!e&&typeof e=="object"&&e.backend===Uw}function vf(e){return to(e)||ts(e)}function Li(){return{backend:$f,payload:Ni()}}function Bw(e,t){t&&(e.payload={...e.payload,...t})}function Ww(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Gw(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=kf(Gn(t));if(n)return n}return{id:Cs,type:""}}function Yt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function jC(e,t){return`${e}@${Vw(t).id}`}function Vw(e){return kf(Gn(e))||{id:Cs,type:""}}function Hw(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=Vw(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(Cs,{sourceId:Cs,sourceType:"",tags:[]}),[...t.values()]}function lf(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Gn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function Cr(e,t="",n=Math.max){return lf(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function kC(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 qw(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Gw(n("mgx:factProvenance")),o=n(Pi).split(" ").filter(Boolean)[0]||null,r=Si(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?Sr:nr))||0,n(ct),n(Ii)||null,o,t]}function RC(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(vt))return;let t=e.prepare(Kw);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(vt))t.run(...qw(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function _C(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Xw(e,t){return e&&t&&(e[Yw]=t),e}function AC(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 Qw(e,t,n,s){let o=e.prepare(TC),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Is();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=_C(Lf(a,c,t).assertions),u=dh(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function CC(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(vt))return;let n=Nf(ty(e));t.exec("BEGIN IMMEDIATE");try{Qw(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function IC(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=Is();for(let i of n){let[a,c]=i.split("\0");if(rc(c)!==vi)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(p=>{let m=Lf(p,t.groups.get(p),t);return m.trust=$a(m.assertions).score,m});if(new Set(u.map(p=>p.object)).size<2)continue;let d=Pd(u,vi)?.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 OC(e,{subject:t,predicate:n}={}){if(!ts(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 LC(){if(Mw)return;Mw=!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 Zw(e){LC();let{DatabaseSync:t}=await Promise.resolve().then(()=>(kw(),jw)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(SC),RC(n);let s={backend:Uw,db:n,dbPath:e};return CC(s),s}function ey(e){ts(e)&&e.db.close()}async function xf(e,t){if(t===$f)return{dir:Li(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>Zl(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,mf))&&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 Dn(we(n),{recursive:!0});let o=await Zw(n);return{dir:o,close:async()=>ey(o)}}async function PC(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await Zl(n)}catch{return null}return xf(e,t)}async function MC(e){if(!e)return null;let t=Li();return Bw(t,Ww(await dt(e))),t}async function no(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Ai(),of));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return xf(e,n)}function FC(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=ty(e),e.cachedFactHeads=AC(e.db),e.cachedDataVersion=t),Xw(Pn(e.cachedPayload),e.cachedFactHeads)}function ty(e){let t=e.db,n=Ni(),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 DC(e,t){let n=Pn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function zC(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function UC(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 BC(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,Pn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function WC(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function GC(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function VC(e,t){let n=e.db,s=Ni(),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=Pn(t.generated_at??s.generated_at),o.memory=Pn(t.memory??s.memory),o.prefixes=Pn(t.prefixes??s.prefixes),o.vocabulary=Pn(t.vocabulary??s.vocabulary),o.classes=Pn(t.classes??s.classes),o.proseIndex=Pn(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(Kw),d=new Set,f=new Set,p=new Set;for(let S of t.individuals||[]){d.add(S.id);let A=JSON.stringify(S),w=i.get(S.id);if(w&&w.json===A)continue;let T=w?w.ord:c++;l.run(S.id,T,S.class??null,S.label??null,A),S.class===vt&&(u.run(...qw(S,A)),f.add(Yt(S.id)),p.add(uf(Oi(S,"subject"),Oi(S,"predicate")))),o&&DC(o,S)}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 S of n.prepare("SELECT id FROM individuals").all()){if(d.has(S.id))continue;let A=g.get(S.id);A&&(f.add(A.triple_hash),p.add(uf(A.subject,A.predicate))),m.run(S.id),h.run(S.id)}o&&zC(o,d);let b=n.prepare("SELECT ord FROM relations WHERE prop = ?"),y=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,x=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),C=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 = ?"),E=new Set;for(let S of t.objectProperties||[]){E.add(S.prop);let A=C.all(S.prop),w=new Map(A.map(L=>[`${L.subject}\0${L.object}`,L])),T=new Set,O=o?UC(o,S.prop):null;for(let L of S.examples||[]){let B=`${L.subject}\0${L.object}`;T.add(B);let V=Object.keys(L).filter(P=>!NC.has(P)),K=V.length?JSON.stringify(Object.fromEntries(V.map(P=>[P,L[P]]))):null,Y=w.get(B);Y&&(Y.subject_label??null)===(L.subjectLabel??null)&&(Y.object_label??null)===(L.objectLabel??null)&&(Y.extra??null)===(K??null)||(v.run(S.prop,L.subject,L.object,L.subjectLabel??null,L.objectLabel??null,K),O&&BC(O,L,V))}for(let L of w.keys()){if(T.has(L))continue;let[B,V]=L.split("\0");j.run(S.prop,B,V)}O&&WC(O,T);let R=Number.isFinite(S.count)?S.count:(S.examples||[]).length,k=b.get(S.prop)?.ord??y++;x.run(S.prop,k,S.predicate??null,R),O&&(O.predicate=S.predicate??null,O.count=R)}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&&GC(o,E),f.size){let S=Nf(t);Qw(n,S,f,e.cachedFactHeads),IC(n,S,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function ny(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Ko(n,t),await da(n,e)}async function Ac(e,t){await ny(e,JSON.stringify(t))}async function qC(e,{retentionVersions:t}={}){if(vf(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=Ci(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=HC(e),r;try{r=JSON.parse(await Ae(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??df}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??df);let i=r.version,a=Ci(e,i);await Dn(we(a),{recursive:!0}),await ny(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await eu(Ci(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Ac(o,r),{skipped:!1,version:i,prunedVersion:c}}async function dt(e){if(to(e))return rf(e.payload);if(ts(e))return rf(FC(e));let t;try{t=await Ae(cf(e),"utf8")}catch(n){if(n?.code==="ENOENT")return Ni();throw n}return rf(JSON.parse(t))}function YC(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==vt||!KC.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 XC(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===jn),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!==vt||String(c.id||"").includes("@")){a.push(c);continue}let l=y=>(c.attributes||[]).find(x=>x?.prop===y)?.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(ct),h=l("mgx:factProvenance"),g=n.get(c.id)||[],b=h?Hw(h):[];for(let y of g)b.some(x=>x.sourceId===y.object)||b.push({sourceId:y.object,sourceType:"",tags:[]});b.length||b.push({sourceId:Cs,sourceType:"",tags:[]});let $=[];for(let y of b){let x={id:`${p}@${y.sourceId}`,label:c.label,class:vt,derived_from:Pn(c.derived_from)||[],mentions:Pn(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:ct,key:"createdAt",value:Cr(y.tags,m,Math.min)||m||Is()},{prop:Io,key:"sourceId",value:y.sourceId},...y.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:y.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")}]:[],...y.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(x),r.push(x),$.push(x.id),y.sourceId!==Cs){let C=g.find(v=>v?.object===y.sourceId);i.push({...C||{},subject:x.id,object:y.sourceId,subjectLabel:x.label,objectLabel:Rf(y.sourceId)})}}s.add(c.id),o.set(c.id,$)}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:jn,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===jn||!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,iy(e);for(let c of r)Rr(e,c);return ns(e),e}async function JC(e,t){if(to(e)){e.payload=t;return}if(ts(e)){VC(e,t);return}await Dn(we(cf(e)),{recursive:!0}),await Ac(cf(e),t)}async function QC(e){if(to(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(ts(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(oy);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Ae(ne(e,Ef),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function ZC(e,t){if(to(e)){e.syllogiseState=structuredClone(t);return}if(ts(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(oy,JSON.stringify(t));return}let n=ne(e,Ef);await Dn(we(n),{recursive:!0}),await Ac(n,t)}async function eI(e){if(to(e))return e.nodeId||null;if(ts(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(ry);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Ae(ne(e,Sf),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function tI(e,t){if(to(e)){e.nodeId=t;return}if(ts(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(ry,JSON.stringify({nodeId:t}));return}let n=ne(e,Sf);await Dn(we(n),{recursive:!0}),await Ac(n,{nodeId:t})}function iy(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===Tr&&n.set(a.id,a),a.class===hn&&pf(r,a),a.class===vt)){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===jn);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[ff]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[ff]}function pf(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 nI(e,t){let n=Xt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===hn&&Yt(s.id)===t)}async function Ns(e,t){let n=await dt(e);iy(n);let s=await t(n)??n;return aI(s),lI(s),s.proseIndex=Zm(s.individuals),await JC(e,s),s}function jf(e,t){return e?.attributes?.find(n=>n?.prop===ct)?.value||t||Is()}function kn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function kf(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Rc}:${e.sessionId}`:Rc,type:"operator"};case"teach":return{id:e.sessionId?`${af}:${e.sessionId}`:af,type:"teach"};case"teachNode":return{id:`${zw}:${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:${wi(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 sI(e){return uu[e]||null}function oI(e,t,n){let s=kf(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=jf(r,t?.createdAt||n),a={id:s.id,label:Rf(s.id),class:Tr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:ct,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=Os(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Ic(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===Tr&&(n[s.id]=s);return n}function ay(e,t){let n=Xt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===jn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function rI(e,t,n=Date.now(),s={}){let o=ay(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===ct)?.value||"",{score:i,inputs:a}=uh({sourceIds:o,createdAt:r},Ic(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});kn(t,nr,"trustScore",String(i)),kn(t,wa,"trustInputs",JSON.stringify(a)),kn(t,Gs,"updatedAt",new Date(n).toISOString())}function iI(e,t,n=Date.now(),s={}){let[o]=ay(e,t.id),r=o?Ic(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=ya(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===ct)?.value||"";kn(t,nr,"trustScore",String(a)),kn(t,wa,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),kn(t,Gs,"updatedAt",new Date(n).toISOString())}function cy(e,t,n,s){t?.class===vt?iI(e,t,n,s):rI(e,t,n,s)}function Rr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===ct)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Gn(i);if(!a)continue;let c=oI(e,a,r);c&&Tc(e,{predicate:"statedBy",prop:jn},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:Rf(c)})}cy(e,t,n,s)}function aI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===jn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==vt||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(Rr(e,r,o),s=!0);s&&ns(e)}function lI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=ht(e),n=new Set;for(let a of yy(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(!cI(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&&(kn(l,Dw,"sourceReliability",String(fh(c))),kn(l,Gs,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===jn),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&&cy(e,c)}}function uI(e,t,n){if(!cc(n?.id))return n;let s=Si(n.id);if(!s)return Bd(t,n);let o=Ic(e);return Bd(t,n,{priorFor:r=>ya(s,o[r])})}function Fw(e,t,n){return n?.class===hn?$w(t,n):uI(e,t,n)}function Os(e,t){let n=Xt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,Fw(e,o,t)),o.class===hn&&pf(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===hn&&pf(n.retractionsByGroup,t),t.class===vt){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]=Fw(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Tc(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===jn?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||Is()}),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||Is();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 ns(e){let t=[gf,hf,vt,Tr,Ar];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 dI(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:gf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:ct,key:"createdAt",value:n||Is()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function ly(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!xC.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=_s(n),d=`utt:${o}#${l}#${t}`,f=Cc(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=ba({doc:u}),m=e.individuals.find($=>$?.id===d),h=jf(m,c||l),g={id:d,label:f,class:hf,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:ct,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(" ")}]:[]]};Os(e,g);let b=dI(e,o,r);if(Tc(e,{predicate:"saidInSession",prop:bf},{subject:d,object:b,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let $=e.individuals.find(y=>y?.id===a);$&&Tc(e,{predicate:"inReplyTo",prop:wf},{subject:d,object:a,subjectLabel:f,objectLabel:$.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function fI(e,t){let n;return await Ns(e,s=>{n=ly(s,t),ns(s)}),{id:n}}async function uy(e,t){let n=[];return t?.length?(await Ns(e,s=>{for(let o of t)n.push(ly(s,o));ns(s)}),{ids:n}):{ids:n}}async function pI(e,t){t?.length&&await Ns(e,n=>{for(let s of t)for(let o of Oo(n,s.factId))Tc(n,{predicate:"canonicalisedFrom",prop:yf},{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===vt&&Yt(s.id)===t).map(s=>s.id)}function dy(e,t,n,s=""){let o=Hw(n);if(o.length===1&&o[0].sourceId===Cs&&Oo(e,t).length)return[];let r=nI(e,t);if(r.length&&(o=o.filter(a=>!mc(r,`${t}@${a.sourceId}`,Cr(a.tags,s))),!o.length))return o;let i=mI(e,t);return i.length?o.filter(a=>!gw(i,a.sourceId)):o}function mI(e,t){let n=Xt(e),s=n?n.factRecordsByGroup.get(t):Oo(e,t),o=[];for(let r of s||[]){if(!Zs(r))continue;let i=eo(e,r);i&&o.push(i)}return o}function fy(e,t,{quantifier:n,environments:s}){let o=Oo(e,t).map(i=>eo(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===Pi)),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)kn(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")||(kn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function hI(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===_c)?.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 py(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(A=>A?.id===p),g=A=>(h?.attributes||[]).find(w=>w?.prop===A)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),$={assertedAt:lf(c.tags),observedAt:u},y=null,x=c.tags,C=$.assertedAt||l||Is(),v=u,j=[],E=d;if(h){let A={assertedAt:lf(b),observedAt:g(Ii)};kC($,A)?(y={head:h,id:`${p}#v${hI(h)}`},j=[y.id]):(x=[...new Set([...b,...c.tags])],C=g(ct)||C,v=u||g(Ii),j=g(_c).split(" ").filter(Boolean)),E=d||g("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:vt,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:ct,key:"createdAt",value:C},{prop:Io,key:"sourceId",value:c.sourceId},...x.length?[{prop:"mgx:factProvenance",key:"provenance",value:x.join(" | ")}]:[],...v?[{prop:Ii,key:"observedAt",value:v}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...E?[{prop:"mgx:factQuantifier",key:"quantifier",value:E}]:[],...f?[{prop:"mgx:factJustification",key:"justification",value:f.map(A=>A.join(" ")).join(" | ")}]:[],...j.length?[{prop:_c,key:"supersedes",value:j.join(" ")}]:[]]},demote:y}}function gI(e,t){let n=`${t}@${Cs}`,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 my(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Cs}`)||gI(e,Yt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};kn(o,Pi,"supersededBy",t.id),Os(e,o),s.push(o.id)}return Os(e,t),s.push(t.id),s}function eo(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 hy(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=eo(e,u);if(!d)continue;let f=$=>(d.attributes||[]).find(y=>y?.prop===$)?.value||"";if(Zs(u)){i.set(Si(u),d);continue}if(jr(u)){a.set(f(Io),d);continue}let p=f("mgx:factProvenance"),m=Gw(p),h=p.split(" | ").filter(Boolean),g={id:u,sourceId:f(Io)||m.id,assertedAt:Cr(h,f(ct)),record:d};if(f(Pi)){let $=r.get(g.sourceId);$?$.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=Ic(e),l=[];for(let[u,d]of o){let f=mw({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>ya(u,c[p])});if(f){Os(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=hw({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;Os(e,f.rollup),l.push(...f.absorbed);let p=eo(e,f.rewire);p&&kn(p,_c,"supersedes",f.rollup.id)}return l}async function gy(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:c,ruleConfidence:l}={}){let u=H(t),d=Yn(n),f=H(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=ba({doc:m}),g=_s(a);return await Ns(e,async b=>{let $=dy(b,p,_s(o),r);for(let y of $.length?[]:fy(b,p,{quantifier:g}))Rr(b,eo(b,y),void 0,{premiseTrusts:c,ruleConfidence:l});for(let y of $){let x=py(b,{groupId:p,s:u,p:d,o:f,label:Cc(m),tokens:h,group:y,createdAt:r,observedAt:i,quantifier:g});await Zd(x.candidate);for(let C of my(b,x))Rr(b,eo(b,C),void 0,C===x.candidate.id?{premiseTrusts:c,ruleConfidence:l}:void 0)}_f(b,hy(b,p)),ns(b)}),{id:p}}function bI(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 ss(e,t){let n=[],s=0;for(let r of t||[]){let i=H(r?.subject),a=Yn(r?.predicate),c=H(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:ba({doc:l}),provenance:_s(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:_s(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:bI(r?.justification)})}let o=[];return n.length?(await Ns(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=dy(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:fy(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=py(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Cc(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let m of my(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)Rr(r,eo(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...hy(r,u));_f(r,l),ns(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=by[n];if(!i)throw new Error(`a rule kind must be one of ${wI.join(", ")}, got ${JSON.stringify(n)}`);let a=H(t);if(!a)throw new Error("a rule needs a name");let c=yI[n]||new Set,l=i.map(([p])=>H(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===Di){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=$I(n,a,l),f=Cc(`${a} = ${n}(${l.join(", ")})`);return await Ns(e,async p=>{let m=p.individuals.find(y=>y?.id===d),h=m?.attributes?.find(y=>y?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),_s(o)].filter(Boolean))],b=jf(m,r),$={id:d,label:f,class:Ar,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Nc,key:"ruleName",value:a},{prop:Ir,key:"ruleKind",value:n},...i.map(([y,x],C)=>({prop:x,key:y,value:l[C],skip:!l[C]&&c.has(y)})).filter(y=>!y.skip).map(({skip:y,...x})=>x),{prop:ct,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await Zd($),Os(p,$),Rr(p,p.individuals.find(y=>y?.id===d)),ns(p)}),{id:d}}function If(e,t){let n=H(t);return(e?.individuals||[]).find(s=>s?.class===Ar&&(s.attributes||[]).find(o=>o?.prop===Nc)?.value===n)}function vI(e,t){let n=H(t),s=o=>(o.attributes||[]).find(r=>r?.prop===Ir)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===Ar&&(o.attributes||[]).find(r=>r?.prop===Nc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Pc(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Ar)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(Ir),r=by[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Nc)||"",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 Of(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(H,n),h=c(H,s),g=r(p).filter(y=>m.has(y.fact.subject)&&h.has(y.fact.object));if(g.length){let y=g.slice().sort((x,C)=>l(x.fact,C.fact))[0];return{citation:[i(y.fact),...y.aliasFacts.map(x=>`${a(x)}${x.provenance?` (source: ${x.provenance})`:""}`)]}}let b=If(e,p),$=b?.attributes?.find(y=>y.prop===Ir)?.value;if(b&&$===Mi){let y=b.attributes.find(O=>O.prop==="mgx:ruleBase1")?.value,x=b.attributes.find(O=>O.prop==="mgx:ruleBase2")?.value,C=H(n),v=H(s);if(!y||!x||!C||!v)return null;let A=f({entity:C,hopsTaken:0},O=>O.hopsTaken===2&&O.entity===v,O=>{if(O.hopsTaken>=2)return[];let R=O.hopsTaken===0?y:x;return r(R).filter(k=>k.fact.subject===O.entity).map(k=>({action:k,nextState:{entity:k.fact.object,hopsTaken:O.hopsTaken+1}}))},{maxDepth:2,stateKey:O=>`${O.entity}#${O.hopsTaken}`});if(!A)return null;let w=new Set,T=[];for(let O of A.actions){T.push(i(O.fact));for(let R of O.aliasFacts){let k=R.id||`${R.subject}|${R.predicate}|${R.object}`;w.has(k)||(w.add(k),T.push(`${a(R)}${R.provenance?` (source: ${R.provenance})`:""}`))}}return{citation:T}}if(b&&$===Fi){let y=b.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,x=b.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!y||!x)return null;let C=await Of(e,y,n,s,o);if(!C)return null;let v=H(n),j=H(x),E=u.find(S=>S.predicate===d&&S.subject===v&&H(S.object)===j);return E?{citation:[...C.citation,i(E)]}:null}return null}async function wy(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(H,n),m=o(f).filter(b=>p.has(b.fact.object));if(m.length){let b=new Map;for(let $ of m)b.has($.fact.subject)||b.set($.fact.subject,[]),b.get($.fact.subject).push($);return[...b.entries()].map(([$,y])=>{let x=y.slice().sort((C,v)=>c(C.fact,v.fact))[0];return{subject:$,citation:[r(x.fact),...x.aliasFacts.map(C=>`${i(C)}${C.provenance?` (source: ${C.provenance})`:""}`)]}})}let h=If(e,f),g=h?.attributes?.find(b=>b.prop===Ir)?.value;if(h&&g===Mi){let b=h.attributes.find(j=>j.prop==="mgx:ruleBase1")?.value,$=h.attributes.find(j=>j.prop==="mgx:ruleBase2")?.value,y=H(n);return!b||!$||!y?[]:d({entity:y,hopsTaken:0},j=>{if(j.hopsTaken>=2)return[];let E=j.hopsTaken===0?$:b;return o(E).filter(S=>S.fact.object===j.entity).map(S=>({action:S,nextState:{entity:S.fact.subject,hopsTaken:j.hopsTaken+1}}))},{maxDepth:2,stateKey:j=>`${j.entity}#${j.hopsTaken}`}).filter(j=>j.node.hopsTaken===2).map(({node:j,path:E})=>{let S=new Set,A=[];for(let w of E.actions.slice().reverse()){A.push(r(w.fact));for(let T of w.aliasFacts){let O=T.id||`${T.subject}|${T.predicate}|${T.object}`;S.has(O)||(S.add(O),A.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:j.entity,citation:A}})}if(h&&g===Fi){let b=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,$=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!b||!$)return[];let y=await wy(e,b,n,s),x=H($),C=[];for(let v of y){let j=H(v.subject),E=l.find(S=>S.predicate===u&&S.subject===j&&H(S.object)===x);E&&C.push({subject:v.subject,citation:[...v.citation,r(E)]})}return C}return[]}function ht(e,t={}){let n=Nf(e),s=Jw(e),o=[];for(let[r,i]of n.groups){let a=Lf(r,i,n),c=s?.get(r);a.trust=$a(c?c.inputs:a.assertions,t).score,o.push(a)}return o}function Nf(e){let t=e?.individuals||[],n=new Map(t.filter(c=>c?.class===Tr).map(c=>[c.id,c])),s=(e?.objectProperties||[]).find(c=>c?.prop===jn),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===hn){let d=Yt(c.id),f=i.get(d);f?f.push(c):i.set(d,[c]);continue}if(c?.class!==vt||(c.attributes||[]).some(d=>d?.prop===Pi)||jr(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=>!mc(l,f.id,Cr(es(f,"mgx:factProvenance").split(" | ").filter(Boolean),es(f,ct))));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=uf(Oi(l[0],"subject"),Oi(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 Lf(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=es,i=Oi,a=[],c=[],l=[],u=new Set,d=[],f=new Set,p="";for(let g of t){if(Zs(g.id)){let j=Si(g.id),E=lc(g);for(let S of E)c.includes(S)||(c.push(S),j&&l.push(j));a.push({id:g.id,sourceId:"",sourceType:j,provenance:"",createdAt:r(g,Jn),ownTrust:Number(r(g,Sr))||0,assertedAt:r(g,Qn),rollup:{count:Number(r(g,Ei))||E.length,sourceIds:E,earliest:r(g,Jn),latest:r(g,Qn)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let j of b)u.add(j);let[$]=s.get(g.id)||[],y=$||r(g,Io),x=o(y);$&&!c.includes($)&&(c.push($),x&&l.push(x));let C=r(g,ct),v=r(g,Ii);a.push({id:g.id,sourceId:y,sourceType:x,provenance:b.join(" | "),createdAt:C,...v?{observedAt:v}:{},ownTrust:Number(r(g,nr))||0,assertedAt:Cr(b,C)}),p=p||i(g,"quantifier");for(let j of i(g,"justification").split(" | ")){let E=j.split(" ").filter(Boolean);if(!E.length)continue;let S=E.join(" ");f.has(S)||(f.add(S),d.push(E))}}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 xI(e){let t=es(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 EI(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||Is();return await Ns(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(f=>{if(f?.class!==vt)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=xI(f),g=`${p}\0${h}`,b=es(f,"mgx:factProvenance"),$=d.get(g);return $?($.ids.push(f.id),b&&$.tags.push(b)):d.set(g,{groupId:p,sourceId:h,ids:[f.id],tags:b?[b]:[],template:{label:f.label||"",subject:es(f,"rdf:subject"),predicate:es(f,"rdf:predicate"),object:es(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=yw({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&Os(c,p)}ns(c)}}),{removed:r,records:i}}function SI(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==hn)continue;let s=hc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function jI(e,t){let n=[];for(let o of t||[]){let r=gc(o);r&&n.push(r)}let s=[];return n.length?(await Ns(e,o=>{let r=new Map;for(let a of n){let c=Os(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=eo(o,l);if(!u)continue;let d=es(u,"mgx:factProvenance").split(" | ").filter(Boolean);mc(c,l,Cr(d,es(u,ct)))&&i.add(l)}if(i.size){_f(o,i);for(let a of i)s.push(a)}ns(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function kI(e,{self:t="",acknowledgedBy:n=null}={}){let s=bc(ht(e)),o=[];for(let r of e?.individuals||[])r?.class===hn&&r.id&&o.push(r.id);return{roster:s,retirable:wc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function RI(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Ns(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==hn||!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)}ns(o)}),{retired:s}):{retired:s}}function yy(e,{floor:t=_I}={}){let n=ht(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(rc(r.predicate)===Od)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=rc(r[0].predicate);i!==Nd&&!Pd(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 _r,mf,hf,vt,gf,Tr,Ar,bf,wf,vC,jn,yf,Dw,Rc,af,zw,xC,Pw,EC,cf,$f,Uw,SC,Cs,Ii,Io,_c,Pi,Kw,es,Oi,uf,Yw,Jw,TC,NC,Mw,Pn,sy,df,HC,rf,KC,Ef,oy,Sf,ry,ff,Xt,Cc,Is,Rf,cI,Mi,Fi,Tf,Af,Oc,Di,Cf,wI,Nc,Ir,by,yI,$I,_I,Or,TI,AI,Ke=M(()=>{Nt();Xe();Ws();ot();ot();Vn();ow();Vn();oc();Wd();Yd();Qd();Sw();Wd();Yd();Qd();_r=ne(".tmct","memory"),mf=ne(_r,"graph.json"),hf="Utterance",vt="Fact",gf="Session",Tr="Source",Ar="Rule",bf="mgx:saidInSession",wf="mgx:inReplyTo",vC="mgx:derivedFrom",jn="mgx:statedBy",yf="mgx:canonicalisedFrom",Dw="mgx:sourceReliability",Rc="src:operator-chat",af="src:teach-chat",zw="src:teach-node",xC=new Set(["visitor","tmct"]),Pw=48,EC=[{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:bf,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:wf,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:ct,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:Gs,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:vC,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:jn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:yf,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:nr,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:wa,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:yr,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)"}];cf=e=>Ci(e),$f="memory",Uw="sqlite";SC=`
104
+ `&&r!=="\r"){let i=Ti(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new ye("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var yC,sf=M(()=>{tf();nf();vc();Ao();yC=/^[a-zA-Z0-9-_]+[ \t]*$/});function Cw(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=Zn(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=xc(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new ye("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=Cw(l[0],s,o,c?2:1);if(!u)throw new ye("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=xc(e,a),l=Cw(c[0],r,i,0);if(!l)throw new ye("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=Ti(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=Zn(e,a,!0),e[a]&&e[a]!==`
105
+ `&&e[a]!=="\r")throw new ye("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=Zn(e,a)}return s}var Iw=M(()=>{sf();nf();vc();Ao();});var Ow=M(()=>{});var Ec=M(()=>{Iw();Ow();ef();Ao();});var of={};Ot(of,{CONFIG_FILE:()=>jc,loadTomlConfig:()=>kc,mergeEffective:()=>Lw,normalizeConfig:()=>Nw});async function kc(e,{file:t}={}){let n=t||ne(e,jc),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 ${jc} at ${n}: ${o&&o.message?o.message:o}`)}}async function $C(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 Nw(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await $C(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 y=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=y.map(x=>Ut(s,String(x)))}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 $=[];for(let[y,x]of vC)n[y]&&n[y][x]!==void 0&&$.push(`${y}.${x}`);return o.unwired=$,o}function Sc(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:Sc(o,r,n)}return n}function Lw({args:e={},toml:t=null,defaults:n={}}={}){let s=Sc(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Sc(o):{},i=Sc(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 jc,vC,Ai=M(()=>{Nt();Xe();Ec();jc="tmct.toml";vC=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ls={};Ot(Ls,{CANONICALISED_FROM_PROP:()=>yf,CAPABLE_OF_PREDICATE:()=>TI,CHAIN_KEEP_DEPTH:()=>aw,CHAIN_ROLLUP_THRESHOLD:()=>ac,CREATED_AT_PROP:()=>ct,DEFAULT_RETENTION:()=>df,FACT_CLASS:()=>vt,GROUP_ROLLUP_THRESHOLD:()=>rw,HAS_A_PREDICATE:()=>Or,IN_REPLY_TO_PROP:()=>wf,MEMORY_DIR_REL:()=>_r,MEMORY_GRAPH_REL:()=>mf,MEMORY_MANIFEST_REL:()=>sy,MEMORY_SESSION_CLASS:()=>gf,MULTI_VALUED_PREDICATES:()=>AI,NODE_ID_REL:()=>Sf,OPERATOR_SOURCE_ID:()=>Rc,RETRACTED_AT_PROP:()=>fc,RETRACTED_COUNT_PROP:()=>Gd,RETRACTED_RECORD_IDS_PROP:()=>dc,RETRACTION_CLASS:()=>hn,RETRACTION_PREDICATE:()=>uc,ROLLUP_COUNT_PROP:()=>Ei,ROLLUP_EARLIEST_PROP:()=>Jn,ROLLUP_KEEP_PER_TYPE:()=>iw,ROLLUP_LATEST_PROP:()=>Qn,ROLLUP_PRIOR_PROP:()=>Sr,ROLLUP_RECORD_IDS_PROP:()=>xi,ROLLUP_SOURCE_IDS_PROP:()=>Er,RULE_CLASS:()=>Ar,RULE_KIND_ACTION_CONSTRAINT:()=>Cf,RULE_KIND_ACTION_EFFECT:()=>Di,RULE_KIND_ACTION_PRECOND:()=>Oc,RULE_KIND_ACTION_SIGNATURE:()=>Af,RULE_KIND_COMPOSE2:()=>Mi,RULE_KIND_FILTER:()=>Fi,RULE_KIND_PROP:()=>Ir,RULE_KIND_RECURSIVE:()=>Tf,SAID_IN_SESSION_PROP:()=>bf,SOURCE_CLASS:()=>Tr,SOURCE_RELIABILITY_PROP:()=>Dw,STATED_BY_PROP:()=>jn,SYLLOGISE_STATE_REL:()=>Ef,UPDATED_AT_PROP:()=>Gs,UTTERANCE_CLASS:()=>hf,admittedNodes:()=>bc,appendCanonicalisedFromEdges:()=>mI,appendFact:()=>gy,appendFacts:()=>ss,appendRetractions:()=>jI,appendRule:()=>Lc,appendUtterance:()=>pI,appendUtterances:()=>uy,applySeedPayload:()=>Bw,attachFactHeads:()=>Xw,chainRollupIdFor:()=>Fd,cloneMemoryPayload:()=>Ww,closeSqliteMemoryStore:()=>ey,createInMemoryStore:()=>Li,createSqliteMemoryStore:()=>Zw,emptyMemory:()=>Ni,factGroupId:()=>Yt,factHeadsOf:()=>Jw,factIdForTriple:()=>$e,factRecordIdForTag:()=>kC,factRecordIdsFor:()=>Oo,findContradictions:()=>$y,findRuleByName:()=>If,findRulesByName:()=>xI,headRollupIdFor:()=>Md,isChainRollupId:()=>jr,isHeadRollupId:()=>Zs,isMemoryOrSqliteHandle:()=>vf,isRetractionId:()=>Hd,isRollupId:()=>cc,loadMemory:()=>dt,loadNodeId:()=>tI,loadSyllogiseState:()=>ZC,normFactPredicate:()=>Yn,normFactTerm:()=>H,openConfiguredMemoryBackend:()=>no,openExistingMemoryBackend:()=>MC,openMemoryBackend:()=>xf,peersToConvince:()=>Jd,provSourceClassFor:()=>oI,provenanceTagToSource:()=>Gn,readFactRows:()=>ht,readObjectSupersessions:()=>NC,readOnlyMemorySnapshot:()=>FC,readRetractions:()=>SI,readRuleRows:()=>Pc,removeFacts:()=>yy,resolveMemoryGraphFile:()=>Ci,resolveRelationChase:()=>Of,resolveRelationChaseReverse:()=>wy,retirableRetractions:()=>kI,retireRetractions:()=>RI,retractedAtOf:()=>To,retractedRecordIds:()=>_o,retractionFromWire:()=>gc,retractionIdFor:()=>Vd,retractionScopeOf:()=>qd,retractionWireFact:()=>hc,saveNodeId:()=>nI,saveSyllogiseState:()=>eI,snapshotMemory:()=>KC,stableRecordIds:()=>wc});function Ni(){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:SC.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function Ci(e,t=null){if(to(e)||ts(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?ne(e,mf):ne(e,_r,`graph.v${t}.json`)}function to(e){return!!e&&typeof e=="object"&&e.backend===$f}function ts(e){return!!e&&typeof e=="object"&&e.backend===Uw}function vf(e){return to(e)||ts(e)}function Li(){return{backend:$f,payload:Ni()}}function Bw(e,t){t&&(e.payload={...e.payload,...t})}function Ww(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Gw(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=kf(Gn(t));if(n)return n}return{id:Cs,type:""}}function Yt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function kC(e,t){return`${e}@${Vw(t).id}`}function Vw(e){return kf(Gn(e))||{id:Cs,type:""}}function Hw(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=Vw(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(Cs,{sourceId:Cs,sourceType:"",tags:[]}),[...t.values()]}function lf(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Gn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function Cr(e,t="",n=Math.max){return lf(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function RC(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 qw(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Gw(n("mgx:factProvenance")),o=n(Pi).split(" ").filter(Boolean)[0]||null,r=Si(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?Sr:nr))||0,n(ct),n(Ii)||null,o,t]}function _C(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(vt))return;let t=e.prepare(Kw);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(vt))t.run(...qw(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function TC(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Xw(e,t){return e&&t&&(e[Yw]=t),e}function CC(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 Qw(e,t,n,s){let o=e.prepare(AC),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Is();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=TC(Lf(a,c,t).assertions),u=dh(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function IC(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(vt))return;let n=Nf(ty(e));t.exec("BEGIN IMMEDIATE");try{Qw(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function OC(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=Is();for(let i of n){let[a,c]=i.split("\0");if(rc(c)!==vi)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(p=>{let m=Lf(p,t.groups.get(p),t);return m.trust=$a(m.assertions).score,m});if(new Set(u.map(p=>p.object)).size<2)continue;let d=Pd(u,vi)?.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 NC(e,{subject:t,predicate:n}={}){if(!ts(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 PC(){if(Mw)return;Mw=!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 Zw(e){PC();let{DatabaseSync:t}=await Promise.resolve().then(()=>(kw(),jw)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(jC),_C(n);let s={backend:Uw,db:n,dbPath:e};return IC(s),s}function ey(e){ts(e)&&e.db.close()}async function xf(e,t){if(t===$f)return{dir:Li(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>Zl(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,mf))&&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 Dn(we(n),{recursive:!0});let o=await Zw(n);return{dir:o,close:async()=>ey(o)}}async function MC(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await Zl(n)}catch{return null}return xf(e,t)}async function FC(e){if(!e)return null;let t=Li();return Bw(t,Ww(await dt(e))),t}async function no(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Ai(),of));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return xf(e,n)}function DC(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=ty(e),e.cachedFactHeads=CC(e.db),e.cachedDataVersion=t),Xw(Pn(e.cachedPayload),e.cachedFactHeads)}function ty(e){let t=e.db,n=Ni(),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 zC(e,t){let n=Pn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function UC(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function BC(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 WC(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,Pn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function GC(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function VC(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function HC(e,t){let n=e.db,s=Ni(),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=Pn(t.generated_at??s.generated_at),o.memory=Pn(t.memory??s.memory),o.prefixes=Pn(t.prefixes??s.prefixes),o.vocabulary=Pn(t.vocabulary??s.vocabulary),o.classes=Pn(t.classes??s.classes),o.proseIndex=Pn(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(Kw),d=new Set,f=new Set,p=new Set;for(let S of t.individuals||[]){d.add(S.id);let A=JSON.stringify(S),w=i.get(S.id);if(w&&w.json===A)continue;let T=w?w.ord:c++;l.run(S.id,T,S.class??null,S.label??null,A),S.class===vt&&(u.run(...qw(S,A)),f.add(Yt(S.id)),p.add(uf(Oi(S,"subject"),Oi(S,"predicate")))),o&&zC(o,S)}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 S of n.prepare("SELECT id FROM individuals").all()){if(d.has(S.id))continue;let A=g.get(S.id);A&&(f.add(A.triple_hash),p.add(uf(A.subject,A.predicate))),m.run(S.id),h.run(S.id)}o&&UC(o,d);let b=n.prepare("SELECT ord FROM relations WHERE prop = ?"),y=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,x=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),C=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 = ?"),E=new Set;for(let S of t.objectProperties||[]){E.add(S.prop);let A=C.all(S.prop),w=new Map(A.map(L=>[`${L.subject}\0${L.object}`,L])),T=new Set,O=o?BC(o,S.prop):null;for(let L of S.examples||[]){let B=`${L.subject}\0${L.object}`;T.add(B);let V=Object.keys(L).filter(P=>!LC.has(P)),K=V.length?JSON.stringify(Object.fromEntries(V.map(P=>[P,L[P]]))):null,Y=w.get(B);Y&&(Y.subject_label??null)===(L.subjectLabel??null)&&(Y.object_label??null)===(L.objectLabel??null)&&(Y.extra??null)===(K??null)||(v.run(S.prop,L.subject,L.object,L.subjectLabel??null,L.objectLabel??null,K),O&&WC(O,L,V))}for(let L of w.keys()){if(T.has(L))continue;let[B,V]=L.split("\0");j.run(S.prop,B,V)}O&&GC(O,T);let R=Number.isFinite(S.count)?S.count:(S.examples||[]).length,k=b.get(S.prop)?.ord??y++;x.run(S.prop,k,S.predicate??null,R),O&&(O.predicate=S.predicate??null,O.count=R)}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&&VC(o,E),f.size){let S=Nf(t);Qw(n,S,f,e.cachedFactHeads),OC(n,S,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function ny(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Ko(n,t),await da(n,e)}async function Ac(e,t){await ny(e,JSON.stringify(t))}async function KC(e,{retentionVersions:t}={}){if(vf(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=Ci(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=qC(e),r;try{r=JSON.parse(await Ae(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??df}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??df);let i=r.version,a=Ci(e,i);await Dn(we(a),{recursive:!0}),await ny(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await eu(Ci(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Ac(o,r),{skipped:!1,version:i,prunedVersion:c}}async function dt(e){if(to(e))return rf(e.payload);if(ts(e))return rf(DC(e));let t;try{t=await Ae(cf(e),"utf8")}catch(n){if(n?.code==="ENOENT")return Ni();throw n}return rf(JSON.parse(t))}function XC(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==vt||!YC.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 JC(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===jn),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!==vt||String(c.id||"").includes("@")){a.push(c);continue}let l=y=>(c.attributes||[]).find(x=>x?.prop===y)?.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(ct),h=l("mgx:factProvenance"),g=n.get(c.id)||[],b=h?Hw(h):[];for(let y of g)b.some(x=>x.sourceId===y.object)||b.push({sourceId:y.object,sourceType:"",tags:[]});b.length||b.push({sourceId:Cs,sourceType:"",tags:[]});let $=[];for(let y of b){let x={id:`${p}@${y.sourceId}`,label:c.label,class:vt,derived_from:Pn(c.derived_from)||[],mentions:Pn(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:ct,key:"createdAt",value:Cr(y.tags,m,Math.min)||m||Is()},{prop:Io,key:"sourceId",value:y.sourceId},...y.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:y.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")}]:[],...y.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(x),r.push(x),$.push(x.id),y.sourceId!==Cs){let C=g.find(v=>v?.object===y.sourceId);i.push({...C||{},subject:x.id,object:y.sourceId,subjectLabel:x.label,objectLabel:Rf(y.sourceId)})}}s.add(c.id),o.set(c.id,$)}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:jn,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===jn||!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,iy(e);for(let c of r)Rr(e,c);return ns(e),e}async function QC(e,t){if(to(e)){e.payload=t;return}if(ts(e)){HC(e,t);return}await Dn(we(cf(e)),{recursive:!0}),await Ac(cf(e),t)}async function ZC(e){if(to(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(ts(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(oy);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await Ae(ne(e,Ef),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function eI(e,t){if(to(e)){e.syllogiseState=structuredClone(t);return}if(ts(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(oy,JSON.stringify(t));return}let n=ne(e,Ef);await Dn(we(n),{recursive:!0}),await Ac(n,t)}async function tI(e){if(to(e))return e.nodeId||null;if(ts(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(ry);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await Ae(ne(e,Sf),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function nI(e,t){if(to(e)){e.nodeId=t;return}if(ts(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(ry,JSON.stringify({nodeId:t}));return}let n=ne(e,Sf);await Dn(we(n),{recursive:!0}),await Ac(n,{nodeId:t})}function iy(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===Tr&&n.set(a.id,a),a.class===hn&&pf(r,a),a.class===vt)){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===jn);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[ff]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[ff]}function pf(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 sI(e,t){let n=Xt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===hn&&Yt(s.id)===t)}async function Ns(e,t){let n=await dt(e);iy(n);let s=await t(n)??n;return cI(s),uI(s),s.proseIndex=Zm(s.individuals),await QC(e,s),s}function jf(e,t){return e?.attributes?.find(n=>n?.prop===ct)?.value||t||Is()}function kn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function kf(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Rc}:${e.sessionId}`:Rc,type:"operator"};case"teach":return{id:e.sessionId?`${af}:${e.sessionId}`:af,type:"teach"};case"teachNode":return{id:`${zw}:${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:${wi(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 oI(e){return uu[e]||null}function rI(e,t,n){let s=kf(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=jf(r,t?.createdAt||n),a={id:s.id,label:Rf(s.id),class:Tr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:ct,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=Os(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Ic(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===Tr&&(n[s.id]=s);return n}function ay(e,t){let n=Xt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===jn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function iI(e,t,n=Date.now(),s={}){let o=ay(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===ct)?.value||"",{score:i,inputs:a}=uh({sourceIds:o,createdAt:r},Ic(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});kn(t,nr,"trustScore",String(i)),kn(t,wa,"trustInputs",JSON.stringify(a)),kn(t,Gs,"updatedAt",new Date(n).toISOString())}function aI(e,t,n=Date.now(),s={}){let[o]=ay(e,t.id),r=o?Ic(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=ya(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===ct)?.value||"";kn(t,nr,"trustScore",String(a)),kn(t,wa,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),kn(t,Gs,"updatedAt",new Date(n).toISOString())}function cy(e,t,n,s){t?.class===vt?aI(e,t,n,s):iI(e,t,n,s)}function Rr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===ct)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Gn(i);if(!a)continue;let c=rI(e,a,r);c&&Tc(e,{predicate:"statedBy",prop:jn},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:Rf(c)})}cy(e,t,n,s)}function cI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===jn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==vt||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(Rr(e,r,o),s=!0);s&&ns(e)}function uI(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=ht(e),n=new Set;for(let a of $y(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(!lI(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&&(kn(l,Dw,"sourceReliability",String(fh(c))),kn(l,Gs,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===jn),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&&cy(e,c)}}function dI(e,t,n){if(!cc(n?.id))return n;let s=Si(n.id);if(!s)return Bd(t,n);let o=Ic(e);return Bd(t,n,{priorFor:r=>ya(s,o[r])})}function Fw(e,t,n){return n?.class===hn?$w(t,n):dI(e,t,n)}function Os(e,t){let n=Xt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,Fw(e,o,t)),o.class===hn&&pf(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===hn&&pf(n.retractionsByGroup,t),t.class===vt){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]=Fw(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Tc(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===jn?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||Is()}),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||Is();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 ns(e){let t=[gf,hf,vt,Tr,Ar];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 fI(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:gf,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:ct,key:"createdAt",value:n||Is()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function ly(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!EC.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=_s(n),d=`utt:${o}#${l}#${t}`,f=Cc(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=ba({doc:u}),m=e.individuals.find($=>$?.id===d),h=jf(m,c||l),g={id:d,label:f,class:hf,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:ct,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(" ")}]:[]]};Os(e,g);let b=fI(e,o,r);if(Tc(e,{predicate:"saidInSession",prop:bf},{subject:d,object:b,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let $=e.individuals.find(y=>y?.id===a);$&&Tc(e,{predicate:"inReplyTo",prop:wf},{subject:d,object:a,subjectLabel:f,objectLabel:$.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function pI(e,t){let n;return await Ns(e,s=>{n=ly(s,t),ns(s)}),{id:n}}async function uy(e,t){let n=[];return t?.length?(await Ns(e,s=>{for(let o of t)n.push(ly(s,o));ns(s)}),{ids:n}):{ids:n}}async function mI(e,t){t?.length&&await Ns(e,n=>{for(let s of t)for(let o of Oo(n,s.factId))Tc(n,{predicate:"canonicalisedFrom",prop:yf},{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===vt&&Yt(s.id)===t).map(s=>s.id)}function dy(e,t,n,s=""){let o=Hw(n);if(o.length===1&&o[0].sourceId===Cs&&Oo(e,t).length)return[];let r=sI(e,t);if(r.length&&(o=o.filter(a=>!mc(r,`${t}@${a.sourceId}`,Cr(a.tags,s))),!o.length))return o;let i=hI(e,t);return i.length?o.filter(a=>!gw(i,a.sourceId)):o}function hI(e,t){let n=Xt(e),s=n?n.factRecordsByGroup.get(t):Oo(e,t),o=[];for(let r of s||[]){if(!Zs(r))continue;let i=eo(e,r);i&&o.push(i)}return o}function fy(e,t,{quantifier:n,environments:s}){let o=Oo(e,t).map(i=>eo(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===Pi)),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)kn(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")||(kn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function gI(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===_c)?.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 py(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(A=>A?.id===p),g=A=>(h?.attributes||[]).find(w=>w?.prop===A)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),$={assertedAt:lf(c.tags),observedAt:u},y=null,x=c.tags,C=$.assertedAt||l||Is(),v=u,j=[],E=d;if(h){let A={assertedAt:lf(b),observedAt:g(Ii)};RC($,A)?(y={head:h,id:`${p}#v${gI(h)}`},j=[y.id]):(x=[...new Set([...b,...c.tags])],C=g(ct)||C,v=u||g(Ii),j=g(_c).split(" ").filter(Boolean)),E=d||g("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:vt,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:ct,key:"createdAt",value:C},{prop:Io,key:"sourceId",value:c.sourceId},...x.length?[{prop:"mgx:factProvenance",key:"provenance",value:x.join(" | ")}]:[],...v?[{prop:Ii,key:"observedAt",value:v}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...E?[{prop:"mgx:factQuantifier",key:"quantifier",value:E}]:[],...f?[{prop:"mgx:factJustification",key:"justification",value:f.map(A=>A.join(" ")).join(" | ")}]:[],...j.length?[{prop:_c,key:"supersedes",value:j.join(" ")}]:[]]},demote:y}}function bI(e,t){let n=`${t}@${Cs}`,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 my(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Cs}`)||bI(e,Yt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};kn(o,Pi,"supersededBy",t.id),Os(e,o),s.push(o.id)}return Os(e,t),s.push(t.id),s}function eo(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 hy(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=eo(e,u);if(!d)continue;let f=$=>(d.attributes||[]).find(y=>y?.prop===$)?.value||"";if(Zs(u)){i.set(Si(u),d);continue}if(jr(u)){a.set(f(Io),d);continue}let p=f("mgx:factProvenance"),m=Gw(p),h=p.split(" | ").filter(Boolean),g={id:u,sourceId:f(Io)||m.id,assertedAt:Cr(h,f(ct)),record:d};if(f(Pi)){let $=r.get(g.sourceId);$?$.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=Ic(e),l=[];for(let[u,d]of o){let f=mw({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>ya(u,c[p])});if(f){Os(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=hw({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;Os(e,f.rollup),l.push(...f.absorbed);let p=eo(e,f.rewire);p&&kn(p,_c,"supersedes",f.rollup.id)}return l}async function gy(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:c,ruleConfidence:l}={}){let u=H(t),d=Yn(n),f=H(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=ba({doc:m}),g=_s(a);return await Ns(e,async b=>{let $=dy(b,p,_s(o),r);for(let y of $.length?[]:fy(b,p,{quantifier:g}))Rr(b,eo(b,y),void 0,{premiseTrusts:c,ruleConfidence:l});for(let y of $){let x=py(b,{groupId:p,s:u,p:d,o:f,label:Cc(m),tokens:h,group:y,createdAt:r,observedAt:i,quantifier:g});await Zd(x.candidate);for(let C of my(b,x))Rr(b,eo(b,C),void 0,C===x.candidate.id?{premiseTrusts:c,ruleConfidence:l}:void 0)}_f(b,hy(b,p)),ns(b)}),{id:p}}function wI(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 ss(e,t){let n=[],s=0;for(let r of t||[]){let i=H(r?.subject),a=Yn(r?.predicate),c=H(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:ba({doc:l}),provenance:_s(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:_s(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:wI(r?.justification)})}let o=[];return n.length?(await Ns(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=dy(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:fy(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=py(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Cc(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let m of my(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)Rr(r,eo(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...hy(r,u));_f(r,l),ns(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=by[n];if(!i)throw new Error(`a rule kind must be one of ${yI.join(", ")}, got ${JSON.stringify(n)}`);let a=H(t);if(!a)throw new Error("a rule needs a name");let c=$I[n]||new Set,l=i.map(([p])=>H(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===Di){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=vI(n,a,l),f=Cc(`${a} = ${n}(${l.join(", ")})`);return await Ns(e,async p=>{let m=p.individuals.find(y=>y?.id===d),h=m?.attributes?.find(y=>y?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),_s(o)].filter(Boolean))],b=jf(m,r),$={id:d,label:f,class:Ar,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Nc,key:"ruleName",value:a},{prop:Ir,key:"ruleKind",value:n},...i.map(([y,x],C)=>({prop:x,key:y,value:l[C],skip:!l[C]&&c.has(y)})).filter(y=>!y.skip).map(({skip:y,...x})=>x),{prop:ct,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await Zd($),Os(p,$),Rr(p,p.individuals.find(y=>y?.id===d)),ns(p)}),{id:d}}function If(e,t){let n=H(t);return(e?.individuals||[]).find(s=>s?.class===Ar&&(s.attributes||[]).find(o=>o?.prop===Nc)?.value===n)}function xI(e,t){let n=H(t),s=o=>(o.attributes||[]).find(r=>r?.prop===Ir)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===Ar&&(o.attributes||[]).find(r=>r?.prop===Nc)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Pc(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Ar)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(Ir),r=by[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Nc)||"",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 Of(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(H,n),h=c(H,s),g=r(p).filter(y=>m.has(y.fact.subject)&&h.has(y.fact.object));if(g.length){let y=g.slice().sort((x,C)=>l(x.fact,C.fact))[0];return{citation:[i(y.fact),...y.aliasFacts.map(x=>`${a(x)}${x.provenance?` (source: ${x.provenance})`:""}`)]}}let b=If(e,p),$=b?.attributes?.find(y=>y.prop===Ir)?.value;if(b&&$===Mi){let y=b.attributes.find(O=>O.prop==="mgx:ruleBase1")?.value,x=b.attributes.find(O=>O.prop==="mgx:ruleBase2")?.value,C=H(n),v=H(s);if(!y||!x||!C||!v)return null;let A=f({entity:C,hopsTaken:0},O=>O.hopsTaken===2&&O.entity===v,O=>{if(O.hopsTaken>=2)return[];let R=O.hopsTaken===0?y:x;return r(R).filter(k=>k.fact.subject===O.entity).map(k=>({action:k,nextState:{entity:k.fact.object,hopsTaken:O.hopsTaken+1}}))},{maxDepth:2,stateKey:O=>`${O.entity}#${O.hopsTaken}`});if(!A)return null;let w=new Set,T=[];for(let O of A.actions){T.push(i(O.fact));for(let R of O.aliasFacts){let k=R.id||`${R.subject}|${R.predicate}|${R.object}`;w.has(k)||(w.add(k),T.push(`${a(R)}${R.provenance?` (source: ${R.provenance})`:""}`))}}return{citation:T}}if(b&&$===Fi){let y=b.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,x=b.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!y||!x)return null;let C=await Of(e,y,n,s,o);if(!C)return null;let v=H(n),j=H(x),E=u.find(S=>S.predicate===d&&S.subject===v&&H(S.object)===j);return E?{citation:[...C.citation,i(E)]}:null}return null}async function wy(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(H,n),m=o(f).filter(b=>p.has(b.fact.object));if(m.length){let b=new Map;for(let $ of m)b.has($.fact.subject)||b.set($.fact.subject,[]),b.get($.fact.subject).push($);return[...b.entries()].map(([$,y])=>{let x=y.slice().sort((C,v)=>c(C.fact,v.fact))[0];return{subject:$,citation:[r(x.fact),...x.aliasFacts.map(C=>`${i(C)}${C.provenance?` (source: ${C.provenance})`:""}`)]}})}let h=If(e,f),g=h?.attributes?.find(b=>b.prop===Ir)?.value;if(h&&g===Mi){let b=h.attributes.find(j=>j.prop==="mgx:ruleBase1")?.value,$=h.attributes.find(j=>j.prop==="mgx:ruleBase2")?.value,y=H(n);return!b||!$||!y?[]:d({entity:y,hopsTaken:0},j=>{if(j.hopsTaken>=2)return[];let E=j.hopsTaken===0?$:b;return o(E).filter(S=>S.fact.object===j.entity).map(S=>({action:S,nextState:{entity:S.fact.subject,hopsTaken:j.hopsTaken+1}}))},{maxDepth:2,stateKey:j=>`${j.entity}#${j.hopsTaken}`}).filter(j=>j.node.hopsTaken===2).map(({node:j,path:E})=>{let S=new Set,A=[];for(let w of E.actions.slice().reverse()){A.push(r(w.fact));for(let T of w.aliasFacts){let O=T.id||`${T.subject}|${T.predicate}|${T.object}`;S.has(O)||(S.add(O),A.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:j.entity,citation:A}})}if(h&&g===Fi){let b=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,$=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!b||!$)return[];let y=await wy(e,b,n,s),x=H($),C=[];for(let v of y){let j=H(v.subject),E=l.find(S=>S.predicate===u&&S.subject===j&&H(S.object)===x);E&&C.push({subject:v.subject,citation:[...v.citation,r(E)]})}return C}return[]}function ht(e,t={}){let n=Nf(e),s=Jw(e),o=[];for(let[r,i]of n.groups){let a=Lf(r,i,n),c=s?.get(r);a.trust=$a(c?c.inputs:a.assertions,t).score,o.push(a)}return o}function Nf(e){let t=e?.individuals||[],n=new Map(t.filter(c=>c?.class===Tr).map(c=>[c.id,c])),s=(e?.objectProperties||[]).find(c=>c?.prop===jn),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===hn){let d=Yt(c.id),f=i.get(d);f?f.push(c):i.set(d,[c]);continue}if(c?.class!==vt||(c.attributes||[]).some(d=>d?.prop===Pi)||jr(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=>!mc(l,f.id,Cr(es(f,"mgx:factProvenance").split(" | ").filter(Boolean),es(f,ct))));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=uf(Oi(l[0],"subject"),Oi(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 Lf(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=es,i=Oi,a=[],c=[],l=[],u=new Set,d=[],f=new Set,p="";for(let g of t){if(Zs(g.id)){let j=Si(g.id),E=lc(g);for(let S of E)c.includes(S)||(c.push(S),j&&l.push(j));a.push({id:g.id,sourceId:"",sourceType:j,provenance:"",createdAt:r(g,Jn),ownTrust:Number(r(g,Sr))||0,assertedAt:r(g,Qn),rollup:{count:Number(r(g,Ei))||E.length,sourceIds:E,earliest:r(g,Jn),latest:r(g,Qn)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let j of b)u.add(j);let[$]=s.get(g.id)||[],y=$||r(g,Io),x=o(y);$&&!c.includes($)&&(c.push($),x&&l.push(x));let C=r(g,ct),v=r(g,Ii);a.push({id:g.id,sourceId:y,sourceType:x,provenance:b.join(" | "),createdAt:C,...v?{observedAt:v}:{},ownTrust:Number(r(g,nr))||0,assertedAt:Cr(b,C)}),p=p||i(g,"quantifier");for(let j of i(g,"justification").split(" | ")){let E=j.split(" ").filter(Boolean);if(!E.length)continue;let S=E.join(" ");f.has(S)||(f.add(S),d.push(E))}}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 EI(e){let t=es(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 yy(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||Is();return await Ns(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(f=>{if(f?.class!==vt)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=EI(f),g=`${p}\0${h}`,b=es(f,"mgx:factProvenance"),$=d.get(g);return $?($.ids.push(f.id),b&&$.tags.push(b)):d.set(g,{groupId:p,sourceId:h,ids:[f.id],tags:b?[b]:[],template:{label:f.label||"",subject:es(f,"rdf:subject"),predicate:es(f,"rdf:predicate"),object:es(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=yw({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&Os(c,p)}ns(c)}}),{removed:r,records:i}}function SI(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==hn)continue;let s=hc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function jI(e,t){let n=[];for(let o of t||[]){let r=gc(o);r&&n.push(r)}let s=[];return n.length?(await Ns(e,o=>{let r=new Map;for(let a of n){let c=Os(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=eo(o,l);if(!u)continue;let d=es(u,"mgx:factProvenance").split(" | ").filter(Boolean);mc(c,l,Cr(d,es(u,ct)))&&i.add(l)}if(i.size){_f(o,i);for(let a of i)s.push(a)}ns(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function kI(e,{self:t="",acknowledgedBy:n=null}={}){let s=bc(ht(e)),o=[];for(let r of e?.individuals||[])r?.class===hn&&r.id&&o.push(r.id);return{roster:s,retirable:wc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function RI(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Ns(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==hn||!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)}ns(o)}),{retired:s}):{retired:s}}function $y(e,{floor:t=_I}={}){let n=ht(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(rc(r.predicate)===Od)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=rc(r[0].predicate);i!==Nd&&!Pd(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 _r,mf,hf,vt,gf,Tr,Ar,bf,wf,xC,jn,yf,Dw,Rc,af,zw,EC,Pw,SC,cf,$f,Uw,jC,Cs,Ii,Io,_c,Pi,Kw,es,Oi,uf,Yw,Jw,AC,LC,Mw,Pn,sy,df,qC,rf,YC,Ef,oy,Sf,ry,ff,Xt,Cc,Is,Rf,lI,Mi,Fi,Tf,Af,Oc,Di,Cf,yI,Nc,Ir,by,$I,vI,_I,Or,TI,AI,Ke=M(()=>{Nt();Xe();Ws();ot();ot();Vn();ow();Vn();oc();Wd();Yd();Qd();Sw();Wd();Yd();Qd();_r=ne(".tmct","memory"),mf=ne(_r,"graph.json"),hf="Utterance",vt="Fact",gf="Session",Tr="Source",Ar="Rule",bf="mgx:saidInSession",wf="mgx:inReplyTo",xC="mgx:derivedFrom",jn="mgx:statedBy",yf="mgx:canonicalisedFrom",Dw="mgx:sourceReliability",Rc="src:operator-chat",af="src:teach-chat",zw="src:teach-node",EC=new Set(["visitor","tmct"]),Pw=48,SC=[{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:bf,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:wf,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:ct,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:Gs,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:xC,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:jn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:yf,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:nr,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:wa,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:yr,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)"}];cf=e=>Ci(e),$f="memory",Uw="sqlite";jC=`
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,50 +143,50 @@ 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
- `,Cs="src:none",Ii="mgx:observedAt",Io="mgx:sourceId",_c="mgx:supersedes",Pi="mgx:supersededBy";Kw="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";es=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Oi=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",uf=(e,t)=>`${e}\0${t}`;Yw=Symbol("materialised fact_heads index");Jw=e=>e?.[Yw]||null,TC="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";NC=new Set(["subject","object","subjectLabel","objectLabel"]),Mw=!1;Pn=e=>e===void 0?e:structuredClone(e);sy=ne(_r,"manifest.json"),df=5,HC=e=>ne(e,sy);rf=e=>XC(YC(e)),KC=/^fact:[0-9a-f]{8}$/;Ef=ne(_r,"syllogise-state.json"),oy="syllogiseState";Sf=ne(_r,"node-id.json"),ry="nodeId";ff=Symbol("mutateMemory lookup index");Xt=e=>e?.[ff]||null;Cc=e=>e.length>Pw?e.slice(0,Pw-1)+"\u2026":e,Is=()=>new Date().toISOString();Rf=e=>String(e).replace(/^src:/,"");cI=e=>typeof e=="string"&&(e.startsWith(`${Rc}:`)||e.startsWith(`${af}:`)||e.startsWith(`${zw}:`));Mi="compose2",Fi="filter",Tf="recursive",Af="action-signature",Oc="action-precond",Di="action-effect",Cf="action-constraint",wI=Object.freeze([Mi,Fi,Tf,Af,Oc,Di,Cf]),Nc="mgx:ruleName",Ir="mgx:ruleKind",by={[Mi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[Fi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Tf]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[Af]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Oc]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[Di]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Cf]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},yI={[Oc]:new Set(["value","negate"]),[Di]:new Set(["objectRole","value"])},$I=(e,t,n)=>`rule:${wi([e,t,...n].join("\0"))}`;_I=.5,Or="mgx:hasA",TI="mgx:capableOf",AI=Ld});async function Rn(e,t=null){try{if(t)return ht(await dt(t));let{dir:n,close:s}=await no(we(we(e.graphFile)));try{return ht(await dt(n))}finally{await s()}}catch{return[]}}function vy(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 Mc(e,t){let n=H(t),s=e.filter(a=>$y.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,No),i=o.length>No?`
146
+ `,Cs="src:none",Ii="mgx:observedAt",Io="mgx:sourceId",_c="mgx:supersedes",Pi="mgx:supersededBy";Kw="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";es=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Oi=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",uf=(e,t)=>`${e}\0${t}`;Yw=Symbol("materialised fact_heads index");Jw=e=>e?.[Yw]||null,AC="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";LC=new Set(["subject","object","subjectLabel","objectLabel"]),Mw=!1;Pn=e=>e===void 0?e:structuredClone(e);sy=ne(_r,"manifest.json"),df=5,qC=e=>ne(e,sy);rf=e=>JC(XC(e)),YC=/^fact:[0-9a-f]{8}$/;Ef=ne(_r,"syllogise-state.json"),oy="syllogiseState";Sf=ne(_r,"node-id.json"),ry="nodeId";ff=Symbol("mutateMemory lookup index");Xt=e=>e?.[ff]||null;Cc=e=>e.length>Pw?e.slice(0,Pw-1)+"\u2026":e,Is=()=>new Date().toISOString();Rf=e=>String(e).replace(/^src:/,"");lI=e=>typeof e=="string"&&(e.startsWith(`${Rc}:`)||e.startsWith(`${af}:`)||e.startsWith(`${zw}:`));Mi="compose2",Fi="filter",Tf="recursive",Af="action-signature",Oc="action-precond",Di="action-effect",Cf="action-constraint",yI=Object.freeze([Mi,Fi,Tf,Af,Oc,Di,Cf]),Nc="mgx:ruleName",Ir="mgx:ruleKind",by={[Mi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[Fi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Tf]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[Af]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Oc]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[Di]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Cf]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},$I={[Oc]:new Set(["value","negate"]),[Di]:new Set(["objectRole","value"])},vI=(e,t,n)=>`rule:${wi([e,t,...n].join("\0"))}`;_I=.5,Or="mgx:hasA",TI="mgx:capableOf",AI=Ld});async function Rn(e,t=null){try{if(t)return ht(await dt(t));let{dir:n,close:s}=await no(we(we(e.graphFile)));try{return ht(await dt(n))}finally{await s()}}catch{return[]}}function xy(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 Mc(e,t){let n=H(t),s=e.filter(a=>vy.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,No),i=o.length>No?`
147
147
  \u2026+${o.length-No} 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
- (${vy(s)})`}function Fc(e,t){let n=H(t),s=e.filter(a=>$y.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,No).join(", ")}`),r.length){let a=r.length>No?`, +${r.length-No} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,No).join(", ")}${a}`)}return i.push(`(${vy(s)})`),i.join(`
151
- `)}var $y,No,Lo=M(()=>{Xe();Ke();$y=new Set(["rdfs:subClassOf","rdf:type"]),No=40});async function xy(e,{graph:t,svc:n,config:s}){let o=ut(e,"symbol"),{match:r,candidates:i}=mn(n.graph,o);if(r)return $u(t,r,{candidates:i});let a=Fc(await Rn(s),o);if(a)return a;Lt(n,o,"symbol")}var Ey=M(()=>{Me();Lo();et()});async function Sy(e,{graph:t,svc:n,repoRoot:s}){let o=ut(e,"symbol"),{match:r,candidates:i}=Lt(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 Rs({readFile:Ae,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:bi})}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?`
150
+ (${xy(s)})`}function Fc(e,t){let n=H(t),s=e.filter(a=>vy.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,No).join(", ")}`),r.length){let a=r.length>No?`, +${r.length-No} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,No).join(", ")}${a}`)}return i.push(`(${xy(s)})`),i.join(`
151
+ `)}var vy,No,Lo=M(()=>{Xe();Ke();vy=new Set(["rdfs:subClassOf","rdf:type"]),No=40});async function Ey(e,{graph:t,svc:n,config:s}){let o=ut(e,"symbol"),{match:r,candidates:i}=mn(n.graph,o);if(r)return $u(t,r,{candidates:i});let a=Fc(await Rn(s),o);if(a)return a;Lt(n,o,"symbol")}var Sy=M(()=>{Me();Lo();et()});async function jy(e,{graph:t,svc:n,repoRoot:s}){let o=ut(e,"symbol"),{match:r,candidates:i}=Lt(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 Rs({readFile:Ae,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:bi})}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
152
  \u2026 (truncated to ${bi} lines; full span ${d})`:"",m=i.length?`
153
153
  (other matches: ${i.map(g=>g.label).join(", ")})`:"",h=Eu(t,r);return`${f}
154
154
  ${l}${p}${h?`
155
- ${h}`:""}${m}`}var jy=M(()=>{Nt();Kt();qa();Me();et()});var ky,Ry=M(()=>{Me();et();ky=mt(zh)});function _y(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"module"),"module");return Th(t,s)}var Ty=M(()=>{Me();et()});async function Ay(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=Fh(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=Fc(await Rn(n),s);if(i)return i}return r}var Cy=M(()=>{Kt();Me();Lo()});async function Iy(e,{graph:t,svc:n,config:s}){let o=ut(e,"class"),{match:r}=mn(n.graph,o);if(r)return Dh(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Mc(await Rn(s),o);if(i)return i;Lt(n,o,"class")}var Oy=M(()=>{Me();Lo();et()});async function Ny(e,{graph:t,svc:n,config:s}){let o=ut(e,"class"),{match:r}=mn(n.graph,o);if(r)return Uh(t,r);let i=Mc(await Rn(s),o);if(i)return i;Lt(n,o,"class")}var Ly=M(()=>{Me();Lo();et()});function Py(e,{conceptBase:t="concept:",relationMap:n=II}={}){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 $=r.get(g);r.set(g,b),g=$}return b},c=(g,b)=>{let $=a(g),y=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 $=H(g.subject),y=H(g.object);!$||!y||(i($),i(y),s.has(b)?c($,y):l.push({s:$,o:y}))}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 $=[...b].sort();f.push({id:u(g),prefLabel:g,altLabels:$.filter(y=>y!==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 $=u(a(g)),y=u(a(b));if($===y)continue;let x=$<y?`${$}\0${y}`:`${y}\0${$}`;p.has(x)||(p.add(x),m.push({subject:$,object:y}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:f,related:m,conceptIdForTerm:g=>{let b=H(g);return r.has(b)?u(a(b)):null},namespace:CI}}function Pf(e,t,n={}){let s=Py(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=H(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 CI,II,Dc=M(()=>{ot();CI="http://www.w3.org/2004/02/skos/core#",II={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Mf(e,{config:t,memoryBackend:n=null}){let s=ut(e,"term"),o=Pf(await Rn(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)"),Js({content:r.join(`
156
- `),data:o})}var My=M(()=>{Kt();Dc();Lo();et();Mf.ownsGraphLoad=!0});function HI(e,t){let n=[];for(let s of t||[])s?.predicate===OI&&H(s.subject)===e&&n.push(H(s.object));return n}function zc(e,t){let n=H(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 HI(i,t))s.has(a)||o.push(a)}}return r}var OI,NI,LI,PI,MI,FI,DI,zI,UI,BI,WI,GI,VI,Fy,Ff=M(()=>{ot();OI="rdfs:subClassOf",NI='<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>',LI='<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>',PI='<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>',MI='<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>',FI='<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>',DI='<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>',zI='<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>',UI='<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>',BI='<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>',WI='<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>',GI='<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>',VI='<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>',Fy=Object.freeze({spider:NI,fly:LI,egg:PI,poodle:MI,dog:FI,animal:DI,room:zI,furniture:UI,portable:BI,person:WI,adventurer:GI,container:VI})});function qI(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function Dy(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 qI(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var zy=M(()=>{});function KI(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 Gy(e){return YI(e).filter(t=>t?.property&&t.value!==void 0)}function XI(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function JI(e,t){let n=null,s=0;for(let o of e){let r=Gy(o);r.length<=s||XI(r,t)&&(n=o,s=r.length)}return n}function QI(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 Uy(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=QI(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function ZI(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 By(e,t){let n=t;for(let s of ZI(e))n=n.split(s).join("");return n}function Wy(e,t,n){let s=KI(e,n),o=JI(s,t);if(o&&!o.parameters)return o.svg;if(o)return By(o,Uy(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=Uy(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?By(i,i.svg):null}function eO(e,t,n,s,o,r){for(let a of zc(e,t)){let c=Wy(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Wy(r,n,s);return i||o[r]}function Vy(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=eO(e,t,n,s,o,r);return i?Dy(a,i):a}var vB,xB,Df=M(()=>{Ff();zy();vB=Object.freeze(["left","half-left","half-right","right"]),xB=Object.freeze(["moving"])});function zi(e){for(let t of e||[])if(t?.predicate===tO&&Object.prototype.hasOwnProperty.call(Hy,t.object))return Hy[t.object];return 1}var tO,Hy,zf=M(()=>{tO="mgx:hasProperty",Hy=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function qy(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 $=c(o,d,g,l,u,b),y=A=>c(A,[],g,l,{},{rootFallback:A}),x=A=>Object.prototype.hasOwnProperty.call(u,A),C=(A,w)=>{let T=l.filter(k=>k&&Array.isArray(k.classes)&&k.classes.indexOf(A)>=0),R=T.find(k=>k.svg===w)||T.find(k=>!k.match&&k.parameters)||null;return R?{classes:R.classes.slice(),parameters:Object.keys(R.parameters||{}).sort(),match:R.match||null}:null},v=null,j=null;if(typeof p=="function"){v=[];for(let A of p(o,d)){let w=y(A);if(v.push({term:A,template:!!w,registry:x(A)}),w){j={term:A,via:"template",hops:v.length-1,root:!1,template:C(A,w)};break}if(x(A)){j={term:A,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!j){let A=y(f);v.push({term:f,template:!!A,registry:x(f),root:!0}),j={term:f,via:A?"template":"registry",hops:v.length-1,root:!0,template:A?C(f,A):null}}}let E=a.instanceKey?c(o,d,g,l,u,{rootFallback:f}):$,S=r?c(o,d,g.filter(A=>A.predicate!==n),l,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:$,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?E!==S:null,rootFallback:f,fellBackToRoot:j?!!j.root:null,chain:v,matched:j}}var Ky=M(()=>{});var Yy,Xy,nO,RB,Jy=M(()=>{Df();Yy="icon tier",Xy="sprite tier",nO=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."})}),RB=Object.freeze(Object.values(nO).map(e=>e.predicate))});var Qy,Zy=M(()=>{Qy=()=>[]});var e$,t$=M(()=>{e$=()=>[]});function iO(){let e=e$();return e.length?{templates:e,tier:Xy}:{templates:Qy(),tier:Yy}}function n$(e){return e.map(t=>t.term).join(" -> ")}async function Uf(e,{config:t,memoryBackend:n=null}){let s=ut(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Bs,o))throw new Ie(`"${o}" is not a sprite expression. The palette holds: ${oO().join(", ")}.`);if(r&&!rO(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}=iO(),c=await Rn(t,n),l=qy({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:Fy,resolveSpriteAsset:Vy,classAncestorChain:zc,sizeScaleFor:zi,expressionPalette:Bs});if(!l.svg||l.fellBackToRoot)throw new Ie(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${n$(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: ${n$(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`),Js({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 sO,oO,rO,s$=M(()=>{Kt();Ff();Df();ha();zf();Ky();Jy();Zy();t$();Lo();et();sO="mgx:hasProperty",oO=()=>Object.keys(Bs).sort(),rO=e=>!!e&&zi([{predicate:sO,object:String(e)}])!==1;Uf.ownsGraphLoad=!0});function o$(e,{graph:t}){return Bh(t,{pkg:String(e?.package||"").trim()})}var r$=M(()=>{Me()});function i$(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"module"),"module");return lg(t,s)}var a$=M(()=>{Me();et()});function c$(e,{graph:t,codeDomainActive:n=null}){return Vh(t,{codeDomainActive:n})}var l$=M(()=>{Me()});function d$(e,t){return Js({content:e,data:t,text:`${e}${u$}${JSON.stringify(t,null,2)}`})}function f$(e,{graph:t}){let{content:n,tmct_ask:s}=Ys(t,ut(e,"query"));return d$(n,s)}var u$,Uc=M(()=>{qn();et();u$=`
155
+ ${h}`:""}${m}`}var ky=M(()=>{Nt();Kt();qa();Me();et()});var Ry,_y=M(()=>{Me();et();Ry=mt(zh)});function Ty(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"module"),"module");return Th(t,s)}var Ay=M(()=>{Me();et()});async function Cy(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=Fh(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=Fc(await Rn(n),s);if(i)return i}return r}var Iy=M(()=>{Kt();Me();Lo()});async function Oy(e,{graph:t,svc:n,config:s}){let o=ut(e,"class"),{match:r}=mn(n.graph,o);if(r)return Dh(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Mc(await Rn(s),o);if(i)return i;Lt(n,o,"class")}var Ny=M(()=>{Me();Lo();et()});async function Ly(e,{graph:t,svc:n,config:s}){let o=ut(e,"class"),{match:r}=mn(n.graph,o);if(r)return Uh(t,r);let i=Mc(await Rn(s),o);if(i)return i;Lt(n,o,"class")}var Py=M(()=>{Me();Lo();et()});function My(e,{conceptBase:t="concept:",relationMap:n=II}={}){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 $=r.get(g);r.set(g,b),g=$}return b},c=(g,b)=>{let $=a(g),y=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 $=H(g.subject),y=H(g.object);!$||!y||(i($),i(y),s.has(b)?c($,y):l.push({s:$,o:y}))}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 $=[...b].sort();f.push({id:u(g),prefLabel:g,altLabels:$.filter(y=>y!==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 $=u(a(g)),y=u(a(b));if($===y)continue;let x=$<y?`${$}\0${y}`:`${y}\0${$}`;p.has(x)||(p.add(x),m.push({subject:$,object:y}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:f,related:m,conceptIdForTerm:g=>{let b=H(g);return r.has(b)?u(a(b)):null},namespace:CI}}function Pf(e,t,n={}){let s=My(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=H(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 CI,II,Dc=M(()=>{ot();CI="http://www.w3.org/2004/02/skos/core#",II={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Mf(e,{config:t,memoryBackend:n=null}){let s=ut(e,"term"),o=Pf(await Rn(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)"),Js({content:r.join(`
156
+ `),data:o})}var Fy=M(()=>{Kt();Dc();Lo();et();Mf.ownsGraphLoad=!0});function HI(e,t){let n=[];for(let s of t||[])s?.predicate===OI&&H(s.subject)===e&&n.push(H(s.object));return n}function zc(e,t){let n=H(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 HI(i,t))s.has(a)||o.push(a)}}return r}var OI,NI,LI,PI,MI,FI,DI,zI,UI,BI,WI,GI,VI,Dy,Ff=M(()=>{ot();OI="rdfs:subClassOf",NI='<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>',LI='<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>',PI='<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>',MI='<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>',FI='<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>',DI='<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>',zI='<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>',UI='<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>',BI='<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>',WI='<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>',GI='<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>',VI='<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>',Dy=Object.freeze({spider:NI,fly:LI,egg:PI,poodle:MI,dog:FI,animal:DI,room:zI,furniture:UI,portable:BI,person:WI,adventurer:GI,container:VI})});function qI(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function zy(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 qI(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var Uy=M(()=>{});function KI(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 Vy(e){return YI(e).filter(t=>t?.property&&t.value!==void 0)}function XI(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function JI(e,t){let n=null,s=0;for(let o of e){let r=Vy(o);r.length<=s||XI(r,t)&&(n=o,s=r.length)}return n}function QI(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 By(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=QI(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function ZI(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 Wy(e,t){let n=t;for(let s of ZI(e))n=n.split(s).join("");return n}function Gy(e,t,n){let s=KI(e,n),o=JI(s,t);if(o&&!o.parameters)return o.svg;if(o)return Wy(o,By(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=By(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?Wy(i,i.svg):null}function eO(e,t,n,s,o,r){for(let a of zc(e,t)){let c=Gy(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Gy(r,n,s);return i||o[r]}function Hy(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=eO(e,t,n,s,o,r);return i?zy(a,i):a}var vB,xB,Df=M(()=>{Ff();Uy();vB=Object.freeze(["left","half-left","half-right","right"]),xB=Object.freeze(["moving"])});function zi(e){for(let t of e||[])if(t?.predicate===tO&&Object.prototype.hasOwnProperty.call(qy,t.object))return qy[t.object];return 1}var tO,qy,zf=M(()=>{tO="mgx:hasProperty",qy=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function Ky(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 $=c(o,d,g,l,u,b),y=A=>c(A,[],g,l,{},{rootFallback:A}),x=A=>Object.prototype.hasOwnProperty.call(u,A),C=(A,w)=>{let T=l.filter(k=>k&&Array.isArray(k.classes)&&k.classes.indexOf(A)>=0),R=T.find(k=>k.svg===w)||T.find(k=>!k.match&&k.parameters)||null;return R?{classes:R.classes.slice(),parameters:Object.keys(R.parameters||{}).sort(),match:R.match||null}:null},v=null,j=null;if(typeof p=="function"){v=[];for(let A of p(o,d)){let w=y(A);if(v.push({term:A,template:!!w,registry:x(A)}),w){j={term:A,via:"template",hops:v.length-1,root:!1,template:C(A,w)};break}if(x(A)){j={term:A,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!j){let A=y(f);v.push({term:f,template:!!A,registry:x(f),root:!0}),j={term:f,via:A?"template":"registry",hops:v.length-1,root:!0,template:A?C(f,A):null}}}let E=a.instanceKey?c(o,d,g,l,u,{rootFallback:f}):$,S=r?c(o,d,g.filter(A=>A.predicate!==n),l,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:$,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?E!==S:null,rootFallback:f,fellBackToRoot:j?!!j.root:null,chain:v,matched:j}}var Yy=M(()=>{});var Xy,Jy,nO,RB,Qy=M(()=>{Df();Xy="icon tier",Jy="sprite tier",nO=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."})}),RB=Object.freeze(Object.values(nO).map(e=>e.predicate))});var Zy,e$=M(()=>{Zy=()=>[]});var t$,n$=M(()=>{t$=()=>[]});function iO(){let e=t$();return e.length?{templates:e,tier:Jy}:{templates:Zy(),tier:Xy}}function s$(e){return e.map(t=>t.term).join(" -> ")}async function Uf(e,{config:t,memoryBackend:n=null}){let s=ut(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Bs,o))throw new Ie(`"${o}" is not a sprite expression. The palette holds: ${oO().join(", ")}.`);if(r&&!rO(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}=iO(),c=await Rn(t,n),l=Ky({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:Dy,resolveSpriteAsset:Hy,classAncestorChain:zc,sizeScaleFor:zi,expressionPalette:Bs});if(!l.svg||l.fellBackToRoot)throw new Ie(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${s$(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: ${s$(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`),Js({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 sO,oO,rO,o$=M(()=>{Kt();Ff();Df();ha();zf();Yy();Qy();e$();n$();Lo();et();sO="mgx:hasProperty",oO=()=>Object.keys(Bs).sort(),rO=e=>!!e&&zi([{predicate:sO,object:String(e)}])!==1;Uf.ownsGraphLoad=!0});function r$(e,{graph:t}){return Bh(t,{pkg:String(e?.package||"").trim()})}var i$=M(()=>{Me()});function a$(e,{graph:t,svc:n}){let{match:s}=Lt(n,ut(e,"module"),"module");return lg(t,s)}var c$=M(()=>{Me();et()});function l$(e,{graph:t,codeDomainActive:n=null}){return Vh(t,{codeDomainActive:n})}var u$=M(()=>{Me()});function f$(e,t){return Js({content:e,data:t,text:`${e}${d$}${JSON.stringify(t,null,2)}`})}function p$(e,{graph:t}){let{content:n,tmct_ask:s}=Ys(t,ut(e,"query"));return f$(n,s)}var d$,Uc=M(()=>{qn();et();d$=`
158
158
 
159
159
  ---tmct_ask---
160
- `});var p$,m$=M(()=>{Me();et();p$=mt(Gh)});var h$,g$=M(()=>{Me();et();h$=mt(Hh)});var b$,w$=M(()=>{Me();et();b$=mt(Zh)});var y$,$$=M(()=>{Me();et();y$=mt(tg)});var v$,x$=M(()=>{Me();et();v$=mt(ng)});var E$,S$=M(()=>{Me();et();E$=mt(Kh)});var j$,k$=M(()=>{Me();et();j$=mt(Yh)});var R$,_$=M(()=>{Me();et();R$=mt(Jh)});var T$,A$=M(()=>{Me();et();T$=mt(cg)});function aO(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function cO(e){let t=(e||[]).map(aO);return t.map(n=>JSON.stringify(n)).join(`
160
+ `});var m$,h$=M(()=>{Me();et();m$=mt(Gh)});var g$,b$=M(()=>{Me();et();g$=mt(Hh)});var w$,y$=M(()=>{Me();et();w$=mt(Zh)});var $$,v$=M(()=>{Me();et();$$=mt(tg)});var x$,E$=M(()=>{Me();et();x$=mt(ng)});var S$,j$=M(()=>{Me();et();S$=mt(Kh)});var k$,R$=M(()=>{Me();et();k$=mt(Yh)});var _$,T$=M(()=>{Me();et();_$=mt(Jh)});var A$,C$=M(()=>{Me();et();A$=mt(cg)});function aO(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function cO(e){let t=(e||[]).map(aO);return t.map(n=>JSON.stringify(n)).join(`
161
161
  `)+(t.length?`
162
- `:"")}function C$(e){return cO(ht(e))}var I$=M(()=>{Ke()});async function Bf(e,{config:t,memoryBackend:n=null}){let s=n?null:await no(we(we(t.graphFile))),o=n||s.dir;try{return C$(await dt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var O$=M(()=>{I$();Xe();Ke();Bf.ownsGraphLoad=!0});async function Wf(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 no(we(we(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 Js({content:c?`${l}
162
+ `:"")}function I$(e){return cO(ht(e))}var O$=M(()=>{Ke()});async function Bf(e,{config:t,memoryBackend:n=null}){let s=n?null:await no(we(we(t.graphFile))),o=n||s.dir;try{return I$(await dt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var N$=M(()=>{O$();Xe();Ke();Bf.ownsGraphLoad=!0});async function Wf(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 no(we(we(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 Js({content:c?`${l}
163
163
  ${a.canonical.join(`
164
- `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var N$=M(()=>{Xe();Ke();et();Wf.ownsGraphLoad=!0});var lO,L$=M(()=>{hd();Lb();Ey();jy();Ry();Ty();Cy();Oy();Ly();My();s$();r$();a$();l$();Uc();m$();g$();w$();$$();x$();S$();k$();_$();A$();O$();N$();lO=Object.freeze({tmct_context:md,tmct_context_more:Nb,tmct_describe:xy,tmct_snippet:Sy,tmct_signature:ky,tmct_impact:_y,tmct_search:Ay,tmct_members:Iy,tmct_subclasses:Ny,tmct_related:Mf,tmct_sprite:Uf,tmct_architecture:o$,tmct_exports:i$,tmct_untested:c$,tmct_ask:f$,tmct_tests_for:p$,tmct_history:h$,tmct_file_history:b$,tmct_method_history:y$,tmct_class_history:v$,tmct_callers:E$,tmct_callees:j$,tmct_calls:R$,tmct_cochanges:T$,tmct_export:Bf,tmct_ingest:Wf})});var Gf=M(()=>{});var Bc,Vf=M(()=>{Bc=()=>({relations:[],constructions:[]})});var P$,M$=M(()=>{Nt();Xe();Km();Kt();Zr();qn();Xa();Ja();L$();Uc();et();lr();Ma();Gf();Vf();Ja();hd();Uc();Fa(void 0);Pa(Bc);P$=qm.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Ps,qf=M(()=>{Ps=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 CW,IW,OW,Wc=M(()=>{CW=Object.freeze(["entity","set","event","measure"]),IW=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),OW=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 Gc=M(()=>{});var xt,PW,MW,FW,DW,zW,UW,BW,WW,GW,VW,HW,qW,KW,YW,XW,JW,qt,QW,ZW,eG,so=M(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},PW=xt("createRequire"),MW=xt("readFileSync"),FW=xt("access"),DW=xt("readFile"),zW=xt("writeFile"),UW=xt("appendFile"),BW=xt("mkdir"),WW=xt("mkdtemp"),GW=xt("rename"),VW=xt("unlink"),HW=xt("rm"),qW=xt("stat"),KW=xt("copyFile"),YW=xt("readdir"),XW=xt("createReadStream"),JW=xt("createWriteStream"),qt=e=>String(e),QW=xt("randomBytes"),ZW=xt("spawnSync"),eG=xt("createInterface")});var V$={};Ot(V$,{PHRASEBOOK_FILE:()=>z$,TECHNICAL_SLOTS:()=>Kf,TEMPLATES_FILE:()=>D$,flatten:()=>Xf,loadPhrasebook:()=>pO,loadTemplates:()=>Jf,loadTemplatesMerged:()=>fO,render:()=>G$,renderSegments:()=>W$,slotKind:()=>B$,slotsOf:()=>Yf});function Yf(e){let t=[];for(let n of String(e).matchAll(U$))t.includes(n[1])||t.push(n[1]);return t}function B$(e){return dO[e]||"entity"}function Xf(e){let t="";for(let n of e)t+=n.text;return t}function W$(e,t={},n=Ui){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(U$.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:B$(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 Jf(e=D$){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(!uO.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=Yf(i.template);if(i.register==="technical"){let c=a.filter(l=>!Kf.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: ${[...Kf].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 Ui=n,n}async function fO(e=[]){let t=Ui,n=new Map;try{for(let s of e){let o=await Jf(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{Ui=t}return n}function G$(e,t={},n=Ui){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Xf(W$(e,t,n))}async function pO(e=z$){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:Yf(i)})}}return{patterns:n,synonyms:s}}var mO,F$,D$,z$,uO,U$,Kf,dO,Ui,Vc=M(()=>{Nt();so();Xe();mO={},F$=ne(we(qt(mO.url)),"..","..",".."),D$=ne(F$,"data","templates","responses.jsonl"),z$=ne(F$,"data","phrasebook","software-phrases.txt"),uO=new Set(["terse","friendly","technical"]),U$=/\{([A-Za-z][A-Za-z0-9]*)\}/g,Kf=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));dO={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};Ui=null});function gO(e,t={}){let n=hO.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function bO(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>gO(s,t))):1}function rt(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:bO(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 hO,H$=M(()=>{hO=/^src:corpus:(.+)$/});var Et,iG,Nr,aG,cG,lG,uG,dG,fG,pG,mG,hG,gG,bG,wG,q$,wO,yG,$G,vG,Po=M(()=>{Et=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iG=Et("createRequire"),Nr=Et("readFileSync"),aG=Et("access"),cG=Et("readFile"),lG=Et("writeFile"),uG=Et("appendFile"),dG=Et("mkdir"),fG=Et("mkdtemp"),pG=Et("rename"),mG=Et("unlink"),hG=Et("rm"),gG=Et("stat"),bG=Et("copyFile"),wG=Et("readdir"),q$=Et("createReadStream"),wO=Et("createWriteStream"),yG=Et("randomBytes"),$G=Et("spawnSync"),vG=Et("createInterface")});function Qf(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 xO(e=$O){let t=Co(Nr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function qc(){if(Hc===null)try{Hc=xO()}catch{Hc=[]}return Hc}var EO,yO,$O,vO,_G,Hc,Kc=M(()=>{Po();so();Xe();Ec();Vc();EO={},yO=we(qt(EO.url)),$O=ne(yO,"..","..","data","templates","grammar-rules.toml"),vO=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),_G=Object.freeze(new Set(vO.filter(e=>e!=="prose")));Hc=null});function SO(){if(Bi!==void 0)return Bi;try{let e=K$?K$():jO();Bi=e&&e.winkNLP&&e.model?e:null}catch{Bi=null}return Bi}function jO(){let e=process.getBuiltinModule("node:module").createRequire(kO.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Yc(){if(Lr!==void 0)return Lr;let e=SO();if(!e)return Lr=null,null;try{Lr=e.winkNLP(e.model)}catch{Lr=null}return Lr}var kO,K$,Bi,Lr,Xc=M(()=>{kO={}});var Jc=M(()=>{Xc()});var X$,Y$=M(()=>{X$={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 nv={};Ot(nv,{CODE_REF_SHAPE:()=>Zc,DETERMINERS:()=>ep,OF_CLASSIFIER_HEADS:()=>np,OF_PARTITIVE_HEADS:()=>sp,QUANTIFIERS:()=>tp,classify:()=>rp,loadLexicon:()=>gn,lookupAdjective:()=>Gi,lookupNoun:()=>_n,lookupProperName:()=>Pr,lookupVerb:()=>Wi,numberOf:()=>op,predicateOf:()=>Qc,readsAsIndividualName:()=>el,thirdPerson:()=>Z$,withProperNames:()=>tv});function op(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):_O[t]??null}function Z$(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 Qc(e,t=Q$){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${Z$(e.lemma)}${n}`}function ev(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 J$(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!TO.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(!AO.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 gn(e,t=Q$){if(!e&&Zf.has(t))return Zf.get(t);let n=X$,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return J$(s,n),e?(J$(s,e),s):(Zf.set(t,s),s)}function tv(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 _n(e,t,n={}){return CO(e,t,n)[0]??null}function CO(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 ev(s))c(e.nouns.get(l));return i}function Wi(e,t){return IO(e,t)[0]??null}function IO(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of ev(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Gi(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function Pr(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function el(e,t){let n=String(e??"");if(!n)return!1;if(Pr(t,n)||Zc.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=_n(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function rp(e,t=gn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(ep[s])return{pos:"determiner",type:ep[s]};if(tp[s])return{pos:"quantifier",type:tp[s]};let o=op(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=Pr(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=_n(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=Wi(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:Qc(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Gi(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var Q$,ep,tp,np,sp,_O,TO,AO,Zf,Zc,os=M(()=>{Y$();Q$="tmct:",ep=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),tp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),np=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),sp=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),_O=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});TO=new Set(["data","object"]),AO=new Set(["subclass","data"]);Zf=new Map;Zc=/[./\\#:@]/});var MG,FG,DG,OO,zG,UG,BG,sv=M(()=>{qn();Me();MG=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),FG=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),DG=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`]}),OO=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"}),zG=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"]}),UG=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"}}),BG=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 Vi(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 nl(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 LO(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function rv(e,t){let n=_n(t,e);return n?H(n.lemma):e}function iv(e,t){let n=LO(String(e??"")).match(NO);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(PO.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&&rv(d,t);if(f&&(FO.has(f)||DO.has(f))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&MO.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=rv(i,t);if(ov.has(i)||ov.has(a))return null;let c=_n(t,i);if(!c)return null;let l=H(c.lemma);return s&&(!/s$/.test(i)||H(i)===l)?null:l}var tl,NO,PO,ov,MO,FO,DO,Mr=M(()=>{ot();os();sv();tl=400;NO=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;PO=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),ov=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"]),MO=new Set(["a","an","the"]),FO=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"]),DO=new Set(["either","one","each","both","any"])});var sl,ol=M(()=>{sl=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var zO,tV,av=M(()=>{Po();ol();so();Xe();Mr();zO={},tV=ne(we(qt(zO.url)),"..","..","..")});function BO(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 UO.includes(e.predicate)}function cv(e){return Vi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(BO):!1}function Hi(e,t){return`research:${e}:${H(t)}`}function rl(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");WO.set(e.name,{name:e.name,create:e.create})}var UO,WO,rV,iV,Fr=M(()=>{ot();Mr();UO=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"]);WO=new Map;rV=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),iV=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function qi({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 E={};return j.etag&&(E["If-None-Match"]=j.etag),j.lastModified&&(E["If-Modified-Since"]=j.lastModified),Object.keys(E).length?E:null}function h(v,j){if(!i)return;let E=j.headers?.get?.("etag")??"",S=j.headers?.get?.("last-modified")??"";if(!E&&!S)return;let A=i.get(v)??{};i.set(v,{etag:E||A.etag||"",lastModified:S||A.lastModified||""})}async function g(v,{asJson:j}){let E=typeof AbortController=="function"?new AbortController:null,S=E?setTimeout(()=>E.abort(),t):null;try{let A={};E&&(A.signal=E.signal);let w={...f()??{},...m(v)??{}};Object.keys(w).length&&(A.headers=w);let T=await a(v,A);if(T.status===429)return p(T.headers?.get?.("retry-after")),null;if(T.status===304)return i?{notModified:!0}:null;if(!T.ok)return null;if(h(v,T),j){let O=await T.json();return O?.error?.code==="maxlag"?(p(T.headers?.get?.("retry-after")),null):O}return await T.text()}catch{return null}finally{S!==null&&clearTimeout(S)}}async function b(v){return g(v,{asJson:!0})}async function $(v){return g(v,{asJson:!1})}let y=()=>Math.max(u,l+n);async function x(){for(;;){let v=Date.now();if(!d&&v>=y())return l=v,d=!0,!0;if(!r)return!1;await new Promise(j=>setTimeout(j,Math.max(y()-v,25)))}}async function C(v,j,{remember:E=!0}={}){if(c.has(v))return c.get(v);if(!await x())return null;let S=null;try{S=await j()}catch{S=null}finally{d=!1}return E&&c.set(v,S),S}return{fetchJson:b,fetchText:$,cachedFetch:C}}var Ki=M(()=>{});function KO({fetchImpl:e,origin:t=GO,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=qO,waitForSlot:i=!1,sourceName:a=HO}={}){let c=qi({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=H(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:nl(h,tl),url:String(m.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(p.replace(/ /g,"_"))}`),revid:g},$=o;if(!$)try{$=gn()}catch{$=null}let y=$?iv(h,$):null;return y&&(b.isa=y),Vi(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 Hi(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${H(p)}`,()=>u(H(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${H(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)}&section=0`))?.parse?.links;if(!Array.isArray(b))return null;let $=new Set,y=[];for(let x of b){if(!x||x.ns!==0||x.exists===!1)continue;let C=String(x.title??x["*"]??"").trim(),v=H(C);!C||!v||$.has(v)||($.add(v),y.push(C))}return y});return Array.isArray(h)?h.slice(0,Math.max(0,p)):null}}}function YO(e={}){return KO({origin:VO,sourceName:uv,waitForSlot:!0,...e})}var GO,VO,HO,uv,qO,dv=M(()=>{ot();os();Mr();Fr();Ki();GO="https://en.wikipedia.org",VO="https://simple.wikipedia.org",HO="wikipedia-live",uv="simple-wikipedia",qO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";rl({name:uv,create:YO})});function oN(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!pv.test(r))continue;let i=H(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function rN(e){let t=[];for(let[n,s]of Object.entries(eN)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=sN)return t;if(r>=nN)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");pv.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function iN(e,t,n){for(let s of tN)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 aN({fetchImpl:e,origin:t=XO,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=ZO,waitForSlot:r=!1,sourceName:i=fv}={}){let a=qi({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=H(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?oN(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=rN(h),b=await l(g.map(E=>E.id)),$=Hi(i,d),y=[],x=new Set;for(let E of g){let S=b.get(E.id);!S||S===d||x.has(`${E.predicate}\0${S}`)||(x.add(`${E.predicate}\0${S}`),y.push({subject:d,predicate:E.predicate,object:S,provenance:$}))}let C=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:C,summary:nl(C,tl),url:`${t}/wiki/${p}`,revid:Number(h.lastrevid),source:JO,licence:QO},j=iN(g,b,d);return j&&(v.isa=j),y.length&&(v.facts=y),cv(v)?v:null}return{name:i,origin:t,provenanceTag(d){return Hi(i,d)},async lookup(d){let f=H(d??"");return f?a.cachedFetch(f,()=>u(f)):null}}}function cN(e={}){return aN({waitForSlot:!0,...e})}var XO,fv,JO,QO,ZO,eN,tN,nN,sN,pv,mv=M(()=>{ot();Mr();Fr();Ki();XO="https://www.wikidata.org",fv="wikidata",JO="Wikidata",QO="CC0 1.0",ZO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",eN=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"}),tN=["P279","P31"],nN=3,sN=12,pv=/^Q[1-9][0-9]*$/;rl({name:fv,create:cN})});var lN,uN,kV,ip=M(()=>{ot();os();lr();Fr();lN=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),uN=["this","is","about","the"],kV=uN.length});var hv=M(()=>{Nt();Xe()});var ap,cl,Yi=M(()=>{ap=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"]),cl=new Set([...ap,"property","concept","idea","content"])});var gv=M(()=>{ot();qf();Yi()});var bv=M(()=>{ot()});var ll=M(()=>{$n();ir()});var wv=M(()=>{ot()});var dN,yv,$v,vv,QV,xv=M(()=>{wv();Ki();dN=250,yv=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:dN,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}]),$v=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes"]),vv=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),QV=new Map(yv.map(e=>[e.id,e]))});var St,eH,tH,nH,sH,oH,rH,iH,aH,cH,lH,uH,dH,fH,pH,mH,hH,gH,bH,wH,cp=M(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},eH=St("createRequire"),tH=St("readFileSync"),nH=St("access"),sH=St("readFile"),oH=St("writeFile"),rH=St("appendFile"),iH=St("mkdir"),aH=St("mkdtemp"),cH=St("rename"),lH=St("unlink"),uH=St("rm"),dH=St("stat"),fH=St("copyFile"),pH=St("readdir"),mH=St("createReadStream"),hH=St("createWriteStream"),gH=St("randomBytes"),bH=St("spawnSync"),wH=St("createInterface")});var Ev=M(()=>{});var Sv=M(()=>{Nt();cp();Xe();Xi();Kc();Jc();Ke();Kt();Ev();ot();Xc();os()});var gq,bq,wq,yq,up=M(()=>{ot();gv();bv();At();os();ll();Vn();xv();Ki();Fr();Sv();Jc();gq=Object.freeze({sources:$v,kbSources:vv,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),bq=6*36e5,wq=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),yq=gs.teach});var dp=M(()=>{ot()});var wN,Cq,jv=M(()=>{Po();ol();so();Xe();dp();ot();wN={},Cq=ne(we(qt(wN.url)),"..","..","..")});var Oq,Nq,Lq,kv=M(()=>{Oq=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),Nq=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"})}),Lq=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 Uq,$N,vN,Bq,Wq,Gq,Vq,Rv=M(()=>{$n();ll();Uq=Object.freeze({inline:"inline",enumerated:"enumerated"}),$N=new Set(["in","on","at","for","with","from","of","into","onto"]),vN=new Set([...$N,"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"]),Bq=new Set([...vN,"be","been"]),Wq=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),Gq=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),Vq=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}])});function Ji(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 ul(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(xN);if(!c.length)break;let l=o?c.filter(d=>d===o||pp(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 pp(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 mp(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,mp(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function EN(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 SN(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=pp(e,n),l=pp(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=>mp(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 dl(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||Ji(t),l=EN(s),u=new Map,d=new Map(a.map($=>[$,$])),f=$=>{for(;d.get($)!==$;)d.set($,d.get(d.get($))),$=d.get($);return $},p=($,y)=>{let x=f($),C=f(y);x!==C&&d.set(x<C?C:x,x<C?x:C)},m=[];for(let $=0;$<a.length;$+=1)for(let y=$+1;y<a.length;y+=1){let x=SN(a[$],a[y],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[$],b:a[y],...x}),x.distinct||p(a[$],a[y])}let h=new Map;for(let $ of a){let y=f($);h.has(y)||h.set(y,[]),h.get(y).push($)}let g=$=>mp($,c,u,new Set),b=[...h.values()].map($=>{let y=[...$].sort(),x=y[0],C=g(x);for(let v of y){let j=g(v);j>C&&(C=j,x=v)}return{objects:y,label:x}}).sort(($,y)=>$.label.localeCompare(y.label));return{split:b.length>1,clusters:b,pairs:m}}var xN,fl=M(()=>{At();Yi();xN=(e,t)=>e<t?-1:e>t?1:0});function hp(e){return typeof e=="string"&&jN.test(e)}function _v(e){return!!e&&typeof e=="object"&&Mo(e.s)}function gp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&hp(e.world)&&Mo(e.subject)&&Mo(e.predicate)&&Mo(e.object)}function bp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!hp(e.world)||!Mo(e.name)||!RN.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 wp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&hp(e.world)&&Mo(e.opening)}function Tv(e){return gp(e)||bp(e)||wp(e)}function Av(e){let t=e||[],n=t.filter(l=>l.predicate===_N).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 jN,kN,RN,Mo,_N,Fo=M(()=>{jN=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,kN=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),RN=new Set(kN),Mo=e=>typeof e=="string"&&e.trim()!=="";_N="mgx:default-contains"});var Jq,Qq,Zq,pl=M(()=>{Jq=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"]),Qq=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),Zq=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var ml=M(()=>{});var TN,AN,CN,IN,ON,NN,LN,PN,MN,FN,DN,zN,UN,BN,WN,GN,VN,HN,qN,oK,KN,Cv,rK,iK,Iv=M(()=>{os();ir();TN="subClassOf",AN="typeAssertion",CN="relation",IN="someValuesFrom",ON="cardinality",NN="disjointWith",LN="possessive",PN="adjective",MN="capability",FN="union",DN="complement",zN="negativeType",UN="enumeration",BN="differentFrom",WN="bareExistential",GN="transitiveRole",VN="inverseRole",HN="universal",qN="subPropertyOf",oK=Object.freeze([TN,AN,CN,IN,ON,NN,LN,PN,MN,FN,DN,zN,UN,BN,WN,GN,VN,HN,qN]),KN=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Cv=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"]]),rK=Math.max(...[...Cv.keys()].map(e=>e.split(" ").length)),iK=[...new Set([...KN,...[...Cv.keys()].map(e=>e.split(" ")[0])])]});var Do=M(()=>{});var yp=M(()=>{Me();qn();Do()});function Dt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:oo.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 YN,oo,xe,XN,zo,ft,Jt,cn,JN,Ov,Ft,QN,ZN,Nv,pK,mK,hK,Dr=M(()=>{YN=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),oo=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"}),XN=Object.freeze([xe.MemoryTerm]),zo=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ft=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:oo.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Jt=()=>Object.freeze({type:oo.Precondition,pred:zo.graphLoaded}),cn=(e,t)=>Object.freeze({type:oo.Precondition,pred:zo.resolves,param:e,as:t}),JN=e=>Object.freeze({type:oo.Precondition,pred:zo.anyPresent,params:Object.freeze([...e])}),Ov=()=>Object.freeze({type:oo.Precondition,pred:zo.memoryFacts}),Ft=(e,t=null)=>Object.freeze({type:oo.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});QN=Object.freeze([Dt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ft("query",xe.Query,{required:!1,note:"required unless a kind filter is given"}),ft("kind",xe.Kind,{required:!1}),ft("name",xe.Query,{required:!1}),ft("decorator",xe.Query,{required:!1})],preconditions:[Jt(),JN(["query","kind"])],add:[Ft("matches","query")]}),Dt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("description","symbol")]}),Dt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("signature","symbol")]}),Dt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ft("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:[Jt(),cn("module",xe.Symbol)],add:[Ft("impact","module")]}),Dt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ft("class",xe.Class,{arg:"class"})],preconditions:[Jt(),cn("class",xe.Class)],add:[Ft("members","class")]}),Dt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ft("class",xe.Class,{arg:"class"})],preconditions:[Jt(),cn("class",xe.Class)],add:[Ft("subclasses","class")]}),Dt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ft("module",xe.Module)],preconditions:[Jt(),cn("module",xe.Module)],add:[Ft("exports","module")]}),Dt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("callers","symbol")]}),Dt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("callees","symbol")]}),Dt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("calls","symbol")]}),Dt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.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:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("history","symbol")]}),Dt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("cochanges","symbol")]}),Dt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ft("package",xe.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:[ft("term",xe.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[Ov(),cn("term",xe.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:[ft("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"}),ft("expression",xe.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ft("size",xe.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[Ov(),cn("class",xe.MemoryTerm)],add:[Ft("sprite","class")]})]),ZN=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Nv=QN,pK=ZN(Nv),mK=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"}),hK=Object.freeze({prefixes:YN,vocab:oo,kinds:xe,precond:zo,get capabilities(){return Nv}})});var $p=M(()=>{Dr()});var hl=M(()=>{Vn()});var vp=M(()=>{Dr()});function oL(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(Bs,n)&&(t.expression=n),!t.size&&zi([{predicate:sL,object:n}])!==1&&(t.size=n);return t}var MK,FK,DK,zK,sL,UK,xp=M(()=>{qn();Bn();Dc();ot();Me();ha();zf();Dr();vp();MK=new RegExp(`\\b(?:${Object.keys(zn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),FK=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"}}),DK=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"}),zK=Object.freeze({}),sL="mgx:hasProperty";UK=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:oL},{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 Mv=M(()=>{});var iL,Fv=M(()=>{xp();Dr();vp();Mv();qn();iL=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 gl=M(()=>{ml();hl();xp();Fv();Dr();$p()});function lL(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(cL,"corpus","worlds")}function Dv(e){try{return sl(Nr(e))}catch{return null}}function zv(e){if(Sp.has(e))return Sp.get(e);let t=null,n=Dv(ne(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 Sp.set(e,t),t}function uL(e,t){let n=zv(e);if(!n)return null;let s=n[String(t??"")];if(!_v(s))return null;let o=`${e}\0${t}`;if(jp.has(o))return jp.get(o);let r=null,i=Dv(ne(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(!Tv(d)||d.world!==t)continue;gp(d)?a.push(d):bp(d)?c.push(d):wp(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:Av(a),rules:c,meta:l})}return jp.set(o,r),r}var fL,cL,Sp,jp,dL,dY,bl=M(()=>{Po();ol();so();Xe();Fo();fL={},cL=ne(we(qt(fL.url)),"..","..","..");Sp=new Map,jp=new Map;dL=e=>({list:async()=>{let t=zv(e());return t?Object.keys(t).sort():null},load:async t=>uL(e(),t)}),dY=dL(()=>lL())});var $Y,Uv=M(()=>{Nt();Xe();Ws();ei();Vn();Ke();$Y=ne(".tmct","memory","blocks")});var Bv=M(()=>{Do()});var Gv=M(()=>{Ws();ei();Do()});var kp=M(()=>{Ws();ei();Do()});var Vv=M(()=>{kp();Ws();bs();Do()});var Hv=M(()=>{});var qv=M(()=>{Bv();Gv();kp();Vv();Hv();Do()});var Kv=M(()=>{Uv();Ke();Xa();Kc();qv();yp()});function zr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function yl(e){let t=n=>gL.map((s,o)=>`--${n}-t${o+1}: ${zr(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: ${zr(e.taught,.12)}; --corpus-soft: ${zr(e.corpus,.12)};`,`--entail-soft: ${zr(e.entail,.14)}; --alert-soft: ${zr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${zr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var wl,gL,f3,Rp=M(()=>{ll();wl=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)"})}),gL=[.35,.65,1];f3=`
164
+ `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var L$=M(()=>{Xe();Ke();et();Wf.ownsGraphLoad=!0});var lO,P$=M(()=>{hd();Lb();Sy();ky();_y();Ay();Iy();Ny();Py();Fy();o$();i$();c$();u$();Uc();h$();b$();y$();v$();E$();j$();R$();T$();C$();N$();L$();lO=Object.freeze({tmct_context:md,tmct_context_more:Nb,tmct_describe:Ey,tmct_snippet:jy,tmct_signature:Ry,tmct_impact:Ty,tmct_search:Cy,tmct_members:Oy,tmct_subclasses:Ly,tmct_related:Mf,tmct_sprite:Uf,tmct_architecture:r$,tmct_exports:a$,tmct_untested:l$,tmct_ask:p$,tmct_tests_for:m$,tmct_history:g$,tmct_file_history:w$,tmct_method_history:$$,tmct_class_history:x$,tmct_callers:S$,tmct_callees:k$,tmct_calls:_$,tmct_cochanges:A$,tmct_export:Bf,tmct_ingest:Wf})});var Gf=M(()=>{});var Bc,Vf=M(()=>{Bc=()=>({relations:[],constructions:[]})});var M$,F$=M(()=>{Nt();Xe();Km();Kt();Zr();qn();Xa();Ja();P$();Uc();et();lr();Ma();Gf();Vf();Ja();hd();Uc();Fa(void 0);Pa(Bc);M$=qm.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Ps,qf=M(()=>{Ps=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 CW,IW,OW,Wc=M(()=>{CW=Object.freeze(["entity","set","event","measure"]),IW=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),OW=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 Gc=M(()=>{});var xt,PW,MW,FW,DW,zW,UW,BW,WW,GW,VW,HW,qW,KW,YW,XW,JW,qt,QW,ZW,eG,so=M(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},PW=xt("createRequire"),MW=xt("readFileSync"),FW=xt("access"),DW=xt("readFile"),zW=xt("writeFile"),UW=xt("appendFile"),BW=xt("mkdir"),WW=xt("mkdtemp"),GW=xt("rename"),VW=xt("unlink"),HW=xt("rm"),qW=xt("stat"),KW=xt("copyFile"),YW=xt("readdir"),XW=xt("createReadStream"),JW=xt("createWriteStream"),qt=e=>String(e),QW=xt("randomBytes"),ZW=xt("spawnSync"),eG=xt("createInterface")});var H$={};Ot(H$,{PHRASEBOOK_FILE:()=>U$,TECHNICAL_SLOTS:()=>Kf,TEMPLATES_FILE:()=>z$,flatten:()=>Xf,loadPhrasebook:()=>pO,loadTemplates:()=>Jf,loadTemplatesMerged:()=>fO,render:()=>V$,renderSegments:()=>G$,slotKind:()=>W$,slotsOf:()=>Yf});function Yf(e){let t=[];for(let n of String(e).matchAll(B$))t.includes(n[1])||t.push(n[1]);return t}function W$(e){return dO[e]||"entity"}function Xf(e){let t="";for(let n of e)t+=n.text;return t}function G$(e,t={},n=Ui){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(B$.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:W$(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 Jf(e=z$){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(!uO.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=Yf(i.template);if(i.register==="technical"){let c=a.filter(l=>!Kf.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: ${[...Kf].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 Ui=n,n}async function fO(e=[]){let t=Ui,n=new Map;try{for(let s of e){let o=await Jf(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{Ui=t}return n}function V$(e,t={},n=Ui){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Xf(G$(e,t,n))}async function pO(e=U$){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:Yf(i)})}}return{patterns:n,synonyms:s}}var mO,D$,z$,U$,uO,B$,Kf,dO,Ui,Vc=M(()=>{Nt();so();Xe();mO={},D$=ne(we(qt(mO.url)),"..","..",".."),z$=ne(D$,"data","templates","responses.jsonl"),U$=ne(D$,"data","phrasebook","software-phrases.txt"),uO=new Set(["terse","friendly","technical"]),B$=/\{([A-Za-z][A-Za-z0-9]*)\}/g,Kf=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));dO={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};Ui=null});function gO(e,t={}){let n=hO.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function bO(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>gO(s,t))):1}function rt(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:bO(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 hO,q$=M(()=>{hO=/^src:corpus:(.+)$/});var Et,iG,Nr,aG,cG,lG,uG,dG,fG,pG,mG,hG,gG,bG,wG,K$,wO,yG,$G,vG,Po=M(()=>{Et=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iG=Et("createRequire"),Nr=Et("readFileSync"),aG=Et("access"),cG=Et("readFile"),lG=Et("writeFile"),uG=Et("appendFile"),dG=Et("mkdir"),fG=Et("mkdtemp"),pG=Et("rename"),mG=Et("unlink"),hG=Et("rm"),gG=Et("stat"),bG=Et("copyFile"),wG=Et("readdir"),K$=Et("createReadStream"),wO=Et("createWriteStream"),yG=Et("randomBytes"),$G=Et("spawnSync"),vG=Et("createInterface")});function Qf(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 xO(e=$O){let t=Co(Nr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function qc(){if(Hc===null)try{Hc=xO()}catch{Hc=[]}return Hc}var EO,yO,$O,vO,_G,Hc,Kc=M(()=>{Po();so();Xe();Ec();Vc();EO={},yO=we(qt(EO.url)),$O=ne(yO,"..","..","data","templates","grammar-rules.toml"),vO=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),_G=Object.freeze(new Set(vO.filter(e=>e!=="prose")));Hc=null});function SO(){if(Bi!==void 0)return Bi;try{let e=Y$?Y$():jO();Bi=e&&e.winkNLP&&e.model?e:null}catch{Bi=null}return Bi}function jO(){let e=process.getBuiltinModule("node:module").createRequire(kO.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Yc(){if(Lr!==void 0)return Lr;let e=SO();if(!e)return Lr=null,null;try{Lr=e.winkNLP(e.model)}catch{Lr=null}return Lr}var kO,Y$,Bi,Lr,Xc=M(()=>{kO={}});var Jc=M(()=>{Xc()});var J$,X$=M(()=>{J$={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 sv={};Ot(sv,{CODE_REF_SHAPE:()=>Zc,DETERMINERS:()=>ep,OF_CLASSIFIER_HEADS:()=>np,OF_PARTITIVE_HEADS:()=>sp,QUANTIFIERS:()=>tp,classify:()=>rp,loadLexicon:()=>gn,lookupAdjective:()=>Gi,lookupNoun:()=>_n,lookupProperName:()=>Pr,lookupVerb:()=>Wi,numberOf:()=>op,predicateOf:()=>Qc,readsAsIndividualName:()=>el,thirdPerson:()=>ev,withProperNames:()=>nv});function op(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):_O[t]??null}function ev(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 Qc(e,t=Z$){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${ev(e.lemma)}${n}`}function tv(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 Q$(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!TO.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(!AO.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 gn(e,t=Z$){if(!e&&Zf.has(t))return Zf.get(t);let n=J$,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return Q$(s,n),e?(Q$(s,e),s):(Zf.set(t,s),s)}function nv(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 _n(e,t,n={}){return CO(e,t,n)[0]??null}function CO(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 tv(s))c(e.nouns.get(l));return i}function Wi(e,t){return IO(e,t)[0]??null}function IO(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of tv(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Gi(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function Pr(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function el(e,t){let n=String(e??"");if(!n)return!1;if(Pr(t,n)||Zc.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=_n(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function rp(e,t=gn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(ep[s])return{pos:"determiner",type:ep[s]};if(tp[s])return{pos:"quantifier",type:tp[s]};let o=op(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=Pr(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=_n(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=Wi(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:Qc(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Gi(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var Z$,ep,tp,np,sp,_O,TO,AO,Zf,Zc,os=M(()=>{X$();Z$="tmct:",ep=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),tp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),np=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),sp=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),_O=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});TO=new Set(["data","object"]),AO=new Set(["subclass","data"]);Zf=new Map;Zc=/[./\\#:@]/});var MG,FG,DG,OO,zG,UG,BG,ov=M(()=>{qn();Me();MG=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),FG=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),DG=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`]}),OO=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"}),zG=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"]}),UG=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"}}),BG=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 Vi(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 nl(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 LO(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function iv(e,t){let n=_n(t,e);return n?H(n.lemma):e}function av(e,t){let n=LO(String(e??"")).match(NO);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(PO.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&&iv(d,t);if(f&&(FO.has(f)||DO.has(f))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&MO.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=iv(i,t);if(rv.has(i)||rv.has(a))return null;let c=_n(t,i);if(!c)return null;let l=H(c.lemma);return s&&(!/s$/.test(i)||H(i)===l)?null:l}var tl,NO,PO,rv,MO,FO,DO,Mr=M(()=>{ot();os();ov();tl=400;NO=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;PO=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),rv=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"]),MO=new Set(["a","an","the"]),FO=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"]),DO=new Set(["either","one","each","both","any"])});var sl,ol=M(()=>{sl=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var zO,tV,cv=M(()=>{Po();ol();so();Xe();Mr();zO={},tV=ne(we(qt(zO.url)),"..","..","..")});function BO(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 UO.includes(e.predicate)}function lv(e){return Vi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(BO):!1}function Hi(e,t){return`research:${e}:${H(t)}`}function rl(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");WO.set(e.name,{name:e.name,create:e.create})}var UO,WO,rV,iV,Fr=M(()=>{ot();Mr();UO=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"]);WO=new Map;rV=Object.freeze(["wikipedia","wikidata","simple-wikipedia","wiktionary","dbpedia"]),iV=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function qi({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 E={};return j.etag&&(E["If-None-Match"]=j.etag),j.lastModified&&(E["If-Modified-Since"]=j.lastModified),Object.keys(E).length?E:null}function h(v,j){if(!i)return;let E=j.headers?.get?.("etag")??"",S=j.headers?.get?.("last-modified")??"";if(!E&&!S)return;let A=i.get(v)??{};i.set(v,{etag:E||A.etag||"",lastModified:S||A.lastModified||""})}async function g(v,{asJson:j}){let E=typeof AbortController=="function"?new AbortController:null,S=E?setTimeout(()=>E.abort(),t):null;try{let A={};E&&(A.signal=E.signal);let w={...f()??{},...m(v)??{}};Object.keys(w).length&&(A.headers=w);let T=await a(v,A);if(T.status===429)return p(T.headers?.get?.("retry-after")),null;if(T.status===304)return i?{notModified:!0}:null;if(!T.ok)return null;if(h(v,T),j){let O=await T.json();return O?.error?.code==="maxlag"?(p(T.headers?.get?.("retry-after")),null):O}return await T.text()}catch{return null}finally{S!==null&&clearTimeout(S)}}async function b(v){return g(v,{asJson:!0})}async function $(v){return g(v,{asJson:!1})}let y=()=>Math.max(u,l+n);async function x(){for(;;){let v=Date.now();if(!d&&v>=y())return l=v,d=!0,!0;if(!r)return!1;await new Promise(j=>setTimeout(j,Math.max(y()-v,25)))}}async function C(v,j,{remember:E=!0}={}){if(c.has(v))return c.get(v);if(!await x())return null;let S=null;try{S=await j()}catch{S=null}finally{d=!1}return E&&c.set(v,S),S}return{fetchJson:b,fetchText:$,cachedFetch:C}}var Ki=M(()=>{});function KO({fetchImpl:e,origin:t=GO,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=qO,waitForSlot:i=!1,sourceName:a=HO}={}){let c=qi({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=H(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:nl(h,tl),url:String(m.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(p.replace(/ /g,"_"))}`),revid:g},$=o;if(!$)try{$=gn()}catch{$=null}let y=$?av(h,$):null;return y&&(b.isa=y),Vi(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 Hi(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${H(p)}`,()=>u(H(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${H(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)}&section=0`))?.parse?.links;if(!Array.isArray(b))return null;let $=new Set,y=[];for(let x of b){if(!x||x.ns!==0||x.exists===!1)continue;let C=String(x.title??x["*"]??"").trim(),v=H(C);!C||!v||$.has(v)||($.add(v),y.push(C))}return y});return Array.isArray(h)?h.slice(0,Math.max(0,p)):null}}}function YO(e={}){return KO({origin:VO,sourceName:dv,waitForSlot:!0,...e})}var GO,VO,HO,dv,qO,fv=M(()=>{ot();os();Mr();Fr();Ki();GO="https://en.wikipedia.org",VO="https://simple.wikipedia.org",HO="wikipedia-live",dv="simple-wikipedia",qO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";rl({name:dv,create:YO})});function oN(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!mv.test(r))continue;let i=H(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function rN(e){let t=[];for(let[n,s]of Object.entries(eN)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=sN)return t;if(r>=nN)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");mv.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function iN(e,t,n){for(let s of tN)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 aN({fetchImpl:e,origin:t=XO,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=ZO,waitForSlot:r=!1,sourceName:i=pv}={}){let a=qi({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=H(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?oN(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=rN(h),b=await l(g.map(E=>E.id)),$=Hi(i,d),y=[],x=new Set;for(let E of g){let S=b.get(E.id);!S||S===d||x.has(`${E.predicate}\0${S}`)||(x.add(`${E.predicate}\0${S}`),y.push({subject:d,predicate:E.predicate,object:S,provenance:$}))}let C=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:C,summary:nl(C,tl),url:`${t}/wiki/${p}`,revid:Number(h.lastrevid),source:JO,licence:QO},j=iN(g,b,d);return j&&(v.isa=j),y.length&&(v.facts=y),lv(v)?v:null}return{name:i,origin:t,provenanceTag(d){return Hi(i,d)},async lookup(d){let f=H(d??"");return f?a.cachedFetch(f,()=>u(f)):null}}}function cN(e={}){return aN({waitForSlot:!0,...e})}var XO,pv,JO,QO,ZO,eN,tN,nN,sN,mv,hv=M(()=>{ot();Mr();Fr();Ki();XO="https://www.wikidata.org",pv="wikidata",JO="Wikidata",QO="CC0 1.0",ZO="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",eN=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"}),tN=["P279","P31"],nN=3,sN=12,mv=/^Q[1-9][0-9]*$/;rl({name:pv,create:cN})});var lN,uN,kV,ip=M(()=>{ot();os();lr();Fr();lN=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),uN=["this","is","about","the"],kV=uN.length});var gv=M(()=>{Nt();Xe()});var ap,cl,Yi=M(()=>{ap=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"]),cl=new Set([...ap,"property","concept","idea","content"])});var bv=M(()=>{ot();qf();Yi()});var wv=M(()=>{ot()});var ll=M(()=>{$n();ir()});var yv=M(()=>{ot()});var dN,$v,vv,xv,QV,Ev=M(()=>{yv();Ki();dN=250,$v=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:dN,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}]),vv=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes"]),xv=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),QV=new Map($v.map(e=>[e.id,e]))});var St,eH,tH,nH,sH,oH,rH,iH,aH,cH,lH,uH,dH,fH,pH,mH,hH,gH,bH,wH,cp=M(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},eH=St("createRequire"),tH=St("readFileSync"),nH=St("access"),sH=St("readFile"),oH=St("writeFile"),rH=St("appendFile"),iH=St("mkdir"),aH=St("mkdtemp"),cH=St("rename"),lH=St("unlink"),uH=St("rm"),dH=St("stat"),fH=St("copyFile"),pH=St("readdir"),mH=St("createReadStream"),hH=St("createWriteStream"),gH=St("randomBytes"),bH=St("spawnSync"),wH=St("createInterface")});var Sv=M(()=>{});var jv=M(()=>{Nt();cp();Xe();Xi();Kc();Jc();Ke();Kt();Sv();ot();Xc();os()});var gq,bq,wq,yq,up=M(()=>{ot();bv();wv();At();os();ll();Vn();Ev();Ki();Fr();jv();Jc();gq=Object.freeze({sources:vv,kbSources:xv,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),bq=6*36e5,wq=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),yq=gs.teach});var dp=M(()=>{ot()});var wN,Cq,kv=M(()=>{Po();ol();so();Xe();dp();ot();wN={},Cq=ne(we(qt(wN.url)),"..","..","..")});var Oq,Nq,Lq,Rv=M(()=>{Oq=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),Nq=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"})}),Lq=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 Uq,$N,vN,Bq,Wq,Gq,Vq,_v=M(()=>{$n();ll();Uq=Object.freeze({inline:"inline",enumerated:"enumerated"}),$N=new Set(["in","on","at","for","with","from","of","into","onto"]),vN=new Set([...$N,"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"]),Bq=new Set([...vN,"be","been"]),Wq=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),Gq=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),Vq=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}])});function Ji(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 ul(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(xN);if(!c.length)break;let l=o?c.filter(d=>d===o||pp(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 pp(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 mp(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,mp(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function EN(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 SN(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=pp(e,n),l=pp(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=>mp(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 dl(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||Ji(t),l=EN(s),u=new Map,d=new Map(a.map($=>[$,$])),f=$=>{for(;d.get($)!==$;)d.set($,d.get(d.get($))),$=d.get($);return $},p=($,y)=>{let x=f($),C=f(y);x!==C&&d.set(x<C?C:x,x<C?x:C)},m=[];for(let $=0;$<a.length;$+=1)for(let y=$+1;y<a.length;y+=1){let x=SN(a[$],a[y],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[$],b:a[y],...x}),x.distinct||p(a[$],a[y])}let h=new Map;for(let $ of a){let y=f($);h.has(y)||h.set(y,[]),h.get(y).push($)}let g=$=>mp($,c,u,new Set),b=[...h.values()].map($=>{let y=[...$].sort(),x=y[0],C=g(x);for(let v of y){let j=g(v);j>C&&(C=j,x=v)}return{objects:y,label:x}}).sort(($,y)=>$.label.localeCompare(y.label));return{split:b.length>1,clusters:b,pairs:m}}var xN,fl=M(()=>{At();Yi();xN=(e,t)=>e<t?-1:e>t?1:0});function hp(e){return typeof e=="string"&&jN.test(e)}function Tv(e){return!!e&&typeof e=="object"&&Mo(e.s)}function gp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&hp(e.world)&&Mo(e.subject)&&Mo(e.predicate)&&Mo(e.object)}function bp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!hp(e.world)||!Mo(e.name)||!RN.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 wp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&hp(e.world)&&Mo(e.opening)}function Av(e){return gp(e)||bp(e)||wp(e)}function Cv(e){let t=e||[],n=t.filter(l=>l.predicate===_N).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 jN,kN,RN,Mo,_N,Fo=M(()=>{jN=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,kN=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),RN=new Set(kN),Mo=e=>typeof e=="string"&&e.trim()!=="";_N="mgx:default-contains"});var Jq,Qq,Zq,pl=M(()=>{Jq=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"]),Qq=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),Zq=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var ml=M(()=>{});var TN,AN,CN,IN,ON,NN,LN,PN,MN,FN,DN,zN,UN,BN,WN,GN,VN,HN,qN,oK,KN,Iv,rK,iK,Ov=M(()=>{os();ir();TN="subClassOf",AN="typeAssertion",CN="relation",IN="someValuesFrom",ON="cardinality",NN="disjointWith",LN="possessive",PN="adjective",MN="capability",FN="union",DN="complement",zN="negativeType",UN="enumeration",BN="differentFrom",WN="bareExistential",GN="transitiveRole",VN="inverseRole",HN="universal",qN="subPropertyOf",oK=Object.freeze([TN,AN,CN,IN,ON,NN,LN,PN,MN,FN,DN,zN,UN,BN,WN,GN,VN,HN,qN]),KN=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Iv=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"]]),rK=Math.max(...[...Iv.keys()].map(e=>e.split(" ").length)),iK=[...new Set([...KN,...[...Iv.keys()].map(e=>e.split(" ")[0])])]});var Do=M(()=>{});var yp=M(()=>{Me();qn();Do()});function Dt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:oo.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 YN,oo,xe,XN,zo,ft,Jt,cn,JN,Nv,Ft,QN,ZN,Lv,pK,mK,hK,Dr=M(()=>{YN=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),oo=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"}),XN=Object.freeze([xe.MemoryTerm]),zo=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ft=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:oo.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Jt=()=>Object.freeze({type:oo.Precondition,pred:zo.graphLoaded}),cn=(e,t)=>Object.freeze({type:oo.Precondition,pred:zo.resolves,param:e,as:t}),JN=e=>Object.freeze({type:oo.Precondition,pred:zo.anyPresent,params:Object.freeze([...e])}),Nv=()=>Object.freeze({type:oo.Precondition,pred:zo.memoryFacts}),Ft=(e,t=null)=>Object.freeze({type:oo.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});QN=Object.freeze([Dt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ft("query",xe.Query,{required:!1,note:"required unless a kind filter is given"}),ft("kind",xe.Kind,{required:!1}),ft("name",xe.Query,{required:!1}),ft("decorator",xe.Query,{required:!1})],preconditions:[Jt(),JN(["query","kind"])],add:[Ft("matches","query")]}),Dt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("description","symbol")]}),Dt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("signature","symbol")]}),Dt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ft("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:[Jt(),cn("module",xe.Symbol)],add:[Ft("impact","module")]}),Dt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ft("class",xe.Class,{arg:"class"})],preconditions:[Jt(),cn("class",xe.Class)],add:[Ft("members","class")]}),Dt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ft("class",xe.Class,{arg:"class"})],preconditions:[Jt(),cn("class",xe.Class)],add:[Ft("subclasses","class")]}),Dt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ft("module",xe.Module)],preconditions:[Jt(),cn("module",xe.Module)],add:[Ft("exports","module")]}),Dt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("callers","symbol")]}),Dt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("callees","symbol")]}),Dt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("calls","symbol")]}),Dt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.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:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("history","symbol")]}),Dt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ft("symbol",xe.Symbol)],preconditions:[Jt(),cn("symbol",xe.Symbol)],add:[Ft("cochanges","symbol")]}),Dt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ft("package",xe.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:[ft("term",xe.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[Nv(),cn("term",xe.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:[ft("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"}),ft("expression",xe.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ft("size",xe.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[Nv(),cn("class",xe.MemoryTerm)],add:[Ft("sprite","class")]})]),ZN=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Lv=QN,pK=ZN(Lv),mK=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"}),hK=Object.freeze({prefixes:YN,vocab:oo,kinds:xe,precond:zo,get capabilities(){return Lv}})});var $p=M(()=>{Dr()});var hl=M(()=>{Vn()});var vp=M(()=>{Dr()});function oL(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(Bs,n)&&(t.expression=n),!t.size&&zi([{predicate:sL,object:n}])!==1&&(t.size=n);return t}var MK,FK,DK,zK,sL,UK,xp=M(()=>{qn();Bn();Dc();ot();Me();ha();zf();Dr();vp();MK=new RegExp(`\\b(?:${Object.keys(zn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),FK=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"}}),DK=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"}),zK=Object.freeze({}),sL="mgx:hasProperty";UK=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:oL},{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 Fv=M(()=>{});var iL,Dv=M(()=>{xp();Dr();vp();Fv();qn();iL=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 gl=M(()=>{ml();hl();xp();Dv();Dr();$p()});function lL(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(cL,"corpus","worlds")}function zv(e){try{return sl(Nr(e))}catch{return null}}function Uv(e){if(Sp.has(e))return Sp.get(e);let t=null,n=zv(ne(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 Sp.set(e,t),t}function uL(e,t){let n=Uv(e);if(!n)return null;let s=n[String(t??"")];if(!Tv(s))return null;let o=`${e}\0${t}`;if(jp.has(o))return jp.get(o);let r=null,i=zv(ne(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(!Av(d)||d.world!==t)continue;gp(d)?a.push(d):bp(d)?c.push(d):wp(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:Cv(a),rules:c,meta:l})}return jp.set(o,r),r}var fL,cL,Sp,jp,dL,dY,bl=M(()=>{Po();ol();so();Xe();Fo();fL={},cL=ne(we(qt(fL.url)),"..","..","..");Sp=new Map,jp=new Map;dL=e=>({list:async()=>{let t=Uv(e());return t?Object.keys(t).sort():null},load:async t=>uL(e(),t)}),dY=dL(()=>lL())});var $Y,Bv=M(()=>{Nt();Xe();Ws();ei();Vn();Ke();$Y=ne(".tmct","memory","blocks")});var Wv=M(()=>{Do()});var Vv=M(()=>{Ws();ei();Do()});var kp=M(()=>{Ws();ei();Do()});var Hv=M(()=>{kp();Ws();bs();Do()});var qv=M(()=>{});var Kv=M(()=>{Wv();Vv();kp();Hv();qv();Do()});var Yv=M(()=>{Bv();Ke();Xa();Kc();Kv();yp()});function zr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function yl(e){let t=n=>gL.map((s,o)=>`--${n}-t${o+1}: ${zr(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: ${zr(e.taught,.12)}; --corpus-soft: ${zr(e.corpus,.12)};`,`--entail-soft: ${zr(e.entail,.14)}; --alert-soft: ${zr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${zr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var wl,gL,f3,Rp=M(()=>{ll();wl=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)"})}),gL=[.35,.65,1];f3=`
168
168
  :root { color-scheme: light dark; ${yl(wl.light)} }
169
169
  @media (prefers-color-scheme: dark) { :root { ${yl(wl.dark)} } }
170
170
  :root[data-theme="dark"] { ${yl(wl.dark)} }
171
171
  :root[data-theme="light"] { ${yl(wl.light)} }
172
- `});var Yv=M(()=>{Rp()});var Xv=M(()=>{Rp()});var Qv=M(()=>{Ke();Fo();$n();Ur()});var ex=M(()=>{bs();Ke();ml();gl();Ur()});var Tp,jL,kL,RL,_L,TL,AL,u5,d5,Ur=M(()=>{Fo();pl();ml();Iv();os();Wc();yp();$p();gl();hl();bl();Ke();Kv();Yv();Xv();Qv();ex();Tp="mgx:world-epoch",jL=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),kL=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),RL="mgx:is-open",_L="mgx:hasMass",TL="mgx:knows-about",AL="mgx:display-name",u5=new Set([...jL,...kL,RL,_L,TL,AL,"rdf:type",Tp]),d5=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 Br,p5,m5,h5,g5,b5,w5,ro=M(()=>{Br=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})}),p5=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"}),m5=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"}),h5=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"}),g5=Object.freeze({teach:"teach"}),b5=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),w5=Object.freeze({max_depth:"maxDepth"})});var nx,CL,vl,IL,OL,sx,ox,NL,LL,v5,PL,ML,rx=M(()=>{ro();nx="spider-fly",CL=10,vl=Object.freeze({x:2,y:2}),IL=1,OL=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}),sx=(e,t)=>`cell-${e}-${t}`,ox=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),NL=(e,t)=>ox(e,t,vl.x,vl.y)<=IL,LL=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})}),v5=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"])]),PL="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.",ML=Object.freeze({name:nx,gridSize:CL,opening:PL,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:NL,webHomeCell:sx(vl.x,vl.y)})});var ix,ux,S5,j5,k5,Ap,ax,cx,lx,Cp,R5,_5,xl=M(()=>{ro();ix=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),ux=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})}),S5=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),j5=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),k5=Object.freeze([ix.spawnedFood,ix.placedFood]),Ap=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),ax=Ap({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"}]}),cx=Ap({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"}]}),lx=Ap({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"}]}),Cp=Object.freeze({[ax.name]:ax,[cx.name]:cx,[lx.name]:lx}),R5=Object.freeze(Object.keys(Cp)),_5=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 Ip=M(()=>{});var dx=M(()=>{});var Zi,t4,VL,HL,qL,KL,YL,XL,JL,QL,ZL,e0,t0,n0,s0,o0,r0,i0,a0,n4,Op=M(()=>{xl();Ip();bs();Ke();Fo();dx();ot();ro();pl();Ur();Zi=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"}}),t4=Object.freeze(["predator","prey"]),VL="mgx:currently-in",HL="mgx:hasMass",qL="mgx:feels",KL="mgx:facing",YL="mgx:driven-facing",XL="mgx:eaten-by",JL="mgx:starved",QL="mgx:placed-by",ZL="mgx:model",e0="mgx:rotation",t0="mgx:carrying",n0="mgx:prey-eaten",s0="mgx:web-built-at-turn",o0="mgx:laid-at-turn",r0="mgx:hatched-into",i0="mgx:turn-played",a0=new Set([VL,HL,qL,KL,YL,XL,JL,QL,ZL,e0,i0,t0,n0,s0,o0,r0,"rdf:type",Tp]),n4=Object.freeze([...a0].sort())});var $4,v4,px=M(()=>{rx();xl();Op();Fo();bl();Ke();ro();$4=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"),v4=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var J4,Q4,Z4,eX,tX,nX,d0,f0,p0,m0,mx,hx,h0,sX,oX,gx=M(()=>{xl();Op();Ur();$n();Fo();bl();Ke();ro();pl();Ip();hl();bs();J4=Zi.predator.kind,Q4=Zi.prey.kind,Z4=Zi.food.spawnedKind,eX=Zi.food.placedKind,tX=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"),nX=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"),d0="mgx:currently-in",f0="mgx:hasMass",p0="mgx:feels",m0="mgx:facing",mx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",hx="(fox|goblin)(?:-(\\d+))?",h0="(crumb|morsel)(?:-(\\d+))?",sX=[{kind:"placement",predicate:d0,re:new RegExp(`^(?:the\\s+)?${mx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:f0,re:new RegExp(`^(?:the\\s+)?${mx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:p0,re:new RegExp(`^(?:the\\s+)?${hx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:m0,re:new RegExp(`^(?:the\\s+)?${hx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],oX=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${h0}\\s+there[.!\\s]*$`,"i")});var jt,iX,aX,cX,lX,uX,dX,fX,pX,mX,hX,gX,bX,wX,yX,$X,vX,xX,EX,g0,bx=M(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iX=jt("createRequire"),aX=jt("readFileSync"),cX=jt("access"),lX=jt("readFile"),uX=jt("writeFile"),dX=jt("appendFile"),fX=jt("mkdir"),pX=jt("mkdtemp"),mX=jt("rename"),hX=jt("unlink"),gX=jt("rm"),bX=jt("stat"),wX=jt("copyFile"),yX=jt("readdir"),$X=jt("createReadStream"),vX=jt("createWriteStream"),xX=jt("randomBytes"),EX=jt("spawnSync"),g0=jt("createInterface")});var kt,jX,kX,RX,_X,TX,AX,CX,IX,OX,NX,LX,PX,MX,FX,DX,zX,UX,wx,BX,Np=M(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},jX=kt("createRequire"),kX=kt("readFileSync"),RX=kt("access"),_X=kt("readFile"),TX=kt("writeFile"),AX=kt("appendFile"),CX=kt("mkdir"),IX=kt("mkdtemp"),OX=kt("rename"),NX=kt("unlink"),LX=kt("rm"),PX=kt("stat"),MX=kt("copyFile"),FX=kt("readdir"),DX=kt("createReadStream"),zX=kt("createWriteStream"),UX=kt("randomBytes"),wx=kt("spawnSync"),BX=kt("createInterface")});var yx=M(()=>{Np();Xe();Nt();Xe();Ai();Kt()});var $x=M(()=>{});var b0,vx=M(()=>{Nt();Xe();Ke();$x();b0=ne(".tmct","sessions")});var xx=M(()=>{Nt();Xe();Gc()});var Ex,El,Sx=M(()=>{Ex=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`)."}),El=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var Rt,l8,u8,d8,f8,p8,m8,h8,g8,b8,w8,y8,$8,v8,x8,E8,S8,j8,k8,jx,kx=M(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},l8=Rt("createRequire"),u8=Rt("readFileSync"),d8=Rt("access"),f8=Rt("readFile"),p8=Rt("writeFile"),m8=Rt("appendFile"),h8=Rt("mkdir"),g8=Rt("mkdtemp"),b8=Rt("rename"),w8=Rt("unlink"),y8=Rt("rm"),$8=Rt("stat"),v8=Rt("copyFile"),x8=Rt("readdir"),E8=Rt("createReadStream"),S8=Rt("createWriteStream"),j8=Rt("randomBytes"),k8=Rt("spawnSync"),jx=Rt("createInterface")});var Cx={};Ot(Cx,{CONTEXT_PASSAGE_PREDICATE:()=>_x,CO_OCCURS_PREDICATE:()=>Sl,ingestUnknownFromAssertions:()=>$0,knownTermsFrom:()=>Tx,passageFor:()=>Ax});function Tx(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==vt)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(H(r)),i&&n.add(H(i))}for(let s of t||[])s?.subject&&n.add(H(s.subject)),s?.object&&n.add(H(s.object));return n}function Ax(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=io(e?.start),o=io(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function y0(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<Rx;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(w0.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=Rx))break}return o}async function $0(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 dt(e),c=Tx(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=io(p.start),g=io(p.end);if(!h||!g)continue;let b=H(h),$=H(g),y=!c.has(b),x=!c.has($);if(!y&&!x)continue;let C=Ax(p,m);if(!C)continue;let v=[[h,g,y],[g,h,x]];for(let[j,E,S]of v){if(!S||l.size>=i)continue;let A=H(j);if(l.has(A))continue;let w=`${r} ${p.rel}`;u.push({subject:j,predicate:_x,object:C,provenance:w}),u.push({subject:j,predicate:Sl,object:E,provenance:w});let T=y0(C,c,new Set([b,$]));for(let O of T)u.push({subject:j,predicate:Sl,object:O,provenance:w});l.add(A),c.add(A)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await ss(e,u),f=u.filter(p=>p.predicate===Sl).length;return{captured:l.size,linked:f,appended:d.appended,skipped:d.skipped}}var _x,Sl,w0,Rx,Ix=M(()=>{Ke();jl();_x="mgx:contextPassage",Sl="mgx:coOccursWith",w0=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"]),Rx=3});var Ox={};Ot(Ox,{MAP_FILE:()=>ta,SEON_CONCEPTS_FILE:()=>kl,SEON_DEFINITIONS_FILE:()=>v0,SLICE_FILE:()=>ea,TIER2_DIR:()=>rs,TIER2_MANIFEST_FILE:()=>x0,WORDNET_DIR:()=>na,loadMap:()=>_l,loadSlice:()=>Rl,seedMemory:()=>S0,termText:()=>io,toFacts:()=>Tl});async function Rl(e=ea){let t=jx({input:q$(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 _l(e=ta){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(!E0.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 Tl(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=io(o.start),a=io(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 S0(e,{limit:t,slicePath:n=ea,mapPath:s=ta,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([Rl(n),_l(s)]),u=Tl(c,l,r);if(Array.isArray(o)&&o.length){let $=new Map(o.map((y,x)=>[y,x]));u=u.slice().sort((y,x)=>($.get(y.predicate)??o.length)-($.get(x.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=($,y,x)=>`${H($)} ${y} ${H(x)}`,f=new Set,p=await dt(e);for(let $ of p.individuals||[]){if($?.class!=="Fact")continue;let y=x=>($.attributes||[]).find(C=>C.key===x)?.value;f.add(d(y("subject"),y("predicate"),y("object")))}let m=0,h=[];for(let $ of u){let y=d($.subject,$.predicate,$.object);if(f.has(y)){m+=1;continue}f.add(y),h.push($)}let g=await ss(e,h),b;if(i){let{ingestUnknownFromAssertions:$}=await Promise.resolve().then(()=>(Ix(),Cx));b=await $(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 j0,Wr,ea,ta,kl,v0,rs,x0,na,M8,E0,io,jl=M(()=>{Po();Nt();kx();so();Xe();Ec();Ke();j0={},Wr=ne(we(qt(j0.url)),"..","..",".."),ea=ne(Wr,"corpus","conceptnet","slice.jsonl"),ta=ne(Wr,"src","adapters","corpus","conceptnet-map.toml"),kl=ne(Wr,"corpus","domains","code","concepts.jsonl"),v0=ne(Wr,"corpus","domains","code","definitions.jsonl"),rs=ne(Wr,"corpus","tier2"),x0=ne(rs,"manifest.json"),na=ne(Wr,"corpus","wordnet"),M8=ne(na,"manifest.json"),E0=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);io=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var Dx={};Ot(Dx,{BUILTIN_EXTENSIONS:()=>T0,EXTENSION_KINDS:()=>Al,activeDomainPacks:()=>Dp,defaultCodeDomainPacks:()=>Fx,defaultCodeLaneVocab:()=>Mx,mergedLaneVocab:()=>Fp,mergedLexiconExtra:()=>Px,resolveExtensions:()=>Lx,seedActiveCorpusEntries:()=>I0,validateExtensionEntry:()=>Nx,validateExtensionPack:()=>N0});function Cl(){return{seon:{kind:"corpus",active:!1,corpusPath:kl,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:kl,provenancePrefix:"corpus:seon",vocabPath:R0,vocabData:Ex,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:ea,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:_0},human:{kind:"corpus",active:!0,corpusPath:ne(rs,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(rs,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(rs,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(rs,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(rs,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(rs,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(rs,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(na,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(na,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(k0,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function Nx(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Al.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Al.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 C0(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Al.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]=A0(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 Lx(e,{configFile:t}={}){let n=e?await kc(e,t?{file:t}:{}):null,s=Cl(),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=C0(f,s[f]||null,o[f]||{},e||process.cwd());Nx(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 I0(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(jl(),Ox)),{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 Px(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 Fp(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 Mx(){if(!Pp){let e={...Cl().code,active:!0};Pp=Fp(new Map([["code",e]]),{})}return Pp}async function O0(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 Dp(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 O0(o.name,o.entry));return s}function Fx(){if(!Mp){let e={...Cl().code,active:!0};Mp=Dp(new Map([["code",e]]),{})}return Mp}async function N0(e,t){let n=[],s=o=>o&&(Ql(o)?o:Ut(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Rl(o),i=await _l(s(t.mapPath)||ta),a=Tl(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(()=>(os(),nv)),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(()=>(Vc(),V$)),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 zp,k0,R0,Lp,Al,_0,T0,A0,Pp,Mp,Up=M(()=>{Xe();Nt();so();Sx();Ai();jl();zp={},k0=ne(we(qt(zp.url)),"..","..","corpus","namenet"),R0=ne(we(qt(zp.url)),"..","..","corpus","domains","code","vocab.json"),Lp=ne(we(qt(zp.url)),"..","..","corpus","tier2","vocab-empty.json"),Al=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),_0=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];T0=Object.freeze(Cl());A0=(e,t)=>{if(t==null)return;let n=String(t);return Ql(n)?n:Ut(e,n)};Pp=null;Mp=null});var zx=M(()=>{});var Ux=M(()=>{Xe();Po();Nt();cp();bx();Np();Kt();yx();Me();vx();Gc();xx();Zr();Up();Xi();ro();Wc();gl();ip();up();Fr();zx()});var Bx={};Ot(Bx,{proseLemma:()=>M0});function M0(){if(Uo!==void 0)return Uo;try{let e=Yc();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,Wx=M(()=>{Xc()});var Gx={};Ot(Gx,{digestTermFromRows:()=>z0,loadDigestStructureTable:()=>D0,readDigestStructures:()=>F0});var F0,D0,z0,Vx=M(()=>{F0=()=>null,D0=()=>null,z0=()=>null});var Yp={};Ot(Yp,{DEFAULT_MODULE_HOPS:()=>Vp,DEFAULT_PROVE_BRANCHES:()=>eE,DEFAULT_PROVE_NODES:()=>tE,DEFAULT_PROVE_STEPS:()=>Zx,MAX_PROVEN_CASES:()=>sE,MAX_ROLE_ASSERTIONS:()=>nE,TABLEAU_RULE_CONFIDENCE:()=>H0,buildTableauKb:()=>h1,canonicalKey:()=>We,extractTableauModule:()=>w1,findTableauViolations:()=>b1,isSatisfiable:()=>qp,moduleHasDlShape:()=>$1,proveEntailment:()=>d1,proveSubsumption:()=>f1,proveSubsumptionOfNegation:()=>p1,toNNF:()=>Qt});function We(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(${We(e.c)})`;case"and":return`and(${e.cs.map(We).sort().join(",")})`;case"or":return`or(${e.cs.map(We).sort().join(",")})`;case"some":return`some(${e.r},${We(e.c)})`;case"all":return`all(${e.r},${We(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${We(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${We(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function sa(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 sa(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>sa(o,t));return s.sort((o,r)=>We(o).localeCompare(We(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=sa(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=sa(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 Qt(e){return sa(e,!1)}function zt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function Wp(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function W0(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Qx(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function G0(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 V0(e,t){let n=(e||[]).map(([r,i])=>[cs(r),cs(i)]),s=G0(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=cs(r);o.set(i,new Set([i,...s(i)]))}return o}function Hx(e,t,n){let s=cs(t),o=cs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Nl(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&Hx(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(cs(r.r)):null;i&&Hx(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function Il(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!q0.test(t)}function oa(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function K0(e,t,n,s){if(t===n)return;let o=oa(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,zt(r?[...r,...s]:s))}function oE(e,t,n,s){return n===s?!1:Il(t,n)&&Il(t,s)?!0:e.inequalityFrom.has(oa(n,s))}function rE(e,t,n){let s=e.inequalityFrom.get(oa(t,n));return s?s.slice():[]}function Y0(e,t,n){let s=Il(e,t),o=Il(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function iE(e,t,n,s){if(n===s)return n;let[o,r]=Y0(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=oa(h,g),$=u.get(b);u.set(b,$?zt([...$,...f]):f)}return e.inequalityFrom=u,e.nodes.delete(r),o}function Hp(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Mn(e,t,n){let s=We(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:zt(n)}),!0)}function Gr(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Ol(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=We(Qt(as(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 qx(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function aE(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?qx(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=qx(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function Kx(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),choices:(e.choices||[]).slice()}}function X0(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of Gr(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Mn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function J0(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(oE(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,...rE(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function Q0(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 Gr(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Nl(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Mn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Mn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function Z0(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),Mn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function e1(e,t){if(We(t)==="bot")return[];let n=We(Qt(as(t))),s=e.labels.get(n);return s?s.from:null}function t1(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function n1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Gr(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,f)=>We(d).localeCompare(We(f)));if(i.some(d=>n.labels.has(We(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:e1(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=t1(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:We(i[0]),keyB:We(Qt(as(i[0]))),premises:zt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),Mn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function s1(e,t){for(let n of e.nodes.values())if(!aE(n,e,t))for(let[,{expr:s,from:o}]of Gr(n)){if(s.t!=="some")continue;let r=We(s.c);if(Nl(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=Hp(`${n.id}.${n.successorCount}`,n.id);return Mn(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 o1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Gr(n)){if(o.t!=="atMost")continue;let i=We(o.c),a=[...new Set(Nl(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])=>!oE(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,...rE(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function r1(e,t){for(let n of e.nodes.values())if(!aE(n,e,t))for(let[,{expr:s,from:o}]of Gr(n)){if(s.t!=="atLeast")continue;let r=We(s.c),i=[...new Set(Nl(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=Hp(`${n.id}.${n.successorCount}`,n.id);Mn(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)K0(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function i1(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Ol(s);if(o)return o}return null}function Bo(e,t){let n=i1(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function a1(e,t){let n=X0(e);if(n.applied)return Bo(e,n.touched);let s=Q0(e,t);if(s.applied)return Bo(e,s.touched);let o=J0(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=iE(e,t,o.a,o.b);return Bo(e,[u])}let r=Z0(e,t);if(r.applied)return Bo(e,r.touched);let i=n1(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),Bo(e,i.touched);if(i.kind==="split")return i;let a=o1(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=r1(e,t);if(c.applied)return Bo(e,c.touched);let l=s1(e,t);return l.applied?Bo(e,l.touched):{kind:"done"}}function c1(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 l1(e,t,n){let s=Wp(n.maxSteps,Zx),o=Wp(n.maxBranches,eE),r=Wp(n.maxNodes,tE),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=a1(u,t);if(d.kind==="clash"){let f=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:f});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=Kx(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);Mn(h,p,d.from);let g=Ol(h);return g&&(m.closed=!0,m.clash={...g,choices:m.choices.slice()}),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=Kx(u),g=iE(h,t,p,m),b=h.nodes.get(g),$=b&&Ol(b);return $&&(h.closed=!0,h.clash={...$,choices:h.choices.slice()}),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:c1(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 u1(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,Hp(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])Mn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||Mn(s(i.ind),Qt(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])Mn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=oa(i.a,i.b),c=o.get(a);o.set(a,zt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function qp(e,t=[],n={}){let s=u1(e,t);for(let r of s.nodes.values()){let i=Ol(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=l1(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 Kp(e,t,n){let s=qp(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=zt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(We(d),d);let i=[...r.keys()].sort(),a=i.slice(0,sE).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function d1(e,t,n,s={}){return Kp(e,[{ind:t,expr:Qt(as(n)),from:[]}],s)}function f1(e,t,n,s={}){let o=Qt(Xx([De(t),as(De(n))]));return Kp(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function p1(e,t,n,s={}){let o=Qt(Xx([De(t),De(n)]));return Kp(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function m1(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function h1(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=new Map,u=[],d=[],f=[],p=[],m=new Set,h=[],g=[],b=[],$=[],y=(_,P,W)=>{_.has(P)||_.set(P,[]),_.get(P).push(W)};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:allvaluesfrom"?o.set(_.subject,{object:_.object,id:_.id}):P==="owl:onclass"?r.set(_.subject,{object:_.object,id:_.id}):P==="owl:mincardinality"?i.set(_.subject,{kind:"min",n:Number(_.object),id:_.id}):P==="owl:maxcardinality"?i.set(_.subject,{kind:"max",n:Number(_.object),id:_.id}):P==="owl:cardinality"?i.set(_.subject,{kind:"exact",n:Number(_.object),id:_.id}):P==="rdfs:subclassof"?u.push(_):P==="owl:disjointwith"?d.push(_):P==="rdf:type"?(f.push(_),String(_.object||"").toLowerCase()==="transitiveproperty"&&m.add(_.subject)):P==="mgxneg:subclassof"?p.push(_):P==="owl:unionof"?y(a,_.subject,_):P==="owl:complementof"?c.set(_.subject,_):P==="rdfs:subpropertyof"?h.push(_):P==="owl:differentfrom"?g.push(_):P==="owl:oneof"?y(l,_.subject,_):P==="owl:inverseof"?b.push(_):$.push(_)}let x=new Set;for(let _ of f){let P=String(_.object||"").toLowerCase();Gp.has(P)||x.add(_.subject)}let C=Qx(x,$),v=_=>C.has(_)||Jx.test(_),j=$.filter(_=>v(_.subject)&&v(_.object)).sort((_,P)=>_.subject.localeCompare(P.subject)||_.predicate.localeCompare(P.predicate)||_.object.localeCompare(P.object)).slice(0,nE).map(_=>({a:_.subject,r:_.predicate,b:_.object,from:[_.id]})),E=(_,P,W)=>({sub:_,sup:P,from:zt(W),disjunction:Qt(Bp([as(_),P]))}),S=[],A=[];for(let _ of u){let P=_.object;if(!n.has(P)){S.push(E(De(_.subject),De(P),[_.id]));continue}let W=n.get(P),F=s.get(P);if(F){S.push(E(De(_.subject),U0(W.object,De(F.object)),[_.id,W.id,F.id]));continue}let z=o.get(P);if(z){S.push(E(De(_.subject),B0(W.object,De(z.object)),[_.id,W.id,z.id]));continue}let N=i.get(P),D=r.get(P);if(N&&D){let U=[_.id,W.id,D.id,N.id];N.kind==="min"?S.push(E(De(_.subject),{t:"atLeast",n:N.n,r:W.object,c:De(D.object)},U)):N.kind==="max"?S.push(E(De(_.subject),{t:"atMost",n:N.n,r:W.object,c:De(D.object)},U)):N.kind==="exact"&&(S.push(E(De(_.subject),{t:"atLeast",n:N.n,r:W.object,c:De(D.object)},U)),S.push(E(De(_.subject),{t:"atMost",n:N.n,r:W.object,c:De(D.object)},U)))}}for(let _ of d)v(_.subject)?A.push({ind:_.subject,expr:Qt(as(De(_.object))),from:[_.id]}):S.push(E(De(_.subject),Qt(as(De(_.object))),[_.id]));for(let _ of f)Gp.has(String(_.object||"").toLowerCase())||A.push({ind:_.subject,expr:De(_.object),from:[_.id]});for(let _ of p)A.push({ind:_.subject,expr:Qt(as(De(_.object))),from:[_.id]});for(let[_,P]of a){let W=[...P].sort((D,U)=>String(D.object).localeCompare(String(U.object))),F=W.map(D=>De(D.object)),z=W.map(D=>D.id),N=Qt(Bp(F));S.push(E(De(_),N,z)),S.push(E(N,De(_),z))}for(let[_,P]of c){let W=Qt(as(De(P.object)));S.push(E(De(_),W,[P.id])),S.push(E(W,De(_),[P.id]))}let w=new Map;for(let[_,P]of l){let W=[...P].sort((N,D)=>String(N.object).localeCompare(String(D.object))),F=W.map(N=>({t:"nom",ind:N.object})),z=W.map(N=>N.id);S.push(E(De(_),Qt(Bp(F)),z));for(let N of W){S.push(E({t:"nom",ind:N.object},De(_),[N.id]));let D=w.get(N.object);w.set(N.object,D?zt([...D,N.id]):[N.id])}}let T=g.map(_=>({a:_.subject,b:_.object,from:[_.id]})).sort((_,P)=>_.a.localeCompare(P.a)||_.b.localeCompare(P.b)),O=new Map;for(let _ of b)O.set(_.subject,_.object),O.has(_.object)||O.set(_.object,_.subject);let R=new Set;for(let{object:_}of n.values())R.add(_);for(let _ of j)R.add(_.r);let k=h.map(_=>[_.subject,_.object]).sort((_,P)=>_[0].localeCompare(P[0])||_[1].localeCompare(P[1])),L=new Set([...R,...k.flat(),...O.keys(),...O.values()]),B=V0(k,L);S.sort((_,P)=>We(_.sub).localeCompare(We(P.sub))||We(_.sup).localeCompare(We(P.sup))||_.from.join(",").localeCompare(P.from.join(","))),A.sort((_,P)=>_.ind.localeCompare(P.ind)||We(_.expr).localeCompare(We(P.expr)));let V=[...new Set([...A.map(_=>_.ind),...j.flatMap(_=>[_.a,_.b])])].sort(),K=new Set(V),Y=new Set([...[...a.values()].flatMap(_=>_.map(P=>P.id)),...[...l.values()].flatMap(_=>_.map(P=>P.id))]);return{axioms:S,assertions:A,roles:[...R].sort(),individuals:V,transitiveRoles:m,roleClosure:B,namedIndividuals:K,nominalIndividuals:w,differentFrom:T,inverseOf:O,roleAssertions:j,unionOrOneOfIds:Y}}function g1(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function b1(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=g1(e,r);if(!i.assertions.length)continue;let a=qp(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:m1(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function is(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function w1(e,t,{hops:n=Vp}={}){let s=Array.isArray(e)?e.filter(k=>k&&k.subject&&k.predicate):[],o=W0(n,Vp),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,g=[],b=new Map,$=new Set;for(let k of s){if(String(k.predicate).trim().toLowerCase()!=="rdf:type")continue;let L=String(k.object||"").toLowerCase();Gp.has(L)||$.add(k.subject)}let y=s.filter(k=>!Yx.has(String(k.predicate).trim().toLowerCase())),x=Qx($,y),C=k=>x.has(k)||Jx.test(k);for(let k of s){let L=String(k.predicate).trim().toLowerCase();L==="rdfs:subclassof"?(is(r,k.subject,k.object),is(i,k.object,k.subject)):L==="owl:onproperty"?a.set(k.subject,k.object):L==="owl:somevaluesfrom"||L==="owl:allvaluesfrom"||L==="owl:onclass"?(c.set(k.subject,k.object),is(l,k.object,k.subject)):L==="owl:unionof"?(is(u,k.subject,k.object),is(d,k.object,k.subject)):L==="owl:complementof"?(f.set(k.subject,k.object),is(p,k.object,k.subject)):L==="owl:oneof"?(is(m,k.subject,k.object),is(h,k.object,k.subject)):!Yx.has(L)&&C(k.subject)&&C(k.object)&&(g.push(k),is(b,k.subject,k.object),is(b,k.object,k.subject))}let v=new Map;function j(k){let L=v.get(k);if(L)return L;let B=new Set,V=[...r.get(k)||[],...i.get(k)||[]];for(;V.length;){let K=V.pop();if(!B.has(K)){B.add(K);for(let Y of r.get(K)||[])B.has(Y)||V.push(Y);for(let Y of i.get(K)||[])B.has(Y)||V.push(Y)}}v.set(k,B);for(let K of B)v.has(K)||v.set(K,B);return B}let E=new Set,S=new Map,A=[];function w(k,L){if(!k)return;let B=S.get(k);B!==void 0&&B>=L||(S.set(k,L),A.push({term:k,hopsLeft:L}))}let T=[...new Set((Array.isArray(t)?t:[]).map(k=>H(k)).filter(Boolean))];for(let k of T)w(k,o);let O=0;for(;O<A.length;){let{term:k,hopsLeft:L}=A[O];if(O+=1,S.get(k)===L){E.add(k);for(let B of j(k))E.add(B),w(B,L);if(!(L<=0)){c.has(k)&&w(c.get(k),o);for(let B of l.get(k)||[])w(B,o);for(let B of u.get(k)||[])w(B,L-1);for(let B of d.get(k)||[])w(B,L-1);f.has(k)&&w(f.get(k),L-1);for(let B of p.get(k)||[])w(B,L-1);for(let B of m.get(k)||[])w(B,L-1);for(let B of h.get(k)||[])w(B,L-1);for(let B of b.get(k)||[])w(B,o)}}}let R=new Set;for(let[k,L]of a)E.has(k)&&R.add(cs(L));for(let k of g)(E.has(k.subject)||E.has(k.object))&&R.add(cs(k.predicate));return s.filter(k=>{if(E.has(k.subject)||E.has(k.object))return!0;let L=String(k.predicate).trim().toLowerCase();return L==="rdfs:subpropertyof"||L==="owl:inverseof"||L==="rdf:type"&&String(k.object).toLowerCase()==="transitiveproperty"?R.has(cs(k.subject)):!1})}function $1(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return y1.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var De,as,Xx,Bp,U0,B0,Jx,cs,Gp,Zx,eE,tE,H0,Vp,nE,sE,q0,Yx,y1,Xp=M(()=>{ot();De=e=>({t:"atom",name:e}),as=e=>({t:"not",c:e}),Xx=e=>({t:"and",cs:e}),Bp=e=>({t:"or",cs:e}),U0=(e,t)=>({t:"some",r:e,c:t}),B0=(e,t)=>({t:"all",r:e,c:t});Jx=/[./\\#:@]/;cs=e=>H(e);Gp=new Set(["restriction","transitiveproperty","class"]),Zx=5e3,eE=256,tE=512,H0=.95,Vp=4,nE=256,sE=6,q0=/\.\d+$/;Yx=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);y1=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var pE={};Ot(pE,{BOT:()=>ln,DEFAULT_EL_BUDGET:()=>tm,DEFAULT_EL_ROUNDS:()=>nm,EL_RESTRICTION_RULE:()=>em,EL_RULE_CONFIDENCE:()=>Jp,EL_SUBSUMPTION_RULE:()=>Zp,ENTAILED_EL_PROVENANCE:()=>dE,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>ia,TOP:()=>ao,classifyEl:()=>L1,elGoalAxioms:()=>lE,elGoalFor:()=>uE,elUnsatisfiableClasses:()=>N1,normalizeElTBox:()=>Qp,proveElSubsumption:()=>O1,saturateEl:()=>Ll});function v1(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 x1(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=H(s);o&&n.add(o)}return n.size?n:null}function Qp(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,T)=>String(w.id).localeCompare(String(T.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=w=>{w&&w!==ao&&w!==ln&&i.add(w)},l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=[],g=[],b=new Map,$=[];for(let w of r){if(w.subject===ao||w.subject===ln||w.object===ao||w.object===ln)continue;let T=w.predicate;j1(T)?(l.set(w.subject,w),c(w.subject)):k1(T)?(u.set(w.subject,w),c(w.subject),c(w.object)):R1(T)?d.set(w.subject,w):_1(T)?(f.set(w.subject,w),c(w.subject),c(w.object)):I1(T)?(p.set(w.subject,w),c(w.subject)):T1(T)?(m.has(w.subject)||m.set(w.subject,[]),m.get(w.subject).push(w),c(w.subject),c(w.object)):cE(T)?(h.push(w),c(w.subject),c(w.object)):S1(T)?(g.push(w),c(w.subject),c(w.object)):E1(T)&&w.object==="transitiveproperty"?(b.has(w.subject)||b.set(w.subject,w),a.add(w.subject)):A1(T)&&($.push(w),a.add(w.subject),a.add(w.object))}let y=new Set([...l.keys()].filter(w=>u.has(w))),x=new Set([...l.keys()].filter(w=>d.has(w)));for(let w of x)i.delete(w);let C=new Map;for(let w of y)C.set(w,{role:l.get(w).object,filler:u.get(w).object});let v=new Map;for(let w of Sd(r))w.kind!=="min"&&w.kind!=="exactly"||w.n>=1&&(y.has(w.restriction)||!l.has(w.restriction)||!f.has(w.restriction)||!p.has(w.restriction)||(v.set(w.restriction,w.onClass),C.set(w.restriction,{role:"has",filler:w.onClass})));let j=new Set(m.keys()),E=[],S=new Map;for(let w of h){let T=w.subject,O=w.object;if(j.has(T)){S.has(T)||S.set(T,w);continue}if(y.has(O)){let{role:R,filler:k}=C.get(O),L=l.get(O),B=u.get(O);E.push({form:"someRight",sub:T,role:R,filler:k,from:[w.id,L.id,B.id]}),E.push({form:"someLeft",role:R,filler:k,sup:O,from:[L.id,B.id]});continue}if(v.has(O)){let R=v.get(O),k=l.get(O),L=f.get(O),B=p.get(O);E.push({form:"someRight",sub:T,role:"has",filler:R,from:[w.id,k.id,L.id,B.id]}),E.push({form:"someLeft",role:"has",filler:R,sup:O,from:[k.id,L.id,B.id]});continue}x.has(O)||E.push({form:"sub",sub:T,sup:O,from:[w.id]})}for(let[w,T]of m){let O=S.get(w);if(!O)continue;let R=new Map;for(let V of T)R.has(V.object)||R.set(V.object,V);let k=[...R.keys()].sort();if(k.length<2)continue;let L=k[0],B=[R.get(k[0]).id];for(let V=1;V<k.length;V+=1){let K=k[V],Y=V===k.length-1,_=Y?O.object:`${L}-and-${K}`,P=[L,K].sort(),W=R.get(K).id,F=Y?[...B,W,O.id]:[...B,W];E.push({form:"and",subs:P,sup:_,from:F}),B=[...B,W],L=_}}for(let w of g)E.push({form:"and",subs:[w.subject,w.object].sort(),sup:ln,from:[w.id]});let A=[];for(let w of[...b.keys()].sort())A.push({kind:"transitive",role:w,from:[b.get(w).id]});for(let w of[...$].sort((T,O)=>`${T.subject}${le}${T.object}`.localeCompare(`${O.subject}${le}${O.object}`)))A.push({kind:"sub",sub:w.subject,sup:w.object,from:[w.id]});return{axioms:E,roleAxioms:A,concepts:i,roles:a,restrictionOf:C,truncated:o}}function Ll(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:x1(s),c=(...w)=>!a||w.some(T=>a.has(T)),l=new Map,u=new Map,d=new Map,f=new Map;for(let w of o)if(w.form==="sub")l.has(w.sub)||l.set(w.sub,[]),l.get(w.sub).push({sup:w.sup,from:w.from});else if(w.form==="and"){let[T,O]=w.subs;for(let[R,k]of[[T,O],[O,T]])u.has(R)||u.set(R,[]),u.get(R).push({other:k,sup:w.sup,from:w.from})}else if(w.form==="someRight")d.has(w.sub)||d.set(w.sub,[]),d.get(w.sub).push({role:w.role,filler:w.filler,from:w.from});else if(w.form==="someLeft"){let T=`${w.role}${le}${w.filler}`;f.has(T)||f.set(T,[]),f.get(T).push({sup:w.sup,from:w.from})}let p=new Map,m=new Set,h=new Map;for(let w of r)w.kind==="sub"?(p.has(w.sub)||p.set(w.sub,[]),p.get(w.sub).push({sup:w.sup,from:w.from})):w.kind==="transitive"&&(m.add(w.role),h.has(w.role)||h.set(w.role,w.from));let g=new Map;for(let w of i)g.set(w,new Set([w,ao]));let b=new Map,$=new Map,y=new Map,x=(w,T)=>w===T?[]:$.get(`${w}${le}${T}`)||[],C=(w,T)=>y.get(`${w}${le}${T}`)||[],v=(...w)=>{let T=new Set,O=[];for(let R of w)for(let k of R||[])!k||T.has(k)||(T.add(k),O.push(k));return O},j=0,E=!1,S=0;for(let w=0;w<n;w+=1){S+=1;let T=[];for(let[R,k]of g)for(let L of k)for(let{sup:B,from:V}of l.get(L)||[])k.has(B)||c(R,L,B)&&T.push({kind:"sub",A:R,X:B,from:v(x(R,L),V),sortKey:`1${le}${R}${le}${B}${le}${L}`});for(let[R,k]of g)for(let L of k)for(let{other:B,sup:V,from:K}of u.get(L)||[])k.has(B)&&(k.has(V)||c(R,L,B,V)&&T.push({kind:"sub",A:R,X:V,from:v(x(R,L),x(R,B),K),sortKey:`2${le}${R}${le}${V}${le}${[L,B].sort().join(le)}`}));for(let[R,k]of g)for(let L of k)for(let{role:B,filler:V,from:K}of d.get(L)||[]){let Y=`${R}${le}${V}`;(b.get(B)||ra).has(Y)||c(R,L,V)&&T.push({kind:"role",role:B,A:R,B:V,from:v(x(R,L),K),sortKey:`3${le}${B}${le}${R}${le}${V}${le}${L}`})}for(let[R,k]of b)for(let L of k){let[B,V]=L.split(le),K=g.get(V)||ra;for(let Y of K)for(let{sup:_,from:P}of f.get(`${R}${le}${Y}`)||[]){let W=g.get(B);!W||W.has(_)||c(B,V,Y,_)&&T.push({kind:"sub",A:B,X:_,from:v(C(R,L),x(V,Y),P),sortKey:`4${le}${B}${le}${_}${le}${R}${le}${V}${le}${Y}`})}}for(let[R,k]of b)for(let L of k){let[B,V]=L.split(le);if(!(g.get(V)||ra).has(ln))continue;let K=g.get(B);!K||K.has(ln)||c(B,V)&&T.push({kind:"sub",A:B,X:ln,from:v(C(R,L),x(V,ln)),sortKey:`5${le}${B}${le}${R}${le}${V}`})}for(let[R,k]of b)for(let{sup:L,from:B}of p.get(R)||[])for(let V of k){if((b.get(L)||ra).has(V))continue;let[K,Y]=V.split(le);c(K,Y)&&T.push({kind:"role",role:L,A:K,B:Y,from:v(C(R,V),B),sortKey:`6${le}${L}${le}${K}${le}${Y}${le}${R}`})}for(let R of[...m].sort()){let k=b.get(R);if(k)for(let L of k){let[B,V]=L.split(le);for(let K of k){let[Y,_]=K.split(le);if(Y!==V)continue;let P=`${B}${le}${_}`;k.has(P)||c(B,V,_)&&T.push({kind:"role",role:R,A:B,B:_,from:v(C(R,L),C(R,K),h.get(R)),sortKey:`7${le}${R}${le}${B}${le}${_}${le}${V}`})}}}if(!T.length){E=!0;break}T.sort((R,k)=>R.sortKey<k.sortKey?-1:R.sortKey>k.sortKey?1:0);let O=!1;for(let R of T){if(j>=t)break;if(R.kind==="sub"){let k=g.get(R.A);if(!k||k.has(R.X))continue;k.add(R.X),$.set(`${R.A}${le}${R.X}`,R.from),j+=1,O=!0}else{b.has(R.role)||b.set(R.role,new Set);let k=b.get(R.role),L=`${R.A}${le}${R.B}`;if(k.has(L))continue;k.add(L),y.set(`${R.role}${le}${L}`,R.from),j+=1,O=!0}}if(j>=t)break;if(!O){E=!0;break}}let A=[...g.entries()].filter(([,w])=>w.has(ln)).map(([w])=>w).sort();return{subsumers:g,roleEdges:b,unsatisfiable:A,derivationOf:$,rounds:S,truncated:!E}}function lE(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${le}${a.filler}${le}${a.sub}`,u=`${c.role}${le}${c.filler}${le}${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,ao])].filter(u=>u!==ao&&u!==ln).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 uE(e,t){let n=H(e),s=H(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function O1(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=H(t),a=Qp(e,{budget:o}),{axiom:c,name:l}=uE(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},f=Ll(d,{budget:o,rounds:r});return(f.subsumers.get(i)||ra).has(l)?{proved:!0,premises:f.derivationOf.get(`${i}${le}${l}`)||[]}:{proved:!1,exhausted:f.truncated}}function fE(e,{budget:t=tm,rounds:n=nm,focus:s=null}={}){let o=Qp(e,{budget:t}),r=Ll(o,{budget:t,rounds:n,focus:s}),i=lE(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Ll(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 N1(e,t={}){let{finalPass:n,truncated:s}=fE(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${le}${ln}`)||[],truncated:s}}async function L1(e,{budget:t=tm,rounds:n=nm,focus:s=null,maxEnvironments:o=wr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=v1(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:f,goalInfo:p,finalPass:m,truncated:h}=fE(u,{budget:t,rounds:n,focus:s}),g=new Map;for(let A of u)g.set(`${A.subject}${le}${A.predicate}${le}${A.object}`,A.trust);let b=new Map(u.map(A=>[A.id,A])),$=A=>(A||[]).map(w=>b.get(w)?.trust).filter(w=>typeof w=="number"),y=new Set(u.filter(A=>cE(A.predicate)).map(A=>`${A.subject}${le}${A.object}`)),x=[],C=[],v=new Set,j=[...m.subsumers.keys()].sort();for(let A of j){let w=m.subsumers.get(A);if(w.has(ln))continue;let T=[...w].filter(O=>O!==A&&O!==ao&&O!==ln).sort();for(let O of T){let R=`${A}${le}${O}`;if(y.has(R))continue;let k=m.derivationOf.get(R)||[],L=p.get(O);if(L){v.has(O)||(v.add(O),x.push({subject:O,predicate:Pt,object:"owl:Restriction",provenance:ia,justification:[k]}),x.push({subject:O,predicate:xn,object:L.role,provenance:ia,justification:[k]}),x.push({subject:O,predicate:En,object:L.filler,provenance:ia,justification:[k]}));let B=$(k),V=x.length;x.push({subject:A,predicate:ze,object:O,provenance:ia,justification:[k],...B.length?{premiseTrusts:B,ruleConfidence:Jp}:{}}),C.push({toWriteIndex:V,subject:A,object:O,rule:em})}else if(d.concepts.has(O)){let B=$(k),V=x.length;x.push({subject:A,predicate:ze,object:O,provenance:dE,justification:[k],...B.length?{premiseTrusts:B,ruleConfidence:Jp}:{}}),C.push({toWriteIndex:V,subject:A,object:O,rule:Zp})}}}let{ids:E}=await c(e,x),S=C.map(A=>({id:E[A.toWriteIndex],subject:A.subject,object:A.object,rule:A.rule}));return{derived:S,count:S.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:f.length}}var le,ao,ln,ls,cE,E1,S1,j1,k1,R1,_1,T1,A1,C1,I1,ra,Zp,dE,em,ia,Jp,tm,nm,mE=M(()=>{ot();At();le="\u241F",ao="top",ln="bot";ls=e=>String(e||"").trim().toLowerCase(),cE=e=>ls(e)==="rdfs:subclassof",E1=e=>ls(e)==="rdf:type",S1=e=>ls(e)==="owl:disjointwith",j1=e=>ls(e)==="owl:onproperty",k1=e=>ls(e)==="owl:somevaluesfrom",R1=e=>ls(e)==="owl:allvaluesfrom",_1=e=>ls(e)==="owl:onclass",T1=e=>ls(e)==="owl:intersectionof",A1=e=>ls(e)==="rdfs:subpropertyof",C1=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),I1=e=>C1.has(ls(e));ra=new Set;Zp="elSubsumption",dE=`entailed:${Zp}`,em="elRestriction",ia=`entailed:${em}`,Jp=.95,tm=2e3,nm=64});var hE={};Ot(hE,{DEFAULT_REASONING_CONFIG:()=>Pl,resolveReasoningConfig:()=>z1});function F1(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function D1(e,t){return typeof e=="boolean"?e:t}function z1(e){let t=e?.reasoning||{},n={...Pl};for(let[s,o]of Object.entries(P1))t[s]!==void 0&&(n[o]=F1(t[s],Pl[o]));for(let[s,o]of Object.entries(M1))t[s]!==void 0&&(n[o]=D1(t[s],Pl[o]));return n}var Pl,P1,M1,gE=M(()=>{Pl=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),P1=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",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),M1=Object.freeze({ask_prove_fallback:"askProveFallback"})});function mm(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 ${Ml(e.entityType)}`;if(t==="list")return`list/enumerate ${Ml(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Ml(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 mm(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&&Tn[o]?Tn[o]:`filter/traverse ${Ml(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&&Tn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?Tn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function vm(e){let t=new Map;for(let n of e)t.has(yE(n))||t.set(yE(n),n);return t}function rm(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 im(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 K1(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function Y1(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Wx(),Bx)),s=n();return s?K1(t,s(t)):t}catch{return t}}function Em(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)||X1.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 Ul(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return Or;if(t==="can")return"mgx:capableOf";try{let n=await Y1(t);return n==="have"?Or:Yn(`mgx:${n}`)}catch{return Yn(`mgx:${t}`)}}function sP(e,t){let n=String(t||"").match(nP);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function aa(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(qn(),Tb)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function xE(e){return e.predicate===H1&&e.object==="transitiveproperty"||e.predicate===HE}function lP(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 Vl(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 SE(e){let t=Vl(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function QE(e){if(Ps[e])return Ps[e];let t=String(e||""),n=Zb(t);if(n){let a=QE(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",Vl(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:(${Sm})-([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?`${lP(i[1])}${i[2]?` ${i[2]}`:""}`:e}function um(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function dP(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of uP)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 ds(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${ds(e.provenance)})`:"";return e.predicate===HE?`${SE(e.subject)} implies ${SE(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Zt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Zt(e)}${t}`:e.provenance.includes("corpus:")?`${Zt(e)}${t}`:e.provenance.includes("reference:")?`${Zt(e)}${t}`:`i learned: ${Zt(e)}${t}`}function jE(e,t,n,{toward:s=null}={}){let o=oe(e);if(!us.has(e.predicate)||!n.has(e.subject))return o;let r=ul(e.object,t,{cap:6,stopAt:cl,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(fP);return a?o.slice(0,a.index)+i+a[0]:o+i}function kE(e,t,n,{indent:s=""}={}){let o=t.filter(C=>C.predicate===Go).map(C=>[C.subject,C.object]),r=Ji(o),i=e.map(C=>`${s}${jE(C,r,n)}`),a=e.filter(C=>us.has(C.predicate)&&n.has(C.subject)),c=[...new Set(a.map(C=>C.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(C=>C.predicate==="owl:disjointWith").map(C=>[C.subject,C.object]),{split:u,clusters:d}=dl(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let C of d)for(let v of C.objects)p.set(v,C);let m=e.filter(C=>!(us.has(C.predicate)&&n.has(C.subject))),h=[],g=[],b=0,$=C=>{let v=jE(C,r,n);return b<je?(b+=1,`${s}${v}`):(g.push(v),null)};for(let C of d){let v=a.filter(j=>p.get(j.object)===C).map($).filter(Boolean);v.length&&h.push(`${s}${f}, the ${C.label}:
172
+ `});var Xv=M(()=>{Rp()});var Jv=M(()=>{Rp()});var Zv=M(()=>{Ke();Fo();$n();Ur()});var tx=M(()=>{bs();Ke();ml();gl();Ur()});var Tp,jL,kL,RL,_L,TL,AL,u5,d5,Ur=M(()=>{Fo();pl();ml();Ov();os();Wc();yp();$p();gl();hl();bl();Ke();Yv();Xv();Jv();Zv();tx();Tp="mgx:world-epoch",jL=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),kL=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),RL="mgx:is-open",_L="mgx:hasMass",TL="mgx:knows-about",AL="mgx:display-name",u5=new Set([...jL,...kL,RL,_L,TL,AL,"rdf:type",Tp]),d5=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 Br,p5,m5,h5,g5,b5,w5,ro=M(()=>{Br=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})}),p5=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"}),m5=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"}),h5=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"}),g5=Object.freeze({teach:"teach"}),b5=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),w5=Object.freeze({max_depth:"maxDepth"})});var sx,CL,vl,IL,OL,ox,rx,NL,LL,v5,PL,ML,ix=M(()=>{ro();sx="spider-fly",CL=10,vl=Object.freeze({x:2,y:2}),IL=1,OL=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}),ox=(e,t)=>`cell-${e}-${t}`,rx=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),NL=(e,t)=>rx(e,t,vl.x,vl.y)<=IL,LL=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})}),v5=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"])]),PL="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.",ML=Object.freeze({name:sx,gridSize:CL,opening:PL,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:NL,webHomeCell:ox(vl.x,vl.y)})});var ax,dx,S5,j5,k5,Ap,cx,lx,ux,Cp,R5,_5,xl=M(()=>{ro();ax=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),dx=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})}),S5=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),j5=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),k5=Object.freeze([ax.spawnedFood,ax.placedFood]),Ap=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),cx=Ap({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"}]}),lx=Ap({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"}]}),ux=Ap({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"}]}),Cp=Object.freeze({[cx.name]:cx,[lx.name]:lx,[ux.name]:ux}),R5=Object.freeze(Object.keys(Cp)),_5=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 Ip=M(()=>{});var fx=M(()=>{});var Zi,t4,VL,HL,qL,KL,YL,XL,JL,QL,ZL,e0,t0,n0,s0,o0,r0,i0,a0,n4,Op=M(()=>{xl();Ip();bs();Ke();Fo();fx();ot();ro();pl();Ur();Zi=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"}}),t4=Object.freeze(["predator","prey"]),VL="mgx:currently-in",HL="mgx:hasMass",qL="mgx:feels",KL="mgx:facing",YL="mgx:driven-facing",XL="mgx:eaten-by",JL="mgx:starved",QL="mgx:placed-by",ZL="mgx:model",e0="mgx:rotation",t0="mgx:carrying",n0="mgx:prey-eaten",s0="mgx:web-built-at-turn",o0="mgx:laid-at-turn",r0="mgx:hatched-into",i0="mgx:turn-played",a0=new Set([VL,HL,qL,KL,YL,XL,JL,QL,ZL,e0,i0,t0,n0,s0,o0,r0,"rdf:type",Tp]),n4=Object.freeze([...a0].sort())});var $4,v4,mx=M(()=>{ix();xl();Op();Fo();bl();Ke();ro();$4=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"),v4=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var J4,Q4,Z4,eX,tX,nX,d0,f0,p0,m0,hx,gx,h0,sX,oX,bx=M(()=>{xl();Op();Ur();$n();Fo();bl();Ke();ro();pl();Ip();hl();bs();J4=Zi.predator.kind,Q4=Zi.prey.kind,Z4=Zi.food.spawnedKind,eX=Zi.food.placedKind,tX=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"),nX=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"),d0="mgx:currently-in",f0="mgx:hasMass",p0="mgx:feels",m0="mgx:facing",hx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",gx="(fox|goblin)(?:-(\\d+))?",h0="(crumb|morsel)(?:-(\\d+))?",sX=[{kind:"placement",predicate:d0,re:new RegExp(`^(?:the\\s+)?${hx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:f0,re:new RegExp(`^(?:the\\s+)?${hx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:p0,re:new RegExp(`^(?:the\\s+)?${gx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:m0,re:new RegExp(`^(?:the\\s+)?${gx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],oX=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${h0}\\s+there[.!\\s]*$`,"i")});var jt,iX,aX,cX,lX,uX,dX,fX,pX,mX,hX,gX,bX,wX,yX,$X,vX,xX,EX,g0,wx=M(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iX=jt("createRequire"),aX=jt("readFileSync"),cX=jt("access"),lX=jt("readFile"),uX=jt("writeFile"),dX=jt("appendFile"),fX=jt("mkdir"),pX=jt("mkdtemp"),mX=jt("rename"),hX=jt("unlink"),gX=jt("rm"),bX=jt("stat"),wX=jt("copyFile"),yX=jt("readdir"),$X=jt("createReadStream"),vX=jt("createWriteStream"),xX=jt("randomBytes"),EX=jt("spawnSync"),g0=jt("createInterface")});var kt,jX,kX,RX,_X,TX,AX,CX,IX,OX,NX,LX,PX,MX,FX,DX,zX,UX,yx,BX,Np=M(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},jX=kt("createRequire"),kX=kt("readFileSync"),RX=kt("access"),_X=kt("readFile"),TX=kt("writeFile"),AX=kt("appendFile"),CX=kt("mkdir"),IX=kt("mkdtemp"),OX=kt("rename"),NX=kt("unlink"),LX=kt("rm"),PX=kt("stat"),MX=kt("copyFile"),FX=kt("readdir"),DX=kt("createReadStream"),zX=kt("createWriteStream"),UX=kt("randomBytes"),yx=kt("spawnSync"),BX=kt("createInterface")});var $x=M(()=>{Np();Xe();Nt();Xe();Ai();Kt()});var vx=M(()=>{});var b0,xx=M(()=>{Nt();Xe();Ke();vx();b0=ne(".tmct","sessions")});var Ex=M(()=>{Nt();Xe();Gc()});var Sx,El,jx=M(()=>{Sx=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`)."}),El=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var Rt,l8,u8,d8,f8,p8,m8,h8,g8,b8,w8,y8,$8,v8,x8,E8,S8,j8,k8,kx,Rx=M(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},l8=Rt("createRequire"),u8=Rt("readFileSync"),d8=Rt("access"),f8=Rt("readFile"),p8=Rt("writeFile"),m8=Rt("appendFile"),h8=Rt("mkdir"),g8=Rt("mkdtemp"),b8=Rt("rename"),w8=Rt("unlink"),y8=Rt("rm"),$8=Rt("stat"),v8=Rt("copyFile"),x8=Rt("readdir"),E8=Rt("createReadStream"),S8=Rt("createWriteStream"),j8=Rt("randomBytes"),k8=Rt("spawnSync"),kx=Rt("createInterface")});var Ix={};Ot(Ix,{CONTEXT_PASSAGE_PREDICATE:()=>Tx,CO_OCCURS_PREDICATE:()=>Sl,ingestUnknownFromAssertions:()=>$0,knownTermsFrom:()=>Ax,passageFor:()=>Cx});function Ax(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==vt)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(H(r)),i&&n.add(H(i))}for(let s of t||[])s?.subject&&n.add(H(s.subject)),s?.object&&n.add(H(s.object));return n}function Cx(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=io(e?.start),o=io(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function y0(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<_x;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(w0.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=_x))break}return o}async function $0(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 dt(e),c=Ax(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=io(p.start),g=io(p.end);if(!h||!g)continue;let b=H(h),$=H(g),y=!c.has(b),x=!c.has($);if(!y&&!x)continue;let C=Cx(p,m);if(!C)continue;let v=[[h,g,y],[g,h,x]];for(let[j,E,S]of v){if(!S||l.size>=i)continue;let A=H(j);if(l.has(A))continue;let w=`${r} ${p.rel}`;u.push({subject:j,predicate:Tx,object:C,provenance:w}),u.push({subject:j,predicate:Sl,object:E,provenance:w});let T=y0(C,c,new Set([b,$]));for(let O of T)u.push({subject:j,predicate:Sl,object:O,provenance:w});l.add(A),c.add(A)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await ss(e,u),f=u.filter(p=>p.predicate===Sl).length;return{captured:l.size,linked:f,appended:d.appended,skipped:d.skipped}}var Tx,Sl,w0,_x,Ox=M(()=>{Ke();jl();Tx="mgx:contextPassage",Sl="mgx:coOccursWith",w0=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"]),_x=3});var Nx={};Ot(Nx,{MAP_FILE:()=>ta,SEON_CONCEPTS_FILE:()=>kl,SEON_DEFINITIONS_FILE:()=>v0,SLICE_FILE:()=>ea,TIER2_DIR:()=>rs,TIER2_MANIFEST_FILE:()=>x0,WORDNET_DIR:()=>na,loadMap:()=>_l,loadSlice:()=>Rl,seedMemory:()=>S0,termText:()=>io,toFacts:()=>Tl});async function Rl(e=ea){let t=kx({input:K$(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 _l(e=ta){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(!E0.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 Tl(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=io(o.start),a=io(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 S0(e,{limit:t,slicePath:n=ea,mapPath:s=ta,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([Rl(n),_l(s)]),u=Tl(c,l,r);if(Array.isArray(o)&&o.length){let $=new Map(o.map((y,x)=>[y,x]));u=u.slice().sort((y,x)=>($.get(y.predicate)??o.length)-($.get(x.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=($,y,x)=>`${H($)} ${y} ${H(x)}`,f=new Set,p=await dt(e);for(let $ of p.individuals||[]){if($?.class!=="Fact")continue;let y=x=>($.attributes||[]).find(C=>C.key===x)?.value;f.add(d(y("subject"),y("predicate"),y("object")))}let m=0,h=[];for(let $ of u){let y=d($.subject,$.predicate,$.object);if(f.has(y)){m+=1;continue}f.add(y),h.push($)}let g=await ss(e,h),b;if(i){let{ingestUnknownFromAssertions:$}=await Promise.resolve().then(()=>(Ox(),Ix));b=await $(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 j0,Wr,ea,ta,kl,v0,rs,x0,na,M8,E0,io,jl=M(()=>{Po();Nt();Rx();so();Xe();Ec();Ke();j0={},Wr=ne(we(qt(j0.url)),"..","..",".."),ea=ne(Wr,"corpus","conceptnet","slice.jsonl"),ta=ne(Wr,"src","adapters","corpus","conceptnet-map.toml"),kl=ne(Wr,"corpus","domains","code","concepts.jsonl"),v0=ne(Wr,"corpus","domains","code","definitions.jsonl"),rs=ne(Wr,"corpus","tier2"),x0=ne(rs,"manifest.json"),na=ne(Wr,"corpus","wordnet"),M8=ne(na,"manifest.json"),E0=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);io=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var zx={};Ot(zx,{BUILTIN_EXTENSIONS:()=>T0,EXTENSION_KINDS:()=>Al,activeDomainPacks:()=>Dp,defaultCodeDomainPacks:()=>Dx,defaultCodeLaneVocab:()=>Fx,mergedLaneVocab:()=>Fp,mergedLexiconExtra:()=>Mx,resolveExtensions:()=>Px,seedActiveCorpusEntries:()=>I0,validateExtensionEntry:()=>Lx,validateExtensionPack:()=>N0});function Cl(){return{seon:{kind:"corpus",active:!1,corpusPath:kl,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:kl,provenancePrefix:"corpus:seon",vocabPath:R0,vocabData:Sx,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:ea,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:_0},human:{kind:"corpus",active:!0,corpusPath:ne(rs,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(rs,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(rs,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(rs,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(rs,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(rs,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Lp,vocabData:El,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(rs,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(na,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(na,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(k0,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function Lx(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Al.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Al.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 C0(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Al.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]=A0(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 Px(e,{configFile:t}={}){let n=e?await kc(e,t?{file:t}:{}):null,s=Cl(),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=C0(f,s[f]||null,o[f]||{},e||process.cwd());Lx(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 I0(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(jl(),Nx)),{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 Mx(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 Fp(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 Fx(){if(!Pp){let e={...Cl().code,active:!0};Pp=Fp(new Map([["code",e]]),{})}return Pp}async function O0(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 Dp(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 O0(o.name,o.entry));return s}function Dx(){if(!Mp){let e={...Cl().code,active:!0};Mp=Dp(new Map([["code",e]]),{})}return Mp}async function N0(e,t){let n=[],s=o=>o&&(Ql(o)?o:Ut(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Rl(o),i=await _l(s(t.mapPath)||ta),a=Tl(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(()=>(os(),sv)),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(()=>(Vc(),H$)),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 zp,k0,R0,Lp,Al,_0,T0,A0,Pp,Mp,Up=M(()=>{Xe();Nt();so();jx();Ai();jl();zp={},k0=ne(we(qt(zp.url)),"..","..","corpus","namenet"),R0=ne(we(qt(zp.url)),"..","..","corpus","domains","code","vocab.json"),Lp=ne(we(qt(zp.url)),"..","..","corpus","tier2","vocab-empty.json"),Al=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),_0=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];T0=Object.freeze(Cl());A0=(e,t)=>{if(t==null)return;let n=String(t);return Ql(n)?n:Ut(e,n)};Pp=null;Mp=null});var Ux=M(()=>{});var Bx=M(()=>{Xe();Po();Nt();cp();wx();Np();Kt();$x();Me();xx();Gc();Ex();Zr();Up();Xi();ro();Wc();gl();ip();up();Fr();Ux()});var Wx={};Ot(Wx,{proseLemma:()=>M0});function M0(){if(Uo!==void 0)return Uo;try{let e=Yc();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,Gx=M(()=>{Xc()});var Vx={};Ot(Vx,{digestTermFromRows:()=>z0,loadDigestStructureTable:()=>D0,readDigestStructures:()=>F0});var F0,D0,z0,Hx=M(()=>{F0=()=>null,D0=()=>null,z0=()=>null});var Yp={};Ot(Yp,{DEFAULT_MODULE_HOPS:()=>Vp,DEFAULT_PROVE_BRANCHES:()=>tE,DEFAULT_PROVE_NODES:()=>nE,DEFAULT_PROVE_STEPS:()=>eE,MAX_PROVEN_CASES:()=>oE,MAX_ROLE_ASSERTIONS:()=>sE,TABLEAU_RULE_CONFIDENCE:()=>H0,buildTableauKb:()=>h1,canonicalKey:()=>We,extractTableauModule:()=>w1,findTableauViolations:()=>b1,isSatisfiable:()=>qp,moduleHasDlShape:()=>$1,proveEntailment:()=>d1,proveSubsumption:()=>f1,proveSubsumptionOfNegation:()=>p1,toNNF:()=>Qt});function We(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(${We(e.c)})`;case"and":return`and(${e.cs.map(We).sort().join(",")})`;case"or":return`or(${e.cs.map(We).sort().join(",")})`;case"some":return`some(${e.r},${We(e.c)})`;case"all":return`all(${e.r},${We(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${We(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${We(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function sa(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 sa(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>sa(o,t));return s.sort((o,r)=>We(o).localeCompare(We(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=sa(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=sa(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 Qt(e){return sa(e,!1)}function zt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function Wp(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function W0(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Zx(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function G0(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 V0(e,t){let n=(e||[]).map(([r,i])=>[cs(r),cs(i)]),s=G0(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=cs(r);o.set(i,new Set([i,...s(i)]))}return o}function qx(e,t,n){let s=cs(t),o=cs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Nl(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&qx(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(cs(r.r)):null;i&&qx(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function Il(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!q0.test(t)}function oa(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function K0(e,t,n,s){if(t===n)return;let o=oa(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,zt(r?[...r,...s]:s))}function rE(e,t,n,s){return n===s?!1:Il(t,n)&&Il(t,s)?!0:e.inequalityFrom.has(oa(n,s))}function iE(e,t,n){let s=e.inequalityFrom.get(oa(t,n));return s?s.slice():[]}function Y0(e,t,n){let s=Il(e,t),o=Il(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function aE(e,t,n,s){if(n===s)return n;let[o,r]=Y0(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=oa(h,g),$=u.get(b);u.set(b,$?zt([...$,...f]):f)}return e.inequalityFrom=u,e.nodes.delete(r),o}function Hp(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Mn(e,t,n){let s=We(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:zt(n)}),!0)}function Gr(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Ol(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=We(Qt(as(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 Kx(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function cE(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?Kx(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=Kx(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function Yx(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),choices:(e.choices||[]).slice()}}function X0(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of Gr(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Mn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function J0(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(rE(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,...iE(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function Q0(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 Gr(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Nl(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Mn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Mn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function Z0(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),Mn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function e1(e,t){if(We(t)==="bot")return[];let n=We(Qt(as(t))),s=e.labels.get(n);return s?s.from:null}function t1(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function n1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Gr(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,f)=>We(d).localeCompare(We(f)));if(i.some(d=>n.labels.has(We(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:e1(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=t1(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:We(i[0]),keyB:We(Qt(as(i[0]))),premises:zt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),Mn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function s1(e,t){for(let n of e.nodes.values())if(!cE(n,e,t))for(let[,{expr:s,from:o}]of Gr(n)){if(s.t!=="some")continue;let r=We(s.c);if(Nl(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=Hp(`${n.id}.${n.successorCount}`,n.id);return Mn(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 o1(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of Gr(n)){if(o.t!=="atMost")continue;let i=We(o.c),a=[...new Set(Nl(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])=>!rE(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,...iE(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function r1(e,t){for(let n of e.nodes.values())if(!cE(n,e,t))for(let[,{expr:s,from:o}]of Gr(n)){if(s.t!=="atLeast")continue;let r=We(s.c),i=[...new Set(Nl(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=Hp(`${n.id}.${n.successorCount}`,n.id);Mn(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)K0(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function i1(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Ol(s);if(o)return o}return null}function Bo(e,t){let n=i1(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function a1(e,t){let n=X0(e);if(n.applied)return Bo(e,n.touched);let s=Q0(e,t);if(s.applied)return Bo(e,s.touched);let o=J0(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=aE(e,t,o.a,o.b);return Bo(e,[u])}let r=Z0(e,t);if(r.applied)return Bo(e,r.touched);let i=n1(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),Bo(e,i.touched);if(i.kind==="split")return i;let a=o1(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=r1(e,t);if(c.applied)return Bo(e,c.touched);let l=s1(e,t);return l.applied?Bo(e,l.touched):{kind:"done"}}function c1(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 l1(e,t,n){let s=Wp(n.maxSteps,eE),o=Wp(n.maxBranches,tE),r=Wp(n.maxNodes,nE),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=a1(u,t);if(d.kind==="clash"){let f=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:f});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=Yx(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);Mn(h,p,d.from);let g=Ol(h);return g&&(m.closed=!0,m.clash={...g,choices:m.choices.slice()}),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=Yx(u),g=aE(h,t,p,m),b=h.nodes.get(g),$=b&&Ol(b);return $&&(h.closed=!0,h.clash={...$,choices:h.choices.slice()}),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:c1(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 u1(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,Hp(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])Mn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||Mn(s(i.ind),Qt(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])Mn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=oa(i.a,i.b),c=o.get(a);o.set(a,zt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function qp(e,t=[],n={}){let s=u1(e,t);for(let r of s.nodes.values()){let i=Ol(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=l1(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 Kp(e,t,n){let s=qp(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=zt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(We(d),d);let i=[...r.keys()].sort(),a=i.slice(0,oE).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function d1(e,t,n,s={}){return Kp(e,[{ind:t,expr:Qt(as(n)),from:[]}],s)}function f1(e,t,n,s={}){let o=Qt(Jx([De(t),as(De(n))]));return Kp(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function p1(e,t,n,s={}){let o=Qt(Jx([De(t),De(n)]));return Kp(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function m1(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function h1(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=new Map,u=[],d=[],f=[],p=[],m=new Set,h=[],g=[],b=[],$=[],y=(_,P,W)=>{_.has(P)||_.set(P,[]),_.get(P).push(W)};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:allvaluesfrom"?o.set(_.subject,{object:_.object,id:_.id}):P==="owl:onclass"?r.set(_.subject,{object:_.object,id:_.id}):P==="owl:mincardinality"?i.set(_.subject,{kind:"min",n:Number(_.object),id:_.id}):P==="owl:maxcardinality"?i.set(_.subject,{kind:"max",n:Number(_.object),id:_.id}):P==="owl:cardinality"?i.set(_.subject,{kind:"exact",n:Number(_.object),id:_.id}):P==="rdfs:subclassof"?u.push(_):P==="owl:disjointwith"?d.push(_):P==="rdf:type"?(f.push(_),String(_.object||"").toLowerCase()==="transitiveproperty"&&m.add(_.subject)):P==="mgxneg:subclassof"?p.push(_):P==="owl:unionof"?y(a,_.subject,_):P==="owl:complementof"?c.set(_.subject,_):P==="rdfs:subpropertyof"?h.push(_):P==="owl:differentfrom"?g.push(_):P==="owl:oneof"?y(l,_.subject,_):P==="owl:inverseof"?b.push(_):$.push(_)}let x=new Set;for(let _ of f){let P=String(_.object||"").toLowerCase();Gp.has(P)||x.add(_.subject)}let C=Zx(x,$),v=_=>C.has(_)||Qx.test(_),j=$.filter(_=>v(_.subject)&&v(_.object)).sort((_,P)=>_.subject.localeCompare(P.subject)||_.predicate.localeCompare(P.predicate)||_.object.localeCompare(P.object)).slice(0,sE).map(_=>({a:_.subject,r:_.predicate,b:_.object,from:[_.id]})),E=(_,P,W)=>({sub:_,sup:P,from:zt(W),disjunction:Qt(Bp([as(_),P]))}),S=[],A=[];for(let _ of u){let P=_.object;if(!n.has(P)){S.push(E(De(_.subject),De(P),[_.id]));continue}let W=n.get(P),F=s.get(P);if(F){S.push(E(De(_.subject),U0(W.object,De(F.object)),[_.id,W.id,F.id]));continue}let z=o.get(P);if(z){S.push(E(De(_.subject),B0(W.object,De(z.object)),[_.id,W.id,z.id]));continue}let N=i.get(P),D=r.get(P);if(N&&D){let U=[_.id,W.id,D.id,N.id];N.kind==="min"?S.push(E(De(_.subject),{t:"atLeast",n:N.n,r:W.object,c:De(D.object)},U)):N.kind==="max"?S.push(E(De(_.subject),{t:"atMost",n:N.n,r:W.object,c:De(D.object)},U)):N.kind==="exact"&&(S.push(E(De(_.subject),{t:"atLeast",n:N.n,r:W.object,c:De(D.object)},U)),S.push(E(De(_.subject),{t:"atMost",n:N.n,r:W.object,c:De(D.object)},U)))}}for(let _ of d)v(_.subject)?A.push({ind:_.subject,expr:Qt(as(De(_.object))),from:[_.id]}):S.push(E(De(_.subject),Qt(as(De(_.object))),[_.id]));for(let _ of f)Gp.has(String(_.object||"").toLowerCase())||A.push({ind:_.subject,expr:De(_.object),from:[_.id]});for(let _ of p)A.push({ind:_.subject,expr:Qt(as(De(_.object))),from:[_.id]});for(let[_,P]of a){let W=[...P].sort((D,U)=>String(D.object).localeCompare(String(U.object))),F=W.map(D=>De(D.object)),z=W.map(D=>D.id),N=Qt(Bp(F));S.push(E(De(_),N,z)),S.push(E(N,De(_),z))}for(let[_,P]of c){let W=Qt(as(De(P.object)));S.push(E(De(_),W,[P.id])),S.push(E(W,De(_),[P.id]))}let w=new Map;for(let[_,P]of l){let W=[...P].sort((N,D)=>String(N.object).localeCompare(String(D.object))),F=W.map(N=>({t:"nom",ind:N.object})),z=W.map(N=>N.id);S.push(E(De(_),Qt(Bp(F)),z));for(let N of W){S.push(E({t:"nom",ind:N.object},De(_),[N.id]));let D=w.get(N.object);w.set(N.object,D?zt([...D,N.id]):[N.id])}}let T=g.map(_=>({a:_.subject,b:_.object,from:[_.id]})).sort((_,P)=>_.a.localeCompare(P.a)||_.b.localeCompare(P.b)),O=new Map;for(let _ of b)O.set(_.subject,_.object),O.has(_.object)||O.set(_.object,_.subject);let R=new Set;for(let{object:_}of n.values())R.add(_);for(let _ of j)R.add(_.r);let k=h.map(_=>[_.subject,_.object]).sort((_,P)=>_[0].localeCompare(P[0])||_[1].localeCompare(P[1])),L=new Set([...R,...k.flat(),...O.keys(),...O.values()]),B=V0(k,L);S.sort((_,P)=>We(_.sub).localeCompare(We(P.sub))||We(_.sup).localeCompare(We(P.sup))||_.from.join(",").localeCompare(P.from.join(","))),A.sort((_,P)=>_.ind.localeCompare(P.ind)||We(_.expr).localeCompare(We(P.expr)));let V=[...new Set([...A.map(_=>_.ind),...j.flatMap(_=>[_.a,_.b])])].sort(),K=new Set(V),Y=new Set([...[...a.values()].flatMap(_=>_.map(P=>P.id)),...[...l.values()].flatMap(_=>_.map(P=>P.id))]);return{axioms:S,assertions:A,roles:[...R].sort(),individuals:V,transitiveRoles:m,roleClosure:B,namedIndividuals:K,nominalIndividuals:w,differentFrom:T,inverseOf:O,roleAssertions:j,unionOrOneOfIds:Y}}function g1(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function b1(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=g1(e,r);if(!i.assertions.length)continue;let a=qp(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:m1(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function is(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function w1(e,t,{hops:n=Vp}={}){let s=Array.isArray(e)?e.filter(k=>k&&k.subject&&k.predicate):[],o=W0(n,Vp),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,g=[],b=new Map,$=new Set;for(let k of s){if(String(k.predicate).trim().toLowerCase()!=="rdf:type")continue;let L=String(k.object||"").toLowerCase();Gp.has(L)||$.add(k.subject)}let y=s.filter(k=>!Xx.has(String(k.predicate).trim().toLowerCase())),x=Zx($,y),C=k=>x.has(k)||Qx.test(k);for(let k of s){let L=String(k.predicate).trim().toLowerCase();L==="rdfs:subclassof"?(is(r,k.subject,k.object),is(i,k.object,k.subject)):L==="owl:onproperty"?a.set(k.subject,k.object):L==="owl:somevaluesfrom"||L==="owl:allvaluesfrom"||L==="owl:onclass"?(c.set(k.subject,k.object),is(l,k.object,k.subject)):L==="owl:unionof"?(is(u,k.subject,k.object),is(d,k.object,k.subject)):L==="owl:complementof"?(f.set(k.subject,k.object),is(p,k.object,k.subject)):L==="owl:oneof"?(is(m,k.subject,k.object),is(h,k.object,k.subject)):!Xx.has(L)&&C(k.subject)&&C(k.object)&&(g.push(k),is(b,k.subject,k.object),is(b,k.object,k.subject))}let v=new Map;function j(k){let L=v.get(k);if(L)return L;let B=new Set,V=[...r.get(k)||[],...i.get(k)||[]];for(;V.length;){let K=V.pop();if(!B.has(K)){B.add(K);for(let Y of r.get(K)||[])B.has(Y)||V.push(Y);for(let Y of i.get(K)||[])B.has(Y)||V.push(Y)}}v.set(k,B);for(let K of B)v.has(K)||v.set(K,B);return B}let E=new Set,S=new Map,A=[];function w(k,L){if(!k)return;let B=S.get(k);B!==void 0&&B>=L||(S.set(k,L),A.push({term:k,hopsLeft:L}))}let T=[...new Set((Array.isArray(t)?t:[]).map(k=>H(k)).filter(Boolean))];for(let k of T)w(k,o);let O=0;for(;O<A.length;){let{term:k,hopsLeft:L}=A[O];if(O+=1,S.get(k)===L){E.add(k);for(let B of j(k))E.add(B),w(B,L);if(!(L<=0)){c.has(k)&&w(c.get(k),o);for(let B of l.get(k)||[])w(B,o);for(let B of u.get(k)||[])w(B,L-1);for(let B of d.get(k)||[])w(B,L-1);f.has(k)&&w(f.get(k),L-1);for(let B of p.get(k)||[])w(B,L-1);for(let B of m.get(k)||[])w(B,L-1);for(let B of h.get(k)||[])w(B,L-1);for(let B of b.get(k)||[])w(B,o)}}}let R=new Set;for(let[k,L]of a)E.has(k)&&R.add(cs(L));for(let k of g)(E.has(k.subject)||E.has(k.object))&&R.add(cs(k.predicate));return s.filter(k=>{if(E.has(k.subject)||E.has(k.object))return!0;let L=String(k.predicate).trim().toLowerCase();return L==="rdfs:subpropertyof"||L==="owl:inverseof"||L==="rdf:type"&&String(k.object).toLowerCase()==="transitiveproperty"?R.has(cs(k.subject)):!1})}function $1(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return y1.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var De,as,Jx,Bp,U0,B0,Qx,cs,Gp,eE,tE,nE,H0,Vp,sE,oE,q0,Xx,y1,Xp=M(()=>{ot();De=e=>({t:"atom",name:e}),as=e=>({t:"not",c:e}),Jx=e=>({t:"and",cs:e}),Bp=e=>({t:"or",cs:e}),U0=(e,t)=>({t:"some",r:e,c:t}),B0=(e,t)=>({t:"all",r:e,c:t});Qx=/[./\\#:@]/;cs=e=>H(e);Gp=new Set(["restriction","transitiveproperty","class"]),eE=5e3,tE=256,nE=512,H0=.95,Vp=4,sE=256,oE=6,q0=/\.\d+$/;Xx=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);y1=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var mE={};Ot(mE,{BOT:()=>ln,DEFAULT_EL_BUDGET:()=>tm,DEFAULT_EL_ROUNDS:()=>nm,EL_RESTRICTION_RULE:()=>em,EL_RULE_CONFIDENCE:()=>Jp,EL_SUBSUMPTION_RULE:()=>Zp,ENTAILED_EL_PROVENANCE:()=>fE,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>ia,TOP:()=>ao,classifyEl:()=>L1,elGoalAxioms:()=>uE,elGoalFor:()=>dE,elUnsatisfiableClasses:()=>N1,normalizeElTBox:()=>Qp,proveElSubsumption:()=>O1,saturateEl:()=>Ll});function v1(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 x1(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=H(s);o&&n.add(o)}return n.size?n:null}function Qp(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,T)=>String(w.id).localeCompare(String(T.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=w=>{w&&w!==ao&&w!==ln&&i.add(w)},l=new Map,u=new Map,d=new Map,f=new Map,p=new Map,m=new Map,h=[],g=[],b=new Map,$=[];for(let w of r){if(w.subject===ao||w.subject===ln||w.object===ao||w.object===ln)continue;let T=w.predicate;j1(T)?(l.set(w.subject,w),c(w.subject)):k1(T)?(u.set(w.subject,w),c(w.subject),c(w.object)):R1(T)?d.set(w.subject,w):_1(T)?(f.set(w.subject,w),c(w.subject),c(w.object)):I1(T)?(p.set(w.subject,w),c(w.subject)):T1(T)?(m.has(w.subject)||m.set(w.subject,[]),m.get(w.subject).push(w),c(w.subject),c(w.object)):lE(T)?(h.push(w),c(w.subject),c(w.object)):S1(T)?(g.push(w),c(w.subject),c(w.object)):E1(T)&&w.object==="transitiveproperty"?(b.has(w.subject)||b.set(w.subject,w),a.add(w.subject)):A1(T)&&($.push(w),a.add(w.subject),a.add(w.object))}let y=new Set([...l.keys()].filter(w=>u.has(w))),x=new Set([...l.keys()].filter(w=>d.has(w)));for(let w of x)i.delete(w);let C=new Map;for(let w of y)C.set(w,{role:l.get(w).object,filler:u.get(w).object});let v=new Map;for(let w of Sd(r))w.kind!=="min"&&w.kind!=="exactly"||w.n>=1&&(y.has(w.restriction)||!l.has(w.restriction)||!f.has(w.restriction)||!p.has(w.restriction)||(v.set(w.restriction,w.onClass),C.set(w.restriction,{role:"has",filler:w.onClass})));let j=new Set(m.keys()),E=[],S=new Map;for(let w of h){let T=w.subject,O=w.object;if(j.has(T)){S.has(T)||S.set(T,w);continue}if(y.has(O)){let{role:R,filler:k}=C.get(O),L=l.get(O),B=u.get(O);E.push({form:"someRight",sub:T,role:R,filler:k,from:[w.id,L.id,B.id]}),E.push({form:"someLeft",role:R,filler:k,sup:O,from:[L.id,B.id]});continue}if(v.has(O)){let R=v.get(O),k=l.get(O),L=f.get(O),B=p.get(O);E.push({form:"someRight",sub:T,role:"has",filler:R,from:[w.id,k.id,L.id,B.id]}),E.push({form:"someLeft",role:"has",filler:R,sup:O,from:[k.id,L.id,B.id]});continue}x.has(O)||E.push({form:"sub",sub:T,sup:O,from:[w.id]})}for(let[w,T]of m){let O=S.get(w);if(!O)continue;let R=new Map;for(let V of T)R.has(V.object)||R.set(V.object,V);let k=[...R.keys()].sort();if(k.length<2)continue;let L=k[0],B=[R.get(k[0]).id];for(let V=1;V<k.length;V+=1){let K=k[V],Y=V===k.length-1,_=Y?O.object:`${L}-and-${K}`,P=[L,K].sort(),W=R.get(K).id,F=Y?[...B,W,O.id]:[...B,W];E.push({form:"and",subs:P,sup:_,from:F}),B=[...B,W],L=_}}for(let w of g)E.push({form:"and",subs:[w.subject,w.object].sort(),sup:ln,from:[w.id]});let A=[];for(let w of[...b.keys()].sort())A.push({kind:"transitive",role:w,from:[b.get(w).id]});for(let w of[...$].sort((T,O)=>`${T.subject}${le}${T.object}`.localeCompare(`${O.subject}${le}${O.object}`)))A.push({kind:"sub",sub:w.subject,sup:w.object,from:[w.id]});return{axioms:E,roleAxioms:A,concepts:i,roles:a,restrictionOf:C,truncated:o}}function Ll(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:x1(s),c=(...w)=>!a||w.some(T=>a.has(T)),l=new Map,u=new Map,d=new Map,f=new Map;for(let w of o)if(w.form==="sub")l.has(w.sub)||l.set(w.sub,[]),l.get(w.sub).push({sup:w.sup,from:w.from});else if(w.form==="and"){let[T,O]=w.subs;for(let[R,k]of[[T,O],[O,T]])u.has(R)||u.set(R,[]),u.get(R).push({other:k,sup:w.sup,from:w.from})}else if(w.form==="someRight")d.has(w.sub)||d.set(w.sub,[]),d.get(w.sub).push({role:w.role,filler:w.filler,from:w.from});else if(w.form==="someLeft"){let T=`${w.role}${le}${w.filler}`;f.has(T)||f.set(T,[]),f.get(T).push({sup:w.sup,from:w.from})}let p=new Map,m=new Set,h=new Map;for(let w of r)w.kind==="sub"?(p.has(w.sub)||p.set(w.sub,[]),p.get(w.sub).push({sup:w.sup,from:w.from})):w.kind==="transitive"&&(m.add(w.role),h.has(w.role)||h.set(w.role,w.from));let g=new Map;for(let w of i)g.set(w,new Set([w,ao]));let b=new Map,$=new Map,y=new Map,x=(w,T)=>w===T?[]:$.get(`${w}${le}${T}`)||[],C=(w,T)=>y.get(`${w}${le}${T}`)||[],v=(...w)=>{let T=new Set,O=[];for(let R of w)for(let k of R||[])!k||T.has(k)||(T.add(k),O.push(k));return O},j=0,E=!1,S=0;for(let w=0;w<n;w+=1){S+=1;let T=[];for(let[R,k]of g)for(let L of k)for(let{sup:B,from:V}of l.get(L)||[])k.has(B)||c(R,L,B)&&T.push({kind:"sub",A:R,X:B,from:v(x(R,L),V),sortKey:`1${le}${R}${le}${B}${le}${L}`});for(let[R,k]of g)for(let L of k)for(let{other:B,sup:V,from:K}of u.get(L)||[])k.has(B)&&(k.has(V)||c(R,L,B,V)&&T.push({kind:"sub",A:R,X:V,from:v(x(R,L),x(R,B),K),sortKey:`2${le}${R}${le}${V}${le}${[L,B].sort().join(le)}`}));for(let[R,k]of g)for(let L of k)for(let{role:B,filler:V,from:K}of d.get(L)||[]){let Y=`${R}${le}${V}`;(b.get(B)||ra).has(Y)||c(R,L,V)&&T.push({kind:"role",role:B,A:R,B:V,from:v(x(R,L),K),sortKey:`3${le}${B}${le}${R}${le}${V}${le}${L}`})}for(let[R,k]of b)for(let L of k){let[B,V]=L.split(le),K=g.get(V)||ra;for(let Y of K)for(let{sup:_,from:P}of f.get(`${R}${le}${Y}`)||[]){let W=g.get(B);!W||W.has(_)||c(B,V,Y,_)&&T.push({kind:"sub",A:B,X:_,from:v(C(R,L),x(V,Y),P),sortKey:`4${le}${B}${le}${_}${le}${R}${le}${V}${le}${Y}`})}}for(let[R,k]of b)for(let L of k){let[B,V]=L.split(le);if(!(g.get(V)||ra).has(ln))continue;let K=g.get(B);!K||K.has(ln)||c(B,V)&&T.push({kind:"sub",A:B,X:ln,from:v(C(R,L),x(V,ln)),sortKey:`5${le}${B}${le}${R}${le}${V}`})}for(let[R,k]of b)for(let{sup:L,from:B}of p.get(R)||[])for(let V of k){if((b.get(L)||ra).has(V))continue;let[K,Y]=V.split(le);c(K,Y)&&T.push({kind:"role",role:L,A:K,B:Y,from:v(C(R,V),B),sortKey:`6${le}${L}${le}${K}${le}${Y}${le}${R}`})}for(let R of[...m].sort()){let k=b.get(R);if(k)for(let L of k){let[B,V]=L.split(le);for(let K of k){let[Y,_]=K.split(le);if(Y!==V)continue;let P=`${B}${le}${_}`;k.has(P)||c(B,V,_)&&T.push({kind:"role",role:R,A:B,B:_,from:v(C(R,L),C(R,K),h.get(R)),sortKey:`7${le}${R}${le}${B}${le}${_}${le}${V}`})}}}if(!T.length){E=!0;break}T.sort((R,k)=>R.sortKey<k.sortKey?-1:R.sortKey>k.sortKey?1:0);let O=!1;for(let R of T){if(j>=t)break;if(R.kind==="sub"){let k=g.get(R.A);if(!k||k.has(R.X))continue;k.add(R.X),$.set(`${R.A}${le}${R.X}`,R.from),j+=1,O=!0}else{b.has(R.role)||b.set(R.role,new Set);let k=b.get(R.role),L=`${R.A}${le}${R.B}`;if(k.has(L))continue;k.add(L),y.set(`${R.role}${le}${L}`,R.from),j+=1,O=!0}}if(j>=t)break;if(!O){E=!0;break}}let A=[...g.entries()].filter(([,w])=>w.has(ln)).map(([w])=>w).sort();return{subsumers:g,roleEdges:b,unsatisfiable:A,derivationOf:$,rounds:S,truncated:!E}}function uE(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${le}${a.filler}${le}${a.sub}`,u=`${c.role}${le}${c.filler}${le}${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,ao])].filter(u=>u!==ao&&u!==ln).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 dE(e,t){let n=H(e),s=H(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function O1(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=H(t),a=Qp(e,{budget:o}),{axiom:c,name:l}=dE(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},f=Ll(d,{budget:o,rounds:r});return(f.subsumers.get(i)||ra).has(l)?{proved:!0,premises:f.derivationOf.get(`${i}${le}${l}`)||[]}:{proved:!1,exhausted:f.truncated}}function pE(e,{budget:t=tm,rounds:n=nm,focus:s=null}={}){let o=Qp(e,{budget:t}),r=Ll(o,{budget:t,rounds:n,focus:s}),i=uE(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Ll(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 N1(e,t={}){let{finalPass:n,truncated:s}=pE(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${le}${ln}`)||[],truncated:s}}async function L1(e,{budget:t=tm,rounds:n=nm,focus:s=null,maxEnvironments:o=wr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=v1(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:f,goalInfo:p,finalPass:m,truncated:h}=pE(u,{budget:t,rounds:n,focus:s}),g=new Map;for(let A of u)g.set(`${A.subject}${le}${A.predicate}${le}${A.object}`,A.trust);let b=new Map(u.map(A=>[A.id,A])),$=A=>(A||[]).map(w=>b.get(w)?.trust).filter(w=>typeof w=="number"),y=new Set(u.filter(A=>lE(A.predicate)).map(A=>`${A.subject}${le}${A.object}`)),x=[],C=[],v=new Set,j=[...m.subsumers.keys()].sort();for(let A of j){let w=m.subsumers.get(A);if(w.has(ln))continue;let T=[...w].filter(O=>O!==A&&O!==ao&&O!==ln).sort();for(let O of T){let R=`${A}${le}${O}`;if(y.has(R))continue;let k=m.derivationOf.get(R)||[],L=p.get(O);if(L){v.has(O)||(v.add(O),x.push({subject:O,predicate:Pt,object:"owl:Restriction",provenance:ia,justification:[k]}),x.push({subject:O,predicate:xn,object:L.role,provenance:ia,justification:[k]}),x.push({subject:O,predicate:En,object:L.filler,provenance:ia,justification:[k]}));let B=$(k),V=x.length;x.push({subject:A,predicate:ze,object:O,provenance:ia,justification:[k],...B.length?{premiseTrusts:B,ruleConfidence:Jp}:{}}),C.push({toWriteIndex:V,subject:A,object:O,rule:em})}else if(d.concepts.has(O)){let B=$(k),V=x.length;x.push({subject:A,predicate:ze,object:O,provenance:fE,justification:[k],...B.length?{premiseTrusts:B,ruleConfidence:Jp}:{}}),C.push({toWriteIndex:V,subject:A,object:O,rule:Zp})}}}let{ids:E}=await c(e,x),S=C.map(A=>({id:E[A.toWriteIndex],subject:A.subject,object:A.object,rule:A.rule}));return{derived:S,count:S.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:f.length}}var le,ao,ln,ls,lE,E1,S1,j1,k1,R1,_1,T1,A1,C1,I1,ra,Zp,fE,em,ia,Jp,tm,nm,hE=M(()=>{ot();At();le="\u241F",ao="top",ln="bot";ls=e=>String(e||"").trim().toLowerCase(),lE=e=>ls(e)==="rdfs:subclassof",E1=e=>ls(e)==="rdf:type",S1=e=>ls(e)==="owl:disjointwith",j1=e=>ls(e)==="owl:onproperty",k1=e=>ls(e)==="owl:somevaluesfrom",R1=e=>ls(e)==="owl:allvaluesfrom",_1=e=>ls(e)==="owl:onclass",T1=e=>ls(e)==="owl:intersectionof",A1=e=>ls(e)==="rdfs:subpropertyof",C1=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),I1=e=>C1.has(ls(e));ra=new Set;Zp="elSubsumption",fE=`entailed:${Zp}`,em="elRestriction",ia=`entailed:${em}`,Jp=.95,tm=2e3,nm=64});var gE={};Ot(gE,{DEFAULT_REASONING_CONFIG:()=>Pl,resolveReasoningConfig:()=>z1});function F1(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function D1(e,t){return typeof e=="boolean"?e:t}function z1(e){let t=e?.reasoning||{},n={...Pl};for(let[s,o]of Object.entries(P1))t[s]!==void 0&&(n[o]=F1(t[s],Pl[o]));for(let[s,o]of Object.entries(M1))t[s]!==void 0&&(n[o]=D1(t[s],Pl[o]));return n}var Pl,P1,M1,bE=M(()=>{Pl=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),P1=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",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),M1=Object.freeze({ask_prove_fallback:"askProveFallback"})});function mm(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 ${Ml(e.entityType)}`;if(t==="list")return`list/enumerate ${Ml(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Ml(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 mm(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&&Tn[o]?Tn[o]:`filter/traverse ${Ml(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&&Tn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?Tn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function vm(e){let t=new Map;for(let n of e)t.has($E(n))||t.set($E(n),n);return t}function rm(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 im(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 K1(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function Y1(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Gx(),Wx)),s=n();return s?K1(t,s(t)):t}catch{return t}}function Em(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)||X1.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 Ul(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return Or;if(t==="can")return"mgx:capableOf";try{let n=await Y1(t);return n==="have"?Or:Yn(`mgx:${n}`)}catch{return Yn(`mgx:${t}`)}}function sP(e,t){let n=String(t||"").match(nP);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function aa(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(qn(),Tb)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function EE(e){return e.predicate===H1&&e.object==="transitiveproperty"||e.predicate===qE}function lP(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 Vl(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 jE(e){let t=Vl(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function ZE(e){if(Ps[e])return Ps[e];let t=String(e||""),n=Zb(t);if(n){let a=ZE(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",Vl(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:(${Sm})-([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?`${lP(i[1])}${i[2]?` ${i[2]}`:""}`:e}function um(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function dP(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of uP)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 ds(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${ds(e.provenance)})`:"";return e.predicate===qE?`${jE(e.subject)} implies ${jE(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Zt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Zt(e)}${t}`:e.provenance.includes("corpus:")?`${Zt(e)}${t}`:e.provenance.includes("reference:")?`${Zt(e)}${t}`:`i learned: ${Zt(e)}${t}`}function kE(e,t,n,{toward:s=null}={}){let o=oe(e);if(!us.has(e.predicate)||!n.has(e.subject))return o;let r=ul(e.object,t,{cap:6,stopAt:cl,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(fP);return a?o.slice(0,a.index)+i+a[0]:o+i}function RE(e,t,n,{indent:s=""}={}){let o=t.filter(C=>C.predicate===Go).map(C=>[C.subject,C.object]),r=Ji(o),i=e.map(C=>`${s}${kE(C,r,n)}`),a=e.filter(C=>us.has(C.predicate)&&n.has(C.subject)),c=[...new Set(a.map(C=>C.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(C=>C.predicate==="owl:disjointWith").map(C=>[C.subject,C.object]),{split:u,clusters:d}=dl(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let C of d)for(let v of C.objects)p.set(v,C);let m=e.filter(C=>!(us.has(C.predicate)&&n.has(C.subject))),h=[],g=[],b=0,$=C=>{let v=kE(C,r,n);return b<je?(b+=1,`${s}${v}`):(g.push(v),null)};for(let C of d){let v=a.filter(j=>p.get(j.object)===C).map($).filter(Boolean);v.length&&h.push(`${s}${f}, the ${C.label}:
173
173
  ${v.join(`
174
174
  `)}`)}if(m.length){let C=m.map($).filter(Boolean);C.length&&h.push(`${s}also about ${f}:
175
175
  ${C.join(`
176
176
  `)}`)}let y=g.length?`
177
177
  ${s}\u2026and ${g.length} more \u2014 say 'more' to see them.`:"",x={text:h.join(`
178
- `)+y,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:x}}async function mP(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Vx(),Gx)))}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("; ")})
178
+ `)+y,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:x}}async function mP(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Hx(),Vx)))}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
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}${c}`,pending:{items:s,noun:"facts"}}}function Vo(e){let t=qc().find(n=>n.kind==="article");return t&&Qf(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 ${Vo(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function hP(e,t){let n=s=>`${Zt(s)}${s.provenance?` (source: ${ds(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 ${Vo(e.object)} ${e.object}".`,replace:!0}}function Fl(e){let t=o=>`${Zt(o)}${o.provenance?` (source: ${ds(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function dm(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Ke(),Ls)),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 it(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(Ke(),Ls)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function gP(e){if(!Dl)try{Dl=gn().nounPlurals}catch{Dl=new Map}return Dl.get(e)??null}function Bl(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return _n(gn(),t)?.lemma||t}catch{return t}}function bP(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Bl(e);let n=Bl(Em(t[1]));return`${Vo(n)} ${n}`}function X(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(wP,"").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=gP(i);a&&s.add(e(a))}return s}function RE(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 nS(e,t=null){let n=Wl(e),s=n.match(yP);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(vP);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function gm(e){let t=String(e||"").replace(SP,"");if(t!==e){let s=t.match(co);if(s)return s}let n=String(e||"").match(jP);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(co):null}function RP(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>us.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=X(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=X(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function wm(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 TE(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function WP(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=>`${Zt(s)}${s.provenance?` (source: ${ds(s.provenance)})`:""}`).join("; ")}function CE(e,t,n,{maxHops:s=3}={}){let o=X(H,e),r=X(H,t),i=sc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?WP(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:
183
+ ${a}${c}`,pending:{items:s,noun:"facts"}}}function Vo(e){let t=qc().find(n=>n.kind==="article");return t&&Qf(String(e||""),t)?"an":"a"}function eS(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 ${Vo(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function hP(e,t){let n=s=>`${Zt(s)}${s.provenance?` (source: ${ds(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 ${Vo(e.object)} ${e.object}".`,replace:!0}}function Fl(e){let t=o=>`${Zt(o)}${o.provenance?` (source: ${ds(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function dm(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Ke(),Ls)),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 it(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(Ke(),Ls)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function gP(e){if(!Dl)try{Dl=gn().nounPlurals}catch{Dl=new Map}return Dl.get(e)??null}function Bl(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return _n(gn(),t)?.lemma||t}catch{return t}}function bP(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Bl(e);let n=Bl(Em(t[1]));return`${Vo(n)} ${n}`}function X(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(wP,"").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=gP(i);a&&s.add(e(a))}return s}function _E(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 sS(e,t=null){let n=Wl(e),s=n.match(yP);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(vP);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function gm(e){let t=String(e||"").replace(SP,"");if(t!==e){let s=t.match(co);if(s)return s}let n=String(e||"").match(jP);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(co):null}function RP(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>us.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=X(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=X(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function wm(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 AE(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function WP(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=>`${Zt(s)}${s.provenance?` (source: ${ds(s.provenance)})`:""}`).join("; ")}function IE(e,t,n,{maxHops:s=3}={}){let o=X(H,e),r=X(H,t),i=sc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?WP(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
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 IE(e,t,n,{maxHops:s=3}={}){let o=X(H,e),r=X(H,t),i=Cd(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,Ad).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}.
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 OE(e,t,n,{maxHops:s=3}={}){let o=X(H,e),r=X(H,t),i=Cd(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,Ad).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
187
  `)}`,replace:!0,miss:!0}}let l=Id(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,Ad),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
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 HP(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 bn(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 oS(e,t,n,s,o={},r=null,i=null){return rS(await oM(e,t,n,s,o,r,i),n,t)}function rS(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=mm(t?.parsed);if(!o&&e.generalVerbQuery&&(o=bE),!o){let r=s.match(hm),i=r?null:Wl(s).match(tS)||nS(s),a=r?r[2]:i?i[1]:null;a&&!bm.has(a.toLowerCase())&&(o=bE)}if(!o){let r=s.match(aS);r&&(o=mm({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function NE(e,t,n,s,o=null){let{ON_PROPERTY_PREDICATE:r,SOME_VALUES_FROM_PREDICATE:i}=await Promise.resolve().then(()=>(At(),rn)),a=await it(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 ZP(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(Xp(),Yp)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(mE(),pE)),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($=>u.get($)).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}function tM(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return eM.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function nM(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${Vo(n)} ${n}`).join(" or ")}function LE(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${nM(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function sM(e,t,n,s,o,r,i){if(!tM(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:f,moduleHasDlShape:p}=await Promise.resolve().then(()=>(Xp(),Yp)),{normFactTerm:m}=await Promise.resolve().then(()=>(Ke(),Ls)),h=UE(o,n,m(s)),g=UE(r,n,m(i)),b=n.filter(O=>O.predicate==="rdf:type"&&o.has(O.subject)).map(O=>O.object),$=a(n,[h,g,...b]);if(!p($))return null;let y=await cS(e);if(!y.askProveFallback)return null;let x=c($),C={maxSteps:y.askProveSteps,maxBranches:y.askProveBranches,maxNodes:y.askProveNodes},v=x.namedIndividuals.has(h),j=new Map($.map(O=>[O.id,O]));if(v){let O=f(x,[h],C)[0];if(O){let R=O.premises.map(k=>j.get(k)).filter(Boolean).map(oe).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${O.subject} is inconsistent: ${R||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let E=O=>O.premises.map(R=>j.get(R)).filter(Boolean).map(oe).join("; "),S=v?l(x,h,{t:"atom",name:g},C):u(x,h,g,C);if(S.status==="proved"){let O=E(S),R=LE(S,s,i);return{text:`yes \u2014 ${O}; ${R}`,replace:!0}}if(S.status==="exhausted")return{budgetExhausted:!0};let A=v?l(x,h,{t:"not",c:{t:"atom",name:g}},C):d(x,h,g,C);if(A.status==="exhausted")return{budgetExhausted:!0};if(A.status!=="proved")return null;let w=E(A),T=LE(A,s,i,{negate:!0});return{text:`no \u2014 ${w}; ${T}`,replace:!0}}async function oM(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(Ke(),Ls)))}catch{return null}let l=String(t).trim(),u=l.match(OP);if(u){let _=X(a,u[1]),P=(await it(e,r)).filter(W=>W.predicate==="mgx:usedFor"&&_.has(W.object));if(P.length){let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
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 HP(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 bn(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 rS(e,t,n,s,o={},r=null,i=null){return iS(await oM(e,t,n,s,o,r,i),n,t)}function iS(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=mm(t?.parsed);if(!o&&e.generalVerbQuery&&(o=wE),!o){let r=s.match(hm),i=r?null:Wl(s).match(nS)||sS(s),a=r?r[2]:i?i[1]:null;a&&!bm.has(a.toLowerCase())&&(o=wE)}if(!o){let r=s.match(cS);r&&(o=mm({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function LE(e,t,n,s,o=null){let{ON_PROPERTY_PREDICATE:r,SOME_VALUES_FROM_PREDICATE:i}=await Promise.resolve().then(()=>(At(),rn)),a=await it(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 ZP(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(Xp(),Yp)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(hE(),mE)),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($=>u.get($)).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}function tM(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return eM.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function nM(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${Vo(n)} ${n}`).join(" or ")}function PE(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${nM(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function sM(e,t,n,s,o,r,i){if(!tM(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:f,moduleHasDlShape:p}=await Promise.resolve().then(()=>(Xp(),Yp)),{normFactTerm:m}=await Promise.resolve().then(()=>(Ke(),Ls)),h=BE(o,n,m(s)),g=BE(r,n,m(i)),b=n.filter(O=>O.predicate==="rdf:type"&&o.has(O.subject)).map(O=>O.object),$=a(n,[h,g,...b]);if(!p($))return null;let y=await lS(e);if(!y.askProveFallback)return null;let x=c($),C={maxSteps:y.askProveSteps,maxBranches:y.askProveBranches,maxNodes:y.askProveNodes},v=x.namedIndividuals.has(h),j=new Map($.map(O=>[O.id,O]));if(v){let O=f(x,[h],C)[0];if(O){let R=O.premises.map(k=>j.get(k)).filter(Boolean).map(oe).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${O.subject} is inconsistent: ${R||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let E=O=>O.premises.map(R=>j.get(R)).filter(Boolean).map(oe).join("; "),S=v?l(x,h,{t:"atom",name:g},C):u(x,h,g,C);if(S.status==="proved"){let O=E(S),R=PE(S,s,i);return{text:`yes \u2014 ${O}; ${R}`,replace:!0}}if(S.status==="exhausted")return{budgetExhausted:!0};let A=v?l(x,h,{t:"not",c:{t:"atom",name:g}},C):d(x,h,g,C);if(A.status==="exhausted")return{budgetExhausted:!0};if(A.status!=="proved")return null;let w=E(A),T=PE(A,s,i,{negate:!0});return{text:`no \u2014 ${w}; ${T}`,replace:!0}}async function oM(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(Ke(),Ls)))}catch{return null}let l=String(t).trim(),u=l.match(OP);if(u){let _=X(a,u[1]),P=(await it(e,r)).filter(W=>W.predicate==="mgx:usedFor"&&_.has(W.object));if(P.length){let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
190
190
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
191
191
  `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}for(let{predicate:_,re:P}of KP){let W=l.match(P);if(!W)continue;let F=X(a,W[1]),z=(await it(e,r)).filter(re=>re.predicate===_&&F.has(re.object));if(!z.length)continue;let D=rt(bn(z),o).map(oe),U=D.slice(0,je),G=D.slice(je),Z=G.length?`
192
192
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:U.join(`
@@ -198,11 +198,11 @@ ${u.map(oe).join(`
198
198
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:U.join(`
199
199
  `)+Z,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}}let $=l.match(FP);if($){let _=$[3].toLowerCase(),P=X(a,$[2]),W=new Set([...X(a,$[1])].map(z=>c(`mgx:${_}-${z.replace(/\s+/g,"-")}`))),F=(await it(e,r)).filter(z=>W.has(c(z.predicate))&&P.has(a(z.subject)));if(F.length){let N=rt(bn(F),o).map(oe),D=N.slice(0,je),U=N.slice(je),G=U.length?`
200
200
  \u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:D.join(`
201
- `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}let y=n?.parsed?.shape==="meta"?n.parsed.object:null,x=n?.parsed&&n.parsed.node!=="miss";if(!y&&s&&!x&&!OE.test(l)){let _=l.match(aS)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);_&&(y=zs(_[1]))}if(!y&&s){let _=l.match(vM);_&&(y=zs(fn(_[1].trim())))}if(!y&&n?.ambiguous&&Array.isArray(n.candidateParses)){let _=n.candidateParses.find(P=>P?.shape==="meta"&&P.object);_&&(y=zs(String(_.object)))}if(y){let _=dP(y),{predicate:P}=_,W=_.subject.replace(/^(?:the|an?)\s+/i,"").trim()||_.subject,F=!1;if(P&&Ms.test(W)){if(!i){let Q=String(Ps[P]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${W.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${Q?` ${Q}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}W=i,F=!0}let z=X(a,W),N=await it(e,r);if(!N.some(Q=>z.has(Q.subject)||z.has(Q.object))){let Q=RP(W,N,a);Q&&(W=Q,z=X(a,W))}let D=(await it(e,r)).filter(Q=>z.has(Q.subject)&&!vE.has(Q.predicate)&&!xE(Q)&&!EE.has(Q.predicate)),U=P?D.filter(Q=>c(Q.predicate)===P):D;if(!P&&U.length&&!U.some(fm)&&(U=[]),!U.length){if(P&&(D.length||F))return{text:`I don't have any "${Ps[P]}" facts about ${W}.`,replace:s,...D.length?{}:{miss:!0}};if(!P){let Q=rt((await it(e,r)).filter(ce=>z.has(ce.object)),o);if(Q.length&&!Q.some(fm)&&(Q=[]),Q.length){let ce=Q.map(oe),ke=ce.slice(0,je),Re=ce.slice(je),de=Re.length?`
201
+ `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}let y=n?.parsed?.shape==="meta"?n.parsed.object:null,x=n?.parsed&&n.parsed.node!=="miss";if(!y&&s&&!x&&!NE.test(l)){let _=l.match(cS)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);_&&(y=zs(_[1]))}if(!y&&s){let _=l.match(vM);_&&(y=zs(fn(_[1].trim())))}if(!y&&n?.ambiguous&&Array.isArray(n.candidateParses)){let _=n.candidateParses.find(P=>P?.shape==="meta"&&P.object);_&&(y=zs(String(_.object)))}if(y){let _=dP(y),{predicate:P}=_,W=_.subject.replace(/^(?:the|an?)\s+/i,"").trim()||_.subject,F=!1;if(P&&Ms.test(W)){if(!i){let Q=String(Ps[P]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${W.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${Q?` ${Q}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}W=i,F=!0}let z=X(a,W),N=await it(e,r);if(!N.some(Q=>z.has(Q.subject)||z.has(Q.object))){let Q=RP(W,N,a);Q&&(W=Q,z=X(a,W))}let D=(await it(e,r)).filter(Q=>z.has(Q.subject)&&!xE.has(Q.predicate)&&!EE(Q)&&!SE.has(Q.predicate)),U=P?D.filter(Q=>c(Q.predicate)===P):D;if(!P&&U.length&&!U.some(fm)&&(U=[]),!U.length){if(P&&(D.length||F))return{text:`I don't have any "${Ps[P]}" facts about ${W}.`,replace:s,...D.length?{}:{miss:!0}};if(!P){let Q=rt((await it(e,r)).filter(ce=>z.has(ce.object)),o);if(Q.length&&!Q.some(fm)&&(Q=[]),Q.length){let ce=Q.map(oe),ke=ce.slice(0,je),Re=ce.slice(je),de=Re.length?`
202
202
  \u2026and ${Re.length} more \u2014 say 'more' to see them.`:"";return{text:ke.join(`
203
- `)+de,replace:s,...Re.length?{pending:{items:Re,noun:"facts"}}:{}}}}return null}U=rt(U,o);let G=await it(e,r),{lines:Z,grouped:re}=kE(U,G,z),ie=!P&&Z.length>pP?await mP(W,U,G,Z):null;if(ie)return{...ie,replace:s};if(re)return{...re,replace:s};let J=Z.slice(0,je),ee=Z.slice(je),te=ee.length?`
203
+ `)+de,replace:s,...Re.length?{pending:{items:Re,noun:"facts"}}:{}}}}return null}U=rt(U,o);let G=await it(e,r),{lines:Z,grouped:re}=RE(U,G,z),ie=!P&&Z.length>pP?await mP(W,U,G,Z):null;if(ie)return{...ie,replace:s};if(re)return{...re,replace:s};let J=Z.slice(0,je),ee=Z.slice(je),te=ee.length?`
204
204
  \u2026and ${ee.length} more \u2014 say 'more' to see them.`:"";return{text:J.join(`
205
- `)+te,replace:s,...ee.length?{pending:{items:ee,noun:"facts"}}:{}}}if(!s)return null;let C=l.match(V1);if(C){let P=`mgx:${C[2].toLowerCase().replace(/\s+/g,"-")}-than`,W=await dm(e),F=ie=>{let J=ie.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ms.test(J)?i:J},z=F(C[1]),N=F(C[3]),D=X(a,z),U=X(a,N),G=W.find(ie=>ie.predicate===P&&D.has(ie.subject)&&U.has(ie.object));if(G){let ie=W.find(ee=>ee.predicate===P&&D.has(ee.object)&&U.has(ee.subject)),J=ie?` \u2014 though you also told me the opposite: ${oe(ie)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(G)}${J}`,replace:!0}}let Z=W.filter(ie=>ie.predicate===P&&(D.has(ie.subject)||D.has(ie.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: "${z} is ${C[2].toLowerCase()} than ${N}".`,replace:!0,miss:!0}}for(let{predicate:_,phrase:P,re:W}of JP){let F=l.match(W);if(!F)continue;let z=await dm(e),N=X(a,F[1]),D=X(a,F[2]),U=z.find(J=>J.predicate===_&&N.has(J.subject)&&D.has(J.object));if(U)return{text:`yes \u2014 ${oe(U)}`,replace:!0};let[G]=P.split(" "),Z=await Ul(Vl(G));if(Z!==_){let J=Z.replace(/^mgx:/,"mgxneg:");if(z.some(ee=>(ee.predicate===Z||ee.predicate===J)&&N.has(ee.subject)))continue}let re=XP.has(_)?` If it's true, teach me: "${F[1]} ${P} ${F[2]}".`:"",ie=z.filter(J=>J.predicate===_&&N.has(J.subject));if(ie.length){let J=ie.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${F[1]} ${P} ${F[2]}. I do know: ${J}.${re}`,replace:!0,miss:!0}}if(!n?.parsed&&z.some(J=>N.has(J.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${F[1]} ${P} ${F[2]}.${re}`,replace:!0,miss:!0};break}let v=l.match(co)||gm(l);if(v){let _=X(a,v[1]),P=X(a,v[2]),W=await it(e,r),F=U=>_.has(U.subject)&&P.has(U.object),{DISJOINT_PREDICATE:z}=await Promise.resolve().then(()=>(At(),rn)),N=U=>_.has(U.subject)||_.has(U.object)||P.has(U.subject)||P.has(U.object);return W.some(U=>U.predicate===z&&Wo(U)&&N(U))?null:ZE(W.find(U=>us.has(U.predicate)&&F(U)),W.find(U=>U.predicate===tc&&F(U)))}let j=wm(l),E=j.match(_P);if(E){let _=await it(e,r),P=E[1],W=CE(E[2],E[3],_);if(W&&j!==AE(l)&&(W=TE(W)),W&&P)return{text:`I can't speak for ${P.trim()} ${E[2]} \u2014 what I remember is generic, not universal. ${W.text}.`,replace:!0};if(W)return W;let F=X(a,E[2]),z=_.filter(N=>N.predicate==="mgx:capableOf"&&F.has(N.subject));if(z.length){let N=z.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${E[2]} can ${E[3]}. I do know: ${N}. If it's true, teach me: "a ${z[0].subject} can ${E[3]}".`,replace:!0,miss:!0}}return IE(E[2],E[3],_)}let S=l.match(TP);if(S){let _=X(a,S[1]),P=X(a,S[2]),W=new Set(["mgx:hasA","tmct:has"]),F=await dm(e),z=G=>F.find(Z=>W.has(Z.predicate)&&G.has(Z.subject)&&P.has(Z.object)),N=z(_);if(N)return{text:`yes \u2014 ${oe(N)}`,replace:!0};let D=[{terms:_,chain:[]}],U=new Set;for(let G=0;G<4;G+=1){let Z=[];for(let{terms:re,chain:ie}of D){let J=F.filter(ee=>us.has(ee.predicate)&&re.has(ee.subject)&&!U.has(ee.object));for(let ee of J){if(U.has(ee.object))continue;U.add(ee.object);let te=[...ie,ee],Q=z(X(a,ee.object));if(Q)return{text:`yes \u2014 ${[...te.map(oe),oe(Q)].join("; ")}`,replace:!0};Z.push({terms:X(a,ee.object),chain:te})}}if(!Z.length)break;D=Z}return NE(e,r,_,P,S[1].trim())}let A=l.match(AP);if(A){let _=X(a,A[1]),P=X(a,A[3]),W=await NE(e,r,_,P,A[1].trim());if(W)return W}let w=wm(l),T=w.match(DP);if(T){let _=await it(e,r),P=!!T[1],W=X(a,T[2]),F=X(a,T[3]),z=CE(T[2],T[3],_);if(z&&w!==AE(l)&&(z=TE(z)),z&&P)return{text:`I can't speak for ${T[1].trim()} ${T[2]} \u2014 what I remember is generic, not universal. ${z.text}.`,replace:!0};if(z)return z;if(s){let N=_.filter(U=>U.predicate==="mgx:capableOf"&&W.has(U.subject));if(N.length){let U=N.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${T[2]} can ${T[3]}. I do know: ${U}. If it's true, teach me: "a ${N[0].subject} can ${T[3]}".`,replace:!0,miss:!0}}let D=IE(T[2],T[3],_);if(D)return D;if(!/\s/.test(T[2].trim())&&!_.some(U=>W.has(U.subject)||W.has(U.object))){let U=Em(Bl(T[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${T[2]}" yet. Teach me "a ${U} can ${T[3]}" (or "a ${U} cannot ${T[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let O=l.match(CP);if(O){let _=X(a,O[1]),P=(await it(e,r)).filter(U=>(U.predicate==="mgx:capableOf"||U.predicate===$r)&&_.has(U.subject));if(!P.length)return null;let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
205
+ `)+te,replace:s,...ee.length?{pending:{items:ee,noun:"facts"}}:{}}}if(!s)return null;let C=l.match(V1);if(C){let P=`mgx:${C[2].toLowerCase().replace(/\s+/g,"-")}-than`,W=await dm(e),F=ie=>{let J=ie.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ms.test(J)?i:J},z=F(C[1]),N=F(C[3]),D=X(a,z),U=X(a,N),G=W.find(ie=>ie.predicate===P&&D.has(ie.subject)&&U.has(ie.object));if(G){let ie=W.find(ee=>ee.predicate===P&&D.has(ee.object)&&U.has(ee.subject)),J=ie?` \u2014 though you also told me the opposite: ${oe(ie)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(G)}${J}`,replace:!0}}let Z=W.filter(ie=>ie.predicate===P&&(D.has(ie.subject)||D.has(ie.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: "${z} is ${C[2].toLowerCase()} than ${N}".`,replace:!0,miss:!0}}for(let{predicate:_,phrase:P,re:W}of JP){let F=l.match(W);if(!F)continue;let z=await dm(e),N=X(a,F[1]),D=X(a,F[2]),U=z.find(J=>J.predicate===_&&N.has(J.subject)&&D.has(J.object));if(U)return{text:`yes \u2014 ${oe(U)}`,replace:!0};let[G]=P.split(" "),Z=await Ul(Vl(G));if(Z!==_){let J=Z.replace(/^mgx:/,"mgxneg:");if(z.some(ee=>(ee.predicate===Z||ee.predicate===J)&&N.has(ee.subject)))continue}let re=XP.has(_)?` If it's true, teach me: "${F[1]} ${P} ${F[2]}".`:"",ie=z.filter(J=>J.predicate===_&&N.has(J.subject));if(ie.length){let J=ie.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${F[1]} ${P} ${F[2]}. I do know: ${J}.${re}`,replace:!0,miss:!0}}if(!n?.parsed&&z.some(J=>N.has(J.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${F[1]} ${P} ${F[2]}.${re}`,replace:!0,miss:!0};break}let v=l.match(co)||gm(l);if(v){let _=X(a,v[1]),P=X(a,v[2]),W=await it(e,r),F=U=>_.has(U.subject)&&P.has(U.object),{DISJOINT_PREDICATE:z}=await Promise.resolve().then(()=>(At(),rn)),N=U=>_.has(U.subject)||_.has(U.object)||P.has(U.subject)||P.has(U.object);return W.some(U=>U.predicate===z&&Wo(U)&&N(U))?null:eS(W.find(U=>us.has(U.predicate)&&F(U)),W.find(U=>U.predicate===tc&&F(U)))}let j=wm(l),E=j.match(_P);if(E){let _=await it(e,r),P=E[1],W=IE(E[2],E[3],_);if(W&&j!==CE(l)&&(W=AE(W)),W&&P)return{text:`I can't speak for ${P.trim()} ${E[2]} \u2014 what I remember is generic, not universal. ${W.text}.`,replace:!0};if(W)return W;let F=X(a,E[2]),z=_.filter(N=>N.predicate==="mgx:capableOf"&&F.has(N.subject));if(z.length){let N=z.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${E[2]} can ${E[3]}. I do know: ${N}. If it's true, teach me: "a ${z[0].subject} can ${E[3]}".`,replace:!0,miss:!0}}return OE(E[2],E[3],_)}let S=l.match(TP);if(S){let _=X(a,S[1]),P=X(a,S[2]),W=new Set(["mgx:hasA","tmct:has"]),F=await dm(e),z=G=>F.find(Z=>W.has(Z.predicate)&&G.has(Z.subject)&&P.has(Z.object)),N=z(_);if(N)return{text:`yes \u2014 ${oe(N)}`,replace:!0};let D=[{terms:_,chain:[]}],U=new Set;for(let G=0;G<4;G+=1){let Z=[];for(let{terms:re,chain:ie}of D){let J=F.filter(ee=>us.has(ee.predicate)&&re.has(ee.subject)&&!U.has(ee.object));for(let ee of J){if(U.has(ee.object))continue;U.add(ee.object);let te=[...ie,ee],Q=z(X(a,ee.object));if(Q)return{text:`yes \u2014 ${[...te.map(oe),oe(Q)].join("; ")}`,replace:!0};Z.push({terms:X(a,ee.object),chain:te})}}if(!Z.length)break;D=Z}return LE(e,r,_,P,S[1].trim())}let A=l.match(AP);if(A){let _=X(a,A[1]),P=X(a,A[3]),W=await LE(e,r,_,P,A[1].trim());if(W)return W}let w=wm(l),T=w.match(DP);if(T){let _=await it(e,r),P=!!T[1],W=X(a,T[2]),F=X(a,T[3]),z=IE(T[2],T[3],_);if(z&&w!==CE(l)&&(z=AE(z)),z&&P)return{text:`I can't speak for ${T[1].trim()} ${T[2]} \u2014 what I remember is generic, not universal. ${z.text}.`,replace:!0};if(z)return z;if(s){let N=_.filter(U=>U.predicate==="mgx:capableOf"&&W.has(U.subject));if(N.length){let U=N.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${T[2]} can ${T[3]}. I do know: ${U}. If it's true, teach me: "a ${N[0].subject} can ${T[3]}".`,replace:!0,miss:!0}}let D=OE(T[2],T[3],_);if(D)return D;if(!/\s/.test(T[2].trim())&&!_.some(U=>W.has(U.subject)||W.has(U.object))){let U=Em(Bl(T[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${T[2]}" yet. Teach me "a ${U} can ${T[3]}" (or "a ${U} cannot ${T[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let O=l.match(CP);if(O){let _=X(a,O[1]),P=(await it(e,r)).filter(U=>(U.predicate==="mgx:capableOf"||U.predicate===$r)&&_.has(U.subject));if(!P.length)return null;let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
206
206
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
207
207
  `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}let R=l.match(BP);if(R){let _=X(a,R[1]),P=X(a,R[2]),W=await it(e,r),F=bn(W.filter(z=>z.predicate==="mgx:capableOf"&&P.has(z.object))).filter(z=>sc(new Set([z.subject]),P,W).verdict==="yes");if(F.length){let{findIsaChain:z,buildSubClassSuccessors:N,SUBCLASS_PREDICATE:D,TYPE_PREDICATE:U}=await Promise.resolve().then(()=>(At(),rn)),G=W.filter(ae=>ae.predicate===D),Z=W.filter(ae=>ae.predicate===U),re=G.map(ae=>[ae.subject,ae.object]),ie=Z.map(ae=>[ae.subject,ae.object]),J=N(re),ee=ae=>(ae.predicate===D?G:Z).find(Oe=>Oe.subject===ae.subject&&Oe.object===ae.object),te=new Map,Q=F.filter(ae=>_.has(ae.subject)?!0:(te.has(ae.subject)||te.set(ae.subject,z(ae.subject,_,ie,J,{maxHops:3})),!!te.get(ae.subject))),ke=rt(Q.length?Q:F,o).map(ae=>{let Oe=Q.length?te.get(ae.subject):null;if(!Oe||Oe.length<2)return oe(ae);let ue=Oe.map(ee);if(!ue.every(Boolean))return oe(ae);let Ee=ue.map(me=>`${Zt(me)}${me.provenance?` (source: ${ds(me.provenance)})`:""}`).join("; ");return`${oe(ae)} \u2014 via: ${Ee}`}),Re=ke.slice(0,je),de=ke.slice(je),Ge=de.length?`
208
208
  \u2026and ${de.length} more \u2014 say 'more' to see them.`:"";return{text:(Q.length?"":`nothing I remember ties these to "${R[1]}", but:
@@ -213,19 +213,19 @@ ${u.map(oe).join(`
213
213
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
214
214
  `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}let B=l.match(IP);if(B&&!QP.has(B[1].trim().split(/\s+/)[0]?.toLowerCase())){let _=X(a,B[1]),P=(await it(e,r)).filter(U=>U.predicate==="mgx:hasA"&&_.has(U.object));if(!P.length)return null;let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
215
215
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
216
- `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}let V=l.match(OE),K=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:V?.[1];if(K){let _=X(a,K),P=(await it(e,r)).filter(U=>us.has(U.predicate)&&_.has(U.object));if(!P.length)return null;let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
216
+ `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}let V=l.match(NE),K=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:V?.[1];if(K){let _=X(a,K),P=(await it(e,r)).filter(U=>us.has(U.predicate)&&_.has(U.object));if(!P.length)return null;let F=rt(bn(P),o).map(oe),z=F.slice(0,je),N=F.slice(je),D=N.length?`
217
217
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
218
- `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}let Y=l.match(kP);if(Y){let _=X(a,Y[1]),P=await it(e,r),W=se=>!String(se.provenance||"").includes("corpus:")&&!String(se.provenance||"").includes("web:"),F=P.filter(se=>us.has(se.predicate)&&W(se)),z=new Set,N=_;for(let se=0;se<8&&N.size;se+=1){let Ne=new Set;for(let Be of F)N.has(Be.object)&&!z.has(Be.subject)&&Ne.add(Be.subject);if(!Ne.size)break;for(let Be of Ne)z.add(Be);let Je=new Set;for(let Be of Ne)for(let gt of X(a,Be))Je.add(gt);N=Je}let D=P.filter(se=>_.has(se.subject)||_.has(se.object)||z.has(se.subject));if(!D.length){let se=a(Y[1]).split(/\s+/).filter(Ne=>Ne.length>=4&&!eS.has(Ne));if(se.length){let Ne=Be=>new Set(String(Be||"").split(/\s+/)),Je=Be=>{let gt=Ne(Be);return se.some(Ct=>gt.has(Ct))};D=P.filter(Be=>Je(Be.subject)||Je(Be.object))}}D=D.filter(se=>!vE.has(se.predicate)&&!xE(se)&&!EE.has(se.predicate));let U=D.length>0&&!D.some(fm);if(!D.length)return null;let{findConsistencyViolations:G,TYPE_PREDICATE:Z,SUBCLASS_PREDICATE:re,DISJOINT_PREDICATE:ie}=await Promise.resolve().then(()=>(At(),rn)),J=se=>!se.provenance?.includes("corpus:")&&!se.provenance?.includes("web:"),ee=P.filter(se=>se.predicate===Z&&J(se)).map(se=>[se.subject,se.object]),te=P.filter(se=>se.predicate===re&&J(se)).map(se=>[se.subject,se.object]),Q=P.filter(se=>se.predicate===ie&&J(se)).map(se=>[se.subject,se.object]);if(Q.length){let Ne=G(ee,te,Q,{focus:_,budget:5}).find(Je=>_.has(Je.subject));if(Ne)return{text:`I can't answer that \u2014 what I've been told about ${Ne.subject} is inconsistent: it's taught to be both ${Ne.classA} and ${Ne.classB}, but ${Ne.viaA} and ${Ne.viaB} are disjoint (${Ne.viaA} owl:disjointWith ${Ne.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let ce=await cS(e),ke=await ZP(P,_,ce);if(ke)return{text:ke,replace:!0};let Re=D.find(se=>_.has(se.subject)||_.has(se.object)),de=Re?_.has(Re.subject)?Re.subject:Re.object:Y[1].trim(),Ge=D.some(se=>z.has(se.subject)&&!_.has(se.subject)&&!_.has(se.object));D=rt(D,o);let Ve=`${D.length} remembered fact${D.length===1?"":"s"} about ${de}${Ge?" (including its known subtypes)":""}:`,{lines:ae,grouped:Oe}=kE(D,P,_,{indent:" "});if(Oe)return{...Oe,text:`${Ve}
218
+ `)+D,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}let Y=l.match(kP);if(Y){let _=X(a,Y[1]),P=await it(e,r),W=se=>!String(se.provenance||"").includes("corpus:")&&!String(se.provenance||"").includes("web:"),F=P.filter(se=>us.has(se.predicate)&&W(se)),z=new Set,N=_;for(let se=0;se<8&&N.size;se+=1){let Ne=new Set;for(let Be of F)N.has(Be.object)&&!z.has(Be.subject)&&Ne.add(Be.subject);if(!Ne.size)break;for(let Be of Ne)z.add(Be);let Je=new Set;for(let Be of Ne)for(let gt of X(a,Be))Je.add(gt);N=Je}let D=P.filter(se=>_.has(se.subject)||_.has(se.object)||z.has(se.subject));if(!D.length){let se=a(Y[1]).split(/\s+/).filter(Ne=>Ne.length>=4&&!tS.has(Ne));if(se.length){let Ne=Be=>new Set(String(Be||"").split(/\s+/)),Je=Be=>{let gt=Ne(Be);return se.some(Ct=>gt.has(Ct))};D=P.filter(Be=>Je(Be.subject)||Je(Be.object))}}D=D.filter(se=>!xE.has(se.predicate)&&!EE(se)&&!SE.has(se.predicate));let U=D.length>0&&!D.some(fm);if(!D.length)return null;let{findConsistencyViolations:G,TYPE_PREDICATE:Z,SUBCLASS_PREDICATE:re,DISJOINT_PREDICATE:ie}=await Promise.resolve().then(()=>(At(),rn)),J=se=>!se.provenance?.includes("corpus:")&&!se.provenance?.includes("web:"),ee=P.filter(se=>se.predicate===Z&&J(se)).map(se=>[se.subject,se.object]),te=P.filter(se=>se.predicate===re&&J(se)).map(se=>[se.subject,se.object]),Q=P.filter(se=>se.predicate===ie&&J(se)).map(se=>[se.subject,se.object]);if(Q.length){let Ne=G(ee,te,Q,{focus:_,budget:5}).find(Je=>_.has(Je.subject));if(Ne)return{text:`I can't answer that \u2014 what I've been told about ${Ne.subject} is inconsistent: it's taught to be both ${Ne.classA} and ${Ne.classB}, but ${Ne.viaA} and ${Ne.viaB} are disjoint (${Ne.viaA} owl:disjointWith ${Ne.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let ce=await lS(e),ke=await ZP(P,_,ce);if(ke)return{text:ke,replace:!0};let Re=D.find(se=>_.has(se.subject)||_.has(se.object)),de=Re?_.has(Re.subject)?Re.subject:Re.object:Y[1].trim(),Ge=D.some(se=>z.has(se.subject)&&!_.has(se.subject)&&!_.has(se.object));D=rt(D,o);let Ve=`${D.length} remembered fact${D.length===1?"":"s"} about ${de}${Ge?" (including its known subtypes)":""}:`,{lines:ae,grouped:Oe}=RE(D,P,_,{indent:" "});if(Oe)return{...Oe,text:`${Ve}
219
219
  ${Oe.text}`,...U?{weakOnly:!0}:{}};let ue=ae.slice(0,je),Ee=ae.slice(je),me=Ee.length?`
220
220
  \u2026and ${Ee.length} more \u2014 say 'more' to see them.`:"";return{text:`${Ve}
221
221
  ${ue.join(`
222
- `)}${me}`,replace:!0,...Ee.length?{pending:{items:Ee.map(se=>se.trim()),noun:"facts"}}:{},...U?{weakOnly:!0}:{}}}return null}async function gM(e,t){let n=await aa(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(()=>(Up(),Dx)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function zl(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<wM;r+=1){let i=null;for(let a of e.relations||[])if(bM.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 iS(e,t,n,s,o=null,r=null,i={},a=null){return rS(await yM(e,t,n,s,o,r,i,a),n,t)}async function yM(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(Ke(),Ls)))}catch{return null}let l=String(t).trim();if(o){let F=l.match(co);if(F){let z=await aa(o,F[1]);if(z){let N=X(c,fn(F[2])),D=zl(o,z.id).find(G=>[...X(c,G.label)].some(Z=>N.has(Z)));if(D)return{text:`yes \u2014 the code graph says ${z.label} inherits ${D.label}.`,replace:!0};let U=await aa(o,fn(F[2]));if(U&&zl(o,U.id).some(G=>G.id===z.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${U.label} inherits ${z.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 it(e,a);if(!d.length){if(!co.test(u)&&!hm.test(u)){let z=u.match(ME);if(z){let N=z[1].trim(),D=Ms.test(N)?r||null:N;if(D&&!/^there\b/i.test(D)&&!n?.parsed&&!DE.test(N)&&!FE.test(N)&&!$E.test(z[2].trim()))return zE(D,z[2].trim().toLowerCase())}}let F=u.match(co)||gm(l);if(!(F&&!/^there\b/i.test(F[1].trim())||_E.test(l)))return null}let f=d.filter(F=>us.has(F.predicate)),p=(F,z)=>z.trust-F.trust,m=F=>{let z=F.map(oe),N=z.slice(0,je),D=z.slice(je),U=D.length?`
222
+ `)}${me}`,replace:!0,...Ee.length?{pending:{items:Ee.map(se=>se.trim()),noun:"facts"}}:{},...U?{weakOnly:!0}:{}}}return null}async function gM(e,t){let n=await aa(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(()=>(Up(),zx)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function zl(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<wM;r+=1){let i=null;for(let a of e.relations||[])if(bM.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 aS(e,t,n,s,o=null,r=null,i={},a=null){return iS(await yM(e,t,n,s,o,r,i,a),n,t)}async function yM(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(Ke(),Ls)))}catch{return null}let l=String(t).trim();if(o){let F=l.match(co);if(F){let z=await aa(o,F[1]);if(z){let N=X(c,fn(F[2])),D=zl(o,z.id).find(G=>[...X(c,G.label)].some(Z=>N.has(Z)));if(D)return{text:`yes \u2014 the code graph says ${z.label} inherits ${D.label}.`,replace:!0};let U=await aa(o,fn(F[2]));if(U&&zl(o,U.id).some(G=>G.id===z.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${U.label} inherits ${z.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 it(e,a);if(!d.length){if(!co.test(u)&&!hm.test(u)){let z=u.match(FE);if(z){let N=z[1].trim(),D=Ms.test(N)?r||null:N;if(D&&!/^there\b/i.test(D)&&!n?.parsed&&!zE.test(N)&&!DE.test(N)&&!vE.test(z[2].trim()))return UE(D,z[2].trim().toLowerCase())}}let F=u.match(co)||gm(l);if(!(F&&!/^there\b/i.test(F[1].trim())||TE.test(l)))return null}let f=d.filter(F=>us.has(F.predicate)),p=(F,z)=>z.trust-F.trust,m=F=>{let z=F.map(oe),N=z.slice(0,je),D=z.slice(je),U=D.length?`
223
223
  \u2026and ${D.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
224
- `)+U,replace:!0,...D.length?{pending:{items:D,noun:"facts"}}:{}}};if(hM.test(l)){let F=rt(f.length?f:d,i);return F.length?m(F):null}let h=u.match(hm);if(h){let F=h[1].trim(),z=Ms.test(F)?r||null:F,N=h[2].trim().toLowerCase(),D=h[3].trim();if(z&&!bm.has(N)){let U=rm(d),{findIsaChain:G}=await Promise.resolve().then(()=>(At(),rn)),Z=Re=>{let de=String(Re||"").trim().toLowerCase(),Ge=[];for(let Ve of d){let ae=um(Ve.predicate);if(!ae)continue;if(ae===de){Ge.push({fact:Ve,aliasFacts:[]});continue}let Oe=im(G,ae,new Set([de]),U,{maxHops:2});if(!Oe)continue;let ue=Oe.map(Ee=>d.find(me=>me.predicate===Go&&me.subject===Ee.subject&&me.object===Ee.object));ue.every(Boolean)&&Ge.push({fact:Ve,aliasFacts:ue})}return Ge},{loadMemory:re,findRuleByName:ie,resolveRelationChase:J}=await Promise.resolve().then(()=>(Ke(),Ls)),{findActionPath:ee}=await Promise.resolve().then(()=>(bs(),xa)),te=await re(e),ce=await J(te,N,z,D,{relationFactsFor:Z,renderFactLine:oe,factPhrase:Zt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:om,findActionPath:ee});return ce?{text:`yes \u2014 ${ce.citation.join("; ")}`,replace:!0}:Z(N).length>0||!!ie(te,N)?{text:`I know the '${N}' relation, but I can't confirm ${z} is the ${N} of ${D} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}let g=Wl(u).match(tS)||nS(u,F=>{let z=X(c,F);return d.some(N=>z.has(N.subject)||z.has(N.object))});if(g){let F=g[1].trim().toLowerCase(),z=g[2].trim(),N=Ms.test(z)?r||null:z;if(N&&!bm.has(F)){let D=rm(d),{findIsaChain:U}=await Promise.resolve().then(()=>(At(),rn)),G=Re=>{let de=String(Re||"").trim().toLowerCase(),Ge=[];for(let Ve of d){let ae=um(Ve.predicate);if(!ae)continue;if(ae===de){Ge.push({fact:Ve,aliasFacts:[]});continue}let Oe=im(U,ae,new Set([de]),D,{maxHops:2});if(!Oe)continue;let ue=Oe.map(Ee=>d.find(me=>me.predicate===Go&&me.subject===Ee.subject&&me.object===Ee.object));ue.every(Boolean)&&Ge.push({fact:Ve,aliasFacts:ue})}return Ge},{loadMemory:Z,findRuleByName:re,resolveRelationChaseReverse:ie}=await Promise.resolve().then(()=>(Ke(),Ls)),J=await Z(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(bs(),xa)),Q=await ie(J,F,N,{relationFactsFor:G,renderFactLine:oe,factPhrase:Zt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:om,findReachableSet:ee});return Q.length?{text:Q.map(de=>`${de.subject} \u2014 ${de.citation.join("; ")}`).join(`
224
+ `)+U,replace:!0,...D.length?{pending:{items:D,noun:"facts"}}:{}}};if(hM.test(l)){let F=rt(f.length?f:d,i);return F.length?m(F):null}let h=u.match(hm);if(h){let F=h[1].trim(),z=Ms.test(F)?r||null:F,N=h[2].trim().toLowerCase(),D=h[3].trim();if(z&&!bm.has(N)){let U=rm(d),{findIsaChain:G}=await Promise.resolve().then(()=>(At(),rn)),Z=Re=>{let de=String(Re||"").trim().toLowerCase(),Ge=[];for(let Ve of d){let ae=um(Ve.predicate);if(!ae)continue;if(ae===de){Ge.push({fact:Ve,aliasFacts:[]});continue}let Oe=im(G,ae,new Set([de]),U,{maxHops:2});if(!Oe)continue;let ue=Oe.map(Ee=>d.find(me=>me.predicate===Go&&me.subject===Ee.subject&&me.object===Ee.object));ue.every(Boolean)&&Ge.push({fact:Ve,aliasFacts:ue})}return Ge},{loadMemory:re,findRuleByName:ie,resolveRelationChase:J}=await Promise.resolve().then(()=>(Ke(),Ls)),{findActionPath:ee}=await Promise.resolve().then(()=>(bs(),xa)),te=await re(e),ce=await J(te,N,z,D,{relationFactsFor:Z,renderFactLine:oe,factPhrase:Zt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:om,findActionPath:ee});return ce?{text:`yes \u2014 ${ce.citation.join("; ")}`,replace:!0}:Z(N).length>0||!!ie(te,N)?{text:`I know the '${N}' relation, but I can't confirm ${z} is the ${N} of ${D} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}let g=Wl(u).match(nS)||sS(u,F=>{let z=X(c,F);return d.some(N=>z.has(N.subject)||z.has(N.object))});if(g){let F=g[1].trim().toLowerCase(),z=g[2].trim(),N=Ms.test(z)?r||null:z;if(N&&!bm.has(F)){let D=rm(d),{findIsaChain:U}=await Promise.resolve().then(()=>(At(),rn)),G=Re=>{let de=String(Re||"").trim().toLowerCase(),Ge=[];for(let Ve of d){let ae=um(Ve.predicate);if(!ae)continue;if(ae===de){Ge.push({fact:Ve,aliasFacts:[]});continue}let Oe=im(U,ae,new Set([de]),D,{maxHops:2});if(!Oe)continue;let ue=Oe.map(Ee=>d.find(me=>me.predicate===Go&&me.subject===Ee.subject&&me.object===Ee.object));ue.every(Boolean)&&Ge.push({fact:Ve,aliasFacts:ue})}return Ge},{loadMemory:Z,findRuleByName:re,resolveRelationChaseReverse:ie}=await Promise.resolve().then(()=>(Ke(),Ls)),J=await Z(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(bs(),xa)),Q=await ie(J,F,N,{relationFactsFor:G,renderFactLine:oe,factPhrase:Zt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:om,findReachableSet:ee});return Q.length?{text:Q.map(de=>`${de.subject} \u2014 ${de.citation.join("; ")}`).join(`
225
225
  `),replace:!0}:G(F).length>0||!!re(J,F)?{text:/^what\b/i.test(Wl(u))?`I don't know what the ${F} of ${N} is from what you've told me.`:`I don't know anyone who is the ${F} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${F}' yet.`,replace:!0}}}{let F=u.match($M);if(F){let z=X(c,F[1]),N=rt(d.filter(D=>z.has(D.subject)||z.has(D.object)),i);if(N.length){let D=N.map(oe),U=D.slice(0,je),G=D.slice(je),Z=G.length?`
226
226
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:U.join(`
227
227
  `)+Z,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}}let b=u.match(xP);if(b){let F=Em(b[1].trim().toLowerCase()),z=b[2].trim(),N=Ms.test(z)?r||null:z;if(N){let{loadMemory:D,findRuleByName:U,RULE_KIND_PROP:G,RULE_KIND_RECURSIVE:Z}=await Promise.resolve().then(()=>(Ke(),Ls)),re=await D(e),ie=U(re,F),J=ie?.attributes?.find(ee=>ee.prop===G)?.value;if(ie&&J===Z){let ee=ie.attributes.find(ce=>ce.prop==="mgx:ruleBaseCase")?.value,te=ie.attributes.find(ce=>ce.prop==="mgx:ruleRecStep")?.value,Q=c(N);if(ee&&te&&Q){let ce=rm(d),{findIsaChain:ke}=await Promise.resolve().then(()=>(At(),rn)),Re=Oe=>{let ue=String(Oe||"").trim().toLowerCase(),Ee=[];for(let me of d){let se=um(me.predicate);if(!se)continue;if(se===ue){Ee.push({fact:me,aliasFacts:[]});continue}let Ne=im(ke,se,new Set([ue]),ce,{maxHops:2});if(!Ne)continue;let Je=Ne.map(Be=>d.find(gt=>gt.predicate===Go&&gt.subject===Be.subject&&gt.object===Be.object));Je.every(Boolean)&&Ee.push({fact:me,aliasFacts:Je})}return Ee},{findReachableSet:de}=await Promise.resolve().then(()=>(bs(),xa)),ae=de({entity:Q,hop:0},Oe=>{let ue=Oe.hop===0?ee:te;return Re(ue).filter(Ee=>Ee.fact.subject===Oe.entity).map(Ee=>({action:Ee,nextState:{entity:Ee.fact.object,hop:Oe.hop+1}}))},{maxDepth:20,stateKey:Oe=>Oe.entity});if(ae.length)return{text:ae.map(({node:ue,path:Ee})=>{let me=new Set,se=[];for(let Ne of Ee.actions){se.push(oe(Ne.fact));for(let Je of Ne.aliasFacts){let Be=Je.id||`${Je.subject}|${Je.predicate}|${Je.object}`;me.has(Be)||(me.add(Be),se.push(`${Zt(Je)}${Je.provenance?` (source: ${ds(Je.provenance)})`:""}`))}}return`${ue.entity} \u2014 ${se.join("; ")}`}).join(`
228
- `),replace:!0}}}return null}}let $=l.match(_E),y=l.match(co)||gm(l)||$&&`is ${$[1].trim()} a ${$[2].trim()}`.match(co);if(y){let F=X(c,fn(y[2])),z=r&&Ms.test(y[1].trim())?r:y[1],N=new Set(X(c,z));if([...N].some(q=>F.has(q))){let q=fn(y[2]).trim();return{text:`yes \u2014 ${Vo(q)} ${q} is ${Vo(q)} ${q}, trivially: every kind is a kind of itself.`,replace:!0}}let D=await gM(o,z);if(D)for(let q of X(c,D))N.add(q);let{findIsaChain:U,buildSubClassSuccessors:G,deriveDisjointViolations:Z,SUBCLASS_PREDICATE:re,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:J}=await Promise.resolve().then(()=>(At(),rn)),ee=Wo,te=f.filter(q=>q.predicate===re&&ee(q)),Q=f.filter(q=>q.predicate===ie&&ee(q)),ce=te.map(q=>[q.subject,q.object]),ke=Q.map(q=>[q.subject,q.object]),Re=f.filter(q=>q.predicate===re),de=f.filter(q=>q.predicate===ie),Ge=de.map(q=>[q.subject,q.object]),Ve=Re.map(q=>[q.subject,q.object]),ae=G(ce),Oe=G(Ve),ue=d.filter(q=>q.predicate===J&&ee(q)),Ee=ue.map(q=>[q.subject,q.object]),me=ue.length?Z(Ge.concat(Ve),Ve,Ee,{budget:20,focus:new Set([...N,...F])}):[],se=q=>{let ve=me.find(Le=>Le.subject===q&&F.has(Le.object));if(!ve)return null;let ge=f.filter(Le=>F.has(Le.object)&&(Le.subject===ve.viaClass||Le.subject===ve.subject)).sort(p)[0],Se=ue.find(Le=>Le.subject===ve.viaClass&&Le.object===ve.object||Le.subject===ve.object&&Le.object===ve.viaClass);return!ge||!Se?null:hP(ge,Se)},Ne=f.filter(q=>N.has(q.subject)&&F.has(q.object)).sort(p)[0],Je=d.filter(q=>q.predicate===tc&&N.has(q.subject)&&F.has(q.object)).sort(p)[0],Be=ue.find(q=>N.has(q.subject)&&F.has(q.object)||N.has(q.object)&&F.has(q.subject));if(Ne&&!Je){let q=se(Ne.subject);if(q)return q}let gt=ZE(Ne,Je||Be);if(gt)return gt;if(ue.length){let q=Se=>{let Le=new Set(Se),It=new Set(Se);for(let Pe=0;Pe<8&&It.size;Pe+=1){let be=new Set;for(let[He,lo]of Ve)It.has(He)&&!Le.has(lo)&&be.add(lo);if(!be.size)break;for(let He of be)Le.add(He);It=be}return Le},ve=q(F),ge=me.find(Se=>N.has(Se.subject)&&ve.has(Se.object)&&!q([Se.viaClass]).has(Se.object)&&!q([Se.object]).has(Se.viaClass));if(ge){let Se=f.filter(be=>N.has(be.subject)&&be.object===ge.viaClass).sort(p)[0],Le=ue.find(be=>be.subject===ge.viaClass&&be.object===ge.object||be.subject===ge.object&&be.object===ge.viaClass),It=!F.has(ge.object),Pe=It?f.filter(be=>F.has(be.subject)&&be.object===ge.object).sort(p)[0]:null;if(Se&&Le&&(!It||Pe)){let be=fn(y[2]).trim();return{text:`no \u2014 ${[Se,...Pe?[Pe]:[]].map(oe).join("; ")}; and ${Zt(Le)}${Le.provenance?` (source: ${ds(Le.provenance)})`:""} \u2014 so ${z} can never be ${Vo(be)} ${be}.`,replace:!0}}}}let Ct=await aa(o,z);if(Ct){let q=new Map;for(let ge of zl(o,Ct.id))for(let Se of X(c,ge.label))!N.has(Se)&&!q.has(Se)&&q.set(Se,ge.label);let ve=f.filter(ge=>q.has(ge.subject)&&F.has(ge.object)).sort(p)[0];if(ve)return{text:`yes \u2014 the code graph says ${Ct.label} inherits ${q.get(ve.subject)}, and ${oe(ve)}`,replace:!0}}let ca=q=>(q.predicate===re?te:Q).find(ve=>ve.subject===q.subject&&ve.object===q.object);for(let q of N){let ve=U(q,F,ke,ae,{maxHops:2});if(!ve)continue;let ge=se(q);if(ge)return ge;let Se=ve.map(ca);if(Se.every(Boolean))return{text:`yes \u2014 ${Fl(Se)}`,replace:!0}}let I=q=>(q.predicate===re?Re:de).find(ve=>ve.subject===q.subject&&ve.object===q.object);for(let q of N){let ve=U(q,F,Ge,Oe,{maxHops:2});if(!ve)continue;let ge=se(q);if(ge)return ge;let Se=ve.map(I);if(Se.every(Boolean)&&Se.some(ee))return{text:`yes \u2014 ${Fl(Se)}`,replace:!0}}let fe=z.match(/^(.*\S)\s+not$/i),Ce=fe&&[fe[0],r&&Ms.test(fe[1].trim())?r:fe[1]];if(Ce){let q=X(c,Ce[1]),ve=F,ge=f.filter(Pe=>q.has(Pe.subject)&&ve.has(Pe.object)).sort(p)[0];if(ge)return{text:`no \u2014 ${oe(ge)}`,replace:!0};let Se=ue.find(Pe=>q.has(Pe.subject)&&ve.has(Pe.object)||q.has(Pe.object)&&ve.has(Pe.subject));if(Se)return{text:`yes \u2014 ${oe(Se)}`,replace:!0};let Le=Ce[1].trim(),It=fn(y[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Le} and ${It}. If no ${Le} is a ${It}, teach me: "no ${Le} is a ${It}".`,replace:!0,miss:!0}}if(ue.length){let q=Z(ke.concat(ce),ce,Ee,{budget:10});for(let ve of N){let ge=q.find(Pe=>Pe.subject===ve&&F.has(Pe.object));if(!ge)continue;let Se=Q.concat(te).find(Pe=>Pe.subject===ge.subject&&Pe.object===ge.viaType),Le=ue.find(Pe=>Pe.subject===ge.viaClass&&Pe.object===ge.object||Pe.subject===ge.object&&Pe.object===ge.viaClass),It=[Se,Le].filter(Boolean).map(oe);return{text:`no \u2014 ${It.length?It.join("; "):`${ge.viaClass} and ${ge.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:fs,ON_PROPERTY_PREDICATE:ps,SOME_VALUES_FROM_PREDICATE:la,deriveSomeValuesFromSubsumption:kS,ENTAILED_SCM_SVF_PROVENANCE:RS,SCM_SVF_RULE_CONFIDENCE:_S,entailedTrustFrom:Rm}=await Promise.resolve().then(()=>(At(),rn)),_m=d.filter(q=>q.predicate===ps&&ee(q)),Tm=d.filter(q=>q.predicate===la&&ee(q));if(_m.length&&Tm.length){let q=new Map(Tm.map(be=>[be.subject,be.object])),ve=_m.map(be=>({restriction:be.subject,property:be.object,target:q.get(be.subject)})).filter(be=>be.target),ge=new Set([re,ie,J,ps,la,"owl:intersectionOf"]),Se=d.filter(be=>ee(be)&&!ge.has(be.predicate)),Le=Se.map(be=>[be.subject,be.predicate,be.object]),It=fs(Le,ke,ce,ve,{budget:10});for(let be of N){let He=It.find(An=>An.subject===be&&F.has(An.object));if(!He)continue;let lo=Se.find(An=>An.subject===He.subject&&An.predicate===He.viaProperty&&An.object===He.viaValue),uo=Q.find(An=>An.subject===He.viaValue&&An.object===He.viaType),Hr=[lo,uo].filter(Boolean).map(oe);return{text:`yes \u2014 ${Hr.length?Hr.join("; "):`${He.subject} ${He.viaProperty} ${He.viaValue}, and ${He.viaValue} is a ${He.viaType}.`}`,replace:!0}}let Pe=ve.length>1?kS(ve,ce,{budget:10}):[];if(Pe.length){let be=G(ce.concat(Pe.map(Te=>[Te.subject,Te.object]))),He=new Map(ve.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,Fn,en)=>lo.get(`${Te}\0${Fn}\0${en}`),Hr=new Map;for(let Te of Pe){let Fn=He.get(Te.subject),en=He.get(Te.object),un=[Fn&&uo(Te.subject,ps,Fn.property),uo(Te.subject,la,Te.viaY1),en&&uo(Te.object,ps,en.property),uo(Te.object,la,Te.viaY2),uo(Te.viaY1,re,Te.viaY2)].filter(CS=>typeof CS=="number"),ua=Rm(un,_S);ua!==null&&Hr.set(`${Te.subject}\0${Te.object}`,ua)}let An=Te=>{if(Te.predicate!==re)return Q.find(un=>un.subject===Te.subject&&un.object===Te.object);let Fn=te.find(un=>un.subject===Te.subject&&un.object===Te.object);if(Fn)return Fn;let en=Pe.find(un=>un.subject===Te.subject&&un.object===Te.object);return en?{subject:en.subject,predicate:re,object:en.object,provenance:RS,trust:Hr.get(`${en.subject}\0${en.object}`)}:void 0};for(let Te of N){let Fn=U(Te,F,ke,be,{maxHops:3});if(!Fn)continue;let en=Fn.map(An);if(en.every(Boolean)){let un=Rm(en.map(ua=>ua.trust),1);return{text:`yes \u2014 ${Fl(en)}`,replace:!0,...un!==null?{trust:un}:{}}}}}}let TS=X(c,z),Yl=f.filter(q=>TS.has(q.subject)).sort(p),wn=z.trim(),Ds=fn(y[2]).trim(),AS=[...N].some(q=>U(q,F,ke,ae,{maxHops:EP})),Xl=await sM(e,a,d,wn,N,F,Ds);if(Xl?.text)return Xl;let Jl=!!Xl?.budgetExhausted;if(Yl.length){let q=Yl.slice(0,3).map(oe).join("; "),{ON_PROPERTY_PREDICATE:ve,SOME_VALUES_FROM_PREDICATE:ge}=await Promise.resolve().then(()=>(At(),rn)),Se=new Set,Le=new Set;for(let He of d)He.predicate===ve?Se.add(He.subject):He.predicate===ge&&Le.add(He.subject);let It=new Set([...Se].filter(He=>Le.has(He))),be=Yl.some(He=>It.has(He.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${wn}", then ask me again.`:AS?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${wn}", then ask me again.`:`If it's true, teach me: "${wn} is a kind of ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${wn} is a ${Ds}. I do know: ${q}. ${be}`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}}let Am=f.filter(q=>N.has(q.object)&&F.has(q.subject)).sort(p)[0];return Am?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(Am)}. A kind doesn't reverse. If it's true, teach me: "every ${wn} is a ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}:!Ct&&!D&&!U1(wn)&&!d.some(q=>N.has(q.subject)||N.has(q.object))?{text:`I can't confirm that \u2014 I don't know "${wn}" at all yet. If it's true, teach me: "${wn} is a kind of ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}:null}let x=l.match(aM);if(x){let[,F,z,N]=x,{SUBCLASS_PREDICATE:D,ON_PROPERTY_PREDICATE:U,buildCardinalityRestrictions:G,proveCardinalityAtLeast:Z,CARDINALITY_RULE_CONFIDENCE:re,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(At(),rn)),J=Wo,ee=f.filter(ce=>ce.predicate===D&&J(ce)).map(ce=>[ce.subject,ce.object]),te=d.filter(ce=>(ce.predicate===U||PE.has(ce.predicate))&&J(ce)),Q=G(te);if(Q.length){let ce=X(c,F.trim()),ke=X(c,N.trim()),Re=Number(z),de=RE(ce,ke,(Ge,Ve)=>Z(ee,Q,Ge,Ve,Re,{}));if(de){let Ge=d.find(me=>me.predicate===D&&me.subject===de.viaClass&&me.object===de.viaRestriction),Ve=Ge?.provenance?` (source: ${ds(Ge.provenance)})`:"",ae=de.kind==="exactly"?"exactly":"at least",Oe=(me,se)=>`${me}${se===1?"":"s"}`,ue=[Ge?.trust,...te.filter(me=>me.subject===de.viaRestriction).map(me=>me.trust),...de.viaClass!==de.subject?[f.find(me=>me.predicate===D&&me.subject===de.subject&&me.object===de.viaClass)?.trust]:[]].filter(me=>typeof me=="number"),Ee=ie(ue,re);return{text:`yes \u2014 every ${de.viaClass} has ${ae} ${de.n} ${Oe(de.object,de.n)}${Ve}, so at least ${Re} follows.`,replace:!0,...Ee!==null?{trust:Ee}:{}}}}}let C=l.match(cM);if(C){let[,F,z]=C,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:D,buildCardinalityRestrictions:U,proveMaxCardinalityZeroDenial:G,CAX_MAXC0_RULE_CONFIDENCE:Z,entailedTrustFrom:re}=await Promise.resolve().then(()=>(At(),rn)),ie=Wo,J=f.filter(Q=>Q.predicate===N&&ie(Q)).map(Q=>[Q.subject,Q.object]),ee=d.filter(Q=>(Q.predicate===D||PE.has(Q.predicate))&&ie(Q)),te=U(ee);if(te.length){let Q=X(c,F.trim()),ce=X(c,z.trim()),ke=RE(Q,ce,(Re,de)=>G(J,te,Re,de,{}));if(ke){let Re=d.find(ae=>ae.predicate===N&&ae.subject===ke.viaClass&&ae.object===ke.viaRestriction),de=Re?.provenance?` (source: ${ds(Re.provenance)})`:"",Ge=[Re?.trust,...ee.filter(ae=>ae.subject===ke.viaRestriction).map(ae=>ae.trust),...ke.viaClass!==ke.subject?[f.find(ae=>ae.predicate===N&&ae.subject===ke.subject&&ae.object===ke.viaClass)?.trust]:[]].filter(ae=>typeof ae=="number"),Ve=re(Ge,Z);return{text:`no \u2014 every ${ke.viaClass} has at most 0 ${ke.object}${de}.`,replace:!0,...Ve!==null?{trust:Ve}:{}}}}}let v=l.match(lM);if(v){let F=X(c,v[1]),z=d.filter(N=>N.predicate===sm&&F.has(N.subject)).sort(p);return z.length?m(z):null}let j=u.match(uM);if(j){let[,F,z]=j,N=X(c,F.trim()),D=X(c,z.replace(/^an?\s+/i,"").trim()),U=d.filter(G=>G.predicate===sm&&D.has(G.subject)&&N.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${F.trim().toLowerCase()} owns/maintains ${z.trim()}.`,replace:!0}}let E=u.match(dM);if(E){let[,F,z]=E,N=X(c,F.replace(/^an?\s+/i,"").trim()),D=X(c,z.trim()),U=d.filter(G=>G.predicate===sm&&N.has(G.subject)&&D.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${F.trim().toLowerCase()} is owned by ${z.trim()}.`,replace:!0}}let S=u.match(fM);if(S){let[,F,z]=S,N=X(c,F.trim()),D=X(c,`${z.trim()} method`),U=d.filter(G=>G.predicate===Or&&N.has(G.subject)&&D.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:null}let A=u.match(pM);if(A){let F=X(c,A[1].trim()),z=d.filter(N=>N.predicate===Or&&F.has(N.subject)&&/ method$/.test(N.object)).sort(p);return z.length?m(z):null}let w=u.match(ME);if(w){let F=w[1].trim(),z=DE.test(F)||FE.test(F)?null:Ms.test(F)?r||null:F,N=w[2].trim().toLowerCase();if(z){let D=X(c,z),U=new Map,G=null;if(o){let te=await aa(o,z);if(G=te,te)for(let Q of zl(o,te.id))for(let ce of X(c,Q.label))!D.has(ce)&&!U.has(ce)&&U.set(ce,Q.label),D.add(ce)}let Z=te=>te.predicate===om&&c(te.object)===N||te.predicate===`tmct:${N}`&&te.object==="true",re=c(z).split(/\s+/).filter(te=>te.length>=4&&!eS.has(te)),ie=te=>re.some(Q=>new Set(String(te.subject||"").split(/\s+/)).has(Q)),J=te=>D.has(te.subject)||re.length&&ie(te),ee=d.filter(te=>J(te)&&Z(te)).sort(p)[0];if(ee){let te=U.get(ee.subject);return{text:te?`yes \u2014 the code graph says ${G.label} inherits ${te}, and ${oe(ee)}`:`yes \u2014 ${oe(ee)}`,replace:!0}}{let{findIsaChain:te,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ce}=await Promise.resolve().then(()=>(At(),rn)),ke=Wo,Re=d.filter(ue=>ue.predicate===Q&&ke(ue)),de=d.filter(ue=>ue.predicate===ce&&ke(ue)),Ge=Re.map(ue=>[ue.subject,ue.object]),Ve=de.map(ue=>[ue.subject,ue.object]),ae=ue=>(ue.predicate===Q?Re:de).find(Ee=>Ee.subject===ue.subject&&Ee.object===ue.object),Oe=X(c,N);for(let ue of D){let Ee=te(ue,Oe,Ve,Ge,{maxHops:2});if(!Ee)continue;let me=Ee.map(ae);if(me.every(Boolean))return{text:`yes \u2014 ${Fl(me)}`,replace:!0}}}if(d.some(J)&&!n?.parsed)return/^there\b/i.test(z)||mM.test(N)?null:{text:`I don't have a fact saying ${bP(z)} is ${N}.`,replace:!0};if(!n?.parsed&&!$E.test(N))return zE(z,N)}}let T=wm(l).match(eP);if(T&&!cm.test(l)){let[,F,z,N]=T,D=z.toLowerCase();if(!am.test(D)&&!lm.test(D)){let U=F.trim(),G=sP(await Ul(D),N),Z=G.object.replace(/^an?\s+/i,"").trim();if(U&&Z){let re=G.predicate,ie=X(c,U),J=X(c,Z),ee=[re,xr(re)],te=d.filter(ce=>ee.includes(ce.predicate)&&ie.has(ce.subject)&&J.has(ce.object)).sort(p)[0];if(te)return{text:`${ew(te.predicate)?"no":"yes"} \u2014 ${oe(te)}`,replace:!0,generalVerbQuery:!0};let Q=d.filter(ce=>ee.includes(ce.predicate)&&ie.has(ce.subject));if(Q.length){let ce=Q.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Zt({subject:U,predicate:re,object:Z})}. I do know: ${ce}.`,replace:!0,miss:!0}}return null}}}let O=l.match(tP);if(O&&!cm.test(l)){let[,F,z]=O,[N,D]=z.toLowerCase().split(/\s+/);if(!am.test(N)&&!lm.test(N)){let U=F.trim();if(U){let G=await Ul(N);D&&/^mgx:[a-z]+$/.test(G)&&(G=`${G}-${D}`);let Z=X(c,U),re=[G,xr(G)],ie=rt(d.filter(J=>re.includes(J.predicate)&&Z.has(J.subject)),i);if(ie.length)return{...m(ie),generalVerbQuery:!0}}}}let R=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(R&&!cm.test(l)){let[,F,z,N]=R,D=F.toLowerCase();if(!am.test(D)&&!lm.test(D)&&!Z1.test(D)){let U=await Ul(D);/^mgx:[a-z]+$/.test(U)&&(U=`${U}-${z.toLowerCase()}`);let G=X(c,N.replace(/^(?:an?|the)\s+/i,"").trim()),Z=rt(d.filter(re=>re.predicate===U&&G.has(re.object)),i);if(Z.length)return{...m(Z),generalVerbQuery:!0}}}let k=l.match(rM);if(k){let F=X(c,k[1]),z=rt(d.filter(re=>F.has(re.subject)||F.has(re.object)),i);if(!z.length)return null;let N=F.has(z[0].subject)?z[0].subject:z[0].object,D=z.map(re=>` ${oe(re)}`),U=D.slice(0,je),G=D.slice(je),Z=G.length?`
228
+ `),replace:!0}}}return null}}let $=l.match(TE),y=l.match(co)||gm(l)||$&&`is ${$[1].trim()} a ${$[2].trim()}`.match(co);if(y){let F=X(c,fn(y[2])),z=r&&Ms.test(y[1].trim())?r:y[1],N=new Set(X(c,z));if([...N].some(q=>F.has(q))){let q=fn(y[2]).trim();return{text:`yes \u2014 ${Vo(q)} ${q} is ${Vo(q)} ${q}, trivially: every kind is a kind of itself.`,replace:!0}}let D=await gM(o,z);if(D)for(let q of X(c,D))N.add(q);let{findIsaChain:U,buildSubClassSuccessors:G,deriveDisjointViolations:Z,SUBCLASS_PREDICATE:re,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:J}=await Promise.resolve().then(()=>(At(),rn)),ee=Wo,te=f.filter(q=>q.predicate===re&&ee(q)),Q=f.filter(q=>q.predicate===ie&&ee(q)),ce=te.map(q=>[q.subject,q.object]),ke=Q.map(q=>[q.subject,q.object]),Re=f.filter(q=>q.predicate===re),de=f.filter(q=>q.predicate===ie),Ge=de.map(q=>[q.subject,q.object]),Ve=Re.map(q=>[q.subject,q.object]),ae=G(ce),Oe=G(Ve),ue=d.filter(q=>q.predicate===J&&ee(q)),Ee=ue.map(q=>[q.subject,q.object]),me=ue.length?Z(Ge.concat(Ve),Ve,Ee,{budget:20,focus:new Set([...N,...F])}):[],se=q=>{let ve=me.find(Le=>Le.subject===q&&F.has(Le.object));if(!ve)return null;let ge=f.filter(Le=>F.has(Le.object)&&(Le.subject===ve.viaClass||Le.subject===ve.subject)).sort(p)[0],Se=ue.find(Le=>Le.subject===ve.viaClass&&Le.object===ve.object||Le.subject===ve.object&&Le.object===ve.viaClass);return!ge||!Se?null:hP(ge,Se)},Ne=f.filter(q=>N.has(q.subject)&&F.has(q.object)).sort(p)[0],Je=d.filter(q=>q.predicate===tc&&N.has(q.subject)&&F.has(q.object)).sort(p)[0],Be=ue.find(q=>N.has(q.subject)&&F.has(q.object)||N.has(q.object)&&F.has(q.subject));if(Ne&&!Je){let q=se(Ne.subject);if(q)return q}let gt=eS(Ne,Je||Be);if(gt)return gt;if(ue.length){let q=Se=>{let Le=new Set(Se),It=new Set(Se);for(let Pe=0;Pe<8&&It.size;Pe+=1){let be=new Set;for(let[He,lo]of Ve)It.has(He)&&!Le.has(lo)&&be.add(lo);if(!be.size)break;for(let He of be)Le.add(He);It=be}return Le},ve=q(F),ge=me.find(Se=>N.has(Se.subject)&&ve.has(Se.object)&&!q([Se.viaClass]).has(Se.object)&&!q([Se.object]).has(Se.viaClass));if(ge){let Se=f.filter(be=>N.has(be.subject)&&be.object===ge.viaClass).sort(p)[0],Le=ue.find(be=>be.subject===ge.viaClass&&be.object===ge.object||be.subject===ge.object&&be.object===ge.viaClass),It=!F.has(ge.object),Pe=It?f.filter(be=>F.has(be.subject)&&be.object===ge.object).sort(p)[0]:null;if(Se&&Le&&(!It||Pe)){let be=fn(y[2]).trim();return{text:`no \u2014 ${[Se,...Pe?[Pe]:[]].map(oe).join("; ")}; and ${Zt(Le)}${Le.provenance?` (source: ${ds(Le.provenance)})`:""} \u2014 so ${z} can never be ${Vo(be)} ${be}.`,replace:!0}}}}let Ct=await aa(o,z);if(Ct){let q=new Map;for(let ge of zl(o,Ct.id))for(let Se of X(c,ge.label))!N.has(Se)&&!q.has(Se)&&q.set(Se,ge.label);let ve=f.filter(ge=>q.has(ge.subject)&&F.has(ge.object)).sort(p)[0];if(ve)return{text:`yes \u2014 the code graph says ${Ct.label} inherits ${q.get(ve.subject)}, and ${oe(ve)}`,replace:!0}}let ca=q=>(q.predicate===re?te:Q).find(ve=>ve.subject===q.subject&&ve.object===q.object);for(let q of N){let ve=U(q,F,ke,ae,{maxHops:2});if(!ve)continue;let ge=se(q);if(ge)return ge;let Se=ve.map(ca);if(Se.every(Boolean))return{text:`yes \u2014 ${Fl(Se)}`,replace:!0}}let I=q=>(q.predicate===re?Re:de).find(ve=>ve.subject===q.subject&&ve.object===q.object);for(let q of N){let ve=U(q,F,Ge,Oe,{maxHops:2});if(!ve)continue;let ge=se(q);if(ge)return ge;let Se=ve.map(I);if(Se.every(Boolean)&&Se.some(ee))return{text:`yes \u2014 ${Fl(Se)}`,replace:!0}}let fe=z.match(/^(.*\S)\s+not$/i),Ce=fe&&[fe[0],r&&Ms.test(fe[1].trim())?r:fe[1]];if(Ce){let q=X(c,Ce[1]),ve=F,ge=f.filter(Pe=>q.has(Pe.subject)&&ve.has(Pe.object)).sort(p)[0];if(ge)return{text:`no \u2014 ${oe(ge)}`,replace:!0};let Se=ue.find(Pe=>q.has(Pe.subject)&&ve.has(Pe.object)||q.has(Pe.object)&&ve.has(Pe.subject));if(Se)return{text:`yes \u2014 ${oe(Se)}`,replace:!0};let Le=Ce[1].trim(),It=fn(y[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Le} and ${It}. If no ${Le} is a ${It}, teach me: "no ${Le} is a ${It}".`,replace:!0,miss:!0}}if(ue.length){let q=Z(ke.concat(ce),ce,Ee,{budget:10});for(let ve of N){let ge=q.find(Pe=>Pe.subject===ve&&F.has(Pe.object));if(!ge)continue;let Se=Q.concat(te).find(Pe=>Pe.subject===ge.subject&&Pe.object===ge.viaType),Le=ue.find(Pe=>Pe.subject===ge.viaClass&&Pe.object===ge.object||Pe.subject===ge.object&&Pe.object===ge.viaClass),It=[Se,Le].filter(Boolean).map(oe);return{text:`no \u2014 ${It.length?It.join("; "):`${ge.viaClass} and ${ge.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:fs,ON_PROPERTY_PREDICATE:ps,SOME_VALUES_FROM_PREDICATE:la,deriveSomeValuesFromSubsumption:RS,ENTAILED_SCM_SVF_PROVENANCE:_S,SCM_SVF_RULE_CONFIDENCE:TS,entailedTrustFrom:Rm}=await Promise.resolve().then(()=>(At(),rn)),_m=d.filter(q=>q.predicate===ps&&ee(q)),Tm=d.filter(q=>q.predicate===la&&ee(q));if(_m.length&&Tm.length){let q=new Map(Tm.map(be=>[be.subject,be.object])),ve=_m.map(be=>({restriction:be.subject,property:be.object,target:q.get(be.subject)})).filter(be=>be.target),ge=new Set([re,ie,J,ps,la,"owl:intersectionOf"]),Se=d.filter(be=>ee(be)&&!ge.has(be.predicate)),Le=Se.map(be=>[be.subject,be.predicate,be.object]),It=fs(Le,ke,ce,ve,{budget:10});for(let be of N){let He=It.find(An=>An.subject===be&&F.has(An.object));if(!He)continue;let lo=Se.find(An=>An.subject===He.subject&&An.predicate===He.viaProperty&&An.object===He.viaValue),uo=Q.find(An=>An.subject===He.viaValue&&An.object===He.viaType),Hr=[lo,uo].filter(Boolean).map(oe);return{text:`yes \u2014 ${Hr.length?Hr.join("; "):`${He.subject} ${He.viaProperty} ${He.viaValue}, and ${He.viaValue} is a ${He.viaType}.`}`,replace:!0}}let Pe=ve.length>1?RS(ve,ce,{budget:10}):[];if(Pe.length){let be=G(ce.concat(Pe.map(Te=>[Te.subject,Te.object]))),He=new Map(ve.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,Fn,en)=>lo.get(`${Te}\0${Fn}\0${en}`),Hr=new Map;for(let Te of Pe){let Fn=He.get(Te.subject),en=He.get(Te.object),un=[Fn&&uo(Te.subject,ps,Fn.property),uo(Te.subject,la,Te.viaY1),en&&uo(Te.object,ps,en.property),uo(Te.object,la,Te.viaY2),uo(Te.viaY1,re,Te.viaY2)].filter(IS=>typeof IS=="number"),ua=Rm(un,TS);ua!==null&&Hr.set(`${Te.subject}\0${Te.object}`,ua)}let An=Te=>{if(Te.predicate!==re)return Q.find(un=>un.subject===Te.subject&&un.object===Te.object);let Fn=te.find(un=>un.subject===Te.subject&&un.object===Te.object);if(Fn)return Fn;let en=Pe.find(un=>un.subject===Te.subject&&un.object===Te.object);return en?{subject:en.subject,predicate:re,object:en.object,provenance:_S,trust:Hr.get(`${en.subject}\0${en.object}`)}:void 0};for(let Te of N){let Fn=U(Te,F,ke,be,{maxHops:3});if(!Fn)continue;let en=Fn.map(An);if(en.every(Boolean)){let un=Rm(en.map(ua=>ua.trust),1);return{text:`yes \u2014 ${Fl(en)}`,replace:!0,...un!==null?{trust:un}:{}}}}}}let AS=X(c,z),Yl=f.filter(q=>AS.has(q.subject)).sort(p),wn=z.trim(),Ds=fn(y[2]).trim(),CS=[...N].some(q=>U(q,F,ke,ae,{maxHops:EP})),Xl=await sM(e,a,d,wn,N,F,Ds);if(Xl?.text)return Xl;let Jl=!!Xl?.budgetExhausted;if(Yl.length){let q=Yl.slice(0,3).map(oe).join("; "),{ON_PROPERTY_PREDICATE:ve,SOME_VALUES_FROM_PREDICATE:ge}=await Promise.resolve().then(()=>(At(),rn)),Se=new Set,Le=new Set;for(let He of d)He.predicate===ve?Se.add(He.subject):He.predicate===ge&&Le.add(He.subject);let It=new Set([...Se].filter(He=>Le.has(He))),be=Yl.some(He=>It.has(He.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${wn}", then ask me again.`:CS?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${wn}", then ask me again.`:`If it's true, teach me: "${wn} is a kind of ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${wn} is a ${Ds}. I do know: ${q}. ${be}`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}}let Am=f.filter(q=>N.has(q.object)&&F.has(q.subject)).sort(p)[0];return Am?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(Am)}. A kind doesn't reverse. If it's true, teach me: "every ${wn} is a ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}:!Ct&&!D&&!U1(wn)&&!d.some(q=>N.has(q.subject)||N.has(q.object))?{text:`I can't confirm that \u2014 I don't know "${wn}" at all yet. If it's true, teach me: "${wn} is a kind of ${Ds}". If it isn't, teach me: "no ${wn} is a ${Ds}".`,replace:!0,miss:!0,...Jl?{budgetExhausted:!0}:{}}:null}let x=l.match(aM);if(x){let[,F,z,N]=x,{SUBCLASS_PREDICATE:D,ON_PROPERTY_PREDICATE:U,buildCardinalityRestrictions:G,proveCardinalityAtLeast:Z,CARDINALITY_RULE_CONFIDENCE:re,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(At(),rn)),J=Wo,ee=f.filter(ce=>ce.predicate===D&&J(ce)).map(ce=>[ce.subject,ce.object]),te=d.filter(ce=>(ce.predicate===U||ME.has(ce.predicate))&&J(ce)),Q=G(te);if(Q.length){let ce=X(c,F.trim()),ke=X(c,N.trim()),Re=Number(z),de=_E(ce,ke,(Ge,Ve)=>Z(ee,Q,Ge,Ve,Re,{}));if(de){let Ge=d.find(me=>me.predicate===D&&me.subject===de.viaClass&&me.object===de.viaRestriction),Ve=Ge?.provenance?` (source: ${ds(Ge.provenance)})`:"",ae=de.kind==="exactly"?"exactly":"at least",Oe=(me,se)=>`${me}${se===1?"":"s"}`,ue=[Ge?.trust,...te.filter(me=>me.subject===de.viaRestriction).map(me=>me.trust),...de.viaClass!==de.subject?[f.find(me=>me.predicate===D&&me.subject===de.subject&&me.object===de.viaClass)?.trust]:[]].filter(me=>typeof me=="number"),Ee=ie(ue,re);return{text:`yes \u2014 every ${de.viaClass} has ${ae} ${de.n} ${Oe(de.object,de.n)}${Ve}, so at least ${Re} follows.`,replace:!0,...Ee!==null?{trust:Ee}:{}}}}}let C=l.match(cM);if(C){let[,F,z]=C,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:D,buildCardinalityRestrictions:U,proveMaxCardinalityZeroDenial:G,CAX_MAXC0_RULE_CONFIDENCE:Z,entailedTrustFrom:re}=await Promise.resolve().then(()=>(At(),rn)),ie=Wo,J=f.filter(Q=>Q.predicate===N&&ie(Q)).map(Q=>[Q.subject,Q.object]),ee=d.filter(Q=>(Q.predicate===D||ME.has(Q.predicate))&&ie(Q)),te=U(ee);if(te.length){let Q=X(c,F.trim()),ce=X(c,z.trim()),ke=_E(Q,ce,(Re,de)=>G(J,te,Re,de,{}));if(ke){let Re=d.find(ae=>ae.predicate===N&&ae.subject===ke.viaClass&&ae.object===ke.viaRestriction),de=Re?.provenance?` (source: ${ds(Re.provenance)})`:"",Ge=[Re?.trust,...ee.filter(ae=>ae.subject===ke.viaRestriction).map(ae=>ae.trust),...ke.viaClass!==ke.subject?[f.find(ae=>ae.predicate===N&&ae.subject===ke.subject&&ae.object===ke.viaClass)?.trust]:[]].filter(ae=>typeof ae=="number"),Ve=re(Ge,Z);return{text:`no \u2014 every ${ke.viaClass} has at most 0 ${ke.object}${de}.`,replace:!0,...Ve!==null?{trust:Ve}:{}}}}}let v=l.match(lM);if(v){let F=X(c,v[1]),z=d.filter(N=>N.predicate===sm&&F.has(N.subject)).sort(p);return z.length?m(z):null}let j=u.match(uM);if(j){let[,F,z]=j,N=X(c,F.trim()),D=X(c,z.replace(/^an?\s+/i,"").trim()),U=d.filter(G=>G.predicate===sm&&D.has(G.subject)&&N.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${F.trim().toLowerCase()} owns/maintains ${z.trim()}.`,replace:!0}}let E=u.match(dM);if(E){let[,F,z]=E,N=X(c,F.replace(/^an?\s+/i,"").trim()),D=X(c,z.trim()),U=d.filter(G=>G.predicate===sm&&N.has(G.subject)&&D.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${F.trim().toLowerCase()} is owned by ${z.trim()}.`,replace:!0}}let S=u.match(fM);if(S){let[,F,z]=S,N=X(c,F.trim()),D=X(c,`${z.trim()} method`),U=d.filter(G=>G.predicate===Or&&N.has(G.subject)&&D.has(G.object)).sort(p)[0];return U?{text:`yes \u2014 ${oe(U)}`,replace:!0}:null}let A=u.match(pM);if(A){let F=X(c,A[1].trim()),z=d.filter(N=>N.predicate===Or&&F.has(N.subject)&&/ method$/.test(N.object)).sort(p);return z.length?m(z):null}let w=u.match(FE);if(w){let F=w[1].trim(),z=zE.test(F)||DE.test(F)?null:Ms.test(F)?r||null:F,N=w[2].trim().toLowerCase();if(z){let D=X(c,z),U=new Map,G=null;if(o){let te=await aa(o,z);if(G=te,te)for(let Q of zl(o,te.id))for(let ce of X(c,Q.label))!D.has(ce)&&!U.has(ce)&&U.set(ce,Q.label),D.add(ce)}let Z=te=>te.predicate===om&&c(te.object)===N||te.predicate===`tmct:${N}`&&te.object==="true",re=c(z).split(/\s+/).filter(te=>te.length>=4&&!tS.has(te)),ie=te=>re.some(Q=>new Set(String(te.subject||"").split(/\s+/)).has(Q)),J=te=>D.has(te.subject)||re.length&&ie(te),ee=d.filter(te=>J(te)&&Z(te)).sort(p)[0];if(ee){let te=U.get(ee.subject);return{text:te?`yes \u2014 the code graph says ${G.label} inherits ${te}, and ${oe(ee)}`:`yes \u2014 ${oe(ee)}`,replace:!0}}{let{findIsaChain:te,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ce}=await Promise.resolve().then(()=>(At(),rn)),ke=Wo,Re=d.filter(ue=>ue.predicate===Q&&ke(ue)),de=d.filter(ue=>ue.predicate===ce&&ke(ue)),Ge=Re.map(ue=>[ue.subject,ue.object]),Ve=de.map(ue=>[ue.subject,ue.object]),ae=ue=>(ue.predicate===Q?Re:de).find(Ee=>Ee.subject===ue.subject&&Ee.object===ue.object),Oe=X(c,N);for(let ue of D){let Ee=te(ue,Oe,Ve,Ge,{maxHops:2});if(!Ee)continue;let me=Ee.map(ae);if(me.every(Boolean))return{text:`yes \u2014 ${Fl(me)}`,replace:!0}}}if(d.some(J)&&!n?.parsed)return/^there\b/i.test(z)||mM.test(N)?null:{text:`I don't have a fact saying ${bP(z)} is ${N}.`,replace:!0};if(!n?.parsed&&!vE.test(N))return UE(z,N)}}let T=wm(l).match(eP);if(T&&!cm.test(l)){let[,F,z,N]=T,D=z.toLowerCase();if(!am.test(D)&&!lm.test(D)){let U=F.trim(),G=sP(await Ul(D),N),Z=G.object.replace(/^an?\s+/i,"").trim();if(U&&Z){let re=G.predicate,ie=X(c,U),J=X(c,Z),ee=[re,xr(re)],te=d.filter(ce=>ee.includes(ce.predicate)&&ie.has(ce.subject)&&J.has(ce.object)).sort(p)[0];if(te)return{text:`${ew(te.predicate)?"no":"yes"} \u2014 ${oe(te)}`,replace:!0,generalVerbQuery:!0};let Q=d.filter(ce=>ee.includes(ce.predicate)&&ie.has(ce.subject));if(Q.length){let ce=Q.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Zt({subject:U,predicate:re,object:Z})}. I do know: ${ce}.`,replace:!0,miss:!0}}return null}}}let O=l.match(tP);if(O&&!cm.test(l)){let[,F,z]=O,[N,D]=z.toLowerCase().split(/\s+/);if(!am.test(N)&&!lm.test(N)){let U=F.trim();if(U){let G=await Ul(N);D&&/^mgx:[a-z]+$/.test(G)&&(G=`${G}-${D}`);let Z=X(c,U),re=[G,xr(G)],ie=rt(d.filter(J=>re.includes(J.predicate)&&Z.has(J.subject)),i);if(ie.length)return{...m(ie),generalVerbQuery:!0}}}}let R=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(R&&!cm.test(l)){let[,F,z,N]=R,D=F.toLowerCase();if(!am.test(D)&&!lm.test(D)&&!Z1.test(D)){let U=await Ul(D);/^mgx:[a-z]+$/.test(U)&&(U=`${U}-${z.toLowerCase()}`);let G=X(c,N.replace(/^(?:an?|the)\s+/i,"").trim()),Z=rt(d.filter(re=>re.predicate===U&&G.has(re.object)),i);if(Z.length)return{...m(Z),generalVerbQuery:!0}}}let k=l.match(rM);if(k){let F=X(c,k[1]),z=rt(d.filter(re=>F.has(re.subject)||F.has(re.object)),i);if(!z.length)return null;let N=F.has(z[0].subject)?z[0].subject:z[0].object,D=z.map(re=>` ${oe(re)}`),U=D.slice(0,je),G=D.slice(je),Z=G.length?`
229
229
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:`${z.length} remembered fact${z.length===1?"":"s"} about ${N}:
230
230
  ${U.join(`
231
- `)}${Z}`,replace:!0,...G.length?{pending:{items:G.map(re=>re.trim()),noun:"facts"}}:{}}}let L=n?.parsed?.shape==="meta"?n.parsed.object:null,B=!1,V=null,K=l.match(iM);if(K)V=K[1]?K[1].trim():null,L=K[2],B=!0;else if(!L&&!n?.parsed){let F=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);F&&(L=F[1])}if(!L)return null;let Y=X(c,L),_=rt(f.filter(F=>Y.has(F.subject)),i),P=rt(f.filter(F=>Y.has(F.object)),i),W=B?_.length?_:P:P.length?P:_;if(!W.length)return null;if(V&&W===_){let F=X(c,V),z=D=>f.find(U=>U.subject===D.object&&F.has(U.object)),N=W.map(D=>({hit:D,bridge:z(D)})).find(({bridge:D})=>D);if(N)return{text:`${oe(N.hit)} \u2014 ${oe(N.bridge)}`,replace:!0}}return m(W)}function fm(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function cS(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(gE(),hE));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(Ai(),of)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function UE(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var $m,U1,Tn,Ml,bE,BE,f9,B1,p9,wE,W1,m9,WE,GE,VE,G1,yE,h9,g9,b9,w9,y9,xm,$9,V1,Ye,sm,om,Go,H1,HE,q1,Wo,v9,x9,E9,S9,j9,k9,R9,_9,T9,A9,C9,I9,O9,N9,L9,P9,M9,F9,$E,X1,Gl,J1,D9,z9,Sm,qE,U9,B9,W9,G9,Q1,V9,am,cm,Z1,H9,eP,tP,lm,nP,oP,q9,KE,YE,rP,K9,Y9,XE,X9,J9,Q9,iP,Z9,aP,Vr,eQ,tQ,nQ,JE,sQ,oQ,cP,rQ,iQ,aQ,cQ,vE,EE,jm,Zt,uP,fP,pP,Dl,wP,eS,lQ,hm,tS,yP,$P,Wl,vP,xP,co,us,EP,SP,jP,bm,_E,kP,je,_P,TP,AP,CP,IP,OP,NP,LP,PP,MP,FP,DP,zP,UP,BP,AE,sS,GP,VP,qP,KP,YP,XP,JP,OE,QP,eM,rM,iM,aM,cM,PE,lM,uM,dM,fM,pM,ME,Ms,mM,FE,DE,zE,hM,bM,wM,uQ,aS,$M,vM,dQ,pm,ym,xM,fQ,pQ,lS,mQ,hQ,gQ,bQ,wQ,Hl,yQ,$Q,vQ,xQ,EM,EQ,SQ,Xi=M(()=>{Xe();M$();Kt();Me();qn();qf();Wc();Gc();Zr();Vc();H$();Ke();oc();Kc();Jc();Bn();$n();lr();Ma();Gf();Vf();ir();os();Ou();Mr();av();dv();mv();ip();hv();up();dp();jv();kv();Rv();fl();Yi();Dc();Ur();px();gx();ro();Ux();Fa(void 0);Pa(Bc);$m=new Set(["it","this","that","here"]),U1=e=>$m.has(String(e||"").trim().toLowerCase()),Tn={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"},Ml=e=>e?`${String(e).toLowerCase()}(s)`:"entities",bE="look up a taught fact about a subject/verb/object";BE={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}},f9=new Set(["stats","memory","focus",...Object.keys(BE)]),B1=new Set(["have","has","holds","hold"]),p9=new RegExp(`\\b(?:${[...Object.keys(pe),...Object.keys(Us)].filter(e=>!B1.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),wE=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,W1=(e,t)=>{let n=wE(e),s=wE(t);return n<s?-1:n>s?1:0},m9=new Set([...P$.map(e=>e.name),...Object.values(BE).map(e=>e.tool)]),WE=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"]),GE=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"]),VE=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"]),G1=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),yE=e=>e.replace(/(.)\1+/g,"$1");h9=vm(WE),g9=vm(GE),b9=vm(VE),w9=new RegExp(`^(?:${[...G1].map(tt).join("|")})\\s+(.+)$`,"i"),y9=[...WE,...GE,...VE,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],xm="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",$9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${xm})\\s+than\\s+(.+)$`,"i"),V1=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${xm})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ye="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",sm="mgx:ownedBy",om="mgx:hasProperty",Go="rdfs:subClassOf",H1="rdf:type",HE="rdfs:subPropertyOf",q1=new Set(["operator","teach","entailed"]),Wo=e=>!!e.sourceTypes?.some(t=>q1.has(t));v9=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),x9=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),E9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),S9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${xm})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),j9=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),k9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\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");R9=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),_9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),T9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),A9=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),C9=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),I9=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),O9=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)$`,"i"),N9=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+(?:${Ye})\\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"),L9=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+(?:${Ye})\\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"),P9=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+(?:${Ye})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),M9=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ye})\\s+(.+?)[?.!\\s]*$`,"i"),F9=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ye}))?[?.!\\s]*$`,"i"),$E=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,X1=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"]);Gl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",J1="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",D9=new RegExp(`^(.+?)\\s+(${J1})\\s+(.+)$`,"i"),z9=new RegExp(`^([\\w'-]+)\\s+${Gl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Sm="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",qE="with|to|from|by|of|in|on|for|as|about|into",U9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Gl}(${Sm})\\s+(${qE})\\s+(.+)$`,"i"),B9=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Sm})\\s+(${qE})\\s+(.+)$`,"i"),W9=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),G9=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),Q1="(?:just\\s+)?(?:one|another)\\s+more|another",V9=new RegExp(`^(?:${Q1})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),am=/^(?:is|are|am|owns|maintains)$/i,cm=/\b(?:is|are|am|owns|maintains)\b/i,Z1=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"),H9=new RegExp(`^(?:${go.filter(e=>!/\s/.test(e)).join("|")})$`,"i");eP=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Gl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),tP=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Gl}([a-z]+(?:\\s+(?:${Ye}))?)[?.!\\s]*$`,"i"),lm=/^(?:be|own|maintain)$/i,nP=new RegExp(`^(${Ye})\\s+(.+)$`,"i");oP=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],q9=new RegExp(`^(?:${oP.join("|")})\\b\\s*,?\\s+`,"i"),KE=Object.freeze(["you","i","it","they","he","she","we"]),YE=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),rP=Object.freeze([...YE,...KE]),K9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${rP.join("|")})\\s+\\S+`,"i"),Y9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${KE.join("|")})\\s+(?:is|are|am|was|were)|(${YE.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),XE="forget|unlearn|delete|remove",X9=new RegExp(`^(?:${XE})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),J9=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),Q9=new RegExp(`^(?:${XE})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),iP="collection|set|group|family",Z9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${iP})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),aP=Object.freeze(["mgx:memberOf","mgx:partOf"]),Vr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",eQ=new RegExp(`^what\\s+does\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),tQ=new RegExp(`^what\\s+(.+?)${Vr}\\s+does${Vr}\\??$`,"i"),nQ=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),JE="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",sQ=new RegExp(`^who\\s+(?:is|was)\\s+${JE}$`,"i"),oQ=new RegExp(`^what\\s+(?:did|has)\\s+${JE}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),cP="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",rQ=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${cP}\\b`,"i"),iQ=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"),aQ=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});cQ=new Set([...Object.keys(pe).flatMap(e=>e.split(/[\s-]+/)),...dn,...Cn,"owns","maintains"].filter(e=>e.length>=3)),vE=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"]);EE=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),jm=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Zt=e=>`${e.subject} ${QE(e.predicate)} ${e.object}`;uP=Object.entries(Ps).filter(([e])=>!jm.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);fP=/ \(source: [^)]*\)$/;pP=8;Dl=null;wP=/^(?:every|each|all|any)\s+/i;eS=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"]),lQ=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("|"))),hm=/^(?: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,tS=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,yP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,$P=/^(who|what)'?s\s+/i,Wl=e=>String(e).replace($P,(t,n)=>`${n} is `),vP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;xP=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,co=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,us=new Set(["rdfs:subClassOf","rdf:type"]),EP=6,SP=/^why\s+(?=(?:is|are)\b)/i,jP=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;bm=new Set(["kind","sort","type","subclass","superclass"]),_E=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,kP=/^(?: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,je=32;_P=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,TP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,AP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,CP=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,IP=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,OP=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,NP=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,LP=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,PP=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ye})\\s+(.+?)\\s*[?.!]*$`,"i"),MP=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,FP=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,DP=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,zP=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,UP=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,BP=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;AE=e=>String(e||"").replace(/\s+/g," ").trim();sS="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",GP=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${sS})[?.!\\s]*$`,"i"),VP=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${sS})\\s+([\\w'-]+)[?.!\\s]*$`,"i");qP=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),KP=Object.entries(Ps).filter(([e])=>!qP.has(e)&&!jm.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${tt(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),YP=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),XP=new Set(["mgx:partOf","mgx:memberOf"]),JP=Object.entries(Ps).filter(([e])=>!YP.has(e)&&!jm.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=tt(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=[Vl(s),...o].map(tt).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),OE=/^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,QP=new Set(["changed","change","changes","updated","modified","happened","occurred"]);eM=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);rM=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,iM=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,aM=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,cM=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,PE=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),lM=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,uM=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,dM=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,fM=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,pM=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,ME=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ms=/^(?:it|this|that)$/i,mM=/^(?:it|them|this|that|in|on|of|to|at)$/i,FE=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,DE=/^(?:you|i|they|he|she|we)\b/i,zE=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Bl(e)} is ${t}".`,replace:!0}),hM=/^(?: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;bM=/inherit|supertype|subclass|extend|specializ/i,wM=8;uQ=new RegExp(`\\b(?:${[...$m].join("|")})\\b`,"i"),aS=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,$M=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,vM=/^(?: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;dQ=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Qe).join("|")})$`,"i"),pm="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",ym="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",xM=`(?:\\s+${ym})?`,fQ=[new RegExp(`^${pm}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${xM}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${pm}architecture\\s+(?:${ym}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${pm}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${ym}(?:\\s+here)?\\??$`,"i")],pQ={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:Tn.contains,subclasses:Tn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:Tn.calls,callees:Tn.calls,tests:Tn.tests,untested:Tn.tests,history:Tn.touches,exports:Tn.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"},lS="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",mQ=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+${lS}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),hQ=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${lS}\\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"),gQ=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"),bQ=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"),wQ=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"),Hl="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",yQ=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Hl}\\s*\\??$`,"i"),$Q=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Hl}\\s*\\??$`,"i"),vQ=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Hl}\\s*\\??$`,"i"),xQ=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Hl}\\s*[.!]*$`,"i"),EM=Object.freeze([...$m].filter(e=>e!=="here").concat("they")),EQ=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${EM.join("|")})\\b(\\s+\\S.*)?$`,"i"),SQ=ne(".tmct","memory","corpus-seed.json")});Xi();Ke();Vn();fl();var ql={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 fS=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"}),Ho=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Kl=e=>fS[e]||"other",jM=e=>Math.max(0,Math.min(1,e));function uS(e){let t=(e.sourceTypes||[]).map(n=>gs[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:gs.entailed}function kM(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function dS(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function pS(e,t,n={},s={}){let o={...ql,...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(Kl(v.predicate)==="isa"){let j=dS(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=>Kl(v.predicate)==="isa").map(v=>v.object),d=dl(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let v of d.clusters){let j=0;for(let E of v.objects){p.set(E,v.label);let S=l.find(A=>A.object===E&&Kl(A.predicate)==="isa");j+=S?uS(S):0}f.set(v.label,j)}let m=null,h=-1;for(let[v,j]of[...f].sort((E,S)=>E[0].localeCompare(S[0])))j>h&&(h=j,m=v);let g=[];for(let v of l){let j=Kl(v.predicate),E=uS(v),S={provenance:E};if(kM(v)&&(E-=o.entailedDepthPenalty,S.entailed=!0),j==="isa"){let w=.6+.4*(1-dS(v.object,n));E*=w,S.informativeness=w;let T=p.get(v.object);m&&T&&T!==m&&(E-=o.minoritySensePenalty,S.minoritySense=T)}E=jM(E),g.push({row:v,family:j,score:E,reasons:S})}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 $=new Map;for(let v of b)$.has(v.family)||$.set(v.family,[]),$.get(v.family).push(v);for(let v of $.values())v.sort((j,E)=>E.score-j.score||j.row.object.localeCompare(E.row.object));let y=Ho.filter(v=>$.has(v)).concat([...$.keys()].filter(v=>!Ho.includes(v)).sort()),x=[],C=!1;for(;x.length<r&&!C;){C=!0;for(let v of y){let j=$.get(v);if(j&&j.length&&(x.push(j.shift()),C=!1,x.length>=r))break}}for(let v of y)for(let j of $.get(v)||[])a.push({row:j.row,family:j.family,reason:"over-budget",score:j.score});return x.sort((v,j)=>{let E=Ho.indexOf(v.family),S=Ho.indexOf(j.family);return E-S||j.score-v.score||v.row.object.localeCompare(j.row.object)}),{term:e,selected:x,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}Ua();ot();var RM=new Set(["isa","location","partOf","capableOf","usedFor"]),_M=new Set(["single","several","chained","group","closer"]),mS=(e,t)=>`${e}:${t}`;function km(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!RM.has(n.family)||typeof n.form!="string"||!_M.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=mS(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 qo=e=>`${ur(e)} ${e}`;function TM(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=qo(t[0]),s=t.slice(1);return s.length?`${n}, and so ${ci(s.map(qo))}`:n}function AM(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:dr(o),A_TERM:qo(o),A_TERM_CAP:dr(qo(o)),TERMS:za(o),TERMS_CAP:dr(za(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?qo(a):"",OBJECT:i,A_OBJECT:i?qo(i):"",OBJECTS_A:ci(r.map(qo)),OBJECTS_PLURAL:ci(r.map(za)),OBJECTS_RAW:ci(r),CHAIN:TM(n&&n.length?n:r.slice(0,1))}}function CM(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 Fs(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(mS(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=Qa(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(p=>p.object),f=CM(c[u],AM(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}Ua();var IM=Ho.filter(e=>e!=="isa"&&e!=="other");function OM(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 hS(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 NM(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 LM(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 PM(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=Fs(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=Fs(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=Fs(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 NM(a,t))for(let p of hS(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?Fs(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):Fs(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=LM(t,e,o.closerRootCount);if(u.length){let f=Fs(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 MM(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=dr(`${ur(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function FM(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 gS(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...ql,...n.config||{}},a=OM(e?.selected||[]),c=[];for(let u of PM(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of IM){let d=a.get(u);if(!(!d||!d.length))for(let f of hS(d,i.maxObjectsPerBodySentence)){let p=Fs(t,u,f,{term:s});p&&c.push({...p,role:"describes",paragraph:"description"})}}MM(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:FM(c,o),provenanceRows:[...l.values()]}}var DM=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function zM(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 UM=Object.freeze({facts:"show the facts",chains:"show the chains"});function BM(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:UM,facts:n.map(DM),factCount:n.length,chains:s}}function bS(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:zM(t?.provenanceRows||[]),detail:BM(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function wS(e,t,n={},s=new Map,o={}){let r=pS(e,t,n,o),i=gS(r,s,o);return bS(r,i,o)}fl();Yi();var yS=new Set(["rdfs:subClassOf","rdf:type"]);function $S(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(yS.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 vS(e,t,n=6){let s=Ji(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=ul(r,s,{cap:n,stopAt:cl});i.length>1&&(o[r]=i)}return o}function xS(e){let t=[],n=new Set;for(let s of e||[])!s||!yS.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Ke();Xi();function WM(e,t,n,s,o={}){let r=km(s||[]);if(!r||r.size===0)return null;let i=t||[],a=$S(n||i),c=vS(a.subClassEdges,xS(i));return wS(e,i,a,r,{...o,chains:c})}function ES(e,t,n,s={}){let o=ht(e||{individuals:[],objectProperties:[]}),r=X(H,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=WM(t,i,o,n,s);return GM(a)}function GM(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 VM="no session is open on this page yet \u2014 await tmct.open() first",SS=Symbol.for("tmct.surface.fallback");function jS({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[SS])return a;let c=null,l=()=>{if(!c)throw new Error(VM);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[SS]=r,i.tmct=u,u}function HM({payload:e=null}={}){let t=Li();return e&&(t.payload=e),{memoryDir:t}}async function qM(e,t,n){let s=null;try{s=await oS(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await iS(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}}jS({open:HM,ask:qM,page:{normFactTerm:H,digestTermFromPayloadBrowser:ES},fallback:!0});})();
231
+ `)}${Z}`,replace:!0,...G.length?{pending:{items:G.map(re=>re.trim()),noun:"facts"}}:{}}}let L=n?.parsed?.shape==="meta"?n.parsed.object:null,B=!1,V=null,K=l.match(iM);if(K)V=K[1]?K[1].trim():null,L=K[2],B=!0;else if(!L&&!n?.parsed){let F=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);F&&(L=F[1])}if(!L)return null;let Y=X(c,L),_=rt(f.filter(F=>Y.has(F.subject)),i),P=rt(f.filter(F=>Y.has(F.object)),i),W=B?_.length?_:P:P.length?P:_;if(!W.length)return null;if(V&&W===_){let F=X(c,V),z=D=>f.find(U=>U.subject===D.object&&F.has(U.object)),N=W.map(D=>({hit:D,bridge:z(D)})).find(({bridge:D})=>D);if(N)return{text:`${oe(N.hit)} \u2014 ${oe(N.bridge)}`,replace:!0}}return m(W)}function fm(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function lS(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(bE(),gE));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(Ai(),of)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function BE(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var $m,U1,Tn,Ml,wE,WE,f9,B1,p9,yE,W1,m9,GE,VE,HE,G1,$E,h9,g9,b9,w9,y9,xm,$9,V1,Ye,sm,om,Go,H1,qE,q1,Wo,v9,x9,E9,S9,j9,k9,R9,_9,T9,A9,C9,I9,O9,N9,L9,P9,M9,F9,vE,X1,Gl,J1,D9,z9,Sm,KE,U9,B9,W9,G9,Q1,V9,am,cm,Z1,H9,eP,tP,lm,nP,oP,q9,YE,XE,rP,K9,Y9,JE,X9,J9,Q9,iP,Z9,aP,Vr,eQ,tQ,nQ,QE,sQ,oQ,cP,rQ,iQ,aQ,cQ,xE,SE,jm,Zt,uP,fP,pP,Dl,wP,tS,lQ,hm,nS,yP,$P,Wl,vP,xP,co,us,EP,SP,jP,bm,TE,kP,je,_P,TP,AP,CP,IP,OP,NP,LP,PP,MP,FP,DP,zP,UP,BP,CE,oS,GP,VP,qP,KP,YP,XP,JP,NE,QP,eM,rM,iM,aM,cM,ME,lM,uM,dM,fM,pM,FE,Ms,mM,DE,zE,UE,hM,bM,wM,uQ,cS,$M,vM,dQ,pm,ym,xM,fQ,pQ,uS,mQ,hQ,gQ,bQ,wQ,Hl,yQ,$Q,vQ,xQ,EM,EQ,SQ,Xi=M(()=>{Xe();F$();Kt();Me();qn();qf();Wc();Gc();Zr();Vc();q$();Ke();oc();Kc();Jc();Bn();$n();lr();Ma();Gf();Vf();ir();os();Ou();Mr();cv();fv();hv();ip();gv();up();dp();kv();Rv();_v();fl();Yi();Dc();Ur();mx();bx();ro();Bx();Fa(void 0);Pa(Bc);$m=new Set(["it","this","that","here"]),U1=e=>$m.has(String(e||"").trim().toLowerCase()),Tn={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"},Ml=e=>e?`${String(e).toLowerCase()}(s)`:"entities",wE="look up a taught fact about a subject/verb/object";WE={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}},f9=new Set(["stats","memory","focus",...Object.keys(WE)]),B1=new Set(["have","has","holds","hold"]),p9=new RegExp(`\\b(?:${[...Object.keys(pe),...Object.keys(Us)].filter(e=>!B1.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),yE=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,W1=(e,t)=>{let n=yE(e),s=yE(t);return n<s?-1:n>s?1:0},m9=new Set([...M$.map(e=>e.name),...Object.values(WE).map(e=>e.tool)]),GE=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"]),VE=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"]),HE=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"]),G1=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),$E=e=>e.replace(/(.)\1+/g,"$1");h9=vm(GE),g9=vm(VE),b9=vm(HE),w9=new RegExp(`^(?:${[...G1].map(tt).join("|")})\\s+(.+)$`,"i"),y9=[...GE,...VE,...HE,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],xm="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",$9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${xm})\\s+than\\s+(.+)$`,"i"),V1=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${xm})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ye="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",sm="mgx:ownedBy",om="mgx:hasProperty",Go="rdfs:subClassOf",H1="rdf:type",qE="rdfs:subPropertyOf",q1=new Set(["operator","teach","entailed"]),Wo=e=>!!e.sourceTypes?.some(t=>q1.has(t));v9=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),x9=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),E9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),S9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${xm})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),j9=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),k9=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\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");R9=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),_9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),T9=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),A9=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),C9=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),I9=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),O9=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)$`,"i"),N9=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+(?:${Ye})\\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"),L9=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+(?:${Ye})\\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"),P9=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+(?:${Ye})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),M9=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ye})\\s+(.+?)[?.!\\s]*$`,"i"),F9=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ye}))?[?.!\\s]*$`,"i"),vE=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,X1=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"]);Gl="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",J1="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",D9=new RegExp(`^(.+?)\\s+(${J1})\\s+(.+)$`,"i"),z9=new RegExp(`^([\\w'-]+)\\s+${Gl}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Sm="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",KE="with|to|from|by|of|in|on|for|as|about|into",U9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Gl}(${Sm})\\s+(${KE})\\s+(.+)$`,"i"),B9=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Sm})\\s+(${KE})\\s+(.+)$`,"i"),W9=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),G9=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),Q1="(?:just\\s+)?(?:one|another)\\s+more|another",V9=new RegExp(`^(?:${Q1})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),am=/^(?:is|are|am|owns|maintains)$/i,cm=/\b(?:is|are|am|owns|maintains)\b/i,Z1=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"),H9=new RegExp(`^(?:${go.filter(e=>!/\s/.test(e)).join("|")})$`,"i");eP=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Gl}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),tP=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Gl}([a-z]+(?:\\s+(?:${Ye}))?)[?.!\\s]*$`,"i"),lm=/^(?:be|own|maintain)$/i,nP=new RegExp(`^(${Ye})\\s+(.+)$`,"i");oP=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],q9=new RegExp(`^(?:${oP.join("|")})\\b\\s*,?\\s+`,"i"),YE=Object.freeze(["you","i","it","they","he","she","we"]),XE=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),rP=Object.freeze([...XE,...YE]),K9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${rP.join("|")})\\s+\\S+`,"i"),Y9=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${YE.join("|")})\\s+(?:is|are|am|was|were)|(${XE.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),JE="forget|unlearn|delete|remove",X9=new RegExp(`^(?:${JE})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),J9=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),Q9=new RegExp(`^(?:${JE})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),iP="collection|set|group|family",Z9=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${iP})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),aP=Object.freeze(["mgx:memberOf","mgx:partOf"]),Vr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",eQ=new RegExp(`^what\\s+does\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),tQ=new RegExp(`^what\\s+(.+?)${Vr}\\s+does${Vr}\\??$`,"i"),nQ=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${Vr}\\s+do${Vr}\\??$`,"i"),QE="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",sQ=new RegExp(`^who\\s+(?:is|was)\\s+${QE}$`,"i"),oQ=new RegExp(`^what\\s+(?:did|has)\\s+${QE}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),cP="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",rQ=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${cP}\\b`,"i"),iQ=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"),aQ=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});cQ=new Set([...Object.keys(pe).flatMap(e=>e.split(/[\s-]+/)),...dn,...Cn,"owns","maintains"].filter(e=>e.length>=3)),xE=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"]);SE=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),jm=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Zt=e=>`${e.subject} ${ZE(e.predicate)} ${e.object}`;uP=Object.entries(Ps).filter(([e])=>!jm.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);fP=/ \(source: [^)]*\)$/;pP=8;Dl=null;wP=/^(?:every|each|all|any)\s+/i;tS=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"]),lQ=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("|"))),hm=/^(?: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,nS=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,yP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,$P=/^(who|what)'?s\s+/i,Wl=e=>String(e).replace($P,(t,n)=>`${n} is `),vP=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;xP=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,co=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,us=new Set(["rdfs:subClassOf","rdf:type"]),EP=6,SP=/^why\s+(?=(?:is|are)\b)/i,jP=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;bm=new Set(["kind","sort","type","subclass","superclass"]),TE=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,kP=/^(?: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,je=32;_P=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,TP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,AP=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,CP=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,IP=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,OP=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,NP=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,LP=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,PP=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ye})\\s+(.+?)\\s*[?.!]*$`,"i"),MP=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,FP=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,DP=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,zP=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,UP=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,BP=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;CE=e=>String(e||"").replace(/\s+/g," ").trim();oS="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",GP=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${oS})[?.!\\s]*$`,"i"),VP=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${oS})\\s+([\\w'-]+)[?.!\\s]*$`,"i");qP=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),KP=Object.entries(Ps).filter(([e])=>!qP.has(e)&&!jm.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${tt(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),YP=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),XP=new Set(["mgx:partOf","mgx:memberOf"]),JP=Object.entries(Ps).filter(([e])=>!YP.has(e)&&!jm.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=tt(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=[Vl(s),...o].map(tt).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),NE=/^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,QP=new Set(["changed","change","changes","updated","modified","happened","occurred"]);eM=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);rM=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,iM=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,aM=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,cM=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,ME=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),lM=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,uM=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,dM=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,fM=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,pM=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,FE=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ms=/^(?:it|this|that)$/i,mM=/^(?:it|them|this|that|in|on|of|to|at)$/i,DE=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,zE=/^(?:you|i|they|he|she|we)\b/i,UE=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Bl(e)} is ${t}".`,replace:!0}),hM=/^(?: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;bM=/inherit|supertype|subclass|extend|specializ/i,wM=8;uQ=new RegExp(`\\b(?:${[...$m].join("|")})\\b`,"i"),cS=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,$M=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,vM=/^(?: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;dQ=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Qe).join("|")})$`,"i"),pm="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",ym="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",xM=`(?:\\s+${ym})?`,fQ=[new RegExp(`^${pm}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${xM}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${pm}architecture\\s+(?:${ym}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${pm}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${ym}(?:\\s+here)?\\??$`,"i")],pQ={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:Tn.contains,subclasses:Tn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:Tn.calls,callees:Tn.calls,tests:Tn.tests,untested:Tn.tests,history:Tn.touches,exports:Tn.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"},uS="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",mQ=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+${uS}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),hQ=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${uS}\\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"),gQ=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"),bQ=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"),wQ=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"),Hl="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",yQ=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Hl}\\s*\\??$`,"i"),$Q=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Hl}\\s*\\??$`,"i"),vQ=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Hl}\\s*\\??$`,"i"),xQ=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Hl}\\s*[.!]*$`,"i"),EM=Object.freeze([...$m].filter(e=>e!=="here").concat("they")),EQ=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${EM.join("|")})\\b(\\s+\\S.*)?$`,"i"),SQ=ne(".tmct","memory","corpus-seed.json")});Xi();Ke();Vn();fl();var ql={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 pS=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"}),Ho=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Kl=e=>pS[e]||"other",jM=e=>Math.max(0,Math.min(1,e));function dS(e){let t=(e.sourceTypes||[]).map(n=>gs[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:gs.entailed}function kM(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function fS(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function mS(e,t,n={},s={}){let o={...ql,...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(Kl(v.predicate)==="isa"){let j=fS(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=>Kl(v.predicate)==="isa").map(v=>v.object),d=dl(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let v of d.clusters){let j=0;for(let E of v.objects){p.set(E,v.label);let S=l.find(A=>A.object===E&&Kl(A.predicate)==="isa");j+=S?dS(S):0}f.set(v.label,j)}let m=null,h=-1;for(let[v,j]of[...f].sort((E,S)=>E[0].localeCompare(S[0])))j>h&&(h=j,m=v);let g=[];for(let v of l){let j=Kl(v.predicate),E=dS(v),S={provenance:E};if(kM(v)&&(E-=o.entailedDepthPenalty,S.entailed=!0),j==="isa"){let w=.6+.4*(1-fS(v.object,n));E*=w,S.informativeness=w;let T=p.get(v.object);m&&T&&T!==m&&(E-=o.minoritySensePenalty,S.minoritySense=T)}E=jM(E),g.push({row:v,family:j,score:E,reasons:S})}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 $=new Map;for(let v of b)$.has(v.family)||$.set(v.family,[]),$.get(v.family).push(v);for(let v of $.values())v.sort((j,E)=>E.score-j.score||j.row.object.localeCompare(E.row.object));let y=Ho.filter(v=>$.has(v)).concat([...$.keys()].filter(v=>!Ho.includes(v)).sort()),x=[],C=!1;for(;x.length<r&&!C;){C=!0;for(let v of y){let j=$.get(v);if(j&&j.length&&(x.push(j.shift()),C=!1,x.length>=r))break}}for(let v of y)for(let j of $.get(v)||[])a.push({row:j.row,family:j.family,reason:"over-budget",score:j.score});return x.sort((v,j)=>{let E=Ho.indexOf(v.family),S=Ho.indexOf(j.family);return E-S||j.score-v.score||v.row.object.localeCompare(j.row.object)}),{term:e,selected:x,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}Ua();ot();var RM=new Set(["isa","location","partOf","capableOf","usedFor"]),_M=new Set(["single","several","chained","group","closer"]),hS=(e,t)=>`${e}:${t}`;function km(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!RM.has(n.family)||typeof n.form!="string"||!_M.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=hS(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 qo=e=>`${ur(e)} ${e}`;function TM(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=qo(t[0]),s=t.slice(1);return s.length?`${n}, and so ${ci(s.map(qo))}`:n}function AM(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:dr(o),A_TERM:qo(o),A_TERM_CAP:dr(qo(o)),TERMS:za(o),TERMS_CAP:dr(za(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?qo(a):"",OBJECT:i,A_OBJECT:i?qo(i):"",OBJECTS_A:ci(r.map(qo)),OBJECTS_PLURAL:ci(r.map(za)),OBJECTS_RAW:ci(r),CHAIN:TM(n&&n.length?n:r.slice(0,1))}}function CM(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 Fs(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(hS(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=Qa(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(p=>p.object),f=CM(c[u],AM(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}Ua();var IM=Ho.filter(e=>e!=="isa"&&e!=="other");function OM(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 gS(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 NM(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 LM(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 PM(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=Fs(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=Fs(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=Fs(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 NM(a,t))for(let p of gS(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?Fs(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):Fs(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=LM(t,e,o.closerRootCount);if(u.length){let f=Fs(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 MM(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=dr(`${ur(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function FM(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 bS(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...ql,...n.config||{}},a=OM(e?.selected||[]),c=[];for(let u of PM(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of IM){let d=a.get(u);if(!(!d||!d.length))for(let f of gS(d,i.maxObjectsPerBodySentence)){let p=Fs(t,u,f,{term:s});p&&c.push({...p,role:"describes",paragraph:"description"})}}MM(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:FM(c,o),provenanceRows:[...l.values()]}}var DM=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function zM(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 UM=Object.freeze({facts:"show the facts",chains:"show the chains"});function BM(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:UM,facts:n.map(DM),factCount:n.length,chains:s}}function wS(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:zM(t?.provenanceRows||[]),detail:BM(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function yS(e,t,n={},s=new Map,o={}){let r=mS(e,t,n,o),i=bS(r,s,o);return wS(r,i,o)}fl();Yi();var $S=new Set(["rdfs:subClassOf","rdf:type"]);function vS(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||($S.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 xS(e,t,n=6){let s=Ji(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=ul(r,s,{cap:n,stopAt:cl});i.length>1&&(o[r]=i)}return o}function ES(e){let t=[],n=new Set;for(let s of e||[])!s||!$S.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Ke();Xi();function WM(e,t,n,s,o={}){let r=km(s||[]);if(!r||r.size===0)return null;let i=t||[],a=vS(n||i),c=xS(a.subClassEdges,ES(i));return yS(e,i,a,r,{...o,chains:c})}function SS(e,t,n,s={}){let o=ht(e||{individuals:[],objectProperties:[]}),r=X(H,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=WM(t,i,o,n,s);return GM(a)}function GM(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 VM="no session is open on this page yet \u2014 await tmct.open() first",jS=Symbol.for("tmct.surface.fallback");function kS({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[jS])return a;let c=null,l=()=>{if(!c)throw new Error(VM);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[jS]=r,i.tmct=u,u}function HM({payload:e=null}={}){let t=Li();return e&&(t.payload=e),{memoryDir:t}}async function qM(e,t,n){let s=null;try{s=await rS(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await aS(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}}kS({open:HM,ask:qM,page:{normFactTerm:H,digestTermFromPayloadBrowser:SS},fallback:!0});})();