@polycode-projects/the-mechanical-code-talker 5.0.16 → 5.0.18

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,41 +1,41 @@
1
- (()=>{var _x=Object.defineProperty;var O=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Wt=(e,t)=>{for(var n in t)_x(e,n,{get:t[n],enumerable:!0})};var ct,UN,BN,WN,GN,VN,HN,qN,KN,YN,XN,JN,QN,ZN,e0,t0,n0,Z,he,Nt,Hc,sf,s0,o0,r0,Ue=O(()=>{ct=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},UN=ct("createRequire"),BN=ct("readFileSync"),WN=ct("access"),GN=ct("readFile"),VN=ct("writeFile"),HN=ct("appendFile"),qN=ct("mkdir"),KN=ct("mkdtemp"),YN=ct("rename"),XN=ct("unlink"),JN=ct("rm"),QN=ct("stat"),ZN=ct("copyFile"),e0=ct("readdir"),t0=ct("createReadStream"),n0=ct("createWriteStream"),Z=(...e)=>e.join("/"),he=e=>String(e).replace(/\/[^/]*$/,""),Nt=(...e)=>e.join("/"),Hc=e=>String(e).startsWith("/"),sf="/",s0=ct("randomBytes"),o0=ct("spawnSync"),r0=ct("createInterface")});var lt,a0,c0,qc,_e,Er,Rx,An,Tx,Ii,Kc,Ax,Ix,l0,Cx,u0,d0,p0,f0,h0,Rt=O(()=>{lt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},a0=lt("createRequire"),c0=lt("readFileSync"),qc=lt("access"),_e=lt("readFile"),Er=lt("writeFile"),Rx=lt("appendFile"),An=lt("mkdir"),Tx=lt("mkdtemp"),Ii=lt("rename"),Kc=lt("unlink"),Ax=lt("rm"),Ix=lt("stat"),l0=lt("copyFile"),Cx=lt("readdir"),u0=lt("createReadStream"),d0=lt("createWriteStream"),p0=lt("randomBytes"),f0=lt("spawnSync"),h0=lt("createInterface")});function To(e){let t=Lx.exec(String(e||""));return t?t[1].toLowerCase():null}function Ci(e){return String(e||"").replace(Nx,"$1")}function vs(e){return e.replace(Px,"").trim()}function nn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(Fx,"").trim();if(s=s.replace(zx,"").trim(),s===t)break;t=s}return t}var of,Sr,Ys,rf,af,Ox,Lx,kr,tn,Yc,Nx,$n,Xc,Px,Mx,Fx,Dx,zx,de,jr,Oi,Ux,cf,We,sn,xs,lf,Jc,Qc,Zc,uf,_r,Xs,df,pf,Js,Xn,Jn,Ao,Je,ff,Qs,Zs,Es,In,hf,Rr,Io,Li,Co,mf,Qn=O(()=>{of=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],Sr={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",...of]},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"]}},Ys=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"})}),rf=Object.freeze(Object.fromEntries(Object.entries(Ys).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),af=Object.freeze(Object.values(Ys).map(e=>e.predicate)),Ox=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),Lx=new RegExp(`^mgx:[a-z]+-(${Ox.join("|")})$`,"i");kr=Object.freeze([...of,"is the superclass of","are the superclass of","is the parent class of"]),tn=Object.freeze(["defined","declared","located","implemented"]),Yc=Object.freeze(["now","currently","right now","at the moment","these days","today"]),Nx=new RegExp(`\\s+(?:${[...Yc].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");$n=Object.freeze(["mentioned","referenced"]),Xc=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),Px=new RegExp(`\\s+(?:${Xc.join("|")})\\s*[?.!]*$`,"i");Mx=Object.freeze(["then","though","too"]),Fx=new RegExp(`\\s+(?:${Mx.join("|")})\\s*[?.!]*$`,"i"),Dx=Object.freeze(["please explain","explain"]),zx=new RegExp(`,\\s*(?:${Dx.join("|")})\\s*[?.!]*$`,"i");de=Object.freeze(Object.fromEntries(Object.entries(Sr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),jr=Object.freeze(new Set(["has","have","holds","hold"])),Oi=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),Ux=e=>!kr.includes(e),cf=Object.freeze([...new Set(Object.keys(de).filter(Ux).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),We=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"}),sn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),xs=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"}),lf=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"}}),Jc=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"}),Qc=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"}),Zc=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"}),uf=/\b([a-z]{3,})in'/gi,_r=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"]),Xs=Object.freeze(["this","it","that","here","this one","that one"]),df=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]}`}]),pf=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`}]),Js=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),Xn=Object.freeze(["that","which","who"]),Jn=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Ao=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"}),Je=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}}),ff=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),Qs=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"]),Zs=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"]),Es=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"}),In=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"}}),hf=Object.freeze({tests:"Module",test:"Module"}),Rr=Object.freeze(["those","them","these"]),Io=Object.freeze(["contains","defines"]),Li=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"]),Co=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),mf=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 Ge,Oo,el=O(()=>{Ge="#000000",Oo=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Ge}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Ge}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Ge}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Ge}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Ge}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Ge}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Ge}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Ge}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Ge}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Ge}" 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="${Ge}" 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="${Ge}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var Bx,dn,gf,bf,tl,wf,$0,v0,yf=O(()=>{Qn();el();Bx=()=>Object.keys(Oo).sort(),dn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),gf=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),bf=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),tl=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:tn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:dn("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:dn("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:gf("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:bf("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:bf("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:Bx(),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:gf("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:dn("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:dn("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:dn("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:dn("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:dn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:dn("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:dn("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:dn("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:dn("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:dn("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}}]),wf=tl.filter(e=>e.tier==="hot"),$0=tl.filter(e=>e.tier==="cold"),v0=Object.freeze(tl.map(e=>e.name))});var $f,Re,Gt=O(()=>{Ue();$f=Z(".tmct","graph.json"),Re=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function Wx(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 vf(e){let t=(Array.isArray(e)?e:[]).map((l,c)=>({file:l?.file,payload:l?.payload||{},name:l?.name!=null&&String(l.name).length?String(l.name):String(c)})),n=t.map(({payload:l})=>Wx(l)),s=new Map;for(let l of n)for(let c of l)s.set(c,(s.get(c)||0)+1);let o=new Set([...s.entries()].filter(([,l])=>l>1).map(([l])=>l)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:l,name:c}of t){a=a&&!!l.bootstrap,typeof l.generated_at=="string"&&l.generated_at>i&&(i=l.generated_at);let u=f=>o.has(f)?`${c}/${f}`:f;Array.isArray(l.classes)&&r.classes.push(...l.classes),Array.isArray(l.vocabulary)&&r.vocabulary.push(...l.vocabulary);for(let f of Array.isArray(l.individuals)?l.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(h=>u(h))),Array.isArray(p.mentions)&&(p.mentions=p.mentions.map(h=>h&&h.id?{...h,id:u(h.id)}:h)),r.individuals.push(p)}for(let f of Array.isArray(l.objectProperties)?l.objectProperties:[]){if(!f)continue;let p={...f};Array.isArray(p.examples)&&(p.examples=p.examples.map(h=>{if(!h)return h;let m={...h};return m.subject&&(m.subject=u(m.subject)),m.object&&(m.object=u(m.object)),m})),r.objectProperties.push(p)}let d=l.proseIndex&&typeof l.proseIndex=="object"?l.proseIndex:{};for(let[f,p]of Object.entries(d)){let h=r.proseIndex[f]||(r.proseIndex[f]=[]);for(let m of Array.isArray(p)?p:[]){let b=u(m);h.includes(b)||h.push(b)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var xf=O(()=>{});var No={};Wt(No,{clearCache:()=>Gx,emptyEntities:()=>nl,fetchEntities:()=>Kx,registerProvider:()=>Vx});function Gx(){Lo=null,Tr=null}function Vx(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Ni;return Ni=e??null,Lo=null,t}function nl(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function Hx(e){let t;try{t=await _e(e,"utf8")}catch(n){if(n?.code==="ENOENT")return nl();throw new Re(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Re(`graph artifact ${e} is not valid JSON`)}}async function qx(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(Tr&&Tr.key===n)return Tr.payload;let s=[];for(let r=0;r<t.length;r++){let i=await Hx(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=vf(s);return Tr={key:n,payload:o},o}async function Kx(e){if(Ni){let s;try{s=await Ni(e)}catch(o){throw o instanceof Re?o:new Re(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Re("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return qx(e);if(Lo&&Lo.file===e.graphFile)return Lo.payload;let t;try{t=await _e(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return nl();throw new Re(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Re(`graph artifact ${e.graphFile} is not valid JSON`)}return Lo={file:e.graphFile,payload:n},n}var Lo,Tr,Ni,Ar=O(()=>{Rt();Gt();xf();Lo=null,Tr=null,Ni=null});function Cn(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<=Ef)}function sl(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>Ef||Yx.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=Xx))break;return t}function Pi({name:e,doc:t}={}){return[...new Set([...Cn(e),...sl(t)])].sort()}function Sf(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 eo(e,t,{limit:n=10}={}){let s=[...new Set([...Cn(t),...sl(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function kf(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let l of Object.keys(s)){let c=s[l];if(!c||typeof c!="object")continue;let u=c[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let f of d)i.add(f);a.add(l)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var Yx,Ef,Xx,Ss=O(()=>{Yx=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+/)),Ef=40,Xx=120});function jf(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 Jx(e){if(!e.startsWith(Rf))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(_f);if(o<0)return null;let r=n.slice(o+_f.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Rf.length,o),createdAt:s}:null}function Zn(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:Zx(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",...jf(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=Jx(s);return o||{kind:"teach",...jf(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}: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 Of(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Af;let n=Number(t);return Number.isFinite(n)?Math.max(ol,Math.min(Cf,n)):Af}function Lf(e,t=Date.now(),n=eE){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Tf+(1-Tf)*Math.pow(.5,o/n)}function Nf(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 h=t[p],m=tE(h);if(!m)continue;i.push(m);let b=(to[m]??0)*Of(h);a.push(Math.max(0,Math.min(1,b)))}let l=0,c=1;for(let p of a)c*=1-p;if(a.length&&(l=Math.min(1,1-c)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let p=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;l=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*p))}let u=Lf(e?.createdAt,s,n.halfLifeMs),d=Po(Math.min(1,l*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Po(u)};return{score:d,inputs:f}}function Fi(e,t){let n=(to[e]??0)*Of(t);return Po(Math.max(0,Math.min(1,n)))}function nE(e){if(e==="operator")return 1;let t=to[e];return t===void 0?1:(t+1)/2}function Di(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let l=Lf(a?.assertedAt,n,t.halfLifeMs),c=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,c*l)),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:c,recency:Po(l)})}let i=1;for(let[a,l]of o){let c=Math.max(nE(a),l.strongest);i*=1-Math.min(1-l.complement,c)}return{score:s.length?Po(Math.min(1,1-i)):0,inputs:r}}function Pf(e){return Di(e,{halfLifeMs:sE})}function Mf({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+oE),i=(o*r+1)/2;return Po(ol+(Cf-ol)*i)}var Mo,Mi,Qe,ks,_f,Rf,Qx,Zx,to,rl,If,eE,Tf,ol,Cf,Af,Po,tE,sE,oE,es=O(()=>{Mo="mgx:trustScore",Mi="mgx:trustInputs",Qe="mgx:createdAt",ks="mgx:updatedAt";_f="#node:",Rf="peer:";Qx="wikipedia-live",Zx=e=>e===Qx?"referenceLive":"reference";to=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),rl=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"}}),If=new Set(Object.entries(rl).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),eE=720*60*60*1e3,Tf=.9,ol=.5,Cf=1.5,Af=1,Po=(e,t=6)=>Number(e.toFixed(t)),tE=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";sE=1/0;oE=19});var no,il=O(()=>{no=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function al(e,t){return Math.log(1+e/(1+t))}var Ir=O(()=>{});var Ui={};Wt(Ui,{bfsLevels:()=>zi,findActionPath:()=>cl,findReachableSet:()=>ll});function Ff(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function Df(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 cl(e,t,n,{maxDepth:s=50,stateKey:o=Ff}={}){if(t(e))return{actions:[],states:[e]};let r=Df(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let c of r)if(t(c.state))return{actions:c.actions,states:c.states};if(a===s)break;let l=[];for(let c of r){let u=o(c.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:f}of n(c.state)||[]){let p=o(f);i.has(p)||l.push({state:f,actions:[...c.actions,d],states:[...c.states,f]})}}}r=l}return null}function ll(e,t,{maxDepth:n=50,stateKey:s=Ff}={}){let o=Df(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let l=[];for(let c of o){let u=s(c.state);if(!r.has(u)&&(r.add(u),i.push({node:c.state,path:{actions:c.actions,states:c.states}}),a!==n))for(let{action:d,nextState:f}of t(c.state)||[]){let p=s(f);r.has(p)||l.push({state:f,actions:[...c.actions,d],states:[...c.states,f]})}}o=l}return i}function*zi(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],l=[];for(let c of r)for(let u of t(c)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),l.push(d))}r=l,yield a}}var so=O(()=>{});function Wi(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 Cr(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function os(e){let t=String(e?.prop||"").toLowerCase();if(zf[t])return zf[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":null}function ns(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function ul(e){let t=ns(e).split("/");return t[t.length-1]}function rE(e){return(e?.derived_from||[]).filter(Zf).length}function Uf(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+rE(e)}function on(e,t){let n=ns(t);if(!n)return{match:null,candidates:[]};let s=ul(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=ns(i.label),l=String(i.id||"").toLowerCase(),c=0;a===n||l===n?c=100:a.endsWith(`/${n}`)||o&&(ul(a)===s||ul(a).replace(/\.[a-z]+$/,"")===s)?c=80:a.includes(n)&&(c=Math.max(10,50-(a.length-n.length))),c>0&&r.push({ind:i,score:c})}return r.sort((i,a)=>a.score-i.score||Uf(a.ind)-Uf(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 Tt(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 iE(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 Bf(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function ss(e){let t=e||"Entity",n=Cn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function ut(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function gl(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(Zf);o.length&&s.push(`attestation: touched by ${o.length} commit(s)`);for(let l of t.attributes||[])s.push(`attribute: ${l.key} = ${l.value}${l.prop?` [${l.prop}]`:""}`);let{out:r,incoming:i}=iE(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:l,edges:c}of r)s.push(` ${Bf(l)} (${c.length}) \u2192 ${ut(c.map(u=>u.objectLabel||u.object),Wf)}`);for(let{group:l,edges:c}of i)s.push(` \u2190 ${Bf(l)} (${c.length}) by ${ut(c.map(u=>u.subjectLabel||u.subject),Wf)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${ut(a,aE)}`),n.length&&s.push(`other matches: ${n.map(l=>`${l.label} (${ss(l.class)})`).join(", ")}`),e.truncated.length&&s.push(cE(e)),s.join(`
2
- `)}function cE(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 Do(e,t,{maxDepth:n=8}={}){let s=new Map,o=new Map,r=(a,l,c,u)=>{!a||!l||a===l||(s.has(a)||s.set(a,[]),s.get(a).push({id:l,label:c,via:u}))};for(let a of e.relations){let l=os(a);if(l==="imports"||l==="calls")for(let c of a.edges)r(c.object,c.subject,c.subjectLabel||c.subject,a.predicate);else if(l==="callsSymbol")for(let c of a.edges){let u=ts(e,c.subject),d=ts(e,c.object);if(!u||!d)continue;let f=e.byId.get(u)?.label||u;r(d,u,f,a.predicate),u!==d&&r(c.object,u,f,a.predicate)}else if(l==="tests")for(let c of a.edges)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push(c.subjectLabel||c.subject)}let i=[];for(let a of zi(t.id,l=>s.get(l)||[],{maxDepth:n,keyOf:l=>l.id})){if(!a.length)continue;let l=a.map(c=>({...c,tests:o.get(c.id)||[]})).sort((c,u)=>String(c.label).localeCompare(String(u.label)));i.push(l)}return i}function eh(e,t,{maxDepth:n=8}={}){let s=Do(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,l)=>a+l.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,l)=>{if(l>=lE){o.push(`depth ${l+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(l===0?`depth 1 (${a.length} direct dependents):`:`depth ${l+1} (${a.length}):`);for(let c of a.slice(0,dl)){let u=c.tests.length?`tests: ${ut(c.tests,uE)}`:"tests: none recorded",d=l===0?`${c.via} it`:"reaches it through an intermediary";o.push(` - ${c.label} (${d}) \u2014 ${u}`)}a.length>dl&&o.push(` \u2026+${a.length-dl} more at depth ${l+1}`)});let i=e.truncated.filter(a=>{let l=os({predicate:a.predicate});return l==="imports"||l==="calls"||l==="callsSymbol"||l==="tests"});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 th(e){let t=new Map;for(let n of e.relations)if(os(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 Vf(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function ih(e,t,n=null){let s=n||(i=>ts(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 Se(e,i))r(s(a.subject),s(a.object));return o}function HE(e,t,n){if(t.length<2)return;let s=new Map(t.map(c=>[c.ind.id,c])),o=new Map(t.map(c=>[c.ind.id,c.score])),r=c=>{if(!c.size)return[[],[]];let u=0;for(let h of c.values())u=Math.max(u,h);let d=[...c.entries()].sort((h,m)=>m[1]-h[1]),f=[],p=[];for(let[h,m]of d)m>=u*PE&&f.length<n?f.push([h,m]):p.length<Gf&&p.push([h,m]);return[f,p]},[i,a]=r(new Map(t.map(c=>[c.ind.id,c.score]))),l=new Set(i.map(([c])=>c));for(let c=0;c<DE&&i.length;c++){let u=new Map,d=[];for(let f of zE){let p=ih(e,f),h=new Map;for(let[g,y]of i)for(let w of p.get(g)||[])o.has(w)&&h.set(w,Math.max(h.get(w)||0,y));let[m,b]=r(h);for(let[g,y]of m)u.set(g,Math.max(u.get(g)||0,y));d.push(...b)}a.push(...d);for(let[f,p]of u){if(l.has(f))continue;let h=s.get(f);h&&(h.score+=Math.min(p*ME,h.score*FE),l.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,Gf).filter(([f])=>!l.has(f)))}}function qE(e,t=[],{depth:n=sh,q:s=rh,nodeLimit:o=oh,kinds:r=UE,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:l=null,hubDegree:c=1/0}={}){let u=new Map(t.map(S=>[S.ind.id,S])),d=0;for(let S of t)d=Math.max(d,S.score);let f=t.length>0&&d>0,p=new Set(l??u.keys());if(!p.size)return[];let h=ih(e,r,a),m=S=>h.get(S)?.size||0,b=[],g=(S,R)=>S.hop!==R.hop?S.hop<R.hop:S.deg!==R.deg?S.deg<R.deg:S.id<R.id,y=(S,R)=>{let _=b[S];b[S]=b[R],b[R]=_},w=S=>{b.push(S);let R=b.length-1;for(;R>0;){let _=R-1>>1;if(g(b[R],b[_]))y(R,_),R=_;else break}},v=()=>{let S=b[0],R=b.pop();if(b.length){b[0]=R;let _=0;for(;;){let I=2*_+1,P=2*_+2,T=_;if(I<b.length&&g(b[I],b[T])&&(T=I),P<b.length&&g(b[P],b[T])&&(T=P),T===_)break;y(_,T),_=T}}return S},k=new Set(p);for(let S of p)w({id:S,hop:0,deg:m(S)});let $=null,x=0,E=[];for(;b.length&&x<o;){let S=v();if(E.push({id:S.id,hop:S.hop}),!p.has(S.id)){if(f){let I=d*BE*Math.pow(WE,S.hop-1),P=u.get(S.id);if(P)P.score+=Math.min(I*GE,P.score*VE);else{let T=e.byId?.get?.(S.id);if(T&&i(T)){$||($=th(e));let F=$.get(T.id)||[],U={ind:T,score:I,defineCount:F.length,matching:[],density:0};t.push(U),u.set(S.id,U)}}}x++}if(S.hop>=n||S.hop>0&&m(S.id)>c)continue;let R=[];for(let I of h.get(S.id)||[]){if(k.has(I))continue;let P=e.byId?.get?.(I);!P||!i(P)||R.push({id:I,deg:m(I)})}if(!R.length)continue;R.sort((I,P)=>I.deg-P.deg||(I.id<P.id?-1:I.id>P.id?1:0));let _=Math.max(1,Math.floor(s*R.length));for(let I=0;I<_;I++){let P=R[I];k.add(P.id),w({id:P.id,hop:S.hop+1,deg:P.deg})}}return E}function ah(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:l=!1,proseLayers:c=!1,literalMention:u=!1,rawQuery:d=""}=n,f=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,p=th(e),h=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let k=String(v.label),$=k.toLowerCase(),x=p.get(v.id)||[],E=new Set(x.map(_=>_.toLowerCase())),S=new Set;for(let _ of x)for(let I of Vf(_))S.add(I);let R=u?String((v.attributes||[]).find(_=>_.key==="dotted")?.value||"").toLowerCase():"";h.push({ind:v,label:k,labelLc:$,defines:x,symSet:E,symComps:S,dotted:R})}let m=h.length||1,b=new Map,g=v=>{let k=0;for(let $ of h)($.labelLc.includes(v)||$.symComps.has(v)||$.symSet.has(v))&&k++;return k},y=v=>(b.has(v)||b.set(v,al(m,g(v))),b.get(v));for(let v of t)y(v);let w=[];for(let v of h){let k=0,$=0,x=0,E=[];for(let P of t){let T=b.get(P)||0;T&&(v.symSet.has(P)?(k+=T*nh,x++):v.symComps.has(P)&&(E.push(T),x++),v.labelLc.includes(P)&&($+=T*pE))}E.sort((P,T)=>T-P);let S=0;for(let P=0;P<Math.min(E.length,hE);P++)S+=E[P]*fE;let R=k+$+S;if(!R)continue;s&&(no(v.labelLc)||wE(v.labelLc))?R*=bE:no(v.labelLc)&&(R*=.4);let _=v.defines.filter(P=>{let T=P.toLowerCase(),F=Vf(P);return t.some(U=>T===U||F.has(U))}),I=v.defines.length?x/v.defines.length:0;w.push({ind:v.ind,score:R,defineCount:v.defines.length,matching:_,density:I})}if(u&&d&&w.length){let v=String(d).toLowerCase(),k=S=>S!=null&&/[a-z0-9_./]/.test(S),$=S=>{for(let R=v.indexOf(S);R!==-1;R=v.indexOf(S,R+1))if(!k(v[R-1])&&!k(v[R+S.length]))return!0;return!1},x=new Map(h.map(S=>[S.ind.id,S])),E=0;for(let S of w)E=Math.max(E,S.score);for(let S of w){let R=x.get(S.ind.id);if(!R)continue;let _=0;for(let I of new Set([R.dotted,R.labelLc])){if(!I||I.split(/[./]+/).filter(Boolean).length<CE||!$(I))continue;let P=[...new Set(I.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((F,U)=>U-F),T=0;for(let F=0;F<Math.min(P.length,OE);F++)T+=P[F]*IE;_=Math.max(_,T)}_&&(S.score+=Math.min(_*LE,E*NE))}}if(w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of Se(e,"imports"))!v.has($.subject)&&!v.has($.object)||(k.has($.subject)||k.set($.subject,new Set),k.has($.object)||k.set($.object,new Set),k.get($.subject).add($.object),k.get($.object).add($.subject));for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*mE,$.score*gE)}}if(o&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of["calls","callsSymbol"])for(let x of Se(e,$)){let E=ts(e,x.subject),S=ts(e,x.object);!E||!S||E===S||!v.has(E)&&!v.has(S)||(k.has(E)||k.set(E,new Set),k.has(S)||k.set(S,new Set),k.get(E).add(S),k.get(S).add(E))}for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*yE,$.score*$E)}}if(r&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of e.individuals)($.class||"")==="Class"&&$.label&&k.set(String($.label),$);for(let $ of w){if(!EE($.ind.label))continue;let x=0;for(let E of Se(e,"inherits")){if(ts(e,E.subject)!==$.ind.id||!SE(E.objectLabel))continue;let R=ts(e,E.object);if(!R){let _=k.get(String(E.objectLabel||""));_&&(R=On(e,_))}R&&(x=Math.max(x,v.get(R)||0))}$.score+=Math.min(x*vE,$.score*xE)}}if(l&&w.length&&e.proseIndex){let v=eo(e.proseIndex,t.join(" "),{limit:_E});if(v.length){let k=new Map;for(let{id:$,score:x}of v){let E=ts(e,$);E&&k.set(E,(k.get(E)||0)+x)}for(let $ of w){let x=k.get($.ind.id)||0;x&&($.score+=Math.min(x*kE,$.score*jE))}}}if(c&&w.length&&e.proseIndex){let v=new Map(w.map(x=>[x.ind.id,x])),k=new Map(h.map(x=>[x.ind.id,x])),$=new Map;for(let x of new Set(t)){let E=b.get(x)||0;if(!E)continue;let{ids:S}=kf(e.proseIndex,x);if(!S.length)continue;let R=new Set;for(let _ of S){let I=ts(e,_);if(!I||R.has(I)||(R.add(I),!v.has(I)))continue;let P=k.get(I);P&&(P.symSet.has(x)||P.symComps.has(x)||P.labelLc.includes(x))||$.set(I,($.get(I)||0)+E*AE)}}for(let x of w){let E=$.get(x.ind.id)||0;E&&(x.score+=Math.min(E*RE,x.score*TE))}}return i&&w.length>1&&HE(e,w,f),a&&w.length&&qE(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:sh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:rh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:oh}),w.sort((v,k)=>k.score-v.score||k.density-v.density||v.defineCount-k.defineCount||String(v.ind.label).length-String(k.ind.label).length),w}function ch(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return ah(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function YE(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let l=0;l<e.length;l++){let c=e[l];if(c==="\\"){let u=e[l+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),l+=1,r="",i=!1;continue}if(o){c==="]"&&(o=!1,r="]",i=!1);continue}if(c==="["){o=!0,r="[",i=!1;continue}if(c==="?"&&(r==="("||i)){r="?",i=!1;continue}if(c==="*"||c==="+"||c==="?"){a(),r=c;continue}if(c==="{"){let u=e.indexOf("}",l),d=u===-1?"":e.slice(l+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),l=u,r="}";continue}r="{",i=!1;continue}r=c,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function bl(e,{now:t=Date.now}={}){let n=String(e);if(n.length>Hf)return{error:`name pattern is ${n.length} characters; the limit is ${Hf}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=YE(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>qf)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${qf}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(l){if(a===null)a=t()+Kf;else if(t()>a)throw new Bi(`name pattern "${n}" exceeded its ${Kf}ms matching budget.`);return i.test(String(l).slice(0,KE))}}}function lh(e,t,{limit:n=Gi,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),l=String(s||"").trim().toLowerCase(),c=String(o||"").trim().toLowerCase(),u=null;if(r){let h=bl(r);if(h.error)return h.error;u=h}if(l&&l!=="module")try{return eS(e,a,{limit:n,kind:l,decFilter:c,nameRe:u,toolNamePrefix:i})}catch(h){if(h instanceof Bi)return h.message;throw h}if(!a.length&&!u&&!c)return"empty query";let d=ah(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let f=d.slice(0,n),p=[`${d.length} module(s) match "${t}" (top ${f.length}):`];for(let{ind:h,defineCount:m,matching:b}of f){let g=b.length?` \u2014 matching: ${ut([...new Set(b)],dE)}`:"";p.push(`- ${h.label} (defines ${m} symbol(s))${g}`)}return p.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),p.join(`
4
- `)}function Se(e,t){let n=Yf.get(e);n||(n=new Map,Yf.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(os(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function ts(e,t){let n=e.byId?.get?.(t);if(n)return On(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function On(e,t){if((t?.class||"")==="Module")return t.id;let n=Tt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function wl(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Fo(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function uh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`],o=Se(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
- `);let r=[],i=[];for(let a of o){let l=e.byId.get(a.object),c=wl(l?Tt(l):null),u=l?Fo(l):"",d=`${a.objectLabel||a.object}${c}${u?` @${u}`:""}`;((l?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${ut(r,Xf)}`),i.length&&s.push(`attributes (${i.length}): ${ut(i,Xf)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
- `)}function dh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Tt(t),o=[`${t.label} \u2014 ${ss(t.class)}${wl(s)}`],r=Me(t,"params"),i=Me(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];Me(t,"isStatic")&&a.push("static"),Me(t,"isAbstract")&&a.push("abstract"),Me(t,"isConstant")&&a.push("constant");let l=Me(t,"visibility");l&&a.push(l),a.length&&o.push(`flags: ${a.join(", ")}`);let c=Fo(t);c&&o.push(`decorators: @${c.split(", ").join(", @")}`);let u=Me(t,"raises");u&&o.push(`raises: ${u}`);let d=Me(t,"catches");d&&o.push(`catches: ${d}`);let f=Me(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=Me(t,"value");p&&o.push(`value: ${p}`);let h=Me(t,"doc");return h&&o.push(`doc: ${h}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
- `)}function ph(e,t){let n=Se(e,"inherits"),s=n.filter(l=>l.subject===t.id).map(l=>l.objectLabel||l.object),o=new Map;for(let l of n)o.has(l.object)||o.set(l.object,[]),o.get(l.object).push({id:l.subject,label:l.subjectLabel||l.subject});let r=[`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${ut(s,Jf)}`:"extends: (no internal/recorded base classes)");let i=[];for(let l of zi(t.id,c=>o.get(c)||[],{maxDepth:8,keyOf:c=>c.id}))l.length&&i.push(l.map(c=>c.label).sort((c,u)=>String(c).localeCompare(String(u))));let a=i.reduce((l,c)=>l+c.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((l,c)=>r.push(` depth ${c+1} (${l.length}): ${ut(l,Jf)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
- `)}function Vi(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 Hi(e,t=""){let n=ns(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||ns(s.label).startsWith(n)))}function fh(e,{pkg:t=""}={}){let n=ns(t),s=Hi(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Vi(s),r=new Map;for(let u of Se(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,JE).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),l=[...o.entries()].sort((u,d)=>d[1]-u[1]),c=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${l.length} package(s).`];return c.push(`packages (by module count): ${ut(l.map(([u,d])=>`${u} (${d})`),XE)}`),c.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),c.join(`
9
- `)}function mh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Tt(t)?.path||n,o=[...new Set(Se(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
- ${ut(o,hh,`
1
+ (()=>{var Lx=Object.defineProperty;var O=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Gt=(e,t)=>{for(var n in t)Lx(e,n,{get:t[n],enumerable:!0})};var ct,a0,c0,l0,u0,d0,p0,f0,h0,m0,g0,b0,w0,y0,$0,v0,x0,Z,he,Nt,Zc,hf,E0,S0,k0,Ue=O(()=>{ct=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},a0=ct("createRequire"),c0=ct("readFileSync"),l0=ct("access"),u0=ct("readFile"),d0=ct("writeFile"),p0=ct("appendFile"),f0=ct("mkdir"),h0=ct("mkdtemp"),m0=ct("rename"),g0=ct("unlink"),b0=ct("rm"),w0=ct("stat"),y0=ct("copyFile"),$0=ct("readdir"),v0=ct("createReadStream"),x0=ct("createWriteStream"),Z=(...e)=>e.join("/"),he=e=>String(e).replace(/\/[^/]*$/,""),Nt=(...e)=>e.join("/"),Zc=e=>String(e).startsWith("/"),hf="/",E0=ct("randomBytes"),S0=ct("spawnSync"),k0=ct("createInterface")});var lt,_0,R0,el,_e,Sr,Nx,An,Px,Li,tl,Mx,Fx,T0,Dx,A0,I0,C0,O0,L0,Rt=O(()=>{lt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},_0=lt("createRequire"),R0=lt("readFileSync"),el=lt("access"),_e=lt("readFile"),Sr=lt("writeFile"),Nx=lt("appendFile"),An=lt("mkdir"),Px=lt("mkdtemp"),Li=lt("rename"),tl=lt("unlink"),Mx=lt("rm"),Fx=lt("stat"),T0=lt("copyFile"),Dx=lt("readdir"),A0=lt("createReadStream"),I0=lt("createWriteStream"),C0=lt("randomBytes"),O0=lt("spawnSync"),L0=lt("createInterface")});function To(e){let t=Ux.exec(String(e||""));return t?t[1].toLowerCase():null}function Ni(e){return String(e||"").replace(Bx,"$1")}function vs(e){return e.replace(Wx,"").trim()}function nn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(Vx,"").trim();if(s=s.replace(qx,"").trim(),s===t)break;t=s}return t}var mf,kr,Ys,gf,bf,zx,Ux,jr,tn,nl,Bx,$n,sl,Wx,Gx,Vx,Hx,qx,de,_r,Pi,Kx,wf,We,sn,xs,yf,ol,rl,il,$f,Rr,Xs,vf,xf,Js,Xn,Jn,Ao,Je,Ef,Qs,Zs,Es,In,Sf,Tr,Io,Mi,Co,kf,Qn=O(()=>{mf=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],kr={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",...mf]},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"]}},Ys=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"})}),gf=Object.freeze(Object.fromEntries(Object.entries(Ys).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),bf=Object.freeze(Object.values(Ys).map(e=>e.predicate)),zx=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),Ux=new RegExp(`^mgx:[a-z]+-(${zx.join("|")})$`,"i");jr=Object.freeze([...mf,"is the superclass of","are the superclass of","is the parent class of"]),tn=Object.freeze(["defined","declared","located","implemented"]),nl=Object.freeze(["now","currently","right now","at the moment","these days","today"]),Bx=new RegExp(`\\s+(?:${[...nl].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");$n=Object.freeze(["mentioned","referenced"]),sl=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),Wx=new RegExp(`\\s+(?:${sl.join("|")})\\s*[?.!]*$`,"i");Gx=Object.freeze(["then","though","too"]),Vx=new RegExp(`\\s+(?:${Gx.join("|")})\\s*[?.!]*$`,"i"),Hx=Object.freeze(["please explain","explain"]),qx=new RegExp(`,\\s*(?:${Hx.join("|")})\\s*[?.!]*$`,"i");de=Object.freeze(Object.fromEntries(Object.entries(kr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),_r=Object.freeze(new Set(["has","have","holds","hold"])),Pi=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),Kx=e=>!jr.includes(e),wf=Object.freeze([...new Set(Object.keys(de).filter(Kx).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),We=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"}),sn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),xs=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"}),yf=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"}}),ol=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"}),rl=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"}),il=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"}),$f=/\b([a-z]{3,})in'/gi,Rr=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"]),Xs=Object.freeze(["this","it","that","here","this one","that one"]),vf=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]}`}]),xf=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`}]),Js=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),Xn=Object.freeze(["that","which","who"]),Jn=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),Ao=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"}),Je=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}}),Ef=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),Qs=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"]),Zs=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"]),Es=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"}),In=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"}}),Sf=Object.freeze({tests:"Module",test:"Module"}),Tr=Object.freeze(["those","them","these"]),Io=Object.freeze(["contains","defines"]),Mi=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"]),Co=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),kf=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 Ge,Oo,al=O(()=>{Ge="#000000",Oo=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${Ge}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${Ge}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${Ge}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${Ge}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${Ge}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${Ge}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${Ge}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${Ge}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${Ge}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${Ge}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${Ge}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${Ge}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${Ge}" 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="${Ge}" 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="${Ge}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var Yx,dn,jf,_f,cl,Rf,z0,U0,Tf=O(()=>{Qn();al();Yx=()=>Object.keys(Oo).sort(),dn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),jf=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),_f=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),cl=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:tn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:dn("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:dn("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:jf("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:_f("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:_f("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:Yx(),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:jf("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:dn("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:dn("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:dn("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:dn("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:dn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:dn("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:dn("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:dn("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:dn("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:dn("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}}]),Rf=cl.filter(e=>e.tier==="hot"),z0=cl.filter(e=>e.tier==="cold"),U0=Object.freeze(cl.map(e=>e.name))});var Af,Re,Vt=O(()=>{Ue();Af=Z(".tmct","graph.json"),Re=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function Xx(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 If(e){let t=(Array.isArray(e)?e:[]).map((l,c)=>({file:l?.file,payload:l?.payload||{},name:l?.name!=null&&String(l.name).length?String(l.name):String(c)})),n=t.map(({payload:l})=>Xx(l)),s=new Map;for(let l of n)for(let c of l)s.set(c,(s.get(c)||0)+1);let o=new Set([...s.entries()].filter(([,l])=>l>1).map(([l])=>l)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:l,name:c}of t){a=a&&!!l.bootstrap,typeof l.generated_at=="string"&&l.generated_at>i&&(i=l.generated_at);let u=f=>o.has(f)?`${c}/${f}`:f;Array.isArray(l.classes)&&r.classes.push(...l.classes),Array.isArray(l.vocabulary)&&r.vocabulary.push(...l.vocabulary);for(let f of Array.isArray(l.individuals)?l.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(h=>u(h))),Array.isArray(p.mentions)&&(p.mentions=p.mentions.map(h=>h&&h.id?{...h,id:u(h.id)}:h)),r.individuals.push(p)}for(let f of Array.isArray(l.objectProperties)?l.objectProperties:[]){if(!f)continue;let p={...f};Array.isArray(p.examples)&&(p.examples=p.examples.map(h=>{if(!h)return h;let m={...h};return m.subject&&(m.subject=u(m.subject)),m.object&&(m.object=u(m.object)),m})),r.objectProperties.push(p)}let d=l.proseIndex&&typeof l.proseIndex=="object"?l.proseIndex:{};for(let[f,p]of Object.entries(d)){let h=r.proseIndex[f]||(r.proseIndex[f]=[]);for(let m of Array.isArray(p)?p:[]){let b=u(m);h.includes(b)||h.push(b)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Cf=O(()=>{});var No={};Gt(No,{clearCache:()=>Jx,emptyEntities:()=>ll,fetchEntities:()=>tE,registerProvider:()=>Qx});function Jx(){Lo=null,Ar=null}function Qx(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Fi;return Fi=e??null,Lo=null,t}function ll(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function Zx(e){let t;try{t=await _e(e,"utf8")}catch(n){if(n?.code==="ENOENT")return ll();throw new Re(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Re(`graph artifact ${e} is not valid JSON`)}}async function eE(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(Ar&&Ar.key===n)return Ar.payload;let s=[];for(let r=0;r<t.length;r++){let i=await Zx(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=If(s);return Ar={key:n,payload:o},o}async function tE(e){if(Fi){let s;try{s=await Fi(e)}catch(o){throw o instanceof Re?o:new Re(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new Re("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return eE(e);if(Lo&&Lo.file===e.graphFile)return Lo.payload;let t;try{t=await _e(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return ll();throw new Re(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new Re(`graph artifact ${e.graphFile} is not valid JSON`)}return Lo={file:e.graphFile,payload:n},n}var Lo,Ar,Fi,Ir=O(()=>{Rt();Vt();Cf();Lo=null,Ar=null,Fi=null});function Cn(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<=Of)}function ul(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>Of||nE.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=sE))break;return t}function Di({name:e,doc:t}={}){return[...new Set([...Cn(e),...ul(t)])].sort()}function Lf(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 eo(e,t,{limit:n=10}={}){let s=[...new Set([...Cn(t),...ul(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 Nf(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let l of Object.keys(s)){let c=s[l];if(!c||typeof c!="object")continue;let u=c[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let f of d)i.add(f);a.add(l)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var nE,Of,sE,Ss=O(()=>{nE=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+/)),Of=40,sE=120});function Pf(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 oE(e){if(!e.startsWith(Ff))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Mf);if(o<0)return null;let r=n.slice(o+Mf.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Ff.length,o),createdAt:s}:null}function Zn(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:iE(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",...Pf(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=oE(s);return o||{kind:"teach",...Pf(s)}}return n.startsWith("web:")?{kind:"web",url:n.slice(4)}:n.startsWith("url:")?{kind:"web",url:n.slice(4)}: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 Wf(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return zf;let n=Number(t);return Number.isFinite(n)?Math.max(dl,Math.min(Bf,n)):zf}function Gf(e,t=Date.now(),n=aE){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Df+(1-Df)*Math.pow(.5,o/n)}function Vf(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 h=t[p],m=cE(h);if(!m)continue;i.push(m);let b=(to[m]??0)*Wf(h);a.push(Math.max(0,Math.min(1,b)))}let l=0,c=1;for(let p of a)c*=1-p;if(a.length&&(l=Math.min(1,1-c)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let p=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;l=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*p))}let u=Gf(e?.createdAt,s,n.halfLifeMs),d=Po(Math.min(1,l*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Po(u)};return{score:d,inputs:f}}function Ui(e,t){let n=(to[e]??0)*Wf(t);return Po(Math.max(0,Math.min(1,n)))}function lE(e){if(e==="operator")return 1;let t=to[e];return t===void 0?1:(t+1)/2}function Bi(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let l=Gf(a?.assertedAt,n,t.halfLifeMs),c=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,c*l)),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:c,recency:Po(l)})}let i=1;for(let[a,l]of o){let c=Math.max(lE(a),l.strongest);i*=1-Math.min(1-l.complement,c)}return{score:s.length?Po(Math.min(1,1-i)):0,inputs:r}}function Hf(e){return Bi(e,{halfLifeMs:uE})}function qf({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+dE),i=(o*r+1)/2;return Po(dl+(Bf-dl)*i)}var Mo,zi,Qe,ks,Mf,Ff,rE,iE,to,pl,Uf,aE,Df,dl,Bf,zf,Po,cE,uE,dE,es=O(()=>{Mo="mgx:trustScore",zi="mgx:trustInputs",Qe="mgx:createdAt",ks="mgx:updatedAt";Mf="#node:",Ff="peer:";rE="wikipedia-live",iE=e=>e===rE?"referenceLive":"reference";to=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),pl=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"}}),Uf=new Set(Object.entries(pl).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),aE=720*60*60*1e3,Df=.9,dl=.5,Bf=1.5,zf=1,Po=(e,t=6)=>Number(e.toFixed(t)),cE=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";uE=1/0;dE=19});var no,fl=O(()=>{no=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function hl(e,t){return Math.log(1+e/(1+t))}var Cr=O(()=>{});var Gi={};Gt(Gi,{bfsLevels:()=>Wi,findActionPath:()=>ml,findReachableSet:()=>gl});function Kf(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function Yf(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 ml(e,t,n,{maxDepth:s=50,stateKey:o=Kf}={}){if(t(e))return{actions:[],states:[e]};let r=Yf(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let c of r)if(t(c.state))return{actions:c.actions,states:c.states};if(a===s)break;let l=[];for(let c of r){let u=o(c.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:f}of n(c.state)||[]){let p=o(f);i.has(p)||l.push({state:f,actions:[...c.actions,d],states:[...c.states,f]})}}}r=l}return null}function gl(e,t,{maxDepth:n=50,stateKey:s=Kf}={}){let o=Yf(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let l=[];for(let c of o){let u=s(c.state);if(!r.has(u)&&(r.add(u),i.push({node:c.state,path:{actions:c.actions,states:c.states}}),a!==n))for(let{action:d,nextState:f}of t(c.state)||[]){let p=s(f);r.has(p)||l.push({state:f,actions:[...c.actions,d],states:[...c.states,f]})}}o=l}return i}function*Wi(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],l=[];for(let c of r)for(let u of t(c)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),l.push(d))}r=l,yield a}}var so=O(()=>{});function Hi(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 Or(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function os(e){let t=String(e?.prop||"").toLowerCase();if(Xf[t])return Xf[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":null}function ns(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function bl(e){let t=ns(e).split("/");return t[t.length-1]}function pE(e){return(e?.derived_from||[]).filter(lh).length}function Jf(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+pE(e)}function on(e,t){let n=ns(t);if(!n)return{match:null,candidates:[]};let s=bl(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=ns(i.label),l=String(i.id||"").toLowerCase(),c=0;a===n||l===n?c=100:a.endsWith(`/${n}`)||o&&(bl(a)===s||bl(a).replace(/\.[a-z]+$/,"")===s)?c=80:a.includes(n)&&(c=Math.max(10,50-(a.length-n.length))),c>0&&r.push({ind:i,score:c})}return r.sort((i,a)=>a.score-i.score||Jf(a.ind)-Jf(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 Tt(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 fE(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 Qf(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function ss(e){let t=e||"Entity",n=Cn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function ut(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function El(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(lh);o.length&&s.push(`attestation: touched by ${o.length} commit(s)`);for(let l of t.attributes||[])s.push(`attribute: ${l.key} = ${l.value}${l.prop?` [${l.prop}]`:""}`);let{out:r,incoming:i}=fE(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:l,edges:c}of r)s.push(` ${Qf(l)} (${c.length}) \u2192 ${ut(c.map(u=>u.objectLabel||u.object),Zf)}`);for(let{group:l,edges:c}of i)s.push(` \u2190 ${Qf(l)} (${c.length}) by ${ut(c.map(u=>u.subjectLabel||u.subject),Zf)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${ut(a,hE)}`),n.length&&s.push(`other matches: ${n.map(l=>`${l.label} (${ss(l.class)})`).join(", ")}`),e.truncated.length&&s.push(mE(e)),s.join(`
2
+ `)}function mE(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 Do(e,t,{maxDepth:n=8}={}){let s=new Map,o=new Map,r=(a,l,c,u)=>{!a||!l||a===l||(s.has(a)||s.set(a,[]),s.get(a).push({id:l,label:c,via:u}))};for(let a of e.relations){let l=os(a);if(l==="imports"||l==="calls")for(let c of a.edges)r(c.object,c.subject,c.subjectLabel||c.subject,a.predicate);else if(l==="callsSymbol")for(let c of a.edges){let u=ts(e,c.subject),d=ts(e,c.object);if(!u||!d)continue;let f=e.byId.get(u)?.label||u;r(d,u,f,a.predicate),u!==d&&r(c.object,u,f,a.predicate)}else if(l==="tests")for(let c of a.edges)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push(c.subjectLabel||c.subject)}let i=[];for(let a of Wi(t.id,l=>s.get(l)||[],{maxDepth:n,keyOf:l=>l.id})){if(!a.length)continue;let l=a.map(c=>({...c,tests:o.get(c.id)||[]})).sort((c,u)=>String(c.label).localeCompare(String(u.label)));i.push(l)}return i}function uh(e,t,{maxDepth:n=8}={}){let s=Do(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,l)=>a+l.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,l)=>{if(l>=gE){o.push(`depth ${l+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(l===0?`depth 1 (${a.length} direct dependents):`:`depth ${l+1} (${a.length}):`);for(let c of a.slice(0,wl)){let u=c.tests.length?`tests: ${ut(c.tests,bE)}`:"tests: none recorded",d=l===0?`${c.via} it`:"reaches it through an intermediary";o.push(` - ${c.label} (${d}) \u2014 ${u}`)}a.length>wl&&o.push(` \u2026+${a.length-wl} more at depth ${l+1}`)});let i=e.truncated.filter(a=>{let l=os({predicate:a.predicate});return l==="imports"||l==="calls"||l==="callsSymbol"||l==="tests"});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 dh(e){let t=new Map;for(let n of e.relations)if(os(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 th(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function gh(e,t,n=null){let s=n||(i=>ts(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 Se(e,i))r(s(a.subject),s(a.object));return o}function ZE(e,t,n){if(t.length<2)return;let s=new Map(t.map(c=>[c.ind.id,c])),o=new Map(t.map(c=>[c.ind.id,c.score])),r=c=>{if(!c.size)return[[],[]];let u=0;for(let h of c.values())u=Math.max(u,h);let d=[...c.entries()].sort((h,m)=>m[1]-h[1]),f=[],p=[];for(let[h,m]of d)m>=u*WE&&f.length<n?f.push([h,m]):p.length<eh&&p.push([h,m]);return[f,p]},[i,a]=r(new Map(t.map(c=>[c.ind.id,c.score]))),l=new Set(i.map(([c])=>c));for(let c=0;c<HE&&i.length;c++){let u=new Map,d=[];for(let f of qE){let p=gh(e,f),h=new Map;for(let[g,y]of i)for(let w of p.get(g)||[])o.has(w)&&h.set(w,Math.max(h.get(w)||0,y));let[m,b]=r(h);for(let[g,y]of m)u.set(g,Math.max(u.get(g)||0,y));d.push(...b)}a.push(...d);for(let[f,p]of u){if(l.has(f))continue;let h=s.get(f);h&&(h.score+=Math.min(p*GE,h.score*VE),l.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,eh).filter(([f])=>!l.has(f)))}}function eS(e,t=[],{depth:n=fh,q:s=mh,nodeLimit:o=hh,kinds:r=KE,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:l=null,hubDegree:c=1/0}={}){let u=new Map(t.map(S=>[S.ind.id,S])),d=0;for(let S of t)d=Math.max(d,S.score);let f=t.length>0&&d>0,p=new Set(l??u.keys());if(!p.size)return[];let h=gh(e,r,a),m=S=>h.get(S)?.size||0,b=[],g=(S,R)=>S.hop!==R.hop?S.hop<R.hop:S.deg!==R.deg?S.deg<R.deg:S.id<R.id,y=(S,R)=>{let _=b[S];b[S]=b[R],b[R]=_},w=S=>{b.push(S);let R=b.length-1;for(;R>0;){let _=R-1>>1;if(g(b[R],b[_]))y(R,_),R=_;else break}},v=()=>{let S=b[0],R=b.pop();if(b.length){b[0]=R;let _=0;for(;;){let I=2*_+1,P=2*_+2,T=_;if(I<b.length&&g(b[I],b[T])&&(T=I),P<b.length&&g(b[P],b[T])&&(T=P),T===_)break;y(_,T),_=T}}return S},k=new Set(p);for(let S of p)w({id:S,hop:0,deg:m(S)});let $=null,x=0,E=[];for(;b.length&&x<o;){let S=v();if(E.push({id:S.id,hop:S.hop}),!p.has(S.id)){if(f){let I=d*YE*Math.pow(XE,S.hop-1),P=u.get(S.id);if(P)P.score+=Math.min(I*JE,P.score*QE);else{let T=e.byId?.get?.(S.id);if(T&&i(T)){$||($=dh(e));let F=$.get(T.id)||[],U={ind:T,score:I,defineCount:F.length,matching:[],density:0};t.push(U),u.set(S.id,U)}}}x++}if(S.hop>=n||S.hop>0&&m(S.id)>c)continue;let R=[];for(let I of h.get(S.id)||[]){if(k.has(I))continue;let P=e.byId?.get?.(I);!P||!i(P)||R.push({id:I,deg:m(I)})}if(!R.length)continue;R.sort((I,P)=>I.deg-P.deg||(I.id<P.id?-1:I.id>P.id?1:0));let _=Math.max(1,Math.floor(s*R.length));for(let I=0;I<_;I++){let P=R[I];k.add(P.id),w({id:P.id,hop:S.hop+1,deg:P.deg})}}return E}function bh(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:l=!1,proseLayers:c=!1,literalMention:u=!1,rawQuery:d=""}=n,f=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,p=dh(e),h=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let k=String(v.label),$=k.toLowerCase(),x=p.get(v.id)||[],E=new Set(x.map(_=>_.toLowerCase())),S=new Set;for(let _ of x)for(let I of th(_))S.add(I);let R=u?String((v.attributes||[]).find(_=>_.key==="dotted")?.value||"").toLowerCase():"";h.push({ind:v,label:k,labelLc:$,defines:x,symSet:E,symComps:S,dotted:R})}let m=h.length||1,b=new Map,g=v=>{let k=0;for(let $ of h)($.labelLc.includes(v)||$.symComps.has(v)||$.symSet.has(v))&&k++;return k},y=v=>(b.has(v)||b.set(v,hl(m,g(v))),b.get(v));for(let v of t)y(v);let w=[];for(let v of h){let k=0,$=0,x=0,E=[];for(let P of t){let T=b.get(P)||0;T&&(v.symSet.has(P)?(k+=T*ph,x++):v.symComps.has(P)&&(E.push(T),x++),v.labelLc.includes(P)&&($+=T*yE))}E.sort((P,T)=>T-P);let S=0;for(let P=0;P<Math.min(E.length,vE);P++)S+=E[P]*$E;let R=k+$+S;if(!R)continue;s&&(no(v.labelLc)||kE(v.labelLc))?R*=SE:no(v.labelLc)&&(R*=.4);let _=v.defines.filter(P=>{let T=P.toLowerCase(),F=th(P);return t.some(U=>T===U||F.has(U))}),I=v.defines.length?x/v.defines.length:0;w.push({ind:v.ind,score:R,defineCount:v.defines.length,matching:_,density:I})}if(u&&d&&w.length){let v=String(d).toLowerCase(),k=S=>S!=null&&/[a-z0-9_./]/.test(S),$=S=>{for(let R=v.indexOf(S);R!==-1;R=v.indexOf(S,R+1))if(!k(v[R-1])&&!k(v[R+S.length]))return!0;return!1},x=new Map(h.map(S=>[S.ind.id,S])),E=0;for(let S of w)E=Math.max(E,S.score);for(let S of w){let R=x.get(S.ind.id);if(!R)continue;let _=0;for(let I of new Set([R.dotted,R.labelLc])){if(!I||I.split(/[./]+/).filter(Boolean).length<DE||!$(I))continue;let P=[...new Set(I.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((F,U)=>U-F),T=0;for(let F=0;F<Math.min(P.length,zE);F++)T+=P[F]*FE;_=Math.max(_,T)}_&&(S.score+=Math.min(_*UE,E*BE))}}if(w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of Se(e,"imports"))!v.has($.subject)&&!v.has($.object)||(k.has($.subject)||k.set($.subject,new Set),k.has($.object)||k.set($.object,new Set),k.get($.subject).add($.object),k.get($.object).add($.subject));for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*xE,$.score*EE)}}if(o&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of["calls","callsSymbol"])for(let x of Se(e,$)){let E=ts(e,x.subject),S=ts(e,x.object);!E||!S||E===S||!v.has(E)&&!v.has(S)||(k.has(E)||k.set(E,new Set),k.has(S)||k.set(S,new Set),k.get(E).add(S),k.get(S).add(E))}for(let $ of w){let x=0;for(let E of k.get($.ind.id)||[])x=Math.max(x,v.get(E)||0);$.score+=Math.min(x*jE,$.score*_E)}}if(r&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),k=new Map;for(let $ of e.individuals)($.class||"")==="Class"&&$.label&&k.set(String($.label),$);for(let $ of w){if(!AE($.ind.label))continue;let x=0;for(let E of Se(e,"inherits")){if(ts(e,E.subject)!==$.ind.id||!IE(E.objectLabel))continue;let R=ts(e,E.object);if(!R){let _=k.get(String(E.objectLabel||""));_&&(R=On(e,_))}R&&(x=Math.max(x,v.get(R)||0))}$.score+=Math.min(x*RE,$.score*TE)}}if(l&&w.length&&e.proseIndex){let v=eo(e.proseIndex,t.join(" "),{limit:LE});if(v.length){let k=new Map;for(let{id:$,score:x}of v){let E=ts(e,$);E&&k.set(E,(k.get(E)||0)+x)}for(let $ of w){let x=k.get($.ind.id)||0;x&&($.score+=Math.min(x*CE,$.score*OE))}}}if(c&&w.length&&e.proseIndex){let v=new Map(w.map(x=>[x.ind.id,x])),k=new Map(h.map(x=>[x.ind.id,x])),$=new Map;for(let x of new Set(t)){let E=b.get(x)||0;if(!E)continue;let{ids:S}=Nf(e.proseIndex,x);if(!S.length)continue;let R=new Set;for(let _ of S){let I=ts(e,_);if(!I||R.has(I)||(R.add(I),!v.has(I)))continue;let P=k.get(I);P&&(P.symSet.has(x)||P.symComps.has(x)||P.labelLc.includes(x))||$.set(I,($.get(I)||0)+E*ME)}}for(let x of w){let E=$.get(x.ind.id)||0;E&&(x.score+=Math.min(E*NE,x.score*PE))}}return i&&w.length>1&&ZE(e,w,f),a&&w.length&&eS(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:fh,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:mh,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:hh}),w.sort((v,k)=>k.score-v.score||k.density-v.density||v.defineCount-k.defineCount||String(v.ind.label).length-String(k.ind.label).length),w}function wh(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 bh(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function nS(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let l=0;l<e.length;l++){let c=e[l];if(c==="\\"){let u=e[l+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),l+=1,r="",i=!1;continue}if(o){c==="]"&&(o=!1,r="]",i=!1);continue}if(c==="["){o=!0,r="[",i=!1;continue}if(c==="?"&&(r==="("||i)){r="?",i=!1;continue}if(c==="*"||c==="+"||c==="?"){a(),r=c;continue}if(c==="{"){let u=e.indexOf("}",l),d=u===-1?"":e.slice(l+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),l=u,r="}";continue}r="{",i=!1;continue}r=c,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function Sl(e,{now:t=Date.now}={}){let n=String(e);if(n.length>nh)return{error:`name pattern is ${n.length} characters; the limit is ${nh}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=nS(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>sh)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${sh}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(l){if(a===null)a=t()+oh;else if(t()>a)throw new Vi(`name pattern "${n}" exceeded its ${oh}ms matching budget.`);return i.test(String(l).slice(0,tS))}}}function yh(e,t,{limit:n=qi,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),l=String(s||"").trim().toLowerCase(),c=String(o||"").trim().toLowerCase(),u=null;if(r){let h=Sl(r);if(h.error)return h.error;u=h}if(l&&l!=="module")try{return aS(e,a,{limit:n,kind:l,decFilter:c,nameRe:u,toolNamePrefix:i})}catch(h){if(h instanceof Vi)return h.message;throw h}if(!a.length&&!u&&!c)return"empty query";let d=bh(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:h,defineCount:m,matching:b}of f){let g=b.length?` \u2014 matching: ${ut([...new Set(b)],wE)}`:"";p.push(`- ${h.label} (defines ${m} symbol(s))${g}`)}return p.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),p.join(`
4
+ `)}function Se(e,t){let n=rh.get(e);n||(n=new Map,rh.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(os(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function ts(e,t){let n=e.byId?.get?.(t);if(n)return On(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function On(e,t){if((t?.class||"")==="Module")return t.id;let n=Tt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function kl(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Fo(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function $h(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`],o=Se(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
+ `);let r=[],i=[];for(let a of o){let l=e.byId.get(a.object),c=kl(l?Tt(l):null),u=l?Fo(l):"",d=`${a.objectLabel||a.object}${c}${u?` @${u}`:""}`;((l?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${ut(r,ih)}`),i.length&&s.push(`attributes (${i.length}): ${ut(i,ih)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
+ `)}function vh(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Tt(t),o=[`${t.label} \u2014 ${ss(t.class)}${kl(s)}`],r=Me(t,"params"),i=Me(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];Me(t,"isStatic")&&a.push("static"),Me(t,"isAbstract")&&a.push("abstract"),Me(t,"isConstant")&&a.push("constant");let l=Me(t,"visibility");l&&a.push(l),a.length&&o.push(`flags: ${a.join(", ")}`);let c=Fo(t);c&&o.push(`decorators: @${c.split(", ").join(", @")}`);let u=Me(t,"raises");u&&o.push(`raises: ${u}`);let d=Me(t,"catches");d&&o.push(`catches: ${d}`);let f=Me(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=Me(t,"value");p&&o.push(`value: ${p}`);let h=Me(t,"doc");return h&&o.push(`doc: ${h}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
+ `)}function xh(e,t){let n=Se(e,"inherits"),s=n.filter(l=>l.subject===t.id).map(l=>l.objectLabel||l.object),o=new Map;for(let l of n)o.has(l.object)||o.set(l.object,[]),o.get(l.object).push({id:l.subject,label:l.subjectLabel||l.subject});let r=[`${t.label} \u2014 ${ss(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${ut(s,ah)}`:"extends: (no internal/recorded base classes)");let i=[];for(let l of Wi(t.id,c=>o.get(c)||[],{maxDepth:8,keyOf:c=>c.id}))l.length&&i.push(l.map(c=>c.label).sort((c,u)=>String(c).localeCompare(String(u))));let a=i.reduce((l,c)=>l+c.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((l,c)=>r.push(` depth ${c+1} (${l.length}): ${ut(l,ah)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
+ `)}function Ki(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 Yi(e,t=""){let n=ns(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||ns(s.label).startsWith(n)))}function Eh(e,{pkg:t=""}={}){let n=ns(t),s=Yi(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Ki(s),r=new Map;for(let u of Se(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,oS).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),l=[...o.entries()].sort((u,d)=>d[1]-u[1]),c=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${l.length} package(s).`];return c.push(`packages (by module count): ${ut(l.map(([u,d])=>`${u} (${d})`),sS)}`),c.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),c.join(`
9
+ `)}function kh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Tt(t)?.path||n,o=[...new Set(Se(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
+ ${ut(o,Sh,`
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
- ${QE}`}function gh(e,{codeDomainActive:t=null}={}){let n=t??Cr(e)>0,s=new Set,o=new Set;for(let a of Se(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!no(String(a.label).toLowerCase()));if(!r.length)return n?Cr(e)===0?`no modules to check for test coverage in this index. ${ml}`:"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
- ${ut(i,hh,`
14
- `)}`:"every source module has at least one covering test module."}function bh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${ut(o,Vt)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function yh(e,t,{toolNamePrefix:n="tmct_"}={}){if(wh.has(t.class)){let i=[...new Set(Se(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
- ${ut(i,Or,`
12
+ ${rS}`}function jh(e,{codeDomainActive:t=null}={}){let n=t??Or(e)>0,s=new Set,o=new Set;for(let a of Se(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!no(String(a.label).toLowerCase()));if(!r.length)return n?Or(e)===0?`no modules to check for test coverage in this index. ${xl}`:"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
+ ${ut(i,Sh,`
14
+ `)}`:"every source module has at least one covering test module."}function _h(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${ut(o,Ht)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Th(e,t,{toolNamePrefix:n="tmct_"}={}){if(Rh.has(t.class)){let i=[...new Set(Se(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
+ ${ut(i,Lr,`
16
16
  `)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=On(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(Se(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
17
- ${ut(r,Or,`
18
- `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function $h(e,t){if(wh.has(t.class)){let r=[...new Set(Se(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
19
- ${ut(r,Or,`
17
+ ${ut(r,Lr,`
18
+ `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function Ah(e,t){if(Rh.has(t.class)){let r=[...new Set(Se(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
19
+ ${ut(r,Lr,`
20
20
  `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(Se(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
- ${ut(o,Or,`
22
- `)}`:`${s}: no recorded callees.`}function vh(e,t){let n=e.byId.get(t.object),s=n?Tt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function yl(e,t){if(!t?.id)return"";let n=Se(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${ut(n.map(s=>vh(e,s)),ZE)}`:""}function xh(e,t){let n=Se(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${ss(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=>vh(e,o));return`${t.label} \u2014 ${ss(t.class)} calls ${n.length} in-repo symbol(s):
23
- ${ut(s,Or,`
24
- `)}`}function Eh(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=Me(s,"commitDate")||Me(s,"date"),i=Me(s,"commitAuthor")||Me(s,"author"),a=Me(s,"commitMessage")||Me(s,"message"),l=[o,r,i].filter(Boolean).join(" ");return a?`${l} \u2014 ${a}`:l}function Sh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(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,Vt).map(a=>` ${Eh(e,a.subject,a.subjectLabel)}`),i=o.length>Vt?`
25
- \u2026+${o.length-Vt} more`:"";return`${s}: touched by ${o.length} recent commit(s):
21
+ ${ut(o,Lr,`
22
+ `)}`:`${s}: no recorded callees.`}function Ih(e,t){let n=e.byId.get(t.object),s=n?Tt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function jl(e,t){if(!t?.id)return"";let n=Se(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${ut(n.map(s=>Ih(e,s)),iS)}`:""}function Ch(e,t){let n=Se(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${ss(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=>Ih(e,o));return`${t.label} \u2014 ${ss(t.class)} calls ${n.length} in-repo symbol(s):
23
+ ${ut(s,Lr,`
24
+ `)}`}function Oh(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=Me(s,"commitDate")||Me(s,"date"),i=Me(s,"commitAuthor")||Me(s,"author"),a=Me(s,"commitMessage")||Me(s,"message"),l=[o,r,i].filter(Boolean).join(" ");return a?`${l} \u2014 ${a}`:l}function Lh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(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,Ht).map(a=>` ${Oh(e,a.subject,a.subjectLabel)}`),i=o.length>Ht?`
25
+ \u2026+${o.length-Ht} more`:"";return`${s}: touched by ${o.length} recent commit(s):
26
26
  ${r.join(`
27
- `)}${i}`}function kh(e,t){let n=Se(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${ss(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,Vt).map(r=>` ${Eh(e,r.subject,r.subjectLabel)}`),o=n.length>Vt?`
28
- \u2026+${n.length-Vt} more`:"";return`${t.label} \u2014 ${ss(t.class)}: touched by ${n.length} commit(s):
27
+ `)}${i}`}function Nh(e,t){let n=Se(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${ss(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,Ht).map(r=>` ${Oh(e,r.subject,r.subjectLabel)}`),o=n.length>Ht?`
28
+ \u2026+${n.length-Ht} more`:"";return`${t.label} \u2014 ${ss(t.class)}: touched by ${n.length} commit(s):
29
29
  ${s.join(`
30
- `)}${o}`}function jh(e,t){return kh(e,t)}function _h(e,t){return kh(e,t)}function $l(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Rh[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Fo(a).toLowerCase().includes(s))continue;let l=String(a.label).toLowerCase(),c=t.length?0:1;for(let u of t)l.includes(u)&&(c+=5);t.length&&!c||i.push({ind:a,score:c})}return i.sort((a,l)=>l.score-a.score||String(a.ind.label).length-String(l.ind.label).length),i}function eS(e,t,{limit:n=Gi,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Rh[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let l=$l(e,t,{kind:s,decFilter:o,nameRe:r});if(!l.length)return`no ${s} matches the given filters.`;let c=l.slice(0,n),u=[`${l.length} ${s}(s) match (top ${c.length}):`];for(let{ind:d}of c)u.push(`- ${d.label}${wl(Tt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
- `)}function uS(e){return{paramCount:qi(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function dS(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>qi(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:lS(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function pS(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(qi(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 fS(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of pl(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 l=new Set(pl(t)),c=l.size?l:new Set(i?[i]:[]),u=new Set(Qf(n)),d=s?.start??null;for(let f of e){let p=pl(f.decorators).some(g=>c.has(g))?1:0,h=Qf(f.label).filter(g=>u.has(g)).length,m=pS(f,o),b=d!=null&&f.site?1/(1+Math.abs(f.site.start-d)):0;f._score=p*1e3+h*50+m+b}return[...e].sort((f,p)=>p._score-f._score||(f.site?.start||0)-(p.site?.start||0))}function zo(e,t){let n=On(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Se(e,"defines").filter(_=>_.subject===n),r=new Map;for(let _ of Se(e,"callsSymbol"))r.has(_.subject)||r.set(_.subject,new Set),r.get(_.subject).add(_.object);let i=[],a=[],l=0;for(let _ of o){let I=e.byId.get(_.object);if(!I)continue;let P=I.class||"",T=Tt(I);P==="GlobalVariable"?(a.push({label:I.label,value:(I.attributes||[]).find(F=>F.key==="value")?.value||"",site:T}),T&&(l=Math.max(l,T.end))):(P==="Function"||P==="Class")&&(i.push({id:I.id,label:I.label,class:P,site:T,decorators:Fo(I),raises:Me(I,"raises"),doc:Me(I,"doc"),params:Me(I,"params"),returns:Me(I,"returns"),callees:r.get(I.id)||new Set}),T&&(l=Math.max(l,T.end)))}let c=Tt(t),u=c&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:c,decorators:Fo(t),raises:Me(t,"raises"),params:Me(t,"params"),returns:Me(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?uS(u):dS(i);i=fS(i,u||{label:t.label},f);let p=u?null:i.find(_=>_.site&&_.label!==t.label)||null,h=[...new Set(Se(e,"tests").filter(_=>_.object===n).map(_=>_.subjectLabel||_.subject))].slice(0,oS),m=Ch(e,n).slice(0,sS),b=Se(e,"reexports").filter(_=>_.subject===n).map(_=>_.objectLabel||_.object).slice(0,20),g=Me(e.byId.get(n),"all"),y=Se(e,"contains"),w=null;(t.class||"")==="Class"?w=t.id:(t.class||"")==="Method"&&(w=y.find(_=>_.object===t.id)?.subject||null);let v=null;if(w){let _=e.byId.get(w),I=y.filter(P=>P.subject===w).map(P=>{let T=e.byId.get(P.object);return{label:P.objectLabel||T?.label||P.object,class:T?.class||"",site:T?Tt(T):null,decorators:T?Fo(T):"",params:T?Me(T,"params"):"",returns:T?Me(T,"returns"):"",raises:T?Me(T,"raises"):""}}).slice(0,nS);v={className:_?.label||String(w).replace(/^fn:.*#/,""),members:I,total:y.filter(P=>P.subject===w).length}}let k=null;for(let _ of[...i,...a])_.site&&(!k||_.site.start>k.start)&&(k=_.site);let $=k?{start:k.start,end:k.end}:null,x=u||p,E=x?.id?e.byId.get(x.id):null,S=E?yl(e,E):"",R=[];if(x?.callees)for(let _ of x.callees){let I=e.byId.get(_),P=I?Tt(I):null;if(P&&R.push({label:I.label,site:P}),R.length>=cS)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:p,globals:a,tests:h,cochange:m,exports:b,allExports:g,classMembers:v,insertion:l,insertionRegion:$,calleeBodies:R,callHint:S,siblingCap:tS}}function oo(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 Th(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 Ki(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=qi(s.params);(i>rS||a>iS||s.raises)&&(o="MID");let l=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),f=d?Tt(d):null;if(f&&f.path!==e.moduleLabel){l=!0;break}}let c=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=aS;(l||c)&&(o="LARGE")}else o="MID";return{tier:o,mask:oo(o),topup:o!=="TINY"}}function Ah(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 Ph(e,t){return Nh(e,t)}function Mh(e,t){return Nh(e,t)}function _l(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Fh[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Fo(a).toLowerCase().includes(s))continue;let l=String(a.label).toLowerCase(),c=t.length?0:1;for(let u of t)l.includes(u)&&(c+=5);t.length&&!c||i.push({ind:a,score:c})}return i.sort((a,l)=>l.score-a.score||String(a.ind.label).length-String(l.ind.label).length),i}function aS(e,t,{limit:n=qi,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Fh[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let l=_l(e,t,{kind:s,decFilter:o,nameRe:r});if(!l.length)return`no ${s} matches the given filters.`;let c=l.slice(0,n),u=[`${l.length} ${s}(s) match (top ${c.length}):`];for(let{ind:d}of c)u.push(`- ${d.label}${kl(Tt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
+ `)}function bS(e){return{paramCount:Xi(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function wS(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>Xi(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:gS(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function yS(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(Xi(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 $S(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of yl(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 l=new Set(yl(t)),c=l.size?l:new Set(i?[i]:[]),u=new Set(ch(n)),d=s?.start??null;for(let f of e){let p=yl(f.decorators).some(g=>c.has(g))?1:0,h=ch(f.label).filter(g=>u.has(g)).length,m=yS(f,o),b=d!=null&&f.site?1/(1+Math.abs(f.site.start-d)):0;f._score=p*1e3+h*50+m+b}return[...e].sort((f,p)=>p._score-f._score||(f.site?.start||0)-(p.site?.start||0))}function zo(e,t){let n=On(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Se(e,"defines").filter(_=>_.subject===n),r=new Map;for(let _ of Se(e,"callsSymbol"))r.has(_.subject)||r.set(_.subject,new Set),r.get(_.subject).add(_.object);let i=[],a=[],l=0;for(let _ of o){let I=e.byId.get(_.object);if(!I)continue;let P=I.class||"",T=Tt(I);P==="GlobalVariable"?(a.push({label:I.label,value:(I.attributes||[]).find(F=>F.key==="value")?.value||"",site:T}),T&&(l=Math.max(l,T.end))):(P==="Function"||P==="Class")&&(i.push({id:I.id,label:I.label,class:P,site:T,decorators:Fo(I),raises:Me(I,"raises"),doc:Me(I,"doc"),params:Me(I,"params"),returns:Me(I,"returns"),callees:r.get(I.id)||new Set}),T&&(l=Math.max(l,T.end)))}let c=Tt(t),u=c&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:c,decorators:Fo(t),raises:Me(t,"raises"),params:Me(t,"params"),returns:Me(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?bS(u):wS(i);i=$S(i,u||{label:t.label},f);let p=u?null:i.find(_=>_.site&&_.label!==t.label)||null,h=[...new Set(Se(e,"tests").filter(_=>_.object===n).map(_=>_.subjectLabel||_.subject))].slice(0,dS),m=Bh(e,n).slice(0,uS),b=Se(e,"reexports").filter(_=>_.subject===n).map(_=>_.objectLabel||_.object).slice(0,20),g=Me(e.byId.get(n),"all"),y=Se(e,"contains"),w=null;(t.class||"")==="Class"?w=t.id:(t.class||"")==="Method"&&(w=y.find(_=>_.object===t.id)?.subject||null);let v=null;if(w){let _=e.byId.get(w),I=y.filter(P=>P.subject===w).map(P=>{let T=e.byId.get(P.object);return{label:P.objectLabel||T?.label||P.object,class:T?.class||"",site:T?Tt(T):null,decorators:T?Fo(T):"",params:T?Me(T,"params"):"",returns:T?Me(T,"returns"):"",raises:T?Me(T,"raises"):""}}).slice(0,lS);v={className:_?.label||String(w).replace(/^fn:.*#/,""),members:I,total:y.filter(P=>P.subject===w).length}}let k=null;for(let _ of[...i,...a])_.site&&(!k||_.site.start>k.start)&&(k=_.site);let $=k?{start:k.start,end:k.end}:null,x=u||p,E=x?.id?e.byId.get(x.id):null,S=E?jl(e,E):"",R=[];if(x?.callees)for(let _ of x.callees){let I=e.byId.get(_),P=I?Tt(I):null;if(P&&R.push({label:I.label,site:P}),R.length>=mS)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:p,globals:a,tests:h,cochange:m,exports:b,allExports:g,classMembers:v,insertion:l,insertionRegion:$,calleeBodies:R,callHint:S,siblingCap:cS}}function oo(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 Dh(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 Ji(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=Xi(s.params);(i>pS||a>fS||s.raises)&&(o="MID");let l=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),f=d?Tt(d):null;if(f&&f.path!==e.moduleLabel){l=!0;break}}let c=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=hS;(l||c)&&(o="LARGE")}else o="MID";return{tier:o,mask:oo(o),topup:o!=="TINY"}}function zh(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
32
32
  ## members of ${e.classMembers.className}:`);for(let n of e.classMembers.members){let s=String(n.label).split(".").pop(),o=n.params!=null&&n.params!==""?`(${n.params})${n.returns?` -> ${n.returns}`:""}`:"",r=n.decorators?`@${n.decorators} `:"",i=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${s}${n.site?` :${n.site.start}`:""} ${r}${s}${o}${i}`)}}if(e.siblings.length){t.push(`
33
33
  ## sibling symbols (most relevant first; ${e.siblings.length} total):`);for(let n of e.siblings.slice(0,e.siblingCap)){let s=n.decorators?`@${n.decorators} `:"",o=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${n.label}${n.site?` :${n.site.start}`:""} ${s}${o}`)}e.siblings.length>e.siblingCap&&t.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return e.allExports&&t.push(`
34
34
  ## module __all__: ${e.allExports}`),e.exports&&e.exports.length&&t.push(`
35
35
  ## re-exported symbols: ${e.exports.join(", ")}`),e.tests.length&&t.push(`
36
36
  ## covering tests: ${e.tests.join(", ")}`),e.cochange&&e.cochange.length&&t.push(`
37
37
  ## usually changed together: ${e.cochange.map(n=>`${n.label} (\xD7${n.weight})`).join(", ")}`),t.length===1&&t.push("(no omitted sections \u2014 the lean bundle already contained everything for this symbol.)"),t.join(`
38
- `)}function Ih(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
38
+ `)}function Uh(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
39
39
  ## registration / module globals (replicate this pattern):`);for(let s of e.globals)n.push(` ${s.label} = ${s.value}${s.site?` [:${s.site.start}]`:""}`)}if(t.classMembers&&e.classMembers&&e.classMembers.members.length){n.push(`
40
40
  ## members of ${e.classMembers.className}:`);for(let s of e.classMembers.members){let o=String(s.label).split(".").pop(),r=s.params!=null&&s.params!==""?`(${s.params})${s.returns?` -> ${s.returns}`:""}`:"",i=s.decorators?`@${s.decorators} `:"",a=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${o}${s.site?` :${s.site.start}`:""} ${i}${o}${r}${a}`)}}if(t.siblings&&e.siblings.length){n.push(`
41
41
  ## sibling symbols to copy the style of (most relevant first; ${e.siblings.length} total):`);for(let s of e.siblings.slice(0,e.siblingCap)){let o=s.decorators?`@${s.decorators} `:"",r=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${s.label}${s.site?` :${s.site.start}`:""} ${o}${r}`)}e.siblings.length>e.siblingCap&&n.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return t.allExports&&e.allExports&&n.push(`
@@ -45,28 +45,28 @@ ${s.join(`
45
45
  ## insert the new sibling after line ~${e.insertion} (end of the last top-level definition).`)),t.tests&&e.tests.length&&n.push(`
46
46
  ## covering tests: ${e.tests.join(", ")}`),t.cochange&&e.cochange&&e.cochange.length&&n.push(`
47
47
  ## usually changed together (consider editing these too): ${e.cochange.map(s=>`${s.label} (\xD7${s.weight})`).join(", ")}`),n.join(`
48
- `)}function Ch(e,t){let n=[];for(let s of Se(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function Oh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Ch(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,fl).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
48
+ `)}function Bh(e,t){let n=[];for(let s of Se(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function Wh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Bh(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,$l).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
49
49
  ${r.join(`
50
- `)}`+(o.length>fl?`
51
- \u2026+${o.length-fl} more`:"")}function Lh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(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,hl).map(i=>{let a=e.byId.get(i.object),l=a?Tt(a):null,c=l?` \u2190 ${l.path}`:"";return`${i.objectLabel||i.object}${c}`});return`${s} \u2014 public API (${o.length} export(s)):
50
+ `)}`+(o.length>$l?`
51
+ \u2026+${o.length-$l} more`:"")}function Gh(e,t){let n=On(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Se(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,vl).map(i=>{let a=e.byId.get(i.object),l=a?Tt(a):null,c=l?` \u2190 ${l.path}`:"";return`${i.objectLabel||i.object}${c}`});return`${s} \u2014 public API (${o.length} export(s)):
52
52
  ${r.join(`
53
- `)}`+(o.length>hl?`
54
- \u2026+${o.length-hl} more`:"")}var ml,zf,Zf,Wf,aE,lE,dl,uE,Gi,dE,pE,fE,nh,hE,mE,gE,bE,wE,yE,$E,vE,xE,EE,SE,kE,jE,_E,RE,TE,AE,IE,CE,OE,LE,NE,PE,ME,FE,Gf,DE,zE,sh,oh,rh,UE,BE,WE,GE,VE,Hf,qf,KE,Kf,Bi,Yf,Xf,Jf,Or,Me,XE,JE,hh,QE,Vt,wh,ZE,Rh,tS,nS,sS,oS,rS,iS,aS,cS,pl,Qf,qi,lS,fl,hl,Le=O(()=>{Ss();es();il();Ir();so();ml="This store holds no code index, so it records no modules or commits to look through.",zf={"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"};Zf=e=>/^(git|turn):/.test(String(e||""));Wf=30,aE=8;lE=2,dl=25,uE=3;Gi=10,dE=8,pE=3,fE=2,nh=5,hE=4,mE=.2,gE=.35,bE=.15,wE=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),yE=.2,$E=.35,vE=.2,xE=.35,EE=e=>/\.cs$/i.test(e),SE=e=>/^I[A-Z]/.test(String(e||"")),kE=.2,jE=.35,_E=50,RE=.2,TE=.35,AE=.5,IE=nh,CE=3,OE=4,LE=1,NE=.9,PE=.5,ME=.2,FE=.35,Gf=4,DE=2,zE=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],sh=3,oh=12,rh=.9,UE=["imports","calls","callsSymbol","inherits"],BE=.5,WE=.6,GE=.2,VE=.35;Hf=128,qf=4,KE=64,Kf=250,Bi=class extends Error{};Yf=new WeakMap;Xf=40,Jf=40,Or=30;Me=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";XE=25,JE=15;hh=40,QE="tests edges are recorded module to module, so this is module-grain coverage.";Vt=15;wh=new Set(["Function","Method"]);ZE=8;Rh={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};tS=8,nS=16,sS=4,oS=6,rS=12,iS=2,aS=8,cS=3,pl=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),Qf=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),qi=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},lS=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};fl=20;hl=40});function Ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Uh(e){let t=String(e||"");return Nh&&(t=t.replace(Nh," ")),t.replace(/\s+/g," ").trim()}function Bh(e){let t=String(e||"");t=t.replace(AS," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(_S);if(o&&(t=o[1].trim()),o=t.match(RS),o&&(t=o[1].trim()),o=t.match(Ph),o&&(t=o[1].trim()),o=t.match(Mh),o&&(t=o[1].trim()),o=t.match(Fh),o&&(t=o[1].trim()),o=t.match(TS),o&&(t=o[1].trim()),o=t.match(Dh),o&&(t=o[1].trim()),o=t.match(IS),o&&(t=o[1].trim()),o=t.match(CS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(OS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(LS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(NS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(PS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(MS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(FS),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(DS),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(zS),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(US),o){let r=o[1].trim();jS(r)||(t=!BS.test(r)&&(ES.test(r)||js.test(r))?r:`describe ${r}`)}if(o=t.match(WS),o){let r=o[1].trim();(js.test(r)||GS.test(r)||Dh.test(r)||Ph.test(r)||Fh.test(r)||Mh.test(r)||VS.test(r))&&(t=r)}if(t===s)break}return t}function KS(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(HS);if(o&&(t=o[1].trim()),o=t.match(qS),o&&(t=o[1].trim()),t===s)break}return t}function XS(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(YS);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function ZS(e){let t=String(e||""),n=t.match(QS);if(n){let o=Gh[n[1].toLowerCase()],r=Wh[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(Vh);return s?`which modules transitively import ${s[1].trim()}`:t}function Yi(e){return String(e||"").replace(mS,t=>Jc[t.toLowerCase()])}function ro(e){let t=Yi(e);return t=t.replace(gS,n=>Qc[n.toLowerCase()]),t=t.replace(bS,n=>Zc[n.toLowerCase()]),t=t.replace(wS,"with"),t=t.replace(yS,(n,s)=>`${s} for`),t=t.replace($S,(n,s)=>`for ${s}`),t=t.replace(vS,(n,s)=>s),t=t.replace(ek,"$1$2"),t=t.replace(uf,"$1ing"),t=Bh(t),t=XS(t),t=KS(t),t=ZS(t),t=Uh(t),t=nn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Lr(e){for(let t of[...pf,...df]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function vl(e){for(let t of tk){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Hh(e){let t=String(e||"").match(nk);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var hS,mS,zh,gS,bS,wS,yS,$S,vS,xS,Nh,ES,js,SS,kS,jS,_S,RS,Ph,Mh,Fh,TS,AS,IS,CS,OS,LS,NS,PS,MS,FS,DS,zS,US,BS,WS,GS,VS,Dh,HS,qS,YS,Wh,Gh,JS,QS,Vh,ek,tk,nk,nt,Ht,fe,vn=O(()=>{Qn();hS=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b","gi"),mS=hS(Jc),zh=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b(?!\\.[a-z0-9])","gi"),gS=zh(Qc),bS=zh(Zc),wS=/(?<=^|\s)w\/(?=\s|$)/gi,yS=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,$S=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,vS=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,xS=Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|"),Nh=_r.length?new RegExp("\\b("+[..._r].sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b\\s*,?","gi"):null;ES=new RegExp("\\b(?:"+Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b","i"),js=/^(?:which|what|who|whose|where|when|why|how)\b/i,SS=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),kS=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,jS=e=>{if(kS.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return SS.has((t[t.length-1]||"").toLowerCase())},_S=/^(?: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,RS=/^(?: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,Ph=/^(?:(?:ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|(?:just\s+)?(?:one|another)\s+more|another\s+one)[\s,]+)+(.+)$/i,Mh=/^(?: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,Fh=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,TS=/^(?:please[\s,]+)+(.+)$/i,AS=/,?\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,IS=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,CS=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,OS=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,LS=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,NS=/^do\s+you\s+know\s+(.+?)\??$/i,PS=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,MS=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,FS=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,DS=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,zS=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,US=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,BS=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,WS=/^(?:and|also|so|then|now|but)\s+(.+)$/i,GS=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,VS=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,Dh=/^(?:(?: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;HS=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,qS=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;YS=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;Wh=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),Gh=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),JS="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",QS=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(Gh).join("|")+")\\s+("+Object.keys(Wh).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+JS+")\\??$","i"),Vh=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;ek=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${Yc.map(Ze).join("|")})(\\s*[?.!]*)$`,"i");tk=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+(?:${Xc.map(Ze).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${xS})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);nk=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");nt=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),Ht=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),fe=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var Kh,qh=O(()=>{Kh={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 rs(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let l=1;l<=t.length;l+=1){let c=e[r-1]===t[l-1]?0:1,u=Math.min(o[l]+1,i[l-1]+1,o[l-1]+c);r>1&&l>1&&e[r-1]===t[l-2]&&e[r-2]===t[l-1]&&(u=Math.min(u,s[l-2]+c)),i[l]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function El(e){return/^[a-z]+$/.test(e)&&!nt.has(e)&&!xl.has(e)}function Jh(e){return ik(e)?null:Xi(e,Xh,is(e))}function Xi(e,t,n=is(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=rs(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 ok,is,xl,Yh,Xh,rk,ik,Uo=O(()=>{Qn();qh();vn();ok=["used"];is=e=>e.length<=5?1:2,xl=new Set([...Object.keys(de),...Object.keys(We),...Object.keys(sn),...ok].flatMap(e=>e.split(" "))),Yh=4,Xh=[...new Set([...Object.keys(de),...Object.keys(sn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=Yh))],rk=new Set(Kh.words),ik=e=>rk.has(e)});function Bo(e){for(let t of uk){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Ji,ak,ck,lk,Sl,uk,Qh,Qi=O(()=>{Qn();vn();Ji=Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|"),ak=Object.keys(We).sort((e,t)=>t.length-e.length).map(Ze).join("|"),ck=Object.keys(sn).sort((e,t)=>t.length-e.length).map(Ze).join("|"),lk=Js.slice().sort((e,t)=>t.length-e.length).map(Ze).join("|"),Sl=(e,t)=>e==="defines"&&jr.has(t),uk=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Ji})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];if(Sl(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+(${ak})\\s+(?:(${ck})\\s+)?(${Ji})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=de[t];return Sl(n,t)?null:{shape:"reverse",entityType:We[e[1].toLowerCase()],modifier:e[2]?sn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Ji})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];return Sl(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+(?:${lk})\\??$`,"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=nn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!We[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&cf.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:vs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${$n.map(Ze).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${tn.map(Ze).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${Ji})\\??$`,"i"),build:e=>de[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()})}];Qh={id:"grammar",class:"graph-query",run(e){let t=Bo(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function Zh(e){let t=e.trim().split(/\s+/);return t.length>1&&Oi.has(t[0].toLowerCase())}function hk(e){return de[e.trim().toLowerCase()]==="calls"}function At(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,l)=>n.has(i+l)))&&r.every((a,l)=>e[i+l]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function Pr(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(E=>E.toLowerCase());if(s.includes("where")&&!At(s,de)){let E=s.some(_=>$n.includes(_)),S=new Set([...tn,...$n]),R=n.filter((_,I)=>!nt.has(s[I])&&!S.has(s[I])).join(" ").trim();if(R){let _=E?"mentions":"where";return{shape:_,entityType:null,modifier:"direct",kind:_,object:R}}}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?de[s[E-1]]:null)==="touches"){let R=n.slice(1,E-1).filter((_,I)=>!nt.has(s[1+I])).join(" ").trim();if(R)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:R}}}let r=s,i=At(s,de);if(!i&&t){let E=s.map(S=>{if(!El(S))return S;let R=t.lemma(S);return xl.has(R)?R:S});i=At(E,de),i&&(r=E)}let a=null;if(!i){let E=s.map(S=>S.length>=4&&El(S)&&Jh(S)||S);if(i=At(E,de),i){r=E;let S=s.slice(i.start,i.end).findIndex((_,I)=>_!==E[i.start+I]),R=i.start+Math.max(S,0);a={from:s[R],to:E[R]}}}let l=!1;if(!i)for(let E=0;E<s.length;E+=1){let S=xs[s[E]];if(!(S&&s[E]==="used"&&s[E+1]==="for")&&S&&s.slice(0,E).some(R=>Nr.has(R))){i={kind:S,start:E,end:E+1},l=!0;break}}if(!i)return null;!l&&i.end-i.start===1&&xs[s[i.start]]&&s.slice(0,i.start).some(E=>Nr.has(E))&&(l=!0);let c=E=>a?{...E,fuzzyVerb:a}:E;if(t&&i.end-i.start===1){let E=i.start,S=s[E-1];if((S==="the"||S==="these"||S==="those")&&s[E+1]==="of"&&t.posTags(n)[E]==="NOUN"){let _=n.slice(E+2).filter((I,P)=>!nt.has(s[E+2+P])).join(" ").trim();if(_)return c({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:_})}}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(de)){if(S!==i.kind)continue;let R=E.split(" "),_=i.end;if(R.every((I,P)=>r[_+P]===I)){d({start:_,end:_+R.length});break}}let f=At(r,We,u);d(f);let p=At(r,sn,u);d(p);let h=(E,S)=>n.slice(E,S).filter((R,_)=>!u.has(E+_)&&!nt.has(s[E+_])).join(" ").trim(),m=h(0,i.start),b=h(i.end,n.length);l&&!s.includes("by")&&fk.has(b.toLowerCase())&&(b="");let g=i.kind,y=f?We[r.slice(f.start,f.end).join(" ")]:null,w=p?sn[r.slice(p.start,p.end).join(" ")]:"direct";if(g==="touches"&&s.includes("when")){let E=m||b;if(E)return c({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:E})}if(g==="touches"&&s.includes("who")&&s.includes("last")){let E=m||b;if(E)return c({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:E})}let v=s.indexOf("by"),k=s.slice(0,i.start).findIndex(E=>Nr.has(E)),$=k>=0,x=$&&k>v;if(v>=0&&!u.has(v)&&$){let E=(_,I)=>n.slice(_,I).filter((P,T)=>{let F=_+T,U=s[F];return!u.has(F)&&!nt.has(U)&&U!=="by"&&!Nr.has(U)&&!dk.has(U)&&!pk.has(U)}).join(" ").trim(),[S,R]=x?[E(k+1,n.length),E(v+1,k)]:[E(0,v),E(v+1,n.length)];if(S&&R)return g==="defines"&&jr.has(r.slice(i.start,i.end).join(" "))?null:c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:R,object:S});if(R)return c({shape:"forward",entityType:y,modifier:w,kind:g,object:R});if(S)return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:S})}if(l&&v<0&&b&&s[i.start]==="called")return null;if(m&&b){let E=r.slice(i.start,i.end).join(" ");if(g==="defines"&&jr.has(E)||g==="calls"&&(Zh(b)||hk(m)))return null;let S=m,R=b;return kr.includes(E)&&([S,R]=[R,S]),c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:S,object:R})}if(b){if(g==="calls"&&Zh(b))return null;let E=f&&f.start>=i.end?null:y;return c({shape:"reverse",entityType:E,modifier:w,kind:g,object:b})}if(g==="inherits"&&!m&&f&&f.start===i.end){let E=r.slice(f.start,f.end).join(" ");if(E)return c({shape:"reverse",entityType:null,modifier:w,kind:g,object:E})}if(m&&!b&&$&&i.end-i.start===1&&xs[s[i.start]]){if(m.split(/\s+/).length>1)return null;if(g==="touches")return c({shape:"when",entityType:null,modifier:"direct",kind:g,object:m});let E=Nr.has(s[0]);return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:m,...E?{polar:!0}:{}})}return m?c({shape:"forward",entityType:y,modifier:"direct",kind:g,object:m}):null}var Nr,dk,pk,fk,em,Zi=O(()=>{Qn();vn();Uo();Nr=new Set(["is","are","was","were","be","been","being","get","gets","got"]),dk=new Set(["which","what","who","whom","whose"]),pk=new Set(Jn.map(e=>e.toLowerCase())),fk=new Set(["recently","lately","yet","already","ever","again"]);em={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Pr(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function gk(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],l=a.toLowerCase();!/^[a-z]+$/.test(a)||tm.has(l)||!s.has(l)||o[i]==="VERB"&&r.push(l)}return r}function bk(e,t=null){let n=Ht(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!tm.has(a)&&(mk.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=gk(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var tm,mk,nm,sm=O(()=>{Qn();vn();Qi();Zi();tm=new Set([...nt,...fe(Xs),...fe(Object.keys(de)),...fe(Object.keys(We)),...fe(Object.keys(sn)),...fe(Object.keys(Je)),...fe(Qs),...fe(Zs),...fe(Object.keys(Es)),...fe(Object.keys(In)),...fe(Object.keys(Ao)),...fe(Jn),...fe(Rr),...fe(Js),...fe(tn),...fe($n),...fe(Xn),...fe(Object.keys(Co))]),mk=new Set([...fe(_r),...fe(Li)]);nm={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Bo(e))return null;let{text:n,dropped:s,maybeNoise:o}=bk(e,t.nlp||null);if(!s.length||!n)return null;let r=Bo(n)||Pr(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 om=O(()=>{});var ea,ta=O(()=>{ea=()=>{}});function im(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Wo(e.subject)===Wo(t.subject)&&Wo(e.object)===Wo(t.object):Wo(e.object)===Wo(t.object)}function kl(e){let t=(e||[]).filter(c=>c&&Array.isArray(c.candidates)&&c.candidates.length);if(!t.length)return null;let n=[];for(let c of t)for(let u of c.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:c.strategyId,class:c.class});if(n.some(c=>!am(c))&&(n=n.filter(c=>!am(c))),!n.length)return null;let s=new Map;for(let c of n)s.has(c.class)||s.set(c.class,[]),s.get(c.class).push(c);let o=[];for(let[c,u]of s){let d=[];for(let f of u){let p=d.find(h=>im(h.parsed,f.parsed)&&h.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),rm(f.parsed)<rm(p.parsed)&&(p.parsed=f.parsed);continue}d.push({...f,agreed:1})}d.length&&o.push({class:c,candidates:d})}if(!o.length)return null;let r=c=>Math.max(...c.candidates.map(u=>u.confidence)),i=o[0];for(let c of o)r(c)>r(i)&&(i=c);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(c=>c.parsed)},l=o.filter(c=>c!==i).map(c=>c.candidates[0]).filter(c=>!i.candidates.some(u=>im(u.parsed,c.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:l}}function $k(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 cm(e,{describe:t=$k,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 Wo,wk,rm,yk,am,jl=O(()=>{Wo=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),wk=/^\s*(?:the|a|an)\s+/i,rm=e=>[e?.subject,e?.object].filter(t=>wk.test(String(t||""))).length;yk=new Set(["fuzzy","lemma","spell"]),am=e=>yk.has(e.via)});function na(e){_l=e}function sa(){return typeof _l=="function"?_l():null}var _l,Go=O(()=>{_l=null});function dm(e,t={},n=xk){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 vk,xk,pm=O(()=>{vn();Qi();Zi();sm();om();ta();jl();Go();vk=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],xk=[Qh,em,nm,...vk]});function Vo(e){return Ek.test(String(e||"").trim())?"an":"a"}function oa(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 Ho(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Mr(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 Ek,ra=O(()=>{Ek=/^[aeiou]/i});var Fr,Rl=O(()=>{Fr=(e,t,n)=>n});var tg={};Wt(tg,{DYNAMIC_TAIL_OK_RE:()=>nu,applyNegationFrames:()=>Lr,ask:()=>As,classDisplayName:()=>as,degreeMetric:()=>Hm,metaFallbackEntityAnswer:()=>Dm,normalizeQuery:()=>ro,parseQuery:()=>Wr,parseQueryFull:()=>Wl,render:()=>En,rephraseHint:()=>Xl,resolveObject:()=>Sn,traverse:()=>qt,worldRelationGraphPayload:()=>b_});function Ke(e,t){let n=fm.get(e);n||(n=new Map,fm.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(os(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Fe(e,t){let[n,s]=Ll[e]||["result","results"];return t===1?n:s}function Vr(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 as(e){let t=String(e||"");if(typeof Cn=="function"){let n=Cn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function io(e){return kk[e]||e}function Ak(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||Tk.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return fe(Js).includes(o)?t:e}function Ok(e,t){if(!e||e.shape!=="where"||e.altObject||!Ik.test(t))return e;let n=Ci(t),s=Ci(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=Ht(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||nt.has(i)||de[i]||i.endsWith("ing"))return o;let a=Ht(n).map(c=>c.toLowerCase());for(;a.length&&Ck.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let l=r.slice(0,-1).join(" ");return{...e,object:l,altObject:s,verb:i}}function Wr(e,{nlp:t=void 0}={}){return Wl(e,{nlp:t}).parsed}function Wl(e,{nlp:t=void 0}={}){let n=t===void 0?sa():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=vl(Lr(ro(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=Nk(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=kl(dm(o,{nlp:n,raw:s}));return i?{parsed:Ok(Ak(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Pl(e,t){return t.length&&Tm.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Yo(e,t){return Bo(e)||Pr(e,t)}function Nk(e,t){let n=Ht(e),s=n.map(o=>o.toLowerCase());return tj(n,s)||sj(n,s)||Dk(n,s,t)||Im(e,t,0)||oj(n,s,t)||Uk(n,s,t)||Kk(n,s,t,0)||Xk(n,s)||Zk(n,s,t)||rj(n,s,t)||cj(n,s,t)||uj(n,s,t,0)||aj(n,s,t,0)||Vl(n,s,t,0)||Wk(n,s,t)||Mk(n,s)||Mm(n,s,t,0)}function Mk(e,t){let n=0;Pk.has(t[n])&&(n+=1);let s=It(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=h=>h+1<t.length?lf[`${t[h]} ${t[h+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,l=-1,c;for(let h=a;h+1<t.length;h+=1){let m=r(h);if(m){l=h,c=m;break}}if(l<0)return null;let u=e.slice(a,l).join(" ").trim(),d=e.slice(l+2).join(" ").trim();if(!u||!d)return null;let f=(h,m)=>h.role==="object"?{shape:"reverse",kind:h.kind,entityType:o,modifier:"direct",object:m}:{shape:"forward",kind:h.kind,modifier:"direct",object:m},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(c,d)}}]}}function aa(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function Dk(e,t,n){if(!["do","does","did"].includes(t[0])||!Fk.has(t[1]))return null;let s=It(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let l=At(a,de);if(!l)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<l.start||p>=l.end)&&!nt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=Xo(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:l.kind,object:u,complement:aa(o,{op:"difference",kind:"set",ast:d})}}function Im(e,t,n=0){let s=Hh(e);if(!s)return null;let o=It(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=Ht(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Je[d]))return aa(r,{op:"difference",kind:"qual",filters:a});let l=At(a,de);if(!l)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,f)=>(f<l.start||f>=l.end)&&!nt.has(a[f])&&a[f]!=="from").length)return aa(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:l.kind}});let u=Xo(`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"}:aa(r,{op:"difference",kind:"set",ast:u})}function Uk(e,t,n){let s=0;for(;s<t.length&&zk.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=At(r,de);if(!a)return null;let c=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!nt.has(r[d])).join(" ").trim();return c?{node:"forwardComplement",kind:a.kind,subjectTerm:c}:null}function Cm(e,t){let n=new Set;for(let s of t)for(let o of Ke(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function Om(e,t){let n=Pt(t),s=n.filter(r=>!_m.has(r)),o=Cm(e,s.length?s:n);return o.size===1?[...o][0]:null}function Xo(e,t,n){if(n>Rm)return{node:"miss",reason:"too deep to resolve"};let s=Im(e,t,n);if(s)return s;let o=Ht(e),r=o.map(c=>c.toLowerCase()),i=Vl(o,r,t,n);if(i)return i;let a=Mm(o,r,t,n);if(a)return a;let l=Yo(e,t);return l?{node:"clause",clause:l}:null}function Vl(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=Xn.includes(t[o]),i=!r&&Am(t[o]);if(!r&&!i||r&&o+1>=t.length||!It(t[o-1]))continue;let l=e.slice(0,o-1);if(!l.length||l.every(f=>Je[f.toLowerCase()]))continue;let c=Yo([...l,Nl].join(" "),n);if(!c||c.shape!=="reverse"&&c.shape!=="forward"||c.modifier&&c.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=Xo(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:c.shape==="reverse"?"reverseSet":"forwardSet",kind:c.kind,entityType:c.entityType,inner:d}}return null}function Wk(e,t,n){for(let s=0;s<t.length;s+=1){if(!Bk.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!de[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Nl,...e.slice(s+1)],a=Yo(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Nl&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function Kk(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!Gk.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(Vk.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&&Hk.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&qk.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>Xn.includes(d)))return null;let l=Gl.has(a[0])?i.join(" "):`which ${i.join(" ")}`,c=Xo(l,n,s+1);if(!c||c.node==="miss")return c?{node:"miss",reason:c.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=It(a[0]);return{node:"temporal",inner:c,entityType:u&&u.entityType||null}}function Xk(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!Yk.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 Qk(e){let t=new Set,n=[];for(let s of e){if(!s||!Jk.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function Zk(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(!Rr.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&&(Qs.includes(f)||Zs.includes(f))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=Qs.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=ej(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let l=o?s-1:s,c=Qk(e.slice(0,l)),u={node:"anaphora",mode:i,filter:a};return c.length>=2&&(u.candidateTerms=c),u}function ej(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&Lk.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Je[a]))return{type:"qual",filters:r};if(o.length===1){let a=It(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Yo(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function tj(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?It(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let l=i.indexOf("in",1);if(l>0){let u=a.slice(1,l).join(" ").trim(),d=a.slice(l+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:c,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:null,scopeModule:l}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function nj(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=vs(n).slice(e.length).trim(),o=Ht(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 sj(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let c=1;c<t.length;c+=1)if(Je[t[c]]){n=c,s=t[c-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&xs[t[n]]){let c=o+1;for(;c<t.length&&(t[c]==="the"||t[c]==="a"||t[c]==="an");)c+=1;let u=t[c];if(u&&!ff.has(u))return null}let r=nj(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let l=a>i?e.slice(i,a).join(" ").trim():"";return l?{node:"qualCheck",term:l,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function oj(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=Yo(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function rj(e,t,n){let s=Qs.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&&Je[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?It(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let l=e.slice(o),c=t.slice(o).some(d=>!nt.has(d)&&!Lm.has(d)),u;if(c){let d=Xo(`which ${a} ${l.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function aj(e,t,n,s){let o=0,r=!1,i=null;for(let y of Nm){let w=y.split(" ");if(t.slice(0,w.length).join(" ")===y){i=y,o=w.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&Hl.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Je[t[o]];)a.push(t[o]),o+=1;let l=o<t.length?It(t[o]):null;if(!l||l.placeholder||l.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Jn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Pm}`}:null;let c=l.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some(y=>!nt.has(y)&&!Lm.has(y)),p=t.slice(o),h=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),h=h.slice(1));let m=r&&ij.has(p[0]);if(r&&(f&&!m||d.length===0))return null;let b,g=!1;if(f){let y=m?h:d,w=Xo(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!w||w.node==="miss")return{node:"miss",reason:w&&w.reason||"the list filter didn't parse"};b=w,g=!0}else b={node:"allOfClass",entityType:c},a.length&&(b={node:"qualifier",filters:a,inner:b});return{node:"list",entityType:c,base:b,scoped:g}}function cj(e,t,n){let s=null,o=-1;for(let h=0;h<t.length;h+=1){let m=t.slice(h,h+2).join(" ");if(Es[m]){s=Es[m],o=h;break}if(Es[t[h]]){s=Es[t[h]],o=h;break}}if(!s)return null;let r=null,i=null;for(let h=o;h<t.length;h+=1)if(In[t[h]]){r=In[t[h]],i=t[h];break}if(!r){for(let h=o-1;h>=0;h-=1)if(In[t[h]]){r=In[t[h]],i=t[h];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),l=["important","significant","central","key","core","essential","critical","principal"],c=t.some(h=>l.includes(h));!r&&(a||c)&&(r=In.connections,i="connections");let u,d=null;for(let h of t){let m=It(h);if(m&&!m.placeholder){u=m.entityType,d=h;break}}if(!d&&(u=i?hf[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(h=>f.includes(h))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:p}}function uj(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Hl.has(t[o]);)o+=1;if(o>=t.length)return null;let r=It(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&lj.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=It(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=>Xn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Jn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Pm}`}:null}function dj(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Hl.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(Xn.includes(t[i])){s=i;break}if(s<0)return null;let o=It(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 pj(e,t,n,s,o,r){let{branches:i,ops:a}=ca(n,s),l=null,c=[];for(let u=0;u<i.length;u+=1){let d=i[u],f=d.map(y=>y.toLowerCase()),p=u===0?"intersection":a[u-1],h=Pl(d,f);if(h.blc.length&&h.blc.every(y=>Je[y])){c.push({op:p,kind:"qual",filters:h.blc});continue}if(f[0]==="of"||f[0]==="in"){c.push({op:p,kind:"set",ast:{node:"membership",entityType:e,term:d.slice(1).join(" ")}});continue}let m=d,b=At(f,de);b?l=d.slice(b.start,b.end):l&&(m=[...l,...d]);let g=Fm(`${t} ${m.join(" ")}`,o,r);if(!g||g.node==="miss")return{miss:g&&g.reason||"a clause in the combination didn't parse"};c.push({op:p,kind:"set",ast:g})}return{atoms:c}}function Mm(e,t,n,s){let o=dj(e,t);if(o){let{entityType:R,term:_,relIdx:I}=o,P=t.slice(I+1),T=e.slice(I+1);if(!P.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[I]}"`};let F=pj(R,`which ${t[I-1]}`,P,T,n,s+1);if(F.miss)return{node:"miss",reason:F.miss};let U=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:_}},...F.atoms];return U.length===1?U[0].ast:{node:"boolean",entityType:R,atoms:U}}let r=0;for(;r<t.length&&Gl.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Je[t[r]];)a.push(t[r]),r+=1;let l=r<t.length?It(t[r]):null;if(!l){let R=r+1<t.length?It(t[r+1]):null;if(hm.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(Tm.has(t[r])){let _=r+1;_<t.length&&(t[_]==="the"||t[_]==="a"||t[_]==="an")&&(_+=1);let I=_+1<t.length?It(t[_+1]):null;if(hm.has(t[_])&&I&&I.entityType==="Commit"&&_+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!de[t[r]]&&!nt.has(t[r])&&!eu.has(t[r])?{node:"find",entityType:R.entityType,term:e[r]}:null}let c=l.entityType,u=t[r];r+=1;let d=t.slice(r),f=e.slice(r),p=!1;d.length&&Xn.includes(d[0])&&(p=!0,d=d.slice(1),f=f.slice(1));let h=d[0]==="of"||d[0]==="in",m=d.length>0&&Am(d[0]),b=f.length>0&&ca(d,f).branches.some(R=>{let{blc:_}=Pl(R,R.map(I=>I.toLowerCase()));return _.length&&_.every(I=>Je[I])}),g=f.length>0?ca(d,f).branches:[],y=!1;if(g.length>1){let R=g[0].map(I=>I.toLowerCase()),_=At(R,de);_&&_.start===0&&(y=g.slice(1).every(I=>{let P=I.map(F=>F.toLowerCase()),T=At(P,de);return T&&T.start===0?T.kind===_.kind:!T}))}let w=!1;if(g.length>1){let R=g[0].map(I=>I.toLowerCase()),_=At(R,de);_&&_.start===0&&(w=g.slice(1).every(I=>{let P=I.map(F=>F.toLowerCase()),T=At(P,de);return!!T&&T.start===0&&T.end-T.start===1}))}if(!(a.length||p||h||m||b||y||w))return null;if(!f.length){let R={node:"allOfClass",entityType:c};return a.length?{node:"qualifier",filters:a,inner:R,entityType:c}:{node:"miss",reason:"nothing to filter or traverse"}}let v=l.placeholder?"what":`which ${u}`,{branches:k,ops:$}=ca(d,f),x=null,E=[];for(let R=0;R<k.length;R+=1){let _=k[R],I=_.map(ce=>ce.toLowerCase()),P=R===0?"seed":$[R-1],T=Pl(_,I);if(T.blc.length&&T.blc.every(ce=>Je[ce])){E.push({op:P,kind:"qual",filters:T.blc});continue}if(I[0]==="of"||I[0]==="in"){E.push({op:P,kind:"set",ast:{node:"membership",entityType:c,term:_.slice(1).join(" ")}});continue}let F=_,U=At(I,de);U?x=_.slice(U.start,U.end):x&&(F=[...x,..._]);let K=Fm(`${v} ${F.join(" ")}`,n,s+1);if(!K||K.node==="miss")return{node:"miss",reason:K&&K.reason||"a clause in the combination didn't parse"};E.push({op:P,kind:"set",ast:K})}if(E[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let S;return E.length===1?S=E[0].ast:S={node:"boolean",entityType:c,atoms:E},a.length&&(S={node:"qualifier",filters:a,inner:S,entityType:c}),S}function Fm(e,t,n){if(n>Rm)return{node:"miss",reason:"too deep to resolve"};let s=Ht(e),o=s.map(a=>a.toLowerCase()),r=Vl(s,o,t,n);if(r)return r;let i=Yo(e,t);return i?{node:"clause",clause:i}:null}function ca(e,t){let n=Object.keys(Ao).sort((a,l)=>l.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let l of n){let c=l.split(" ");if(e.slice(i,i+c.length).join(" ")===l){a={c:l,len:c.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(Ao[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 ql(e,t,n,s){let o=qo[t];if(o&&Ts.has(n)){let u=Ke(e,o).filter(d=>s.has(d.object));return ls(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Ts.has(e.byId.get(u)?.class))?[...Pt(t),o]:Pt(t)).flatMap(u=>Ke(e,u)).filter(u=>s.has(u.object)),l=ls(a.map(u=>e.byId.get(u.subject)).filter(Boolean));if(!n||n==="Change")return l;let c=l.filter(u=>u.class===n);return c.length?c:n!=="Module"&&l.some(u=>u.class==="Module")?Jl(e,new Set(l.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function hj(e,t){let n=new Set(ql(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=fj.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function Ur(e,t,n){let s=Pt(t).flatMap(o=>Ke(e,o)).filter(o=>n.has(o.subject));return ls(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ls(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 mj(e,t){let n=ns(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&ns(o.label).startsWith(s))}function Ml(e){let t=mm.get(e);if(t)return t;let n=new Set;for(let i of Ke(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 Ke(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of Ke(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},mm.set(e,t),t}function Ko(e,t){return t?t.class==="Module"?t.id:Ml(e).moduleOfSymbol.get(t.id)||null:null}function Dm(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>gj.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Ko(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),l=a==="attribute"?"an":"a",c=i?`, ${Fr("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${l} ${a} in this codebase${c} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function Fl(e,t,n){let s=ls(Io.flatMap(o=>Ur(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function Kl(e,t,n=null){let s=cs(e,t,n);if(!(s.match&&s.tier===1)){let o=mj(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 zm(e,t,n,s,o){let r=o||(()=>!0),i=Fl(e,t,s).filter(r);if(i.length||!Bm(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of Um(e,t)){let l=e.byId.get(a);if(!l)continue;let c=Fl(e,a,s).filter(r);if(c.length)return{own:i,inherited:c,viaId:a,viaLabel:l.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function ao(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=Ml(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=Ko(e,t),o=Ml(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&no(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function Yl(e){return Ke(e,"inherits")}function Dl(e,t){return Yl(e).filter(n=>n.object===t).map(n=>n.subject)}function gm(e,t){return Yl(e).filter(n=>n.subject===t).map(n=>n.object)}function bj(e,t){let n=new Set,s=[...Dl(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Dl(e,o))n.has(r)||s.push(r)}}return n}function Um(e,t){let n=new Set,s=[...gm(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of gm(e,o))n.has(r)||s.push(r)}}return n}function Bm(e,t){let n=bm.get(e);if(n||(n=new Map,bm.set(e,n)),n.has(t))return n.get(t);let s=Yl(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 wm(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 $m(e){return e.slice().sort((t,n)=>ym[n.via]-ym[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function vm(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=is(n);if(rs(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of co(e.label))if(rs(o,n,s)<=s)return!0;return!1}function Wm(e,t,n){let s=e.individuals.filter(l=>l.class===t),o=[...co(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=Bm(e,t),i=[];for(let l of s){let c=wm(l,o);if(c){i.push({ind:l,via:c});continue}if(!r)continue;[...bj(e,l.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!wm(f,o)})&&i.push({ind:l,via:"chain"})}if(i.length||!r)return{narrow:$m(i),broad:[]};let a=new Map;for(let l of s)for(let c of Um(e,l.id)){if(!a.has(c)){let u=e.byId.get(c);u&&u.class===t&&vm(u,n)&&a.set(c,{ind:u,via:"chain"})}for(let u of Dl(e,c)){if(u===l.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&vm(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:$m([...a.values()])}}function wj(e){return[...Vi(Hi(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function pn(e,t,n){switch(t.node){case"clause":return qt(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?wj(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=Wm(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Pt(t.kind).flatMap(o=>Ke(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=cs(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=Om(e,t.kind);if(!o)return[];let r=new Set(Ur(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(pn(e,t.inner,n).map(o=>o.id));return ql(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(pn(e,t.inner,n).map(o=>o.id));return Ur(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=Kl(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(l=>l.id));return ls(Io.flatMap(l=>Ur(e,l,i))).filter(l=>l.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=zm(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?qm(e,t,n).matches:pn(e,t.inner,n).filter(o=>t.filters.every(r=>ao(e,o,Je[r])));case"boolean":return Gm(e,t,n);case"anaphora":return Vm(e,t,n).matches;default:return[]}}function Gm(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=pn(e,o.ast,n);continue}if(o.kind==="qual"){let i=l=>o.filters.every(c=>ao(e,l,Je[c])),a=l=>o.filters.every(c=>{let u=yj(Je[c]);return u?ao(e,l,u):!ao(e,l,Je[c])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(pn(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 pn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function $j(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=Sn(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 Vm(e,t,n){let o=$j(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=>ao(e,d,Je[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=Sn(e,i.clause.object);if(!d.match)r=[];else{let f=qo[i.clause.kind],p=[...Pt(i.clause.kind),...f?[f]:[]],h=new Set(p.flatMap(m=>Ke(e,m)).filter(m=>m.object===d.match.id).map(m=>m.subject));r=r.filter(m=>h.has(m.id))}}let a=d=>d.length&&d.every(f=>f.class===d[0].class)?d[0].class:null,l=i&&i.type==="entity"?i.entityType:a(o),c=r.length?a(r):l;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:c,matches:[]};let u=Vr(c,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:c,referents:u}}function Hm(e,t,n){let s=n.kind==="*"?vj:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of Ke(e,r)){let a=i.subject===t.id,l=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let c=e.byId.get(i.object);if(!c||c.class!==n.filter)continue}o+=1}else(n.dir==="in"&&l||n.dir==="both"&&(a||l))&&(o+=1)}return o}function xj(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 Sj(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(Ej.test(s))r=s;else{let{match:u,ambiguous:d}=Sn(e,s,{expectedClass:"Commit"});u&&!d&&u.class==="Commit"&&o(u)&&(i=u.id,a=u.label,r=o(u))}if(!r)return{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotResolved:!1,matches:[]};let l=e.individuals.filter(u=>u.class==="Commit"&&u.id!==i&&o(u)).filter(u=>{let d=o(u);return n==="since"?d>=r:n==="before"?d<r:n==="after"?d>r:d===r}).sort((u,d)=>o(d).localeCompare(o(u))),c=[];return l.length&&c.push({kind:"set",class:"Commit",label:`${l.length} commit${l.length===1?"":"s"} ${n} ${s}`,ids:l.map(u=>u.id),attrs:{count:l.length,op:n,...i?{pivot:i}:{}},lane:"commitFilter"}),i&&c.push({kind:"event",class:"Commit",label:a,ids:[i],attrs:{date:r},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:r,pivotResolved:!0,matches:l,referents:c}}function kj(e,t,n){let s=pn(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=ql(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(l=>l.key==="date")?.value||"");return r.sort((a,l)=>i(l).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function jj(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(Ke(e,"tests").map(l=>l.subject));n=n.filter(l=>!a.has(l.id)&&!no(String(l.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:Hm(e,a,t.metric)})).sort((a,l)=>t.extreme==="most"?l.score-a.score:a.score-l.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?Vr(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 qm(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?h=>s.filters.every(m=>ao(e,h,Je[m])):null,a=h=>Vr(r,h,"membership"),l=Kl(e,o.term,n&&n.contextId);if(l.kind==="dir"){let h;if(!r||r==="Module")h=l.mods;else{let m=new Set(l.mods.map(b=>b.id));h=ls(Io.flatMap(b=>Ur(e,b,m))).filter(b=>b.class===r)}return i&&(h=h.filter(i)),{compositeKind:"set",matches:h,entityType:r,referents:a(h)}}if(l.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:c,inherited:u,viaLabel:d}=zm(e,l.id,l.entityClass,r,i),f=!c.length&&u.length>0,p=f?u:c;return{compositeKind:"membership",entityType:r,matches:p,inheritedNotOwn:f,viaLabel:d,ownerLabel:l.label,referents:a(p)}}function _j(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=Sn(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=Sn(e,s,{expectedClass:n}),l=!r||a.match&&Ko(e,a.match)===r.id,c=a.match&&l;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:c?[a.match]:[]}}let i=r?Jl(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 Rj(e,t,n){let s=Ko(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Fl(e,n.id).some(o=>o.id===t.id)}function Tj(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=cs(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=Kl(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!Rj(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let l=ao(e,a.match,Je[o]),c=r?!l:l,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:c,matches:[a.match],referents:u}}function Aj(e,t,n){let s=Sn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=pn(e,{node:"allOfClass",entityType:t.entityType},n),r=Gm(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 Ij(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(pn(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}=qt(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function Cj(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return _j(e,t);if(t.node==="qualCheck")return Tj(e,t,n);if(t.node==="universal")return Aj(e,t,n);if(t.node==="count"){let i=Ij(e,t.base,n);return i?{compositeKind:"count",count:hj(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:pn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:pn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return h_(e,t);if(t.node==="superlative")return jj(e,t);if(t.node==="temporal")return kj(e,t,n);if(t.node==="recentCommits")return xj(e);if(t.node==="commitFilter")return Sj(e,t);if(t.node==="anaphora")return Vm(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return qm(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=Wm(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=pn(e,t,n),o=t.entityType||null,r=Vr(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function Km(){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 Oj(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=Gr(e);return n?`${t} in ${n}`:t}function zl(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(zl):Array.isArray(e.filters)&&e.filters.some(t=>Je[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(zl)}function Lj(e,t){return!["Function","Method"].includes(t)||!zl(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 Nj(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})`:""}. ${Km()}.`,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=Gr(i),l=i.class==="Module"?"":a?`, ${Fr("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${_s(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=_k(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}: ${_s(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>qe?` \u2014 narrow with "${Fe(t.entityType,2)} in <module>"`:"";return{content:`${_s(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=xn(t.asked),o=Ys[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)})`:""}. ${Rs(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}: ${_s(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${_s(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?Oj(t.matches[0]):_s(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,Vt).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Vt?` \u2026+${t.matches.length-Vt} 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,Vt).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Vt?` \u2026+${t.matches.length-Vt} 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:`${_s(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. ${Rs(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. ${Rs(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let l=(i.attributes||[]).find(d=>d.key==="message")?.value||"",c=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${c}${l?` ("${l}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=Lj(e,t.entityType)||Rs(n);return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${_s(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function Xl(){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). `+Km()}function Rs(e=null){return e&&Cr(e)===0?ml:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function co(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function ua(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 Ym(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function Pj(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Dr(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(b=>b.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let b=i[2],g=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${b}`)||String(y.label).toLowerCase().startsWith(b)));if(g.length===1)return{match:g[0],candidates:[],tier:1,ambiguous:!1};if(g.length>1)return{match:g[0],candidates:g.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(b=>String(b.label).toLowerCase()===o||String(b.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let l=`ext:${o}`,c=null;e:for(let b of e.relations)for(let g of b.edges)if(String(g.object).toLowerCase()===l){c=g.object;break e}if(c&&!n)return{match:{id:c,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(b=>b.trim()).filter(Boolean);if(u.length>1){let b=new Set;for(let g of u){let y=Dr(e,g,{expectedClass:n});y.match&&!y.ambiguous&&b.add(y.match.id)}if(b.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],f=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(f){let b=o.split(".").pop();for(let g of r){let y=String(g.label||"").toLowerCase();g.class==="Module"?y.split("/").pop()===o&&d.push({ind:g,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:g,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${b}`)&&d.push({ind:g,score:1500-Math.abs(y.length-o.length)})}}else{let b=[...co(s)],g=o.split(/\s+/).find($=>$.includes("/")),y=g?g.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,k=v?Pj(s):null;for(let $ of r){let x=String($.label||"").toLowerCase(),E=x.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(E===o){d.push({ind:$,score:5e3});continue}if(o.length>=4&&(E.startsWith(o)||E.endsWith(o))){d.push({ind:$,score:4e3-Math.abs(E.length-o.length)});continue}if(v){let _=Ym($.label);if(_&&_===k){d.push({ind:$,score:5e3});continue}let I=/[/_-]/.test($.label)||/\.[a-z0-9]+$/i.test(String($.label||""));if(_&&I&&k.length>=4&&_.includes(k)){d.push({ind:$,score:2e3-Math.abs(_.length-k.length)});continue}}if($.class==="Module"){let _=ua(o);if(_!==o&&_===ua(E)){let I=is(o);if(rs(E,o,I)>I){d.push({ind:$,score:3e3-Math.abs(E.length-o.length)});continue}}}if(o.length>=4&&x.includes(o)){d.push({ind:$,score:1e3-Math.abs(x.length-o.length)});continue}let S=co($.label),R=b.filter(_=>S.has(_)).length;R>0&&(!y||S.has(y))&&d.push({ind:$,score:R/b.length*Al})}}if(d.sort((b,g)=>g.score-b.score),d.length){let[b,...g]=d,y=g.filter(v=>v.score===b.score),w=b.score>=Al?g.filter(v=>v.score>=Al):g;return{match:b.ind,candidates:w.slice(0,4).map(v=>v.ind),tier:3,ambiguous:y.length>0}}let p=f||o.includes("/"),h=null,m=!p&&typeof eo=="function"?eo(e.proseIndex,s).filter(b=>!n||e.byId.get(b.id)?.class===n):[];if(m.length){let[b,...g]=m,y=e.byId.get(b.id);if(y){let w=g.filter(v=>v.score===b.score);if(h={match:y,candidates:g.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!h.ambiguous&&b.via!=="spell")return h}}if(!i&&o.length>=4){let b=is(o),g=b+1,y=[];for(let w of r){let v=rs(String(w.label||"").toLowerCase(),o,b);if(v>0)for(let k of co(w.label)){if(v<=0)break;v=Math.min(v,rs(k,o,b))}v<g?(g=v,y=[w]):v===g&&v<=b&&y.push(w)}if(g<=b&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(g<=b&&y.length>1&&!h){let[w,...v]=y;return{match:w,candidates:v.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return h||{match:null,candidates:[],tier:null,ambiguous:!1}}function Il(e,t){let n=Ym(t),s=[...co(t)],o=[];for(let r of co(e))n.includes(r)||s.some(i=>ua(i)===ua(r))||la.has(r)||Qm.has(r)||o.push(r);return o}function ia(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(Il(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Il(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:xn(s.slice(0,4).map(r=>r.label))}:e}let n=Il(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function Sn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(Mj,"").trim(),i=r.match(Fj);if(i){let a=r.slice(0,i.index).trim(),l=We[i[1].toLowerCase()];if(a&&l){let c=ia(Dr(e,a,{expectedClass:l}),a);if(c?.match?.id&&!c.ambiguous)return c}}if(r&&r!==o){let a=ia(Dr(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return ia(Dr(e,t,n),t)}return ia(Dr(e,t,n),t)}function cs(e,t,n){if(Xs.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 Sn(e,t)}function Jl(e,t,n){let s=[];for(let o of Ke(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 Dj(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Ts.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],l=a.flatMap(c=>Ke(e,c)).filter(c=>c.subject===t.id).map(c=>e.byId.get(c.object)).filter(Boolean);return n&&Ts.has(n)&&(l=l.filter(c=>c.class===n)),{matches:l,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function Wj(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&Ql.has(xm(s.label))).map(s=>({ind:s,named:n.has(xm(s.label))?1:0,depth:String(s.label).split("/").length,fixture:Bj(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 Gj(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function Zl(e){return(e?.attributes||[]).find(t=>t.prop===Vj)?.value||null}function Hj(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Vo(e)} ${e} in this graph's vocabulary`}function qt(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 Cj(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let T=t.candidates.map(F=>{let U=qt(e,F,{contextId:n,prev:s});return{parsed:F,result:U,rendered:En(F,U,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:T}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let T=String(t.object||"").trim(),F=T.toLowerCase(),U=(e.individuals||[]).find(K=>{if(!Zl(K))return!1;if(String(K.label).toLowerCase()===F)return!0;let ce=(K.attributes||[]).find(ie=>ie.key==="token")?.value;return ce&&String(ce).toLowerCase()===F});if(!U){let K=Dm(e,T);return K?{matches:[K.hit],objMatch:K.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:K.text,traversal:`schema lookup for "${T}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}return{matches:[U],objMatch:U,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}if(r==="mentions"){let T=String(t.object||"").trim();return{matches:(typeof eo=="function"?eo(e.proseIndex,T):[]).map(K=>e.byId.get(K.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${T}"`}}if(r==="where"&&zj.test(String(t.object||"").trim())){let T=Wj(e,t.object);return{matches:T,objMatch:T[0]||null,candidates:T.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...Ql].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!Gj(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let T=cs(e,t.subject,n),F=cs(e,t.object,n);if(!T.match||!F.match||T.ambiguous||F.ambiguous)return{matches:[],objMatch:F.match,candidates:F.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(T.unresolvedPronoun||F.unresolvedPronoun)};let[U,K]=[T.match,F.match];i==="touches"&&K.class==="Commit"&&U.class!=="Commit"&&([U,K]=[K,U]);let ce=qo[i],ie=[...new Set(ce?[...Pt(i),ce]:Pt(i))],D=ie.flatMap(B=>Ke(e,B)).filter(B=>B.subject===U.id&&B.object===K.id);return{matches:D,answer:t.negated?D.length===0:D.length>0,objMatch:F.match,subjMatch:T.match,candidates:[],traversal:`${ie.join("+")} edge from ${U.label} to ${K.label}`,ambiguous:!1}}let l;if(o)l={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(l=cs(e,t.object,n),t.altObject&&t.altObject!==t.object){let T=cs(e,t.altObject,n),F=!!l.match&&!l.ambiguous,U=!!T.match&&!T.ambiguous;!F&&U?l=T:F&&U&&l.match.id!==T.match.id&&(l={...l,ambiguous:!0,candidates:[T.match,...l.candidates||[]]})}if(t.kind==="tests"&&l.match&&!l.ambiguous&&!String(t.object||"").includes("/")){let T=K=>K.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),F=T(String(t.object||"").trim().toLowerCase()),U=(e.individuals||[]).find(K=>{if(K.class!=="Module"||K.id===l.match.id)return!1;let ce=String(K.label||"").toLowerCase().split("/").pop();return ce!==T(ce)&&T(ce)===F});U&&(l={...l,ambiguous:!0,candidates:[U,...l.candidates||[]]})}}let{match:c,candidates:u,ambiguous:d,unresolvedPronoun:f,matchedVia:p,unplacedWords:h,nearestLabel:m}=l;if(!c)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:f,unplacedWords:h,nearestLabel:m};if(d){let F=ls([c,...u||[]]).slice(0,qe).map(U=>{let K=qt(e,t,{contextId:n,prev:s,pinnedObjMatch:U});return{candidate:U,result:K,rendered:En(t,K,e)}});return{matches:[],objMatch:c,candidates:u,traversal:null,ambiguous:!0,branches:F}}if(r==="where"){let T=(c.attributes||[]).find(F=>F.key==="site")?.value||null;return{matches:[c],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whereShape:!0,site:T,traversal:T?`site attribute of ${c.label}`:`class + defining module of ${c.label}`}}if(r==="when"){let T=K=>String((K.attributes||[]).find(ce=>ce.key==="date")?.value||""),F;if(c.class==="Commit")F=[c];else{let K=["touches","touchesSymbol"].flatMap(ie=>Ke(e,ie)).filter(ie=>ie.object===c.id),ce=new Set;F=[];for(let ie of K){if(ce.has(ie.subject))continue;ce.add(ie.subject);let D=e.byId.get(ie.subject);D&&D.class==="Commit"&&F.push(D)}F.sort((ie,D)=>T(D).localeCompare(T(ie)))}let U=F.length&&T(F[0])?[{kind:"event",class:"Commit",label:F[0].label,ids:[F[0].id],attrs:{date:T(F[0]).slice(0,10)},lane:"when"}]:[];return{matches:F,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:U,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit date first`}}if(r==="whoLast"){let T=ie=>String((ie.attributes||[]).find(D=>D.key==="date")?.value||""),F=["touches","touchesSymbol"].flatMap(ie=>Ke(e,ie)).filter(ie=>ie.object===c.id),U=new Set,K=[];for(let ie of F){if(U.has(ie.subject))continue;U.add(ie.subject);let D=e.byId.get(ie.subject);D&&D.class==="Commit"&&K.push(D)}K.sort((ie,D)=>T(D).localeCompare(T(ie)));let ce=K.length&&T(K[0])?[{kind:"event",class:"Commit",label:K[0].label,ids:[K[0].id],attrs:{date:T(K[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:K,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:ce,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit's author`}}if(i==="touches"&&c.class==="Commit")return Dj(e,c,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let T=qo[i],U=!!(T&&c.class&&Ts.has(c.class))?[...new Set([...Pt(i),T])]:Pt(i);if(a&&a!=="Change"){let W=Cm(e,U),A=Tl[a];if(W.size&&!W.has(a)&&!(A&&W.has(A)))return{matches:[],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...W],traversal:`${U.join("+")} edges where subject = ${c.label} (grain mismatch: this "${i}" relation never targets a ${as(a)})`}}let ce=U.flatMap(W=>Ke(e,W)).filter(W=>W.subject===c.id).map(W=>e.byId.get(W.object)).filter(Boolean),ie=ls(ce),D=ie,B="";if(a&&a!=="Change"){D=ie.filter(A=>A.class===a);let W=Tl[a];if(!D.length&&W){let A=ie.filter(L=>L.class===W);A.length&&(D=A,B=`, widened to ${W} subjects (no ${a} recorded)`)}}return{matches:D,objMatch:c,candidates:u,traversal:`${U.join("+")} edges where subject = ${c.label}${B}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:Do(e,c,{maxDepth:Em}).flat().map(U=>e.byId.get(U.id)).filter(Boolean),objMatch:c,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${c.label} (impactClosure, maxDepth=${Em})`};let b=qo[i]||Pt(i).find(T=>_m.has(T))||null,g=!!(c.class&&Ts.has(c.class));if(b&&(Ts.has(a)||g)){let T=Ke(e,b).filter(B=>B.object===c.id),F=ls(T.map(B=>e.byId.get(B.subject)).filter(Boolean)),U=!a||a==="Change"?F:F.filter(B=>B.class===a),K="",ce=Tl[a];if(!U.length&&ce){let B=F.filter(W=>W.class===ce);B.length&&(U=B,K=`, widened to ${ce} subjects (no ${a} recorded)`)}let ie=(i==="touches"||i==="calls"||i==="uses")&&c.class==="Class"&&!Ke(e,"contains").some(B=>B.subject===c.id),D=ie?e.byId.get(Ko(e,c)||""):null;if(U.length||!(ie&&D))return{matches:U,objMatch:c,candidates:u,traversal:`${b} edges where object = ${c.label}${K}`,ambiguous:d,matchedVia:p}}let y=c,w=u,v=d,k=p,$="",x=Om(e,i);if(x&&y.class&&y.class!==x){let T=Sn(e,t.object,{expectedClass:x});if(T.match&&!T.ambiguous)y=T.match,w=T.candidates,v=T.ambiguous,k=T.matchedVia;else if(x==="Module"){let F=Ko(e,y),U=F&&e.byId.get(F);if(U)$=`, refined from ${y.label} to its containing module`,y=U;else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${as(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${as(x)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${as(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${as(x)})`}}let E=Pt(i).flatMap(T=>Ke(e,T)).filter(T=>T.object===y.id);i==="cochange"&&(E=E.concat(Pt(i).flatMap(T=>Ke(e,T)).filter(T=>T.subject===y.id).map(T=>({...T,subject:T.object,object:T.subject}))));let S="";if(!E.length&&y.class){let T=`ext:${String(y.label).toLowerCase()}`;E=Pt(i).flatMap(F=>Ke(e,F)).filter(F=>String(F.object).toLowerCase()===T),E.length&&(S=` (by name, via unresolved ${T} references)`)}let R=[],_=new Set;for(let T of E){let F=e.byId.get(T.subject);F&&!_.has(F.id)&&(_.add(F.id),R.push(F))}let I,P="";if(!a||a==="Change")I=R;else{let T=R.filter(F=>F.class===a);if(T.length)I=T;else if(a!=="Module"&&R.some(F=>F.class==="Module")){let F=new Set(R.filter(U=>U.class==="Module").map(U=>U.id));I=Jl(e,F,a),P=`, then ${as(a)} defined in the matched module(s)`}else I=[]}return{matches:I,objMatch:y,candidates:w,traversal:`${Pt(i).join("+")} edges where object = ${y.label}${S}${P}${$}`,ambiguous:v,matchedVia:k}}function Gr(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 Cl(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function qj(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function xn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function zr(e){let t=e.object??e.subject??"?";return`${e.entityType?Fe(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Ul(e){return Sr[e]?.bare||e}function Kj(e){let t=Ul(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function Yj(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 ${Ul(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 ${Ul(o.kind)} ${JSON.stringify(String(r))}`}function Xm(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(zr).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Xm(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?Yj(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 ":""}${io(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 ${io(e.kind)}`:`${r}${io(e.kind)} "${e.object}"`}return{english:o,machine:s}}function En(e,t,n=null){let s=Jm(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function Jm(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${Xl()}`,miss:!0,ambiguous:!1};if(e.node)return Nj(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
- ${t.branches.map((l,c)=>`${c+1}) as ${zr(l.parsed)}: ${l.rendered.content}`).join(`
53
+ `)}`+(o.length>vl?`
54
+ \u2026+${o.length-vl} more`:"")}var xl,Xf,lh,Zf,hE,gE,wl,bE,qi,wE,yE,$E,ph,vE,xE,EE,SE,kE,jE,_E,RE,TE,AE,IE,CE,OE,LE,NE,PE,ME,FE,DE,zE,UE,BE,WE,GE,VE,eh,HE,qE,fh,hh,mh,KE,YE,XE,JE,QE,nh,sh,tS,oh,Vi,rh,ih,ah,Lr,Me,sS,oS,Sh,rS,Ht,Rh,iS,Fh,cS,lS,uS,dS,pS,fS,hS,mS,yl,ch,Xi,gS,$l,vl,Le=O(()=>{Ss();es();fl();Cr();so();xl="This store holds no code index, so it records no modules or commits to look through.",Xf={"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"};lh=e=>/^(git|turn):/.test(String(e||""));Zf=30,hE=8;gE=2,wl=25,bE=3;qi=10,wE=8,yE=3,$E=2,ph=5,vE=4,xE=.2,EE=.35,SE=.15,kE=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),jE=.2,_E=.35,RE=.2,TE=.35,AE=e=>/\.cs$/i.test(e),IE=e=>/^I[A-Z]/.test(String(e||"")),CE=.2,OE=.35,LE=50,NE=.2,PE=.35,ME=.5,FE=ph,DE=3,zE=4,UE=1,BE=.9,WE=.5,GE=.2,VE=.35,eh=4,HE=2,qE=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],fh=3,hh=12,mh=.9,KE=["imports","calls","callsSymbol","inherits"],YE=.5,XE=.6,JE=.2,QE=.35;nh=128,sh=4,tS=64,oh=250,Vi=class extends Error{};rh=new WeakMap;ih=40,ah=40,Lr=30;Me=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";sS=25,oS=15;Sh=40,rS="tests edges are recorded module to module, so this is module-grain coverage.";Ht=15;Rh=new Set(["Function","Method"]);iS=8;Fh={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};cS=8,lS=16,uS=4,dS=6,pS=12,fS=2,hS=8,mS=3,yl=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),ch=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),Xi=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},gS=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};$l=20;vl=40});function Ze(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jh(e){let t=String(e||"");return Vh&&(t=t.replace(Vh," ")),t.replace(/\s+/g," ").trim()}function Qh(e){let t=String(e||"");t=t.replace(MS," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(LS);if(o&&(t=o[1].trim()),o=t.match(NS),o&&(t=o[1].trim()),o=t.match(Hh),o&&(t=o[1].trim()),o=t.match(qh),o&&(t=o[1].trim()),o=t.match(Kh),o&&(t=o[1].trim()),o=t.match(PS),o&&(t=o[1].trim()),o=t.match(Yh),o&&(t=o[1].trim()),o=t.match(FS),o&&(t=o[1].trim()),o=t.match(DS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(zS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(US),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(BS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(WS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(GS),o&&js.test(o[1].trim())&&(t=o[1].trim()),o=t.match(VS),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(HS),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(qS),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(KS),o){let r=o[1].trim();OS(r)||(t=!YS.test(r)&&(AS.test(r)||js.test(r))?r:`describe ${r}`)}if(o=t.match(XS),o){let r=o[1].trim();(js.test(r)||JS.test(r)||Yh.test(r)||Hh.test(r)||Kh.test(r)||qh.test(r)||QS.test(r))&&(t=r)}if(t===s)break}return t}function tk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(ZS);if(o&&(t=o[1].trim()),o=t.match(ek),o&&(t=o[1].trim()),t===s)break}return t}function sk(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(nk);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function ik(e){let t=String(e||""),n=t.match(rk);if(n){let o=em[n[1].toLowerCase()],r=Zh[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(tm);return s?`which modules transitively import ${s[1].trim()}`:t}function Qi(e){return String(e||"").replace(xS,t=>ol[t.toLowerCase()])}function ro(e){let t=Qi(e);return t=t.replace(ES,n=>rl[n.toLowerCase()]),t=t.replace(SS,n=>il[n.toLowerCase()]),t=t.replace(kS,"with"),t=t.replace(jS,(n,s)=>`${s} for`),t=t.replace(_S,(n,s)=>`for ${s}`),t=t.replace(RS,(n,s)=>s),t=t.replace(ak,"$1$2"),t=t.replace($f,"$1ing"),t=Qh(t),t=sk(t),t=tk(t),t=ik(t),t=Jh(t),t=nn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Nr(e){for(let t of[...xf,...vf]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Rl(e){for(let t of ck){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function nm(e){let t=String(e||"").match(lk);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var vS,xS,Xh,ES,SS,kS,jS,_S,RS,TS,Vh,AS,js,IS,CS,OS,LS,NS,Hh,qh,Kh,PS,MS,FS,DS,zS,US,BS,WS,GS,VS,HS,qS,KS,YS,XS,JS,QS,Yh,ZS,ek,nk,Zh,em,ok,rk,tm,ak,ck,lk,nt,qt,fe,vn=O(()=>{Qn();vS=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b","gi"),xS=vS(ol),Xh=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Ze).join("|")+")\\b(?!\\.[a-z0-9])","gi"),ES=Xh(rl),SS=Xh(il),kS=/(?<=^|\s)w\/(?=\s|$)/gi,jS=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,_S=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,RS=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,TS=Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|"),Vh=Rr.length?new RegExp("\\b("+[...Rr].sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b\\s*,?","gi"):null;AS=new RegExp("\\b(?:"+Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|")+")\\b","i"),js=/^(?:which|what|who|whose|where|when|why|how)\b/i,IS=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),CS=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,OS=e=>{if(CS.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return IS.has((t[t.length-1]||"").toLowerCase())},LS=/^(?: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,NS=/^(?: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,Hh=/^(?:(?:ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|(?:just\s+)?(?:one|another)\s+more|another\s+one)[\s,]+)+(.+)$/i,qh=/^(?: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,Kh=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,PS=/^(?:please[\s,]+)+(.+)$/i,MS=/,?\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,FS=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,DS=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,zS=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,US=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,BS=/^do\s+you\s+know\s+(.+?)\??$/i,WS=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,GS=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,VS=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,HS=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,qS=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,KS=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,YS=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,XS=/^(?:and|also|so|then|now|but)\s+(.+)$/i,JS=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,QS=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,Yh=/^(?:(?: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;ZS=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,ek=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;nk=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;Zh=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),em=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),ok="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",rk=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(em).join("|")+")\\s+("+Object.keys(Zh).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+ok+")\\??$","i"),tm=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;ak=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${nl.map(Ze).join("|")})(\\s*[?.!]*)$`,"i");ck=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+(?:${sl.map(Ze).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${TS})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);lk=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");nt=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),qt=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),fe=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var om,sm=O(()=>{om={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 rs(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let l=1;l<=t.length;l+=1){let c=e[r-1]===t[l-1]?0:1,u=Math.min(o[l]+1,i[l-1]+1,o[l-1]+c);r>1&&l>1&&e[r-1]===t[l-2]&&e[r-2]===t[l-1]&&(u=Math.min(u,s[l-2]+c)),i[l]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Al(e){return/^[a-z]+$/.test(e)&&!nt.has(e)&&!Tl.has(e)}function am(e){return fk(e)?null:Zi(e,im,is(e))}function Zi(e,t,n=is(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=rs(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 dk,is,Tl,rm,im,pk,fk,Uo=O(()=>{Qn();sm();vn();dk=["used"];is=e=>e.length<=5?1:2,Tl=new Set([...Object.keys(de),...Object.keys(We),...Object.keys(sn),...dk].flatMap(e=>e.split(" "))),rm=4,im=[...new Set([...Object.keys(de),...Object.keys(sn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=rm))],pk=new Set(om.words),fk=e=>pk.has(e)});function Bo(e){for(let t of bk){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var ea,hk,mk,gk,Il,bk,cm,ta=O(()=>{Qn();vn();ea=Object.keys(de).sort((e,t)=>t.length-e.length).map(Ze).join("|"),hk=Object.keys(We).sort((e,t)=>t.length-e.length).map(Ze).join("|"),mk=Object.keys(sn).sort((e,t)=>t.length-e.length).map(Ze).join("|"),gk=Js.slice().sort((e,t)=>t.length-e.length).map(Ze).join("|"),Il=(e,t)=>e==="defines"&&_r.has(t),bk=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${ea})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];if(Il(n,t))return null;let s=e[1].trim(),o=e[3].trim();return jr.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+(${hk})\\s+(?:(${mk})\\s+)?(${ea})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=de[t];return Il(n,t)?null:{shape:"reverse",entityType:We[e[1].toLowerCase()],modifier:e[2]?sn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${ea})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];return Il(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+(?:${gk})\\??$`,"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=nn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!We[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&wf.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:vs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${$n.map(Ze).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${tn.map(Ze).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${ea})\\??$`,"i"),build:e=>de[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()})}];cm={id:"grammar",class:"graph-query",run(e){let t=Bo(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function lm(e){let t=e.trim().split(/\s+/);return t.length>1&&Pi.has(t[0].toLowerCase())}function vk(e){return de[e.trim().toLowerCase()]==="calls"}function At(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,l)=>n.has(i+l)))&&r.every((a,l)=>e[i+l]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function Mr(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(E=>E.toLowerCase());if(s.includes("where")&&!At(s,de)){let E=s.some(_=>$n.includes(_)),S=new Set([...tn,...$n]),R=n.filter((_,I)=>!nt.has(s[I])&&!S.has(s[I])).join(" ").trim();if(R){let _=E?"mentions":"where";return{shape:_,entityType:null,modifier:"direct",kind:_,object:R}}}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?de[s[E-1]]:null)==="touches"){let R=n.slice(1,E-1).filter((_,I)=>!nt.has(s[1+I])).join(" ").trim();if(R)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:R}}}let r=s,i=At(s,de);if(!i&&t){let E=s.map(S=>{if(!Al(S))return S;let R=t.lemma(S);return Tl.has(R)?R:S});i=At(E,de),i&&(r=E)}let a=null;if(!i){let E=s.map(S=>S.length>=4&&Al(S)&&am(S)||S);if(i=At(E,de),i){r=E;let S=s.slice(i.start,i.end).findIndex((_,I)=>_!==E[i.start+I]),R=i.start+Math.max(S,0);a={from:s[R],to:E[R]}}}let l=!1;if(!i)for(let E=0;E<s.length;E+=1){let S=xs[s[E]];if(!(S&&s[E]==="used"&&s[E+1]==="for")&&S&&s.slice(0,E).some(R=>Pr.has(R))){i={kind:S,start:E,end:E+1},l=!0;break}}if(!i)return null;!l&&i.end-i.start===1&&xs[s[i.start]]&&s.slice(0,i.start).some(E=>Pr.has(E))&&(l=!0);let c=E=>a?{...E,fuzzyVerb:a}:E;if(t&&i.end-i.start===1){let E=i.start,S=s[E-1];if((S==="the"||S==="these"||S==="those")&&s[E+1]==="of"&&t.posTags(n)[E]==="NOUN"){let _=n.slice(E+2).filter((I,P)=>!nt.has(s[E+2+P])).join(" ").trim();if(_)return c({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:_})}}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(de)){if(S!==i.kind)continue;let R=E.split(" "),_=i.end;if(R.every((I,P)=>r[_+P]===I)){d({start:_,end:_+R.length});break}}let f=At(r,We,u);d(f);let p=At(r,sn,u);d(p);let h=(E,S)=>n.slice(E,S).filter((R,_)=>!u.has(E+_)&&!nt.has(s[E+_])).join(" ").trim(),m=h(0,i.start),b=h(i.end,n.length);l&&!s.includes("by")&&$k.has(b.toLowerCase())&&(b="");let g=i.kind,y=f?We[r.slice(f.start,f.end).join(" ")]:null,w=p?sn[r.slice(p.start,p.end).join(" ")]:"direct";if(g==="touches"&&s.includes("when")){let E=m||b;if(E)return c({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:E})}if(g==="touches"&&s.includes("who")&&s.includes("last")){let E=m||b;if(E)return c({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:E})}let v=s.indexOf("by"),k=s.slice(0,i.start).findIndex(E=>Pr.has(E)),$=k>=0,x=$&&k>v;if(v>=0&&!u.has(v)&&$){let E=(_,I)=>n.slice(_,I).filter((P,T)=>{let F=_+T,U=s[F];return!u.has(F)&&!nt.has(U)&&U!=="by"&&!Pr.has(U)&&!wk.has(U)&&!yk.has(U)}).join(" ").trim(),[S,R]=x?[E(k+1,n.length),E(v+1,k)]:[E(0,v),E(v+1,n.length)];if(S&&R)return g==="defines"&&_r.has(r.slice(i.start,i.end).join(" "))?null:c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:R,object:S});if(R)return c({shape:"forward",entityType:y,modifier:w,kind:g,object:R});if(S)return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:S})}if(l&&v<0&&b&&s[i.start]==="called")return null;if(m&&b){let E=r.slice(i.start,i.end).join(" ");if(g==="defines"&&_r.has(E)||g==="calls"&&(lm(b)||vk(m)))return null;let S=m,R=b;return jr.includes(E)&&([S,R]=[R,S]),c({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:S,object:R})}if(b){if(g==="calls"&&lm(b))return null;let E=f&&f.start>=i.end?null:y;return c({shape:"reverse",entityType:E,modifier:w,kind:g,object:b})}if(g==="inherits"&&!m&&f&&f.start===i.end){let E=r.slice(f.start,f.end).join(" ");if(E)return c({shape:"reverse",entityType:null,modifier:w,kind:g,object:E})}if(m&&!b&&$&&i.end-i.start===1&&xs[s[i.start]]){if(m.split(/\s+/).length>1)return null;if(g==="touches")return c({shape:"when",entityType:null,modifier:"direct",kind:g,object:m});let E=Pr.has(s[0]);return c({shape:"reverse",entityType:y,modifier:w,kind:g,object:m,...E?{polar:!0}:{}})}return m?c({shape:"forward",entityType:y,modifier:"direct",kind:g,object:m}):null}var Pr,wk,yk,$k,um,na=O(()=>{Qn();vn();Uo();Pr=new Set(["is","are","was","were","be","been","being","get","gets","got"]),wk=new Set(["which","what","who","whom","whose"]),yk=new Set(Jn.map(e=>e.toLowerCase())),$k=new Set(["recently","lately","yet","already","ever","again"]);um={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Mr(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function Ek(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],l=a.toLowerCase();!/^[a-z]+$/.test(a)||dm.has(l)||!s.has(l)||o[i]==="VERB"&&r.push(l)}return r}function Sk(e,t=null){let n=qt(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!dm.has(a)&&(xk.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=Ek(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var dm,xk,pm,fm=O(()=>{Qn();vn();ta();na();dm=new Set([...nt,...fe(Xs),...fe(Object.keys(de)),...fe(Object.keys(We)),...fe(Object.keys(sn)),...fe(Object.keys(Je)),...fe(Qs),...fe(Zs),...fe(Object.keys(Es)),...fe(Object.keys(In)),...fe(Object.keys(Ao)),...fe(Jn),...fe(Tr),...fe(Js),...fe(tn),...fe($n),...fe(Xn),...fe(Object.keys(Co))]),xk=new Set([...fe(Rr),...fe(Mi)]);pm={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Bo(e))return null;let{text:n,dropped:s,maybeNoise:o}=Sk(e,t.nlp||null);if(!s.length||!n)return null;let r=Bo(n)||Mr(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 hm=O(()=>{});var sa,oa=O(()=>{sa=()=>{}});function gm(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Wo(e.subject)===Wo(t.subject)&&Wo(e.object)===Wo(t.object):Wo(e.object)===Wo(t.object)}function Cl(e){let t=(e||[]).filter(c=>c&&Array.isArray(c.candidates)&&c.candidates.length);if(!t.length)return null;let n=[];for(let c of t)for(let u of c.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:c.strategyId,class:c.class});if(n.some(c=>!bm(c))&&(n=n.filter(c=>!bm(c))),!n.length)return null;let s=new Map;for(let c of n)s.has(c.class)||s.set(c.class,[]),s.get(c.class).push(c);let o=[];for(let[c,u]of s){let d=[];for(let f of u){let p=d.find(h=>gm(h.parsed,f.parsed)&&h.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),mm(f.parsed)<mm(p.parsed)&&(p.parsed=f.parsed);continue}d.push({...f,agreed:1})}d.length&&o.push({class:c,candidates:d})}if(!o.length)return null;let r=c=>Math.max(...c.candidates.map(u=>u.confidence)),i=o[0];for(let c of o)r(c)>r(i)&&(i=c);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(c=>c.parsed)},l=o.filter(c=>c!==i).map(c=>c.candidates[0]).filter(c=>!i.candidates.some(u=>gm(u.parsed,c.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:l}}function _k(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 wm(e,{describe:t=_k,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 Wo,kk,mm,jk,bm,Ol=O(()=>{Wo=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),kk=/^\s*(?:the|a|an)\s+/i,mm=e=>[e?.subject,e?.object].filter(t=>kk.test(String(t||""))).length;jk=new Set(["fuzzy","lemma","spell"]),bm=e=>jk.has(e.via)});function ra(e){Ll=e}function ia(){return typeof Ll=="function"?Ll():null}var Ll,Go=O(()=>{Ll=null});function vm(e,t={},n=Tk){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 Rk,Tk,xm=O(()=>{vn();ta();na();fm();hm();oa();Ol();Go();Rk=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],Tk=[cm,um,pm,...Rk]});function Vo(e){return Ak.test(String(e||"").trim())?"an":"a"}function aa(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 Ho(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Fr(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 Ak,ca=O(()=>{Ak=/^[aeiou]/i});var Dr,Nl=O(()=>{Dr=(e,t,n)=>n});var dg={};Gt(dg,{DYNAMIC_TAIL_OK_RE:()=>lu,applyNegationFrames:()=>Nr,ask:()=>As,classDisplayName:()=>as,degreeMetric:()=>ng,metaFallbackEntityAnswer:()=>Ym,normalizeQuery:()=>ro,parseQuery:()=>Gr,parseQueryFull:()=>Xl,render:()=>En,rephraseHint:()=>su,resolveObject:()=>Sn,traverse:()=>Kt,worldRelationGraphPayload:()=>S_});function Ke(e,t){let n=Em.get(e);n||(n=new Map,Em.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(os(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Fe(e,t){let[n,s]=Ul[e]||["result","results"];return t===1?n:s}function Hr(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 as(e){let t=String(e||"");if(typeof Cn=="function"){let n=Cn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function io(e){return Ck[e]||e}function Mk(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||Pk.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return fe(Js).includes(o)?t:e}function zk(e,t){if(!e||e.shape!=="where"||e.altObject||!Fk.test(t))return e;let n=Ni(t),s=Ni(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=qt(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||nt.has(i)||de[i]||i.endsWith("ing"))return o;let a=qt(n).map(c=>c.toLowerCase());for(;a.length&&Dk.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let l=r.slice(0,-1).join(" ");return{...e,object:l,altObject:s,verb:i}}function Gr(e,{nlp:t=void 0}={}){return Xl(e,{nlp:t}).parsed}function Xl(e,{nlp:t=void 0}={}){let n=t===void 0?ia():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Rl(Nr(ro(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=Bk(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Cl(vm(o,{nlp:n,raw:s}));return i?{parsed:zk(Mk(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Wl(e,t){return t.length&&Dm.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Yo(e,t){return Bo(e)||Mr(e,t)}function Bk(e,t){let n=qt(e),s=n.map(o=>o.toLowerCase());return cj(n,s)||uj(n,s)||Hk(n,s,t)||Um(e,t,0)||dj(n,s,t)||Kk(n,s,t)||tj(n,s,t,0)||sj(n,s)||ij(n,s,t)||pj(n,s,t)||mj(n,s,t)||bj(n,s,t,0)||hj(n,s,t,0)||Ql(n,s,t,0)||Xk(n,s,t)||Gk(n,s)||qm(n,s,t,0)}function Gk(e,t){let n=0;Wk.has(t[n])&&(n+=1);let s=It(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=h=>h+1<t.length?yf[`${t[h]} ${t[h+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,l=-1,c;for(let h=a;h+1<t.length;h+=1){let m=r(h);if(m){l=h,c=m;break}}if(l<0)return null;let u=e.slice(a,l).join(" ").trim(),d=e.slice(l+2).join(" ").trim();if(!u||!d)return null;let f=(h,m)=>h.role==="object"?{shape:"reverse",kind:h.kind,entityType:o,modifier:"direct",object:m}:{shape:"forward",kind:h.kind,modifier:"direct",object:m},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(c,d)}}]}}function ua(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function Hk(e,t,n){if(!["do","does","did"].includes(t[0])||!Vk.has(t[1]))return null;let s=It(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let l=At(a,de);if(!l)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<l.start||p>=l.end)&&!nt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=Xo(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:l.kind,object:u,complement:ua(o,{op:"difference",kind:"set",ast:d})}}function Um(e,t,n=0){let s=nm(e);if(!s)return null;let o=It(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=qt(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Je[d]))return ua(r,{op:"difference",kind:"qual",filters:a});let l=At(a,de);if(!l)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,f)=>(f<l.start||f>=l.end)&&!nt.has(a[f])&&a[f]!=="from").length)return ua(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:l.kind}});let u=Xo(`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"}:ua(r,{op:"difference",kind:"set",ast:u})}function Kk(e,t,n){let s=0;for(;s<t.length&&qk.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=At(r,de);if(!a)return null;let c=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!nt.has(r[d])).join(" ").trim();return c?{node:"forwardComplement",kind:a.kind,subjectTerm:c}:null}function Bm(e,t){let n=new Set;for(let s of t)for(let o of Ke(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function Wm(e,t){let n=Pt(t),s=n.filter(r=>!Mm.has(r)),o=Bm(e,s.length?s:n);return o.size===1?[...o][0]:null}function Xo(e,t,n){if(n>Fm)return{node:"miss",reason:"too deep to resolve"};let s=Um(e,t,n);if(s)return s;let o=qt(e),r=o.map(c=>c.toLowerCase()),i=Ql(o,r,t,n);if(i)return i;let a=qm(o,r,t,n);if(a)return a;let l=Yo(e,t);return l?{node:"clause",clause:l}:null}function Ql(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=Xn.includes(t[o]),i=!r&&zm(t[o]);if(!r&&!i||r&&o+1>=t.length||!It(t[o-1]))continue;let l=e.slice(0,o-1);if(!l.length||l.every(f=>Je[f.toLowerCase()]))continue;let c=Yo([...l,Bl].join(" "),n);if(!c||c.shape!=="reverse"&&c.shape!=="forward"||c.modifier&&c.modifier!=="direct")continue;let u=`which ${t[o-1]} ${e.slice(r?o+1:o).join(" ")}`,d=Xo(u,n,s+1);return!d||d.node==="miss"?d?{node:"miss",reason:d.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"}:{node:c.shape==="reverse"?"reverseSet":"forwardSet",kind:c.kind,entityType:c.entityType,inner:d}}return null}function Xk(e,t,n){for(let s=0;s<t.length;s+=1){if(!Yk.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!de[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Bl,...e.slice(s+1)],a=Yo(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Bl&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function tj(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!Jk.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(Qk.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&&Zk.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&ej.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>Xn.includes(d)))return null;let l=Jl.has(a[0])?i.join(" "):`which ${i.join(" ")}`,c=Xo(l,n,s+1);if(!c||c.node==="miss")return c?{node:"miss",reason:c.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=It(a[0]);return{node:"temporal",inner:c,entityType:u&&u.entityType||null}}function sj(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!nj.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 rj(e){let t=new Set,n=[];for(let s of e){if(!s||!oj.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function ij(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(!Tr.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&&(Qs.includes(f)||Zs.includes(f))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=Qs.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=aj(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let l=o?s-1:s,c=rj(e.slice(0,l)),u={node:"anaphora",mode:i,filter:a};return c.length>=2&&(u.candidateTerms=c),u}function aj(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&Uk.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Je[a]))return{type:"qual",filters:r};if(o.length===1){let a=It(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Yo(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function cj(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?It(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let l=i.indexOf("in",1);if(l>0){let u=a.slice(1,l).join(" ").trim(),d=a.slice(l+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:c,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:null,scopeModule:l}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function lj(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=vs(n).slice(e.length).trim(),o=qt(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 uj(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let c=1;c<t.length;c+=1)if(Je[t[c]]){n=c,s=t[c-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&xs[t[n]]){let c=o+1;for(;c<t.length&&(t[c]==="the"||t[c]==="a"||t[c]==="an");)c+=1;let u=t[c];if(u&&!Ef.has(u))return null}let r=lj(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let l=a>i?e.slice(i,a).join(" ").trim():"";return l?{node:"qualCheck",term:l,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function dj(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=Yo(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function pj(e,t,n){let s=Qs.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&&Je[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?It(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let l=e.slice(o),c=t.slice(o).some(d=>!nt.has(d)&&!Gm.has(d)),u;if(c){let d=Xo(`which ${a} ${l.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function hj(e,t,n,s){let o=0,r=!1,i=null;for(let y of Vm){let w=y.split(" ");if(t.slice(0,w.length).join(" ")===y){i=y,o=w.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&Zl.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Je[t[o]];)a.push(t[o]),o+=1;let l=o<t.length?It(t[o]):null;if(!l||l.placeholder||l.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Jn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Hm}`}:null;let c=l.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some(y=>!nt.has(y)&&!Gm.has(y)),p=t.slice(o),h=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),h=h.slice(1));let m=r&&fj.has(p[0]);if(r&&(f&&!m||d.length===0))return null;let b,g=!1;if(f){let y=m?h:d,w=Xo(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!w||w.node==="miss")return{node:"miss",reason:w&&w.reason||"the list filter didn't parse"};b=w,g=!0}else b={node:"allOfClass",entityType:c},a.length&&(b={node:"qualifier",filters:a,inner:b});return{node:"list",entityType:c,base:b,scoped:g}}function mj(e,t,n){let s=null,o=-1;for(let h=0;h<t.length;h+=1){let m=t.slice(h,h+2).join(" ");if(Es[m]){s=Es[m],o=h;break}if(Es[t[h]]){s=Es[t[h]],o=h;break}}if(!s)return null;let r=null,i=null;for(let h=o;h<t.length;h+=1)if(In[t[h]]){r=In[t[h]],i=t[h];break}if(!r){for(let h=o-1;h>=0;h-=1)if(In[t[h]]){r=In[t[h]],i=t[h];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),l=["important","significant","central","key","core","essential","critical","principal"],c=t.some(h=>l.includes(h));!r&&(a||c)&&(r=In.connections,i="connections");let u,d=null;for(let h of t){let m=It(h);if(m&&!m.placeholder){u=m.entityType,d=h;break}}if(!d&&(u=i?Sf[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(h=>f.includes(h))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:p}}function bj(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Zl.has(t[o]);)o+=1;if(o>=t.length)return null;let r=It(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&gj.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=It(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=>Xn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Jn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Hm}`}:null}function wj(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Zl.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(Xn.includes(t[i])){s=i;break}if(s<0)return null;let o=It(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 yj(e,t,n,s,o,r){let{branches:i,ops:a}=da(n,s),l=null,c=[];for(let u=0;u<i.length;u+=1){let d=i[u],f=d.map(y=>y.toLowerCase()),p=u===0?"intersection":a[u-1],h=Wl(d,f);if(h.blc.length&&h.blc.every(y=>Je[y])){c.push({op:p,kind:"qual",filters:h.blc});continue}if(f[0]==="of"||f[0]==="in"){c.push({op:p,kind:"set",ast:{node:"membership",entityType:e,term:d.slice(1).join(" ")}});continue}let m=d,b=At(f,de);b?l=d.slice(b.start,b.end):l&&(m=[...l,...d]);let g=Km(`${t} ${m.join(" ")}`,o,r);if(!g||g.node==="miss")return{miss:g&&g.reason||"a clause in the combination didn't parse"};c.push({op:p,kind:"set",ast:g})}return{atoms:c}}function qm(e,t,n,s){let o=wj(e,t);if(o){let{entityType:R,term:_,relIdx:I}=o,P=t.slice(I+1),T=e.slice(I+1);if(!P.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[I]}"`};let F=yj(R,`which ${t[I-1]}`,P,T,n,s+1);if(F.miss)return{node:"miss",reason:F.miss};let U=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:_}},...F.atoms];return U.length===1?U[0].ast:{node:"boolean",entityType:R,atoms:U}}let r=0;for(;r<t.length&&Jl.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Je[t[r]];)a.push(t[r]),r+=1;let l=r<t.length?It(t[r]):null;if(!l){let R=r+1<t.length?It(t[r+1]):null;if(Sm.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(Dm.has(t[r])){let _=r+1;_<t.length&&(t[_]==="the"||t[_]==="a"||t[_]==="an")&&(_+=1);let I=_+1<t.length?It(t[_+1]):null;if(Sm.has(t[_])&&I&&I.entityType==="Commit"&&_+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!de[t[r]]&&!nt.has(t[r])&&!au.has(t[r])?{node:"find",entityType:R.entityType,term:e[r]}:null}let c=l.entityType,u=t[r];r+=1;let d=t.slice(r),f=e.slice(r),p=!1;d.length&&Xn.includes(d[0])&&(p=!0,d=d.slice(1),f=f.slice(1));let h=d[0]==="of"||d[0]==="in",m=d.length>0&&zm(d[0]),b=f.length>0&&da(d,f).branches.some(R=>{let{blc:_}=Wl(R,R.map(I=>I.toLowerCase()));return _.length&&_.every(I=>Je[I])}),g=f.length>0?da(d,f).branches:[],y=!1;if(g.length>1){let R=g[0].map(I=>I.toLowerCase()),_=At(R,de);_&&_.start===0&&(y=g.slice(1).every(I=>{let P=I.map(F=>F.toLowerCase()),T=At(P,de);return T&&T.start===0?T.kind===_.kind:!T}))}let w=!1;if(g.length>1){let R=g[0].map(I=>I.toLowerCase()),_=At(R,de);_&&_.start===0&&(w=g.slice(1).every(I=>{let P=I.map(F=>F.toLowerCase()),T=At(P,de);return!!T&&T.start===0&&T.end-T.start===1}))}if(!(a.length||p||h||m||b||y||w))return null;if(!f.length){let R={node:"allOfClass",entityType:c};return a.length?{node:"qualifier",filters:a,inner:R,entityType:c}:{node:"miss",reason:"nothing to filter or traverse"}}let v=l.placeholder?"what":`which ${u}`,{branches:k,ops:$}=da(d,f),x=null,E=[];for(let R=0;R<k.length;R+=1){let _=k[R],I=_.map(ce=>ce.toLowerCase()),P=R===0?"seed":$[R-1],T=Wl(_,I);if(T.blc.length&&T.blc.every(ce=>Je[ce])){E.push({op:P,kind:"qual",filters:T.blc});continue}if(I[0]==="of"||I[0]==="in"){E.push({op:P,kind:"set",ast:{node:"membership",entityType:c,term:_.slice(1).join(" ")}});continue}let F=_,U=At(I,de);U?x=_.slice(U.start,U.end):x&&(F=[...x,..._]);let K=Km(`${v} ${F.join(" ")}`,n,s+1);if(!K||K.node==="miss")return{node:"miss",reason:K&&K.reason||"a clause in the combination didn't parse"};E.push({op:P,kind:"set",ast:K})}if(E[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let S;return E.length===1?S=E[0].ast:S={node:"boolean",entityType:c,atoms:E},a.length&&(S={node:"qualifier",filters:a,inner:S,entityType:c}),S}function Km(e,t,n){if(n>Fm)return{node:"miss",reason:"too deep to resolve"};let s=qt(e),o=s.map(a=>a.toLowerCase()),r=Ql(s,o,t,n);if(r)return r;let i=Yo(e,t);return i?{node:"clause",clause:i}:null}function da(e,t){let n=Object.keys(Ao).sort((a,l)=>l.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let l of n){let c=l.split(" ");if(e.slice(i,i+c.length).join(" ")===l){a={c:l,len:c.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(Ao[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 eu(e,t,n,s){let o=qo[t];if(o&&Ts.has(n)){let u=Ke(e,o).filter(d=>s.has(d.object));return ls(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Ts.has(e.byId.get(u)?.class))?[...Pt(t),o]:Pt(t)).flatMap(u=>Ke(e,u)).filter(u=>s.has(u.object)),l=ls(a.map(u=>e.byId.get(u.subject)).filter(Boolean));if(!n||n==="Change")return l;let c=l.filter(u=>u.class===n);return c.length?c:n!=="Module"&&l.some(u=>u.class==="Module")?ou(e,new Set(l.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function vj(e,t){let n=new Set(eu(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=$j.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function Br(e,t,n){let s=Pt(t).flatMap(o=>Ke(e,o)).filter(o=>n.has(o.subject));return ls(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ls(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 xj(e,t){let n=ns(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&ns(o.label).startsWith(s))}function Gl(e){let t=km.get(e);if(t)return t;let n=new Set;for(let i of Ke(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 Ke(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of Ke(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},km.set(e,t),t}function Ko(e,t){return t?t.class==="Module"?t.id:Gl(e).moduleOfSymbol.get(t.id)||null:null}function Ym(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>Ej.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Ko(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),l=a==="attribute"?"an":"a",c=i?`, ${Dr("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${l} ${a} in this codebase${c} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function Vl(e,t,n){let s=ls(Io.flatMap(o=>Br(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function tu(e,t,n=null){let s=cs(e,t,n);if(!(s.match&&s.tier===1)){let o=xj(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 Xm(e,t,n,s,o){let r=o||(()=>!0),i=Vl(e,t,s).filter(r);if(i.length||!Qm(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of Jm(e,t)){let l=e.byId.get(a);if(!l)continue;let c=Vl(e,a,s).filter(r);if(c.length)return{own:i,inherited:c,viaId:a,viaLabel:l.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function ao(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=Gl(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=Ko(e,t),o=Gl(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&no(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function nu(e){return Ke(e,"inherits")}function Hl(e,t){return nu(e).filter(n=>n.object===t).map(n=>n.subject)}function jm(e,t){return nu(e).filter(n=>n.subject===t).map(n=>n.object)}function Sj(e,t){let n=new Set,s=[...Hl(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Hl(e,o))n.has(r)||s.push(r)}}return n}function Jm(e,t){let n=new Set,s=[...jm(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of jm(e,o))n.has(r)||s.push(r)}}return n}function Qm(e,t){let n=_m.get(e);if(n||(n=new Map,_m.set(e,n)),n.has(t))return n.get(t);let s=nu(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 Rm(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 Am(e){return e.slice().sort((t,n)=>Tm[n.via]-Tm[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Im(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=is(n);if(rs(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of co(e.label))if(rs(o,n,s)<=s)return!0;return!1}function Zm(e,t,n){let s=e.individuals.filter(l=>l.class===t),o=[...co(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=Qm(e,t),i=[];for(let l of s){let c=Rm(l,o);if(c){i.push({ind:l,via:c});continue}if(!r)continue;[...Sj(e,l.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!Rm(f,o)})&&i.push({ind:l,via:"chain"})}if(i.length||!r)return{narrow:Am(i),broad:[]};let a=new Map;for(let l of s)for(let c of Jm(e,l.id)){if(!a.has(c)){let u=e.byId.get(c);u&&u.class===t&&Im(u,n)&&a.set(c,{ind:u,via:"chain"})}for(let u of Hl(e,c)){if(u===l.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Im(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Am([...a.values()])}}function kj(e){return[...Ki(Yi(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function pn(e,t,n){switch(t.node){case"clause":return Kt(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?kj(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=Zm(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Pt(t.kind).flatMap(o=>Ke(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=cs(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=Wm(e,t.kind);if(!o)return[];let r=new Set(Br(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(pn(e,t.inner,n).map(o=>o.id));return eu(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(pn(e,t.inner,n).map(o=>o.id));return Br(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=tu(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(l=>l.id));return ls(Io.flatMap(l=>Br(e,l,i))).filter(l=>l.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=Xm(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?sg(e,t,n).matches:pn(e,t.inner,n).filter(o=>t.filters.every(r=>ao(e,o,Je[r])));case"boolean":return eg(e,t,n);case"anaphora":return tg(e,t,n).matches;default:return[]}}function eg(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=pn(e,o.ast,n);continue}if(o.kind==="qual"){let i=l=>o.filters.every(c=>ao(e,l,Je[c])),a=l=>o.filters.every(c=>{let u=jj(Je[c]);return u?ao(e,l,u):!ao(e,l,Je[c])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(pn(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 pn(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function _j(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=Sn(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 tg(e,t,n){let o=_j(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=>ao(e,d,Je[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=Sn(e,i.clause.object);if(!d.match)r=[];else{let f=qo[i.clause.kind],p=[...Pt(i.clause.kind),...f?[f]:[]],h=new Set(p.flatMap(m=>Ke(e,m)).filter(m=>m.object===d.match.id).map(m=>m.subject));r=r.filter(m=>h.has(m.id))}}let a=d=>d.length&&d.every(f=>f.class===d[0].class)?d[0].class:null,l=i&&i.type==="entity"?i.entityType:a(o),c=r.length?a(r):l;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:c,matches:[]};let u=Hr(c,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:c,referents:u}}function ng(e,t,n){let s=n.kind==="*"?Rj:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of Ke(e,r)){let a=i.subject===t.id,l=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let c=e.byId.get(i.object);if(!c||c.class!==n.filter)continue}o+=1}else(n.dir==="in"&&l||n.dir==="both"&&(a||l))&&(o+=1)}return o}function Tj(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 Ij(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(Aj.test(s))r=s;else{let{match:u,ambiguous:d}=Sn(e,s,{expectedClass:"Commit"});u&&!d&&u.class==="Commit"&&o(u)&&(i=u.id,a=u.label,r=o(u))}if(!r)return{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotResolved:!1,matches:[]};let l=e.individuals.filter(u=>u.class==="Commit"&&u.id!==i&&o(u)).filter(u=>{let d=o(u);return n==="since"?d>=r:n==="before"?d<r:n==="after"?d>r:d===r}).sort((u,d)=>o(d).localeCompare(o(u))),c=[];return l.length&&c.push({kind:"set",class:"Commit",label:`${l.length} commit${l.length===1?"":"s"} ${n} ${s}`,ids:l.map(u=>u.id),attrs:{count:l.length,op:n,...i?{pivot:i}:{}},lane:"commitFilter"}),i&&c.push({kind:"event",class:"Commit",label:a,ids:[i],attrs:{date:r},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:r,pivotResolved:!0,matches:l,referents:c}}function Cj(e,t,n){let s=pn(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=eu(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(l=>l.key==="date")?.value||"");return r.sort((a,l)=>i(l).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function Oj(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(Ke(e,"tests").map(l=>l.subject));n=n.filter(l=>!a.has(l.id)&&!no(String(l.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:ng(e,a,t.metric)})).sort((a,l)=>t.extreme==="most"?l.score-a.score:a.score-l.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?Hr(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 sg(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?h=>s.filters.every(m=>ao(e,h,Je[m])):null,a=h=>Hr(r,h,"membership"),l=tu(e,o.term,n&&n.contextId);if(l.kind==="dir"){let h;if(!r||r==="Module")h=l.mods;else{let m=new Set(l.mods.map(b=>b.id));h=ls(Io.flatMap(b=>Br(e,b,m))).filter(b=>b.class===r)}return i&&(h=h.filter(i)),{compositeKind:"set",matches:h,entityType:r,referents:a(h)}}if(l.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:c,inherited:u,viaLabel:d}=Xm(e,l.id,l.entityClass,r,i),f=!c.length&&u.length>0,p=f?u:c;return{compositeKind:"membership",entityType:r,matches:p,inheritedNotOwn:f,viaLabel:d,ownerLabel:l.label,referents:a(p)}}function Lj(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=Sn(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=Sn(e,s,{expectedClass:n}),l=!r||a.match&&Ko(e,a.match)===r.id,c=a.match&&l;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:c?[a.match]:[]}}let i=r?ou(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 Nj(e,t,n){let s=Ko(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||Vl(e,n.id).some(o=>o.id===t.id)}function Pj(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=cs(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=tu(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!Nj(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let l=ao(e,a.match,Je[o]),c=r?!l:l,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:c,matches:[a.match],referents:u}}function Mj(e,t,n){let s=Sn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=pn(e,{node:"allOfClass",entityType:t.entityType},n),r=eg(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 Fj(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(pn(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}=Kt(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function Dj(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return Lj(e,t);if(t.node==="qualCheck")return Pj(e,t,n);if(t.node==="universal")return Mj(e,t,n);if(t.node==="count"){let i=Fj(e,t.base,n);return i?{compositeKind:"count",count:vj(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:pn(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:pn(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return v_(e,t);if(t.node==="superlative")return Oj(e,t);if(t.node==="temporal")return Cj(e,t,n);if(t.node==="recentCommits")return Tj(e);if(t.node==="commitFilter")return Ij(e,t);if(t.node==="anaphora")return tg(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return sg(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=Zm(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=pn(e,t,n),o=t.entityType||null,r=Hr(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function og(){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 zj(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=Vr(e);return n?`${t} in ${n}`:t}function ql(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(ql):Array.isArray(e.filters)&&e.filters.some(t=>Je[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(ql)}function Uj(e,t){return!["Function","Method"].includes(t)||!ql(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 Bj(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})`:""}. ${og()}.`,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=Vr(i),l=i.class==="Module"?"":a?`, ${Dr("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${_s(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=Lk(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}: ${_s(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>qe?` \u2014 narrow with "${Fe(t.entityType,2)} in <module>"`:"";return{content:`${_s(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=xn(t.asked),o=Ys[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)})`:""}. ${Rs(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}: ${_s(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${_s(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?zj(t.matches[0]):_s(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,Ht).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Ht?` \u2026+${t.matches.length-Ht} 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,Ht).map(i=>{let a=s(i).slice(0,10),l=(i.attributes||[]).find(c=>c.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${l?` \u2014 ${l}`:""}`}),r=t.matches.length>Ht?` \u2026+${t.matches.length-Ht} 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:`${_s(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. ${Rs(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. ${Rs(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let l=(i.attributes||[]).find(d=>d.key==="message")?.value||"",c=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${c}${l?` ("${l}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=Uj(e,t.entityType)||Rs(n);return{content:`nothing in the index matches that${t.entityType?` (${Fe(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${_s(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function su(){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). `+og()}function Rs(e=null){return e&&Or(e)===0?xl:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function co(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function fa(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 rg(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function Wj(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function zr(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(b=>b.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let b=i[2],g=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${b}`)||String(y.label).toLowerCase().startsWith(b)));if(g.length===1)return{match:g[0],candidates:[],tier:1,ambiguous:!1};if(g.length>1)return{match:g[0],candidates:g.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(b=>String(b.label).toLowerCase()===o||String(b.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let l=`ext:${o}`,c=null;e:for(let b of e.relations)for(let g of b.edges)if(String(g.object).toLowerCase()===l){c=g.object;break e}if(c&&!n)return{match:{id:c,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(b=>b.trim()).filter(Boolean);if(u.length>1){let b=new Set;for(let g of u){let y=zr(e,g,{expectedClass:n});y.match&&!y.ambiguous&&b.add(y.match.id)}if(b.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],f=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(f){let b=o.split(".").pop();for(let g of r){let y=String(g.label||"").toLowerCase();g.class==="Module"?y.split("/").pop()===o&&d.push({ind:g,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:g,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${b}`)&&d.push({ind:g,score:1500-Math.abs(y.length-o.length)})}}else{let b=[...co(s)],g=o.split(/\s+/).find($=>$.includes("/")),y=g?g.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,k=v?Wj(s):null;for(let $ of r){let x=String($.label||"").toLowerCase(),E=x.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(E===o){d.push({ind:$,score:5e3});continue}if(o.length>=4&&(E.startsWith(o)||E.endsWith(o))){d.push({ind:$,score:4e3-Math.abs(E.length-o.length)});continue}if(v){let _=rg($.label);if(_&&_===k){d.push({ind:$,score:5e3});continue}let I=/[/_-]/.test($.label)||/\.[a-z0-9]+$/i.test(String($.label||""));if(_&&I&&k.length>=4&&_.includes(k)){d.push({ind:$,score:2e3-Math.abs(_.length-k.length)});continue}}if($.class==="Module"){let _=fa(o);if(_!==o&&_===fa(E)){let I=is(o);if(rs(E,o,I)>I){d.push({ind:$,score:3e3-Math.abs(E.length-o.length)});continue}}}if(o.length>=4&&x.includes(o)){d.push({ind:$,score:1e3-Math.abs(x.length-o.length)});continue}let S=co($.label),R=b.filter(_=>S.has(_)).length;R>0&&(!y||S.has(y))&&d.push({ind:$,score:R/b.length*Ml})}}if(d.sort((b,g)=>g.score-b.score),d.length){let[b,...g]=d,y=g.filter(v=>v.score===b.score),w=b.score>=Ml?g.filter(v=>v.score>=Ml):g;return{match:b.ind,candidates:w.slice(0,4).map(v=>v.ind),tier:3,ambiguous:y.length>0}}let p=f||o.includes("/"),h=null,m=!p&&typeof eo=="function"?eo(e.proseIndex,s).filter(b=>!n||e.byId.get(b.id)?.class===n):[];if(m.length){let[b,...g]=m,y=e.byId.get(b.id);if(y){let w=g.filter(v=>v.score===b.score);if(h={match:y,candidates:g.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!h.ambiguous&&b.via!=="spell")return h}}if(!i&&o.length>=4){let b=is(o),g=b+1,y=[];for(let w of r){let v=rs(String(w.label||"").toLowerCase(),o,b);if(v>0)for(let k of co(w.label)){if(v<=0)break;v=Math.min(v,rs(k,o,b))}v<g?(g=v,y=[w]):v===g&&v<=b&&y.push(w)}if(g<=b&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(g<=b&&y.length>1&&!h){let[w,...v]=y;return{match:w,candidates:v.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return h||{match:null,candidates:[],tier:null,ambiguous:!1}}function Fl(e,t){let n=rg(t),s=[...co(t)],o=[];for(let r of co(e))n.includes(r)||s.some(i=>fa(i)===fa(r))||pa.has(r)||cg.has(r)||o.push(r);return o}function la(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(Fl(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Fl(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:xn(s.slice(0,4).map(r=>r.label))}:e}let n=Fl(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function Sn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(Gj,"").trim(),i=r.match(Vj);if(i){let a=r.slice(0,i.index).trim(),l=We[i[1].toLowerCase()];if(a&&l){let c=la(zr(e,a,{expectedClass:l}),a);if(c?.match?.id&&!c.ambiguous)return c}}if(r&&r!==o){let a=la(zr(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return la(zr(e,t,n),t)}return la(zr(e,t,n),t)}function cs(e,t,n){if(Xs.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 Sn(e,t)}function ou(e,t,n){let s=[];for(let o of Ke(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 Hj(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Ts.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],l=a.flatMap(c=>Ke(e,c)).filter(c=>c.subject===t.id).map(c=>e.byId.get(c.object)).filter(Boolean);return n&&Ts.has(n)&&(l=l.filter(c=>c.class===n)),{matches:l,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function Xj(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&ru.has(Cm(s.label))).map(s=>({ind:s,named:n.has(Cm(s.label))?1:0,depth:String(s.label).split("/").length,fixture:Yj(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 Jj(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function iu(e){return(e?.attributes||[]).find(t=>t.prop===Qj)?.value||null}function Zj(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Vo(e)} ${e} in this graph's vocabulary`}function Kt(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 Dj(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let T=t.candidates.map(F=>{let U=Kt(e,F,{contextId:n,prev:s});return{parsed:F,result:U,rendered:En(F,U,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:T}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let T=String(t.object||"").trim(),F=T.toLowerCase(),U=(e.individuals||[]).find(K=>{if(!iu(K))return!1;if(String(K.label).toLowerCase()===F)return!0;let ce=(K.attributes||[]).find(ie=>ie.key==="token")?.value;return ce&&String(ce).toLowerCase()===F});if(!U){let K=Ym(e,T);return K?{matches:[K.hit],objMatch:K.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:K.text,traversal:`schema lookup for "${T}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}return{matches:[U],objMatch:U,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}if(r==="mentions"){let T=String(t.object||"").trim();return{matches:(typeof eo=="function"?eo(e.proseIndex,T):[]).map(K=>e.byId.get(K.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${T}"`}}if(r==="where"&&qj.test(String(t.object||"").trim())){let T=Xj(e,t.object);return{matches:T,objMatch:T[0]||null,candidates:T.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...ru].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!Jj(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let T=cs(e,t.subject,n),F=cs(e,t.object,n);if(!T.match||!F.match||T.ambiguous||F.ambiguous)return{matches:[],objMatch:F.match,candidates:F.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(T.unresolvedPronoun||F.unresolvedPronoun)};let[U,K]=[T.match,F.match];i==="touches"&&K.class==="Commit"&&U.class!=="Commit"&&([U,K]=[K,U]);let ce=qo[i],ie=[...new Set(ce?[...Pt(i),ce]:Pt(i))],D=ie.flatMap(B=>Ke(e,B)).filter(B=>B.subject===U.id&&B.object===K.id);return{matches:D,answer:t.negated?D.length===0:D.length>0,objMatch:F.match,subjMatch:T.match,candidates:[],traversal:`${ie.join("+")} edge from ${U.label} to ${K.label}`,ambiguous:!1}}let l;if(o)l={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(l=cs(e,t.object,n),t.altObject&&t.altObject!==t.object){let T=cs(e,t.altObject,n),F=!!l.match&&!l.ambiguous,U=!!T.match&&!T.ambiguous;!F&&U?l=T:F&&U&&l.match.id!==T.match.id&&(l={...l,ambiguous:!0,candidates:[T.match,...l.candidates||[]]})}if(t.kind==="tests"&&l.match&&!l.ambiguous&&!String(t.object||"").includes("/")){let T=K=>K.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),F=T(String(t.object||"").trim().toLowerCase()),U=(e.individuals||[]).find(K=>{if(K.class!=="Module"||K.id===l.match.id)return!1;let ce=String(K.label||"").toLowerCase().split("/").pop();return ce!==T(ce)&&T(ce)===F});U&&(l={...l,ambiguous:!0,candidates:[U,...l.candidates||[]]})}}let{match:c,candidates:u,ambiguous:d,unresolvedPronoun:f,matchedVia:p,unplacedWords:h,nearestLabel:m}=l;if(!c)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:f,unplacedWords:h,nearestLabel:m};if(d){let F=ls([c,...u||[]]).slice(0,qe).map(U=>{let K=Kt(e,t,{contextId:n,prev:s,pinnedObjMatch:U});return{candidate:U,result:K,rendered:En(t,K,e)}});return{matches:[],objMatch:c,candidates:u,traversal:null,ambiguous:!0,branches:F}}if(r==="where"){let T=(c.attributes||[]).find(F=>F.key==="site")?.value||null;return{matches:[c],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whereShape:!0,site:T,traversal:T?`site attribute of ${c.label}`:`class + defining module of ${c.label}`}}if(r==="when"){let T=K=>String((K.attributes||[]).find(ce=>ce.key==="date")?.value||""),F;if(c.class==="Commit")F=[c];else{let K=["touches","touchesSymbol"].flatMap(ie=>Ke(e,ie)).filter(ie=>ie.object===c.id),ce=new Set;F=[];for(let ie of K){if(ce.has(ie.subject))continue;ce.add(ie.subject);let D=e.byId.get(ie.subject);D&&D.class==="Commit"&&F.push(D)}F.sort((ie,D)=>T(D).localeCompare(T(ie)))}let U=F.length&&T(F[0])?[{kind:"event",class:"Commit",label:F[0].label,ids:[F[0].id],attrs:{date:T(F[0]).slice(0,10)},lane:"when"}]:[];return{matches:F,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:U,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit date first`}}if(r==="whoLast"){let T=ie=>String((ie.attributes||[]).find(D=>D.key==="date")?.value||""),F=["touches","touchesSymbol"].flatMap(ie=>Ke(e,ie)).filter(ie=>ie.object===c.id),U=new Set,K=[];for(let ie of F){if(U.has(ie.subject))continue;U.add(ie.subject);let D=e.byId.get(ie.subject);D&&D.class==="Commit"&&K.push(D)}K.sort((ie,D)=>T(D).localeCompare(T(ie)));let ce=K.length&&T(K[0])?[{kind:"event",class:"Commit",label:K[0].label,ids:[K[0].id],attrs:{date:T(K[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:K,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:ce,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit's author`}}if(i==="touches"&&c.class==="Commit")return Hj(e,c,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let T=qo[i],U=!!(T&&c.class&&Ts.has(c.class))?[...new Set([...Pt(i),T])]:Pt(i);if(a&&a!=="Change"){let W=Bm(e,U),A=Pl[a];if(W.size&&!W.has(a)&&!(A&&W.has(A)))return{matches:[],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...W],traversal:`${U.join("+")} edges where subject = ${c.label} (grain mismatch: this "${i}" relation never targets a ${as(a)})`}}let ce=U.flatMap(W=>Ke(e,W)).filter(W=>W.subject===c.id).map(W=>e.byId.get(W.object)).filter(Boolean),ie=ls(ce),D=ie,B="";if(a&&a!=="Change"){D=ie.filter(A=>A.class===a);let W=Pl[a];if(!D.length&&W){let A=ie.filter(L=>L.class===W);A.length&&(D=A,B=`, widened to ${W} subjects (no ${a} recorded)`)}}return{matches:D,objMatch:c,candidates:u,traversal:`${U.join("+")} edges where subject = ${c.label}${B}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:Do(e,c,{maxDepth:Om}).flat().map(U=>e.byId.get(U.id)).filter(Boolean),objMatch:c,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${c.label} (impactClosure, maxDepth=${Om})`};let b=qo[i]||Pt(i).find(T=>Mm.has(T))||null,g=!!(c.class&&Ts.has(c.class));if(b&&(Ts.has(a)||g)){let T=Ke(e,b).filter(B=>B.object===c.id),F=ls(T.map(B=>e.byId.get(B.subject)).filter(Boolean)),U=!a||a==="Change"?F:F.filter(B=>B.class===a),K="",ce=Pl[a];if(!U.length&&ce){let B=F.filter(W=>W.class===ce);B.length&&(U=B,K=`, widened to ${ce} subjects (no ${a} recorded)`)}let ie=(i==="touches"||i==="calls"||i==="uses")&&c.class==="Class"&&!Ke(e,"contains").some(B=>B.subject===c.id),D=ie?e.byId.get(Ko(e,c)||""):null;if(U.length||!(ie&&D))return{matches:U,objMatch:c,candidates:u,traversal:`${b} edges where object = ${c.label}${K}`,ambiguous:d,matchedVia:p}}let y=c,w=u,v=d,k=p,$="",x=Wm(e,i);if(x&&y.class&&y.class!==x){let T=Sn(e,t.object,{expectedClass:x});if(T.match&&!T.ambiguous)y=T.match,w=T.candidates,v=T.ambiguous,k=T.matchedVia;else if(x==="Module"){let F=Ko(e,y),U=F&&e.byId.get(F);if(U)$=`, refined from ${y.label} to its containing module`,y=U;else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${as(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${as(x)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:k,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${as(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${as(x)})`}}let E=Pt(i).flatMap(T=>Ke(e,T)).filter(T=>T.object===y.id);i==="cochange"&&(E=E.concat(Pt(i).flatMap(T=>Ke(e,T)).filter(T=>T.subject===y.id).map(T=>({...T,subject:T.object,object:T.subject}))));let S="";if(!E.length&&y.class){let T=`ext:${String(y.label).toLowerCase()}`;E=Pt(i).flatMap(F=>Ke(e,F)).filter(F=>String(F.object).toLowerCase()===T),E.length&&(S=` (by name, via unresolved ${T} references)`)}let R=[],_=new Set;for(let T of E){let F=e.byId.get(T.subject);F&&!_.has(F.id)&&(_.add(F.id),R.push(F))}let I,P="";if(!a||a==="Change")I=R;else{let T=R.filter(F=>F.class===a);if(T.length)I=T;else if(a!=="Module"&&R.some(F=>F.class==="Module")){let F=new Set(R.filter(U=>U.class==="Module").map(U=>U.id));I=ou(e,F,a),P=`, then ${as(a)} defined in the matched module(s)`}else I=[]}return{matches:I,objMatch:y,candidates:w,traversal:`${Pt(i).join("+")} edges where object = ${y.label}${S}${P}${$}`,ambiguous:v,matchedVia:k}}function Vr(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 Dl(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function e_(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function xn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function Ur(e){let t=e.object??e.subject??"?";return`${e.entityType?Fe(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function Kl(e){return kr[e]?.bare||e}function t_(e){let t=Kl(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function n_(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 ${Kl(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 ${Kl(o.kind)} ${JSON.stringify(String(r))}`}function ig(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(Ur).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>ig(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?n_(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 ":""}${io(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 ${io(e.kind)}`:`${r}${io(e.kind)} "${e.object}"`}return{english:o,machine:s}}function En(e,t,n=null){let s=ag(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function ag(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${su()}`,miss:!0,ambiguous:!1};if(e.node)return Bj(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
+ ${t.branches.map((l,c)=>`${c+1}) as ${Ur(l.parsed)}: ${l.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(zr),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,l)=>`${l+1}) ${zr(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(zr),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 "${io(e.kind)}" relation in this index never produces ${Fe(e.entityType,2)} \u2014 only ${xn(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=Zl(t.objMatch)||"";return{content:`${t.objMatch.label} is ${Hj(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,qe).map(l=>`${l.label} (${Fe(l.class,1)})`),a=t.matches.length>qe?`, \u2026and ${t.matches.length-qe} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${xn(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 ${xn([...Ql])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,l=a.slice(0,qe).map(d=>d.label),c=a.length>qe?`, \u2026and ${a.length-qe} more`:"",u=a.length?` \u2014 also matched: ${xn(l)}${c}`:"";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&&Ll[e.entityType]?Fe(e.entityType,1):"module",l=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let c=xn(t.unplacedWords.map(f=>`"${f}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${l} matching "${e.object}" found in the index. ${c} ${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 ${l} matching "${e.object}" found in the index. ${Rs(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(g=>g.class==="Commit")){let g=w=>!["Commit","Session","Source","Utterance"].includes(w?.class),y=i.filter(g);y.length&&(i=y,a?.length&&(a=a.filter(w=>g(w.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let g=String(e.object||"").toLowerCase(),y=new Set(Cn(String(e.object||"")).filter(x=>x.length>=3)),w=new Set(i.map(x=>x.id)),v=null,k=0,$=1/0;if(y.size)for(let x of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(x.class)||w.has(x.id))continue;let E=Cn(String(x.label)).filter(R=>y.has(R)).length;if(!E||E<k)continue;let S=rs(String(x.label).toLowerCase(),g,8);(E>k||S<$)&&(v=x,k=E,$=S)}if(v&&(i=[...i,v],a)){let x=qt(n,e,{pinnedObjMatch:v});a=[...a,{candidate:v,result:x,rendered:En(e,x,n)}]}}let l=i.length&&i.every(g=>g.class===i[0].class)?i[0].class:null,c=l?Ll[l]?Fe(l,1):as(l):"module",u=i.slice(0,qe).map(g=>g.label),d=i.length>qe?`, \u2026and ${i.length-qe} more`:"",f=`"${e.object}" matches more than one ${c} ambiguously \u2014 did you mean ${xn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,p=String(e.object||""),h=p?new RegExp(`\\b${Ze(p)}\\b`,"gi"):null,m=g=>{let y=String(g.candidate.label||"");return!h||!y?g.rendered.content:g.rendered.content.split(y).map(w=>w.replace(h,y)).join(y)};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(Ur),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,l)=>`${l+1}) ${Ur(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Ur),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 "${io(e.kind)}" relation in this index never produces ${Fe(e.entityType,2)} \u2014 only ${xn(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=iu(t.objMatch)||"";return{content:`${t.objMatch.label} is ${Zj(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,qe).map(l=>`${l.label} (${Fe(l.class,1)})`),a=t.matches.length>qe?`, \u2026and ${t.matches.length-qe} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${xn(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 ${xn([...ru])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,l=a.slice(0,qe).map(d=>d.label),c=a.length>qe?`, \u2026and ${a.length-qe} more`:"",u=a.length?` \u2014 also matched: ${xn(l)}${c}`:"";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&&Ul[e.entityType]?Fe(e.entityType,1):"module",l=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let c=xn(t.unplacedWords.map(f=>`"${f}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${l} matching "${e.object}" found in the index. ${c} ${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 ${l} matching "${e.object}" found in the index. ${Rs(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(g=>g.class==="Commit")){let g=w=>!["Commit","Session","Source","Utterance"].includes(w?.class),y=i.filter(g);y.length&&(i=y,a?.length&&(a=a.filter(w=>g(w.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let g=String(e.object||"").toLowerCase(),y=new Set(Cn(String(e.object||"")).filter(x=>x.length>=3)),w=new Set(i.map(x=>x.id)),v=null,k=0,$=1/0;if(y.size)for(let x of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(x.class)||w.has(x.id))continue;let E=Cn(String(x.label)).filter(R=>y.has(R)).length;if(!E||E<k)continue;let S=rs(String(x.label).toLowerCase(),g,8);(E>k||S<$)&&(v=x,k=E,$=S)}if(v&&(i=[...i,v],a)){let x=Kt(n,e,{pinnedObjMatch:v});a=[...a,{candidate:v,result:x,rendered:En(e,x,n)}]}}let l=i.length&&i.every(g=>g.class===i[0].class)?i[0].class:null,c=l?Ul[l]?Fe(l,1):as(l):"module",u=i.slice(0,qe).map(g=>g.label),d=i.length>qe?`, \u2026and ${i.length-qe} more`:"",f=`"${e.object}" matches more than one ${c} ambiguously \u2014 did you mean ${xn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,p=String(e.object||""),h=p?new RegExp(`\\b${Ze(p)}\\b`,"gi"):null,m=g=>{let y=String(g.candidate.label||"");return!h||!y?g.rendered.content:g.rendered.content.split(y).map(w=>w.replace(h,y)).join(y)};return{content:a&&a.length?`${f}
58
58
  ${a.map((g,y)=>`${y+1}) ${g.candidate.label}: ${m(g)}`).join(`
59
- `)}`:f,miss:!1,ambiguous:!0,candidates:i.map(g=>g.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let c=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${Cl(i)} is defined in ${a[1]} at ${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}let l=Gr(i);return l?{content:`${Cl(i)} is defined in ${l} (no line span recorded in this index).`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Rs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(f=>f.key==="date")?.value||"";if(!l)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let c=(a.attributes||[]).find(f=>f.key==="message")?.value||"",u=String(l).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${Fr("is-dated",a.id,"is dated")} ${u}${c?` ("${c}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${c?` ("${c}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Rs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!l)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let c=t.matches.length-1;return{content:`${i} was last touched by ${l} (commit ${a.label})${c?`; ${c} earlier commit${c===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,qe)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let l=[...a.entries()].map(([u,d])=>`${Fe(u,d.length)} ${xn(d)}`),c=t.matches.length>qe?`; \u2026and ${t.matches.length-qe} more`:"";return{content:`${i} touched ${l.join("; ")}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,l=e.negated?a:i,c=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?l:c}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(Io.includes(e.kind)&&n&&t.objMatch)for(let l of Io){if(l===e.kind)continue;let c={...e,kind:l},u=qt(n,c,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return Jm(c,u,n)}return{content:`${t.objMatch.label} has no ${io(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(Rk,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=Fe(e.entityType||"Module",2),a=t.objMatch&&Xs.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${io(e.kind)} ${a}. ${Rs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${Kj(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=>!Ts.has(i.class))){let i=t.matches.slice(0,qe).map(l=>l.class==="Commit"?qj(l):l.label),a=t.matches.length>qe?`, \u2026and ${t.matches.length-qe} 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,qe)){let a=Gr(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Cl(i))}let o=[...s.entries()].map(([i,a],l)=>{let c=xn(a);return l===0?`in ${i} there is ${c}`:`there is ${c} in ${i}`}),r=t.matches.length>qe?` \u2026and ${t.matches.length-qe} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Zm(e){if(e.length<4||Qj.has(e))return null;let t=is(e),n=t+1,s=null,o=!1;for(let r of Jj){let i=rs(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 Sm(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!Zl(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Zm(n);return!!s&&s!==n&&!!We[s]}function eg(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=cs(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Sm(s,t.object))return!1;if(t.shape==="ask"){let o=cs(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Sm(o,t.subject))}return!0}function Zj(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return mf.includes(t)}function e_(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Lr(ro(String(t||""))),i=Ht(r);if(!i.length)return null;let a=[],l=[],c=_=>{let I=Sn(e,_);return!!I.match&&I.tier!=null&&I.tier<=2},u=_=>{let I=Sn(e,_);return!!I.match&&I.tier!=null&&I.tier<=3},d=_=>{let I=String(_||"").trim().toLowerCase();return Xs.includes(I)?!0:Ht(I).some(P=>{let T=P.toLowerCase();return!la.has(T)&&!Bl.has(T)})},f=new Set(["reverse","forward","where","when","ask"]),p=_=>{let I=_.join(" "),P=Wr(I,{nlp:n});return eg(e,P,s)!==!0||P&&!P.node&&f.has(P.shape)&&(P.object!=null&&!d(P.object)||P.shape==="ask"&&P.subject!=null&&!d(P.subject))||En(P,qt(e,P,{contextId:s,prev:o}),e).miss?null:{parsed:P,text:I}},h=_=>({parsed:_.parsed,from:r,to:_.text,dropped:[...a],steps:l}),m=0,b=Math.max(i.length,1)+12;for(;m<b;m+=1){let _=-1;for(let T=0;T<i.length;T+=1){let F=i[T].toLowerCase();if(eu.has(F)&&!la.has(F)&&!c(i[T])){_=T;break}}if(_<0)break;let I=i[_];i=i.filter((T,F)=>F!==_),a.push(I),l.push(`strip noise "${I}" \u2192 "${i.join(" ")}"`);let P=p(i);if(P)return h(P)}let g=Wr(i.join(" "),{nlp:n}),y=new Set;if(g&&!g.node&&f.has(g.shape))for(let _ of[g.object,g.subject])for(let I of Ht(String(_||"").toLowerCase()))y.add(I);let w=[],v=[],k=[];for(let _ of i){let I=_.toLowerCase();if(!/^[a-z]+$/.test(I)||la.has(I)||Bl.has(I)||u(_)){w.push(_);continue}let T=Zm(I);if(T&&T!==I){w.push(T),k.push(`${_}\u2192${T}`);continue}if(y.has(I)){w.push(_);continue}v.push(_)}if((k.length||v.length)&&w.length){i=w,a.push(...v),k.length&&l.push(`fuzzy-correct ${JSON.stringify(k)} \u2192 "${i.join(" ")}"`),v.length&&l.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let _=p(i);if(_)return h(_)}let $=!1,x=i.map(_=>{let I=_.toLowerCase();return Co[I]&&!u(_)?($=!0,Co[I]):_});if($){l.push(`normalise synonyms \u2192 "${x.join(" ")}"`);let _=p(x);if(_)return h(_)}let E=Ht(r).map(_=>_.toLowerCase()),S=[],R=[];for(let _ of E){if(Qm.has(_))continue;let I=We[_];I&&I!=="Change"?S.push(_):R.push(_)}if(S.length===1&&R.length===0){let _=p(["count",S[0]]);if(_)return l.push(`bare kind "${S[0]}" \u2192 count`),h(_)}return null}function n_(e,t){let n=String(t||"");if(!e||!km.test(n))return n;let s=e.individuals.filter(l=>l.class==="Commit");if(!s.length)return n;let o=l=>String((l.attributes||[]).find(c=>c.key==="date")?.value||""),r=[...s].sort((l,c)=>o(c).localeCompare(o(l)))[0];if(!r)return n;let i=n.replace(km,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return t_.test(a)?`${a} touched`:i}function s_(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 tu(e,t){let n=s_(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function i_(e,t){let n=String(t||"").trim(),s=n.match(o_),o=s?null:n.match(r_),r=s||o;if(!r||!nu.test(r[2]||"")||We[r[1].toLowerCase()])return null;let i=tu(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 a_(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=tu(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function d_(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 p_(e,t){let n=Ci(String(t||"").trim()),s=n.match(c_),o=s?rf[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(l_)?.[1]||n.match(u_)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Ys[o].predicate},a=a_(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let l=d_(e,r);return l?{...i,subjects:[l],asked:[l]}:null}function f_(e,t){return Ys[e].matchesLocativePredicates?To(Br(t.prop))||To(Br(t.predicate)):null}function h_(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Ys[t.relation],r=Br(o.predicate),i=new Map,a=new Map;for(let c of e?.relations||[]){let u=Br(c.prop),d=Br(c.predicate),f=u===r||d===r,p=f?null:f_(t.relation,c);if(!(!f&&!p))for(let h of c.edges||[]){let m=e.byId?.get(h.subject);if(!m||!(s?s.has(h.subject):n.has(m.class)))continue;let g={subject:m,object:h.object,reads:f?o.reads:`is ${p}`};f?i.set(h.subject,g):a.set(`${u||d}\0${h.subject}`,g)}}let l=[...i.values(),...[...a.values()].filter(c=>!i.has(c.subject.id))].sort((c,u)=>String(c.subject.id).localeCompare(String(u.subject.id))||String(c.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:l,matches:l.map(c=>c.subject)}}function Ol(e){let t=m_.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 b_(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Ol(a.subject).base,String(a.object));let s=new Set(af),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:l,epoch:c,stamp:u}=Ol(a.subject),d=n.get(l)||t(l);if(!d)continue;let f=`${a.predicate}\0${l}`;g_(r.get(f),c,u)&&(o.set(l,{id:l,label:l,class:d}),r.set(f,{epoch:c,stamp:u,predicate:a.predicate,subject:l,object:Ol(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 $_(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=tu(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(l=>l.id));if(i.size<2)return!1;let a=new Map;for(let l of e?.individuals||[])l?.id&&(a.has(l.id)||a.set(l.id,new Set),a.get(l.id).add(l.class));return[...i].every(l=>l===o||a.get(l)?.has(o))}function As(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(Zj(t))return{content:Xl(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=n_(e,t);let r=Wl(t,{nlp:s}),i=r.parsed,a=i,l=null;if(eg(e,i,n)===!1){let f=e_(e,t,{nlp:s,contextId:n,prev:o});f&&(a=f.parsed,l={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let c=qt(e,a,{contextId:n,prev:o}),u=En(a,c,e);if(jm(e,a,c,u)){let f=i_(e,t);if(f){let p=qt(e,f,{contextId:n,prev:o}),h=En(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(jm(e,a,c,u)){let f=p_(e,t);if(f){let p=qt(e,f,{contextId:n,prev:o}),h=En(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Yi(String(t||"")).trim().match(w_)?.[1]?.trim();if(p&&!/\s+(?:for|about)$/i.test(p)){let h=Wr(`what is a ${p}`,{nlp:s});h?.shape==="meta"&&(c=qt(e,h,{contextId:n,prev:o}),u=En(h,c,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=ro(String(t||"")).match(y_)?.[1]?.trim();if(p){let h=Wr(`what is a ${p}`,{nlp:s});if(h?.shape==="meta"){let m=qt(e,h,{contextId:n,prev:o}),b=En(h,m,e);!b.miss&&!b.ambiguous&&(c=m,u=b)}}}let d=l&&!u.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${u.content}`:u.content;if(!l&&!u.miss&&!u.ambiguous&&r.alternates.length){let f=r.alternates.map(p=>{let h=qt(e,p.parsed,{contextId:n,prev:o}),m=En(p.parsed,h,e);return m.miss?null:{a:p,text:m.content}}).filter(Boolean);if(f.length){let p=cm(f.map(h=>h.a),{answerFor:h=>f.find(m=>m.a===h)?.text||null});d=`${d}
59
+ `)}`:f,miss:!1,ambiguous:!0,candidates:i.map(g=>g.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let c=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${Dl(i)} is defined in ${a[1]} at ${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}let l=Vr(i);return l?{content:`${Dl(i)} is defined in ${l} (no line span recorded in this index).`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Rs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(f=>f.key==="date")?.value||"";if(!l)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let c=(a.attributes||[]).find(f=>f.key==="message")?.value||"",u=String(l).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${Dr("is-dated",a.id,"is dated")} ${u}${c?` ("${c}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${c?` ("${c}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${Rs(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],l=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!l)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let c=t.matches.length-1;return{content:`${i} was last touched by ${l} (commit ${a.label})${c?`; ${c} earlier commit${c===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,qe)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let l=[...a.entries()].map(([u,d])=>`${Fe(u,d.length)} ${xn(d)}`),c=t.matches.length>qe?`; \u2026and ${t.matches.length-qe} more`:"";return{content:`${i} touched ${l.join("; ")}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,l=e.negated?a:i,c=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?l:c}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(Io.includes(e.kind)&&n&&t.objMatch)for(let l of Io){if(l===e.kind)continue;let c={...e,kind:l},u=Kt(n,c,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return ag(c,u,n)}return{content:`${t.objMatch.label} has no ${io(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(Nk,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=Fe(e.entityType||"Module",2),a=t.objMatch&&Xs.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${io(e.kind)} ${a}. ${Rs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${t_(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=>!Ts.has(i.class))){let i=t.matches.slice(0,qe).map(l=>l.class==="Commit"?e_(l):l.label),a=t.matches.length>qe?`, \u2026and ${t.matches.length-qe} 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,qe)){let a=Vr(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Dl(i))}let o=[...s.entries()].map(([i,a],l)=>{let c=xn(a);return l===0?`in ${i} there is ${c}`:`there is ${c} in ${i}`}),r=t.matches.length>qe?` \u2026and ${t.matches.length-qe} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function lg(e){if(e.length<4||r_.has(e))return null;let t=is(e),n=t+1,s=null,o=!1;for(let r of o_){let i=rs(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 Lm(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!iu(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=lg(n);return!!s&&s!==n&&!!We[s]}function ug(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=cs(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Lm(s,t.object))return!1;if(t.shape==="ask"){let o=cs(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Lm(o,t.subject))}return!0}function i_(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return kf.includes(t)}function a_(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Nr(ro(String(t||""))),i=qt(r);if(!i.length)return null;let a=[],l=[],c=_=>{let I=Sn(e,_);return!!I.match&&I.tier!=null&&I.tier<=2},u=_=>{let I=Sn(e,_);return!!I.match&&I.tier!=null&&I.tier<=3},d=_=>{let I=String(_||"").trim().toLowerCase();return Xs.includes(I)?!0:qt(I).some(P=>{let T=P.toLowerCase();return!pa.has(T)&&!Yl.has(T)})},f=new Set(["reverse","forward","where","when","ask"]),p=_=>{let I=_.join(" "),P=Gr(I,{nlp:n});return ug(e,P,s)!==!0||P&&!P.node&&f.has(P.shape)&&(P.object!=null&&!d(P.object)||P.shape==="ask"&&P.subject!=null&&!d(P.subject))||En(P,Kt(e,P,{contextId:s,prev:o}),e).miss?null:{parsed:P,text:I}},h=_=>({parsed:_.parsed,from:r,to:_.text,dropped:[...a],steps:l}),m=0,b=Math.max(i.length,1)+12;for(;m<b;m+=1){let _=-1;for(let T=0;T<i.length;T+=1){let F=i[T].toLowerCase();if(au.has(F)&&!pa.has(F)&&!c(i[T])){_=T;break}}if(_<0)break;let I=i[_];i=i.filter((T,F)=>F!==_),a.push(I),l.push(`strip noise "${I}" \u2192 "${i.join(" ")}"`);let P=p(i);if(P)return h(P)}let g=Gr(i.join(" "),{nlp:n}),y=new Set;if(g&&!g.node&&f.has(g.shape))for(let _ of[g.object,g.subject])for(let I of qt(String(_||"").toLowerCase()))y.add(I);let w=[],v=[],k=[];for(let _ of i){let I=_.toLowerCase();if(!/^[a-z]+$/.test(I)||pa.has(I)||Yl.has(I)||u(_)){w.push(_);continue}let T=lg(I);if(T&&T!==I){w.push(T),k.push(`${_}\u2192${T}`);continue}if(y.has(I)){w.push(_);continue}v.push(_)}if((k.length||v.length)&&w.length){i=w,a.push(...v),k.length&&l.push(`fuzzy-correct ${JSON.stringify(k)} \u2192 "${i.join(" ")}"`),v.length&&l.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let _=p(i);if(_)return h(_)}let $=!1,x=i.map(_=>{let I=_.toLowerCase();return Co[I]&&!u(_)?($=!0,Co[I]):_});if($){l.push(`normalise synonyms \u2192 "${x.join(" ")}"`);let _=p(x);if(_)return h(_)}let E=qt(r).map(_=>_.toLowerCase()),S=[],R=[];for(let _ of E){if(cg.has(_))continue;let I=We[_];I&&I!=="Change"?S.push(_):R.push(_)}if(S.length===1&&R.length===0){let _=p(["count",S[0]]);if(_)return l.push(`bare kind "${S[0]}" \u2192 count`),h(_)}return null}function l_(e,t){let n=String(t||"");if(!e||!Nm.test(n))return n;let s=e.individuals.filter(l=>l.class==="Commit");if(!s.length)return n;let o=l=>String((l.attributes||[]).find(c=>c.key==="date")?.value||""),r=[...s].sort((l,c)=>o(c).localeCompare(o(l)))[0];if(!r)return n;let i=n.replace(Nm,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return c_.test(a)?`${a} touched`:i}function u_(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 cu(e,t){let n=u_(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function f_(e,t){let n=String(t||"").trim(),s=n.match(d_),o=s?null:n.match(p_),r=s||o;if(!r||!lu.test(r[2]||"")||We[r[1].toLowerCase()])return null;let i=cu(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 h_(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=cu(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function w_(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 y_(e,t){let n=Ni(String(t||"").trim()),s=n.match(m_),o=s?gf[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(g_)?.[1]||n.match(b_)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Ys[o].predicate},a=h_(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let l=w_(e,r);return l?{...i,subjects:[l],asked:[l]}:null}function $_(e,t){return Ys[e].matchesLocativePredicates?To(Wr(t.prop))||To(Wr(t.predicate)):null}function v_(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Ys[t.relation],r=Wr(o.predicate),i=new Map,a=new Map;for(let c of e?.relations||[]){let u=Wr(c.prop),d=Wr(c.predicate),f=u===r||d===r,p=f?null:$_(t.relation,c);if(!(!f&&!p))for(let h of c.edges||[]){let m=e.byId?.get(h.subject);if(!m||!(s?s.has(h.subject):n.has(m.class)))continue;let g={subject:m,object:h.object,reads:f?o.reads:`is ${p}`};f?i.set(h.subject,g):a.set(`${u||d}\0${h.subject}`,g)}}let l=[...i.values(),...[...a.values()].filter(c=>!i.has(c.subject.id))].sort((c,u)=>String(c.subject.id).localeCompare(String(u.subject.id))||String(c.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:l,matches:l.map(c=>c.subject)}}function zl(e){let t=x_.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 S_(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(zl(a.subject).base,String(a.object));let s=new Set(bf),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:l,epoch:c,stamp:u}=zl(a.subject),d=n.get(l)||t(l);if(!d)continue;let f=`${a.predicate}\0${l}`;E_(r.get(f),c,u)&&(o.set(l,{id:l,label:l,class:d}),r.set(f,{epoch:c,stamp:u,predicate:a.predicate,subject:l,object:zl(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 __(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=cu(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(l=>l.id));if(i.size<2)return!1;let a=new Map;for(let l of e?.individuals||[])l?.id&&(a.has(l.id)||a.set(l.id,new Set),a.get(l.id).add(l.class));return[...i].every(l=>l===o||a.get(l)?.has(o))}function As(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(i_(t))return{content:su(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=l_(e,t);let r=Xl(t,{nlp:s}),i=r.parsed,a=i,l=null;if(ug(e,i,n)===!1){let f=a_(e,t,{nlp:s,contextId:n,prev:o});f&&(a=f.parsed,l={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let c=Kt(e,a,{contextId:n,prev:o}),u=En(a,c,e);if(Pm(e,a,c,u)){let f=f_(e,t);if(f){let p=Kt(e,f,{contextId:n,prev:o}),h=En(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(Pm(e,a,c,u)){let f=y_(e,t);if(f){let p=Kt(e,f,{contextId:n,prev:o}),h=En(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Qi(String(t||"")).trim().match(k_)?.[1]?.trim();if(p&&!/\s+(?:for|about)$/i.test(p)){let h=Gr(`what is a ${p}`,{nlp:s});h?.shape==="meta"&&(c=Kt(e,h,{contextId:n,prev:o}),u=En(h,c,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=ro(String(t||"")).match(j_)?.[1]?.trim();if(p){let h=Gr(`what is a ${p}`,{nlp:s});if(h?.shape==="meta"){let m=Kt(e,h,{contextId:n,prev:o}),b=En(h,m,e);!b.miss&&!b.ambiguous&&(c=m,u=b)}}}let d=l&&!u.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${u.content}`:u.content;if(!l&&!u.miss&&!u.ambiguous&&r.alternates.length){let f=r.alternates.map(p=>{let h=Kt(e,p.parsed,{contextId:n,prev:o}),m=En(p.parsed,h,e);return m.miss?null:{a:p,text:m.content}}).filter(Boolean);if(f.length){let p=wm(f.map(h=>h.a),{answerFor:h=>f.find(m=>m.a===h)?.text||null});d=`${d}
60
60
  ${p.join(`
61
61
  `)}`}}if(!u.ambiguous&&c.objMatch&&Array.isArray(c.candidates)&&c.candidates.length){let f=new Set((c.matches||[]).map(h=>h&&h.id)),p=c.candidates.filter(h=>h&&h.id&&h.id!==c.objMatch.id&&!f.has(h.id));if(p.length){let h=p.slice(0,3).map(g=>g.label).filter(Boolean),m=p.length-h.length,b=h.join(", ")+(m>0?`, +${m} more`:"");d=`${d}
62
- (answering for ${c.objMatch.label} \u2014 ${p.length} other match${p.length===1?"":"es"}: ${b})`}}return!Array.isArray(c.referents)&&!u.miss&&!u.ambiguous&&(a?.shape==="reverse"||a?.shape==="forward")&&a.entityType&&Array.isArray(c.matches)&&c.matches.length&&c.matches.every(f=>f&&f.class===a.entityType)&&(c={...c,referents:Vr(a.entityType,c.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:Xm(a),matches:(c.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?Gr(f):void 0})),traversal:c.traversal||null,miss:!!u.miss,ambiguous:!!u.ambiguous,relaxed:l,matchedVia:c.matchedVia||null,...Array.isArray(c.referents)&&c.referents.length?{discourse:c.referents}:{},...u.ambiguous?{candidates:u.candidates,candidateParses:u.candidateParses}:{}}}}var fm,qo,Ts,Tl,Sk,Pt,_m,qe,Ll,kk,jk,_k,Rk,Tk,Ik,Ck,Rm,Nl,Lk,Gl,Tm,It,Am,Pk,Fk,zk,Bk,Gk,Vk,Hk,qk,Yk,Jk,Lm,Hl,Nm,Pm,ij,lj,hm,fj,mm,gj,bm,ym,yj,vj,Ej,_s,Al,Mj,Fj,zj,Ql,Uj,xm,Bj,Em,Vj,la,Bl,eu,Qm,Xj,Jj,Qj,km,t_,o_,r_,nu,c_,l_,u_,Br,m_,g_,w_,y_,jm,Is=O(()=>{Le();il();Qn();vn();Uo();Qi();Zi();pm();jl();Ss();ra();Rl();Go();fm=new WeakMap;qo={calls:"callsSymbol",touches:"touchesSymbol"},Ts=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Tl={Function:"Method",Method:"Function"},Sk={uses:["imports","calls","callsSymbol"]},Pt=e=>Sk[e]||[e],_m=new Set(Object.values(qo)),qe=12,Ll={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"]};kk={cochange:"cochanges",reexports:"export"};jk={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"},_k=e=>jk[e]||io(e),Rk=new RegExp(`^(?:${Object.keys(de).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),Tk=new Set(["imports"]);Ik=/^where\s+(?:does|do|did)\s+/i,Ck=new Set(fe(tn));Rm=4,Nl="zzinnerset",Lk=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Gl=new Set(["which","what","who","list","show","find","give","me","us","all"]),Tm=new Set(["are","is","was","were"]);It=e=>We[e]?{entityType:We[e],placeholder:!1}:Jn.includes(e)?{entityType:null,placeholder:!0}:null,Am=e=>!!de[e]&&e.endsWith("ing");Pk=new Set(["which","the","all"]);Fk=new Set(["all","every","each"]);zk=new Set(["what","which","thing","things","one","ones","stuff"]);Bk=new Set(["those","them"]);Gk=new Set(["did","was","were","do","does","has","have","had"]),Vk=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),Hk=new Set(["last","recently","ever","get","got","been","then","now","already"]),qk=new Set(["the","a","an","all","those","these","any"]);Yk=new Set(["since","before","after","on"]);Jk=/\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/;Lm=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Hl=new Set(["the","a","an","all","me","us"]),Nm=[...Zs].sort((e,t)=>t.split(" ").length-e.split(" ").length),Pm="functions, classes, methods, modules, packages, attributes, variables, or commits",ij=new Set(["in","inside","under"]);lj=new Set(["called","named","about","like","containing","matching","with"]);hm=new Set(["recent","latest","newest"]);fj=/^git:(.+)$/i;mm=new WeakMap;gj=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);bm=new WeakMap;ym={label:3,chain:2,attr:1};yj=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;vj=["imports","calls","callsSymbol","inherits","contains","tests"];Ej=/^\d{4}-\d{2}-\d{2}$/;_s=e=>xn(e.slice(0,qe).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>qe?`, \u2026and ${e.length-qe} more`:"");Al=10;Mj=/^(?:the|a|an)\s+/i,Fj=new RegExp(`\\s+(${Object.keys(We).join("|")})$`,"i");zj=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,Ql=new Set(["index","main","app","server","cli","__main__"]),Uj=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),xm=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),Bj=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>Uj.has(t));Em=8,Vj="mgx:schemaDoc";la=new Set([...fe(Object.keys(de)),...fe(Object.keys(We)),...fe(Object.keys(sn)),...fe(Object.keys(Je)),...fe(Qs),...fe(Object.keys(Es)),...fe(Object.keys(In)),...fe(Object.keys(Ao)),...fe(Jn),...fe(Rr),...fe(Js),...fe(tn),...fe($n),...fe(Xn),...fe(Object.keys(Co)),...fe([...Oi])]),Bl=new Set([...nt,...Gl,...Xs]),eu=new Set(fe(Li)),Qm=new Set([...eu,...Bl]),Xj=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],Jj=[...new Set([...fe(Object.keys(de)),...Object.keys(We),...Xj])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!nt.has(e)),Qj=new Set(["impact","impacts","impacted"]);km=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,t_=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;o_=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,r_=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,nu=/^(?: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;c_=new RegExp(`^(?:${Nm.map(Ze).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),l_=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,u_=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Br=e=>String(e||"").toLowerCase();m_=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;g_=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;w_=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,y_=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;jm=(e,t,n,s)=>s.ambiguous?$_(e,t,n):!!s.miss});function Cs(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((l,c)=>`${o+c} ${l}`).join(`
63
- `);return{start:o,end:r,text:a,truncated:i}}async function us({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Nt(t),a=Nt(i,n);if(a!==i&&!a.startsWith(i+sf))throw new Re(`refusing to read outside the repository root: ${n}`);let c=(await e(a,"utf8")).split(`
64
- `);return s==null||o==null?{lines:c}:{lines:c,...Cs(c,s,o,r)}}var da=O(()=>{Ue();Gt()});function vt(e){return{ok:!0,value:e}}function xt(e,{detail:t="",term:n=null}={}){if(!rt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Ln(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 pa(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 ou,v_,rt,ru,M1,ng,iu,x_,kn,su,Ct,F1,sg=O(()=>{ou="1.1.0",v_="urn:tmct:core",rt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),ru=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),M1=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"}),ng=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),iu=Object.freeze(Object.values(ng).flat()),x_=Object.freeze(new Set(ng.source));kn="Individual",su="Edge",Ct="concurrent-safe: reads immutable graph truth; no shared mutable state",F1=Object.freeze({version:ou,ontology:v_,missReasons:Object.values(rt),edgeKinds:[...ru],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: ${kn}, candidates: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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: ${kn}, out: ${su}[], incoming: ${su}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${kn}[], attributes: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${kn}[], subclasses: ${kn}[], levels: Array<${kn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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:Ct,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: ${su}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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:Ct,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:Ct,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:Ct,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:Ct,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${kn}[] }`,misses:[],concurrency:Ct,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:Ct,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:Ct,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: ${kn}[] }`,misses:[],concurrency:Ct,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:Ct,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function E_(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(pa(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(pa(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function S_(e,t){for(let n of e.relations)if(os(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function j_(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await us({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
- ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(Cs(o,i,a,au).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,l=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
- ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${l} @ ${e.moduleLabel}:${i}-${a}`),r.push(Cs(o,i,a,au).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=k_;for(let a of e.calleeBodies){if(i<=0)break;let l=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await us({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=Cs(u,l,a.site.end,i);r.push(`
62
+ (answering for ${c.objMatch.label} \u2014 ${p.length} other match${p.length===1?"":"es"}: ${b})`}}return!Array.isArray(c.referents)&&!u.miss&&!u.ambiguous&&(a?.shape==="reverse"||a?.shape==="forward")&&a.entityType&&Array.isArray(c.matches)&&c.matches.length&&c.matches.every(f=>f&&f.class===a.entityType)&&(c={...c,referents:Hr(a.entityType,c.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:ig(a),matches:(c.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?Vr(f):void 0})),traversal:c.traversal||null,miss:!!u.miss,ambiguous:!!u.ambiguous,relaxed:l,matchedVia:c.matchedVia||null,...Array.isArray(c.referents)&&c.referents.length?{discourse:c.referents}:{},...u.ambiguous?{candidates:u.candidates,candidateParses:u.candidateParses}:{}}}}var Em,qo,Ts,Pl,Ik,Pt,Mm,qe,Ul,Ck,Ok,Lk,Nk,Pk,Fk,Dk,Fm,Bl,Uk,Jl,Dm,It,zm,Wk,Vk,qk,Yk,Jk,Qk,Zk,ej,nj,oj,Gm,Zl,Vm,Hm,fj,gj,Sm,$j,km,Ej,_m,Tm,jj,Rj,Aj,_s,Ml,Gj,Vj,qj,ru,Kj,Cm,Yj,Om,Qj,pa,Yl,au,cg,s_,o_,r_,Nm,c_,d_,p_,lu,m_,g_,b_,Wr,x_,E_,k_,j_,Pm,Is=O(()=>{Le();fl();Qn();vn();Uo();ta();na();xm();Ol();Ss();ca();Nl();Go();Em=new WeakMap;qo={calls:"callsSymbol",touches:"touchesSymbol"},Ts=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Pl={Function:"Method",Method:"Function"},Ik={uses:["imports","calls","callsSymbol"]},Pt=e=>Ik[e]||[e],Mm=new Set(Object.values(qo)),qe=12,Ul={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"]};Ck={cochange:"cochanges",reexports:"export"};Ok={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"},Lk=e=>Ok[e]||io(e),Nk=new RegExp(`^(?:${Object.keys(de).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),Pk=new Set(["imports"]);Fk=/^where\s+(?:does|do|did)\s+/i,Dk=new Set(fe(tn));Fm=4,Bl="zzinnerset",Uk=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),Jl=new Set(["which","what","who","list","show","find","give","me","us","all"]),Dm=new Set(["are","is","was","were"]);It=e=>We[e]?{entityType:We[e],placeholder:!1}:Jn.includes(e)?{entityType:null,placeholder:!0}:null,zm=e=>!!de[e]&&e.endsWith("ing");Wk=new Set(["which","the","all"]);Vk=new Set(["all","every","each"]);qk=new Set(["what","which","thing","things","one","ones","stuff"]);Yk=new Set(["those","them"]);Jk=new Set(["did","was","were","do","does","has","have","had"]),Qk=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),Zk=new Set(["last","recently","ever","get","got","been","then","now","already"]),ej=new Set(["the","a","an","all","those","these","any"]);nj=new Set(["since","before","after","on"]);oj=/\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/;Gm=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Zl=new Set(["the","a","an","all","me","us"]),Vm=[...Zs].sort((e,t)=>t.split(" ").length-e.split(" ").length),Hm="functions, classes, methods, modules, packages, attributes, variables, or commits",fj=new Set(["in","inside","under"]);gj=new Set(["called","named","about","like","containing","matching","with"]);Sm=new Set(["recent","latest","newest"]);$j=/^git:(.+)$/i;km=new WeakMap;Ej=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);_m=new WeakMap;Tm={label:3,chain:2,attr:1};jj=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;Rj=["imports","calls","callsSymbol","inherits","contains","tests"];Aj=/^\d{4}-\d{2}-\d{2}$/;_s=e=>xn(e.slice(0,qe).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>qe?`, \u2026and ${e.length-qe} more`:"");Ml=10;Gj=/^(?:the|a|an)\s+/i,Vj=new RegExp(`\\s+(${Object.keys(We).join("|")})$`,"i");qj=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,ru=new Set(["index","main","app","server","cli","__main__"]),Kj=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Cm=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),Yj=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>Kj.has(t));Om=8,Qj="mgx:schemaDoc";pa=new Set([...fe(Object.keys(de)),...fe(Object.keys(We)),...fe(Object.keys(sn)),...fe(Object.keys(Je)),...fe(Qs),...fe(Object.keys(Es)),...fe(Object.keys(In)),...fe(Object.keys(Ao)),...fe(Jn),...fe(Tr),...fe(Js),...fe(tn),...fe($n),...fe(Xn),...fe(Object.keys(Co)),...fe([...Pi])]),Yl=new Set([...nt,...Jl,...Xs]),au=new Set(fe(Mi)),cg=new Set([...au,...Yl]),s_=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],o_=[...new Set([...fe(Object.keys(de)),...Object.keys(We),...s_])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!nt.has(e)),r_=new Set(["impact","impacts","impacted"]);Nm=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,c_=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;d_=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,p_=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,lu=/^(?: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;m_=new RegExp(`^(?:${Vm.map(Ze).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),g_=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,b_=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Wr=e=>String(e||"").toLowerCase();x_=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;E_=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;k_=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,j_=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;Pm=(e,t,n,s)=>s.ambiguous?__(e,t,n):!!s.miss});function Cs(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((l,c)=>`${o+c} ${l}`).join(`
63
+ `);return{start:o,end:r,text:a,truncated:i}}async function us({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Nt(t),a=Nt(i,n);if(a!==i&&!a.startsWith(i+hf))throw new Re(`refusing to read outside the repository root: ${n}`);let c=(await e(a,"utf8")).split(`
64
+ `);return s==null||o==null?{lines:c}:{lines:c,...Cs(c,s,o,r)}}var ha=O(()=>{Ue();Vt()});function vt(e){return{ok:!0,value:e}}function xt(e,{detail:t="",term:n=null}={}){if(!rt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function Ln(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 ma(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 du,R_,rt,pu,sP,pg,fu,T_,kn,uu,Ct,oP,fg=O(()=>{du="1.1.0",R_="urn:tmct:core",rt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),pu=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),sP=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"}),pg=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),fu=Object.freeze(Object.values(pg).flat()),T_=Object.freeze(new Set(pg.source));kn="Individual",uu="Edge",Ct="concurrent-safe: reads immutable graph truth; no shared mutable state",oP=Object.freeze({version:du,ontology:R_,missReasons:Object.values(rt),edgeKinds:[...pu],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: ${kn}, candidates: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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: ${kn}, out: ${uu}[], incoming: ${uu}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${kn}[], attributes: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${kn}[], subclasses: ${kn}[], levels: Array<${kn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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: ${kn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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:Ct,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: ${uu}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ct,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:Ct,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:Ct,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:Ct,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:Ct,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${kn}[] }`,misses:[],concurrency:Ct,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:Ct,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:Ct,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: ${kn}[] }`,misses:[],concurrency:Ct,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:Ct,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function A_(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(ma(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(ma(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function I_(e,t){for(let n of e.relations)if(os(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function O_(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await us({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
+ ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(Cs(o,i,a,hu).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,l=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
+ ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${l} @ ${e.moduleLabel}:${i}-${a}`),r.push(Cs(o,i,a,hu).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=C_;for(let a of e.calleeBodies){if(i<=0)break;let l=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await us({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=Cs(u,l,a.site.end,i);r.push(`
67
67
  ## inlined callee body (depth-1 in-repo call): ${a.label} @ ${a.site.path}:${l}-${a.site.end}`),r.push(d.text),i-=d.end-l+1}}return r.join(`
68
- `)}function fa(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=c=>i.get(c)||null,l={version:ou,capabilities:[...iu],sourceAccess:!!t,graph:e,resolve(c){let{match:u,candidates:d}=on(e,String(c??""));return u?vt({match:Ln(u),candidates:d.map(Ln)}):xt(rt.UNRESOLVED_TERM,{term:String(c??"")})},describe(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let{out:d,incoming:f}=E_(e,c);return vt({individual:Ln(u),out:d,incoming:f})},members(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=Se(e,"contains").filter(h=>h.subject===c),f=[],p=[];for(let h of d){let m=i.get(h.object),b=m?Ln(m):{id:h.object,label:h.objectLabel||h.object,class:"Entity",attributes:[]};(m?.class||"")==="Attribute"?p.push(b):f.push(b)}return vt({methods:f,attributes:p})},subclasses(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=Se(e,"inherits"),f=d.filter(y=>y.subject===c).map(y=>i.get(y.object)?Ln(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),p=new Map;for(let y of d)p.has(y.object)||p.set(y.object,[]),p.get(y.object).push(y.subject);let h=new Set([c]),m=[],b=[],g=[c];for(let y=0;y<8&&g.length;y+=1){let w=[],v=[];for(let k of g)for(let $ of p.get(k)||[]){if(h.has($))continue;h.add($);let x=i.get($),E=x?Ln(x):{id:$,label:$,class:"Class",attributes:[]};m.push(E),v.push(E),w.push($)}v.length&&b.push(v),g=w}return vt({bases:f,subclasses:m,levels:b})},exports(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let f=Se(e,"reexports").filter(p=>p.subject===c).map(p=>i.get(p.object)?Ln(i.get(p.object)):{id:p.object,label:p.objectLabel||p.object,class:"Entity",attributes:[]});return vt({exports:f})},signature(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let d=[];for(let[p,h]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])Kt(u,p)&&d.push(h);let f=Kt(u,"visibility");return f&&d.push(f),vt({id:u.id,label:u.label,class:u.class||"Entity",params:Kt(u,"params"),returns:Kt(u,"returns"),raises:Kt(u,"raises"),decorators:Kt(u,"decorators"),doc:Kt(u,"doc"),selfFields:Kt(u,"self_fields"),flags:d})},edges(c,u,{limit:d,offset:f=0}={}){if(!ru.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let h=S_(e,u),m=Se(e,u).filter(b=>b.subject===c).map(b=>pa(b,h));return m=d==null?m.slice(f):m.slice(f,f+d),vt({kind:u,edges:m})},impact(c,{maxDepth:u}={}){let d=a(c);if(!d)return xt(rt.UNRESOLVED_TERM,{term:c});let f=u==null?Do(e,d):Do(e,d,{maxDepth:u}),p=f.reduce((h,m)=>h+m.length,0);return vt({total:p,levels:f})},async snippet(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let d=Tt(u);if(!l.sourceAccess)return xt(rt.NO_SOURCE,{term:c,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 xt(rt.NO_SOURCE,{term:c,detail:"no source span in the graph (likely a module)"});try{let f=await us({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:au});return vt({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return xt(rt.NO_SOURCE,{term:c,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(c,{depth:u="auto"}={}){let{match:d}=on(e,String(c??""));if(!d)return xt(rt.UNRESOLVED_TERM,{term:String(c??"")});let f=zo(e,d),p=String(u||"auto").trim().toLowerCase(),h,m;p==="min"?(h="TINY",m=oo("TINY")):p==="full"?(h="FULL",m=oo("FULL")):{tier:h,mask:m}=Ki(f,e,{});let b=Ih(f,m);if(!l.sourceAccess)return vt({text:b,tier:h});let g=await j_(f,m,{readFile:s,repoRoot:n});return vt({text:g?`${b}
69
- ${g}`:b,tier:h})},architecture({package:c=""}={}){let u=String(c||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(g=>(g.class||"")==="Module"&&(!u||String(g.label||"").toLowerCase().startsWith(u))),f=new Map;for(let g of d){let y=g.label.includes("/")?g.label.slice(0,g.label.lastIndexOf("/")):"(root)";f.set(y,(f.get(y)||0)+1)}let p=new Set(d.map(g=>g.id)),h=new Map;for(let g of Se(e,"imports"))p.has(g.object)&&h.set(g.object,(h.get(g.object)||0)+1);let m=[...h.entries()].sort((g,y)=>y[1]-g[1]).map(([g,y])=>({id:g,label:i.get(g)?.label||g,importers:y})),b=[...f.entries()].sort((g,y)=>y[1]-g[1]);return vt({modules:d.length,packages:b,hubs:m})},untested(){let c=new Set(Se(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!c.has(d.id)&&!/\.test\./.test(d.label||"")).map(Ln);return vt({modules:u})},stats(){let c=new Map;for(let d of e.individuals){let f=d.class||"Entity";c.set(f,(c.get(f)||0)+1)}let u=[...c.entries()].map(([d,f])=>({class:d,count:f})).sort((d,f)=>f.count-d.count||d.class.localeCompare(f.class));return vt({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=[...Se(e,"touches"),...Se(e,"touchesSymbol")].filter(h=>h.object===c),f=new Set,p=[];for(let h of d){if(f.has(h.subject))continue;f.add(h.subject);let m=i.get(h.subject);p.push({id:h.subject,label:h.subjectLabel||m?.label||h.subject,author:m?Kt(m,"author")??Kt(m,"commitAuthor"):null,date:m?Kt(m,"date")??Kt(m,"commitDate"):null,message:m?Kt(m,"message")??Kt(m,"commitMessage"):null})}return vt({commits:p})},search(c,{kind:u="",name:d="",decorator:f="",limit:p=Gi,offset:h=0}={}){let m=String(c||""),b=String(u||"").trim().toLowerCase(),g=String(d||"").trim(),y=String(f||"").trim().toLowerCase(),w;if(b&&b!=="module"){let k=null;if(g){let x=bl(g);if(x.error)return xt(rt.UNRESOLVED_TERM,{term:g,detail:x.error});k=x}let $=m.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{w=$l(e,$,{kind:b,decFilter:y,nameRe:k}).map(x=>x.ind)}catch(x){return xt(rt.UNRESOLVED_TERM,{term:g,detail:String(x?.message||x)})}}else{let k=new Map;for(let $ of e.individuals)($.class||"")==="Module"&&k.set($.label,$);w=ch(e,m).map(({path:$})=>k.get($)).filter(Boolean)}let v=w.slice(h,h+p).map(Ln);return vt({results:v})},ask(c){if(typeof r!="function")return xt(rt.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(c||""));return vt({content:u,tmct_ask:d})}};if(o)for(let c of iu){let u=l[c];typeof u=="function"&&(l[c]=(...d)=>{let f=performance.now(),p=u.apply(l,d);return p&&typeof p.then=="function"?p.then(h=>(og(o,c,performance.now()-f,h),h)):(og(o,c,performance.now()-f,p),p)})}return l}function og(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:__(s)})}catch{}}function __(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 Kt,au,k_,ha=O(()=>{Le();da();sg();Kt=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;au=200,k_=120});async function Hr(e,t){let n=await t.fetchEntities(e),s=Wi(n);if(!s.individuals.length){let o=new Re(`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 ma=O(()=>{Gt();Le()});function Os({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function st(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Re(`${t} is required`);return n}function St(e,t,n){let{match:s,candidates:o}=on(e.graph,t);if(!s)throw new Re(`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 qr,it,Ve=O(()=>{Gt();Le();qr=200;it=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=St(s,st(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function rg(e,{config:t,source:n=No,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Re("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,l=!!e?.untuned,c=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await Hr(t,n),f=he(he(t.graphFile)),p=fa(d,{sourceAccess:!0,repoRoot:f,readFile:_e,tel:o,ask:As}),{match:h}=St(p,r,"symbol"),m=zo(d,h),b,g,y=!1;a||i==="min"?(b="TINY",g=oo("TINY")):c||i==="full"?(b="FULL",g=oo("FULL"),y=!0):{tier:b,mask:g,topup:y}=Ki(m,d,{untuned:l}),s&&!c&&(g=Th(g));let w=null;if(m.moduleLabel)try{({lines:w}=await us({readFile:_e,repoRoot:f,path:m.moduleLabel}))}catch{w=null}let v=x=>w&&w[x-1]!=null?w[x-1].trim():"",k=(x,E)=>Cs(w,x,E,qr).text,$=[`Edit context for ${m.moduleLabel} [${b}${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(g.anchor&&m.anchor?.site&&w){let{start:x,end:E}=m.anchor.site;$.push(`
68
+ `)}function ga(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=c=>i.get(c)||null,l={version:du,capabilities:[...fu],sourceAccess:!!t,graph:e,resolve(c){let{match:u,candidates:d}=on(e,String(c??""));return u?vt({match:Ln(u),candidates:d.map(Ln)}):xt(rt.UNRESOLVED_TERM,{term:String(c??"")})},describe(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let{out:d,incoming:f}=A_(e,c);return vt({individual:Ln(u),out:d,incoming:f})},members(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=Se(e,"contains").filter(h=>h.subject===c),f=[],p=[];for(let h of d){let m=i.get(h.object),b=m?Ln(m):{id:h.object,label:h.objectLabel||h.object,class:"Entity",attributes:[]};(m?.class||"")==="Attribute"?p.push(b):f.push(b)}return vt({methods:f,attributes:p})},subclasses(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=Se(e,"inherits"),f=d.filter(y=>y.subject===c).map(y=>i.get(y.object)?Ln(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),p=new Map;for(let y of d)p.has(y.object)||p.set(y.object,[]),p.get(y.object).push(y.subject);let h=new Set([c]),m=[],b=[],g=[c];for(let y=0;y<8&&g.length;y+=1){let w=[],v=[];for(let k of g)for(let $ of p.get(k)||[]){if(h.has($))continue;h.add($);let x=i.get($),E=x?Ln(x):{id:$,label:$,class:"Class",attributes:[]};m.push(E),v.push(E),w.push($)}v.length&&b.push(v),g=w}return vt({bases:f,subclasses:m,levels:b})},exports(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let f=Se(e,"reexports").filter(p=>p.subject===c).map(p=>i.get(p.object)?Ln(i.get(p.object)):{id:p.object,label:p.objectLabel||p.object,class:"Entity",attributes:[]});return vt({exports:f})},signature(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let d=[];for(let[p,h]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])Yt(u,p)&&d.push(h);let f=Yt(u,"visibility");return f&&d.push(f),vt({id:u.id,label:u.label,class:u.class||"Entity",params:Yt(u,"params"),returns:Yt(u,"returns"),raises:Yt(u,"raises"),decorators:Yt(u,"decorators"),doc:Yt(u,"doc"),selfFields:Yt(u,"self_fields"),flags:d})},edges(c,u,{limit:d,offset:f=0}={}){if(!pu.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let h=I_(e,u),m=Se(e,u).filter(b=>b.subject===c).map(b=>ma(b,h));return m=d==null?m.slice(f):m.slice(f,f+d),vt({kind:u,edges:m})},impact(c,{maxDepth:u}={}){let d=a(c);if(!d)return xt(rt.UNRESOLVED_TERM,{term:c});let f=u==null?Do(e,d):Do(e,d,{maxDepth:u}),p=f.reduce((h,m)=>h+m.length,0);return vt({total:p,levels:f})},async snippet(c){let u=a(c);if(!u)return xt(rt.UNRESOLVED_TERM,{term:c});let d=Tt(u);if(!l.sourceAccess)return xt(rt.NO_SOURCE,{term:c,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 xt(rt.NO_SOURCE,{term:c,detail:"no source span in the graph (likely a module)"});try{let f=await us({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:hu});return vt({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return xt(rt.NO_SOURCE,{term:c,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(c,{depth:u="auto"}={}){let{match:d}=on(e,String(c??""));if(!d)return xt(rt.UNRESOLVED_TERM,{term:String(c??"")});let f=zo(e,d),p=String(u||"auto").trim().toLowerCase(),h,m;p==="min"?(h="TINY",m=oo("TINY")):p==="full"?(h="FULL",m=oo("FULL")):{tier:h,mask:m}=Ji(f,e,{});let b=Uh(f,m);if(!l.sourceAccess)return vt({text:b,tier:h});let g=await O_(f,m,{readFile:s,repoRoot:n});return vt({text:g?`${b}
69
+ ${g}`:b,tier:h})},architecture({package:c=""}={}){let u=String(c||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(g=>(g.class||"")==="Module"&&(!u||String(g.label||"").toLowerCase().startsWith(u))),f=new Map;for(let g of d){let y=g.label.includes("/")?g.label.slice(0,g.label.lastIndexOf("/")):"(root)";f.set(y,(f.get(y)||0)+1)}let p=new Set(d.map(g=>g.id)),h=new Map;for(let g of Se(e,"imports"))p.has(g.object)&&h.set(g.object,(h.get(g.object)||0)+1);let m=[...h.entries()].sort((g,y)=>y[1]-g[1]).map(([g,y])=>({id:g,label:i.get(g)?.label||g,importers:y})),b=[...f.entries()].sort((g,y)=>y[1]-g[1]);return vt({modules:d.length,packages:b,hubs:m})},untested(){let c=new Set(Se(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!c.has(d.id)&&!/\.test\./.test(d.label||"")).map(Ln);return vt({modules:u})},stats(){let c=new Map;for(let d of e.individuals){let f=d.class||"Entity";c.set(f,(c.get(f)||0)+1)}let u=[...c.entries()].map(([d,f])=>({class:d,count:f})).sort((d,f)=>f.count-d.count||d.class.localeCompare(f.class));return vt({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(c){if(!a(c))return xt(rt.UNRESOLVED_TERM,{term:c});let d=[...Se(e,"touches"),...Se(e,"touchesSymbol")].filter(h=>h.object===c),f=new Set,p=[];for(let h of d){if(f.has(h.subject))continue;f.add(h.subject);let m=i.get(h.subject);p.push({id:h.subject,label:h.subjectLabel||m?.label||h.subject,author:m?Yt(m,"author")??Yt(m,"commitAuthor"):null,date:m?Yt(m,"date")??Yt(m,"commitDate"):null,message:m?Yt(m,"message")??Yt(m,"commitMessage"):null})}return vt({commits:p})},search(c,{kind:u="",name:d="",decorator:f="",limit:p=qi,offset:h=0}={}){let m=String(c||""),b=String(u||"").trim().toLowerCase(),g=String(d||"").trim(),y=String(f||"").trim().toLowerCase(),w;if(b&&b!=="module"){let k=null;if(g){let x=Sl(g);if(x.error)return xt(rt.UNRESOLVED_TERM,{term:g,detail:x.error});k=x}let $=m.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{w=_l(e,$,{kind:b,decFilter:y,nameRe:k}).map(x=>x.ind)}catch(x){return xt(rt.UNRESOLVED_TERM,{term:g,detail:String(x?.message||x)})}}else{let k=new Map;for(let $ of e.individuals)($.class||"")==="Module"&&k.set($.label,$);w=wh(e,m).map(({path:$})=>k.get($)).filter(Boolean)}let v=w.slice(h,h+p).map(Ln);return vt({results:v})},ask(c){if(typeof r!="function")return xt(rt.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(c||""));return vt({content:u,tmct_ask:d})}};if(o)for(let c of fu){let u=l[c];typeof u=="function"&&(l[c]=(...d)=>{let f=performance.now(),p=u.apply(l,d);return p&&typeof p.then=="function"?p.then(h=>(hg(o,c,performance.now()-f,h),h)):(hg(o,c,performance.now()-f,p),p)})}return l}function hg(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:L_(s)})}catch{}}function L_(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 Yt,hu,C_,ba=O(()=>{Le();ha();fg();Yt=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;hu=200,C_=120});async function qr(e,t){let n=await t.fetchEntities(e),s=Hi(n);if(!s.individuals.length){let o=new Re(`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 wa=O(()=>{Vt();Le()});function Os({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function st(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Re(`${t} is required`);return n}function St(e,t,n){let{match:s,candidates:o}=on(e.graph,t);if(!s)throw new Re(`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 Kr,it,Ve=O(()=>{Vt();Le();Kr=200;it=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=St(s,st(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function mg(e,{config:t,source:n=No,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Re("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,l=!!e?.untuned,c=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await qr(t,n),f=he(he(t.graphFile)),p=ga(d,{sourceAccess:!0,repoRoot:f,readFile:_e,tel:o,ask:As}),{match:h}=St(p,r,"symbol"),m=zo(d,h),b,g,y=!1;a||i==="min"?(b="TINY",g=oo("TINY")):c||i==="full"?(b="FULL",g=oo("FULL"),y=!0):{tier:b,mask:g,topup:y}=Ji(m,d,{untuned:l}),s&&!c&&(g=Dh(g));let w=null;if(m.moduleLabel)try{({lines:w}=await us({readFile:_e,repoRoot:f,path:m.moduleLabel}))}catch{w=null}let v=x=>w&&w[x-1]!=null?w[x-1].trim():"",k=(x,E)=>Cs(w,x,E,Kr).text,$=[`Edit context for ${m.moduleLabel} [${b}${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(g.anchor&&m.anchor?.site&&w){let{start:x,end:E}=m.anchor.site;$.push(`
70
70
  ## anchor: ${m.anchor.label} (${m.anchor.class}) @ ${m.moduleLabel}:${x}-${E}`),$.push(k(x,E)),m.callHint&&$.push(m.callHint)}if(g.registration&&m.globals.length){$.push(`
71
71
  ## registration / module globals (replicate this pattern):`);for(let x of m.globals)$.push(` ${x.label} = ${x.value}${x.site?` [:${x.site.start}]`:""}`)}if(g.exemplar&&m.exemplar?.site&&w){let{start:x,end:E}=m.exemplar.site,S=m.exemplar.decorators?` @${m.exemplar.decorators}`:"";$.push(`
72
72
  ## closest example (full body) \u2014 copy this style: ${m.exemplar.label} (${m.exemplar.class})${S} @ ${m.moduleLabel}:${x}-${E}`),$.push(k(x,E)),m.callHint&&$.push(m.callHint)}if(g.inlinedCallees&&m.calleeBodies.length&&w){let x=120;for(let E of m.calleeBodies){if(x<=0)break;let S=E.site.start,_=E.site.path===m.moduleLabel&&w?w:await us({readFile:_e,repoRoot:f,path:E.site.path}).then(P=>P.lines).catch(()=>null);if(!_)continue;let I=Cs(_,S,E.site.end,x);$.push(`
@@ -82,29 +82,29 @@ ${g}`:b,tier:h})},architecture({package:c=""}={}){let u=String(c||"").trim().toL
82
82
  ## covering tests: ${m.tests.join(", ")}`),g.cochange&&m.cochange&&m.cochange.length&&$.push(`
83
83
  ## usually changed together (consider editing these too): ${m.cochange.map(x=>`${x.label} (\xD7${x.weight})`).join(", ")}`),$.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 ${m.moduleLabel}.`),b!=="FULL"&&$.push(`(bundle tier ${b}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:$.join(`
85
- `),tier:b,topup:y}}async function cu(e,{config:t,source:n,tel:s}){return(await rg(e,{config:t,source:n,tel:s})).text}var lu=O(()=>{Rt();Ue();Gt();da();Ar();Le();Is();ha();ma();Ve();cu.ownsGraphLoad=!0});function ig(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"symbol"),"symbol");return Ah(zo(t,s))}var ag=O(()=>{Le();Ve()});function ga(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 Kr(e){return ga(e).toString(16).padStart(8,"0")}function T_(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let w=0;w<16;w+=1)i[w]=o.getUint32(u+w*4);for(let w=16;w<64;w+=1){let v=a(i[w-15],7)^a(i[w-15],18)^i[w-15]>>>3,k=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+v+i[w-7]+k>>>0}let[d,f,p,h,m,b,g,y]=r;for(let w=0;w<64;w+=1){let v=a(m,6)^a(m,11)^a(m,25),k=m&b^~m&g,$=y+v+k+R_[w]+i[w]>>>0,x=a(d,2)^a(d,13)^a(d,22),E=d&f^d&p^f&p,S=x+E>>>0;y=g,g=b,b=m,m=h+$>>>0,h=p,p=f,f=d,d=$+S>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+p>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+m>>>0,r[5]=r[5]+b>>>0,r[6]=r[6]+g>>>0,r[7]=r[7]+y>>>0}let l=new Uint8Array(32),c=new DataView(l.buffer);for(let u=0;u<8;u+=1)c.setUint32(u*4,r[u]);return l}function A_(e,t){let n=T_(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function V(e){let t=ds(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 ps(e){let t=ds(e);return C_.get(t)??t}function ge(e,t,n){return Jo(V(e),ps(t),V(n))}var R_,I_,ds,C_,Jo,Yt=O(()=>{R_=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]);I_=2e3,ds=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,I_);C_=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:${A_(`${e}\0${t}\0${n}`,8)}`});var fn={};Wt(fn,{CARDINALITY_RULE_CONFIDENCE:()=>D_,CAX_DW_RULE:()=>du,CAX_DW_RULE_CONFIDENCE:()=>fu,CAX_MAXC0_RULE_CONFIDENCE:()=>U_,CLS_SVF1_RULE:()=>hu,CLS_SVF1_RULE_CONFIDENCE:()=>gu,DEFAULT_MAX_ENVIRONMENTS:()=>ba,DISJOINT_PREDICATE:()=>Qo,ENTAILED_DISJOINT_PROVENANCE:()=>pu,ENTAILED_PROVENANCE:()=>ug,ENTAILED_SCM_SVF_PROVENANCE:()=>yu,ENTAILED_SVF1_PROVENANCE:()=>mu,ENTAILED_TYPE_PROVENANCE:()=>pg,ON_PROPERTY_PREDICATE:()=>Nn,SCM_SVF_RULE:()=>wu,SCM_SVF_RULE_CONFIDENCE:()=>$u,SOME_VALUES_FROM_PREDICATE:()=>Pn,SUBCLASS_PREDICATE:()=>ze,TYPE_PREDICATE:()=>Mt,buildCardinalityRestrictions:()=>F_,buildRelevanceFrontier:()=>uu,buildSubClassSuccessors:()=>wa,deriveDisjointViolations:()=>gg,deriveSomeValuesFromApplication:()=>bg,deriveSomeValuesFromSubsumption:()=>wg,deriveSubClassClosure:()=>fg,deriveSubClassClosureDelta:()=>hg,deriveTypePropagation:()=>mg,entailedTrustFrom:()=>L_,findConsistencyViolations:()=>W_,findIsaChain:()=>vu,proveCardinalityAtLeast:()=>z_,proveMaxCardinalityZeroDenial:()=>B_,retractSubClassOf:()=>K_,syllogise:()=>G_});function cg(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 L_(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 fs(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function fg(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}${Ne}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:fs(s),a=(u,d,f)=>!i||i.has(u)||i.has(d)||i.has(f),l=[],c=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[p,h]of r)for(let m of h){let b=r.get(m);if(b)for(let g of b){if(p===g)continue;let y=`${p}${Ne}${g}`;o.has(y)||c.has(y)||a(p,m,g)&&d.push([p,m,g,y])}}if(!d.length)break;d.sort((p,h)=>p[0].localeCompare(h[0])||p[2].localeCompare(h[2])||p[1].localeCompare(h[1]));let f=!1;for(let[p,h,m,b]of d)if(!c.has(b)){if(l.length>=n)break;c.add(b),l.push({subject:p,object:m,via:h}),r.has(p)||r.set(p,new Set),r.get(p).add(m),f=!0}if(l.length>=n||!f)break}return l}function hg(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[h,m]of e||[])!h||!m||h===m||(r.add(`${h}${Ne}${m}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),a.has(m)||a.set(m,new Set),a.get(m).add(h));let l=[],c=new Set;for(let[h,m]of t||[]){if(!h||!m||h===m)continue;let b=`${h}${Ne}${m}`;c.has(b)||(c.add(b),l.push([h,m]))}let u=o instanceof Set?o.size?o:null:fs(o),d=(h,m,b)=>!u||u.has(h)||u.has(m)||u.has(b),f=[],p=new Set;for(let h=0;h<n&&l.length;h+=1){let m=[],b=(w,v,k)=>{if(w===k)return;let $=`${w}${Ne}${k}`;r.has($)||p.has($)||d(w,v,k)&&m.push([w,v,k,$])};for(let[w,v]of l){for(let k of i.get(v)||[])b(w,v,k);for(let k of a.get(w)||[])b(k,w,v)}if(!m.length)break;m.sort((w,v)=>w[0].localeCompare(v[0])||w[2].localeCompare(v[2])||w[1].localeCompare(v[1]));let g=!1,y=[];for(let[w,v,k,$]of m)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:w,object:k,via:v}),i.has(w)||i.set(w,new Set),i.get(w).add(k),a.has(k)||a.set(k,new Set),a.get(k).add(w),y.push([w,k]),g=!0}if(f.length>=s||!g)break;l=y}return f}function Mn(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 N_(e){return Mn((e||[]).map(([t,n])=>[n,t]))}function uu(e,t){let n=[],s=[],o=new Map,r=new Map;for(let c of e||[])!c||!c.subject||!c.predicate||!c.object||(Ls(c.predicate)?n.push([c.subject,c.object]):uo(c.predicate)?s.push([c.subject,c.object]):Zo(c.predicate)?o.set(c.subject,c.object):Xr(c.predicate)&&r.set(c.subject,c.object));let i=N_(n),a=new Set;for(let c of t||[]){let u=V(c);if(u){a.add(u);for(let d of i(u))a.add(d)}}let l=new Set(a);for(let[c,u]of s)a.has(u)&&l.add(c);for(let[c,u]of r)o.has(c)&&a.has(u)&&l.add(c);return l}function mg(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Mn(t),i=new Set,a=new Set;for(let[p,h]of o||[])p&&h&&i.add(`${p}${Ne}${h}`);let l=s instanceof Set?s.size?s:null:fs(s),c=(p,h,m)=>!l||l.has(p)||l.has(h)||l.has(m),u=[];for(let[p,h]of e||[]){if(!p||!h)continue;let m=`${p}${Ne}${h}`;if(!a.has(m)){a.add(m);for(let b of r(h)){if(b===h||b===p)continue;let g=`${p}${Ne}${b}`;i.has(g)||c(p,h,b)&&u.push([p,h,b,g])}}}u.sort((p,h)=>p[0].localeCompare(h[0])||p[2].localeCompare(h[2])||p[1].localeCompare(h[1]));let d=[],f=new Set;for(let[p,h,m,b]of u)if(!f.has(b)){if(d.length>=n)break;f.add(b),d.push({subject:p,object:m,via:h})}return d}function gg(e,t,n,{budget:s=50,focus:o=null}={}){let r=Mn(t),i=new Map,a=new Set;for(let[h,m]of n||[])!h||!m||h===m||(a.add(`${h}${Ne}${m}`),a.add(`${m}${Ne}${h}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(h));if(!i.size)return[];let l=new Set,c=o instanceof Set?o.size?o:null:fs(o),u=(h,m,b)=>!c||c.has(h)||c.has(m)||c.has(b),d=[];for(let[h,m]of e||[]){if(!h||!m)continue;let b=`${h}${Ne}${m}`;if(!l.has(b)){l.add(b);for(let g of[m,...r(m)]){let y=i.get(g);if(y)for(let w of y){if(w===h)continue;let v=`${h}${Ne}${w}`;a.has(v)||u(h,m,w)&&d.push([h,m,g,w,v])}}}}d.sort((h,m)=>h[0].localeCompare(m[0])||h[3].localeCompare(m[3])||h[2].localeCompare(m[2])||h[1].localeCompare(m[1]));let f=[],p=new Set;for(let[h,m,b,g,y]of d)if(!p.has(y)){if(f.length>=s)break;p.add(y),f.push({subject:h,object:g,viaType:m,viaClass:b})}return f}function bg(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Mn(n),a=new Map;for(let b of s||[]){if(!b||!b.restriction||!b.property||!b.target)continue;let g=`${b.property}${Ne}${b.target}`;a.has(g)||a.set(g,new Set),a.get(g).add(b.restriction)}if(!a.size)return[];let l=new Set,c=new Map;for(let[b,g]of t||[])!b||!g||(l.add(`${b}${Ne}${g}`),c.has(b)||c.set(b,new Set),c.get(b).add(g));let u=r instanceof Set?r.size?r:null:fs(r),d=(b,g,y)=>!u||u.has(b)||u.has(g)||u.has(y),f=new Set,p=[];for(let[b,g,y]of e||[]){if(!b||!g||!y)continue;let w=V(g),v=`${b}${Ne}${w}${Ne}${y}`;if(f.has(v))continue;f.add(v);let k=c.get(y);if(k)for(let $ of k)for(let x of[$,...i($)]){let E=a.get(`${w}${Ne}${x}`);if(E)for(let S of E){if(b===S)continue;let R=`${b}${Ne}${S}`;l.has(R)||d(b,y,S)&&p.push([b,g,w,y,$,x,S,R])}}}p.sort((b,g)=>b[0].localeCompare(g[0])||b[6].localeCompare(g[6])||b[1].localeCompare(g[1])||b[3].localeCompare(g[3]));let h=[],m=new Set;for(let[b,g,y,w,v,k,$,x]of p)if(!m.has(x)){if(h.length>=o)break;m.add(x),h.push({subject:b,object:$,viaProperty:g,viaPropertyKey:y,viaValue:w,viaType:v,viaTarget:k})}return h}function F_(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Zo(r.predicate))t.set(r.subject,r.object);else if(O_(r.predicate))s.set(r.subject,r.object);else{let i=M_[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)!==P_)continue;let l=s.get(r);l&&o.push({restriction:r,kind:i,n:a,onClass:l})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function wg(e,t,{budget:n=50,focus:s=null}={}){let o=Mn(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=V(f.property);r.has(p)||r.set(p,[]),r.get(p).push({restriction:f.restriction,target:f.target})}let i=new Set;for(let[f,p]of t||[])f&&p&&i.add(`${f}${Ne}${p}`);let a=s instanceof Set?s.size?s:null:fs(s),l=(f,p)=>!a||a.has(f)||a.has(p),c=[];for(let[,f]of r)if(!(f.length<2))for(let p of f)for(let h of f){if(p.restriction===h.restriction||p.target===h.target||!o(p.target).has(h.target))continue;let m=`${p.restriction}${Ne}${h.restriction}`;i.has(m)||l(p.restriction,h.restriction)&&c.push([p.restriction,h.restriction,p.target,h.target,m])}c.sort((f,p)=>f[0].localeCompare(p[0])||f[1].localeCompare(p[1]));let u=[],d=new Set;for(let[f,p,h,m,b]of c)if(!d.has(b)){if(u.length>=n)break;d.add(b),u.push({subject:f,object:p,viaY1:h,viaY2:m})}return u}function yg(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Mn(e),a=r instanceof Set?r.size?r:null:fs(r),l=f=>!a||a.has(n)||a.has(f),c=new Map;for(let[f,p]of e||[])!f||!p||(c.has(f)||c.set(f,new Set),c.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,!!l(f))for(let p of c.get(f)||[]){let h=u.get(p);if(h&&s(h))return{viaClass:f,viaRestriction:p,record:h}}}return null}function z_(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=yg(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 B_(e,t,n,s,o={}){if(!s)return null;let r=yg(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 W_(e,t,n,{budget:s=50,focus:o=null}={}){let r=Mn(t),i=new Map;for(let[p,h]of n||[])!p||!h||p===h||(i.has(p)||i.set(p,new Set),i.get(p).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(p));if(!i.size)return[];let a=new Map;for(let[p,h]of e||[])!p||!h||(a.has(p)||a.set(p,new Set),a.get(p).add(h));let l=o instanceof Set?o.size?o:null:fs(o),c=p=>!l||l.has(p),u=[],d=new Set;for(let[p,h]of a){if(!c(p))continue;let m=[...h].sort();for(let b=0;b<m.length;b+=1)for(let g=b+1;g<m.length;g+=1){let[y,w]=[m[b],m[g]],v=[y,...r(y)],k=[w,...r(w)],$=null;for(let E of v){let S=i.get(E);if(S){for(let R of k)if(S.has(R)){$=[E,R];break}if($)break}}if(!$)continue;let x=`${p}${Ne}${y}${Ne}${w}`;d.has(x)||(d.add(x),u.push([p,y,w,$[0],$[1]]))}}u.sort((p,h)=>p[0].localeCompare(h[0])||p[1].localeCompare(h[1])||p[2].localeCompare(h[2]));let f=[];for(let[p,h,m,b,g]of u){if(f.length>=s)break;f.push({subject:p,classA:h,classB:m,viaA:b,viaB:g})}return f}async function G_(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=ba,full:i=!1,store:a}={}){let{loadMemory:l,readFactRows:c,appendFacts:u}=cg(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await l(e),p=c(f),h=p.filter(j=>Ls(j.predicate)).map(j=>[j.subject,j.object]),m=p.filter(j=>uo(j.predicate)).map(j=>[j.subject,j.object]),b=p.filter(j=>lo(j.predicate)).map(j=>[j.subject,j.object]),g=new Map,y=new Map,w=[];for(let j of p){let pe=String(j.predicate||"").trim().toLowerCase();Zo(j.predicate)?g.set(j.subject,j.object):Xr(j.predicate)?y.set(j.subject,j.object):bu.has(pe)||w.push([j.subject,j.predicate,j.object])}let v=[];for(let[j,pe]of g){let Ae=y.get(j);Ae&&v.push({restriction:j,property:pe,target:Ae})}let k=fs(s),$=o&&k?uu(p,[...k]):k,x=$===null&&d?await a.loadSyllogiseState(e):null,E=new Set(p.map(j=>j.id)),S=Array.isArray(x?.factIds)?x.factIds.filter(j=>!E.has(j)):[],R=x&&Array.isArray(x.factIds)&&!S.length&&!i?"delta":"full",_=R==="delta"?new Set(x.factIds):null,I=R==="delta"?p.filter(j=>!_.has(j.id)):p,P=I.length,T=new Map;for(let j of p)T.set(`${j.subject}${Ne}${j.predicate}${Ne}${j.object}`,j.trust);let F=(j,pe,Ae)=>T.get(`${j}${Ne}${pe}${Ne}${Ae}`),U=(j,pe,Ae)=>T.has(`${j}${Ne}${pe}${Ne}${Ae}`),K=j=>j.filter(pe=>typeof pe=="number"),ce=R==="delta"&&!I.length,ie=R==="delta"?I.filter(j=>Ls(j.predicate)).map(j=>[j.subject,j.object]):[],D=R==="delta"?ie.length?hg(h,ie,{depth:t,budget:n,focus:$}):[]:fg(h,{depth:t,budget:n,focus:$}),B=h.concat(D.map(j=>[j.subject,j.object])),W=$,A=null;if(R==="delta"&&!ce){let j=p.concat(D.map(Ae=>({subject:Ae.subject,predicate:ze,object:Ae.object}))),pe=[];for(let Ae of I)pe.push(Ae.subject,Ae.object);A=uu(j,pe),W=A}let L=j=>!A||A.has(j),C=A?m.filter(([j,pe])=>L(j)||L(pe)):m,N=new Set;if(A)for(let j of I)lo(j.predicate)&&(N.add(j.subject),N.add(j.object));let M=A&&N.size?Mn(B):null,z=A?m.filter(([j,pe])=>L(j)||L(pe)||M&&[...M(pe)].some(Ae=>N.has(Ae))):m,q=new Set;if(A){for(let j of I)if(Zo(j.predicate)||Xr(j.predicate)){let pe=g.get(j.subject);pe&&q.add(V(pe))}}let Q=A?w.filter(([j,pe,Ae])=>L(j)||L(Ae)||q.has(V(pe))):w,ae=Math.max(0,n-D.length),te=ae>0&&!ce?mg(C,B,{budget:ae,focus:W,presentTypeEdges:m}):[],ee=Math.max(0,n-D.length-te.length),Y=ee>0&&!ce?gg(z,B,b,{budget:ee,focus:W}):[],J=Math.max(0,n-D.length-te.length-Y.length),ne=J>0&&v.length&&!ce?bg(Q,m,B,v,{budget:J,focus:W}):[],xe=Math.max(0,n-D.length-te.length-Y.length-ne.length),Te=xe>0&&v.length>1&&!ce?wg(v,B,{budget:xe,focus:W}):[],ue=new Map(v.map(j=>[j.restriction,j])),Ie=[...D.map(j=>({subject:j.subject,predicate:ze,object:j.object,provenance:ug,justification:[[ge(j.subject,ze,j.via),ge(j.via,ze,j.object)]]})),...te.map(j=>({subject:j.subject,predicate:Mt,object:j.object,provenance:pg,justification:[[ge(j.subject,Mt,j.via),ge(j.via,ze,j.object)]]})),...Y.map(j=>{let pe=U(j.viaClass,Qo,j.object),[Ae,un]=pe?[j.viaClass,j.object]:[j.object,j.viaClass],Yn=K([F(j.subject,Mt,j.viaType),F(Ae,Qo,un),...j.viaClass!==j.viaType?[F(j.viaType,ze,j.viaClass)]:[]]);return{subject:j.subject,predicate:Qo,object:j.object,provenance:pu,justification:[[ge(j.subject,Mt,j.viaType),ge(Ae,Qo,un),...j.viaClass!==j.viaType?[ge(j.viaType,ze,j.viaClass)]:[]]],...Yn.length?{premiseTrusts:Yn,ruleConfidence:fu}:{}}}),...ne.map(j=>{let pe=K([F(j.subject,j.viaProperty,j.viaValue),F(j.viaValue,Mt,j.viaType),F(j.object,Nn,j.viaPropertyKey),F(j.object,Pn,j.viaTarget),...j.viaType!==j.viaTarget?[F(j.viaType,ze,j.viaTarget)]:[]]);return{subject:j.subject,predicate:Mt,object:j.object,provenance:mu,justification:[[ge(j.subject,j.viaProperty,j.viaValue),ge(j.viaValue,Mt,j.viaType),ge(j.object,Nn,j.viaPropertyKey),ge(j.object,Pn,j.viaTarget),...j.viaType!==j.viaTarget?[ge(j.viaType,ze,j.viaTarget)]:[]]],...pe.length?{premiseTrusts:pe,ruleConfidence:gu}:{}}}),...Te.map(j=>{let pe=ue.get(j.subject),Ae=ue.get(j.object),un=K([pe&&F(j.subject,Nn,pe.property),F(j.subject,Pn,j.viaY1),Ae&&F(j.object,Nn,Ae.property),F(j.object,Pn,j.viaY2),F(j.viaY1,ze,j.viaY2)]);return{subject:j.subject,predicate:ze,object:j.object,provenance:yu,justification:[[...pe?[ge(j.subject,Nn,pe.property)]:[],ge(j.subject,Pn,j.viaY1),...Ae?[ge(j.object,Nn,Ae.property)]:[],ge(j.object,Pn,j.viaY2),ge(j.viaY1,ze,j.viaY2)]],...un.length?{premiseTrusts:un,ruleConfidence:$u}:{}}})],Ce=Ie.map(j=>({id:ge(j.subject,j.predicate,j.object),subject:j.subject,predicate:j.predicate,object:j.object,environments:j.justification,write:j})),oe=vg(p.concat(Ce.map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object})))),ke=new Map(p.map(j=>[j.id,j])),le=j=>Ls(j)||uo(j)||lo(j),H=j=>R!=="delta"||A!==null&&(A.has(j.subject)||A.has(j.object)),se=p.filter(j=>le(j.predicate)&&$g(j.provenance)&&Yr(j).length<r&&H(j)).map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object,environments:Yr(j),provenance:j.provenance})),He=[...Ce,...se].sort((j,pe)=>j.subject.localeCompare(pe.subject)||j.predicate.localeCompare(pe.predicate)||j.object.localeCompare(pe.object)),De=0,tt=!1,cn=0;for(let j of He){if(cn>=n){tt=!0;break}cn+=1;let pe=oe(j,{maxEnvironments:r+1}),{kept:Ae,truncated:un}=H_(j.environments,pe,r);if(un&&(tt=!0),!(Ae.length<=j.environments.length)){if(De+=Ae.length-j.environments.length,j.write){j.write.justification=Ae;continue}Ie.push({subject:j.subject,predicate:j.predicate,object:j.object,justification:Ae,...xg(j.provenance,Ae,Yn=>ke.get(Yn)?.trust)||{}})}}let{ids:Qt}=await u(e,Ie),Zt=[],ln=0;for(let j of D)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.via,rule:lg}),ln+=1;for(let j of te)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.via,rule:dg}),ln+=1;for(let j of Y)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaClass,rule:du}),ln+=1;for(let j of ne)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaValue,rule:hu}),ln+=1;for(let j of Te)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaY1,rule:wu}),ln+=1;let Ti=Zt.length>=n;if($===null&&d&&!Ti){let j=new Set(E);for(let pe of Qt)j.add(pe);await a.saveSyllogiseState(e,{version:1,factIds:[...j].sort(),completedAt:new Date().toISOString()})}return{derived:Zt,count:Zt.length,budget:n,depth:t,truncated:Ti,mode:R,deltaSize:P,environmentsAdded:De,alternatesTruncated:tt}}function $g(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function V_(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();Ls(u.predicate)?t.push([u.subject,u.object]):uo(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):lo(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)):Zo(u.predicate)?o.set(u.subject,u.object):Xr(u.predicate)?r.set(u.subject,u.object):bu.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([V(u.predicate),u.object]))}let a=Mn(t),l=(u,d)=>u!==d&&a(u).has(d),c=u=>{let d=o.get(u),f=r.get(u);return d&&f?{property:V(d),target:f}:null};return u=>{if(Ls(u.predicate)){if(l(u.subject,u.object))return!0;let d=c(u.subject),f=c(u.object);return!!(d&&f&&d.property===f.property&&l(d.target,f.target))}if(uo(u.predicate)){for(let f of n.get(u.subject)||[])if(l(f,u.object))return!0;let d=c(u.object);if(d){for(let[f,p]of i.get(u.subject)||[])if(f===d.property){for(let h of n.get(p)||[])if(h===d.target||l(h,d.target))return!0}}return!1}if(lo(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 vg(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,l=new Map,c=new Map;for(let p of e){if(!p||!p.subject||!p.predicate||!p.object)continue;p.id&&t.add(p.id);let h=String(p.predicate||"").trim().toLowerCase();Ls(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)):uo(p.predicate)?(o.has(p.subject)||o.set(p.subject,new Set),o.get(p.subject).add(p.object)):lo(p.predicate)?(r.add(`${p.subject}${Ne}${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)):Zo(p.predicate)?a.set(p.subject,p.object):Xr(p.predicate)?l.set(p.subject,p.object):bu.has(h)||(c.has(p.subject)||c.set(p.subject,[]),c.get(p.subject).push([p.predicate,p.object]))}let u=Mn(n),d=p=>s.get(p)||new Set,f=p=>{let h=a.get(p),m=l.get(p);return h&&m?{property:h,propertyKey:V(h),target:m}:null};return(p,{maxEnvironments:h=ba}={})=>{let m=[],b=new Set,g=y=>{if(m.length>=h||p.id&&y.includes(p.id)||!y.every(v=>t.has(v)))return;let w=[...y].sort().join(" ");b.has(w)||(b.add(w),m.push(y))};if(Ls(p.predicate)){for(let y of[...d(p.subject)].sort()){if(m.length>=h)break;y===p.subject||y===p.object||d(y).has(p.object)&&g([ge(p.subject,ze,y),ge(y,ze,p.object)])}if(m.length<h){let y=f(p.subject),w=f(p.object);y&&w&&y.propertyKey===w.propertyKey&&y.target!==w.target&&d(y.target).has(w.target)&&g([ge(p.subject,Nn,y.property),ge(p.subject,Pn,y.target),ge(p.object,Nn,w.property),ge(p.object,Pn,w.target),ge(y.target,ze,w.target)])}return m}if(uo(p.predicate)){for(let w of[...o.get(p.subject)||[]].sort()){if(m.length>=h)break;w!==p.object&&d(w).has(p.object)&&g([ge(p.subject,Mt,w),ge(w,ze,p.object)])}let y=f(p.object);if(y){let w=[...c.get(p.subject)||[]].filter(([v])=>V(v)===y.propertyKey).sort((v,k)=>v[0].localeCompare(k[0])||v[1].localeCompare(k[1]));for(let[v,k]of w){if(m.length>=h)break;for(let $ of[...o.get(k)||[]].sort()){if(m.length>=h)break;$!==y.target&&!d($).has(y.target)||g([ge(p.subject,v,k),ge(k,Mt,$),ge(p.object,Nn,y.propertyKey),ge(p.object,Pn,y.target),...$!==y.target?[ge($,ze,y.target)]:[]])}}}return m}if(lo(p.predicate)){let y=[];for(let w of o.get(p.subject)||[])for(let v of[w,...u(w)])(i.get(v)||new Set).has(p.object)&&y.push([w,v]);y.sort((w,v)=>w[0].localeCompare(v[0])||w[1].localeCompare(v[1]));for(let[w,v]of y){if(m.length>=h)break;let k=r.has(`${v}${Ne}${p.object}`),[$,x]=k?[v,p.object]:[p.object,v];g([ge(p.subject,Mt,w),ge($,Qo,x),...v!==w?[ge(w,ze,v)]:[]])}return m}return m}}function H_(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 xg(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=q_.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(c=>n(c)).filter(c=>typeof c=="number");if(a.length!==i.length)continue;let l=Math.min(...a);l>r&&(r=l,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function K_(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=ba,store:i,sourceTags:a=[],predicate:l=ze}={}){let{loadMemory:c,readFactRows:u,removeFacts:d}=cg(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),f=typeof i?.appendFacts=="function"?i.appendFacts:null,p=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,h=(a||[]).filter(Boolean);if(h.length&&!p)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let m=V(t),b=V(n),g=ge(m,l,b),y=await c(e),w=u(y),v=new Map(w.map(U=>[U.id,U]));if(!v.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let k=v.get(g).sourceIds||[],$=h.map(U=>p(g,U).slice(g.length+1)),x=h.length?k.filter(U=>$.includes(U)):[],E=!h.length||x.length>0;if(h.length&&!E)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=h.length>0&&x.length<k.length,R=new Set([g]),_=[g],I=new Map,P=!1;if(!S){let U=w.filter(D=>Yr(D).length&&$g(D.provenance)),K=new Map;for(let D of U)for(let B of Yr(D))for(let W of B)K.has(W)||K.set(W,new Set),K.get(W).add(D.id);let ce=0,ie=[g];for(;ce<o;ce+=1){let D=new Set;for(let z of ie)for(let q of K.get(z)||[])R.has(q)||D.add(q);let B=[...D].map(z=>v.get(z)).sort((z,q)=>z.subject.localeCompare(q.subject)||z.predicate.localeCompare(q.predicate)||z.object.localeCompare(q.object));if(!B.length)break;let W=w.filter(z=>!R.has(z.id)&&!D.has(z.id)),A=new Set(W.map(z=>z.id)),L=vg(W),C=V_(W),N=!1,M=!1;ie=[];for(let z of B){if(R.size>=s){M=!0;break}let q=Yr(z),Q=q.filter(te=>te.every(ee=>A.has(ee)));if(Q.length){Q.length!==q.length&&I.set(z.id,Q);continue}let ae=L(z,{maxEnvironments:r});if(ae.length){I.set(z.id,ae);continue}C(z)||(R.add(z.id),_.push(z.id),ie.push(z.id),N=!0)}if(M){P=!0;break}if(!N)break}!P&&ce>=o&&(P=U.some(D=>!R.has(D.id)&&D.justification.some(B=>R.has(B))))}let T=h.length?[...x.map(U=>`${g}@${U}`),..._.slice(1)]:_,{removed:F}=await d(e,T);if(f){let U=[...I.entries()].filter(([K])=>!R.has(K)).sort((K,ce)=>K[0].localeCompare(ce[0])).map(([K,ce])=>{let ie=v.get(K);return{subject:ie.subject,predicate:ie.predicate,object:ie.object,justification:ce,...xg(ie.provenance,ce,D=>v.get(D)?.trust)||{}}});U.length&&await f(e,U)}return{retracted:F,count:F.length,budget:s,depth:o,truncated:P,found:!0,...h.length?{ownRecord:!0,stillStands:S}:{}}}function wa(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 vu(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:wa(s),a=[];for(let[c,u]of n||[])c===e&&u&&a.push({node:u,path:[{subject:c,predicate:Mt,object:u}]});for(let c of i.get(e)||[])a.push({node:c,path:[{subject:e,predicate:ze,object:c}]});let l=new Set([e]);for(let c=1;c<=o&&a.length;c+=1){for(let{node:d,path:f}of a)if(r.has(d))return f;if(c===o)break;let u=[];for(let{node:d,path:f}of a)if(!l.has(d)){l.add(d);for(let p of i.get(d)||[])l.has(p)||u.push({node:p,path:[...f,{subject:d,predicate:ze,object:p}]})}a=u}return null}var ze,lg,ug,Mt,dg,pg,Qo,du,pu,fu,Nn,Pn,hu,mu,gu,ba,Ne,Ls,uo,lo,Zo,Xr,O_,bu,P_,M_,wu,yu,$u,D_,U_,Yr,q_,Xt=O(()=>{Yt();ze="rdfs:subClassOf",lg="subClassOf",ug=`entailed:${lg}`,Mt="rdf:type",dg="type",pg=`entailed:${dg}`,Qo="owl:disjointWith",du="disjointWith",pu=`entailed:${du}`,fu=.95,Nn="owl:onProperty",Pn="owl:someValuesFrom",hu="someValuesFrom",mu=`entailed:${hu}`,gu=.95,ba=4,Ne="\u241F",Ls=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",uo=e=>String(e||"").trim().toLowerCase()==="rdf:type",lo=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Zo=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",Xr=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",O_=e=>String(e||"").trim().toLowerCase()==="owl:onclass",bu=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);P_="has",M_={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};wu="someValuesFromSubsumption",yu=`entailed:${wu}`,$u=.95;D_=.95;U_=.95;Yr=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);q_=new Map([[pu,fu],[mu,gu],[yu,$u]])});function sr(e){let t=String(e||""),n=Eg.get(t);return n||(t.startsWith(xu)?er+t.slice(xu.length):t)}function Sg(e){let t=String(e||""),n=Y_.get(t);return n||(t.startsWith(er)?xu+t.slice(er.length):null)}function _g(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=vu(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function va(e,t,n,{maxHops:s=3}={}){let o=nr(e),r=nr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:l}=jg(i),c=i.filter(g=>(g.predicate===$a||g.predicate===tr)&&r.has(g.object)),u=[];for(let g of c){let y=g.predicate===tr?"negative":"positive";if(o.has(g.subject)){u.push({fact:g,polarity:y,hops:0,chain:null});continue}let w=_g(o,g.subject,a,l,s);w&&w.length&&u.push({fact:g,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Su(o,r,i,{maxHops:s})};u.sort((g,y)=>g.hops-y.hops||(y.fact.trust||0)-(g.fact.trust||0));let d=u[0].hops,f=u.filter(g=>g.hops===d),p=f.filter(g=>g.polarity==="positive").map(g=>g.fact),h=f.filter(g=>g.polarity==="negative").map(g=>g.fact),m=h.length&&!p.length?"negative":"positive",b=u.find(g=>g.hops>d&&g.polarity!==m)||null;return{verdict:p.length&&h.length?"both":h.length?"no":"yes",hops:d,positive:p,negative:h,chain:u[0].chain,overrides:b?{fact:b.fact,chain:b.chain}:null,baseRate:null}}function Su(e,t,n,{maxHops:s=3}={}){let o=nr(e),r=nr(t),i=Array.isArray(n)?n:[],a=i.filter(m=>m.predicate===ze||m.predicate===Mt),l=a.filter(m=>o.has(m.subject)).map(m=>m.object);if(!l.length)return null;let c=l[0],u=[...new Set(a.filter(m=>m.object===c&&!o.has(m.subject)).map(m=>m.subject))],d=m=>{let b=i.find(g=>g.subject===m&&r.has(g.object)&&(g.predicate===$a||g.predicate===tr));return b?{name:m,polarity:b.predicate===tr?"negative":"positive",fact:b}:{name:m,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:h}=jg(i);return{klass:c,kinds:u.length,positive:f.filter(m=>m.polarity==="positive"),negative:f.filter(m=>m.polarity==="negative"),unknown:f.filter(m=>m.polarity==="unknown"),chain:_g(o,c,p,h,s)}}function ku(e,t,{exclude:n=[],maxHops:s=3}={}){let o=nr(e),r=nr(n),i=Array.isArray(t)?t:[],a=new Set,l=[];for(let c of i)c.predicate!==$a||!o.has(c.object)||r.has(c.subject)||a.has(c.subject)||(a.add(c.subject),va(new Set([c.subject]),o,i,{maxHops:s}).verdict==="yes"&&l.push(c));return l.sort(X_)}var er,xu,ya,Eg,Y_,kg,$a,tr,Eu,X_,nr,jg,xa=O(()=>{Xt();er="mgxneg:",xu="mgx:",ya="mgxneg:subClassOf",Eg=new Map([[ze,ya]]),Y_=new Map([...Eg].map(([e,t])=>[t,e]));kg=e=>String(e||"").startsWith(er),$a="mgx:capableOf",tr=sr($a),Eu=6,X_=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),nr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),jg=e=>{let t=e.filter(s=>s.predicate===Mt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===ze).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:wa(n)}}});function Ea(e){let t=String(e||"");return Ru.has(t)?ju:Q_.has(t)||Z_.test(t)?Jr:eR.has(t)?Rg:_u}function tR(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(If.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function nR(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(tR(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Tu(e,t){let n=t===Rg;if(!n&&t!==Jr)return null;let s=(e||[]).map(r=>({row:r,at:nR(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[l,c]=[String(r.row.object),String(i.row.object)];return l<c?-1:l>c?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var ju,Jr,Rg,_u,J_,Ru,Q_,Z_,eR,Tg=O(()=>{xa();es();ju="merge",Jr="latest-observation-wins",Rg="first-claim-wins",_u="contradiction",J_=["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"],Ru=new Set(J_.flatMap(e=>[e,sr(e)])),Q_=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"]),Z_=/^mgx:has-exit-([a-z]+)$/,eR=new Set(["mgx:playedBy"])});function ei(e){let t=String(e||""),n=t.indexOf(Sa);return n<0?"":t.slice(n+Sa.length)}function aR(e){let t=1,n=0;for(let s of e)t*=1-rR(s),n+=1;return n?iR(Math.min(1,1-t)):0}function Lg(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 Mg(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 Fg(e,t="",n=""){let s=t,o=n;for(let r of e)s=Ng(s,r.assertedAt),o=Pg(o,r.assertedAt);return{earliest:s,latest:o}}function Ou({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let l=[...new Set(o)].filter(Boolean).sort(),c=a?aR(l.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:sR,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===or?"rollupSourceIds":"rollupRecordIds",value:l.join(" ")},{prop:Zr,key:"rollupCount",value:String(l.length)},{prop:Fn,key:"rollupEarliest",value:r},{prop:Dn,key:"rollupLatest",value:i},...c===void 0?[]:[{prop:rr,key:"rollupPrior",value:String(c)}]]}}function Dg({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(Mg).slice(8);if(!i.length)return null;let{earliest:a,latest:l}=Fg(i,kt(s,Fn),kt(s,Dn));return{rollup:Ou({id:Au(e,t),sourceKey:`rollup:${t}`,template:Lu(i[0].record||s),idsProp:or,ids:[..._a(s),...i.map(u=>u.sourceId)],earliest:a,latest:l,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function zg({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(Mg),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:l}=Fg(i,kt(s,Fn),kt(s,Dn));return{rollup:Ou({id:Iu(e,t),sourceKey:t,template:Lu(i[0].record||s),idsProp:Qr,ids:[...oR(s),...i.map(u=>u.id)],earliest:a,latest:l}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Nu(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Ns(s),r=o?or:Qr,i=a=>Cu(kt(a,r));return Ou({id:s,sourceKey:kt(e,"mgx:sourceId")||kt(t,"mgx:sourceId"),template:Lu(kt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Ng(kt(e,Fn),kt(t,Fn)),latest:Pg(kt(e,Dn),kt(t,Dn)),priorFor:o?n:void 0})}function Ug(e,t){if(!t)return!1;for(let n of e||[])if(_a(n).includes(t))return!0;return!1}var sR,Ag,Ig,ka,Cg,or,Qr,Zr,Fn,Dn,rr,Sa,Og,Au,Iu,Ns,ir,ja,kt,Cu,_a,oR,rR,iR,Ng,Pg,Lu,Pu=O(()=>{sR="Fact",Ag=64,Ig=8,ka=8,Cg=2,or="mgx:rollupSourceIds",Qr="mgx:rollupRecordIds",Zr="mgx:rollupCount",Fn="mgx:rollupEarliest",Dn="mgx:rollupLatest",rr="mgx:rollupPrior",Sa="@rollup:",Og="#rollup",Au=(e,t)=>`${e}${Sa}${t}`,Iu=(e,t)=>`${e}@${t}${Og}`,Ns=e=>String(e||"").includes(Sa),ir=e=>String(e||"").endsWith(Og),ja=e=>Ns(e)||ir(e);kt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Cu=e=>String(e||"").split(" ").filter(Boolean),_a=e=>Cu(kt(e,or)),oR=e=>Cu(kt(e,Qr)),rR=e=>Math.max(0,Math.min(1,Number(e)||0)),iR=e=>Number(e.toFixed(6));Ng=(e,t)=>Lg(e,t,Math.min),Pg=(e,t)=>Lg(e,t,Math.max);Lu=e=>({label:e?.label||"",subject:kt(e,"rdf:subject"),predicate:kt(e,"rdf:predicate"),object:kt(e,"rdf:object")})});function zu(e){let t=String(e||"");return Du(t)?t.slice(0,-Ia.length):""}function Bg(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 Uu({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:rn,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:Ta,key:"retractedRecordIds",value:i.join(" ")},{prop:Mu,key:"retractedCount",value:String(i.length)},{prop:Aa,key:"retractedAt",value:o||""},...a.length?[{prop:ti,key:"provenance",value:a.join(" | ")}]:[]]}}function Gg({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...po(o),...n].filter(Boolean);return a.length?Uu({id:Fu(e,t),sourceId:t,template:r||Wg(o),ids:a,retractedAt:Bg(fo(o),s),tags:[...ni(hn(o,ti)),...ni(i)]}):null}function Vg(e,t){let n=Wg(hn(e,"rdf:subject")?e:t);return Uu({id:e?.id||t?.id,sourceId:hn(e,"mgx:sourceId")||hn(t,"mgx:sourceId"),template:n,ids:[...po(e),...po(t)],retractedAt:Bg(fo(e),fo(t)),tags:[...ni(hn(e,ti)),...ni(hn(t,ti))]})}function lR(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function uR(e,t,n=""){return!e||!t||!po(e).includes(t)?!1:lR(n,fo(e))}function Ca(e,t,n=""){for(let s of e||[])if(uR(s,t,n))return!0;return!1}function dR(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function pR(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 Oa(e){let t=zu(e?.id);return t?{id:e.id,subject:t,predicate:Ra,object:dR(fo(e),po(e)),provenance:hn(e,ti)}:null}function La(e){if(!e||e.predicate!==Ra)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=pR(e.object);return o.length?Uu({id:`${t}${Ia}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ni(e.provenance)}):null}var rn,Ra,Ta,Aa,Mu,Ia,ti,Fu,Du,hn,cR,ni,po,fo,Wg,Bu=O(()=>{rn="Retraction",Ra="mgx:retracted",Ta="mgx:retractedRecordIds",Aa="mgx:retractedAt",Mu="mgx:retractedCount",Ia="#retracted",ti="mgx:factProvenance",Fu=(e,t)=>`${e}@${t}${Ia}`,Du=e=>String(e||"").endsWith(Ia);hn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",cR=e=>String(e||"").split(" ").filter(Boolean),ni=e=>String(e||"").split(" | ").filter(Boolean),po=e=>cR(hn(e,Ta)),fo=e=>hn(e,Aa);Wg=e=>({label:e?.label||"",subject:hn(e,"rdf:subject"),predicate:hn(e,"rdf:predicate"),object:hn(e,"rdf:object")})});var fR,hR,mR,gR,Wu,yP,Hg=O(()=>{es();fR="mgx:worldName",hR="mgx:nodeName",mR="mgx:playedBy",gR="mgx:waved",Wu="mgx:invitedBy",yP=Object.freeze([fR,hR,mR,gR,Wu])});function Na(e){let t=new Set;for(let n of e||[])n?.predicate===Wu&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function Gu(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Pa({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=Gu(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let l=s(a);r.set(a,new Set([...l||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(l=>r.get(l).has(a)))}var Vu=O(()=>{Hg()});function hs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function xR(e,t){(!e?.class||!bR.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function ER(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])si(hs(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=hs(e,i);a!==void 0&&yR.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=hs(e,"mgx:factProvenance");n!==void 0&&!si(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";$R(s)&&!Kg.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=hs(e,"mgx:sourceId");o!==void 0&&!si(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=hs(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 vR){let a=hs(e,i);if(a===void 0)continue;let l=a.split(" ").filter(Boolean);l.length||t.push(`${i}, when present, must name at least one record id`);for(let c of l)Kg.test(c)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(c)})`)}}function SR(e,t){si(hs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=hs(e,"mgx:ruleKind");if(!n||!qg.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...qg].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of wR[n])si(hs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function kR(e){let t=[];return xR(e,t),e?.class==="Fact"&&ER(e,t),e?.class==="Rule"&&SR(e,t),{ok:t.length===0,violations:t}}function Hu(e){let t=kR(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 bR,qg,wR,yR,Kg,$R,vR,si,Yg=O(()=>{bR=new Set(["Utterance","Fact","Session","Source","Rule"]),qg=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),wR={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"]},yR=/[.!?]\s+\w/,Kg=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,$R=e=>e.includes("@")||/#v\d/.test(e),vR=["mgx:supersedes","mgx:supersededBy"];si=e=>typeof e=="string"&&e.trim().length>0});var Xg={};Wt(Xg,{access:()=>RR,appendFile:()=>IR,basename:()=>qR,copyFile:()=>FR,createInterface:()=>QR,createReadStream:()=>zR,createRequire:()=>jR,createWriteStream:()=>UR,default:()=>eT,dirname:()=>GR,existsSync:()=>BR,fileURLToPath:()=>YR,isAbsolute:()=>HR,join:()=>WR,mkdir:()=>CR,mkdtemp:()=>OR,randomBytes:()=>XR,readFile:()=>TR,readFileSync:()=>_R,readdir:()=>DR,rename:()=>LR,resolve:()=>VR,rm:()=>PR,sep:()=>KR,spawnSync:()=>JR,stat:()=>MR,tmpdir:()=>ZR,unlink:()=>NR,writeFile:()=>AR});var dt,jR,_R,RR,TR,AR,IR,CR,OR,LR,NR,PR,MR,FR,DR,zR,UR,BR,WR,GR,VR,HR,qR,KR,YR,XR,JR,QR,ZR,eT,Jg=O(()=>{dt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},jR=dt("createRequire"),_R=dt("readFileSync"),RR=dt("access"),TR=dt("readFile"),AR=dt("writeFile"),IR=dt("appendFile"),CR=dt("mkdir"),OR=dt("mkdtemp"),LR=dt("rename"),NR=dt("unlink"),PR=dt("rm"),MR=dt("stat"),FR=dt("copyFile"),DR=dt("readdir"),zR=dt("createReadStream"),UR=dt("createWriteStream"),BR=()=>!1,WR=(...e)=>e.join("/"),GR=e=>String(e).replace(/\/[^/]*$/,""),VR=(...e)=>e.join("/"),HR=e=>String(e).startsWith("/"),qR=e=>String(e).split("/").pop(),KR="/",YR=e=>String(e),XR=dt("randomBytes"),JR=dt("spawnSync"),QR=dt("createInterface"),ZR=()=>"/tmp",eT={}});var tT,oi,qu=O(()=>{tT=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,oi=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(tT);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function nT(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function sT(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:b,topup:y}}async function mu(e,{config:t,source:n,tel:s}){return(await mg(e,{config:t,source:n,tel:s})).text}var gu=O(()=>{Rt();Ue();Vt();ha();Ir();Le();Is();ba();wa();Ve();mu.ownsGraphLoad=!0});function gg(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"symbol"),"symbol");return zh(zo(t,s))}var bg=O(()=>{Le();Ve()});function ya(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 Yr(e){return ya(e).toString(16).padStart(8,"0")}function P_(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let w=0;w<16;w+=1)i[w]=o.getUint32(u+w*4);for(let w=16;w<64;w+=1){let v=a(i[w-15],7)^a(i[w-15],18)^i[w-15]>>>3,k=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+v+i[w-7]+k>>>0}let[d,f,p,h,m,b,g,y]=r;for(let w=0;w<64;w+=1){let v=a(m,6)^a(m,11)^a(m,25),k=m&b^~m&g,$=y+v+k+N_[w]+i[w]>>>0,x=a(d,2)^a(d,13)^a(d,22),E=d&f^d&p^f&p,S=x+E>>>0;y=g,g=b,b=m,m=h+$>>>0,h=p,p=f,f=d,d=$+S>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+p>>>0,r[3]=r[3]+h>>>0,r[4]=r[4]+m>>>0,r[5]=r[5]+b>>>0,r[6]=r[6]+g>>>0,r[7]=r[7]+y>>>0}let l=new Uint8Array(32),c=new DataView(l.buffer);for(let u=0;u<8;u+=1)c.setUint32(u*4,r[u]);return l}function M_(e,t){let n=P_(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function V(e){let t=ds(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 ps(e){let t=ds(e);return D_.get(t)??t}function ge(e,t,n){return Jo(V(e),ps(t),V(n))}var N_,F_,ds,D_,Jo,Mt=O(()=>{N_=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]);F_=2e3,ds=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,F_);D_=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);Jo=(e,t,n)=>`fact:${M_(`${e}\0${t}\0${n}`,8)}`});var fn={};Gt(fn,{CARDINALITY_RULE_CONFIDENCE:()=>H_,CAX_DW_RULE:()=>wu,CAX_DW_RULE_CONFIDENCE:()=>$u,CAX_MAXC0_RULE_CONFIDENCE:()=>K_,CLS_SVF1_RULE:()=>vu,CLS_SVF1_RULE_CONFIDENCE:()=>Eu,DEFAULT_MAX_ENVIRONMENTS:()=>$a,DISJOINT_PREDICATE:()=>Qo,ENTAILED_DISJOINT_PROVENANCE:()=>yu,ENTAILED_PROVENANCE:()=>$g,ENTAILED_SCM_SVF_PROVENANCE:()=>ju,ENTAILED_SVF1_PROVENANCE:()=>xu,ENTAILED_TYPE_PROVENANCE:()=>xg,ON_PROPERTY_PREDICATE:()=>Nn,SCM_SVF_RULE:()=>ku,SCM_SVF_RULE_CONFIDENCE:()=>_u,SOME_VALUES_FROM_PREDICATE:()=>Pn,SUBCLASS_PREDICATE:()=>ze,TYPE_PREDICATE:()=>Ft,buildCardinalityRestrictions:()=>V_,buildRelevanceFrontier:()=>bu,buildSubClassSuccessors:()=>va,deriveDisjointViolations:()=>jg,deriveSomeValuesFromApplication:()=>_g,deriveSomeValuesFromSubsumption:()=>Rg,deriveSubClassClosure:()=>Eg,deriveSubClassClosureDelta:()=>Sg,deriveTypePropagation:()=>kg,entailedTrustFrom:()=>U_,findConsistencyViolations:()=>X_,findIsaChain:()=>Ru,proveCardinalityAtLeast:()=>q_,proveMaxCardinalityZeroDenial:()=>Y_,retractSubClassOf:()=>tR,syllogise:()=>J_});function wg(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 U_(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 fs(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Eg(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}${Ne}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:fs(s),a=(u,d,f)=>!i||i.has(u)||i.has(d)||i.has(f),l=[],c=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[p,h]of r)for(let m of h){let b=r.get(m);if(b)for(let g of b){if(p===g)continue;let y=`${p}${Ne}${g}`;o.has(y)||c.has(y)||a(p,m,g)&&d.push([p,m,g,y])}}if(!d.length)break;d.sort((p,h)=>p[0].localeCompare(h[0])||p[2].localeCompare(h[2])||p[1].localeCompare(h[1]));let f=!1;for(let[p,h,m,b]of d)if(!c.has(b)){if(l.length>=n)break;c.add(b),l.push({subject:p,object:m,via:h}),r.has(p)||r.set(p,new Set),r.get(p).add(m),f=!0}if(l.length>=n||!f)break}return l}function Sg(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[h,m]of e||[])!h||!m||h===m||(r.add(`${h}${Ne}${m}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),a.has(m)||a.set(m,new Set),a.get(m).add(h));let l=[],c=new Set;for(let[h,m]of t||[]){if(!h||!m||h===m)continue;let b=`${h}${Ne}${m}`;c.has(b)||(c.add(b),l.push([h,m]))}let u=o instanceof Set?o.size?o:null:fs(o),d=(h,m,b)=>!u||u.has(h)||u.has(m)||u.has(b),f=[],p=new Set;for(let h=0;h<n&&l.length;h+=1){let m=[],b=(w,v,k)=>{if(w===k)return;let $=`${w}${Ne}${k}`;r.has($)||p.has($)||d(w,v,k)&&m.push([w,v,k,$])};for(let[w,v]of l){for(let k of i.get(v)||[])b(w,v,k);for(let k of a.get(w)||[])b(k,w,v)}if(!m.length)break;m.sort((w,v)=>w[0].localeCompare(v[0])||w[2].localeCompare(v[2])||w[1].localeCompare(v[1]));let g=!1,y=[];for(let[w,v,k,$]of m)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:w,object:k,via:v}),i.has(w)||i.set(w,new Set),i.get(w).add(k),a.has(k)||a.set(k,new Set),a.get(k).add(w),y.push([w,k]),g=!0}if(f.length>=s||!g)break;l=y}return f}function Mn(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 B_(e){return Mn((e||[]).map(([t,n])=>[n,t]))}function bu(e,t){let n=[],s=[],o=new Map,r=new Map;for(let c of e||[])!c||!c.subject||!c.predicate||!c.object||(Ls(c.predicate)?n.push([c.subject,c.object]):uo(c.predicate)?s.push([c.subject,c.object]):Zo(c.predicate)?o.set(c.subject,c.object):Jr(c.predicate)&&r.set(c.subject,c.object));let i=B_(n),a=new Set;for(let c of t||[]){let u=V(c);if(u){a.add(u);for(let d of i(u))a.add(d)}}let l=new Set(a);for(let[c,u]of s)a.has(u)&&l.add(c);for(let[c,u]of r)o.has(c)&&a.has(u)&&l.add(c);return l}function kg(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Mn(t),i=new Set,a=new Set;for(let[p,h]of o||[])p&&h&&i.add(`${p}${Ne}${h}`);let l=s instanceof Set?s.size?s:null:fs(s),c=(p,h,m)=>!l||l.has(p)||l.has(h)||l.has(m),u=[];for(let[p,h]of e||[]){if(!p||!h)continue;let m=`${p}${Ne}${h}`;if(!a.has(m)){a.add(m);for(let b of r(h)){if(b===h||b===p)continue;let g=`${p}${Ne}${b}`;i.has(g)||c(p,h,b)&&u.push([p,h,b,g])}}}u.sort((p,h)=>p[0].localeCompare(h[0])||p[2].localeCompare(h[2])||p[1].localeCompare(h[1]));let d=[],f=new Set;for(let[p,h,m,b]of u)if(!f.has(b)){if(d.length>=n)break;f.add(b),d.push({subject:p,object:m,via:h})}return d}function jg(e,t,n,{budget:s=50,focus:o=null}={}){let r=Mn(t),i=new Map,a=new Set;for(let[h,m]of n||[])!h||!m||h===m||(a.add(`${h}${Ne}${m}`),a.add(`${m}${Ne}${h}`),i.has(h)||i.set(h,new Set),i.get(h).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(h));if(!i.size)return[];let l=new Set,c=o instanceof Set?o.size?o:null:fs(o),u=(h,m,b)=>!c||c.has(h)||c.has(m)||c.has(b),d=[];for(let[h,m]of e||[]){if(!h||!m)continue;let b=`${h}${Ne}${m}`;if(!l.has(b)){l.add(b);for(let g of[m,...r(m)]){let y=i.get(g);if(y)for(let w of y){if(w===h)continue;let v=`${h}${Ne}${w}`;a.has(v)||u(h,m,w)&&d.push([h,m,g,w,v])}}}}d.sort((h,m)=>h[0].localeCompare(m[0])||h[3].localeCompare(m[3])||h[2].localeCompare(m[2])||h[1].localeCompare(m[1]));let f=[],p=new Set;for(let[h,m,b,g,y]of d)if(!p.has(y)){if(f.length>=s)break;p.add(y),f.push({subject:h,object:g,viaType:m,viaClass:b})}return f}function _g(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Mn(n),a=new Map;for(let b of s||[]){if(!b||!b.restriction||!b.property||!b.target)continue;let g=`${b.property}${Ne}${b.target}`;a.has(g)||a.set(g,new Set),a.get(g).add(b.restriction)}if(!a.size)return[];let l=new Set,c=new Map;for(let[b,g]of t||[])!b||!g||(l.add(`${b}${Ne}${g}`),c.has(b)||c.set(b,new Set),c.get(b).add(g));let u=r instanceof Set?r.size?r:null:fs(r),d=(b,g,y)=>!u||u.has(b)||u.has(g)||u.has(y),f=new Set,p=[];for(let[b,g,y]of e||[]){if(!b||!g||!y)continue;let w=V(g),v=`${b}${Ne}${w}${Ne}${y}`;if(f.has(v))continue;f.add(v);let k=c.get(y);if(k)for(let $ of k)for(let x of[$,...i($)]){let E=a.get(`${w}${Ne}${x}`);if(E)for(let S of E){if(b===S)continue;let R=`${b}${Ne}${S}`;l.has(R)||d(b,y,S)&&p.push([b,g,w,y,$,x,S,R])}}}p.sort((b,g)=>b[0].localeCompare(g[0])||b[6].localeCompare(g[6])||b[1].localeCompare(g[1])||b[3].localeCompare(g[3]));let h=[],m=new Set;for(let[b,g,y,w,v,k,$,x]of p)if(!m.has(x)){if(h.length>=o)break;m.add(x),h.push({subject:b,object:$,viaProperty:g,viaPropertyKey:y,viaValue:w,viaType:v,viaTarget:k})}return h}function V_(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Zo(r.predicate))t.set(r.subject,r.object);else if(z_(r.predicate))s.set(r.subject,r.object);else{let i=G_[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==W_)continue;let l=s.get(r);l&&o.push({restriction:r,kind:i,n:a,onClass:l})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function Rg(e,t,{budget:n=50,focus:s=null}={}){let o=Mn(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=V(f.property);r.has(p)||r.set(p,[]),r.get(p).push({restriction:f.restriction,target:f.target})}let i=new Set;for(let[f,p]of t||[])f&&p&&i.add(`${f}${Ne}${p}`);let a=s instanceof Set?s.size?s:null:fs(s),l=(f,p)=>!a||a.has(f)||a.has(p),c=[];for(let[,f]of r)if(!(f.length<2))for(let p of f)for(let h of f){if(p.restriction===h.restriction||p.target===h.target||!o(p.target).has(h.target))continue;let m=`${p.restriction}${Ne}${h.restriction}`;i.has(m)||l(p.restriction,h.restriction)&&c.push([p.restriction,h.restriction,p.target,h.target,m])}c.sort((f,p)=>f[0].localeCompare(p[0])||f[1].localeCompare(p[1]));let u=[],d=new Set;for(let[f,p,h,m,b]of c)if(!d.has(b)){if(u.length>=n)break;d.add(b),u.push({subject:f,object:p,viaY1:h,viaY2:m})}return u}function Tg(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Mn(e),a=r instanceof Set?r.size?r:null:fs(r),l=f=>!a||a.has(n)||a.has(f),c=new Map;for(let[f,p]of e||[])!f||!p||(c.has(f)||c.set(f,new Set),c.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,!!l(f))for(let p of c.get(f)||[]){let h=u.get(p);if(h&&s(h))return{viaClass:f,viaRestriction:p,record:h}}}return null}function q_(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Tg(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 Y_(e,t,n,s,o={}){if(!s)return null;let r=Tg(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function X_(e,t,n,{budget:s=50,focus:o=null}={}){let r=Mn(t),i=new Map;for(let[p,h]of n||[])!p||!h||p===h||(i.has(p)||i.set(p,new Set),i.get(p).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(p));if(!i.size)return[];let a=new Map;for(let[p,h]of e||[])!p||!h||(a.has(p)||a.set(p,new Set),a.get(p).add(h));let l=o instanceof Set?o.size?o:null:fs(o),c=p=>!l||l.has(p),u=[],d=new Set;for(let[p,h]of a){if(!c(p))continue;let m=[...h].sort();for(let b=0;b<m.length;b+=1)for(let g=b+1;g<m.length;g+=1){let[y,w]=[m[b],m[g]],v=[y,...r(y)],k=[w,...r(w)],$=null;for(let E of v){let S=i.get(E);if(S){for(let R of k)if(S.has(R)){$=[E,R];break}if($)break}}if(!$)continue;let x=`${p}${Ne}${y}${Ne}${w}`;d.has(x)||(d.add(x),u.push([p,y,w,$[0],$[1]]))}}u.sort((p,h)=>p[0].localeCompare(h[0])||p[1].localeCompare(h[1])||p[2].localeCompare(h[2]));let f=[];for(let[p,h,m,b,g]of u){if(f.length>=s)break;f.push({subject:p,classA:h,classB:m,viaA:b,viaB:g})}return f}async function J_(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=$a,full:i=!1,store:a}={}){let{loadMemory:l,readFactRows:c,appendFacts:u}=wg(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await l(e),p=c(f),h=p.filter(j=>Ls(j.predicate)).map(j=>[j.subject,j.object]),m=p.filter(j=>uo(j.predicate)).map(j=>[j.subject,j.object]),b=p.filter(j=>lo(j.predicate)).map(j=>[j.subject,j.object]),g=new Map,y=new Map,w=[];for(let j of p){let pe=String(j.predicate||"").trim().toLowerCase();Zo(j.predicate)?g.set(j.subject,j.object):Jr(j.predicate)?y.set(j.subject,j.object):Su.has(pe)||w.push([j.subject,j.predicate,j.object])}let v=[];for(let[j,pe]of g){let Ae=y.get(j);Ae&&v.push({restriction:j,property:pe,target:Ae})}let k=fs(s),$=o&&k?bu(p,[...k]):k,x=$===null&&d?await a.loadSyllogiseState(e):null,E=new Set(p.map(j=>j.id)),S=Array.isArray(x?.factIds)?x.factIds.filter(j=>!E.has(j)):[],R=x&&Array.isArray(x.factIds)&&!S.length&&!i?"delta":"full",_=R==="delta"?new Set(x.factIds):null,I=R==="delta"?p.filter(j=>!_.has(j.id)):p,P=I.length,T=new Map;for(let j of p)T.set(`${j.subject}${Ne}${j.predicate}${Ne}${j.object}`,j.trust);let F=(j,pe,Ae)=>T.get(`${j}${Ne}${pe}${Ne}${Ae}`),U=(j,pe,Ae)=>T.has(`${j}${Ne}${pe}${Ne}${Ae}`),K=j=>j.filter(pe=>typeof pe=="number"),ce=R==="delta"&&!I.length,ie=R==="delta"?I.filter(j=>Ls(j.predicate)).map(j=>[j.subject,j.object]):[],D=R==="delta"?ie.length?Sg(h,ie,{depth:t,budget:n,focus:$}):[]:Eg(h,{depth:t,budget:n,focus:$}),B=h.concat(D.map(j=>[j.subject,j.object])),W=$,A=null;if(R==="delta"&&!ce){let j=p.concat(D.map(Ae=>({subject:Ae.subject,predicate:ze,object:Ae.object}))),pe=[];for(let Ae of I)pe.push(Ae.subject,Ae.object);A=bu(j,pe),W=A}let L=j=>!A||A.has(j),C=A?m.filter(([j,pe])=>L(j)||L(pe)):m,N=new Set;if(A)for(let j of I)lo(j.predicate)&&(N.add(j.subject),N.add(j.object));let M=A&&N.size?Mn(B):null,z=A?m.filter(([j,pe])=>L(j)||L(pe)||M&&[...M(pe)].some(Ae=>N.has(Ae))):m,q=new Set;if(A){for(let j of I)if(Zo(j.predicate)||Jr(j.predicate)){let pe=g.get(j.subject);pe&&q.add(V(pe))}}let Q=A?w.filter(([j,pe,Ae])=>L(j)||L(Ae)||q.has(V(pe))):w,ae=Math.max(0,n-D.length),te=ae>0&&!ce?kg(C,B,{budget:ae,focus:W,presentTypeEdges:m}):[],ee=Math.max(0,n-D.length-te.length),Y=ee>0&&!ce?jg(z,B,b,{budget:ee,focus:W}):[],J=Math.max(0,n-D.length-te.length-Y.length),ne=J>0&&v.length&&!ce?_g(Q,m,B,v,{budget:J,focus:W}):[],xe=Math.max(0,n-D.length-te.length-Y.length-ne.length),Te=xe>0&&v.length>1&&!ce?Rg(v,B,{budget:xe,focus:W}):[],ue=new Map(v.map(j=>[j.restriction,j])),Ie=[...D.map(j=>({subject:j.subject,predicate:ze,object:j.object,provenance:$g,justification:[[ge(j.subject,ze,j.via),ge(j.via,ze,j.object)]]})),...te.map(j=>({subject:j.subject,predicate:Ft,object:j.object,provenance:xg,justification:[[ge(j.subject,Ft,j.via),ge(j.via,ze,j.object)]]})),...Y.map(j=>{let pe=U(j.viaClass,Qo,j.object),[Ae,un]=pe?[j.viaClass,j.object]:[j.object,j.viaClass],Yn=K([F(j.subject,Ft,j.viaType),F(Ae,Qo,un),...j.viaClass!==j.viaType?[F(j.viaType,ze,j.viaClass)]:[]]);return{subject:j.subject,predicate:Qo,object:j.object,provenance:yu,justification:[[ge(j.subject,Ft,j.viaType),ge(Ae,Qo,un),...j.viaClass!==j.viaType?[ge(j.viaType,ze,j.viaClass)]:[]]],...Yn.length?{premiseTrusts:Yn,ruleConfidence:$u}:{}}}),...ne.map(j=>{let pe=K([F(j.subject,j.viaProperty,j.viaValue),F(j.viaValue,Ft,j.viaType),F(j.object,Nn,j.viaPropertyKey),F(j.object,Pn,j.viaTarget),...j.viaType!==j.viaTarget?[F(j.viaType,ze,j.viaTarget)]:[]]);return{subject:j.subject,predicate:Ft,object:j.object,provenance:xu,justification:[[ge(j.subject,j.viaProperty,j.viaValue),ge(j.viaValue,Ft,j.viaType),ge(j.object,Nn,j.viaPropertyKey),ge(j.object,Pn,j.viaTarget),...j.viaType!==j.viaTarget?[ge(j.viaType,ze,j.viaTarget)]:[]]],...pe.length?{premiseTrusts:pe,ruleConfidence:Eu}:{}}}),...Te.map(j=>{let pe=ue.get(j.subject),Ae=ue.get(j.object),un=K([pe&&F(j.subject,Nn,pe.property),F(j.subject,Pn,j.viaY1),Ae&&F(j.object,Nn,Ae.property),F(j.object,Pn,j.viaY2),F(j.viaY1,ze,j.viaY2)]);return{subject:j.subject,predicate:ze,object:j.object,provenance:ju,justification:[[...pe?[ge(j.subject,Nn,pe.property)]:[],ge(j.subject,Pn,j.viaY1),...Ae?[ge(j.object,Nn,Ae.property)]:[],ge(j.object,Pn,j.viaY2),ge(j.viaY1,ze,j.viaY2)]],...un.length?{premiseTrusts:un,ruleConfidence:_u}:{}}})],Ce=Ie.map(j=>({id:ge(j.subject,j.predicate,j.object),subject:j.subject,predicate:j.predicate,object:j.object,environments:j.justification,write:j})),oe=Ig(p.concat(Ce.map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object})))),ke=new Map(p.map(j=>[j.id,j])),le=j=>Ls(j)||uo(j)||lo(j),H=j=>R!=="delta"||A!==null&&(A.has(j.subject)||A.has(j.object)),se=p.filter(j=>le(j.predicate)&&Ag(j.provenance)&&Xr(j).length<r&&H(j)).map(j=>({id:j.id,subject:j.subject,predicate:j.predicate,object:j.object,environments:Xr(j),provenance:j.provenance})),He=[...Ce,...se].sort((j,pe)=>j.subject.localeCompare(pe.subject)||j.predicate.localeCompare(pe.predicate)||j.object.localeCompare(pe.object)),De=0,tt=!1,cn=0;for(let j of He){if(cn>=n){tt=!0;break}cn+=1;let pe=oe(j,{maxEnvironments:r+1}),{kept:Ae,truncated:un}=Z_(j.environments,pe,r);if(un&&(tt=!0),!(Ae.length<=j.environments.length)){if(De+=Ae.length-j.environments.length,j.write){j.write.justification=Ae;continue}Ie.push({subject:j.subject,predicate:j.predicate,object:j.object,justification:Ae,...Cg(j.provenance,Ae,Yn=>ke.get(Yn)?.trust)||{}})}}let{ids:Qt}=await u(e,Ie),Zt=[],ln=0;for(let j of D)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.via,rule:yg}),ln+=1;for(let j of te)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.via,rule:vg}),ln+=1;for(let j of Y)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaClass,rule:wu}),ln+=1;for(let j of ne)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaValue,rule:vu}),ln+=1;for(let j of Te)Zt.push({id:Qt[ln],subject:j.subject,object:j.object,via:j.viaY1,rule:ku}),ln+=1;let Ci=Zt.length>=n;if($===null&&d&&!Ci){let j=new Set(E);for(let pe of Qt)j.add(pe);await a.saveSyllogiseState(e,{version:1,factIds:[...j].sort(),completedAt:new Date().toISOString()})}return{derived:Zt,count:Zt.length,budget:n,depth:t,truncated:Ci,mode:R,deltaSize:P,environmentsAdded:De,alternatesTruncated:tt}}function Ag(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function Q_(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();Ls(u.predicate)?t.push([u.subject,u.object]):uo(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):lo(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)):Zo(u.predicate)?o.set(u.subject,u.object):Jr(u.predicate)?r.set(u.subject,u.object):Su.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([V(u.predicate),u.object]))}let a=Mn(t),l=(u,d)=>u!==d&&a(u).has(d),c=u=>{let d=o.get(u),f=r.get(u);return d&&f?{property:V(d),target:f}:null};return u=>{if(Ls(u.predicate)){if(l(u.subject,u.object))return!0;let d=c(u.subject),f=c(u.object);return!!(d&&f&&d.property===f.property&&l(d.target,f.target))}if(uo(u.predicate)){for(let f of n.get(u.subject)||[])if(l(f,u.object))return!0;let d=c(u.object);if(d){for(let[f,p]of i.get(u.subject)||[])if(f===d.property){for(let h of n.get(p)||[])if(h===d.target||l(h,d.target))return!0}}return!1}if(lo(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 Ig(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,l=new Map,c=new Map;for(let p of e){if(!p||!p.subject||!p.predicate||!p.object)continue;p.id&&t.add(p.id);let h=String(p.predicate||"").trim().toLowerCase();Ls(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)):uo(p.predicate)?(o.has(p.subject)||o.set(p.subject,new Set),o.get(p.subject).add(p.object)):lo(p.predicate)?(r.add(`${p.subject}${Ne}${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)):Zo(p.predicate)?a.set(p.subject,p.object):Jr(p.predicate)?l.set(p.subject,p.object):Su.has(h)||(c.has(p.subject)||c.set(p.subject,[]),c.get(p.subject).push([p.predicate,p.object]))}let u=Mn(n),d=p=>s.get(p)||new Set,f=p=>{let h=a.get(p),m=l.get(p);return h&&m?{property:h,propertyKey:V(h),target:m}:null};return(p,{maxEnvironments:h=$a}={})=>{let m=[],b=new Set,g=y=>{if(m.length>=h||p.id&&y.includes(p.id)||!y.every(v=>t.has(v)))return;let w=[...y].sort().join(" ");b.has(w)||(b.add(w),m.push(y))};if(Ls(p.predicate)){for(let y of[...d(p.subject)].sort()){if(m.length>=h)break;y===p.subject||y===p.object||d(y).has(p.object)&&g([ge(p.subject,ze,y),ge(y,ze,p.object)])}if(m.length<h){let y=f(p.subject),w=f(p.object);y&&w&&y.propertyKey===w.propertyKey&&y.target!==w.target&&d(y.target).has(w.target)&&g([ge(p.subject,Nn,y.property),ge(p.subject,Pn,y.target),ge(p.object,Nn,w.property),ge(p.object,Pn,w.target),ge(y.target,ze,w.target)])}return m}if(uo(p.predicate)){for(let w of[...o.get(p.subject)||[]].sort()){if(m.length>=h)break;w!==p.object&&d(w).has(p.object)&&g([ge(p.subject,Ft,w),ge(w,ze,p.object)])}let y=f(p.object);if(y){let w=[...c.get(p.subject)||[]].filter(([v])=>V(v)===y.propertyKey).sort((v,k)=>v[0].localeCompare(k[0])||v[1].localeCompare(k[1]));for(let[v,k]of w){if(m.length>=h)break;for(let $ of[...o.get(k)||[]].sort()){if(m.length>=h)break;$!==y.target&&!d($).has(y.target)||g([ge(p.subject,v,k),ge(k,Ft,$),ge(p.object,Nn,y.propertyKey),ge(p.object,Pn,y.target),...$!==y.target?[ge($,ze,y.target)]:[]])}}}return m}if(lo(p.predicate)){let y=[];for(let w of o.get(p.subject)||[])for(let v of[w,...u(w)])(i.get(v)||new Set).has(p.object)&&y.push([w,v]);y.sort((w,v)=>w[0].localeCompare(v[0])||w[1].localeCompare(v[1]));for(let[w,v]of y){if(m.length>=h)break;let k=r.has(`${v}${Ne}${p.object}`),[$,x]=k?[v,p.object]:[p.object,v];g([ge(p.subject,Ft,w),ge($,Qo,x),...v!==w?[ge(w,ze,v)]:[]])}return m}return m}}function Z_(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 Cg(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=eR.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(c=>n(c)).filter(c=>typeof c=="number");if(a.length!==i.length)continue;let l=Math.min(...a);l>r&&(r=l,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function tR(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=$a,store:i,sourceTags:a=[],predicate:l=ze}={}){let{loadMemory:c,readFactRows:u,removeFacts:d}=wg(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),f=typeof i?.appendFacts=="function"?i.appendFacts:null,p=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,h=(a||[]).filter(Boolean);if(h.length&&!p)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let m=V(t),b=V(n),g=ge(m,l,b),y=await c(e),w=u(y),v=new Map(w.map(U=>[U.id,U]));if(!v.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let k=v.get(g).sourceIds||[],$=h.map(U=>p(g,U).slice(g.length+1)),x=h.length?k.filter(U=>$.includes(U)):[],E=!h.length||x.length>0;if(h.length&&!E)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=h.length>0&&x.length<k.length,R=new Set([g]),_=[g],I=new Map,P=!1;if(!S){let U=w.filter(D=>Xr(D).length&&Ag(D.provenance)),K=new Map;for(let D of U)for(let B of Xr(D))for(let W of B)K.has(W)||K.set(W,new Set),K.get(W).add(D.id);let ce=0,ie=[g];for(;ce<o;ce+=1){let D=new Set;for(let z of ie)for(let q of K.get(z)||[])R.has(q)||D.add(q);let B=[...D].map(z=>v.get(z)).sort((z,q)=>z.subject.localeCompare(q.subject)||z.predicate.localeCompare(q.predicate)||z.object.localeCompare(q.object));if(!B.length)break;let W=w.filter(z=>!R.has(z.id)&&!D.has(z.id)),A=new Set(W.map(z=>z.id)),L=Ig(W),C=Q_(W),N=!1,M=!1;ie=[];for(let z of B){if(R.size>=s){M=!0;break}let q=Xr(z),Q=q.filter(te=>te.every(ee=>A.has(ee)));if(Q.length){Q.length!==q.length&&I.set(z.id,Q);continue}let ae=L(z,{maxEnvironments:r});if(ae.length){I.set(z.id,ae);continue}C(z)||(R.add(z.id),_.push(z.id),ie.push(z.id),N=!0)}if(M){P=!0;break}if(!N)break}!P&&ce>=o&&(P=U.some(D=>!R.has(D.id)&&D.justification.some(B=>R.has(B))))}let T=h.length?[...x.map(U=>`${g}@${U}`),..._.slice(1)]:_,{removed:F}=await d(e,T);if(f){let U=[...I.entries()].filter(([K])=>!R.has(K)).sort((K,ce)=>K[0].localeCompare(ce[0])).map(([K,ce])=>{let ie=v.get(K);return{subject:ie.subject,predicate:ie.predicate,object:ie.object,justification:ce,...Cg(ie.provenance,ce,D=>v.get(D)?.trust)||{}}});U.length&&await f(e,U)}return{retracted:F,count:F.length,budget:s,depth:o,truncated:P,found:!0,...h.length?{ownRecord:!0,stillStands:S}:{}}}function va(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 Ru(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:va(s),a=[];for(let[c,u]of n||[])c===e&&u&&a.push({node:u,path:[{subject:c,predicate:Ft,object:u}]});for(let c of i.get(e)||[])a.push({node:c,path:[{subject:e,predicate:ze,object:c}]});let l=new Set([e]);for(let c=1;c<=o&&a.length;c+=1){for(let{node:d,path:f}of a)if(r.has(d))return f;if(c===o)break;let u=[];for(let{node:d,path:f}of a)if(!l.has(d)){l.add(d);for(let p of i.get(d)||[])l.has(p)||u.push({node:p,path:[...f,{subject:d,predicate:ze,object:p}]})}a=u}return null}var ze,yg,$g,Ft,vg,xg,Qo,wu,yu,$u,Nn,Pn,vu,xu,Eu,$a,Ne,Ls,uo,lo,Zo,Jr,z_,Su,W_,G_,ku,ju,_u,H_,K_,Xr,eR,Xt=O(()=>{Mt();ze="rdfs:subClassOf",yg="subClassOf",$g=`entailed:${yg}`,Ft="rdf:type",vg="type",xg=`entailed:${vg}`,Qo="owl:disjointWith",wu="disjointWith",yu=`entailed:${wu}`,$u=.95,Nn="owl:onProperty",Pn="owl:someValuesFrom",vu="someValuesFrom",xu=`entailed:${vu}`,Eu=.95,$a=4,Ne="\u241F",Ls=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",uo=e=>String(e||"").trim().toLowerCase()==="rdf:type",lo=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Zo=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",Jr=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",z_=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Su=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);W_="has",G_={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};ku="someValuesFromSubsumption",ju=`entailed:${ku}`,_u=.95;H_=.95;K_=.95;Xr=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);eR=new Map([[yu,$u],[xu,Eu],[ju,_u]])});function sr(e){let t=String(e||""),n=Og.get(t);return n||(t.startsWith(Tu)?er+t.slice(Tu.length):t)}function Lg(e){let t=String(e||""),n=nR.get(t);return n||(t.startsWith(er)?Tu+t.slice(er.length):null)}function Mg(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Ru(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function Sa(e,t,n,{maxHops:s=3}={}){let o=nr(e),r=nr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:l}=Pg(i),c=i.filter(g=>(g.predicate===Ea||g.predicate===tr)&&r.has(g.object)),u=[];for(let g of c){let y=g.predicate===tr?"negative":"positive";if(o.has(g.subject)){u.push({fact:g,polarity:y,hops:0,chain:null});continue}let w=Mg(o,g.subject,a,l,s);w&&w.length&&u.push({fact:g,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Iu(o,r,i,{maxHops:s})};u.sort((g,y)=>g.hops-y.hops||(y.fact.trust||0)-(g.fact.trust||0));let d=u[0].hops,f=u.filter(g=>g.hops===d),p=f.filter(g=>g.polarity==="positive").map(g=>g.fact),h=f.filter(g=>g.polarity==="negative").map(g=>g.fact),m=h.length&&!p.length?"negative":"positive",b=u.find(g=>g.hops>d&&g.polarity!==m)||null;return{verdict:p.length&&h.length?"both":h.length?"no":"yes",hops:d,positive:p,negative:h,chain:u[0].chain,overrides:b?{fact:b.fact,chain:b.chain}:null,baseRate:null}}function Iu(e,t,n,{maxHops:s=3}={}){let o=nr(e),r=nr(t),i=Array.isArray(n)?n:[],a=i.filter(m=>m.predicate===ze||m.predicate===Ft),l=a.filter(m=>o.has(m.subject)).map(m=>m.object);if(!l.length)return null;let c=l[0],u=[...new Set(a.filter(m=>m.object===c&&!o.has(m.subject)).map(m=>m.subject))],d=m=>{let b=i.find(g=>g.subject===m&&r.has(g.object)&&(g.predicate===Ea||g.predicate===tr));return b?{name:m,polarity:b.predicate===tr?"negative":"positive",fact:b}:{name:m,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:h}=Pg(i);return{klass:c,kinds:u.length,positive:f.filter(m=>m.polarity==="positive"),negative:f.filter(m=>m.polarity==="negative"),unknown:f.filter(m=>m.polarity==="unknown"),chain:Mg(o,c,p,h,s)}}function Cu(e,t,{exclude:n=[],maxHops:s=3}={}){let o=nr(e),r=nr(n),i=Array.isArray(t)?t:[],a=new Set,l=[];for(let c of i)c.predicate!==Ea||!o.has(c.object)||r.has(c.subject)||a.has(c.subject)||(a.add(c.subject),Sa(new Set([c.subject]),o,i,{maxHops:s}).verdict==="yes"&&l.push(c));return l.sort(sR)}var er,Tu,xa,Og,nR,Ng,Ea,tr,Au,sR,nr,Pg,ka=O(()=>{Xt();er="mgxneg:",Tu="mgx:",xa="mgxneg:subClassOf",Og=new Map([[ze,xa]]),nR=new Map([...Og].map(([e,t])=>[t,e]));Ng=e=>String(e||"").startsWith(er),Ea="mgx:capableOf",tr=sr(Ea),Au=6,sR=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),nr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),Pg=e=>{let t=e.filter(s=>s.predicate===Ft).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===ze).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:va(n)}}});function ja(e){let t=String(e||"");return Nu.has(t)?Ou:rR.has(t)||iR.test(t)?Qr:aR.has(t)?Fg:Lu}function cR(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(Uf.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function lR(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(cR(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function Pu(e,t){let n=t===Fg;if(!n&&t!==Qr)return null;let s=(e||[]).map(r=>({row:r,at:lR(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[l,c]=[String(r.row.object),String(i.row.object)];return l<c?-1:l>c?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Ou,Qr,Fg,Lu,oR,Nu,rR,iR,aR,Dg=O(()=>{ka();es();Ou="merge",Qr="latest-observation-wins",Fg="first-claim-wins",Lu="contradiction",oR=["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"],Nu=new Set(oR.flatMap(e=>[e,sr(e)])),rR=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"]),iR=/^mgx:has-exit-([a-z]+)$/,aR=new Set(["mgx:playedBy"])});function ti(e){let t=String(e||""),n=t.indexOf(_a);return n<0?"":t.slice(n+_a.length)}function hR(e){let t=1,n=0;for(let s of e)t*=1-pR(s),n+=1;return n?fR(Math.min(1,1-t)):0}function Gg(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 qg(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 Kg(e,t="",n=""){let s=t,o=n;for(let r of e)s=Vg(s,r.assertedAt),o=Hg(o,r.assertedAt);return{earliest:s,latest:o}}function zu({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let l=[...new Set(o)].filter(Boolean).sort(),c=a?hR(l.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:uR,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===or?"rollupSourceIds":"rollupRecordIds",value:l.join(" ")},{prop:ei,key:"rollupCount",value:String(l.length)},{prop:Fn,key:"rollupEarliest",value:r},{prop:Dn,key:"rollupLatest",value:i},...c===void 0?[]:[{prop:rr,key:"rollupPrior",value:String(c)}]]}}function Yg({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(qg).slice(8);if(!i.length)return null;let{earliest:a,latest:l}=Kg(i,kt(s,Fn),kt(s,Dn));return{rollup:zu({id:Mu(e,t),sourceKey:`rollup:${t}`,template:Uu(i[0].record||s),idsProp:or,ids:[...Aa(s),...i.map(u=>u.sourceId)],earliest:a,latest:l,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function Xg({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(qg),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:l}=Kg(i,kt(s,Fn),kt(s,Dn));return{rollup:zu({id:Fu(e,t),sourceKey:t,template:Uu(i[0].record||s),idsProp:Zr,ids:[...dR(s),...i.map(u=>u.id)],earliest:a,latest:l}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function Bu(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Ns(s),r=o?or:Zr,i=a=>Du(kt(a,r));return zu({id:s,sourceKey:kt(e,"mgx:sourceId")||kt(t,"mgx:sourceId"),template:Uu(kt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Vg(kt(e,Fn),kt(t,Fn)),latest:Hg(kt(e,Dn),kt(t,Dn)),priorFor:o?n:void 0})}function Jg(e,t){if(!t)return!1;for(let n of e||[])if(Aa(n).includes(t))return!0;return!1}var uR,zg,Ug,Ra,Bg,or,Zr,ei,Fn,Dn,rr,_a,Wg,Mu,Fu,Ns,ir,Ta,kt,Du,Aa,dR,pR,fR,Vg,Hg,Uu,Wu=O(()=>{uR="Fact",zg=64,Ug=8,Ra=8,Bg=2,or="mgx:rollupSourceIds",Zr="mgx:rollupRecordIds",ei="mgx:rollupCount",Fn="mgx:rollupEarliest",Dn="mgx:rollupLatest",rr="mgx:rollupPrior",_a="@rollup:",Wg="#rollup",Mu=(e,t)=>`${e}${_a}${t}`,Fu=(e,t)=>`${e}@${t}${Wg}`,Ns=e=>String(e||"").includes(_a),ir=e=>String(e||"").endsWith(Wg),Ta=e=>Ns(e)||ir(e);kt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Du=e=>String(e||"").split(" ").filter(Boolean),Aa=e=>Du(kt(e,or)),dR=e=>Du(kt(e,Zr)),pR=e=>Math.max(0,Math.min(1,Number(e)||0)),fR=e=>Number(e.toFixed(6));Vg=(e,t)=>Gg(e,t,Math.min),Hg=(e,t)=>Gg(e,t,Math.max);Uu=e=>({label:e?.label||"",subject:kt(e,"rdf:subject"),predicate:kt(e,"rdf:predicate"),object:kt(e,"rdf:object")})});function qu(e){let t=String(e||"");return Hu(t)?t.slice(0,-La.length):""}function Qg(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 Ku({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:rn,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:Ca,key:"retractedRecordIds",value:i.join(" ")},{prop:Gu,key:"retractedCount",value:String(i.length)},{prop:Oa,key:"retractedAt",value:o||""},...a.length?[{prop:ni,key:"provenance",value:a.join(" | ")}]:[]]}}function eb({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...po(o),...n].filter(Boolean);return a.length?Ku({id:Vu(e,t),sourceId:t,template:r||Zg(o),ids:a,retractedAt:Qg(fo(o),s),tags:[...si(hn(o,ni)),...si(i)]}):null}function tb(e,t){let n=Zg(hn(e,"rdf:subject")?e:t);return Ku({id:e?.id||t?.id,sourceId:hn(e,"mgx:sourceId")||hn(t,"mgx:sourceId"),template:n,ids:[...po(e),...po(t)],retractedAt:Qg(fo(e),fo(t)),tags:[...si(hn(e,ni)),...si(hn(t,ni))]})}function gR(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function bR(e,t,n=""){return!e||!t||!po(e).includes(t)?!1:gR(n,fo(e))}function Na(e,t,n=""){for(let s of e||[])if(bR(s,t,n))return!0;return!1}function wR(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function yR(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 Pa(e){let t=qu(e?.id);return t?{id:e.id,subject:t,predicate:Ia,object:wR(fo(e),po(e)),provenance:hn(e,ni)}:null}function Ma(e){if(!e||e.predicate!==Ia)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=yR(e.object);return o.length?Ku({id:`${t}${La}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:si(e.provenance)}):null}var rn,Ia,Ca,Oa,Gu,La,ni,Vu,Hu,hn,mR,si,po,fo,Zg,Yu=O(()=>{rn="Retraction",Ia="mgx:retracted",Ca="mgx:retractedRecordIds",Oa="mgx:retractedAt",Gu="mgx:retractedCount",La="#retracted",ni="mgx:factProvenance",Vu=(e,t)=>`${e}@${t}${La}`,Hu=e=>String(e||"").endsWith(La);hn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",mR=e=>String(e||"").split(" ").filter(Boolean),si=e=>String(e||"").split(" | ").filter(Boolean),po=e=>mR(hn(e,Ca)),fo=e=>hn(e,Oa);Zg=e=>({label:e?.label||"",subject:hn(e,"rdf:subject"),predicate:hn(e,"rdf:predicate"),object:hn(e,"rdf:object")})});var $R,vR,xR,ER,Xu,DP,nb=O(()=>{es();$R="mgx:worldName",vR="mgx:nodeName",xR="mgx:playedBy",ER="mgx:waved",Xu="mgx:invitedBy",DP=Object.freeze([$R,vR,xR,ER,Xu])});function Fa(e){let t=new Set;for(let n of e||[])n?.predicate===Xu&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function Ju(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Da({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=Ju(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let l=s(a);r.set(a,new Set([...l||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(l=>r.get(l).has(a)))}var Qu=O(()=>{nb()});function hs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function TR(e,t){(!e?.class||!SR.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function AR(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])oi(hs(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=hs(e,i);a!==void 0&&jR.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=hs(e,"mgx:factProvenance");n!==void 0&&!oi(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";_R(s)&&!ob.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=hs(e,"mgx:sourceId");o!==void 0&&!oi(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=hs(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 RR){let a=hs(e,i);if(a===void 0)continue;let l=a.split(" ").filter(Boolean);l.length||t.push(`${i}, when present, must name at least one record id`);for(let c of l)ob.test(c)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(c)})`)}}function IR(e,t){oi(hs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=hs(e,"mgx:ruleKind");if(!n||!sb.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...sb].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of kR[n])oi(hs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function CR(e){let t=[];return TR(e,t),e?.class==="Fact"&&AR(e,t),e?.class==="Rule"&&IR(e,t),{ok:t.length===0,violations:t}}function Zu(e){let t=CR(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 SR,sb,kR,jR,ob,_R,RR,oi,rb=O(()=>{SR=new Set(["Utterance","Fact","Session","Source","Rule"]),sb=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),kR={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"]},jR=/[.!?]\s+\w/,ob=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,_R=e=>e.includes("@")||/#v\d/.test(e),RR=["mgx:supersedes","mgx:supersededBy"];oi=e=>typeof e=="string"&&e.trim().length>0});var ib={};Gt(ib,{access:()=>NR,appendFile:()=>FR,basename:()=>eT,copyFile:()=>VR,createInterface:()=>rT,createReadStream:()=>qR,createRequire:()=>OR,createWriteStream:()=>KR,default:()=>aT,dirname:()=>JR,existsSync:()=>YR,fileURLToPath:()=>nT,isAbsolute:()=>ZR,join:()=>XR,mkdir:()=>DR,mkdtemp:()=>zR,randomBytes:()=>sT,readFile:()=>PR,readFileSync:()=>LR,readdir:()=>HR,rename:()=>UR,resolve:()=>QR,rm:()=>WR,sep:()=>tT,spawnSync:()=>oT,stat:()=>GR,tmpdir:()=>iT,unlink:()=>BR,writeFile:()=>MR});var dt,OR,LR,NR,PR,MR,FR,DR,zR,UR,BR,WR,GR,VR,HR,qR,KR,YR,XR,JR,QR,ZR,eT,tT,nT,sT,oT,rT,iT,aT,ab=O(()=>{dt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},OR=dt("createRequire"),LR=dt("readFileSync"),NR=dt("access"),PR=dt("readFile"),MR=dt("writeFile"),FR=dt("appendFile"),DR=dt("mkdir"),zR=dt("mkdtemp"),UR=dt("rename"),BR=dt("unlink"),WR=dt("rm"),GR=dt("stat"),VR=dt("copyFile"),HR=dt("readdir"),qR=dt("createReadStream"),KR=dt("createWriteStream"),YR=()=>!1,XR=(...e)=>e.join("/"),JR=e=>String(e).replace(/\/[^/]*$/,""),QR=(...e)=>e.join("/"),ZR=e=>String(e).startsWith("/"),eT=e=>String(e).split("/").pop(),tT="/",nT=e=>String(e),sT=dt("randomBytes"),oT=dt("spawnSync"),rT=dt("createInterface"),iT=()=>"/tmp",aT={}});var cT,ri,ed=O(()=>{cT=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ri=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(cT);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 lT(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function uT(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 me,ho=O(()=>{me=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=nT(n.toml,n.ptr),r=sT(n.toml,s,o);super(`Invalid TOML document: ${t}
87
+ `))}return o}var me,ho=O(()=>{me=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=lT(n.toml,n.ptr),r=uT(n.toml,s,o);super(`Invalid TOML document: ${t}
88
88
 
89
- ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function Ma(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
89
+ ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function za(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,l=0;for(let c=t;c<e.length;c++)if(n=e[c],r&&(n===`
92
92
  `||n==="\r"&&e[c+1]===`
93
93
  `))l=l&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new me("control characters are not allowed in strings",{toml:e,ptr:c});if((!l||l===3)&&n===s&&(!r||e[c+1]===s&&e[c+2]===s))return r&&(e[c+3]===s&&c++,e[c+3]===s&&c++),[l?i:i+e.slice(a,c),c+(r?3:1)];if(!l)!o&&n==="\\"&&(i+=e.slice(a,a=c),l=1);else if(l===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++,c++){let p=e.charCodeAt(c+1),h=p>=48&&p<=57?p-48:p>=65&&p<=70?p-65+10:p>=97&&p<=102?p-97+10:-1;if(h<0)throw new me("invalid non-hex character in unicode escape",{toml:e,ptr:c+1});u=u<<4|h}if(u<0||u>1114111||u>=55296&&u<=57343)throw new me("invalid unicode escape",{toml:e,ptr:c});i+=String.fromCodePoint(u),a=c+1,l=0}else if(n===" "||n===" ")l=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 me("unrecognized escape sequence",{toml:e,ptr:c});a=c+1,l=0}else if(n!==" "&&n!==" "){if(l===2)throw new me("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});l=!o&&n==="\\"?1:0,a=c}}throw new me("unfinished string",{toml:e,ptr:t})}function Qg(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=oT.test(e);if(o||rT.test(e)){if(iT.test(e))throw new me("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new me("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new me("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new oi(e);if(!r.isValid())throw new me("invalid value",{toml:t,ptr:n});return r}var oT,rT,iT,Ku=O(()=>{qu();ho();oT=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,rT=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,iT=/^[+-]?0[0-9_]/});function Fa(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 me("unrecognized escape sequence",{toml:e,ptr:c});a=c+1,l=0}else if(n!==" "&&n!==" "){if(l===2)throw new me("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});l=!o&&n==="\\"?1:0,a=c}}throw new me("unfinished string",{toml:e,ptr:t})}function cb(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=dT.test(e);if(o||pT.test(e)){if(fT.test(e))throw new me("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new me("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new me("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new ri(e);if(!r.isValid())throw new me("invalid value",{toml:t,ptr:n});return r}var dT,pT,fT,td=O(()=>{ed();ho();dT=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,pT=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,fT=/^[+-]?0[0-9_]/});function Ua(e,t=0,n=e.length){let s=e.indexOf(`
95
95
  `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function ar(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 me("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
- `);)t++;if(s||o!=="#")break;t=ar(e,t)}return t}function Zg(e,t,n,s,o=!1){if(!s)return t=Fa(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=Fa(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
99
+ `);)t++;if(s||o!=="#")break;t=ar(e,t)}return t}function lb(e,t,n,s,o=!1){if(!s)return t=Ua(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=Ua(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 me("cannot find end of structure",{toml:e,ptr:t})}var Da=O(()=>{ho();});function aT(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(ar(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ri(e,t,n,s,o){if(s===0)throw new me("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[l,c]=r==="["?tb(e,t,s,o):eb(e,t,s,o);if(n){if(c=zn(e,c),e[c]===",")c++;else if(e[c]!==n)throw new me("expected comma or end of structure",{toml:e,ptr:c})}return[l,c]}if(r==='"'||r==="'"){let[l,c]=Ma(e,t);if(n){if(c=zn(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
102
- `&&e[c]!=="\r")throw new me("unexpected character encountered",{toml:e,ptr:c});e[c]===","&&c++}return[l,c]}let i=Zg(e,t,",",n),a=aT(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new me("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++),[Qg(a[0],e,t,o),i]}var Yu=O(()=>{Ku();Xu();Da();ho();});function za(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new me("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 me("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,l]=Ma(e,t);s=e.indexOf(".",l);let c=e.slice(l,s<0||s>r?r:s),u=Fa(c);if(u>-1)throw new me("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(c.trimStart())throw new me("found extra tokens after the string part",{toml:e,ptr:l});if(r<l&&(r=e.indexOf(n,l),r<0))throw new me("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(!cT.test(a))throw new me("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 eb(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new me("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=ar(e,t);else if(i!==" "&&i!==" "&&i!==`
103
- `&&i!=="\r"){let a,l=o,c=!1,[u,d]=za(e,t-1);for(let h=0;h<u.length;h++){if(h&&(l=c?l[a]:l[a]={}),a=u[h],(c=Object.hasOwn(l,a))&&(typeof l[a]!="object"||r.has(l[a])))throw new me("trying to redefine an already defined value",{toml:e,ptr:t});!c&&a==="__proto__"&&Object.defineProperty(l,a,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new me("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=ri(e,d,"}",n-1,s);r.add(f),l[a]=f,t=p}}if(!i)throw new me("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function tb(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new me("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=ar(e,t);else if(r!==" "&&r!==" "&&r!==`
104
- `&&r!=="\r"){let i=ri(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new me("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var cT,Xu=O(()=>{Ku();Yu();Da();ho();cT=/^[a-zA-Z0-9-_]+[ \t]*$/});function nb(e,t,n,s){let o=t,r=n,i,a=!1,l;for(let c=0;c<e.length;c++){if(c){if(o=a?o[i]:o[i]={},r=(l=r[i]).c,s===0&&(l.t===1||l.t===2))return null;if(l.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[c],(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:c<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(l=r[i],l.t!==s&&!(s===1&&l.t===3)||(s===2&&(l.d||(l.d=!0,o[i]=[]),o[i].push(o={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,l.c]}function mo(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 l=e[++a]==="[",c=za(e,a+=+l,"]");if(l){if(e[c[1]-1]!=="]")throw new me("expected end of table declaration",{toml:e,ptr:c[1]-1});c[1]++}let u=nb(c[0],s,o,l?2:1);if(!u)throw new me("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=c[1]}else{let l=za(e,a),c=nb(l[0],r,i,0);if(!c)throw new me("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ri(e,l[1],void 0,t,n);c[1][c[0]]=u[0],a=u[1]}if(a=zn(e,a,!0),e[a]&&e[a]!==`
105
- `&&e[a]!=="\r")throw new me("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=zn(e,a)}return s}var sb=O(()=>{Xu();Yu();Da();ho();});var ob=O(()=>{});var Ua=O(()=>{sb();ob();qu();ho();});var ab={};Wt(ab,{CONFIG_FILE:()=>Wa,loadTomlConfig:()=>Ga,mergeEffective:()=>ib,normalizeConfig:()=>rb});async function Ga(e,{file:t}={}){let n=t||Z(e,Wa),s;try{s=await _e(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return mo(s)}catch(o){throw new Error(`Invalid ${Wa} at ${n}: ${o&&o.message?o.message:o}`)}}async function lT(e,t){let n;if(Array.isArray(e))n=e;else{let o=Nt(t,String(e));n=(await _e(o,"utf8")).split(`
106
- `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Nt(t,r))}return s}async function rb(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await lT(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Nt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Nt(s,String(n.graph_file))),n.graph_files!==void 0){let w=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=w.map(v=>Nt(s,String(v)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},l={};a.enabled!==void 0&&(l.enabled=a.enabled),a.limit!==void 0&&(l.limit=a.limit),a.capture_unknown_context!==void 0&&(l.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(l.unknownContextLimit=a.unknown_context_limit),Object.keys(l).length&&(o.seed=l),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.discourse!==void 0&&(o.discourse=n.discourse);let c=n.index||{},u={};c.languages!==void 0&&(u.languages=c.languages),c.exclude!==void 0&&(u.exclude=c.exclude),c.secret_exclude!==void 0&&(u.secretExclude=c.secret_exclude),c.history_depth!==void 0&&(u.historyDepth=c.history_depth),c.include_text!==void 0&&(u.includeText=c.include_text),c.include_structure!==void 0&&(u.includeStructure=c.include_structure),c.respect_gitignore!==void 0&&(u.respectGitignore=c.respect_gitignore),c.markdown_sections!==void 0&&(u.markdownSections=c.markdown_sections),c.vue!==void 0&&(u.vue=c.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},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||{},h={};p.strategy!==void 0&&(h.strategy=p.strategy),p.nodes!==void 0&&(h.nodes=p.nodes),p.q!==void 0&&(h.q=p.q),p.depth!==void 0&&(h.depth=p.depth),Object.keys(h).length&&(f.expansion=h),Object.keys(f).length&&(o.tune=f);let m=n.telemetry||{};m.enabled!==void 0&&(o.telemetry={enabled:m.enabled});let b=n.memory||{},g={};b.retention_versions!==void 0&&(g.retentionVersions=b.retention_versions),b.backend!==void 0&&(g.backend=b.backend),Object.keys(g).length&&(o.memory=g);let y=[];for(let[w,v]of uT)n[w]&&n[w][v]!==void 0&&y.push(`${w}.${v}`);return o.unwired=y,o}function Ba(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:Ba(o,r,n)}return n}function ib({args:e={},toml:t=null,defaults:n={}}={}){let s=Ba(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Ba(o):{},i=Ba(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),l={},c={};for(let u of a)u in i?(l[u]=i[u],c[u]="arg"):u in r?(l[u]=r[u],c[u]="tmct.toml"):(l[u]=s[u],c[u]="default");return{effective:l,sources:c}}var Wa,uT,Va=O(()=>{Rt();Ue();Ua();Wa="tmct.toml";uT=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ds={};Wt(Ds,{CANONICALISED_FROM_PROP:()=>ud,CAPABLE_OF_PREDICATE:()=>$A,CHAIN_KEEP_DEPTH:()=>Cg,CHAIN_ROLLUP_THRESHOLD:()=>ka,CREATED_AT_PROP:()=>Qe,DEFAULT_RETENTION:()=>nd,FACT_CLASS:()=>pt,GROUP_ROLLUP_THRESHOLD:()=>Ag,HAS_A_PREDICATE:()=>hr,IN_REPLY_TO_PROP:()=>ld,MEMORY_DIR_REL:()=>lr,MEMORY_GRAPH_REL:()=>rd,MEMORY_MANIFEST_REL:()=>Tb,MEMORY_SESSION_CLASS:()=>ad,MULTI_VALUED_PREDICATES:()=>vA,NODE_ID_REL:()=>md,OPERATOR_SOURCE_ID:()=>Ha,RETRACTED_AT_PROP:()=>Aa,RETRACTED_COUNT_PROP:()=>Mu,RETRACTED_RECORD_IDS_PROP:()=>Ta,RETRACTION_CLASS:()=>rn,RETRACTION_PREDICATE:()=>Ra,ROLLUP_COUNT_PROP:()=>Zr,ROLLUP_EARLIEST_PROP:()=>Fn,ROLLUP_KEEP_PER_TYPE:()=>Ig,ROLLUP_LATEST_PROP:()=>Dn,ROLLUP_PRIOR_PROP:()=>rr,ROLLUP_RECORD_IDS_PROP:()=>Qr,ROLLUP_SOURCE_IDS_PROP:()=>or,RULE_CLASS:()=>dr,RULE_KIND_ACTION_CONSTRAINT:()=>xd,RULE_KIND_ACTION_EFFECT:()=>hi,RULE_KIND_ACTION_PRECOND:()=>Qa,RULE_KIND_ACTION_SIGNATURE:()=>vd,RULE_KIND_COMPOSE2:()=>pi,RULE_KIND_FILTER:()=>fi,RULE_KIND_PROP:()=>fr,RULE_KIND_RECURSIVE:()=>$d,SAID_IN_SESSION_PROP:()=>cd,SOURCE_CLASS:()=>ur,SOURCE_RELIABILITY_PROP:()=>db,STATED_BY_PROP:()=>mn,SYLLOGISE_STATE_REL:()=>hd,UPDATED_AT_PROP:()=>ks,UTTERANCE_CLASS:()=>id,admittedNodes:()=>Na,appendCanonicalisedFromEdges:()=>sA,appendFact:()=>aA,appendFacts:()=>Gn,appendRetractions:()=>gA,appendRule:()=>ec,appendUtterance:()=>nA,appendUtterances:()=>Pb,applySeedPayload:()=>hb,attachFactHeads:()=>xb,chainRollupIdFor:()=>Iu,cloneMemoryPayload:()=>mb,closeSqliteMemoryStore:()=>jb,createInMemoryStore:()=>ui,createSqliteMemoryStore:()=>kb,emptyMemory:()=>li,factGroupId:()=>Ft,factHeadsOf:()=>Eb,factIdForTriple:()=>ge,factRecordIdForTag:()=>mT,factRecordIdsFor:()=>bo,findContradictions:()=>Gb,findRuleByName:()=>Ed,findRulesByName:()=>pA,headRollupIdFor:()=>Au,isChainRollupId:()=>ir,isHeadRollupId:()=>Ns,isMemoryOrSqliteHandle:()=>pd,isRetractionId:()=>Du,isRollupId:()=>ja,loadMemory:()=>ft,loadNodeId:()=>GT,loadSyllogiseState:()=>BT,normFactPredicate:()=>ps,normFactTerm:()=>V,openConfiguredMemoryBackend:()=>Fs,openExistingMemoryBackend:()=>jT,openMemoryBackend:()=>fd,peersToConvince:()=>Gu,provSourceClassFor:()=>qT,provenanceTagToSource:()=>Zn,readFactRows:()=>Et,readObjectSupersessions:()=>ET,readOnlyMemorySnapshot:()=>_T,readRetractions:()=>mA,readRuleRows:()=>Sd,removeFacts:()=>hA,resolveMemoryGraphFile:()=>ii,resolveRelationChase:()=>kd,resolveRelationChaseReverse:()=>Wb,retirableRetractions:()=>bA,retireRetractions:()=>wA,retractedAtOf:()=>fo,retractedRecordIds:()=>po,retractionFromWire:()=>La,retractionIdFor:()=>Fu,retractionScopeOf:()=>zu,retractionWireFact:()=>Oa,saveNodeId:()=>VT,saveSyllogiseState:()=>WT,snapshotMemory:()=>MT,stableRecordIds:()=>Pa});function li(){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:fT.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function ii(e,t=null){if(Ms(e)||Bn(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?Z(e,rd):Z(e,lr,`graph.v${t}.json`)}function Ms(e){return!!e&&typeof e=="object"&&e.backend===dd}function Bn(e){return!!e&&typeof e=="object"&&e.backend===fb}function pd(e){return Ms(e)||Bn(e)}function ui(){return{backend:dd,payload:li()}}function hb(e,t){t&&(e.payload={...e.payload,...t})}function mb(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function gb(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=bd(Zn(t));if(n)return n}return{id:ms,type:""}}function Ft(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function mT(e,t){return`${e}@${bb(t).id}`}function bb(e){return bd(Zn(e))||{id:ms,type:""}}function wb(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=bb(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(ms,{sourceId:ms,sourceType:"",tags:[]}),[...t.values()]}function ed(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Zn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function pr(e,t="",n=Math.max){return ed(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function gT(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 yb(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=gb(n("mgx:factProvenance")),o=n(di).split(" ").filter(Boolean)[0]||null,r=ei(e.id);return[e.id,Ft(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(go)||s.id,r||s.type,Number(n(r?rr:Mo))||0,n(Qe),n(ai)||null,o,t]}function bT(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(pt))return;let t=e.prepare($b);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(pt))t.run(...yb(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function wT(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function xb(e,t){return e&&t&&(e[vb]=t),e}function $T(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 Sb(e,t,n,s){let o=e.prepare(yT),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=gs();for(let a of n){let l=t.groups.get(a);if(!l?.length){r.run(a),s?.delete(a);continue}let c=wT(_d(a,l,t).assertions),u=Pf(c).score;o.run(a,u,JSON.stringify(c),i),s?.set(a,{trustBase:u,inputs:c})}}function vT(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(pt))return;let n=jd(_b(e));t.exec("BEGIN IMMEDIATE");try{Sb(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function xT(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=gs();for(let i of n){let[a,l]=i.split("\0");if(Ea(l)!==Jr)continue;let c=t.groupsByPair.get(i)||[];if(c.length<2)continue;let u=c.map(p=>{let h=_d(p,t.groups.get(p),t);return h.trust=Di(h.assertions).score,h});if(new Set(u.map(p=>p.object)).size<2)continue;let d=Tu(u,Jr)?.winner?.id;if(!d)continue;let f=s.get(a,l);f?.to_id!==d&&o.run(a,l,(f?.ord??-1)+1,f?.to_id||"",d,r)}}function ET(e,{subject:t,predicate:n}={}){if(!Bn(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 kT(){if(lb)return;lb=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function kb(e){kT();let{DatabaseSync:t}=await Promise.resolve().then(()=>(Jg(),Xg)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(hT),bT(n);let s={backend:fb,db:n,dbPath:e};return vT(s),s}function jb(e){Bn(e)&&e.db.close()}async function fd(e,t){if(t===dd)return{dir:ui(),close:async()=>{}};let n=Z(e,".tmct","memory","graph.sqlite"),s=r=>qc(r).then(()=>!0,()=>!1);!await s(n)&&await s(Z(e,rd))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
- `),await An(he(n),{recursive:!0});let o=await kb(n);return{dir:o,close:async()=>jb(o)}}async function jT(e,t=""){if(!e||typeof e!="string")return null;let n=Z(e,".tmct","memory","graph.sqlite");try{await qc(n)}catch{return null}return fd(e,t)}async function _T(e){if(!e)return null;let t=ui();return hb(t,mb(await ft(e))),t}async function Fs(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Va(),ab));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return fd(e,n)}function RT(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=_b(e),e.cachedFactHeads=$T(e.db),e.cachedDataVersion=t),xb(jn(e.cachedPayload),e.cachedFactHeads)}function _b(e){let t=e.db,n=li(),s=(a,l)=>{let c=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return c?JSON.parse(c.v):l},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(l=>{let c={subject:l.subject,object:l.object,subjectLabel:l.subject_label,objectLabel:l.object_label};return l.extra&&Object.assign(c,JSON.parse(l.extra)),c})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function TT(e,t){let n=jn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function AT(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function IT(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 CT(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,jn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function OT(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function LT(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function NT(e,t){let n=e.db,s=li(),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=jn(t.generated_at??s.generated_at),o.memory=jn(t.memory??s.memory),o.prefixes=jn(t.prefixes??s.prefixes),o.vocabulary=jn(t.vocabulary??s.vocabulary),o.classes=jn(t.classes??s.classes),o.proseIndex=jn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),l=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,c=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare($b),d=new Set,f=new Set,p=new Set;for(let S of t.individuals||[]){d.add(S.id);let R=JSON.stringify(S),_=i.get(S.id);if(_&&_.json===R)continue;let I=_?_.ord:l++;c.run(S.id,I,S.class??null,S.label??null,R),S.class===pt&&(u.run(...yb(S,R)),f.add(Ft(S.id)),p.add(td(ci(S,"subject"),ci(S,"predicate")))),o&&TT(o,S)}let h=n.prepare("DELETE FROM individuals WHERE id = ?"),m=n.prepare("DELETE FROM facts WHERE id = ?"),b=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let S of n.prepare("SELECT id FROM individuals").all()){if(d.has(S.id))continue;let R=b.get(S.id);R&&(f.add(R.triple_hash),p.add(td(R.subject,R.predicate))),h.run(S.id),m.run(S.id)}o&&AT(o,d);let g=n.prepare("SELECT ord FROM relations WHERE prop = ?"),w=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,v=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),k=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),$=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),x=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),E=new Set;for(let S of t.objectProperties||[]){E.add(S.prop);let R=k.all(S.prop),_=new Map(R.map(U=>[`${U.subject}\0${U.object}`,U])),I=new Set,P=o?IT(o,S.prop):null;for(let U of S.examples||[]){let K=`${U.subject}\0${U.object}`;I.add(K);let ce=Object.keys(U).filter(W=>!ST.has(W)),ie=ce.length?JSON.stringify(Object.fromEntries(ce.map(W=>[W,U[W]]))):null,D=_.get(K);D&&(D.subject_label??null)===(U.subjectLabel??null)&&(D.object_label??null)===(U.objectLabel??null)&&(D.extra??null)===(ie??null)||($.run(S.prop,U.subject,U.object,U.subjectLabel??null,U.objectLabel??null,ie),P&&CT(P,U,ce))}for(let U of _.keys()){if(I.has(U))continue;let[K,ce]=U.split("\0");x.run(S.prop,K,ce)}P&&OT(P,I);let T=Number.isFinite(S.count)?S.count:(S.examples||[]).length,F=g.get(S.prop)?.ord??w++;v.run(S.prop,F,S.predicate??null,T),P&&(P.predicate=S.predicate??null,P.count=T)}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&&LT(o,E),f.size){let S=jd(t);Sb(n,S,f,e.cachedFactHeads),xT(n,S,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Rb(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Er(n,t),await Ii(n,e)}async function Ya(e,t){await Rb(e,JSON.stringify(t))}async function MT(e,{retentionVersions:t}={}){if(pd(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=ii(e),s;try{s=await _e(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=PT(e),r;try{r=JSON.parse(await _e(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??nd}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??nd);let i=r.version,a=ii(e,i);await An(he(a),{recursive:!0}),await Rb(a,s),r.version=i+1;let l=null,c=i-r.retentionVersions;if(c>=0)try{await Kc(ii(e,c)),l=c}catch(u){if(u?.code!=="ENOENT")throw u}return await Ya(o,r),{skipped:!1,version:i,prunedVersion:l}}async function ft(e){if(Ms(e))return Ju(e.payload);if(Bn(e))return Ju(RT(e));let t;try{t=await _e(Zu(e),"utf8")}catch(n){if(n?.code==="ENOENT")return li();throw n}return Ju(JSON.parse(t))}function DT(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==pt||!FT.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 zT(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(l=>l?.prop===mn),n=new Map;for(let l of t?.examples||[]){if(!l?.subject)continue;let c=n.get(l.subject);c?c.push(l):n.set(l.subject,[l])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let l of e.individuals){if(l?.class!==pt||String(l.id||"").includes("@")){a.push(l);continue}let c=w=>(l.attributes||[]).find(v=>v?.prop===w)?.value||"",u=c("rdf:subject"),d=c("rdf:predicate"),f=c("rdf:object");if(!u||!d||!f){a.push(l);continue}let p=Jo(u,d,f),h=c(Qe),m=c("mgx:factProvenance"),b=n.get(l.id)||[],g=m?wb(m):[];for(let w of b)g.some(v=>v.sourceId===w.object)||g.push({sourceId:w.object,sourceType:"",tags:[]});g.length||g.push({sourceId:ms,sourceType:"",tags:[]});let y=[];for(let w of g){let v={id:`${p}@${w.sourceId}`,label:l.label,class:pt,derived_from:jn(l.derived_from)||[],mentions:jn(l.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:f},{prop:Qe,key:"createdAt",value:pr(w.tags,h,Math.min)||h||gs()},{prop:go,key:"sourceId",value:w.sourceId},...w.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:w.tags.join(" | ")}]:[],...c("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:c("mgx:hasProseTokens")}]:[],...c("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:c("mgx:factQuantifier")}]:[],...w.sourceType==="entailed"&&c("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:c("mgx:factJustification")}]:[]]};if(a.push(v),r.push(v),y.push(v.id),w.sourceId!==ms){let k=b.find($=>$?.object===w.sourceId);i.push({...k||{},subject:v.id,object:w.sourceId,subjectLabel:v.label,objectLabel:wd(w.sourceId)})}}s.add(l.id),o.set(l.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(l=>!s.has(l?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:mn,count:i.length,examples:i}));for(let l of e.objectProperties||[]){if(l?.prop===mn||!l?.examples?.length)continue;let c=[];for(let u of l.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 h of f)c.push({...u,subject:p,object:h})}l.examples=c,l.count=c.length}e.individuals=a,Cb(e);for(let l of r)cr(e,l);return Wn(e),e}async function UT(e,t){if(Ms(e)){e.payload=t;return}if(Bn(e)){NT(e,t);return}await An(he(Zu(e)),{recursive:!0}),await Ya(Zu(e),t)}async function BT(e){if(Ms(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(Bn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Ab);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await _e(Z(e,hd),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function WT(e,t){if(Ms(e)){e.syllogiseState=structuredClone(t);return}if(Bn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Ab,JSON.stringify(t));return}let n=Z(e,hd);await An(he(n),{recursive:!0}),await Ya(n,t)}async function GT(e){if(Ms(e))return e.nodeId||null;if(Bn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Ib);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await _e(Z(e,md),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function VT(e,t){if(Ms(e)){e.nodeId=t;return}if(Bn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Ib,JSON.stringify({nodeId:t}));return}let n=Z(e,md);await An(he(n),{recursive:!0}),await Ya(n,{nodeId:t})}function Cb(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===ur&&n.set(a.id,a),a.class===rn&&od(r,a),a.class===pt)){let l=Ft(a.id),c=o.get(l);c?c.push(a.id):o.set(l,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===mn);for(let a of i?.examples||[]){if(!a?.subject)continue;let l=s.get(a.subject);l?l.push(a.object):s.set(a.subject,[a.object])}return e[sd]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[sd]}function od(e,t){let n=Ft(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function HT(e,t){let n=Dt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===rn&&Ft(s.id)===t)}async function ws(e,t){let n=await ft(e);Cb(n);let s=await t(n)??n;return JT(s),ZT(s),s.proseIndex=Sf(s.individuals),await UT(e,s),s}function gd(e,t){return e?.attributes?.find(n=>n?.prop===Qe)?.value||t||gs()}function gn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function bd(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Ha}:${e.sessionId}`:Ha,type:"operator"};case"teach":return{id:e.sessionId?`${Qu}:${e.sessionId}`:Qu,type:"teach"};case"teachNode":return{id:`${pb}:${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:${Kr(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 qT(e){return rl[e]||null}function KT(e,t,n){let s=bd(t);if(!s)return null;let o=Dt(e),r=o?o.individualsById.get(s.id):e.individuals.find(c=>c?.id===s.id),i=gd(r,t?.createdAt||n),a={id:s.id,label:wd(s.id),class:ur,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:Qe,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},l=bs(e,a);return o&&o.sourcesById.set(s.id,l),s.id}function Ja(e){let t=Dt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===ur&&(n[s.id]=s);return n}function Ob(e,t){let n=Dt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===mn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function YT(e,t,n=Date.now(),s={}){let o=Ob(e,t.id),r=(t.attributes||[]).find(l=>l?.prop===Qe)?.value||"",{score:i,inputs:a}=Nf({sourceIds:o,createdAt:r},Ja(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});gn(t,Mo,"trustScore",String(i)),gn(t,Mi,"trustInputs",JSON.stringify(a)),gn(t,ks,"updatedAt",new Date(n).toISOString())}function XT(e,t,n=Date.now(),s={}){let[o]=Ob(e,t.id),r=o?Ja(e)[o]:null,i=(r?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||"",a=Fi(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let c=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*c))}let l=(t.attributes||[]).find(c=>c?.prop===Qe)?.value||"";gn(t,Mo,"trustScore",String(a)),gn(t,Mi,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:l})),gn(t,ks,"updatedAt",new Date(n).toISOString())}function Lb(e,t,n,s){t?.class===pt?XT(e,t,n,s):YT(e,t,n,s)}function cr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===Qe)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Zn(i);if(!a)continue;let l=KT(e,a,r);l&&Ka(e,{predicate:"statedBy",prop:mn},{subject:t.id,object:l,subjectLabel:t.label,objectLabel:wd(l)})}Lb(e,t,n,s)}function JT(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===mn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==pt||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(cr(e,r,o),s=!0);s&&Wn(e)}function ZT(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=Et(e),n=new Set;for(let a of Gb(e))for(let l of a)n.add(l.id);let s=new Map;for(let a of t)for(let l of a.sourceIds){if(!QT(l))continue;let c=s.get(l)||{factsAsserted:0,factsContradicted:0};c.factsAsserted+=1,n.has(a.id)&&(c.factsContradicted+=1),s.set(l,c)}if(!s.size)return;let o=Dt(e);for(let[a,l]of s){let c=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);c&&(gn(c,db,"sourceReliability",String(Mf(l))),gn(c,ks,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===mn),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let l=o?o.individualsById.get(a):e.individuals.find(c=>c?.id===a);l&&Lb(e,l)}}function eA(e,t,n){if(!ja(n?.id))return n;let s=ei(n.id);if(!s)return Nu(t,n);let o=Ja(e);return Nu(t,n,{priorFor:r=>Fi(s,o[r])})}function ub(e,t,n){return n?.class===rn?Vg(t,n):eA(e,t,n)}function bs(e,t){let n=Dt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,ub(e,o,t)),o.class===rn&&od(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===rn&&od(n.retractionsByGroup,t),t.class===pt){let r=Ft(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]=ub(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Ka(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(l=>l?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===mn?Dt(e):null;if(r){let l=r.statedByBySubject.get(s.subject);if(!l||!l.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||gs()}),o.count=o.examples.length,l?l.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(l=>l?.subject===s.subject&&l?.object===s.object)?.createdAt||s.createdAt||gs();if(o.examples=(o.examples||[]).filter(l=>!(l?.subject===s.subject&&l?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let l=r.statedByBySubject.get(s.subject)||[];l.includes(s.object)||l.push(s.object),r.statedByBySubject.set(s.subject,l)}}function Wn(e){let t=[ad,id,pt,ur,dr];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 tA(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:ad,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Qe,key:"createdAt",value:n||gs()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Nb(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:l=""}){if(!pT.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let c=String(s||""),u=ds(n),d=`utt:${o}#${c}#${t}`,f=Xa(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=Pi({doc:u}),h=e.individuals.find(y=>y?.id===d),m=gd(h,l||c),b={id:d,label:f,class:id,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:c},{prop:Qe,key:"createdAt",value:m},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...p.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:p.join(" ")}]:[]]};bs(e,b);let g=tA(e,o,r);if(Ka(e,{predicate:"saidInSession",prop:cd},{subject:d,object:g,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&Ka(e,{predicate:"inReplyTo",prop:ld},{subject:d,object:a,subjectLabel:f,objectLabel:y.label})}return c&&c>String(e.generated_at||"")&&(e.generated_at=c),d}async function nA(e,t){let n;return await ws(e,s=>{n=Nb(s,t),Wn(s)}),{id:n}}async function Pb(e,t){let n=[];return t?.length?(await ws(e,s=>{for(let o of t)n.push(Nb(s,o));Wn(s)}),{ids:n}):{ids:n}}async function sA(e,t){t?.length&&await ws(e,n=>{for(let s of t)for(let o of bo(n,s.factId))Ka(n,{predicate:"canonicalisedFrom",prop:ud},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function bo(e,t){let n=Dt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===pt&&Ft(s.id)===t).map(s=>s.id)}function Mb(e,t,n,s=""){let o=wb(n);if(o.length===1&&o[0].sourceId===ms&&bo(e,t).length)return[];let r=HT(e,t);if(r.length&&(o=o.filter(a=>!Ca(r,`${t}@${a.sourceId}`,pr(a.tags,s))),!o.length))return o;let i=oA(e,t);return i.length?o.filter(a=>!Ug(i,a.sourceId)):o}function oA(e,t){let n=Dt(e),s=n?n.factRecordsByGroup.get(t):bo(e,t),o=[];for(let r of s||[]){if(!Ns(r))continue;let i=Ps(e,r);i&&o.push(i)}return o}function Fb(e,t,{quantifier:n,environments:s}){let o=bo(e,t).map(i=>Ps(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===di)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(l=>l?.prop==="mgx:factJustification"));for(let a of i.length?i:o)gn(a,"mgx:factJustification","justification",s.map(l=>l.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(gn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function rA(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===qa)?.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 Db(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:l,createdAt:c,observedAt:u,quantifier:d,environments:f}=t,p=`${n}@${l.sourceId}`,h=Dt(e),m=h?h.individualsById.get(p):e.individuals.find(R=>R?.id===p),b=R=>(m?.attributes||[]).find(_=>_?.prop===R)?.value||"",g=b("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:ed(l.tags),observedAt:u},w=null,v=l.tags,k=y.assertedAt||c||gs(),$=u,x=[],E=d;if(m){let R={assertedAt:ed(g),observedAt:b(ai)};gT(y,R)?(w={head:m,id:`${p}#v${rA(m)}`},x=[w.id]):(v=[...new Set([...g,...l.tags])],k=b(Qe)||k,$=u||b(ai),x=b(qa).split(" ").filter(Boolean)),E=d||b("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:pt,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:Qe,key:"createdAt",value:k},{prop:go,key:"sourceId",value:l.sourceId},...v.length?[{prop:"mgx:factProvenance",key:"provenance",value:v.join(" | ")}]:[],...$?[{prop:ai,key:"observedAt",value:$}]:[],...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(R=>R.join(" ")).join(" | ")}]:[],...x.length?[{prop:qa,key:"supersedes",value:x.join(" ")}]:[]]},demote:w}}function iA(e,t){let n=`${t}@${ms}`,s=Dt(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 zb(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${ms}`)||iA(e,Ft(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};gn(o,di,"supersededBy",t.id),bs(e,o),s.push(o.id)}return bs(e,t),s.push(t.id),s}function Ps(e,t){let n=Dt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function yd(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=Dt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Ft(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Ub(e,t){let n=Dt(e),s=(n?n.factRecordsByGroup.get(t):bo(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=Ps(e,u);if(!d)continue;let f=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(Ns(u)){i.set(ei(u),d);continue}if(ir(u)){a.set(f(go),d);continue}let p=f("mgx:factProvenance"),h=gb(p),m=p.split(" | ").filter(Boolean),b={id:u,sourceId:f(go)||h.id,assertedAt:pr(m,f(Qe)),record:d};if(f(di)){let y=r.get(b.sourceId);y?y.push(b):r.set(b.sourceId,[b]);continue}if(!h.type)continue;let g=o.get(h.type);g?g.push(b):o.set(h.type,[b])}let l=Ja(e),c=[];for(let[u,d]of o){let f=Dg({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>Fi(u,l[p])});if(f){bs(e,f.rollup),c.push(...f.absorbed);for(let p of f.absorbedSourceIds){for(let m of r.get(p)||[])c.push(m.id);r.delete(p);let h=a.get(p);h&&c.push(h.id),a.delete(p)}}}for(let[u,d]of r){let f=zg({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;bs(e,f.rollup),c.push(...f.absorbed);let p=Ps(e,f.rewire);p&&gn(p,qa,"supersedes",f.rollup.id)}return c}async function aA(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:l,ruleConfidence:c}={}){let u=V(t),d=ps(n),f=V(s);if(!u||!d||!f)throw new Error("a fact needs subject, predicate and object");let p=Jo(u,d,f),h=`${u} ${d} ${f}`,m=Pi({doc:h}),b=ds(a);return await ws(e,async g=>{let y=Mb(g,p,ds(o),r);for(let w of y.length?[]:Fb(g,p,{quantifier:b}))cr(g,Ps(g,w),void 0,{premiseTrusts:l,ruleConfidence:c});for(let w of y){let v=Db(g,{groupId:p,s:u,p:d,o:f,label:Xa(h),tokens:m,group:w,createdAt:r,observedAt:i,quantifier:b});await Hu(v.candidate);for(let k of zb(g,v))cr(g,Ps(g,k),void 0,k===v.candidate.id?{premiseTrusts:l,ruleConfidence:c}:void 0)}yd(g,Ub(g,p)),Wn(g)}),{id:p}}function cA(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 Gn(e,t){let n=[],s=0;for(let r of t||[]){let i=V(r?.subject),a=ps(r?.predicate),l=V(r?.object);if(!i||!a||!l){s+=1;continue}let c=`${i} ${a} ${l}`;n.push({id:Jo(i,a,l),s:i,p:a,o:l,text:c,tokens:Pi({doc:c}),provenance:ds(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:ds(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:cA(r?.justification)})}let o=[];return n.length?(await ws(e,r=>{let i=[],a=new Set,l=new Map;for(let u of n){let d=Mb(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:Fb(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)&&l.set(f,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let f of d){let p=Db(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Xa(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let h of zb(r,p))a.has(h)||(a.add(h),i.push(h));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&l.set(p.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)cr(r,Ps(r,u),void 0,l.get(u));let c=[];for(let u of new Set(o))c.push(...Ub(r,u));yd(r,c),Wn(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function ec(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Bb[n];if(!i)throw new Error(`a rule kind must be one of ${lA.join(", ")}, got ${JSON.stringify(n)}`);let a=V(t);if(!a)throw new Error("a rule needs a name");let l=uA[n]||new Set,c=i.map(([p])=>V(s?.[p])),u=i.filter(([p],h)=>!l.has(p)&&!c[h]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([p])=>p).join(" + ")}`);if(n===hi){let p=c[i.findIndex(([m])=>m==="objectRole")],h=c[i.findIndex(([m])=>m==="value")];if(!p&&!h)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=dA(n,a,c),f=Xa(`${a} = ${n}(${c.join(", ")})`);return await ws(e,async p=>{let h=p.individuals.find(w=>w?.id===d),m=h?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",b=[...new Set([...m.split(" | "),ds(o)].filter(Boolean))],g=gd(h,r),y={id:d,label:f,class:dr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Za,key:"ruleName",value:a},{prop:fr,key:"ruleKind",value:n},...i.map(([w,v],k)=>({prop:v,key:w,value:c[k],skip:!c[k]&&l.has(w)})).filter(w=>!w.skip).map(({skip:w,...v})=>v),{prop:Qe,key:"createdAt",value:g},...b.length?[{prop:"mgx:factProvenance",key:"provenance",value:b.join(" | ")}]:[]]};await Hu(y),bs(p,y),cr(p,p.individuals.find(w=>w?.id===d)),Wn(p)}),{id:d}}function Ed(e,t){let n=V(t);return(e?.individuals||[]).find(s=>s?.class===dr&&(s.attributes||[]).find(o=>o?.prop===Za)?.value===n)}function pA(e,t){let n=V(t),s=o=>(o.attributes||[]).find(r=>r?.prop===fr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===dr&&(o.attributes||[]).find(r=>r?.prop===Za)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Sd(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==dr)continue;let s=a=>(n.attributes||[]).find(l=>l?.prop===a)?.value,o=s(fr),r=Bb[o];if(!r)continue;let i={};for(let[a,l]of r)i[a]=s(l)??"";t.push({id:n.id,name:s(Za)||"",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 kd(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:l,byTrust:c,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:f}=o,p=String(t||"").trim().toLowerCase(),h=l(V,n),m=l(V,s),b=r(p).filter(w=>h.has(w.fact.subject)&&m.has(w.fact.object));if(b.length){let w=b.slice().sort((v,k)=>c(v.fact,k.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let g=Ed(e,p),y=g?.attributes?.find(w=>w.prop===fr)?.value;if(g&&y===pi){let w=g.attributes.find(P=>P.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(P=>P.prop==="mgx:ruleBase2")?.value,k=V(n),$=V(s);if(!w||!v||!k||!$)return null;let R=f({entity:k,hopsTaken:0},P=>P.hopsTaken===2&&P.entity===$,P=>{if(P.hopsTaken>=2)return[];let T=P.hopsTaken===0?w:v;return r(T).filter(F=>F.fact.subject===P.entity).map(F=>({action:F,nextState:{entity:F.fact.object,hopsTaken:P.hopsTaken+1}}))},{maxDepth:2,stateKey:P=>`${P.entity}#${P.hopsTaken}`});if(!R)return null;let _=new Set,I=[];for(let P of R.actions){I.push(i(P.fact));for(let T of P.aliasFacts){let F=T.id||`${T.subject}|${T.predicate}|${T.object}`;_.has(F)||(_.add(F),I.push(`${a(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{citation:I}}if(g&&y===fi){let w=g.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!w||!v)return null;let k=await kd(e,w,n,s,o);if(!k)return null;let $=V(n),x=V(v),E=u.find(S=>S.predicate===d&&S.subject===$&&V(S.object)===x);return E?{citation:[...k.citation,i(E)]}:null}return null}async function Wb(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:l,rows:c,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,f=String(t||"").trim().toLowerCase(),p=a(V,n),h=o(f).filter(g=>p.has(g.fact.object));if(h.length){let g=new Map;for(let y of h)g.has(y.fact.subject)||g.set(y.fact.subject,[]),g.get(y.fact.subject).push(y);return[...g.entries()].map(([y,w])=>{let v=w.slice().sort((k,$)=>l(k.fact,$.fact))[0];return{subject:y,citation:[r(v.fact),...v.aliasFacts.map(k=>`${i(k)}${k.provenance?` (source: ${k.provenance})`:""}`)]}})}let m=Ed(e,f),b=m?.attributes?.find(g=>g.prop===fr)?.value;if(m&&b===pi){let g=m.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,y=m.attributes.find(x=>x.prop==="mgx:ruleBase2")?.value,w=V(n);return!g||!y||!w?[]:d({entity:w,hopsTaken:0},x=>{if(x.hopsTaken>=2)return[];let E=x.hopsTaken===0?y:g;return o(E).filter(S=>S.fact.object===x.entity).map(S=>({action:S,nextState:{entity:S.fact.subject,hopsTaken:x.hopsTaken+1}}))},{maxDepth:2,stateKey:x=>`${x.entity}#${x.hopsTaken}`}).filter(x=>x.node.hopsTaken===2).map(({node:x,path:E})=>{let S=new Set,R=[];for(let _ of E.actions.slice().reverse()){R.push(r(_.fact));for(let I of _.aliasFacts){let P=I.id||`${I.subject}|${I.predicate}|${I.object}`;S.has(P)||(S.add(P),R.push(`${i(I)}${I.provenance?` (source: ${I.provenance})`:""}`))}}return{subject:x.entity,citation:R}})}if(m&&b===fi){let g=m.attributes.find($=>$.prop==="mgx:ruleBase1")?.value,y=m.attributes.find($=>$.prop==="mgx:ruleFilterProperty")?.value;if(!g||!y)return[];let w=await Wb(e,g,n,s),v=V(y),k=[];for(let $ of w){let x=V($.subject),E=c.find(S=>S.predicate===u&&S.subject===x&&V(S.object)===v);E&&k.push({subject:$.subject,citation:[...$.citation,r(E)]})}return k}return[]}function Et(e,t={}){let n=jd(e),s=Eb(e),o=[];for(let[r,i]of n.groups){let a=_d(r,i,n),l=s?.get(r);a.trust=Di(l?l.inputs:a.assertions,t).score,o.push(a)}return o}function jd(e){let t=e?.individuals||[],n=new Map(t.filter(l=>l?.class===ur).map(l=>[l.id,l])),s=(e?.objectProperties||[]).find(l=>l?.prop===mn),o=new Map;for(let l of s?.examples||[])o.has(l.subject)||o.set(l.subject,[]),o.get(l.subject).push(l.object);let r=new Map,i=new Map;for(let l of t){if(l?.class===rn){let d=Ft(l.id),f=i.get(d);f?f.push(l):i.set(d,[l]);continue}if(l?.class!==pt||(l.attributes||[]).some(d=>d?.prop===di)||ir(l.id))continue;let c=Ft(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}for(let[l,c]of i){let u=r.get(l);if(!u)continue;let d=u.filter(f=>!Ca(c,f.id,pr(Un(f,"mgx:factProvenance").split(" | ").filter(Boolean),Un(f,Qe))));d.length!==u.length&&(d.length?r.set(l,d):r.delete(l))}let a=new Map;for(let[l,c]of r){c.sort((f,p)=>f.id<p.id?-1:f.id>p.id?1:0);let u=td(ci(c[0],"subject"),ci(c[0],"predicate")),d=a.get(u);d?d.push(l):a.set(u,[l])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:l=>(n.get(l)?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||""}}function _d(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=Un,i=ci,a=[],l=[],c=[],u=new Set,d=[],f=new Set,p="";for(let b of t){if(Ns(b.id)){let x=ei(b.id),E=_a(b);for(let S of E)l.includes(S)||(l.push(S),x&&c.push(x));a.push({id:b.id,sourceId:"",sourceType:x,provenance:"",createdAt:r(b,Fn),ownTrust:Number(r(b,rr))||0,assertedAt:r(b,Dn),rollup:{count:Number(r(b,Zr))||E.length,sourceIds:E,earliest:r(b,Fn),latest:r(b,Dn)}});continue}let g=r(b,"mgx:factProvenance").split(" | ").filter(Boolean);for(let x of g)u.add(x);let[y]=s.get(b.id)||[],w=y||r(b,go),v=o(w);y&&!l.includes(y)&&(l.push(y),v&&c.push(v));let k=r(b,Qe),$=r(b,ai);a.push({id:b.id,sourceId:w,sourceType:v,provenance:g.join(" | "),createdAt:k,...$?{observedAt:$}:{},ownTrust:Number(r(b,Mo))||0,assertedAt:pr(g,k)}),p=p||i(b,"quantifier");for(let x of i(b,"justification").split(" | ")){let E=x.split(" ").filter(Boolean);if(!E.length)continue;let S=E.join(" ");f.has(S)||(f.add(S),d.push(E))}}let h=[],m=new Set;for(let b of d)for(let g of b)m.has(g)||(m.add(g),h.push(g));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:p,sourceIds:l,sourceTypes:c,environments:d,justification:h,assertions:a}}function fA(e){let t=Un(e,go);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 hA(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||gs();return await ws(e,l=>{let c=new Set,u=new Set,d=new Map;l.individuals=(l.individuals||[]).filter(f=>{if(f?.class!==pt)return!0;let p=Ft(f.id),h=o.has(f.id)?f.id:o.has(p)?p:"";if(!h)return!0;u.add(h),c.add(f.id);let m=fA(f),b=`${p}\0${m}`,g=Un(f,"mgx:factProvenance"),y=d.get(b);return y?(y.ids.push(f.id),g&&y.tags.push(g)):d.set(b,{groupId:p,sourceId:m,ids:[f.id],tags:g?[g]:[],template:{label:f.label||"",subject:Un(f,"rdf:subject"),predicate:Un(f,"rdf:predicate"),object:Un(f,"rdf:object")}}),!1});for(let f of u)r.push(f);if(r.length){for(let f of c)i.push(f);for(let f of l.objectProperties||[]){let p=f.examples||[];f.examples=p.filter(h=>!c.has(h?.subject)&&!c.has(h?.object)),f.count=f.examples.length}for(let f of d.values()){let p=Gg({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&bs(l,p)}Wn(l)}}),{removed:r,records:i}}function mA(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==rn)continue;let s=Oa(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function gA(e,t){let n=[];for(let o of t||[]){let r=La(o);r&&n.push(r)}let s=[];return n.length?(await ws(e,o=>{let r=new Map;for(let a of n){let l=bs(o,a),c=Ft(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}let i=new Set;for(let[a,l]of r)for(let c of bo(o,a)){let u=Ps(o,c);if(!u)continue;let d=Un(u,"mgx:factProvenance").split(" | ").filter(Boolean);Ca(l,c,pr(d,Un(u,Qe)))&&i.add(c)}if(i.size){yd(o,i);for(let a of i)s.push(a)}Wn(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function bA(e,{self:t="",acknowledgedBy:n=null}={}){let s=Na(Et(e)),o=[];for(let r of e?.individuals||[])r?.class===rn&&r.id&&o.push(r.id);return{roster:s,retirable:Pa({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function wA(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await ws(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==rn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Dt(o);if(i)for(let a of r){i.individualsById.delete(a);let l=Ft(a),c=(i.retractionsByGroup.get(l)||[]).filter(u=>!r.has(u.id));c.length?i.retractionsByGroup.set(l,c):i.retractionsByGroup.delete(l)}Wn(o)}),{retired:s}):{retired:s}}function Gb(e,{floor:t=yA}={}){let n=Et(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(Ea(r.predicate)===ju)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=Ea(r[0].predicate);i!==_u&&!Tu(r,i).contested||o.push(r.slice().sort((a,l)=>l.trust-a.trust||a.object.localeCompare(l.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var lr,rd,id,pt,ad,ur,dr,cd,ld,dT,mn,ud,db,Ha,Qu,pb,pT,cb,fT,Zu,dd,fb,hT,ms,ai,go,qa,di,$b,Un,ci,td,vb,Eb,yT,ST,lb,jn,Tb,nd,PT,Ju,FT,hd,Ab,md,Ib,sd,Dt,Xa,gs,wd,QT,pi,fi,$d,vd,Qa,hi,xd,lA,Za,fr,Bb,uA,dA,yA,hr,$A,vA,Be=O(()=>{Rt();Ue();Ss();Yt();Yt();es();Tg();es();xa();Pu();Bu();Vu();Yg();Pu();Bu();Vu();lr=Z(".tmct","memory"),rd=Z(lr,"graph.json"),id="Utterance",pt="Fact",ad="Session",ur="Source",dr="Rule",cd="mgx:saidInSession",ld="mgx:inReplyTo",dT="mgx:derivedFrom",mn="mgx:statedBy",ud="mgx:canonicalisedFrom",db="mgx:sourceReliability",Ha="src:operator-chat",Qu="src:teach-chat",pb="src:teach-node",pT=new Set(["visitor","tmct"]),cb=48,fT=[{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:cd,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:ld,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:Qe,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:ks,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:dT,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:mn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:ud,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:Mo,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:Mi,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:er,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)"}];Zu=e=>ii(e),dd="memory",fb="sqlite";hT=`
101
+ `))return r}}throw new me("cannot find end of structure",{toml:e,ptr:t})}var Ba=O(()=>{ho();});function hT(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(ar(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ii(e,t,n,s,o){if(s===0)throw new me("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[l,c]=r==="["?db(e,t,s,o):ub(e,t,s,o);if(n){if(c=zn(e,c),e[c]===",")c++;else if(e[c]!==n)throw new me("expected comma or end of structure",{toml:e,ptr:c})}return[l,c]}if(r==='"'||r==="'"){let[l,c]=za(e,t);if(n){if(c=zn(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
102
+ `&&e[c]!=="\r")throw new me("unexpected character encountered",{toml:e,ptr:c});e[c]===","&&c++}return[l,c]}let i=lb(e,t,",",n),a=hT(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new me("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++),[cb(a[0],e,t,o),i]}var nd=O(()=>{td();sd();Ba();ho();});function Wa(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new me("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 me("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,l]=za(e,t);s=e.indexOf(".",l);let c=e.slice(l,s<0||s>r?r:s),u=Ua(c);if(u>-1)throw new me("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(c.trimStart())throw new me("found extra tokens after the string part",{toml:e,ptr:l});if(r<l&&(r=e.indexOf(n,l),r<0))throw new me("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(!mT.test(a))throw new me("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 ub(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new me("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=ar(e,t);else if(i!==" "&&i!==" "&&i!==`
103
+ `&&i!=="\r"){let a,l=o,c=!1,[u,d]=Wa(e,t-1);for(let h=0;h<u.length;h++){if(h&&(l=c?l[a]:l[a]={}),a=u[h],(c=Object.hasOwn(l,a))&&(typeof l[a]!="object"||r.has(l[a])))throw new me("trying to redefine an already defined value",{toml:e,ptr:t});!c&&a==="__proto__"&&Object.defineProperty(l,a,{enumerable:!0,configurable:!0,writable:!0})}if(c)throw new me("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=ii(e,d,"}",n-1,s);r.add(f),l[a]=f,t=p}}if(!i)throw new me("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function db(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new me("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=ar(e,t);else if(r!==" "&&r!==" "&&r!==`
104
+ `&&r!=="\r"){let i=ii(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new me("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var mT,sd=O(()=>{td();nd();Ba();ho();mT=/^[a-zA-Z0-9-_]+[ \t]*$/});function pb(e,t,n,s){let o=t,r=n,i,a=!1,l;for(let c=0;c<e.length;c++){if(c){if(o=a?o[i]:o[i]={},r=(l=r[i]).c,s===0&&(l.t===1||l.t===2))return null;if(l.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[c],(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:c<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(l=r[i],l.t!==s&&!(s===1&&l.t===3)||(s===2&&(l.d||(l.d=!0,o[i]=[]),o[i].push(o={}),l.c[l.i++]=l={t:1,d:!1,i:0,c:{}}),l.d))return null;if(l.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,l.c]}function mo(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 l=e[++a]==="[",c=Wa(e,a+=+l,"]");if(l){if(e[c[1]-1]!=="]")throw new me("expected end of table declaration",{toml:e,ptr:c[1]-1});c[1]++}let u=pb(c[0],s,o,l?2:1);if(!u)throw new me("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=c[1]}else{let l=Wa(e,a),c=pb(l[0],r,i,0);if(!c)throw new me("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ii(e,l[1],void 0,t,n);c[1][c[0]]=u[0],a=u[1]}if(a=zn(e,a,!0),e[a]&&e[a]!==`
105
+ `&&e[a]!=="\r")throw new me("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=zn(e,a)}return s}var fb=O(()=>{sd();nd();Ba();ho();});var hb=O(()=>{});var Ga=O(()=>{fb();hb();ed();ho();});var bb={};Gt(bb,{CONFIG_FILE:()=>Ha,loadTomlConfig:()=>qa,mergeEffective:()=>gb,normalizeConfig:()=>mb});async function qa(e,{file:t}={}){let n=t||Z(e,Ha),s;try{s=await _e(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return mo(s)}catch(o){throw new Error(`Invalid ${Ha} at ${n}: ${o&&o.message?o.message:o}`)}}async function gT(e,t){let n;if(Array.isArray(e))n=e;else{let o=Nt(t,String(e));n=(await _e(o,"utf8")).split(`
106
+ `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Nt(t,r))}return s}async function mb(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await gT(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Nt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Nt(s,String(n.graph_file))),n.graph_files!==void 0){let w=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=w.map(v=>Nt(s,String(v)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},l={};a.enabled!==void 0&&(l.enabled=a.enabled),a.limit!==void 0&&(l.limit=a.limit),a.capture_unknown_context!==void 0&&(l.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(l.unknownContextLimit=a.unknown_context_limit),Object.keys(l).length&&(o.seed=l),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.discourse!==void 0&&(o.discourse=n.discourse);let c=n.index||{},u={};c.languages!==void 0&&(u.languages=c.languages),c.exclude!==void 0&&(u.exclude=c.exclude),c.secret_exclude!==void 0&&(u.secretExclude=c.secret_exclude),c.history_depth!==void 0&&(u.historyDepth=c.history_depth),c.include_text!==void 0&&(u.includeText=c.include_text),c.include_structure!==void 0&&(u.includeStructure=c.include_structure),c.respect_gitignore!==void 0&&(u.respectGitignore=c.respect_gitignore),c.markdown_sections!==void 0&&(u.markdownSections=c.markdown_sections),c.vue!==void 0&&(u.vue=c.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},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||{},h={};p.strategy!==void 0&&(h.strategy=p.strategy),p.nodes!==void 0&&(h.nodes=p.nodes),p.q!==void 0&&(h.q=p.q),p.depth!==void 0&&(h.depth=p.depth),Object.keys(h).length&&(f.expansion=h),Object.keys(f).length&&(o.tune=f);let m=n.telemetry||{};m.enabled!==void 0&&(o.telemetry={enabled:m.enabled});let b=n.memory||{},g={};b.retention_versions!==void 0&&(g.retentionVersions=b.retention_versions),b.backend!==void 0&&(g.backend=b.backend),Object.keys(g).length&&(o.memory=g);let y=[];for(let[w,v]of bT)n[w]&&n[w][v]!==void 0&&y.push(`${w}.${v}`);return o.unwired=y,o}function Va(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:Va(o,r,n)}return n}function gb({args:e={},toml:t=null,defaults:n={}}={}){let s=Va(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Va(o):{},i=Va(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),l={},c={};for(let u of a)u in i?(l[u]=i[u],c[u]="arg"):u in r?(l[u]=r[u],c[u]="tmct.toml"):(l[u]=s[u],c[u]="default");return{effective:l,sources:c}}var Ha,bT,Ka=O(()=>{Rt();Ue();Ga();Ha="tmct.toml";bT=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ds={};Gt(Ds,{CANONICALISED_FROM_PROP:()=>bd,CAPABLE_OF_PREDICATE:()=>_A,CHAIN_KEEP_DEPTH:()=>Bg,CHAIN_ROLLUP_THRESHOLD:()=>Ra,CREATED_AT_PROP:()=>Qe,DEFAULT_RETENTION:()=>ld,FACT_CLASS:()=>pt,GROUP_ROLLUP_THRESHOLD:()=>zg,HAS_A_PREDICATE:()=>hr,IN_REPLY_TO_PROP:()=>gd,MEMORY_DIR_REL:()=>lr,MEMORY_GRAPH_REL:()=>pd,MEMORY_MANIFEST_REL:()=>Db,MEMORY_SESSION_CLASS:()=>hd,MULTI_VALUED_PREDICATES:()=>RA,NODE_ID_REL:()=>xd,OPERATOR_SOURCE_ID:()=>Ya,RETRACTED_AT_PROP:()=>Oa,RETRACTED_COUNT_PROP:()=>Gu,RETRACTED_RECORD_IDS_PROP:()=>Ca,RETRACTION_CLASS:()=>rn,RETRACTION_PREDICATE:()=>Ia,ROLLUP_COUNT_PROP:()=>ei,ROLLUP_EARLIEST_PROP:()=>Fn,ROLLUP_KEEP_PER_TYPE:()=>Ug,ROLLUP_LATEST_PROP:()=>Dn,ROLLUP_PRIOR_PROP:()=>rr,ROLLUP_RECORD_IDS_PROP:()=>Zr,ROLLUP_SOURCE_IDS_PROP:()=>or,RULE_CLASS:()=>dr,RULE_KIND_ACTION_CONSTRAINT:()=>Td,RULE_KIND_ACTION_EFFECT:()=>mi,RULE_KIND_ACTION_PRECOND:()=>tc,RULE_KIND_ACTION_SIGNATURE:()=>Rd,RULE_KIND_COMPOSE2:()=>fi,RULE_KIND_FILTER:()=>hi,RULE_KIND_PROP:()=>fr,RULE_KIND_RECURSIVE:()=>_d,SAID_IN_SESSION_PROP:()=>md,SOURCE_CLASS:()=>ur,SOURCE_RELIABILITY_PROP:()=>vb,STATED_BY_PROP:()=>mn,SYLLOGISE_STATE_REL:()=>vd,UPDATED_AT_PROP:()=>ks,UTTERANCE_CLASS:()=>fd,admittedNodes:()=>Fa,appendCanonicalisedFromEdges:()=>uA,appendFact:()=>hA,appendFacts:()=>Gn,appendRetractions:()=>EA,appendRule:()=>sc,appendUtterance:()=>lA,appendUtterances:()=>Hb,applySeedPayload:()=>Sb,attachFactHeads:()=>Cb,chainRollupIdFor:()=>Fu,cloneMemoryPayload:()=>kb,closeSqliteMemoryStore:()=>Pb,createInMemoryStore:()=>di,createSqliteMemoryStore:()=>Nb,emptyMemory:()=>ui,factGroupId:()=>Dt,factHeadsOf:()=>Ob,factIdForTriple:()=>ge,factRecordIdForTag:()=>xT,factRecordIdsFor:()=>bo,findContradictions:()=>ew,findRuleByName:()=>Ad,findRulesByName:()=>yA,headRollupIdFor:()=>Mu,isChainRollupId:()=>ir,isHeadRollupId:()=>Ns,isMemoryOrSqliteHandle:()=>yd,isRetractionId:()=>Hu,isRollupId:()=>Ta,loadMemory:()=>ft,loadNodeId:()=>JT,loadSyllogiseState:()=>YT,normFactPredicate:()=>ps,normFactTerm:()=>V,openConfiguredMemoryBackend:()=>Fs,openExistingMemoryBackend:()=>OT,openMemoryBackend:()=>$d,peersToConvince:()=>Ju,provSourceClassFor:()=>eA,provenanceTagToSource:()=>Zn,readFactRows:()=>Et,readObjectSupersessions:()=>AT,readOnlyMemorySnapshot:()=>LT,readRetractions:()=>xA,readRuleRows:()=>Id,removeFacts:()=>vA,resolveMemoryGraphFile:()=>ai,resolveRelationChase:()=>Cd,resolveRelationChaseReverse:()=>Zb,retirableRetractions:()=>SA,retireRetractions:()=>kA,retractedAtOf:()=>fo,retractedRecordIds:()=>po,retractionFromWire:()=>Ma,retractionIdFor:()=>Vu,retractionScopeOf:()=>qu,retractionWireFact:()=>Pa,saveNodeId:()=>QT,saveSyllogiseState:()=>XT,snapshotMemory:()=>GT,stableRecordIds:()=>Da});function ui(){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:$T.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function ai(e,t=null){if(Ms(e)||Bn(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?Z(e,pd):Z(e,lr,`graph.v${t}.json`)}function Ms(e){return!!e&&typeof e=="object"&&e.backend===wd}function Bn(e){return!!e&&typeof e=="object"&&e.backend===Eb}function yd(e){return Ms(e)||Bn(e)}function di(){return{backend:wd,payload:ui()}}function Sb(e,t){t&&(e.payload={...e.payload,...t})}function kb(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function jb(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Sd(Zn(t));if(n)return n}return{id:ms,type:""}}function Dt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function xT(e,t){return`${e}@${_b(t).id}`}function _b(e){return Sd(Zn(e))||{id:ms,type:""}}function Rb(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=_b(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(ms,{sourceId:ms,sourceType:"",tags:[]}),[...t.values()]}function ad(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Zn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function pr(e,t="",n=Math.max){return ad(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function ET(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 Tb(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=jb(n("mgx:factProvenance")),o=n(pi).split(" ").filter(Boolean)[0]||null,r=ti(e.id);return[e.id,Dt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(go)||s.id,r||s.type,Number(n(r?rr:Mo))||0,n(Qe),n(ci)||null,o,t]}function ST(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(pt))return;let t=e.prepare(Ab);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(pt))t.run(...Tb(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function kT(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Cb(e,t){return e&&t&&(e[Ib]=t),e}function _T(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 Lb(e,t,n,s){let o=e.prepare(jT),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=gs();for(let a of n){let l=t.groups.get(a);if(!l?.length){r.run(a),s?.delete(a);continue}let c=kT(Ld(a,l,t).assertions),u=Hf(c).score;o.run(a,u,JSON.stringify(c),i),s?.set(a,{trustBase:u,inputs:c})}}function RT(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(pt))return;let n=Od(Mb(e));t.exec("BEGIN IMMEDIATE");try{Lb(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function TT(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=gs();for(let i of n){let[a,l]=i.split("\0");if(ja(l)!==Qr)continue;let c=t.groupsByPair.get(i)||[];if(c.length<2)continue;let u=c.map(p=>{let h=Ld(p,t.groups.get(p),t);return h.trust=Bi(h.assertions).score,h});if(new Set(u.map(p=>p.object)).size<2)continue;let d=Pu(u,Qr)?.winner?.id;if(!d)continue;let f=s.get(a,l);f?.to_id!==d&&o.run(a,l,(f?.ord??-1)+1,f?.to_id||"",d,r)}}function AT(e,{subject:t,predicate:n}={}){if(!Bn(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 CT(){if(yb)return;yb=!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 Nb(e){CT();let{DatabaseSync:t}=await Promise.resolve().then(()=>(ab(),ib)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(vT),ST(n);let s={backend:Eb,db:n,dbPath:e};return RT(s),s}function Pb(e){Bn(e)&&e.db.close()}async function $d(e,t){if(t===wd)return{dir:di(),close:async()=>{}};let n=Z(e,".tmct","memory","graph.sqlite"),s=r=>el(r).then(()=>!0,()=>!1);!await s(n)&&await s(Z(e,pd))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
+ `),await An(he(n),{recursive:!0});let o=await Nb(n);return{dir:o,close:async()=>Pb(o)}}async function OT(e,t=""){if(!e||typeof e!="string")return null;let n=Z(e,".tmct","memory","graph.sqlite");try{await el(n)}catch{return null}return $d(e,t)}async function LT(e){if(!e)return null;let t=di();return Sb(t,kb(await ft(e))),t}async function Fs(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Ka(),bb));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return $d(e,n)}function NT(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=Mb(e),e.cachedFactHeads=_T(e.db),e.cachedDataVersion=t),Cb(jn(e.cachedPayload),e.cachedFactHeads)}function Mb(e){let t=e.db,n=ui(),s=(a,l)=>{let c=t.prepare("SELECT v FROM meta WHERE k = ?").get(a);return c?JSON.parse(c.v):l},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(a=>JSON.parse(a.json)),r=t.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid"),i=t.prepare("SELECT prop, predicate, count FROM relations ORDER BY ord").all().map(a=>({predicate:a.predicate,prop:a.prop,count:a.count,examples:r.all(a.prop).map(l=>{let c={subject:l.subject,object:l.object,subjectLabel:l.subject_label,objectLabel:l.object_label};return l.extra&&Object.assign(c,JSON.parse(l.extra)),c})}));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:i,individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function PT(e,t){let n=jn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function MT(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function FT(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 DT(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,jn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function zT(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function UT(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function BT(e,t){let n=e.db,s=ui(),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=jn(t.generated_at??s.generated_at),o.memory=jn(t.memory??s.memory),o.prefixes=jn(t.prefixes??s.prefixes),o.vocabulary=jn(t.vocabulary??s.vocabulary),o.classes=jn(t.classes??s.classes),o.proseIndex=jn(t.proseIndex??s.proseIndex));let i=n.prepare("SELECT ord, json FROM individuals WHERE id = ?"),l=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM individuals").get().m+1,c=n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),u=n.prepare(Ab),d=new Set,f=new Set,p=new Set;for(let S of t.individuals||[]){d.add(S.id);let R=JSON.stringify(S),_=i.get(S.id);if(_&&_.json===R)continue;let I=_?_.ord:l++;c.run(S.id,I,S.class??null,S.label??null,R),S.class===pt&&(u.run(...Tb(S,R)),f.add(Dt(S.id)),p.add(cd(li(S,"subject"),li(S,"predicate")))),o&&PT(o,S)}let h=n.prepare("DELETE FROM individuals WHERE id = ?"),m=n.prepare("DELETE FROM facts WHERE id = ?"),b=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let S of n.prepare("SELECT id FROM individuals").all()){if(d.has(S.id))continue;let R=b.get(S.id);R&&(f.add(R.triple_hash),p.add(cd(R.subject,R.predicate))),h.run(S.id),m.run(S.id)}o&&MT(o,d);let g=n.prepare("SELECT ord FROM relations WHERE prop = ?"),w=n.prepare("SELECT COALESCE(MAX(ord), -1) AS m FROM relations").get().m+1,v=n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),k=n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),$=n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),x=n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),E=new Set;for(let S of t.objectProperties||[]){E.add(S.prop);let R=k.all(S.prop),_=new Map(R.map(U=>[`${U.subject}\0${U.object}`,U])),I=new Set,P=o?FT(o,S.prop):null;for(let U of S.examples||[]){let K=`${U.subject}\0${U.object}`;I.add(K);let ce=Object.keys(U).filter(W=>!IT.has(W)),ie=ce.length?JSON.stringify(Object.fromEntries(ce.map(W=>[W,U[W]]))):null,D=_.get(K);D&&(D.subject_label??null)===(U.subjectLabel??null)&&(D.object_label??null)===(U.objectLabel??null)&&(D.extra??null)===(ie??null)||($.run(S.prop,U.subject,U.object,U.subjectLabel??null,U.objectLabel??null,ie),P&&DT(P,U,ce))}for(let U of _.keys()){if(I.has(U))continue;let[K,ce]=U.split("\0");x.run(S.prop,K,ce)}P&&zT(P,I);let T=Number.isFinite(S.count)?S.count:(S.examples||[]).length,F=g.get(S.prop)?.ord??w++;v.run(S.prop,F,S.predicate??null,T),P&&(P.predicate=S.predicate??null,P.count=T)}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&&UT(o,E),f.size){let S=Od(t);Lb(n,S,f,e.cachedFactHeads),TT(n,S,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Fb(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Sr(n,t),await Li(n,e)}async function Qa(e,t){await Fb(e,JSON.stringify(t))}async function GT(e,{retentionVersions:t}={}){if(yd(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a memory/sqlite handle has no on-disk graph.json to snapshot");let n=ai(e),s;try{s=await _e(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=WT(e),r;try{r=JSON.parse(await _e(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??ld}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??ld);let i=r.version,a=ai(e,i);await An(he(a),{recursive:!0}),await Fb(a,s),r.version=i+1;let l=null,c=i-r.retentionVersions;if(c>=0)try{await tl(ai(e,c)),l=c}catch(u){if(u?.code!=="ENOENT")throw u}return await Qa(o,r),{skipped:!1,version:i,prunedVersion:l}}async function ft(e){if(Ms(e))return od(e.payload);if(Bn(e))return od(NT(e));let t;try{t=await _e(id(e),"utf8")}catch(n){if(n?.code==="ENOENT")return ui();throw n}return od(JSON.parse(t))}function HT(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==pt||!VT.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 qT(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(l=>l?.prop===mn),n=new Map;for(let l of t?.examples||[]){if(!l?.subject)continue;let c=n.get(l.subject);c?c.push(l):n.set(l.subject,[l])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let l of e.individuals){if(l?.class!==pt||String(l.id||"").includes("@")){a.push(l);continue}let c=w=>(l.attributes||[]).find(v=>v?.prop===w)?.value||"",u=c("rdf:subject"),d=c("rdf:predicate"),f=c("rdf:object");if(!u||!d||!f){a.push(l);continue}let p=Jo(u,d,f),h=c(Qe),m=c("mgx:factProvenance"),b=n.get(l.id)||[],g=m?Rb(m):[];for(let w of b)g.some(v=>v.sourceId===w.object)||g.push({sourceId:w.object,sourceType:"",tags:[]});g.length||g.push({sourceId:ms,sourceType:"",tags:[]});let y=[];for(let w of g){let v={id:`${p}@${w.sourceId}`,label:l.label,class:pt,derived_from:jn(l.derived_from)||[],mentions:jn(l.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:f},{prop:Qe,key:"createdAt",value:pr(w.tags,h,Math.min)||h||gs()},{prop:go,key:"sourceId",value:w.sourceId},...w.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:w.tags.join(" | ")}]:[],...c("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:c("mgx:hasProseTokens")}]:[],...c("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:c("mgx:factQuantifier")}]:[],...w.sourceType==="entailed"&&c("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:c("mgx:factJustification")}]:[]]};if(a.push(v),r.push(v),y.push(v.id),w.sourceId!==ms){let k=b.find($=>$?.object===w.sourceId);i.push({...k||{},subject:v.id,object:w.sourceId,subjectLabel:v.label,objectLabel:kd(w.sourceId)})}}s.add(l.id),o.set(l.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(l=>!s.has(l?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:mn,count:i.length,examples:i}));for(let l of e.objectProperties||[]){if(l?.prop===mn||!l?.examples?.length)continue;let c=[];for(let u of l.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 h of f)c.push({...u,subject:p,object:h})}l.examples=c,l.count=c.length}e.individuals=a,Bb(e);for(let l of r)cr(e,l);return Wn(e),e}async function KT(e,t){if(Ms(e)){e.payload=t;return}if(Bn(e)){BT(e,t);return}await An(he(id(e)),{recursive:!0}),await Qa(id(e),t)}async function YT(e){if(Ms(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(Bn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(zb);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await _e(Z(e,vd),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function XT(e,t){if(Ms(e)){e.syllogiseState=structuredClone(t);return}if(Bn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(zb,JSON.stringify(t));return}let n=Z(e,vd);await An(he(n),{recursive:!0}),await Qa(n,t)}async function JT(e){if(Ms(e))return e.nodeId||null;if(Bn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Ub);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await _e(Z(e,xd),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function QT(e,t){if(Ms(e)){e.nodeId=t;return}if(Bn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Ub,JSON.stringify({nodeId:t}));return}let n=Z(e,xd);await An(he(n),{recursive:!0}),await Qa(n,{nodeId:t})}function Bb(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===ur&&n.set(a.id,a),a.class===rn&&dd(r,a),a.class===pt)){let l=Dt(a.id),c=o.get(l);c?c.push(a.id):o.set(l,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===mn);for(let a of i?.examples||[]){if(!a?.subject)continue;let l=s.get(a.subject);l?l.push(a.object):s.set(a.subject,[a.object])}return e[ud]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[ud]}function dd(e,t){let n=Dt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function ZT(e,t){let n=zt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===rn&&Dt(s.id)===t)}async function ws(e,t){let n=await ft(e);Bb(n);let s=await t(n)??n;return oA(s),iA(s),s.proseIndex=Lf(s.individuals),await KT(e,s),s}function Ed(e,t){return e?.attributes?.find(n=>n?.prop===Qe)?.value||t||gs()}function gn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Sd(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Ya}:${e.sessionId}`:Ya,type:"operator"};case"teach":return{id:e.sessionId?`${rd}:${e.sessionId}`:rd,type:"teach"};case"teachNode":return{id:`${xb}:${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:${Yr(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 eA(e){return pl[e]||null}function tA(e,t,n){let s=Sd(t);if(!s)return null;let o=zt(e),r=o?o.individualsById.get(s.id):e.individuals.find(c=>c?.id===s.id),i=Ed(r,t?.createdAt||n),a={id:s.id,label:kd(s.id),class:ur,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:Qe,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},l=bs(e,a);return o&&o.sourcesById.set(s.id,l),s.id}function ec(e){let t=zt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===ur&&(n[s.id]=s);return n}function Wb(e,t){let n=zt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===mn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function nA(e,t,n=Date.now(),s={}){let o=Wb(e,t.id),r=(t.attributes||[]).find(l=>l?.prop===Qe)?.value||"",{score:i,inputs:a}=Vf({sourceIds:o,createdAt:r},ec(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});gn(t,Mo,"trustScore",String(i)),gn(t,zi,"trustInputs",JSON.stringify(a)),gn(t,ks,"updatedAt",new Date(n).toISOString())}function sA(e,t,n=Date.now(),s={}){let[o]=Wb(e,t.id),r=o?ec(e)[o]:null,i=(r?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||"",a=Ui(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let c=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*c))}let l=(t.attributes||[]).find(c=>c?.prop===Qe)?.value||"";gn(t,Mo,"trustScore",String(a)),gn(t,zi,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:l})),gn(t,ks,"updatedAt",new Date(n).toISOString())}function Gb(e,t,n,s){t?.class===pt?sA(e,t,n,s):nA(e,t,n,s)}function cr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===Qe)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Zn(i);if(!a)continue;let l=tA(e,a,r);l&&Ja(e,{predicate:"statedBy",prop:mn},{subject:t.id,object:l,subjectLabel:t.label,objectLabel:kd(l)})}Gb(e,t,n,s)}function oA(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===mn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==pt||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(cr(e,r,o),s=!0);s&&Wn(e)}function iA(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=Et(e),n=new Set;for(let a of ew(e))for(let l of a)n.add(l.id);let s=new Map;for(let a of t)for(let l of a.sourceIds){if(!rA(l))continue;let c=s.get(l)||{factsAsserted:0,factsContradicted:0};c.factsAsserted+=1,n.has(a.id)&&(c.factsContradicted+=1),s.set(l,c)}if(!s.size)return;let o=zt(e);for(let[a,l]of s){let c=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);c&&(gn(c,vb,"sourceReliability",String(qf(l))),gn(c,ks,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===mn),i=new Set;for(let a of r?.examples||[])s.has(a?.object)&&i.add(a.subject);for(let a of i){let l=o?o.individualsById.get(a):e.individuals.find(c=>c?.id===a);l&&Gb(e,l)}}function aA(e,t,n){if(!Ta(n?.id))return n;let s=ti(n.id);if(!s)return Bu(t,n);let o=ec(e);return Bu(t,n,{priorFor:r=>Ui(s,o[r])})}function $b(e,t,n){return n?.class===rn?tb(t,n):aA(e,t,n)}function bs(e,t){let n=zt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,$b(e,o,t)),o.class===rn&&dd(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===rn&&dd(n.retractionsByGroup,t),t.class===pt){let r=Dt(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]=$b(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Ja(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(l=>l?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===mn?zt(e):null;if(r){let l=r.statedByBySubject.get(s.subject);if(!l||!l.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||gs()}),o.count=o.examples.length,l?l.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(l=>l?.subject===s.subject&&l?.object===s.object)?.createdAt||s.createdAt||gs();if(o.examples=(o.examples||[]).filter(l=>!(l?.subject===s.subject&&l?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let l=r.statedByBySubject.get(s.subject)||[];l.includes(s.object)||l.push(s.object),r.statedByBySubject.set(s.subject,l)}}function Wn(e){let t=[hd,fd,pt,ur,dr];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 cA(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:hd,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Qe,key:"createdAt",value:n||gs()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Vb(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:l=""}){if(!yT.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let c=String(s||""),u=ds(n),d=`utt:${o}#${c}#${t}`,f=Za(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=Di({doc:u}),h=e.individuals.find(y=>y?.id===d),m=Ed(h,l||c),b={id:d,label:f,class:fd,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:c},{prop:Qe,key:"createdAt",value:m},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...p.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:p.join(" ")}]:[]]};bs(e,b);let g=cA(e,o,r);if(Ja(e,{predicate:"saidInSession",prop:md},{subject:d,object:g,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&Ja(e,{predicate:"inReplyTo",prop:gd},{subject:d,object:a,subjectLabel:f,objectLabel:y.label})}return c&&c>String(e.generated_at||"")&&(e.generated_at=c),d}async function lA(e,t){let n;return await ws(e,s=>{n=Vb(s,t),Wn(s)}),{id:n}}async function Hb(e,t){let n=[];return t?.length?(await ws(e,s=>{for(let o of t)n.push(Vb(s,o));Wn(s)}),{ids:n}):{ids:n}}async function uA(e,t){t?.length&&await ws(e,n=>{for(let s of t)for(let o of bo(n,s.factId))Ja(n,{predicate:"canonicalisedFrom",prop:bd},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function bo(e,t){let n=zt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===pt&&Dt(s.id)===t).map(s=>s.id)}function qb(e,t,n,s=""){let o=Rb(n);if(o.length===1&&o[0].sourceId===ms&&bo(e,t).length)return[];let r=ZT(e,t);if(r.length&&(o=o.filter(a=>!Na(r,`${t}@${a.sourceId}`,pr(a.tags,s))),!o.length))return o;let i=dA(e,t);return i.length?o.filter(a=>!Jg(i,a.sourceId)):o}function dA(e,t){let n=zt(e),s=n?n.factRecordsByGroup.get(t):bo(e,t),o=[];for(let r of s||[]){if(!Ns(r))continue;let i=Ps(e,r);i&&o.push(i)}return o}function Kb(e,t,{quantifier:n,environments:s}){let o=bo(e,t).map(i=>Ps(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(l=>l?.prop==="mgx:factJustification"));for(let a of i.length?i:o)gn(a,"mgx:factJustification","justification",s.map(l=>l.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(gn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function pA(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Xa)?.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 Yb(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:l,createdAt:c,observedAt:u,quantifier:d,environments:f}=t,p=`${n}@${l.sourceId}`,h=zt(e),m=h?h.individualsById.get(p):e.individuals.find(R=>R?.id===p),b=R=>(m?.attributes||[]).find(_=>_?.prop===R)?.value||"",g=b("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:ad(l.tags),observedAt:u},w=null,v=l.tags,k=y.assertedAt||c||gs(),$=u,x=[],E=d;if(m){let R={assertedAt:ad(g),observedAt:b(ci)};ET(y,R)?(w={head:m,id:`${p}#v${pA(m)}`},x=[w.id]):(v=[...new Set([...g,...l.tags])],k=b(Qe)||k,$=u||b(ci),x=b(Xa).split(" ").filter(Boolean)),E=d||b("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:pt,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:Qe,key:"createdAt",value:k},{prop:go,key:"sourceId",value:l.sourceId},...v.length?[{prop:"mgx:factProvenance",key:"provenance",value:v.join(" | ")}]:[],...$?[{prop:ci,key:"observedAt",value:$}]:[],...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(R=>R.join(" ")).join(" | ")}]:[],...x.length?[{prop:Xa,key:"supersedes",value:x.join(" ")}]:[]]},demote:w}}function fA(e,t){let n=`${t}@${ms}`,s=zt(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 Xb(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${ms}`)||fA(e,Dt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};gn(o,pi,"supersededBy",t.id),bs(e,o),s.push(o.id)}return bs(e,t),s.push(t.id),s}function Ps(e,t){let n=zt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function jd(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=zt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Dt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Jb(e,t){let n=zt(e),s=(n?n.factRecordsByGroup.get(t):bo(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=Ps(e,u);if(!d)continue;let f=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(Ns(u)){i.set(ti(u),d);continue}if(ir(u)){a.set(f(go),d);continue}let p=f("mgx:factProvenance"),h=jb(p),m=p.split(" | ").filter(Boolean),b={id:u,sourceId:f(go)||h.id,assertedAt:pr(m,f(Qe)),record:d};if(f(pi)){let y=r.get(b.sourceId);y?y.push(b):r.set(b.sourceId,[b]);continue}if(!h.type)continue;let g=o.get(h.type);g?g.push(b):o.set(h.type,[b])}let l=ec(e),c=[];for(let[u,d]of o){let f=Yg({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>Ui(u,l[p])});if(f){bs(e,f.rollup),c.push(...f.absorbed);for(let p of f.absorbedSourceIds){for(let m of r.get(p)||[])c.push(m.id);r.delete(p);let h=a.get(p);h&&c.push(h.id),a.delete(p)}}}for(let[u,d]of r){let f=Xg({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;bs(e,f.rollup),c.push(...f.absorbed);let p=Ps(e,f.rewire);p&&gn(p,Xa,"supersedes",f.rollup.id)}return c}async function hA(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:l,ruleConfidence:c}={}){let u=V(t),d=ps(n),f=V(s);if(!u||!d||!f)throw new Error("a fact needs subject, predicate and object");let p=Jo(u,d,f),h=`${u} ${d} ${f}`,m=Di({doc:h}),b=ds(a);return await ws(e,async g=>{let y=qb(g,p,ds(o),r);for(let w of y.length?[]:Kb(g,p,{quantifier:b}))cr(g,Ps(g,w),void 0,{premiseTrusts:l,ruleConfidence:c});for(let w of y){let v=Yb(g,{groupId:p,s:u,p:d,o:f,label:Za(h),tokens:m,group:w,createdAt:r,observedAt:i,quantifier:b});await Zu(v.candidate);for(let k of Xb(g,v))cr(g,Ps(g,k),void 0,k===v.candidate.id?{premiseTrusts:l,ruleConfidence:c}:void 0)}jd(g,Jb(g,p)),Wn(g)}),{id:p}}function mA(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 Gn(e,t){let n=[],s=0;for(let r of t||[]){let i=V(r?.subject),a=ps(r?.predicate),l=V(r?.object);if(!i||!a||!l){s+=1;continue}let c=`${i} ${a} ${l}`;n.push({id:Jo(i,a,l),s:i,p:a,o:l,text:c,tokens:Di({doc:c}),provenance:ds(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:ds(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:mA(r?.justification)})}let o=[];return n.length?(await ws(e,r=>{let i=[],a=new Set,l=new Map;for(let u of n){let d=qb(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:Kb(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)&&l.set(f,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let f of d){let p=Yb(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Za(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let h of Xb(r,p))a.has(h)||(a.add(h),i.push(h));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&l.set(p.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)cr(r,Ps(r,u),void 0,l.get(u));let c=[];for(let u of new Set(o))c.push(...Jb(r,u));jd(r,c),Wn(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function sc(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Qb[n];if(!i)throw new Error(`a rule kind must be one of ${gA.join(", ")}, got ${JSON.stringify(n)}`);let a=V(t);if(!a)throw new Error("a rule needs a name");let l=bA[n]||new Set,c=i.map(([p])=>V(s?.[p])),u=i.filter(([p],h)=>!l.has(p)&&!c[h]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([p])=>p).join(" + ")}`);if(n===mi){let p=c[i.findIndex(([m])=>m==="objectRole")],h=c[i.findIndex(([m])=>m==="value")];if(!p&&!h)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=wA(n,a,c),f=Za(`${a} = ${n}(${c.join(", ")})`);return await ws(e,async p=>{let h=p.individuals.find(w=>w?.id===d),m=h?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",b=[...new Set([...m.split(" | "),ds(o)].filter(Boolean))],g=Ed(h,r),y={id:d,label:f,class:dr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:nc,key:"ruleName",value:a},{prop:fr,key:"ruleKind",value:n},...i.map(([w,v],k)=>({prop:v,key:w,value:c[k],skip:!c[k]&&l.has(w)})).filter(w=>!w.skip).map(({skip:w,...v})=>v),{prop:Qe,key:"createdAt",value:g},...b.length?[{prop:"mgx:factProvenance",key:"provenance",value:b.join(" | ")}]:[]]};await Zu(y),bs(p,y),cr(p,p.individuals.find(w=>w?.id===d)),Wn(p)}),{id:d}}function Ad(e,t){let n=V(t);return(e?.individuals||[]).find(s=>s?.class===dr&&(s.attributes||[]).find(o=>o?.prop===nc)?.value===n)}function yA(e,t){let n=V(t),s=o=>(o.attributes||[]).find(r=>r?.prop===fr)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===dr&&(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 Id(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==dr)continue;let s=a=>(n.attributes||[]).find(l=>l?.prop===a)?.value,o=s(fr),r=Qb[o];if(!r)continue;let i={};for(let[a,l]of r)i[a]=s(l)??"";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 Cd(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:l,byTrust:c,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:f}=o,p=String(t||"").trim().toLowerCase(),h=l(V,n),m=l(V,s),b=r(p).filter(w=>h.has(w.fact.subject)&&m.has(w.fact.object));if(b.length){let w=b.slice().sort((v,k)=>c(v.fact,k.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let g=Ad(e,p),y=g?.attributes?.find(w=>w.prop===fr)?.value;if(g&&y===fi){let w=g.attributes.find(P=>P.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(P=>P.prop==="mgx:ruleBase2")?.value,k=V(n),$=V(s);if(!w||!v||!k||!$)return null;let R=f({entity:k,hopsTaken:0},P=>P.hopsTaken===2&&P.entity===$,P=>{if(P.hopsTaken>=2)return[];let T=P.hopsTaken===0?w:v;return r(T).filter(F=>F.fact.subject===P.entity).map(F=>({action:F,nextState:{entity:F.fact.object,hopsTaken:P.hopsTaken+1}}))},{maxDepth:2,stateKey:P=>`${P.entity}#${P.hopsTaken}`});if(!R)return null;let _=new Set,I=[];for(let P of R.actions){I.push(i(P.fact));for(let T of P.aliasFacts){let F=T.id||`${T.subject}|${T.predicate}|${T.object}`;_.has(F)||(_.add(F),I.push(`${a(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{citation:I}}if(g&&y===hi){let w=g.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!w||!v)return null;let k=await Cd(e,w,n,s,o);if(!k)return null;let $=V(n),x=V(v),E=u.find(S=>S.predicate===d&&S.subject===$&&V(S.object)===x);return E?{citation:[...k.citation,i(E)]}:null}return null}async function Zb(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:l,rows:c,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,f=String(t||"").trim().toLowerCase(),p=a(V,n),h=o(f).filter(g=>p.has(g.fact.object));if(h.length){let g=new Map;for(let y of h)g.has(y.fact.subject)||g.set(y.fact.subject,[]),g.get(y.fact.subject).push(y);return[...g.entries()].map(([y,w])=>{let v=w.slice().sort((k,$)=>l(k.fact,$.fact))[0];return{subject:y,citation:[r(v.fact),...v.aliasFacts.map(k=>`${i(k)}${k.provenance?` (source: ${k.provenance})`:""}`)]}})}let m=Ad(e,f),b=m?.attributes?.find(g=>g.prop===fr)?.value;if(m&&b===fi){let g=m.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,y=m.attributes.find(x=>x.prop==="mgx:ruleBase2")?.value,w=V(n);return!g||!y||!w?[]:d({entity:w,hopsTaken:0},x=>{if(x.hopsTaken>=2)return[];let E=x.hopsTaken===0?y:g;return o(E).filter(S=>S.fact.object===x.entity).map(S=>({action:S,nextState:{entity:S.fact.subject,hopsTaken:x.hopsTaken+1}}))},{maxDepth:2,stateKey:x=>`${x.entity}#${x.hopsTaken}`}).filter(x=>x.node.hopsTaken===2).map(({node:x,path:E})=>{let S=new Set,R=[];for(let _ of E.actions.slice().reverse()){R.push(r(_.fact));for(let I of _.aliasFacts){let P=I.id||`${I.subject}|${I.predicate}|${I.object}`;S.has(P)||(S.add(P),R.push(`${i(I)}${I.provenance?` (source: ${I.provenance})`:""}`))}}return{subject:x.entity,citation:R}})}if(m&&b===hi){let g=m.attributes.find($=>$.prop==="mgx:ruleBase1")?.value,y=m.attributes.find($=>$.prop==="mgx:ruleFilterProperty")?.value;if(!g||!y)return[];let w=await Zb(e,g,n,s),v=V(y),k=[];for(let $ of w){let x=V($.subject),E=c.find(S=>S.predicate===u&&S.subject===x&&V(S.object)===v);E&&k.push({subject:$.subject,citation:[...$.citation,r(E)]})}return k}return[]}function Et(e,t={}){let n=Od(e),s=Ob(e),o=[];for(let[r,i]of n.groups){let a=Ld(r,i,n),l=s?.get(r);a.trust=Bi(l?l.inputs:a.assertions,t).score,o.push(a)}return o}function Od(e){let t=e?.individuals||[],n=new Map(t.filter(l=>l?.class===ur).map(l=>[l.id,l])),s=(e?.objectProperties||[]).find(l=>l?.prop===mn),o=new Map;for(let l of s?.examples||[])o.has(l.subject)||o.set(l.subject,[]),o.get(l.subject).push(l.object);let r=new Map,i=new Map;for(let l of t){if(l?.class===rn){let d=Dt(l.id),f=i.get(d);f?f.push(l):i.set(d,[l]);continue}if(l?.class!==pt||(l.attributes||[]).some(d=>d?.prop===pi)||ir(l.id))continue;let c=Dt(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}for(let[l,c]of i){let u=r.get(l);if(!u)continue;let d=u.filter(f=>!Na(c,f.id,pr(Un(f,"mgx:factProvenance").split(" | ").filter(Boolean),Un(f,Qe))));d.length!==u.length&&(d.length?r.set(l,d):r.delete(l))}let a=new Map;for(let[l,c]of r){c.sort((f,p)=>f.id<p.id?-1:f.id>p.id?1:0);let u=cd(li(c[0],"subject"),li(c[0],"predicate")),d=a.get(u);d?d.push(l):a.set(u,[l])}return{groups:r,groupsByPair:a,statedByRecord:o,sourceTypeOf:l=>(n.get(l)?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||""}}function Ld(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=Un,i=li,a=[],l=[],c=[],u=new Set,d=[],f=new Set,p="";for(let b of t){if(Ns(b.id)){let x=ti(b.id),E=Aa(b);for(let S of E)l.includes(S)||(l.push(S),x&&c.push(x));a.push({id:b.id,sourceId:"",sourceType:x,provenance:"",createdAt:r(b,Fn),ownTrust:Number(r(b,rr))||0,assertedAt:r(b,Dn),rollup:{count:Number(r(b,ei))||E.length,sourceIds:E,earliest:r(b,Fn),latest:r(b,Dn)}});continue}let g=r(b,"mgx:factProvenance").split(" | ").filter(Boolean);for(let x of g)u.add(x);let[y]=s.get(b.id)||[],w=y||r(b,go),v=o(w);y&&!l.includes(y)&&(l.push(y),v&&c.push(v));let k=r(b,Qe),$=r(b,ci);a.push({id:b.id,sourceId:w,sourceType:v,provenance:g.join(" | "),createdAt:k,...$?{observedAt:$}:{},ownTrust:Number(r(b,Mo))||0,assertedAt:pr(g,k)}),p=p||i(b,"quantifier");for(let x of i(b,"justification").split(" | ")){let E=x.split(" ").filter(Boolean);if(!E.length)continue;let S=E.join(" ");f.has(S)||(f.add(S),d.push(E))}}let h=[],m=new Set;for(let b of d)for(let g of b)m.has(g)||(m.add(g),h.push(g));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:p,sourceIds:l,sourceTypes:c,environments:d,justification:h,assertions:a}}function $A(e){let t=Un(e,go);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 vA(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||gs();return await ws(e,l=>{let c=new Set,u=new Set,d=new Map;l.individuals=(l.individuals||[]).filter(f=>{if(f?.class!==pt)return!0;let p=Dt(f.id),h=o.has(f.id)?f.id:o.has(p)?p:"";if(!h)return!0;u.add(h),c.add(f.id);let m=$A(f),b=`${p}\0${m}`,g=Un(f,"mgx:factProvenance"),y=d.get(b);return y?(y.ids.push(f.id),g&&y.tags.push(g)):d.set(b,{groupId:p,sourceId:m,ids:[f.id],tags:g?[g]:[],template:{label:f.label||"",subject:Un(f,"rdf:subject"),predicate:Un(f,"rdf:predicate"),object:Un(f,"rdf:object")}}),!1});for(let f of u)r.push(f);if(r.length){for(let f of c)i.push(f);for(let f of l.objectProperties||[]){let p=f.examples||[];f.examples=p.filter(h=>!c.has(h?.subject)&&!c.has(h?.object)),f.count=f.examples.length}for(let f of d.values()){let p=eb({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&bs(l,p)}Wn(l)}}),{removed:r,records:i}}function xA(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==rn)continue;let s=Pa(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function EA(e,t){let n=[];for(let o of t||[]){let r=Ma(o);r&&n.push(r)}let s=[];return n.length?(await ws(e,o=>{let r=new Map;for(let a of n){let l=bs(o,a),c=Dt(l.id),u=r.get(c);u?u.push(l):r.set(c,[l])}let i=new Set;for(let[a,l]of r)for(let c of bo(o,a)){let u=Ps(o,c);if(!u)continue;let d=Un(u,"mgx:factProvenance").split(" | ").filter(Boolean);Na(l,c,pr(d,Un(u,Qe)))&&i.add(c)}if(i.size){jd(o,i);for(let a of i)s.push(a)}Wn(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function SA(e,{self:t="",acknowledgedBy:n=null}={}){let s=Fa(Et(e)),o=[];for(let r of e?.individuals||[])r?.class===rn&&r.id&&o.push(r.id);return{roster:s,retirable:Da({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function kA(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await ws(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==rn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=zt(o);if(i)for(let a of r){i.individualsById.delete(a);let l=Dt(a),c=(i.retractionsByGroup.get(l)||[]).filter(u=>!r.has(u.id));c.length?i.retractionsByGroup.set(l,c):i.retractionsByGroup.delete(l)}Wn(o)}),{retired:s}):{retired:s}}function ew(e,{floor:t=jA}={}){let n=Et(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(ja(r.predicate)===Ou)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=ja(r[0].predicate);i!==Lu&&!Pu(r,i).contested||o.push(r.slice().sort((a,l)=>l.trust-a.trust||a.object.localeCompare(l.object)))}return o.sort((r,i)=>`${r[0].subject} ${r[0].predicate}`.localeCompare(`${i[0].subject} ${i[0].predicate}`))}var lr,pd,fd,pt,hd,ur,dr,md,gd,wT,mn,bd,vb,Ya,rd,xb,yT,wb,$T,id,wd,Eb,vT,ms,ci,go,Xa,pi,Ab,Un,li,cd,Ib,Ob,jT,IT,yb,jn,Db,ld,WT,od,VT,vd,zb,xd,Ub,ud,zt,Za,gs,kd,rA,fi,hi,_d,Rd,tc,mi,Td,gA,nc,fr,Qb,bA,wA,jA,hr,_A,RA,Be=O(()=>{Rt();Ue();Ss();Mt();Mt();es();Dg();es();ka();Wu();Yu();Qu();rb();Wu();Yu();Qu();lr=Z(".tmct","memory"),pd=Z(lr,"graph.json"),fd="Utterance",pt="Fact",hd="Session",ur="Source",dr="Rule",md="mgx:saidInSession",gd="mgx:inReplyTo",wT="mgx:derivedFrom",mn="mgx:statedBy",bd="mgx:canonicalisedFrom",vb="mgx:sourceReliability",Ya="src:operator-chat",rd="src:teach-chat",xb="src:teach-node",yT=new Set(["visitor","tmct"]),wb=48,$T=[{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:md,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:gd,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:Qe,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:ks,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:wT,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:mn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:bd,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:Mo,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:zi,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:er,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)"}];id=e=>ai(e),wd="memory",Eb="sqlite";vT=`
108
108
  CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v TEXT NOT NULL);
109
109
  CREATE TABLE IF NOT EXISTS individuals (id TEXT PRIMARY KEY, ord INTEGER NOT NULL, class TEXT, label TEXT, json TEXT NOT NULL);
110
110
  CREATE TABLE IF NOT EXISTS relations (prop TEXT PRIMARY KEY, ord INTEGER NOT NULL, predicate TEXT, count INTEGER);
@@ -143,89 +143,89 @@ CREATE TABLE IF NOT EXISTS fact_object_supersessions (
143
143
  recorded_at TEXT NOT NULL,
144
144
  PRIMARY KEY (subject, predicate, ord)
145
145
  );
146
- `,ms="src:none",ai="mgx:observedAt",go="mgx:sourceId",qa="mgx:supersedes",di="mgx:supersededBy";$b="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";Un=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",ci=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",td=(e,t)=>`${e}\0${t}`;vb=Symbol("materialised fact_heads index");Eb=e=>e?.[vb]||null,yT="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";ST=new Set(["subject","object","subjectLabel","objectLabel"]),lb=!1;jn=e=>e===void 0?e:structuredClone(e);Tb=Z(lr,"manifest.json"),nd=5,PT=e=>Z(e,Tb);Ju=e=>zT(DT(e)),FT=/^fact:[0-9a-f]{8}$/;hd=Z(lr,"syllogise-state.json"),Ab="syllogiseState";md=Z(lr,"node-id.json"),Ib="nodeId";sd=Symbol("mutateMemory lookup index");Dt=e=>e?.[sd]||null;Xa=e=>e.length>cb?e.slice(0,cb-1)+"\u2026":e,gs=()=>new Date().toISOString();wd=e=>String(e).replace(/^src:/,"");QT=e=>typeof e=="string"&&(e.startsWith(`${Ha}:`)||e.startsWith(`${Qu}:`)||e.startsWith(`${pb}:`));pi="compose2",fi="filter",$d="recursive",vd="action-signature",Qa="action-precond",hi="action-effect",xd="action-constraint",lA=Object.freeze([pi,fi,$d,vd,Qa,hi,xd]),Za="mgx:ruleName",fr="mgx:ruleKind",Bb={[pi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[fi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[$d]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[vd]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Qa]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[hi]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[xd]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},uA={[Qa]:new Set(["value","negate"]),[hi]:new Set(["objectRole","value"])},dA=(e,t,n)=>`rule:${Kr([e,t,...n].join("\0"))}`;yA=.5,hr="mgx:hasA",$A="mgx:capableOf",vA=Ru});async function bn(e,t=null){try{if(t)return Et(await ft(t));let{dir:n,close:s}=await Fs(he(he(e.graphFile)));try{return Et(await ft(n))}finally{await s()}}catch{return[]}}function Hb(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 tc(e,t){let n=V(t),s=e.filter(a=>Vb.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,wo),i=o.length>wo?`
146
+ `,ms="src:none",ci="mgx:observedAt",go="mgx:sourceId",Xa="mgx:supersedes",pi="mgx:supersededBy";Ab="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";Un=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",li=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",cd=(e,t)=>`${e}\0${t}`;Ib=Symbol("materialised fact_heads index");Ob=e=>e?.[Ib]||null,jT="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";IT=new Set(["subject","object","subjectLabel","objectLabel"]),yb=!1;jn=e=>e===void 0?e:structuredClone(e);Db=Z(lr,"manifest.json"),ld=5,WT=e=>Z(e,Db);od=e=>qT(HT(e)),VT=/^fact:[0-9a-f]{8}$/;vd=Z(lr,"syllogise-state.json"),zb="syllogiseState";xd=Z(lr,"node-id.json"),Ub="nodeId";ud=Symbol("mutateMemory lookup index");zt=e=>e?.[ud]||null;Za=e=>e.length>wb?e.slice(0,wb-1)+"\u2026":e,gs=()=>new Date().toISOString();kd=e=>String(e).replace(/^src:/,"");rA=e=>typeof e=="string"&&(e.startsWith(`${Ya}:`)||e.startsWith(`${rd}:`)||e.startsWith(`${xb}:`));fi="compose2",hi="filter",_d="recursive",Rd="action-signature",tc="action-precond",mi="action-effect",Td="action-constraint",gA=Object.freeze([fi,hi,_d,Rd,tc,mi,Td]),nc="mgx:ruleName",fr="mgx:ruleKind",Qb={[fi]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[hi]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[_d]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[Rd]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[tc]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[mi]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Td]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},bA={[tc]:new Set(["value","negate"]),[mi]:new Set(["objectRole","value"])},wA=(e,t,n)=>`rule:${Yr([e,t,...n].join("\0"))}`;jA=.5,hr="mgx:hasA",_A="mgx:capableOf",RA=Nu});async function bn(e,t=null){try{if(t)return Et(await ft(t));let{dir:n,close:s}=await Fs(he(he(e.graphFile)));try{return Et(await ft(n))}finally{await s()}}catch{return[]}}function nw(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 oc(e,t){let n=V(t),s=e.filter(a=>tw.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,wo),i=o.length>wo?`
147
147
  \u2026+${o.length-wo} 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
- (${Hb(s)})`}function nc(e,t){let n=V(t),s=e.filter(a=>Vb.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,wo).join(", ")}`),r.length){let a=r.length>wo?`, +${r.length-wo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,wo).join(", ")}${a}`)}return i.push(`(${Hb(s)})`),i.join(`
151
- `)}var Vb,wo,yo=O(()=>{Ue();Be();Vb=new Set(["rdfs:subClassOf","rdf:type"]),wo=40});async function qb(e,{graph:t,svc:n,config:s}){let o=st(e,"symbol"),{match:r,candidates:i}=on(n.graph,o);if(r)return gl(t,r,{candidates:i});let a=nc(await bn(s),o);if(a)return a;St(n,o,"symbol")}var Kb=O(()=>{Le();yo();Ve()});async function Yb(e,{graph:t,svc:n,repoRoot:s}){let o=st(e,"symbol"),{match:r,candidates:i}=St(n,o,"symbol"),a=Tt(r);if(!a)throw new Re(`"${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 l;try{l=await us({readFile:_e,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:qr})}catch(b){throw b instanceof Re?b:new Re(`could not read ${a.path} (${b?.code||b?.message||b})`)}let{text:c,truncated:u}=l,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,f=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,p=u?`
152
- \u2026 (truncated to ${qr} lines; full span ${d})`:"",h=i.length?`
153
- (other matches: ${i.map(b=>b.label).join(", ")})`:"",m=yl(t,r);return`${f}
150
+ (${nw(s)})`}function rc(e,t){let n=V(t),s=e.filter(a=>tw.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,wo).join(", ")}`),r.length){let a=r.length>wo?`, +${r.length-wo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,wo).join(", ")}${a}`)}return i.push(`(${nw(s)})`),i.join(`
151
+ `)}var tw,wo,yo=O(()=>{Ue();Be();tw=new Set(["rdfs:subClassOf","rdf:type"]),wo=40});async function sw(e,{graph:t,svc:n,config:s}){let o=st(e,"symbol"),{match:r,candidates:i}=on(n.graph,o);if(r)return El(t,r,{candidates:i});let a=rc(await bn(s),o);if(a)return a;St(n,o,"symbol")}var ow=O(()=>{Le();yo();Ve()});async function rw(e,{graph:t,svc:n,repoRoot:s}){let o=st(e,"symbol"),{match:r,candidates:i}=St(n,o,"symbol"),a=Tt(r);if(!a)throw new Re(`"${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 l;try{l=await us({readFile:_e,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Kr})}catch(b){throw b instanceof Re?b:new Re(`could not read ${a.path} (${b?.code||b?.message||b})`)}let{text:c,truncated:u}=l,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,f=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,p=u?`
152
+ \u2026 (truncated to ${Kr} lines; full span ${d})`:"",h=i.length?`
153
+ (other matches: ${i.map(b=>b.label).join(", ")})`:"",m=jl(t,r);return`${f}
154
154
  ${c}${p}${m?`
155
- ${m}`:""}${h}`}var Xb=O(()=>{Rt();Gt();da();Le();Ve()});var Jb,Qb=O(()=>{Le();Ve();Jb=it(dh)});function Zb(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"module"),"module");return eh(t,s)}var ew=O(()=>{Le();Ve()});async function tw(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Re("query is required");let r=lh(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=nc(await bn(n),s);if(i)return i}return r}var nw=O(()=>{Gt();Le();yo()});async function sw(e,{graph:t,svc:n,config:s}){let o=st(e,"class"),{match:r}=on(n.graph,o);if(r)return uh(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=tc(await bn(s),o);if(i)return i;St(n,o,"class")}var ow=O(()=>{Le();yo();Ve()});async function rw(e,{graph:t,svc:n,config:s}){let o=st(e,"class"),{match:r}=on(n.graph,o);if(r)return ph(t,r);let i=tc(await bn(s),o);if(i)return i;St(n,o,"class")}var iw=O(()=>{Le();yo();Ve()});function SA(e,{conceptBase:t="concept:",relationMap:n=EA}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=b=>{r.has(b)||r.set(b,b)},a=b=>{let g=b;for(;r.get(g)!==g;)g=r.get(g);for(;r.get(b)!==g;){let y=r.get(b);r.set(b,g),b=y}return g},l=(b,g)=>{let y=a(b),w=a(g);y!==w&&(y<w?r.set(w,y):r.set(y,w))},c=[];for(let b of e){let g=b.predicate;if(!s.has(g)&&!o.has(g))continue;let y=V(b.subject),w=V(b.object);!y||!w||(i(y),i(w),s.has(g)?l(y,w):c.push({s:y,o:w}))}let u=b=>t+b.replace(/ /g,"_"),d=new Map;for(let b of r.keys()){let g=a(b);d.has(g)||d.set(g,new Set),d.get(g).add(b)}let f=[];for(let[b,g]of d){let y=[...g].sort();f.push({id:u(b),prefLabel:b,altLabels:y.filter(w=>w!==b)})}f.sort((b,g)=>b.id<g.id?-1:b.id>g.id?1:0);let p=new Set,h=[];for(let{s:b,o:g}of c){let y=u(a(b)),w=u(a(g));if(y===w)continue;let v=y<w?`${y}\0${w}`:`${w}\0${y}`;p.has(v)||(p.add(v),h.push({subject:y,object:w}))}return h.sort((b,g)=>`${b.subject}${b.object}`<`${g.subject}${g.object}`?-1:1),{concepts:f,related:h,conceptIdForTerm:b=>{let g=V(b);return r.has(g)?u(a(g)):null},namespace:xA}}function Rd(e,t,n={}){let s=SA(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=V(t),l=[i.prefLabel,...i.altLabels].filter(u=>u!==a),c=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:l,related:c}}var xA,EA,Td=O(()=>{Yt();xA="http://www.w3.org/2004/02/skos/core#",EA={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Ad(e,{config:t,memoryBackend:n=null}){let s=st(e,"term"),o=Rd(await bn(t,n),s);if(!o)throw new Re(`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)"),Os({content:r.join(`
156
- `),data:o})}var aw=O(()=>{Gt();Td();yo();Ve();Ad.ownsGraphLoad=!0});function FA(e,t){let n=[];for(let s of t||[])s?.predicate===kA&&V(s.subject)===e&&n.push(V(s.object));return n}function sc(e,t){let n=V(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of FA(i,t))s.has(a)||o.push(a)}}return r}var kA,jA,_A,RA,TA,AA,IA,CA,OA,LA,NA,PA,MA,cw,Id=O(()=>{Yt();kA="rdfs:subClassOf",jA='<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>',_A='<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>',RA='<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>',TA='<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>',AA='<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>',IA='<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>',CA='<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>',OA='<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>',LA='<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>',NA='<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>',PA='<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>',MA='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',cw=Object.freeze({spider:jA,fly:_A,egg:RA,poodle:TA,dog:AA,animal:IA,room:CA,furniture:OA,portable:LA,person:NA,adventurer:PA,container:MA})});function DA(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function lw(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 DA(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var uw=O(()=>{});function zA(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function UA(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function hw(e){return UA(e).filter(t=>t?.property&&t.value!==void 0)}function BA(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function WA(e,t){let n=null,s=0;for(let o of e){let r=hw(o);r.length<=s||BA(r,t)&&(n=o,s=r.length)}return n}function GA(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 dw(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(l=>l.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,l.object));if(!i)continue;let a=GA(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function VA(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function pw(e,t){let n=t;for(let s of VA(e))n=n.split(s).join("");return n}function fw(e,t,n){let s=zA(e,n),o=WA(s,t);if(o&&!o.parameters)return o.svg;if(o)return pw(o,dw(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let l=dw(a,t);if(l)return l}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?pw(i,i.svg):null}function HA(e,t,n,s,o,r){for(let a of sc(e,t)){let l=fw(a,n,s);if(l)return l;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=fw(r,n,s);return i||o[r]}function mw(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=HA(e,t,n,s,o,r);return i?lw(a,i):a}var lF,uF,Cd=O(()=>{Id();uw();lF=Object.freeze(["left","half-left","half-right","right"]),uF=Object.freeze(["moving"])});function Od(e){for(let t of e||[])if(t?.predicate===qA&&Object.prototype.hasOwnProperty.call(gw,t.object))return gw[t.object];return 1}var qA,gw,bw=O(()=>{qA="mgx:hasProperty",gw=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function ww(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},l=a.resolveSpriteAsset;if(typeof l!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let c=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],f=a.rootFallback||"animal",p=a.classAncestorChain,h=a.sizeScaleFor,m=a.expressionPalette,b=[];r&&b.push({predicate:n,object:r}),i&&b.push({predicate:s,object:i});let g={rootFallback:f};a.instanceKey&&(g.instanceKey=a.instanceKey);let y=l(o,d,b,c,u,g),w=R=>l(R,[],b,c,{},{rootFallback:R}),v=R=>Object.prototype.hasOwnProperty.call(u,R),k=(R,_)=>{let I=c.filter(F=>F&&Array.isArray(F.classes)&&F.classes.indexOf(R)>=0),T=I.find(F=>F.svg===_)||I.find(F=>!F.match&&F.parameters)||null;return T?{classes:T.classes.slice(),parameters:Object.keys(T.parameters||{}).sort(),match:T.match||null}:null},$=null,x=null;if(typeof p=="function"){$=[];for(let R of p(o,d)){let _=w(R);if($.push({term:R,template:!!_,registry:v(R)}),_){x={term:R,via:"template",hops:$.length-1,root:!1,template:k(R,_)};break}if(v(R)){x={term:R,via:"registry",hops:$.length-1,root:!1,template:null};break}}if(!x){let R=w(f);$.push({term:f,template:!!R,registry:v(f),root:!0}),x={term:f,via:R?"template":"registry",hops:$.length-1,root:!0,template:R?k(f,R):null}}}let E=a.instanceKey?l(o,d,b,c,u,{rootFallback:f}):y,S=r?l(o,d,b.filter(R=>R.predicate!==n),c,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof h=="function"?h(b):1,sizeKnown:i&&typeof h=="function"?h([{predicate:s,object:i}])!==1:null,expressionKnown:r&&m?Object.prototype.hasOwnProperty.call(m,r):null,expressionApplied:r?E!==S:null,rootFallback:f,fellBackToRoot:x?!!x.root:null,chain:$,matched:x}}var yw=O(()=>{});var $w,vw,KA,mF,xw=O(()=>{Cd();$w="icon tier",vw="sprite tier",KA=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."})}),mF=Object.freeze(Object.values(KA).map(e=>e.predicate))});var Ew,Sw=O(()=>{Ew=()=>[]});var kw,jw=O(()=>{kw=()=>[]});function QA(){let e=kw();return e.length?{templates:e,tier:vw}:{templates:Ew(),tier:$w}}function _w(e){return e.map(t=>t.term).join(" -> ")}async function Ld(e,{config:t,memoryBackend:n=null}){let s=st(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Oo,o))throw new Re(`"${o}" is not a sprite expression. The palette holds: ${XA().join(", ")}.`);if(r&&!JA(r))throw new Re(`"${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}=QA(),l=await bn(t,n),c=ww({class:s,expression:o,size:r},{factRows:l,templates:i,spriteRegistry:cw,resolveSpriteAsset:mw,classAncestorChain:sc,sizeScaleFor:Od,expressionPalette:Oo});if(!c.svg||c.fellBackToRoot)throw new Re(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${_w(c.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!c.expressionApplied)throw new Re(`the ${a} draws "${s}" (matched at "${c.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,c.matched.hops===0?`matched at "${c.matched.term}", the class itself, via its own ${c.matched.via}`:`matched at "${c.matched.term}", ${c.matched.hops} hop(s) up the ancestor chain, via its ${c.matched.via}`,`ancestor chain walked: ${_w(c.chain)}`];return c.matched.template?.parameters.length&&d.push(`template parameters: ${c.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${c.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${c.svg.length} characters of SVG markup`),Os({content:d.join(`
157
- `),data:{class:c.class,expression:c.expression,size:c.size,tier:a,scale:c.scale,svg:c.svg,chain:c.chain,matched:c.matched,expressionApplied:c.expressionApplied}})}var YA,XA,JA,Rw=O(()=>{Gt();Id();Cd();el();bw();yw();xw();Sw();jw();yo();Ve();YA="mgx:hasProperty",XA=()=>Object.keys(Oo).sort(),JA=e=>!!e&&Od([{predicate:YA,object:String(e)}])!==1;Ld.ownsGraphLoad=!0});function Tw(e,{graph:t}){return fh(t,{pkg:String(e?.package||"").trim()})}var Aw=O(()=>{Le()});function Iw(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"module"),"module");return Lh(t,s)}var Cw=O(()=>{Le();Ve()});function Ow(e,{graph:t,codeDomainActive:n=null}){return gh(t,{codeDomainActive:n})}var Lw=O(()=>{Le()});function Pw(e,t){return Os({content:e,data:t,text:`${e}${Nw}${JSON.stringify(t,null,2)}`})}function Mw(e,{graph:t}){let{content:n,tmct_ask:s}=As(t,st(e,"query"));return Pw(n,s)}var Nw,oc=O(()=>{Is();Ve();Nw=`
155
+ ${m}`:""}${h}`}var iw=O(()=>{Rt();Vt();ha();Le();Ve()});var aw,cw=O(()=>{Le();Ve();aw=it(vh)});function lw(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"module"),"module");return uh(t,s)}var uw=O(()=>{Le();Ve()});async function dw(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Re("query is required");let r=yh(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=rc(await bn(n),s);if(i)return i}return r}var pw=O(()=>{Vt();Le();yo()});async function fw(e,{graph:t,svc:n,config:s}){let o=st(e,"class"),{match:r}=on(n.graph,o);if(r)return $h(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=oc(await bn(s),o);if(i)return i;St(n,o,"class")}var hw=O(()=>{Le();yo();Ve()});async function mw(e,{graph:t,svc:n,config:s}){let o=st(e,"class"),{match:r}=on(n.graph,o);if(r)return xh(t,r);let i=oc(await bn(s),o);if(i)return i;St(n,o,"class")}var gw=O(()=>{Le();yo();Ve()});function IA(e,{conceptBase:t="concept:",relationMap:n=AA}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=b=>{r.has(b)||r.set(b,b)},a=b=>{let g=b;for(;r.get(g)!==g;)g=r.get(g);for(;r.get(b)!==g;){let y=r.get(b);r.set(b,g),b=y}return g},l=(b,g)=>{let y=a(b),w=a(g);y!==w&&(y<w?r.set(w,y):r.set(y,w))},c=[];for(let b of e){let g=b.predicate;if(!s.has(g)&&!o.has(g))continue;let y=V(b.subject),w=V(b.object);!y||!w||(i(y),i(w),s.has(g)?l(y,w):c.push({s:y,o:w}))}let u=b=>t+b.replace(/ /g,"_"),d=new Map;for(let b of r.keys()){let g=a(b);d.has(g)||d.set(g,new Set),d.get(g).add(b)}let f=[];for(let[b,g]of d){let y=[...g].sort();f.push({id:u(b),prefLabel:b,altLabels:y.filter(w=>w!==b)})}f.sort((b,g)=>b.id<g.id?-1:b.id>g.id?1:0);let p=new Set,h=[];for(let{s:b,o:g}of c){let y=u(a(b)),w=u(a(g));if(y===w)continue;let v=y<w?`${y}\0${w}`:`${w}\0${y}`;p.has(v)||(p.add(v),h.push({subject:y,object:w}))}return h.sort((b,g)=>`${b.subject}${b.object}`<`${g.subject}${g.object}`?-1:1),{concepts:f,related:h,conceptIdForTerm:b=>{let g=V(b);return r.has(g)?u(a(g)):null},namespace:TA}}function Nd(e,t,n={}){let s=IA(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=V(t),l=[i.prefLabel,...i.altLabels].filter(u=>u!==a),c=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:l,related:c}}var TA,AA,Pd=O(()=>{Mt();TA="http://www.w3.org/2004/02/skos/core#",AA={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function Md(e,{config:t,memoryBackend:n=null}){let s=st(e,"term"),o=Nd(await bn(t,n),s);if(!o)throw new Re(`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)"),Os({content:r.join(`
156
+ `),data:o})}var bw=O(()=>{Vt();Pd();yo();Ve();Md.ownsGraphLoad=!0});function VA(e,t){let n=[];for(let s of t||[])s?.predicate===CA&&V(s.subject)===e&&n.push(V(s.object));return n}function ic(e,t){let n=V(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of VA(i,t))s.has(a)||o.push(a)}}return r}var CA,OA,LA,NA,PA,MA,FA,DA,zA,UA,BA,WA,GA,ww,Fd=O(()=>{Mt();CA="rdfs:subClassOf",OA='<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>',LA='<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>',NA='<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>',PA='<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>',MA='<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>',FA='<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>',DA='<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>',zA='<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>',UA='<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>',BA='<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>',WA='<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>',GA='<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>',ww=Object.freeze({spider:OA,fly:LA,egg:NA,poodle:PA,dog:MA,animal:FA,room:DA,furniture:zA,portable:UA,person:BA,adventurer:WA,container:GA})});function HA(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function yw(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 HA(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var $w=O(()=>{});function qA(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function KA(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function Sw(e){return KA(e).filter(t=>t?.property&&t.value!==void 0)}function YA(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function XA(e,t){let n=null,s=0;for(let o of e){let r=Sw(o);r.length<=s||YA(r,t)&&(n=o,s=r.length)}return n}function JA(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 vw(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(l=>l.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,l.object));if(!i)continue;let a=JA(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function QA(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 xw(e,t){let n=t;for(let s of QA(e))n=n.split(s).join("");return n}function Ew(e,t,n){let s=qA(e,n),o=XA(s,t);if(o&&!o.parameters)return o.svg;if(o)return xw(o,vw(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let l=vw(a,t);if(l)return l}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?xw(i,i.svg):null}function ZA(e,t,n,s,o,r){for(let a of ic(e,t)){let l=Ew(a,n,s);if(l)return l;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Ew(r,n,s);return i||o[r]}function kw(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=ZA(e,t,n,s,o,r);return i?yw(a,i):a}var TF,AF,Dd=O(()=>{Fd();$w();TF=Object.freeze(["left","half-left","half-right","right"]),AF=Object.freeze(["moving"])});function zd(e){for(let t of e||[])if(t?.predicate===eI&&Object.prototype.hasOwnProperty.call(jw,t.object))return jw[t.object];return 1}var eI,jw,_w=O(()=>{eI="mgx:hasProperty",jw=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function Rw(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},l=a.resolveSpriteAsset;if(typeof l!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let c=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],f=a.rootFallback||"animal",p=a.classAncestorChain,h=a.sizeScaleFor,m=a.expressionPalette,b=[];r&&b.push({predicate:n,object:r}),i&&b.push({predicate:s,object:i});let g={rootFallback:f};a.instanceKey&&(g.instanceKey=a.instanceKey);let y=l(o,d,b,c,u,g),w=R=>l(R,[],b,c,{},{rootFallback:R}),v=R=>Object.prototype.hasOwnProperty.call(u,R),k=(R,_)=>{let I=c.filter(F=>F&&Array.isArray(F.classes)&&F.classes.indexOf(R)>=0),T=I.find(F=>F.svg===_)||I.find(F=>!F.match&&F.parameters)||null;return T?{classes:T.classes.slice(),parameters:Object.keys(T.parameters||{}).sort(),match:T.match||null}:null},$=null,x=null;if(typeof p=="function"){$=[];for(let R of p(o,d)){let _=w(R);if($.push({term:R,template:!!_,registry:v(R)}),_){x={term:R,via:"template",hops:$.length-1,root:!1,template:k(R,_)};break}if(v(R)){x={term:R,via:"registry",hops:$.length-1,root:!1,template:null};break}}if(!x){let R=w(f);$.push({term:f,template:!!R,registry:v(f),root:!0}),x={term:f,via:R?"template":"registry",hops:$.length-1,root:!0,template:R?k(f,R):null}}}let E=a.instanceKey?l(o,d,b,c,u,{rootFallback:f}):y,S=r?l(o,d,b.filter(R=>R.predicate!==n),c,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof h=="function"?h(b):1,sizeKnown:i&&typeof h=="function"?h([{predicate:s,object:i}])!==1:null,expressionKnown:r&&m?Object.prototype.hasOwnProperty.call(m,r):null,expressionApplied:r?E!==S:null,rootFallback:f,fellBackToRoot:x?!!x.root:null,chain:$,matched:x}}var Tw=O(()=>{});var Aw,Iw,tI,NF,Cw=O(()=>{Dd();Aw="icon tier",Iw="sprite tier",tI=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."})}),NF=Object.freeze(Object.values(tI).map(e=>e.predicate))});var Ow,Lw=O(()=>{Ow=()=>[]});var Nw,Pw=O(()=>{Nw=()=>[]});function rI(){let e=Nw();return e.length?{templates:e,tier:Iw}:{templates:Ow(),tier:Aw}}function Mw(e){return e.map(t=>t.term).join(" -> ")}async function Ud(e,{config:t,memoryBackend:n=null}){let s=st(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(Oo,o))throw new Re(`"${o}" is not a sprite expression. The palette holds: ${sI().join(", ")}.`);if(r&&!oI(r))throw new Re(`"${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}=rI(),l=await bn(t,n),c=Rw({class:s,expression:o,size:r},{factRows:l,templates:i,spriteRegistry:ww,resolveSpriteAsset:kw,classAncestorChain:ic,sizeScaleFor:zd,expressionPalette:Oo});if(!c.svg||c.fellBackToRoot)throw new Re(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${Mw(c.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!c.expressionApplied)throw new Re(`the ${a} draws "${s}" (matched at "${c.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,c.matched.hops===0?`matched at "${c.matched.term}", the class itself, via its own ${c.matched.via}`:`matched at "${c.matched.term}", ${c.matched.hops} hop(s) up the ancestor chain, via its ${c.matched.via}`,`ancestor chain walked: ${Mw(c.chain)}`];return c.matched.template?.parameters.length&&d.push(`template parameters: ${c.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${c.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${c.svg.length} characters of SVG markup`),Os({content:d.join(`
157
+ `),data:{class:c.class,expression:c.expression,size:c.size,tier:a,scale:c.scale,svg:c.svg,chain:c.chain,matched:c.matched,expressionApplied:c.expressionApplied}})}var nI,sI,oI,Fw=O(()=>{Vt();Fd();Dd();al();_w();Tw();Cw();Lw();Pw();yo();Ve();nI="mgx:hasProperty",sI=()=>Object.keys(Oo).sort(),oI=e=>!!e&&zd([{predicate:nI,object:String(e)}])!==1;Ud.ownsGraphLoad=!0});function Dw(e,{graph:t}){return Eh(t,{pkg:String(e?.package||"").trim()})}var zw=O(()=>{Le()});function Uw(e,{graph:t,svc:n}){let{match:s}=St(n,st(e,"module"),"module");return Gh(t,s)}var Bw=O(()=>{Le();Ve()});function Ww(e,{graph:t,codeDomainActive:n=null}){return jh(t,{codeDomainActive:n})}var Gw=O(()=>{Le()});function Hw(e,t){return Os({content:e,data:t,text:`${e}${Vw}${JSON.stringify(t,null,2)}`})}function qw(e,{graph:t}){let{content:n,tmct_ask:s}=As(t,st(e,"query"));return Hw(n,s)}var Vw,ac=O(()=>{Is();Ve();Vw=`
158
158
 
159
159
  ---tmct_ask---
160
- `});var Fw,Dw=O(()=>{Le();Ve();Fw=it(mh)});var zw,Uw=O(()=>{Le();Ve();zw=it(bh)});var Bw,Ww=O(()=>{Le();Ve();Bw=it(Sh)});var Gw,Vw=O(()=>{Le();Ve();Gw=it(jh)});var Hw,qw=O(()=>{Le();Ve();Hw=it(_h)});var Kw,Yw=O(()=>{Le();Ve();Kw=it(yh)});var Xw,Jw=O(()=>{Le();Ve();Xw=it($h)});var Qw,Zw=O(()=>{Le();Ve();Qw=it(xh)});var ey,ty=O(()=>{Le();Ve();ey=it(Oh)});function ZA(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function eI(e){let t=(e||[]).map(ZA);return t.map(n=>JSON.stringify(n)).join(`
160
+ `});var Kw,Yw=O(()=>{Le();Ve();Kw=it(kh)});var Xw,Jw=O(()=>{Le();Ve();Xw=it(_h)});var Qw,Zw=O(()=>{Le();Ve();Qw=it(Lh)});var ey,ty=O(()=>{Le();Ve();ey=it(Ph)});var ny,sy=O(()=>{Le();Ve();ny=it(Mh)});var oy,ry=O(()=>{Le();Ve();oy=it(Th)});var iy,ay=O(()=>{Le();Ve();iy=it(Ah)});var cy,ly=O(()=>{Le();Ve();cy=it(Ch)});var uy,dy=O(()=>{Le();Ve();uy=it(Wh)});function iI(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function aI(e){let t=(e||[]).map(iI);return t.map(n=>JSON.stringify(n)).join(`
161
161
  `)+(t.length?`
162
- `:"")}function ny(e){return eI(Et(e))}var sy=O(()=>{Be()});async function Nd(e,{config:t,memoryBackend:n=null}){let s=n?null:await Fs(he(he(t.graphFile))),o=n||s.dir;try{return ny(await ft(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var oy=O(()=>{sy();Ue();Be();Nd.ownsGraphLoad=!0});async function Pd(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 Fs(he(he(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0}),l=a.extracted.length+a.optimistic.length,c=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${l} fact(s) grounded.`;return Os({content:l?`${c}
162
+ `:"")}function py(e){return aI(Et(e))}var fy=O(()=>{Be()});async function Bd(e,{config:t,memoryBackend:n=null}){let s=n?null:await Fs(he(he(t.graphFile))),o=n||s.dir;try{return py(await ft(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var hy=O(()=>{fy();Ue();Be();Bd.ownsGraphLoad=!0});async function Wd(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 Fs(he(he(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0}),l=a.extracted.length+a.optimistic.length,c=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${l} fact(s) grounded.`;return Os({content:l?`${c}
163
163
  ${a.canonical.join(`
164
- `)}`:c,data:{...a,grounded:l}})}finally{await i()}}var ry=O(()=>{Ue();Be();Ve();Pd.ownsGraphLoad=!0});var tI,iy=O(()=>{lu();ag();Kb();Xb();Qb();ew();nw();ow();iw();aw();Rw();Aw();Cw();Lw();oc();Dw();Uw();Ww();Vw();qw();Yw();Jw();Zw();ty();oy();ry();tI=Object.freeze({tmct_context:cu,tmct_context_more:ig,tmct_describe:qb,tmct_snippet:Yb,tmct_signature:Jb,tmct_impact:Zb,tmct_search:tw,tmct_members:sw,tmct_subclasses:rw,tmct_related:Ad,tmct_sprite:Ld,tmct_architecture:Tw,tmct_exports:Iw,tmct_untested:Ow,tmct_ask:Mw,tmct_tests_for:Fw,tmct_history:zw,tmct_file_history:Bw,tmct_method_history:Gw,tmct_class_history:Hw,tmct_callers:Kw,tmct_callees:Xw,tmct_calls:Qw,tmct_cochanges:ey,tmct_export:Nd,tmct_ingest:Pd})});var Md=O(()=>{});var rc,Fd=O(()=>{rc=()=>({relations:[],constructions:[]})});var ay,cy=O(()=>{Rt();Ue();yf();Gt();Ar();Is();ha();ma();iy();oc();Ve();Go();ta();Md();Fd();ma();lu();oc();na(void 0);ea(rc);ay=wf.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var wz,yz,$z,ic=O(()=>{wz=Object.freeze(["entity","set","event","measure"]),yz=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),$z=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 ht,xz,Ez,Sz,kz,jz,_z,Rz,Tz,Az,Iz,Cz,Oz,Lz,Nz,Pz,Mz,nI,Fz,Dz,ly=O(()=>{ht=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},xz=ht("createRequire"),Ez=ht("readFileSync"),Sz=ht("access"),kz=ht("readFile"),jz=ht("writeFile"),_z=ht("appendFile"),Rz=ht("mkdir"),Tz=ht("mkdtemp"),Az=ht("rename"),Iz=ht("unlink"),Cz=ht("rm"),Oz=ht("stat"),Lz=ht("copyFile"),Nz=ht("readdir"),Pz=ht("createReadStream"),Mz=ht("createWriteStream"),nI=ht("randomBytes"),Fz=ht("spawnSync"),Dz=ht("createInterface")});var ac=O(()=>{ly()});var mt,Wz,Gz,Vz,Hz,qz,Kz,Yz,Xz,Jz,Qz,Zz,e2,t2,n2,s2,o2,Ot,r2,i2,a2,zs=O(()=>{mt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},Wz=mt("createRequire"),Gz=mt("readFileSync"),Vz=mt("access"),Hz=mt("readFile"),qz=mt("writeFile"),Kz=mt("appendFile"),Yz=mt("mkdir"),Xz=mt("mkdtemp"),Jz=mt("rename"),Qz=mt("unlink"),Zz=mt("rm"),e2=mt("stat"),t2=mt("copyFile"),n2=mt("readdir"),s2=mt("createReadStream"),o2=mt("createWriteStream"),Ot=e=>String(e),r2=mt("randomBytes"),i2=mt("spawnSync"),a2=mt("createInterface")});var by={};Wt(by,{PHRASEBOOK_FILE:()=>py,TECHNICAL_SLOTS:()=>zd,TEMPLATES_FILE:()=>dy,flatten:()=>Bd,loadPhrasebook:()=>iI,loadTemplates:()=>Wd,loadTemplatesMerged:()=>rI,render:()=>gy,renderSegments:()=>my,slotKind:()=>hy,slotsOf:()=>Ud});function Ud(e){let t=[];for(let n of String(e).matchAll(fy))t.includes(n[1])||t.push(n[1]);return t}function hy(e){return oI[e]||"entity"}function Bd(e){let t="";for(let n of e)t+=n.text;return t}function my(e,t={},n=mi){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(fy.source,"g"),a=[],l=0,c;for(;(c=i.exec(r))!==null;)c.index>l&&a.push({type:"prose",text:r.slice(l,c.index)}),a.push({type:hy(c[1]),text:String(t[c[1]])}),l=c.index+c[0].length;return l<r.length&&a.push({type:"prose",text:r.slice(l)}),a}async function Wd(e=dy){let t=await _e(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(l){throw new Error(`${e}:${o+1}: not valid JSON: ${l.message}`)}for(let l of["id","class","template","register"])if(typeof i[l]!="string"||!i[l])throw new Error(`${e}:${o+1}: missing/empty "${l}"`);if(!sI.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=Ud(i.template);if(i.register==="technical"){let l=a.filter(c=>!zd.has(c));if(l.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${l.length>1?"s":""}: ${l.join(", ")} (allowed: ${[...zd].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 mi=n,n}async function rI(e=[]){let t=mi,n=new Map;try{for(let s of e){let o=await Wd(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{mi=t}return n}function gy(e,t={},n=mi){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Bd(my(e,t,n))}async function iI(e=py){let t=await _e(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(l=>l.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:Ud(i)})}}return{patterns:n,synonyms:s}}var aI,uy,dy,py,sI,fy,zd,oI,mi,cc=O(()=>{Rt();zs();Ue();aI={},uy=Z(he(Ot(aI.url)),"..","..",".."),dy=Z(uy,"data","templates","responses.jsonl"),py=Z(uy,"data","phrasebook","software-phrases.txt"),sI=new Set(["terse","friendly","technical"]),fy=/\{([A-Za-z][A-Za-z0-9]*)\}/g,zd=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));oI={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};mi=null});function lI(e,t={}){let n=cI.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function uI(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>lI(s,t))):1}function Ye(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:uI(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 cI,wy=O(()=>{cI=/^src:corpus:(.+)$/});var gt,f2,mr,h2,m2,g2,b2,w2,y2,$2,v2,x2,E2,S2,k2,yy,dI,j2,_2,R2,$o=O(()=>{gt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},f2=gt("createRequire"),mr=gt("readFileSync"),h2=gt("access"),m2=gt("readFile"),g2=gt("writeFile"),b2=gt("appendFile"),w2=gt("mkdir"),y2=gt("mkdtemp"),$2=gt("rename"),v2=gt("unlink"),x2=gt("rm"),E2=gt("stat"),S2=gt("copyFile"),k2=gt("readdir"),yy=gt("createReadStream"),dI=gt("createWriteStream"),j2=gt("randomBytes"),_2=gt("spawnSync"),R2=gt("createInterface")});function $y(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 mI(e=fI){let t=mo(mr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Gd(){if(lc===null)try{lc=mI()}catch{lc=[]}return lc}var gI,pI,fI,hI,N2,lc,Vd=O(()=>{$o();zs();Ue();Ua();cc();gI={},pI=he(Ot(gI.url)),fI=Z(pI,"..","..","data","templates","grammar-rules.toml"),hI=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),N2=Object.freeze(new Set(hI.filter(e=>e!=="prose")));lc=null});function bI(){if(gi!==void 0)return gi;try{let e=vy?vy():wI();gi=e&&e.winkNLP&&e.model?e:null}catch{gi=null}return gi}function wI(){let e=process.getBuiltinModule("node:module").createRequire(yI.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Hd(){if(gr!==void 0)return gr;let e=bI();if(!e)return gr=null,null;try{gr=e.winkNLP(e.model)}catch{gr=null}return gr}var yI,vy,gi,gr,qd=O(()=>{yI={}});var xy=O(()=>{qd()});var Sy,Ey=O(()=>{Sy={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:{},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:{},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 Cy={};Wt(Cy,{CODE_REF_SHAPE:()=>Zd,DETERMINERS:()=>Yd,OF_CLASSIFIER_HEADS:()=>_y,OF_PARTITIVE_HEADS:()=>Ry,QUANTIFIERS:()=>Xd,classify:()=>tp,loadLexicon:()=>_n,lookupAdjective:()=>dc,lookupNoun:()=>Vn,lookupProperName:()=>bi,lookupVerb:()=>uc,numberOf:()=>Jd,predicateOf:()=>Qd,readsAsIndividualName:()=>ep,thirdPerson:()=>Ty,withProperNames:()=>Iy});function Jd(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):vI[t]??null}function Ty(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 Qd(e,t=jy){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${Ty(e.lemma)}${n}`}function Ay(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function ky(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!xI.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(!EI.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function _n(e,t=jy){if(!e&&Kd.has(t))return Kd.get(t);let n=Sy,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return ky(s,n),e?(ky(s,e),s):(Kd.set(t,s),s)}function Iy(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 Vn(e,t,n={}){return SI(e,t,n)[0]??null}function SI(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,l=c=>{c&&!a.has(c.lemma)&&(a.add(c.lemma),i.push(c))};if(r){let c=e.nouns.get(r)??null;return n.singularOnly&&o?(l(o),l(c)):(l(c),l(o)),i}for(let c of Ay(s))l(e.nouns.get(c));return i}function uc(e,t){return kI(e,t)[0]??null}function kI(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of Ay(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function dc(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function bi(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function ep(e,t){let n=String(e??"");if(!n)return!1;if(bi(t,n)||Zd.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=Vn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function tp(e,t=_n()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(Yd[s])return{pos:"determiner",type:Yd[s]};if(Xd[s])return{pos:"quantifier",type:Xd[s]};let o=Jd(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=bi(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=Vn(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=uc(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:Qd(a,t.ns),...a.prep?{prep:a.prep}:{}};let l=dc(t,s);return l?{pos:"adjective",type:l.type,lemma:l.lemma}:null}var jy,Yd,Xd,_y,Ry,vI,xI,EI,Kd,Zd,Us=O(()=>{Ey();jy="tmct:",Yd=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),Xd=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),_y=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Ry=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),vI=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});xI=new Set(["data","object"]),EI=new Set(["subclass","data"]);Kd=new Map;Zd=/[./\\#:@]/});var G2,V2,H2,jI,q2,K2,Y2,Oy=O(()=>{Is();Le();G2=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),V2=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),H2=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`]}),jI=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"}),q2=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"]}),K2=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"}}),Y2=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 pc(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 My(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 RI(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function Ny(e,t){let n=Vn(t,e);return n?V(n.lemma):e}function Fy(e,t){let n=RI(String(e??"")).match(_I);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(TI.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&&Ny(d,t);if(f&&(II.has(f)||CI.has(f))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&AI.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=Ny(i,t);if(Ly.has(i)||Ly.has(a))return null;let l=Vn(t,i);if(!l)return null;let c=V(l.lemma);return s&&(!/s$/.test(i)||V(i)===c)?null:c}var Py,_I,TI,Ly,AI,II,CI,wi=O(()=>{Yt();Us();Oy();Py=400;_I=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;TI=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),Ly=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"]),AI=new Set(["a","an","the"]),II=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"]),CI=new Set(["either","one","each","both","any"])});var fc,hc=O(()=>{fc=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var OI,cU,Dy=O(()=>{$o();hc();zs();Ue();wi();OI={},cU=Z(he(Ot(OI.url)),"..","..","..")});function zy(e,t){return`research:${e}:${V(t)}`}function Uy(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");LI.set(e.name,{name:e.name,create:e.create})}var pU,LI,By=O(()=>{Yt();wi();pU=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"]);LI=new Map});function Wy({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1}={}){let i=e??((...g)=>globalThis.fetch(...g)),a=new Map,l=0,c=0,u=!1,d=()=>{if(!o)return null;let g={"Api-User-Agent":o};return typeof document>"u"&&(g["User-Agent"]=o),g};function f(g){let y=Number(g)*1e3;c=Date.now()+Math.max(y||0,s)}async function p(g){let y=typeof AbortController=="function"?new AbortController:null,w=y?setTimeout(()=>y.abort(),t):null;try{let v={};y&&(v.signal=y.signal);let k=d();k&&(v.headers=k);let $=await i(g,v);if($.status===429)return f($.headers?.get?.("retry-after")),null;if(!$.ok)return null;let x=await $.json();return x?.error?.code==="maxlag"?(f($.headers?.get?.("retry-after")),null):x}catch{return null}finally{w!==null&&clearTimeout(w)}}let h=()=>Math.max(c,l+n);async function m(){for(;;){let g=Date.now();if(!u&&g>=h())return l=g,u=!0,!0;if(!r)return!1;await new Promise(y=>setTimeout(y,Math.max(h()-g,25)))}}async function b(g,y){if(a.has(g))return a.get(g);if(!await m())return null;let w=null;try{w=await y()}catch{w=null}finally{u=!1}return a.set(g,w),w}return{fetchJson:p,cachedFetch:b}}var Gy=O(()=>{});function UI({fetchImpl:e,origin:t=MI,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=zI,waitForSlot:i=!1,sourceName:a=DI}={}){let l=Wy({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function c(f,p){let h=Array.isArray(p?.[1])?p[1]:[];for(let m of h){let b=V(m);if(b===f||b.startsWith(f))return String(m)}return null}async function u(f,p){let h=await l.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(p.replace(/ /g,"_"))}`);if(!h)return null;let m=String(h.extract??""),b=Number(h.revision),g={term:f,title:String(h.title??p),text:m,summary:My(m,Py),url:String(h.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(p.replace(/ /g,"_"))}`),revid:b},y=o;if(!y)try{y=_n()}catch{y=null}let w=y?Fy(m,y):null;return w&&(g.isa=w),pc(g)?g:null}async function d(f){let p=await l.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(f)}&limit=3`),h=p?c(f,p):null;return h?u(f,h):null}return{name:a,origin:t,provenanceTag(f){return zy(a,f)},async lookup(f){let p=String(f??"");return p?l.cachedFetch(p,()=>d(p)):null},async pageByTitle(f){let p=String(f??"").trim();return p?l.cachedFetch(`title\0${V(p)}`,()=>u(V(p),p)):null},async linkedTitles(f,{limit:p=25}={}){let h=String(f??"").trim();if(!h)return null;let m=await l.cachedFetch(`links\0${V(h)}`,async()=>{let g=(await l.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(h)}&section=0`))?.parse?.links;if(!Array.isArray(g))return null;let y=new Set,w=[];for(let v of g){if(!v||v.ns!==0||v.exists===!1)continue;let k=String(v.title??v["*"]??"").trim(),$=V(k);!k||!$||y.has($)||(y.add($),w.push(k))}return w});return Array.isArray(m)?m.slice(0,Math.max(0,p)):null}}}function BI(e={}){return UI({origin:FI,sourceName:Hy,waitForSlot:!0,...e})}var MI,FI,DI,Hy,zI,qy=O(()=>{Yt();Us();wi();By();Gy();MI="https://en.wikipedia.org",FI="https://simple.wikipedia.org",DI="wikipedia-live",Hy="simple-wikipedia",zI="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";Uy({name:Hy,create:BI})});var WI,GI,SU,np=O(()=>{Yt();Us();Go();WI=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3}),GI=["this","is","about","the"],SU=GI.length});var Ky=O(()=>{Rt();Ue()});var sp=O(()=>{Yt()});var VI,DU,Yy=O(()=>{$o();hc();zs();Ue();sp();Yt();VI={},DU=Z(he(Ot(VI.url)),"..","..","..")});var UU,BU,WU,Xy=O(()=>{UU=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),BU=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"})}),WU=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var Jy,mc,gc=O(()=>{Jy=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"]),mc=new Set([...Jy,"property","concept","idea","content"])});function yi(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 bc(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let l=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(HI);if(!l.length)break;let c=o?l.filter(d=>d===o||op(d,t).has(o)):[];a=(c.length?c:l)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function op(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 rp(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,rp(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function qI(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 KI(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let l=op(e,n),c=op(t,n);if(l.has(t)||c.has(e))return{distinct:!1,reason:"subsumes",lcs:l.has(t)?t:e};if(s.size)for(let m of l){let b=s.get(m);if(b){for(let g of c)if(b.has(g))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...l].filter(m=>c.has(m));if(!u.length)return l.size<2||c.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=m=>rp(m,n,o,new Set),f=u[0],p=d(f);for(let m of u){let b=d(m);(b>p||b===p&&m<f)&&(f=m,p=b)}if(p<=i)return{distinct:!0,reason:"root-subsumer",lcs:f};if(a){let m=a.get(f);return typeof m=="number"&&m<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 wc(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],l=n||yi(t),c=qI(s),u=new Map,d=new Map(a.map(y=>[y,y])),f=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},p=(y,w)=>{let v=f(y),k=f(w);v!==k&&d.set(v<k?k:v,v<k?v:k)},h=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let v=KI(a[y],a[w],l,c,u,{threshold:o,rootDepth:r,icByTerm:i});h.push({a:a[y],b:a[w],...v}),v.distinct||p(a[y],a[w])}let m=new Map;for(let y of a){let w=f(y);m.has(w)||m.set(w,[]),m.get(w).push(y)}let b=y=>rp(y,l,u,new Set),g=[...m.values()].map(y=>{let w=[...y].sort(),v=w[0],k=b(v);for(let $ of w){let x=b($);x>k&&(k=x,v=$)}return{objects:w,label:v}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:g.length>1,clusters:g,pairs:h}}var HI,yc=O(()=>{Xt();gc();HI=(e,t)=>e<t?-1:e>t?1:0});function ip(e){return typeof e=="string"&&YI.test(e)}function Qy(e){return!!e&&typeof e=="object"&&vo(e.s)}function ap(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&ip(e.world)&&vo(e.subject)&&vo(e.predicate)&&vo(e.object)}function cp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!ip(e.world)||!vo(e.name)||!JI.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(vo)}function lp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&ip(e.world)&&vo(e.opening)}function Zy(e){return ap(e)||cp(e)||lp(e)}function e$(e){let t=e||[],n=t.filter(c=>c.predicate===QI).sort((c,u)=>`${c.subject}\0${c.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(c=>c.predicate==="rdf:type").map(c=>c.subject)),o=new Map;for(let c of t)c.predicate==="mgx:located-in"&&o.set(c.subject,c.object);let r=(c,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===c&&o.get(d.subject)===u),i=t.find(c=>typeof c.world=="string"&&c.kind==="fact"),a=(c,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:c,predicate:u,object:d}),l=[];for(let c of n){let u=c.subject,d=c.object;if(r(d,u))continue;let f=d,p=1;for(;s.has(f);)p+=1,f=`${d}-${p}`;s.add(f),l.push(a(f,"rdf:type",d)),l.push(a(f,"rdf:type","portable")),l.push(a(f,"mgx:located-in",u))}return l.length?[...t,...l]:t}var YI,XI,JI,vo,QI,xo=O(()=>{YI=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,XI=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),JI=new Set(XI),vo=e=>typeof e=="string"&&e.trim()!=="";QI="mgx:default-contains"});var ZI,eC,tC,nC,sC,oC,rC,iC,aC,QU,cC,t$,ZU,eB,n$=O(()=>{Us();Uo();ZI="subClassOf",eC="typeAssertion",tC="relation",nC="someValuesFrom",sC="cardinality",oC="disjointWith",rC="possessive",iC="adjective",aC="capability",QU=Object.freeze([ZI,eC,tC,nC,sC,oC,rC,iC,aC]),cC=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),t$=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"]]),ZU=Math.max(...[...t$.keys()].map(e=>e.split(" ").length)),eB=[...new Set([...cC,...[...t$.keys()].map(e=>e.split(" ")[0])])]});var Eo=O(()=>{});var up=O(()=>{Le();Is();Eo()});function _t({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Bs.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 lC,Bs,$e,aB,vi,ot,zt,Jt,uC,s$,jt,dC,pC,o$,cB,lB,uB,r$=O(()=>{lC=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Bs=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),$e=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),aB=Object.freeze([$e.MemoryTerm]),vi=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ot=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Bs.Parameter,name:e,kind:t,arg:n,required:s,note:o}),zt=()=>Object.freeze({type:Bs.Precondition,pred:vi.graphLoaded}),Jt=(e,t)=>Object.freeze({type:Bs.Precondition,pred:vi.resolves,param:e,as:t}),uC=e=>Object.freeze({type:Bs.Precondition,pred:vi.anyPresent,params:Object.freeze([...e])}),s$=()=>Object.freeze({type:Bs.Precondition,pred:vi.memoryFacts}),jt=(e,t=null)=>Object.freeze({type:Bs.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});dC=Object.freeze([_t({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ot("query",$e.Query,{required:!1,note:"required unless a kind filter is given"}),ot("kind",$e.Kind,{required:!1}),ot("name",$e.Query,{required:!1}),ot("decorator",$e.Query,{required:!1})],preconditions:[zt(),uC(["query","kind"])],add:[jt("matches","query")]}),_t({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("description","symbol")]}),_t({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("signature","symbol")]}),_t({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ot("module",$e.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[zt(),Jt("module",$e.Symbol)],add:[jt("impact","module")]}),_t({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ot("class",$e.Class,{arg:"class"})],preconditions:[zt(),Jt("class",$e.Class)],add:[jt("members","class")]}),_t({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ot("class",$e.Class,{arg:"class"})],preconditions:[zt(),Jt("class",$e.Class)],add:[jt("subclasses","class")]}),_t({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ot("module",$e.Module)],preconditions:[zt(),Jt("module",$e.Module)],add:[jt("exports","module")]}),_t({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("callers","symbol")]}),_t({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("callees","symbol")]}),_t({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("calls","symbol")]}),_t({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("tests","symbol")]}),_t({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[zt()],add:[jt("untested",null)]}),_t({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("history","symbol")]}),_t({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ot("symbol",$e.Symbol)],preconditions:[zt(),Jt("symbol",$e.Symbol)],add:[jt("cochanges","symbol")]}),_t({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ot("package",$e.Package,{required:!1})],preconditions:[zt()],add:[jt("architecture","package")]}),_t({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[ot("term",$e.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[s$(),Jt("term",$e.MemoryTerm)],add:[jt("related","term")]}),_t({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[ot("class",$e.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),ot("expression",$e.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ot("size",$e.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[s$(),Jt("class",$e.MemoryTerm)],add:[jt("sprite","class")]})]),pC=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),o$=dC,cB=pC(o$),lB=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"}),uB=Object.freeze({prefixes:lC,vocab:Bs,kinds:$e,precond:vi,get capabilities(){return o$}})});var i$=O(()=>{r$()});var a$=O(()=>{es()});function hC(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||Z(fC,"corpus","worlds")}function c$(e){try{return fc(mr(e))}catch{return null}}function l$(e){if(dp.has(e))return dp.get(e);let t=null,n=c$(Z(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return dp.set(e,t),t}function mC(e,t){let n=l$(e);if(!n)return null;let s=n[String(t??"")];if(!Qy(s))return null;let o=`${e}\0${t}`;if(pp.has(o))return pp.get(o);let r=null,i=c$(Z(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],l=[],c=null;for(let u of i.toString("utf8").split(`
167
- `))if(u.trim())try{let d=JSON.parse(u);if(!Zy(d)||d.world!==t)continue;ap(d)?a.push(d):cp(d)?l.push(d):lp(d)&&!c&&(c=d)}catch{}(a.length||l.length||c)&&(r={name:t,facts:e$(a),rules:l,meta:c})}return pp.set(o,r),r}var bC,fC,dp,pp,gC,EB,$c=O(()=>{$o();hc();zs();Ue();xo();bC={},fC=Z(he(Ot(bC.url)),"..","..","..");dp=new Map,pp=new Map;gC=e=>({list:async()=>{let t=l$(e());return t?Object.keys(t).sort():null},load:async t=>mC(e(),t)}),EB=gC(()=>hC())});var CB,u$=O(()=>{Rt();Ue();Ss();Ir();es();Be();CB=Z(".tmct","memory","blocks")});var d$=O(()=>{Eo()});var f$=O(()=>{Ss();Ir();Eo()});var fp=O(()=>{Ss();Ir();Eo()});var h$=O(()=>{fp();Ss();so();Eo()});var m$=O(()=>{});var g$=O(()=>{d$();f$();fp();h$();m$();Eo()});var b$=O(()=>{u$();Be();ha();Vd();g$();up()});var w$=O(()=>{vn();Uo()});function br(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function xc(e){let t=n=>vC.map((s,o)=>`--${n}-t${o+1}: ${br(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: ${br(e.taught,.12)}; --corpus-soft: ${br(e.corpus,.12)};`,`--entail-soft: ${br(e.entail,.14)}; --alert-soft: ${br(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${br(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var vc,vC,RW,hp=O(()=>{w$();vc=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)"})}),vC=[.35,.65,1];RW=`
168
- :root { color-scheme: light dark; ${xc(vc.light)} }
169
- @media (prefers-color-scheme: dark) { :root { ${xc(vc.dark)} } }
170
- :root[data-theme="dark"] { ${xc(vc.dark)} }
171
- :root[data-theme="light"] { ${xc(vc.light)} }
172
- `});var y$=O(()=>{hp()});var $$=O(()=>{hp()});var E$=O(()=>{Be();xo();vn();xi()});var mp,jC,_C,RC,TC,AC,IC,mG,gG,xi=O(()=>{xo();n$();Us();ic();up();i$();a$();$c();Be();b$();y$();$$();E$();mp="mgx:world-epoch",jC=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),_C=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),RC="mgx:is-open",TC="mgx:hasMass",AC="mgx:knows-about",IC="mgx:display-name",mG=new Set([...jC,..._C,RC,TC,AC,IC,"rdf:type",mp]),gG=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 wr,wG,yG,$G,vG,xG,EG,Ws=O(()=>{wr=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})}),wG=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"}),yG=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"}),$G=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"}),vG=Object.freeze({teach:"teach"}),xG=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),EG=Object.freeze({max_depth:"maxDepth"})});var j$,CC,Sc,OC,LC,_$,R$,NC,PC,jG,MC,FC,T$=O(()=>{Ws();j$="spider-fly",CC=10,Sc=Object.freeze({x:2,y:2}),OC=1,LC=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}),_$=(e,t)=>`cell-${e}-${t}`,R$=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),NC=(e,t)=>R$(e,t,Sc.x,Sc.y)<=OC,PC=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})}),jG=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"])]),MC="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.",FC=Object.freeze({name:j$,gridSize:CC,opening:MC,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:NC,webHomeCell:_$(Sc.x,Sc.y)})});var A$,L$,TG,AG,IG,gp,I$,C$,O$,bp,CG,OG,kc=O(()=>{Ws();A$=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),L$=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})}),TG=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),AG=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),IG=Object.freeze([A$.spawnedFood,A$.placedFood]),gp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),I$=gp({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"}]}),C$=gp({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"}]}),O$=gp({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"}]}),bp=Object.freeze({[I$.name]:I$,[C$.name]:C$,[O$.name]:O$}),CG=Object.freeze(Object.keys(bp)),OG=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 N$=O(()=>{});var P$=O(()=>{});var Ei,tV,HC,qC,KC,YC,XC,JC,QC,ZC,eO,tO,nO,sO,oO,rO,iO,aO,cO,nV,wp=O(()=>{kc();N$();so();Be();xo();P$();Yt();Ws();xi();Ei=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"}}),tV=Object.freeze(["predator","prey"]),HC="mgx:currently-in",qC="mgx:hasMass",KC="mgx:feels",YC="mgx:facing",XC="mgx:driven-facing",JC="mgx:eaten-by",QC="mgx:starved",ZC="mgx:placed-by",eO="mgx:model",tO="mgx:rotation",nO="mgx:carrying",sO="mgx:prey-eaten",oO="mgx:web-built-at-turn",rO="mgx:laid-at-turn",iO="mgx:hatched-into",aO="mgx:turn-played",cO=new Set([HC,qC,KC,YC,XC,JC,QC,ZC,eO,tO,aO,nO,sO,oO,rO,iO,"rdf:type",mp]),nV=Object.freeze([...cO].sort())});var $V,vV,F$=O(()=>{T$();kc();wp();xo();$c();Be();Ws();$V=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"),vV=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var DV,zV,UV,BV,WV,GV,pO,fO,hO,mO,D$,z$,gO,VV,HV,U$=O(()=>{kc();wp();xi();vn();xo();$c();Be();Ws();DV=Ei.predator.kind,zV=Ei.prey.kind,UV=Ei.food.spawnedKind,BV=Ei.food.placedKind,WV=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"),GV=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"),pO="mgx:currently-in",fO="mgx:hasMass",hO="mgx:feels",mO="mgx:facing",D$="(fox|goblin|crumb|morsel)(?:-(\\d+))?",z$="(fox|goblin)(?:-(\\d+))?",gO="(crumb|morsel)(?:-(\\d+))?",VV=[{kind:"placement",predicate:pO,re:new RegExp(`^(?:the\\s+)?${D$}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:fO,re:new RegExp(`^(?:the\\s+)?${D$}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:hO,re:new RegExp(`^(?:the\\s+)?${z$}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:mO,re:new RegExp(`^(?:the\\s+)?${z$}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],HV=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${gO}\\s+there[.!\\s]*$`,"i")});var bt,KV,YV,XV,JV,QV,ZV,eH,tH,nH,sH,oH,rH,iH,aH,cH,lH,uH,dH,pH,B$=O(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},KV=bt("createRequire"),YV=bt("readFileSync"),XV=bt("access"),JV=bt("readFile"),QV=bt("writeFile"),ZV=bt("appendFile"),eH=bt("mkdir"),tH=bt("mkdtemp"),nH=bt("rename"),sH=bt("unlink"),oH=bt("rm"),rH=bt("stat"),iH=bt("copyFile"),aH=bt("readdir"),cH=bt("createReadStream"),lH=bt("createWriteStream"),uH=bt("randomBytes"),dH=bt("spawnSync"),pH=bt("createInterface")});var wt,hH,mH,gH,bH,wH,yH,$H,vH,xH,EH,SH,kH,jH,_H,RH,TH,AH,IH,bO,W$=O(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},hH=wt("createRequire"),mH=wt("readFileSync"),gH=wt("access"),bH=wt("readFile"),wH=wt("writeFile"),yH=wt("appendFile"),$H=wt("mkdir"),vH=wt("mkdtemp"),xH=wt("rename"),EH=wt("unlink"),SH=wt("rm"),kH=wt("stat"),jH=wt("copyFile"),_H=wt("readdir"),RH=wt("createReadStream"),TH=wt("createWriteStream"),AH=wt("randomBytes"),IH=wt("spawnSync"),bO=wt("createInterface")});var yt,OH,LH,NH,PH,MH,FH,DH,zH,UH,BH,WH,GH,VH,HH,qH,KH,YH,G$,XH,yp=O(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},OH=yt("createRequire"),LH=yt("readFileSync"),NH=yt("access"),PH=yt("readFile"),MH=yt("writeFile"),FH=yt("appendFile"),DH=yt("mkdir"),zH=yt("mkdtemp"),UH=yt("rename"),BH=yt("unlink"),WH=yt("rm"),GH=yt("stat"),VH=yt("copyFile"),HH=yt("readdir"),qH=yt("createReadStream"),KH=yt("createWriteStream"),YH=yt("randomBytes"),G$=yt("spawnSync"),XH=yt("createInterface")});var V$=O(()=>{yp();Ue();Rt();Ue();Va();Gt()});var H$=O(()=>{});var wO,q$=O(()=>{Rt();Ue();Be();H$();wO=Z(".tmct","sessions")});var Y$=O(()=>{Rt();Ue();ac()});var X$,jc,J$=O(()=>{X$=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`)."}),jc=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var $t,wq,yq,$q,vq,xq,Eq,Sq,kq,jq,_q,Rq,Tq,Aq,Iq,Cq,Oq,Lq,Nq,Q$,Z$=O(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},wq=$t("createRequire"),yq=$t("readFileSync"),$q=$t("access"),vq=$t("readFile"),xq=$t("writeFile"),Eq=$t("appendFile"),Sq=$t("mkdir"),kq=$t("mkdtemp"),jq=$t("rename"),_q=$t("unlink"),Rq=$t("rm"),Tq=$t("stat"),Aq=$t("copyFile"),Iq=$t("readdir"),Cq=$t("createReadStream"),Oq=$t("createWriteStream"),Lq=$t("randomBytes"),Nq=$t("spawnSync"),Q$=$t("createInterface")});var ov={};Wt(ov,{CONTEXT_PASSAGE_PREDICATE:()=>tv,CO_OCCURS_PREDICATE:()=>_c,ingestUnknownFromAssertions:()=>vO,knownTermsFrom:()=>nv,passageFor:()=>sv});function nv(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==pt)continue;let o=a=>(s.attributes||[]).find(l=>l?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(V(r)),i&&n.add(V(i))}for(let s of t||[])s?.subject&&n.add(V(s.subject)),s?.object&&n.add(V(s.object));return n}function sv(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=Gs(e?.start),o=Gs(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function $O(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<ev;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let l of a)if(!(yO.has(l)||r.has(l)||n.has(l))&&t.has(l)&&(o.push(l),r.add(l),o.length>=ev))break}return o}async function vO(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 ft(e),l=nv(a,s),c=new Set,u=[];for(let p of t){if(c.size>=i)break;let h=n.get(p.rel);if(!h||h.ace!=="none")continue;let m=Gs(p.start),b=Gs(p.end);if(!m||!b)continue;let g=V(m),y=V(b),w=!l.has(g),v=!l.has(y);if(!w&&!v)continue;let k=sv(p,h);if(!k)continue;let $=[[m,b,w],[b,m,v]];for(let[x,E,S]of $){if(!S||c.size>=i)continue;let R=V(x);if(c.has(R))continue;let _=`${r} ${p.rel}`;u.push({subject:x,predicate:tv,object:k,provenance:_}),u.push({subject:x,predicate:_c,object:E,provenance:_});let I=$O(k,l,new Set([g,y]));for(let P of I)u.push({subject:x,predicate:_c,object:P,provenance:_});c.add(R),l.add(R)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await Gn(e,u),f=u.filter(p=>p.predicate===_c).length;return{captured:c.size,linked:f,appended:d.appended,skipped:d.skipped}}var tv,_c,yO,ev,rv=O(()=>{Be();Rc();tv="mgx:contextPassage",_c="mgx:coOccursWith",yO=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"]),ev=3});var iv={};Wt(iv,{MAP_FILE:()=>ki,SEON_CONCEPTS_FILE:()=>Tc,SEON_DEFINITIONS_FILE:()=>xO,SLICE_FILE:()=>Si,TIER2_DIR:()=>Hn,TIER2_MANIFEST_FILE:()=>EO,WORDNET_DIR:()=>ji,loadMap:()=>Ic,loadSlice:()=>Ac,seedMemory:()=>kO,termText:()=>Gs,toFacts:()=>Cc});async function Ac(e=Si){let t=Q$({input:yy(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 Ic(e=ki){let n=mo(await _e(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(!SO.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 Cc(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=Gs(o.start),a=Gs(o.end);if(!i||!a)continue;let l=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${l} ${o.rel}`})}return s}async function kO(e,{limit:t,slicePath:n=Si,mapPath:s=ki,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[l,c]=await Promise.all([Ac(n),Ic(s)]),u=Cc(l,c,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map((w,v)=>[w,v]));u=u.slice().sort((w,v)=>(y.get(w.predicate)??o.length)-(y.get(v.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,w,v)=>`${V(y)} ${w} ${V(v)}`,f=new Set,p=await ft(e);for(let y of p.individuals||[]){if(y?.class!=="Fact")continue;let w=v=>(y.attributes||[]).find(k=>k.key===v)?.value;f.add(d(w("subject"),w("predicate"),w("object")))}let h=0,m=[];for(let y of u){let w=d(y.subject,y.predicate,y.object);if(f.has(w)){h+=1;continue}f.add(w),m.push(y)}let b=await Gn(e,m),g;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(rv(),ov));g=await y(e,{assertions:l,map:c,mappedFacts:u,memory:p,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:b.appended,skipped:h+b.skipped,total:u.length,...g?{unknown:g}:{}}}var jO,yr,Si,ki,Tc,xO,Hn,EO,ji,Hq,SO,Gs,Rc=O(()=>{$o();Rt();Z$();zs();Ue();Ua();Be();jO={},yr=Z(he(Ot(jO.url)),"..","..",".."),Si=Z(yr,"corpus","conceptnet","slice.jsonl"),ki=Z(yr,"src","adapters","corpus","conceptnet-map.toml"),Tc=Z(yr,"corpus","domains","code","concepts.jsonl"),xO=Z(yr,"corpus","domains","code","definitions.jsonl"),Hn=Z(yr,"corpus","tier2"),EO=Z(Hn,"manifest.json"),ji=Z(yr,"corpus","wordnet"),Hq=Z(ji,"manifest.json"),SO=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);Gs=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var pv={};Wt(pv,{BUILTIN_EXTENSIONS:()=>AO,EXTENSION_KINDS:()=>Oc,activeDomainPacks:()=>Sp,defaultCodeDomainPacks:()=>dv,defaultCodeLaneVocab:()=>uv,mergedLaneVocab:()=>Ep,mergedLexiconExtra:()=>lv,resolveExtensions:()=>cv,seedActiveCorpusEntries:()=>OO,validateExtensionEntry:()=>av,validateExtensionPack:()=>NO});function Lc(){return{seon:{kind:"corpus",active:!1,corpusPath:Tc,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Tc,provenancePrefix:"corpus:seon",vocabPath:RO,vocabData:X$,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:Si,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:TO},human:{kind:"corpus",active:!0,corpusPath:Z(Hn,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:Z(Hn,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:Z(Hn,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:Z(Hn,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:$p,vocabData:jc,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:Z(Hn,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:$p,vocabData:jc,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:Z(Hn,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:$p,vocabData:jc,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:Z(Hn,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:Z(ji,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:Z(ji,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:Z(_O,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function av(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Oc.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Oc.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 CO(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Oc.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]=IO(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 cv(e,{configFile:t}={}){let n=e?await Ga(e,t?{file:t}:{}):null,s=Lc(),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=CO(f,s[f]||null,o[f]||{},e||process.cwd());av(f,p),a.set(f,p)}let l={};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)}`);l[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:l}}async function OO(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(Rc(),iv)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,l=0,c=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let 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,l+=p.skipped,c+=p.total}catch(p){i[u]={appended:0,skipped:0,total:0,error:p&&p.message?p.message:String(p)}}return{appended:a,skipped:l,total:c,perBundle:i}}async function lv(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 _e(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 Ep(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 _e(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 uv(){if(!vp){let e={...Lc().code,active:!0};vp=Ep(new Map([["code",e]]),{})}return vp}async function LO(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 _e(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 Sp(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 LO(o.name,o.entry));return s}function dv(){if(!xp){let e={...Lc().code,active:!0};xp=Sp(new Map([["code",e]]),{})}return xp}async function NO(e,t){let n=[],s=o=>o&&(Hc(o)?o:Nt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Ac(o),i=await Ic(s(t.mapPath)||ki),a=Cc(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(()=>(Us(),Cy)),i=JSON.parse(await _e(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(()=>(cc(),by)),i=await r(o),a=[...i.keys()].filter(l=>!l.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await _e(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,l=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:l}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var kp,_O,RO,$p,Oc,TO,AO,IO,vp,xp,jp=O(()=>{Ue();Rt();zs();J$();Va();Rc();kp={},_O=Z(he(Ot(kp.url)),"..","..","corpus","namenet"),RO=Z(he(Ot(kp.url)),"..","..","corpus","domains","code","vocab.json"),$p=Z(he(Ot(kp.url)),"..","..","corpus","tier2","vocab-empty.json"),Oc=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),TO=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];AO=Object.freeze(Lc());IO=(e,t)=>{if(t==null)return;let n=String(t);return Hc(n)?n:Nt(e,n)};vp=null;xp=null});var fv=O(()=>{});var hv=O(()=>{Ue();$o();Rt();B$();W$();yp();Gt();V$();Le();q$();ac();Y$();Ar();jp();Nc();Ws();ic();np();fv()});var mv={};Wt(mv,{proseLemma:()=>MO});function MO(){if(So!==void 0)return So;try{let e=Hd();if(!e)return So=null,So;let t=e.its,n=new Map;So=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{So=null}return So}var So,gv=O(()=>{qd()});var bv={};Wt(bv,{digestTermFromRows:()=>zO,loadDigestStructureTable:()=>DO,readDigestStructures:()=>FO});var FO,DO,zO,wv=O(()=>{FO=()=>null,DO=()=>null,zO=()=>null});function Dp(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 ${Pc(e.entityType)}`;if(t==="list")return`list/enumerate ${Pc(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Pc(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 Dp(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&&wn[o]?wn[o]:`filter/traverse ${Pc(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&&wn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?wn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function Hp(e){let t=new Map;for(let n of e)t.has(vv(n))||t.set(vv(n),n);return t}function Tp(e,t=Ri){let n=[],s=[];for(let l of e)l.predicate===t&&(s.push([l.subject,l.object]),ko(l)&&n.push([l.subject,l.object]));let o=new Map,r=new Map,i=new Set,a=(l,c,u)=>{!c||!u||c===u||(l.has(c)||l.set(c,new Set),l.get(c).add(u))};for(let[l,c]of s)a(r,l,c),c&&i.add(c);for(let[l,c]of n)a(o,l,c);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function Ap(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 qO(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function KO(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(gv(),mv)),s=n();return s?qO(t,s(t)):t}catch{return t}}function Kp(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)||YO.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 Op(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return hr;if(t==="can")return"mgx:capableOf";try{let n=await KO(t);return n==="have"?hr:ps(`mgx:${n}`)}catch{return ps(`mgx:${t}`)}}function tL(e,t){let n=String(t||"").match(eL);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function _i(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Is(),tg)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function aL(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 qv(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 Kv(e){if(jo[e])return jo[e];let t=String(e||""),n=Sg(t);if(n){let a=Kv(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[l,...c]=a.split(" ");return["does not",qv(l),...c].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${Yp})-([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?`${aL(i[1])}${i[2]?` ${i[2]}`:""}`:e}function Np(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function lL(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of cL)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 Kn(e){return e.replace(/#node:[0-9a-f]+/g,"")}function re(e){let t=e.provenance?` (source: ${Kn(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Ut(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Ut(e)}${t}`:e.provenance.includes("corpus:")?`${Ut(e)}${t}`:e.provenance.includes("reference:")?`${Ut(e)}${t}`:`i learned: ${Ut(e)}${t}`}function Sv(e,t,n,{toward:s=null}={}){let o=re(e);if(!qn.has(e.predicate)||!n.has(e.subject))return o;let r=bc(e.object,t,{cap:6,stopAt:mc,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(uL);return a?o.slice(0,a.index)+i+a[0]:o+i}function kv(e,t,n,{indent:s=""}={}){let o=t.filter(k=>k.predicate===Ri).map(k=>[k.subject,k.object]),r=yi(o),i=e.map(k=>`${s}${Sv(k,r,n)}`),a=e.filter(k=>qn.has(k.predicate)&&n.has(k.subject)),l=[...new Set(a.map(k=>k.object))];if(l.length<2)return{lines:i,grouped:null};let c=t.filter(k=>k.predicate==="owl:disjointWith").map(k=>[k.subject,k.object]),{split:u,clusters:d}=wc(l,{parents:r,disjointEdges:c});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let k of d)for(let $ of k.objects)p.set($,k);let h=e.filter(k=>!(qn.has(k.predicate)&&n.has(k.subject))),m=[],b=[],g=0,y=k=>{let $=Sv(k,r,n);return g<ve?(g+=1,`${s}${$}`):(b.push($),null)};for(let k of d){let $=a.filter(x=>p.get(x.object)===k).map(y).filter(Boolean);$.length&&m.push(`${s}${f}, the ${k.label}:
164
+ `)}`:c,data:{...a,grounded:l}})}finally{await i()}}var my=O(()=>{Ue();Be();Ve();Wd.ownsGraphLoad=!0});var cI,gy=O(()=>{gu();bg();ow();iw();cw();uw();pw();hw();gw();bw();Fw();zw();Bw();Gw();ac();Yw();Jw();Zw();ty();sy();ry();ay();ly();dy();hy();my();cI=Object.freeze({tmct_context:mu,tmct_context_more:gg,tmct_describe:sw,tmct_snippet:rw,tmct_signature:aw,tmct_impact:lw,tmct_search:dw,tmct_members:fw,tmct_subclasses:mw,tmct_related:Md,tmct_sprite:Ud,tmct_architecture:Dw,tmct_exports:Uw,tmct_untested:Ww,tmct_ask:qw,tmct_tests_for:Kw,tmct_history:Xw,tmct_file_history:Qw,tmct_method_history:ey,tmct_class_history:ny,tmct_callers:oy,tmct_callees:iy,tmct_calls:cy,tmct_cochanges:uy,tmct_export:Bd,tmct_ingest:Wd})});var Gd=O(()=>{});var cc,Vd=O(()=>{cc=()=>({relations:[],constructions:[]})});var by,wy=O(()=>{Rt();Ue();Tf();Vt();Ir();Is();ba();wa();gy();ac();Ve();Go();oa();Gd();Vd();wa();gu();ac();ra(void 0);sa(cc);by=Rf.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var Fz,Dz,zz,lc=O(()=>{Fz=Object.freeze(["entity","set","event","measure"]),Dz=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),zz=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 ht,Bz,Wz,Gz,Vz,Hz,qz,Kz,Yz,Xz,Jz,Qz,Zz,e2,t2,n2,s2,lI,o2,r2,yy=O(()=>{ht=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},Bz=ht("createRequire"),Wz=ht("readFileSync"),Gz=ht("access"),Vz=ht("readFile"),Hz=ht("writeFile"),qz=ht("appendFile"),Kz=ht("mkdir"),Yz=ht("mkdtemp"),Xz=ht("rename"),Jz=ht("unlink"),Qz=ht("rm"),Zz=ht("stat"),e2=ht("copyFile"),t2=ht("readdir"),n2=ht("createReadStream"),s2=ht("createWriteStream"),lI=ht("randomBytes"),o2=ht("spawnSync"),r2=ht("createInterface")});var uc=O(()=>{yy()});var mt,l2,u2,d2,p2,f2,h2,m2,g2,b2,w2,y2,$2,v2,x2,E2,S2,Ot,k2,j2,_2,zs=O(()=>{mt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},l2=mt("createRequire"),u2=mt("readFileSync"),d2=mt("access"),p2=mt("readFile"),f2=mt("writeFile"),h2=mt("appendFile"),m2=mt("mkdir"),g2=mt("mkdtemp"),b2=mt("rename"),w2=mt("unlink"),y2=mt("rm"),$2=mt("stat"),v2=mt("copyFile"),x2=mt("readdir"),E2=mt("createReadStream"),S2=mt("createWriteStream"),Ot=e=>String(e),k2=mt("randomBytes"),j2=mt("spawnSync"),_2=mt("createInterface")});var _y={};Gt(_y,{PHRASEBOOK_FILE:()=>xy,TECHNICAL_SLOTS:()=>qd,TEMPLATES_FILE:()=>vy,flatten:()=>Yd,loadPhrasebook:()=>fI,loadTemplates:()=>Xd,loadTemplatesMerged:()=>pI,render:()=>jy,renderSegments:()=>ky,slotKind:()=>Sy,slotsOf:()=>Kd});function Kd(e){let t=[];for(let n of String(e).matchAll(Ey))t.includes(n[1])||t.push(n[1]);return t}function Sy(e){return dI[e]||"entity"}function Yd(e){let t="";for(let n of e)t+=n.text;return t}function ky(e,t={},n=gi){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(Ey.source,"g"),a=[],l=0,c;for(;(c=i.exec(r))!==null;)c.index>l&&a.push({type:"prose",text:r.slice(l,c.index)}),a.push({type:Sy(c[1]),text:String(t[c[1]])}),l=c.index+c[0].length;return l<r.length&&a.push({type:"prose",text:r.slice(l)}),a}async function Xd(e=vy){let t=await _e(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(l){throw new Error(`${e}:${o+1}: not valid JSON: ${l.message}`)}for(let l of["id","class","template","register"])if(typeof i[l]!="string"||!i[l])throw new Error(`${e}:${o+1}: missing/empty "${l}"`);if(!uI.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=Kd(i.template);if(i.register==="technical"){let l=a.filter(c=>!qd.has(c));if(l.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${l.length>1?"s":""}: ${l.join(", ")} (allowed: ${[...qd].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 gi=n,n}async function pI(e=[]){let t=gi,n=new Map;try{for(let s of e){let o=await Xd(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{gi=t}return n}function jy(e,t={},n=gi){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Yd(ky(e,t,n))}async function fI(e=xy){let t=await _e(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(l=>l.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:Kd(i)})}}return{patterns:n,synonyms:s}}var hI,$y,vy,xy,uI,Ey,qd,dI,gi,dc=O(()=>{Rt();zs();Ue();hI={},$y=Z(he(Ot(hI.url)),"..","..",".."),vy=Z($y,"data","templates","responses.jsonl"),xy=Z($y,"data","phrasebook","software-phrases.txt"),uI=new Set(["terse","friendly","technical"]),Ey=/\{([A-Za-z][A-Za-z0-9]*)\}/g,qd=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));dI={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};gi=null});function gI(e,t={}){let n=mI.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function bI(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>gI(s,t))):1}function Ye(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:bI(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var mI,Ry=O(()=>{mI=/^src:corpus:(.+)$/});var gt,O2,mr,L2,N2,P2,M2,F2,D2,z2,U2,B2,W2,G2,V2,Ty,wI,H2,q2,K2,$o=O(()=>{gt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},O2=gt("createRequire"),mr=gt("readFileSync"),L2=gt("access"),N2=gt("readFile"),P2=gt("writeFile"),M2=gt("appendFile"),F2=gt("mkdir"),D2=gt("mkdtemp"),z2=gt("rename"),U2=gt("unlink"),B2=gt("rm"),W2=gt("stat"),G2=gt("copyFile"),V2=gt("readdir"),Ty=gt("createReadStream"),wI=gt("createWriteStream"),H2=gt("randomBytes"),q2=gt("spawnSync"),K2=gt("createInterface")});function Ay(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 xI(e=$I){let t=mo(mr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Jd(){if(pc===null)try{pc=xI()}catch{pc=[]}return pc}var EI,yI,$I,vI,tU,pc,Qd=O(()=>{$o();zs();Ue();Ga();dc();EI={},yI=he(Ot(EI.url)),$I=Z(yI,"..","..","data","templates","grammar-rules.toml"),vI=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),tU=Object.freeze(new Set(vI.filter(e=>e!=="prose")));pc=null});function SI(){if(bi!==void 0)return bi;try{let e=Iy?Iy():kI();bi=e&&e.winkNLP&&e.model?e:null}catch{bi=null}return bi}function kI(){let e=process.getBuiltinModule("node:module").createRequire(jI.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Zd(){if(gr!==void 0)return gr;let e=SI();if(!e)return gr=null,null;try{gr=e.winkNLP(e.model)}catch{gr=null}return gr}var jI,Iy,bi,gr,ep=O(()=>{jI={}});var Cy=O(()=>{ep()});var Ly,Oy=O(()=>{Ly={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:{},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:{},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 By={};Gt(By,{CODE_REF_SHAPE:()=>ip,DETERMINERS:()=>np,OF_CLASSIFIER_HEADS:()=>My,OF_PARTITIVE_HEADS:()=>Fy,QUANTIFIERS:()=>sp,classify:()=>cp,loadLexicon:()=>_n,lookupAdjective:()=>hc,lookupNoun:()=>Vn,lookupProperName:()=>wi,lookupVerb:()=>fc,numberOf:()=>op,predicateOf:()=>rp,readsAsIndividualName:()=>ap,thirdPerson:()=>Dy,withProperNames:()=>Uy});function op(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):RI[t]??null}function Dy(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 rp(e,t=Py){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${Dy(e.lemma)}${n}`}function zy(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function Ny(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!TI.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(!AI.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function _n(e,t=Py){if(!e&&tp.has(t))return tp.get(t);let n=Ly,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return Ny(s,n),e?(Ny(s,e),s):(tp.set(t,s),s)}function Uy(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 Vn(e,t,n={}){return II(e,t,n)[0]??null}function II(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,l=c=>{c&&!a.has(c.lemma)&&(a.add(c.lemma),i.push(c))};if(r){let c=e.nouns.get(r)??null;return n.singularOnly&&o?(l(o),l(c)):(l(c),l(o)),i}for(let c of zy(s))l(e.nouns.get(c));return i}function fc(e,t){return CI(e,t)[0]??null}function CI(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of zy(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function hc(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function wi(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function ap(e,t){let n=String(e??"");if(!n)return!1;if(wi(t,n)||ip.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=Vn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function cp(e,t=_n()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(np[s])return{pos:"determiner",type:np[s]};if(sp[s])return{pos:"quantifier",type:sp[s]};let o=op(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=wi(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=Vn(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=fc(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:rp(a,t.ns),...a.prep?{prep:a.prep}:{}};let l=hc(t,s);return l?{pos:"adjective",type:l.type,lemma:l.lemma}:null}var Py,np,sp,My,Fy,RI,TI,AI,tp,ip,Us=O(()=>{Oy();Py="tmct:",np=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),sp=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),My=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Fy=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),RI=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});TI=new Set(["data","object"]),AI=new Set(["subclass","data"]);tp=new Map;ip=/[./\\#:@]/});var uU,dU,pU,OI,fU,hU,mU,Wy=O(()=>{Is();Le();uU=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),dU=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),pU=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`]}),OI=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"}),fU=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"]}),hU=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"}}),mU=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 yi(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 gc(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 NI(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function Vy(e,t){let n=Vn(t,e);return n?V(n.lemma):e}function Hy(e,t){let n=NI(String(e??"")).match(LI);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(PI.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&&Vy(d,t);if(f&&(FI.has(f)||DI.has(f))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&MI.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=Vy(i,t);if(Gy.has(i)||Gy.has(a))return null;let l=Vn(t,i);if(!l)return null;let c=V(l.lemma);return s&&(!/s$/.test(i)||V(i)===c)?null:c}var mc,LI,PI,Gy,MI,FI,DI,br=O(()=>{Mt();Us();Wy();mc=400;LI=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;PI=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),Gy=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"]),MI=new Set(["a","an","the"]),FI=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"]),DI=new Set(["either","one","each","both","any"])});var bc,wc=O(()=>{bc=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var zI,RU,qy=O(()=>{$o();wc();zs();Ue();br();zI={},RU=Z(he(Ot(zI.url)),"..","..","..")});function BI(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 UI.includes(e.predicate)}function Ky(e){return yi(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(BI):!1}function $i(e,t){return`research:${e}:${V(t)}`}function yc(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");WI.set(e.name,{name:e.name,create:e.create})}var UI,WI,CU,OU,vi=O(()=>{Mt();br();UI=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"]);WI=new Map;CU=Object.freeze(["wikipedia","wikidata"]),OU=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata"})});function $c({fetchImpl:e,timeoutMs:t=4e3,minIntervalMs:n=2e3,retryAfterFloorMs:s=5e3,userAgent:o,waitForSlot:r=!1}={}){let i=e??((...g)=>globalThis.fetch(...g)),a=new Map,l=0,c=0,u=!1,d=()=>{if(!o)return null;let g={"Api-User-Agent":o};return typeof document>"u"&&(g["User-Agent"]=o),g};function f(g){let y=Number(g)*1e3;c=Date.now()+Math.max(y||0,s)}async function p(g){let y=typeof AbortController=="function"?new AbortController:null,w=y?setTimeout(()=>y.abort(),t):null;try{let v={};y&&(v.signal=y.signal);let k=d();k&&(v.headers=k);let $=await i(g,v);if($.status===429)return f($.headers?.get?.("retry-after")),null;if(!$.ok)return null;let x=await $.json();return x?.error?.code==="maxlag"?(f($.headers?.get?.("retry-after")),null):x}catch{return null}finally{w!==null&&clearTimeout(w)}}let h=()=>Math.max(c,l+n);async function m(){for(;;){let g=Date.now();if(!u&&g>=h())return l=g,u=!0,!0;if(!r)return!1;await new Promise(y=>setTimeout(y,Math.max(h()-g,25)))}}async function b(g,y){if(a.has(g))return a.get(g);if(!await m())return null;let w=null;try{w=await y()}catch{w=null}finally{u=!1}return a.set(g,w),w}return{fetchJson:p,cachedFetch:b}}var lp=O(()=>{});function KI({fetchImpl:e,origin:t=GI,timeoutMs:n=4e3,minIntervalMs:s=2e3,lexicon:o=null,userAgent:r=qI,waitForSlot:i=!1,sourceName:a=HI}={}){let l=$c({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function c(f,p){let h=Array.isArray(p?.[1])?p[1]:[];for(let m of h){let b=V(m);if(b===f||b.startsWith(f))return String(m)}return null}async function u(f,p){let h=await l.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(p.replace(/ /g,"_"))}`);if(!h)return null;let m=String(h.extract??""),b=Number(h.revision),g={term:f,title:String(h.title??p),text:m,summary:gc(m,mc),url:String(h.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(p.replace(/ /g,"_"))}`),revid:b},y=o;if(!y)try{y=_n()}catch{y=null}let w=y?Hy(m,y):null;return w&&(g.isa=w),yi(g)?g:null}async function d(f){let p=await l.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${5}&search=${encodeURIComponent(f)}&limit=3`),h=p?c(f,p):null;return h?u(f,h):null}return{name:a,origin:t,provenanceTag(f){return $i(a,f)},async lookup(f){let p=String(f??"");return p?l.cachedFetch(p,()=>d(p)):null},async pageByTitle(f){let p=String(f??"").trim();return p?l.cachedFetch(`title\0${V(p)}`,()=>u(V(p),p)):null},async linkedTitles(f,{limit:p=25}={}){let h=String(f??"").trim();if(!h)return null;let m=await l.cachedFetch(`links\0${V(h)}`,async()=>{let g=(await l.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${5}&prop=links&redirects=1&page=${encodeURIComponent(h)}&section=0`))?.parse?.links;if(!Array.isArray(g))return null;let y=new Set,w=[];for(let v of g){if(!v||v.ns!==0||v.exists===!1)continue;let k=String(v.title??v["*"]??"").trim(),$=V(k);!k||!$||y.has($)||(y.add($),w.push(k))}return w});return Array.isArray(m)?m.slice(0,Math.max(0,p)):null}}}function YI(e={}){return KI({origin:VI,sourceName:Xy,waitForSlot:!0,...e})}var GI,VI,HI,Xy,qI,Jy=O(()=>{Mt();Us();br();vi();lp();GI="https://en.wikipedia.org",VI="https://simple.wikipedia.org",HI="wikipedia-live",Xy="simple-wikipedia",qI="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";yc({name:Xy,create:YI})});function oC(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!Zy.test(r))continue;let i=V(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function rC(e){let t=[];for(let[n,s]of Object.entries(eC)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=sC)return t;if(r>=nC)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let l=String(a?.datavalue?.value?.id??"");Zy.test(l)&&(t.push({property:n,predicate:s,id:l}),r+=1)}}return t}function iC(e,t,n){for(let s of tC)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 aC({fetchImpl:e,origin:t=XI,timeoutMs:n=4e3,minIntervalMs:s=2e3,userAgent:o=ZI,waitForSlot:r=!1,sourceName:i=Qy}={}){let a=$c({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),l=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(5),...d})}`;async function c(d){let f=new Map;if(!d.length)return f;let p=await a.fetchJson(l({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[h,m]of Object.entries(p?.entities??{})){let b=V(m?.labels?.en?.value??"");b&&f.set(h,b)}return f}async function u(d){let f=await a.fetchJson(l({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),p=f?oC(d,f):null;if(!p)return null;let m=(await a.fetchJson(l({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:p})))?.entities?.[p];if(!m)return null;let b=rC(m),g=await c(b.map(E=>E.id)),y=$i(i,d),w=[],v=new Set;for(let E of b){let S=g.get(E.id);!S||S===d||v.has(`${E.predicate}\0${S}`)||(v.add(`${E.predicate}\0${S}`),w.push({subject:d,predicate:E.predicate,object:S,provenance:y}))}let k=String(m.descriptions?.en?.value??""),$={term:d,title:String(m.labels?.en?.value??""),text:k,summary:gc(k,mc),url:`${t}/wiki/${p}`,revid:Number(m.lastrevid),source:JI,licence:QI},x=iC(b,g,d);return x&&($.isa=x),w.length&&($.facts=w),Ky($)?$:null}return{name:i,origin:t,provenanceTag(d){return $i(i,d)},async lookup(d){let f=V(d??"");return f?a.cachedFetch(f,()=>u(f)):null}}}function cC(e={}){return aC({waitForSlot:!0,...e})}var XI,Qy,JI,QI,ZI,eC,tC,nC,sC,Zy,e$=O(()=>{Mt();br();vi();lp();XI="https://www.wikidata.org",Qy="wikidata",JI="Wikidata",QI="CC0 1.0",ZI="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",eC=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"}),tC=["P279","P31"],nC=3,sC=12,Zy=/^Q[1-9][0-9]*$/;yc({name:Qy,create:cC})});var lC,uC,ZU,pp=O(()=>{Mt();Us();Go();vi();lC=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),uC=["this","is","about","the"],ZU=uC.length});var t$=O(()=>{Rt();Ue()});var fp=O(()=>{Mt()});var dC,hB,n$=O(()=>{$o();wc();zs();Ue();fp();Mt();dC={},hB=Z(he(Ot(dC.url)),"..","..","..")});var gB,bB,wB,s$=O(()=>{gB=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),bB=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"})}),wB=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var o$,xc,Ec=O(()=>{o$=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"]),xc=new Set([...o$,"property","concept","idea","content"])});function xi(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Sc(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let l=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(pC);if(!l.length)break;let c=o?l.filter(d=>d===o||hp(d,t).has(o)):[];a=(c.length?c:l)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function hp(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 fC(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 hC(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let l=hp(e,n),c=hp(t,n);if(l.has(t)||c.has(e))return{distinct:!1,reason:"subsumes",lcs:l.has(t)?t:e};if(s.size)for(let m of l){let b=s.get(m);if(b){for(let g of c)if(b.has(g))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...l].filter(m=>c.has(m));if(!u.length)return l.size<2||c.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=m=>mp(m,n,o,new Set),f=u[0],p=d(f);for(let m of u){let b=d(m);(b>p||b===p&&m<f)&&(f=m,p=b)}if(p<=i)return{distinct:!0,reason:"root-subsumer",lcs:f};if(a){let m=a.get(f);return typeof m=="number"&&m<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 kc(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],l=n||xi(t),c=fC(s),u=new Map,d=new Map(a.map(y=>[y,y])),f=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},p=(y,w)=>{let v=f(y),k=f(w);v!==k&&d.set(v<k?k:v,v<k?v:k)},h=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let v=hC(a[y],a[w],l,c,u,{threshold:o,rootDepth:r,icByTerm:i});h.push({a:a[y],b:a[w],...v}),v.distinct||p(a[y],a[w])}let m=new Map;for(let y of a){let w=f(y);m.has(w)||m.set(w,[]),m.get(w).push(y)}let b=y=>mp(y,l,u,new Set),g=[...m.values()].map(y=>{let w=[...y].sort(),v=w[0],k=b(v);for(let $ of w){let x=b($);x>k&&(k=x,v=$)}return{objects:w,label:v}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:g.length>1,clusters:g,pairs:h}}var pC,jc=O(()=>{Xt();Ec();pC=(e,t)=>e<t?-1:e>t?1:0});function gp(e){return typeof e=="string"&&mC.test(e)}function r$(e){return!!e&&typeof e=="object"&&vo(e.s)}function bp(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&gp(e.world)&&vo(e.subject)&&vo(e.predicate)&&vo(e.object)}function wp(e){if(!e||typeof e!="object"||e.kind!=="rule"||!gp(e.world)||!vo(e.name)||!bC.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(vo)}function yp(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&gp(e.world)&&vo(e.opening)}function i$(e){return bp(e)||wp(e)||yp(e)}function a$(e){let t=e||[],n=t.filter(c=>c.predicate===wC).sort((c,u)=>`${c.subject}\0${c.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(c=>c.predicate==="rdf:type").map(c=>c.subject)),o=new Map;for(let c of t)c.predicate==="mgx:located-in"&&o.set(c.subject,c.object);let r=(c,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===c&&o.get(d.subject)===u),i=t.find(c=>typeof c.world=="string"&&c.kind==="fact"),a=(c,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:c,predicate:u,object:d}),l=[];for(let c of n){let u=c.subject,d=c.object;if(r(d,u))continue;let f=d,p=1;for(;s.has(f);)p+=1,f=`${d}-${p}`;s.add(f),l.push(a(f,"rdf:type",d)),l.push(a(f,"rdf:type","portable")),l.push(a(f,"mgx:located-in",u))}return l.length?[...t,...l]:t}var mC,gC,bC,vo,wC,xo=O(()=>{mC=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,gC=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),bC=new Set(gC),vo=e=>typeof e=="string"&&e.trim()!=="";wC="mgx:default-contains"});var yC,$C,vC,xC,EC,SC,kC,jC,_C,_B,RC,c$,RB,TB,l$=O(()=>{Us();Uo();yC="subClassOf",$C="typeAssertion",vC="relation",xC="someValuesFrom",EC="cardinality",SC="disjointWith",kC="possessive",jC="adjective",_C="capability",_B=Object.freeze([yC,$C,vC,xC,EC,SC,kC,jC,_C]),RC=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),c$=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"]]),RB=Math.max(...[...c$.keys()].map(e=>e.split(" ").length)),TB=[...new Set([...RC,...[...c$.keys()].map(e=>e.split(" ")[0])])]});var Eo=O(()=>{});var $p=O(()=>{Le();Is();Eo()});function _t({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Bs.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 TC,Bs,$e,PB,Si,ot,Ut,Jt,AC,u$,jt,IC,CC,d$,MB,FB,DB,p$=O(()=>{TC=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Bs=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),$e=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),PB=Object.freeze([$e.MemoryTerm]),Si=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ot=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Bs.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Ut=()=>Object.freeze({type:Bs.Precondition,pred:Si.graphLoaded}),Jt=(e,t)=>Object.freeze({type:Bs.Precondition,pred:Si.resolves,param:e,as:t}),AC=e=>Object.freeze({type:Bs.Precondition,pred:Si.anyPresent,params:Object.freeze([...e])}),u$=()=>Object.freeze({type:Bs.Precondition,pred:Si.memoryFacts}),jt=(e,t=null)=>Object.freeze({type:Bs.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});IC=Object.freeze([_t({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ot("query",$e.Query,{required:!1,note:"required unless a kind filter is given"}),ot("kind",$e.Kind,{required:!1}),ot("name",$e.Query,{required:!1}),ot("decorator",$e.Query,{required:!1})],preconditions:[Ut(),AC(["query","kind"])],add:[jt("matches","query")]}),_t({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("description","symbol")]}),_t({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("signature","symbol")]}),_t({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ot("module",$e.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Ut(),Jt("module",$e.Symbol)],add:[jt("impact","module")]}),_t({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ot("class",$e.Class,{arg:"class"})],preconditions:[Ut(),Jt("class",$e.Class)],add:[jt("members","class")]}),_t({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ot("class",$e.Class,{arg:"class"})],preconditions:[Ut(),Jt("class",$e.Class)],add:[jt("subclasses","class")]}),_t({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ot("module",$e.Module)],preconditions:[Ut(),Jt("module",$e.Module)],add:[jt("exports","module")]}),_t({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("callers","symbol")]}),_t({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("callees","symbol")]}),_t({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("calls","symbol")]}),_t({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("tests","symbol")]}),_t({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Ut()],add:[jt("untested",null)]}),_t({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("history","symbol")]}),_t({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ot("symbol",$e.Symbol)],preconditions:[Ut(),Jt("symbol",$e.Symbol)],add:[jt("cochanges","symbol")]}),_t({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ot("package",$e.Package,{required:!1})],preconditions:[Ut()],add:[jt("architecture","package")]}),_t({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[ot("term",$e.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[u$(),Jt("term",$e.MemoryTerm)],add:[jt("related","term")]}),_t({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[ot("class",$e.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),ot("expression",$e.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ot("size",$e.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[u$(),Jt("class",$e.MemoryTerm)],add:[jt("sprite","class")]})]),CC=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),d$=IC,MB=CC(d$),FB=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"}),DB=Object.freeze({prefixes:TC,vocab:Bs,kinds:$e,precond:Si,get capabilities(){return d$}})});var f$=O(()=>{p$()});var h$=O(()=>{es()});function LC(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||Z(OC,"corpus","worlds")}function m$(e){try{return bc(mr(e))}catch{return null}}function g$(e){if(vp.has(e))return vp.get(e);let t=null,n=m$(Z(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return vp.set(e,t),t}function NC(e,t){let n=g$(e);if(!n)return null;let s=n[String(t??"")];if(!r$(s))return null;let o=`${e}\0${t}`;if(xp.has(o))return xp.get(o);let r=null,i=m$(Z(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],l=[],c=null;for(let u of i.toString("utf8").split(`
167
+ `))if(u.trim())try{let d=JSON.parse(u);if(!i$(d)||d.world!==t)continue;bp(d)?a.push(d):wp(d)?l.push(d):yp(d)&&!c&&(c=d)}catch{}(a.length||l.length||c)&&(r={name:t,facts:a$(a),rules:l,meta:c})}return xp.set(o,r),r}var MC,OC,vp,xp,PC,QB,_c=O(()=>{$o();wc();zs();Ue();xo();MC={},OC=Z(he(Ot(MC.url)),"..","..","..");vp=new Map,xp=new Map;PC=e=>({list:async()=>{let t=g$(e());return t?Object.keys(t).sort():null},load:async t=>NC(e(),t)}),QB=PC(()=>LC())});var aW,b$=O(()=>{Rt();Ue();Ss();Cr();es();Be();aW=Z(".tmct","memory","blocks")});var w$=O(()=>{Eo()});var $$=O(()=>{Ss();Cr();Eo()});var Ep=O(()=>{Ss();Cr();Eo()});var v$=O(()=>{Ep();Ss();so();Eo()});var x$=O(()=>{});var E$=O(()=>{w$();$$();Ep();v$();x$();Eo()});var S$=O(()=>{b$();Be();ba();Qd();E$();$p()});var k$=O(()=>{vn();Uo()});function wr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function Tc(e){let t=n=>UC.map((s,o)=>`--${n}-t${o+1}: ${wr(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: ${wr(e.taught,.12)}; --corpus-soft: ${wr(e.corpus,.12)};`,`--entail-soft: ${wr(e.entail,.14)}; --alert-soft: ${wr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${wr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var Rc,UC,sG,Sp=O(()=>{k$();Rc=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)"})}),UC=[.35,.65,1];sG=`
168
+ :root { color-scheme: light dark; ${Tc(Rc.light)} }
169
+ @media (prefers-color-scheme: dark) { :root { ${Tc(Rc.dark)} } }
170
+ :root[data-theme="dark"] { ${Tc(Rc.dark)} }
171
+ :root[data-theme="light"] { ${Tc(Rc.light)} }
172
+ `});var j$=O(()=>{Sp()});var _$=O(()=>{Sp()});var A$=O(()=>{Be();xo();vn();ki()});var kp,HC,qC,KC,YC,XC,JC,GG,VG,ki=O(()=>{xo();l$();Us();lc();$p();f$();h$();_c();Be();S$();j$();_$();A$();kp="mgx:world-epoch",HC=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),qC=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),KC="mgx:is-open",YC="mgx:hasMass",XC="mgx:knows-about",JC="mgx:display-name",GG=new Set([...HC,...qC,KC,YC,XC,JC,"rdf:type",kp]),VG=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 yr,qG,KG,YG,XG,JG,QG,Ws=O(()=>{yr=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})}),qG=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"}),KG=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"}),YG=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"}),XG=Object.freeze({teach:"teach"}),JG=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),QG=Object.freeze({max_depth:"maxDepth"})});var O$,QC,Ic,ZC,eO,L$,N$,tO,nO,tV,sO,oO,P$=O(()=>{Ws();O$="spider-fly",QC=10,Ic=Object.freeze({x:2,y:2}),ZC=1,eO=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}),L$=(e,t)=>`cell-${e}-${t}`,N$=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),tO=(e,t)=>N$(e,t,Ic.x,Ic.y)<=ZC,nO=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})}),tV=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"])]),sO="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.",oO=Object.freeze({name:O$,gridSize:QC,opening:sO,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:tO,webHomeCell:L$(Ic.x,Ic.y)})});var M$,U$,oV,rV,iV,jp,F$,D$,z$,_p,aV,cV,Cc=O(()=>{Ws();M$=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),U$=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})}),oV=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),rV=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),iV=Object.freeze([M$.spawnedFood,M$.placedFood]),jp=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),F$=jp({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"}]}),D$=jp({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"}]}),z$=jp({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"}]}),_p=Object.freeze({[F$.name]:F$,[D$.name]:D$,[z$.name]:z$}),aV=Object.freeze(Object.keys(_p)),cV=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 B$=O(()=>{});var W$=O(()=>{});var ji,AV,pO,fO,hO,mO,gO,bO,wO,yO,$O,vO,xO,EO,SO,kO,jO,_O,RO,IV,Rp=O(()=>{Cc();B$();so();Be();xo();W$();Mt();Ws();ki();ji=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"}}),AV=Object.freeze(["predator","prey"]),pO="mgx:currently-in",fO="mgx:hasMass",hO="mgx:feels",mO="mgx:facing",gO="mgx:driven-facing",bO="mgx:eaten-by",wO="mgx:starved",yO="mgx:placed-by",$O="mgx:model",vO="mgx:rotation",xO="mgx:carrying",EO="mgx:prey-eaten",SO="mgx:web-built-at-turn",kO="mgx:laid-at-turn",jO="mgx:hatched-into",_O="mgx:turn-played",RO=new Set([pO,fO,hO,mO,gO,bO,wO,yO,$O,vO,_O,xO,EO,SO,kO,jO,"rdf:type",kp]),IV=Object.freeze([...RO].sort())});var YV,XV,V$=O(()=>{P$();Cc();Rp();xo();_c();Be();Ws();YV=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"),XV=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var hH,mH,gH,bH,wH,yH,CO,OO,LO,NO,H$,q$,PO,$H,vH,K$=O(()=>{Cc();Rp();ki();vn();xo();_c();Be();Ws();hH=ji.predator.kind,mH=ji.prey.kind,gH=ji.food.spawnedKind,bH=ji.food.placedKind,wH=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"),yH=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"),CO="mgx:currently-in",OO="mgx:hasMass",LO="mgx:feels",NO="mgx:facing",H$="(fox|goblin|crumb|morsel)(?:-(\\d+))?",q$="(fox|goblin)(?:-(\\d+))?",PO="(crumb|morsel)(?:-(\\d+))?",$H=[{kind:"placement",predicate:CO,re:new RegExp(`^(?:the\\s+)?${H$}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:OO,re:new RegExp(`^(?:the\\s+)?${H$}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:LO,re:new RegExp(`^(?:the\\s+)?${q$}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:NO,re:new RegExp(`^(?:the\\s+)?${q$}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],vH=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${PO}\\s+there[.!\\s]*$`,"i")});var bt,EH,SH,kH,jH,_H,RH,TH,AH,IH,CH,OH,LH,NH,PH,MH,FH,DH,zH,UH,Y$=O(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},EH=bt("createRequire"),SH=bt("readFileSync"),kH=bt("access"),jH=bt("readFile"),_H=bt("writeFile"),RH=bt("appendFile"),TH=bt("mkdir"),AH=bt("mkdtemp"),IH=bt("rename"),CH=bt("unlink"),OH=bt("rm"),LH=bt("stat"),NH=bt("copyFile"),PH=bt("readdir"),MH=bt("createReadStream"),FH=bt("createWriteStream"),DH=bt("randomBytes"),zH=bt("spawnSync"),UH=bt("createInterface")});var wt,WH,GH,VH,HH,qH,KH,YH,XH,JH,QH,ZH,eq,tq,nq,sq,oq,rq,iq,MO,X$=O(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},WH=wt("createRequire"),GH=wt("readFileSync"),VH=wt("access"),HH=wt("readFile"),qH=wt("writeFile"),KH=wt("appendFile"),YH=wt("mkdir"),XH=wt("mkdtemp"),JH=wt("rename"),QH=wt("unlink"),ZH=wt("rm"),eq=wt("stat"),tq=wt("copyFile"),nq=wt("readdir"),sq=wt("createReadStream"),oq=wt("createWriteStream"),rq=wt("randomBytes"),iq=wt("spawnSync"),MO=wt("createInterface")});var yt,cq,lq,uq,dq,pq,fq,hq,mq,gq,bq,wq,yq,$q,vq,xq,Eq,Sq,J$,kq,Tp=O(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},cq=yt("createRequire"),lq=yt("readFileSync"),uq=yt("access"),dq=yt("readFile"),pq=yt("writeFile"),fq=yt("appendFile"),hq=yt("mkdir"),mq=yt("mkdtemp"),gq=yt("rename"),bq=yt("unlink"),wq=yt("rm"),yq=yt("stat"),$q=yt("copyFile"),vq=yt("readdir"),xq=yt("createReadStream"),Eq=yt("createWriteStream"),Sq=yt("randomBytes"),J$=yt("spawnSync"),kq=yt("createInterface")});var Q$=O(()=>{Tp();Ue();Rt();Ue();Ka();Vt()});var Z$=O(()=>{});var FO,ev=O(()=>{Rt();Ue();Be();Z$();FO=Z(".tmct","sessions")});var nv=O(()=>{Rt();Ue();uc()});var sv,Oc,ov=O(()=>{sv=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`)."}),Oc=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var $t,qq,Kq,Yq,Xq,Jq,Qq,Zq,eK,tK,nK,sK,oK,rK,iK,aK,cK,lK,uK,rv,iv=O(()=>{$t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},qq=$t("createRequire"),Kq=$t("readFileSync"),Yq=$t("access"),Xq=$t("readFile"),Jq=$t("writeFile"),Qq=$t("appendFile"),Zq=$t("mkdir"),eK=$t("mkdtemp"),tK=$t("rename"),nK=$t("unlink"),sK=$t("rm"),oK=$t("stat"),rK=$t("copyFile"),iK=$t("readdir"),aK=$t("createReadStream"),cK=$t("createWriteStream"),lK=$t("randomBytes"),uK=$t("spawnSync"),rv=$t("createInterface")});var dv={};Gt(dv,{CONTEXT_PASSAGE_PREDICATE:()=>cv,CO_OCCURS_PREDICATE:()=>Lc,ingestUnknownFromAssertions:()=>UO,knownTermsFrom:()=>lv,passageFor:()=>uv});function lv(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==pt)continue;let o=a=>(s.attributes||[]).find(l=>l?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(V(r)),i&&n.add(V(i))}for(let s of t||[])s?.subject&&n.add(V(s.subject)),s?.object&&n.add(V(s.object));return n}function uv(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=Gs(e?.start),o=Gs(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function zO(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<av;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let l of a)if(!(DO.has(l)||r.has(l)||n.has(l))&&t.has(l)&&(o.push(l),r.add(l),o.length>=av))break}return o}async function UO(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 ft(e),l=lv(a,s),c=new Set,u=[];for(let p of t){if(c.size>=i)break;let h=n.get(p.rel);if(!h||h.ace!=="none")continue;let m=Gs(p.start),b=Gs(p.end);if(!m||!b)continue;let g=V(m),y=V(b),w=!l.has(g),v=!l.has(y);if(!w&&!v)continue;let k=uv(p,h);if(!k)continue;let $=[[m,b,w],[b,m,v]];for(let[x,E,S]of $){if(!S||c.size>=i)continue;let R=V(x);if(c.has(R))continue;let _=`${r} ${p.rel}`;u.push({subject:x,predicate:cv,object:k,provenance:_}),u.push({subject:x,predicate:Lc,object:E,provenance:_});let I=zO(k,l,new Set([g,y]));for(let P of I)u.push({subject:x,predicate:Lc,object:P,provenance:_});c.add(R),l.add(R)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await Gn(e,u),f=u.filter(p=>p.predicate===Lc).length;return{captured:c.size,linked:f,appended:d.appended,skipped:d.skipped}}var cv,Lc,DO,av,pv=O(()=>{Be();Nc();cv="mgx:contextPassage",Lc="mgx:coOccursWith",DO=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"]),av=3});var fv={};Gt(fv,{MAP_FILE:()=>Ri,SEON_CONCEPTS_FILE:()=>Pc,SEON_DEFINITIONS_FILE:()=>BO,SLICE_FILE:()=>_i,TIER2_DIR:()=>Hn,TIER2_MANIFEST_FILE:()=>WO,WORDNET_DIR:()=>Ti,loadMap:()=>Fc,loadSlice:()=>Mc,seedMemory:()=>VO,termText:()=>Gs,toFacts:()=>Dc});async function Mc(e=_i){let t=rv({input:Ty(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 Fc(e=Ri){let n=mo(await _e(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(!GO.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 Dc(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=Gs(o.start),a=Gs(o.end);if(!i||!a)continue;let l=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${l} ${o.rel}`})}return s}async function VO(e,{limit:t,slicePath:n=_i,mapPath:s=Ri,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[l,c]=await Promise.all([Mc(n),Fc(s)]),u=Dc(l,c,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map((w,v)=>[w,v]));u=u.slice().sort((w,v)=>(y.get(w.predicate)??o.length)-(y.get(v.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,w,v)=>`${V(y)} ${w} ${V(v)}`,f=new Set,p=await ft(e);for(let y of p.individuals||[]){if(y?.class!=="Fact")continue;let w=v=>(y.attributes||[]).find(k=>k.key===v)?.value;f.add(d(w("subject"),w("predicate"),w("object")))}let h=0,m=[];for(let y of u){let w=d(y.subject,y.predicate,y.object);if(f.has(w)){h+=1;continue}f.add(w),m.push(y)}let b=await Gn(e,m),g;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(pv(),dv));g=await y(e,{assertions:l,map:c,mappedFacts:u,memory:p,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:b.appended,skipped:h+b.skipped,total:u.length,...g?{unknown:g}:{}}}var HO,$r,_i,Ri,Pc,BO,Hn,WO,Ti,vK,GO,Gs,Nc=O(()=>{$o();Rt();iv();zs();Ue();Ga();Be();HO={},$r=Z(he(Ot(HO.url)),"..","..",".."),_i=Z($r,"corpus","conceptnet","slice.jsonl"),Ri=Z($r,"src","adapters","corpus","conceptnet-map.toml"),Pc=Z($r,"corpus","domains","code","concepts.jsonl"),BO=Z($r,"corpus","domains","code","definitions.jsonl"),Hn=Z($r,"corpus","tier2"),WO=Z(Hn,"manifest.json"),Ti=Z($r,"corpus","wordnet"),vK=Z(Ti,"manifest.json"),GO=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);Gs=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var yv={};Gt(yv,{BUILTIN_EXTENSIONS:()=>XO,EXTENSION_KINDS:()=>zc,activeDomainPacks:()=>Lp,defaultCodeDomainPacks:()=>wv,defaultCodeLaneVocab:()=>bv,mergedLaneVocab:()=>Op,mergedLexiconExtra:()=>gv,resolveExtensions:()=>mv,seedActiveCorpusEntries:()=>ZO,validateExtensionEntry:()=>hv,validateExtensionPack:()=>tL});function Uc(){return{seon:{kind:"corpus",active:!1,corpusPath:Pc,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Pc,provenancePrefix:"corpus:seon",vocabPath:KO,vocabData:sv,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:_i,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:YO},human:{kind:"corpus",active:!0,corpusPath:Z(Hn,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:Z(Hn,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:Z(Hn,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:Z(Hn,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:Ap,vocabData:Oc,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:Z(Hn,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:Ap,vocabData:Oc,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:Z(Hn,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:Ap,vocabData:Oc,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:Z(Hn,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:Z(Ti,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:Z(Ti,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:Z(qO,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function hv(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!zc.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${zc.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 QO(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${zc.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]=JO(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 mv(e,{configFile:t}={}){let n=e?await qa(e,t?{file:t}:{}):null,s=Uc(),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=QO(f,s[f]||null,o[f]||{},e||process.cwd());hv(f,p),a.set(f,p)}let l={};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)}`);l[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:l}}async function ZO(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(Nc(),fv)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,l=0,c=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let 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,l+=p.skipped,c+=p.total}catch(p){i[u]={appended:0,skipped:0,total:0,error:p&&p.message?p.message:String(p)}}return{appended:a,skipped:l,total:c,perBundle:i}}async function gv(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 _e(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 Op(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 _e(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 bv(){if(!Ip){let e={...Uc().code,active:!0};Ip=Op(new Map([["code",e]]),{})}return Ip}async function eL(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 _e(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 Lp(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 eL(o.name,o.entry));return s}function wv(){if(!Cp){let e={...Uc().code,active:!0};Cp=Lp(new Map([["code",e]]),{})}return Cp}async function tL(e,t){let n=[],s=o=>o&&(Zc(o)?o:Nt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Mc(o),i=await Fc(s(t.mapPath)||Ri),a=Dc(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(()=>(Us(),By)),i=JSON.parse(await _e(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(()=>(dc(),_y)),i=await r(o),a=[...i.keys()].filter(l=>!l.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await _e(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,l=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:l}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var Np,qO,KO,Ap,zc,YO,XO,JO,Ip,Cp,Pp=O(()=>{Ue();Rt();zs();ov();Ka();Nc();Np={},qO=Z(he(Ot(Np.url)),"..","..","corpus","namenet"),KO=Z(he(Ot(Np.url)),"..","..","corpus","domains","code","vocab.json"),Ap=Z(he(Ot(Np.url)),"..","..","corpus","tier2","vocab-empty.json"),zc=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),YO=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];XO=Object.freeze(Uc());JO=(e,t)=>{if(t==null)return;let n=String(t);return Zc(n)?n:Nt(e,n)};Ip=null;Cp=null});var $v=O(()=>{});var vv=O(()=>{Ue();$o();Rt();Y$();X$();Tp();Vt();Q$();Le();ev();uc();nv();Ir();Pp();Bc();Ws();lc();pp();vi();$v()});var xv={};Gt(xv,{proseLemma:()=>sL});function sL(){if(So!==void 0)return So;try{let e=Zd();if(!e)return So=null,So;let t=e.its,n=new Map;So=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{So=null}return So}var So,Ev=O(()=>{ep()});var Sv={};Gt(Sv,{digestTermFromRows:()=>iL,loadDigestStructureTable:()=>rL,readDigestStructures:()=>oL});var oL,rL,iL,kv=O(()=>{oL=()=>null,rL=()=>null,iL=()=>null});function Yp(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 ${Wc(e.entityType)}`;if(t==="list")return`list/enumerate ${Wc(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Wc(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 Yp(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&&wn[o]?wn[o]:`filter/traverse ${Wc(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&&wn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?wn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function nf(e){let t=new Map;for(let n of e)t.has(Rv(n))||t.set(Rv(n),n);return t}function Dp(e,t=Ii){let n=[],s=[];for(let l of e)l.predicate===t&&(s.push([l.subject,l.object]),ko(l)&&n.push([l.subject,l.object]));let o=new Map,r=new Map,i=new Set,a=(l,c,u)=>{!c||!u||c===u||(l.has(c)||l.set(c,new Set),l.get(c).add(u))};for(let[l,c]of s)a(r,l,c),c&&i.add(c);for(let[l,c]of n)a(o,l,c);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function zp(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 fL(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function hL(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Ev(),xv)),s=n();return s?fL(t,s(t)):t}catch{return t}}function of(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)||mL.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 Wp(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return hr;if(t==="can")return"mgx:capableOf";try{let n=await hL(t);return n==="have"?hr:ps(`mgx:${n}`)}catch{return ps(`mgx:${t}`)}}function vL(e,t){let n=String(t||"").match($L);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function Ai(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(Is(),dg)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function _L(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 ex(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 tx(e){if(jo[e])return jo[e];let t=String(e||""),n=Lg(t);if(n){let a=tx(n);if(a==="can")return"cannot";if(a==="can be")return"cannot be";if(a==="is"||a.startsWith("is "))return`is not${a.slice(2)}`;let[l,...c]=a.split(" ");return["does not",ex(l),...c].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(t);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${rf})-([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?`${_L(i[1])}${i[2]?` ${i[2]}`:""}`:e}function Vp(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function TL(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of RL)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 Kn(e){return e.replace(/#node:[0-9a-f]+/g,"")}function re(e){let t=e.provenance?` (source: ${Kn(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Bt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Bt(e)}${t}`:e.provenance.includes("corpus:")?`${Bt(e)}${t}`:e.provenance.includes("reference:")?`${Bt(e)}${t}`:`i learned: ${Bt(e)}${t}`}function Iv(e,t,n,{toward:s=null}={}){let o=re(e);if(!qn.has(e.predicate)||!n.has(e.subject))return o;let r=Sc(e.object,t,{cap:6,stopAt:xc,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=o.match(AL);return a?o.slice(0,a.index)+i+a[0]:o+i}function Cv(e,t,n,{indent:s=""}={}){let o=t.filter(k=>k.predicate===Ii).map(k=>[k.subject,k.object]),r=xi(o),i=e.map(k=>`${s}${Iv(k,r,n)}`),a=e.filter(k=>qn.has(k.predicate)&&n.has(k.subject)),l=[...new Set(a.map(k=>k.object))];if(l.length<2)return{lines:i,grouped:null};let c=t.filter(k=>k.predicate==="owl:disjointWith").map(k=>[k.subject,k.object]),{split:u,clusters:d}=kc(l,{parents:r,disjointEdges:c});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let k of d)for(let $ of k.objects)p.set($,k);let h=e.filter(k=>!(qn.has(k.predicate)&&n.has(k.subject))),m=[],b=[],g=0,y=k=>{let $=Iv(k,r,n);return g<ve?(g+=1,`${s}${$}`):(b.push($),null)};for(let k of d){let $=a.filter(x=>p.get(x.object)===k).map(y).filter(Boolean);$.length&&m.push(`${s}${f}, the ${k.label}:
173
173
  ${$.join(`
174
174
  `)}`)}if(h.length){let k=h.map(y).filter(Boolean);k.length&&m.push(`${s}also about ${f}:
175
175
  ${k.join(`
176
176
  `)}`)}let w=b.length?`
177
177
  ${s}\u2026and ${b.length} more \u2014 say 'more' to see them.`:"",v={text:m.join(`
178
- `)+w,replace:!0,...b.length?{pending:{items:b,noun:"facts"}}:{}};return{lines:i,grouped:v}}async function pL(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(wv(),bv)))}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
+ `)+w,replace:!0,...b.length?{pending:{items:b,noun:"facts"}}:{}};return{lines:i,grouped:v}}async function CL(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(kv(),Sv)))}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
  `:"",l=`Say 'show the facts' for all ${s.length} stored facts.`;return{text:`${r.paragraphs.join(`
180
180
 
181
181
  `)}
182
182
 
183
- ${a}${l}`,pending:{items:s,noun:"facts"}}}function $r(e){let t=Gd().find(n=>n.kind==="article");return t&&$y(String(e||""),t)?"an":"a"}function Yv(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${re(e)}; ${re(t)}. To settle it, say "forget that ${e.subject} is ${$r(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${re(t)}`,replace:!0}:e?{text:`yes \u2014 ${re(e)}`,replace:!0}:null}function fL(e,t){let n=s=>`${Ut(s)}${s.provenance?` (source: ${Kn(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 ${$r(e.object)} ${e.object}".`,replace:!0}}function Mc(e){let t=o=>`${Ut(o)}${o.provenance?` (source: ${Kn(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Pp(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Be(),Ds)),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 et(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(Be(),Ds)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function hL(e){if(!Fc)try{Fc=_n().nounPlurals}catch{Fc=new Map}return Fc.get(e)??null}function zc(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return Vn(_n(),t)?.lemma||t}catch{return t}}function mL(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return zc(e);let n=zc(Kp(t[1]));return`${$r(n)} ${n}`}function X(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(gL,"").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=hL(i);a&&s.add(e(a))}return s}function jv(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 Qv(e,t=null){let n=Uc(e),s=n.match(bL);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(yL);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function Up(e){let t=String(e||"").replace(xL,"");if(t!==e){let s=t.match(Vs);if(s)return s}let n=String(e||"").match(EL);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(Vs):null}function kL(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>qn.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(" "),l=X(n,a);if(o.some(c=>l.has(c.subject)&&i.has(c.object)))return a}return null}function Wp(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 Rv(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function zL(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=>`${Ut(s)}${s.provenance?` (source: ${Kn(s.provenance)})`:""}`).join("; ")}function Av(e,t,n,{maxHops:s=3}={}){let o=X(V,e),r=X(V,t),i=va(o,r,n,{maxHops:s}),a=l=>{let c=l&&l.length?zL(l,n):null;return c?` \u2014 via: ${c}`:""};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}${l}`,pending:{items:s,noun:"facts"}}}function vr(e){let t=Jd().find(n=>n.kind==="article");return t&&Ay(String(e||""),t)?"an":"a"}function nx(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${re(e)}; ${re(t)}. To settle it, say "forget that ${e.subject} is ${vr(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${re(t)}`,replace:!0}:e?{text:`yes \u2014 ${re(e)}`,replace:!0}:null}function OL(e,t){let n=s=>`${Bt(s)}${s.provenance?` (source: ${Kn(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 ${vr(e.object)} ${e.object}".`,replace:!0}}function Gc(e){let t=o=>`${Bt(o)}${o.provenance?` (source: ${Kn(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Hp(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Be(),Ds)),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 et(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(Be(),Ds)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function LL(e){if(!Vc)try{Vc=_n().nounPlurals}catch{Vc=new Map}return Vc.get(e)??null}function qc(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return Vn(_n(),t)?.lemma||t}catch{return t}}function NL(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return qc(e);let n=qc(of(t[1]));return`${vr(n)} ${n}`}function X(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(PL,"").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=LL(i);a&&s.add(e(a))}return s}function Ov(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 rx(e,t=null){let n=Kc(e),s=n.match(ML);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(DL);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function Jp(e){let t=String(e||"").replace(BL,"");if(t!==e){let s=t.match(Vs);if(s)return s}let n=String(e||"").match(WL);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(Vs):null}function VL(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>qn.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(" "),l=X(n,a);if(o.some(c=>l.has(c.subject)&&i.has(c.object)))return a}return null}function Zp(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 Nv(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function iN(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=>`${Bt(s)}${s.provenance?` (source: ${Kn(s.provenance)})`:""}`).join("; ")}function Mv(e,t,n,{maxHops:s=3}={}){let o=X(V,e),r=X(V,t),i=Sa(o,r,n,{maxHops:s}),a=l=>{let c=l&&l.length?iN(l,n):null;return c?` \u2014 via: ${c}`:""};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(re).join(`
185
- `)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let l=i.verdict==="no"?i.negative[0]:i.positive[0],c=`${i.verdict} \u2014 ${re(l)}${a(i.chain)}`;return i.overrides&&(c+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${re(i.overrides.fact)}`),{text:c,replace:!0}}return null}function Iv(e,t,n,{maxHops:s=3}={}){let o=X(V,e),r=X(V,t),i=Su(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,l=`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,Eu).map(f=>re(f.fact));return{text:`${l} ${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 l=i.verdict==="no"?i.negative[0]:i.positive[0],c=`${i.verdict} \u2014 ${re(l)}${a(i.chain)}`;return i.overrides&&(c+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${re(i.overrides.fact)}`),{text:c,replace:!0}}return null}function Fv(e,t,n,{maxHops:s=3}={}){let o=X(V,e),r=X(V,t),i=Iu(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,l=`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,Au).map(f=>re(f.fact));return{text:`${l} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
186
186
  ${d.join(`
187
- `)}`,replace:!0,miss:!0}}let c=ku(r,n,{exclude:new Set([...o,i.klass])});if(c.length){let u=c.slice(0,Eu),d=c.slice(u.length);return{text:`${l} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${c.length} thing${c.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
187
+ `)}`,replace:!0,miss:!0}}let c=Cu(r,n,{exclude:new Set([...o,i.klass])});if(c.length){let u=c.slice(0,Au),d=c.slice(u.length);return{text:`${l} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${c.length} thing${c.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
188
188
  ${u.map(re).join(`
189
- `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(re),noun:"facts"}}:{}}}return{text:`${l} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function WL(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 an(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 ex(e,t,n,s,o={},r=null,i=null){return tx(await XL(e,t,n,s,o,r,i),n,t)}function tx(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Dp(t?.parsed);if(!o&&e.generalVerbQuery&&(o=yv),!o){let r=s.match(zp),i=r?null:Uc(s).match(Jv)||Qv(s),a=r?r[2]:i?i[1]:null;a&&!Bp.has(a.toLowerCase())&&(o=yv)}if(!o){let r=s.match(sx);r&&(o=Dp({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function XL(e,t,n,s,o={},r=null,i=null){let a,l;try{({normFactTerm:a,normFactPredicate:l}=await Promise.resolve().then(()=>(Be(),Ds)))}catch{return null}let c=String(t).trim(),u=c.match(AL);if(u){let D=X(a,u[1]),B=(await et(e,r)).filter(W=>W.predicate==="mgx:usedFor"&&D.has(W.object));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
189
+ `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(re),noun:"facts"}}:{}}}return{text:`${l} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function lN(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 an(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 ax(e,t,n,s,o={},r=null,i=null){return cx(await gN(e,t,n,s,o,r,i),n,t)}function cx(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Yp(t?.parsed);if(!o&&e.generalVerbQuery&&(o=jv),!o){let r=s.match(Xp),i=r?null:Kc(s).match(ox)||rx(s),a=r?r[2]:i?i[1]:null;a&&!Qp.has(a.toLowerCase())&&(o=jv)}if(!o){let r=s.match(ux);r&&(o=Yp({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function gN(e,t,n,s,o={},r=null,i=null){let a,l;try{({normFactTerm:a,normFactPredicate:l}=await Promise.resolve().then(()=>(Be(),Ds)))}catch{return null}let c=String(t).trim(),u=c.match(XL);if(u){let D=X(a,u[1]),B=(await et(e,r)).filter(W=>W.predicate==="mgx:usedFor"&&D.has(W.object));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
190
190
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
191
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}for(let{predicate:D,re:B}of VL){let W=c.match(B);if(!W)continue;let A=X(a,W[1]),L=(await et(e,r)).filter(Q=>Q.predicate===D&&A.has(Q.object));if(!L.length)continue;let N=Ye(an(L),o).map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
191
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}for(let{predicate:D,re:B}of dN){let W=c.match(B);if(!W)continue;let A=X(a,W[1]),L=(await et(e,r)).filter(Q=>Q.predicate===D&&A.has(Q.object));if(!L.length)continue;let N=Ye(an(L),o).map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
192
192
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
193
- `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let d=c.match(UL),f=d?null:c.match(BL),p=d?d[1]:f?.[2],h=d?d[2]:f?.[1],m=p&&h?WL(h):null;if(m){let D=`mgx:${m.replace(/\s+/g,"-")}-than`,B=await et(e,r),W=X(a,p),A=[...W].sort((N,M)=>N.length-M.length)[0],L=N=>W.has(N)||N.startsWith(`${A}-`)||N.startsWith(`${A} `)||B.some(M=>qn.has(M.predicate)&&M.subject===N&&W.has(M.object)),C=an(B.filter(N=>N.predicate===D&&ko(N))).filter(N=>N.subject!==N.object&&L(N.subject)&&L(N.object));if(C.length){let N=new Set,M=new Map;for(let te of C)N.add(te.subject),N.add(te.object),M.set(te.object,(M.get(te.object)||0)+1),M.has(te.subject)||M.set(te.subject,M.get(te.subject)||0);let z=new Map(M),q=[],Q=null;for(;z.size;){let te=[...z.keys()].filter(Y=>z.get(Y)===0);if(te.length!==1){Q=te.length===0?{text:`I can't order the ${A}s \u2014 the "${m} than" facts I have loop back on themselves, so no ${h} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${h} ${A} from what I know \u2014 nothing compares ${te[0]} and ${te[1]}. Teach me, e.g. "${te[0]} is ${m} than ${te[1]}".`,replace:!0,miss:!0};break}let ee=te[0];q.push(ee),z.delete(ee);for(let Y of C)Y.subject===ee&&z.has(Y.object)&&z.set(Y.object,z.get(Y.object)-1)}if(Q)return Q;let ae=q.slice(0,-1).map((te,ee)=>C.find(Y=>Y.subject===te&&Y.object===q[ee+1]));if(ae.every(Boolean)){let te=ae.map(ee=>`${Ut(ee)}${ee.provenance?` (source: ${Kn(ee.provenance)})`:""}`).join("; ");return{text:`${q[0]} \u2014 ${te}; so ${q[0]} is the ${h} ${A}`,replace:!0}}}}let b=s?c.match(IL)||c.match(CL):null;if(b){let D=X(a,b[1]),B=(await et(e,r)).filter(W=>To(W.predicate)!==null&&D.has(W.subject));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
193
+ `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}let d=c.match(aN),f=d?null:c.match(cN),p=d?d[1]:f?.[2],h=d?d[2]:f?.[1],m=p&&h?lN(h):null;if(m){let D=`mgx:${m.replace(/\s+/g,"-")}-than`,B=await et(e,r),W=X(a,p),A=[...W].sort((N,M)=>N.length-M.length)[0],L=N=>W.has(N)||N.startsWith(`${A}-`)||N.startsWith(`${A} `)||B.some(M=>qn.has(M.predicate)&&M.subject===N&&W.has(M.object)),C=an(B.filter(N=>N.predicate===D&&ko(N))).filter(N=>N.subject!==N.object&&L(N.subject)&&L(N.object));if(C.length){let N=new Set,M=new Map;for(let te of C)N.add(te.subject),N.add(te.object),M.set(te.object,(M.get(te.object)||0)+1),M.has(te.subject)||M.set(te.subject,M.get(te.subject)||0);let z=new Map(M),q=[],Q=null;for(;z.size;){let te=[...z.keys()].filter(Y=>z.get(Y)===0);if(te.length!==1){Q=te.length===0?{text:`I can't order the ${A}s \u2014 the "${m} than" facts I have loop back on themselves, so no ${h} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${h} ${A} from what I know \u2014 nothing compares ${te[0]} and ${te[1]}. Teach me, e.g. "${te[0]} is ${m} than ${te[1]}".`,replace:!0,miss:!0};break}let ee=te[0];q.push(ee),z.delete(ee);for(let Y of C)Y.subject===ee&&z.has(Y.object)&&z.set(Y.object,z.get(Y.object)-1)}if(Q)return Q;let ae=q.slice(0,-1).map((te,ee)=>C.find(Y=>Y.subject===te&&Y.object===q[ee+1]));if(ae.every(Boolean)){let te=ae.map(ee=>`${Bt(ee)}${ee.provenance?` (source: ${Kn(ee.provenance)})`:""}`).join("; ");return{text:`${q[0]} \u2014 ${te}; so ${q[0]} is the ${h} ${A}`,replace:!0}}}}let b=s?c.match(JL)||c.match(QL):null;if(b){let D=X(a,b[1]),B=(await et(e,r)).filter(W=>To(W.predicate)!==null&&D.has(W.subject));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
194
194
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
195
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let g=c.match(OL);if(g){let D=g[1].toLowerCase(),B=X(a,g[2].replace(/^(?:an?|the)\s+/i,"").trim()),W=(await et(e,r)).filter(A=>To(A.predicate)===D&&B.has(A.object));if(W.length){let L=Ye(an(W),o).map(re),C=L.slice(0,ve),N=L.slice(ve),M=N.length?`
195
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let g=c.match(ZL);if(g){let D=g[1].toLowerCase(),B=X(a,g[2].replace(/^(?:an?|the)\s+/i,"").trim()),W=(await et(e,r)).filter(A=>To(A.predicate)===D&&B.has(A.object));if(W.length){let L=Ye(an(W),o).map(re),C=L.slice(0,ve),N=L.slice(ve),M=N.length?`
196
196
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:C.join(`
197
- `)+M,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}{let D=c.match(LL),B=D?D[2]:g&&["in","inside"].includes(g[1].toLowerCase())?g[2]:null;if(B!=null){let W=D&&D[1].toLowerCase()==="parts"?["mgx:partOf"]:rL,A=X(a,B.replace(/^(?:an?|the)\s+/i,"").trim()),L=(await et(e,r)).filter(C=>W.includes(C.predicate)&&A.has(C.object)).sort(WO);if(L.length){let N=Ye(an(L),o).map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
197
+ `)+M,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}{let D=c.match(eN),B=D?D[2]:g&&["in","inside"].includes(g[1].toLowerCase())?g[2]:null;if(B!=null){let W=D&&D[1].toLowerCase()==="parts"?["mgx:partOf"]:kL,A=X(a,B.replace(/^(?:an?|the)\s+/i,"").trim()),L=(await et(e,r)).filter(C=>W.includes(C.predicate)&&A.has(C.object)).sort(lL);if(L.length){let N=Ye(an(L),o).map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
198
198
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
199
- `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}}let y=c.match(NL);if(y){let D=y[3].toLowerCase(),B=X(a,y[2]),W=new Set([...X(a,y[1])].map(L=>l(`mgx:${D}-${L.replace(/\s+/g,"-")}`))),A=(await et(e,r)).filter(L=>W.has(l(L.predicate))&&B.has(a(L.subject)));if(A.length){let C=Ye(an(A),o).map(re),N=C.slice(0,ve),M=C.slice(ve),z=M.length?`
199
+ `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}}let y=c.match(tN);if(y){let D=y[3].toLowerCase(),B=X(a,y[2]),W=new Set([...X(a,y[1])].map(L=>l(`mgx:${D}-${L.replace(/\s+/g,"-")}`))),A=(await et(e,r)).filter(L=>W.has(l(L.predicate))&&B.has(a(L.subject)));if(A.length){let C=Ye(an(A),o).map(re),N=C.slice(0,ve),M=C.slice(ve),z=M.length?`
200
200
  \u2026and ${M.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
201
- `)+z,replace:!0,...M.length?{pending:{items:M,noun:"facts"}}:{}}}}let w=n?.parsed?.shape==="meta"?n.parsed.object:null,v=n?.parsed&&n.parsed.node!=="miss";if(!w&&s&&!v&&!Cv.test(c)){let D=c.match(sx)||c.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);D&&(w=vs(D[1]))}if(!w&&s){let D=c.match(fN);D&&(w=vs(nn(D[1].trim())))}if(!w&&n?.ambiguous&&Array.isArray(n.candidateParses)){let D=n.candidateParses.find(B=>B?.shape==="meta"&&B.object);D&&(w=vs(String(D.object)))}if(w){let D=lL(w),{predicate:B}=D,W=D.subject.replace(/^(?:the|an?)\s+/i,"").trim()||D.subject,A=!1;if(B&&ys.test(W)){if(!i){let J=String(jo[B]||"").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>${J?` ${J}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}W=i,A=!0}let L=X(a,W),C=await et(e,r);if(!C.some(J=>L.has(J.subject)||L.has(J.object))){let J=kL(W,C,a);J&&(W=J,L=X(a,W))}let N=(await et(e,r)).filter(J=>L.has(J.subject)&&!Ev.has(J.predicate)),M=B?N.filter(J=>l(J.predicate)===B):N;if(!B&&M.length&&!M.some(Mp)&&(M=[]),!M.length){if(B&&(N.length||A))return{text:`I don't have any "${jo[B]}" facts about ${W}.`,replace:s,...N.length?{}:{miss:!0}};if(!B){let J=Ye((await et(e,r)).filter(ne=>L.has(ne.object)),o);if(J.length&&!J.some(Mp)&&(J=[]),J.length){let ne=J.map(re),xe=ne.slice(0,ve),Te=ne.slice(ve),ue=Te.length?`
201
+ `)+z,replace:!0,...M.length?{pending:{items:M,noun:"facts"}}:{}}}}let w=n?.parsed?.shape==="meta"?n.parsed.object:null,v=n?.parsed&&n.parsed.node!=="miss";if(!w&&s&&!v&&!Dv.test(c)){let D=c.match(ux)||c.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);D&&(w=vs(D[1]))}if(!w&&s){let D=c.match(ON);D&&(w=vs(nn(D[1].trim())))}if(!w&&n?.ambiguous&&Array.isArray(n.candidateParses)){let D=n.candidateParses.find(B=>B?.shape==="meta"&&B.object);D&&(w=vs(String(D.object)))}if(w){let D=TL(w),{predicate:B}=D,W=D.subject.replace(/^(?:the|an?)\s+/i,"").trim()||D.subject,A=!1;if(B&&ys.test(W)){if(!i){let J=String(jo[B]||"").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>${J?` ${J}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}W=i,A=!0}let L=X(a,W),C=await et(e,r);if(!C.some(J=>L.has(J.subject)||L.has(J.object))){let J=VL(W,C,a);J&&(W=J,L=X(a,W))}let N=(await et(e,r)).filter(J=>L.has(J.subject)&&!Av.has(J.predicate)),M=B?N.filter(J=>l(J.predicate)===B):N;if(!B&&M.length&&!M.some(qp)&&(M=[]),!M.length){if(B&&(N.length||A))return{text:`I don't have any "${jo[B]}" facts about ${W}.`,replace:s,...N.length?{}:{miss:!0}};if(!B){let J=Ye((await et(e,r)).filter(ne=>L.has(ne.object)),o);if(J.length&&!J.some(qp)&&(J=[]),J.length){let ne=J.map(re),xe=ne.slice(0,ve),Te=ne.slice(ve),ue=Te.length?`
202
202
  \u2026and ${Te.length} more \u2014 say 'more' to see them.`:"";return{text:xe.join(`
203
- `)+ue,replace:s,...Te.length?{pending:{items:Te,noun:"facts"}}:{}}}}return null}M=Ye(M,o);let z=await et(e,r),{lines:q,grouped:Q}=kv(M,z,L),ae=!B&&q.length>dL?await pL(W,M,z,q):null;if(ae)return{...ae,replace:s};if(Q)return{...Q,replace:s};let te=q.slice(0,ve),ee=q.slice(ve),Y=ee.length?`
203
+ `)+ue,replace:s,...Te.length?{pending:{items:Te,noun:"facts"}}:{}}}}return null}M=Ye(M,o);let z=await et(e,r),{lines:q,grouped:Q}=Cv(M,z,L),ae=!B&&q.length>IL?await CL(W,M,z,q):null;if(ae)return{...ae,replace:s};if(Q)return{...Q,replace:s};let te=q.slice(0,ve),ee=q.slice(ve),Y=ee.length?`
204
204
  \u2026and ${ee.length} more \u2014 say 'more' to see them.`:"";return{text:te.join(`
205
- `)+Y,replace:s,...ee.length?{pending:{items:ee,noun:"facts"}}:{}}}if(!s)return null;let k=c.match(VO);if(k){let B=`mgx:${k[2].toLowerCase().replace(/\s+/g,"-")}-than`,W=await Pp(e),A=ae=>{let te=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&ys.test(te)?i:te},L=A(k[1]),C=A(k[3]),N=X(a,L),M=X(a,C),z=W.find(ae=>ae.predicate===B&&N.has(ae.subject)&&M.has(ae.object));if(z){let ae=W.find(ee=>ee.predicate===B&&N.has(ee.object)&&M.has(ee.subject)),te=ae?` \u2014 though you also told me the opposite: ${re(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${re(z)}${te}`,replace:!0}}let q=W.filter(ae=>ae.predicate===B&&(N.has(ae.subject)||N.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${q.length?` I do know: ${q.slice(0,3).map(re).join("; ")}.`:""} If it's true, teach me: "${L} is ${k[2].toLowerCase()} than ${C}".`,replace:!0,miss:!0}}for(let{predicate:D,phrase:B,re:W}of KL){let A=c.match(W);if(!A)continue;let L=await Pp(e),C=X(a,A[1]),N=X(a,A[2]),M=L.find(Q=>Q.predicate===D&&C.has(Q.subject)&&N.has(Q.object));if(M)return{text:`yes \u2014 ${re(M)}`,replace:!0};let z=qL.has(D)?` If it's true, teach me: "${A[1]} ${B} ${A[2]}".`:"",q=L.filter(Q=>Q.predicate===D&&C.has(Q.subject));if(q.length){let Q=q.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${A[1]} ${B} ${A[2]}. I do know: ${Q}.${z}`,replace:!0,miss:!0}}if(!n?.parsed&&L.some(Q=>C.has(Q.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${A[1]} ${B} ${A[2]}.${z}`,replace:!0,miss:!0};break}let $=c.match(Vs)||Up(c);if($){let D=X(a,$[1]),B=X(a,$[2]),W=await et(e,r),A=M=>D.has(M.subject)&&B.has(M.object),{DISJOINT_PREDICATE:L}=await Promise.resolve().then(()=>(Xt(),fn)),C=M=>D.has(M.subject)||D.has(M.object)||B.has(M.subject)||B.has(M.object);return W.some(M=>M.predicate===L&&ko(M)&&C(M))?null:Yv(W.find(M=>qn.has(M.predicate)&&A(M)),W.find(M=>M.predicate===ya&&A(M)))}let x=Wp(c),E=x.match(jL);if(E){let D=await et(e,r),B=E[1],W=Av(E[2],E[3],D);if(W&&x!==Tv(c)&&(W=Rv(W)),W&&B)return{text:`I can't speak for ${B.trim()} ${E[2]} \u2014 what I remember is generic, not universal. ${W.text}.`,replace:!0};if(W)return W;let A=X(a,E[2]),L=D.filter(C=>C.predicate==="mgx:capableOf"&&A.has(C.subject));if(L.length){let C=L.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${E[2]} can ${E[3]}. I do know: ${C}. If it's true, teach me: "a ${L[0].subject} can ${E[3]}".`,replace:!0,miss:!0}}return Iv(E[2],E[3],D)}let S=c.match(_L);if(S){let D=X(a,S[1]),B=X(a,S[2]),W=new Set(["mgx:hasA","tmct:has"]),A=await Pp(e),L=z=>A.find(q=>W.has(q.predicate)&&z.has(q.subject)&&B.has(q.object)),C=L(D);if(C)return{text:`yes \u2014 ${re(C)}`,replace:!0};let N=[{terms:D,chain:[]}],M=new Set;for(let z=0;z<4;z+=1){let q=[];for(let{terms:Q,chain:ae}of N){let te=A.filter(ee=>qn.has(ee.predicate)&&Q.has(ee.subject)&&!M.has(ee.object));for(let ee of te){if(M.has(ee.object))continue;M.add(ee.object);let Y=[...ae,ee],J=L(X(a,ee.object));if(J)return{text:`yes \u2014 ${[...Y.map(re),re(J)].join("; ")}`,replace:!0};q.push({terms:X(a,ee.object),chain:Y})}}if(!q.length)break;N=q}return null}let R=Wp(c),_=R.match(PL);if(_){let D=await et(e,r),B=!!_[1],W=X(a,_[2]),A=X(a,_[3]),L=Av(_[2],_[3],D);if(L&&R!==Tv(c)&&(L=Rv(L)),L&&B)return{text:`I can't speak for ${_[1].trim()} ${_[2]} \u2014 what I remember is generic, not universal. ${L.text}.`,replace:!0};if(L)return L;if(s){let C=D.filter(M=>M.predicate==="mgx:capableOf"&&W.has(M.subject));if(C.length){let M=C.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${_[2]} can ${_[3]}. I do know: ${M}. If it's true, teach me: "a ${C[0].subject} can ${_[3]}".`,replace:!0,miss:!0}}let N=Iv(_[2],_[3],D);if(N)return N;if(!/\s/.test(_[2].trim())&&!D.some(M=>W.has(M.subject)||W.has(M.object))){let M=Kp(zc(_[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${_[2]}" yet. Teach me "a ${M} can ${_[3]}" (or "a ${M} cannot ${_[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let I=c.match(RL);if(I){let D=X(a,I[1]),B=(await et(e,r)).filter(M=>(M.predicate==="mgx:capableOf"||M.predicate===tr)&&D.has(M.subject));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
205
+ `)+Y,replace:s,...ee.length?{pending:{items:ee,noun:"facts"}}:{}}}if(!s)return null;let k=c.match(dL);if(k){let B=`mgx:${k[2].toLowerCase().replace(/\s+/g,"-")}-than`,W=await Hp(e),A=ae=>{let te=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&ys.test(te)?i:te},L=A(k[1]),C=A(k[3]),N=X(a,L),M=X(a,C),z=W.find(ae=>ae.predicate===B&&N.has(ae.subject)&&M.has(ae.object));if(z){let ae=W.find(ee=>ee.predicate===B&&N.has(ee.object)&&M.has(ee.subject)),te=ae?` \u2014 though you also told me the opposite: ${re(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${re(z)}${te}`,replace:!0}}let q=W.filter(ae=>ae.predicate===B&&(N.has(ae.subject)||N.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${q.length?` I do know: ${q.slice(0,3).map(re).join("; ")}.`:""} If it's true, teach me: "${L} is ${k[2].toLowerCase()} than ${C}".`,replace:!0,miss:!0}}for(let{predicate:D,phrase:B,re:W}of hN){let A=c.match(W);if(!A)continue;let L=await Hp(e),C=X(a,A[1]),N=X(a,A[2]),M=L.find(Q=>Q.predicate===D&&C.has(Q.subject)&&N.has(Q.object));if(M)return{text:`yes \u2014 ${re(M)}`,replace:!0};let z=fN.has(D)?` If it's true, teach me: "${A[1]} ${B} ${A[2]}".`:"",q=L.filter(Q=>Q.predicate===D&&C.has(Q.subject));if(q.length){let Q=q.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${A[1]} ${B} ${A[2]}. I do know: ${Q}.${z}`,replace:!0,miss:!0}}if(!n?.parsed&&L.some(Q=>C.has(Q.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${A[1]} ${B} ${A[2]}.${z}`,replace:!0,miss:!0};break}let $=c.match(Vs)||Jp(c);if($){let D=X(a,$[1]),B=X(a,$[2]),W=await et(e,r),A=M=>D.has(M.subject)&&B.has(M.object),{DISJOINT_PREDICATE:L}=await Promise.resolve().then(()=>(Xt(),fn)),C=M=>D.has(M.subject)||D.has(M.object)||B.has(M.subject)||B.has(M.object);return W.some(M=>M.predicate===L&&ko(M)&&C(M))?null:nx(W.find(M=>qn.has(M.predicate)&&A(M)),W.find(M=>M.predicate===xa&&A(M)))}let x=Zp(c),E=x.match(HL);if(E){let D=await et(e,r),B=E[1],W=Mv(E[2],E[3],D);if(W&&x!==Pv(c)&&(W=Nv(W)),W&&B)return{text:`I can't speak for ${B.trim()} ${E[2]} \u2014 what I remember is generic, not universal. ${W.text}.`,replace:!0};if(W)return W;let A=X(a,E[2]),L=D.filter(C=>C.predicate==="mgx:capableOf"&&A.has(C.subject));if(L.length){let C=L.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${E[2]} can ${E[3]}. I do know: ${C}. If it's true, teach me: "a ${L[0].subject} can ${E[3]}".`,replace:!0,miss:!0}}return Fv(E[2],E[3],D)}let S=c.match(qL);if(S){let D=X(a,S[1]),B=X(a,S[2]),W=new Set(["mgx:hasA","tmct:has"]),A=await Hp(e),L=z=>A.find(q=>W.has(q.predicate)&&z.has(q.subject)&&B.has(q.object)),C=L(D);if(C)return{text:`yes \u2014 ${re(C)}`,replace:!0};let N=[{terms:D,chain:[]}],M=new Set;for(let z=0;z<4;z+=1){let q=[];for(let{terms:Q,chain:ae}of N){let te=A.filter(ee=>qn.has(ee.predicate)&&Q.has(ee.subject)&&!M.has(ee.object));for(let ee of te){if(M.has(ee.object))continue;M.add(ee.object);let Y=[...ae,ee],J=L(X(a,ee.object));if(J)return{text:`yes \u2014 ${[...Y.map(re),re(J)].join("; ")}`,replace:!0};q.push({terms:X(a,ee.object),chain:Y})}}if(!q.length)break;N=q}return null}let R=Zp(c),_=R.match(nN);if(_){let D=await et(e,r),B=!!_[1],W=X(a,_[2]),A=X(a,_[3]),L=Mv(_[2],_[3],D);if(L&&R!==Pv(c)&&(L=Nv(L)),L&&B)return{text:`I can't speak for ${_[1].trim()} ${_[2]} \u2014 what I remember is generic, not universal. ${L.text}.`,replace:!0};if(L)return L;if(s){let C=D.filter(M=>M.predicate==="mgx:capableOf"&&W.has(M.subject));if(C.length){let M=C.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${_[2]} can ${_[3]}. I do know: ${M}. If it's true, teach me: "a ${C[0].subject} can ${_[3]}".`,replace:!0,miss:!0}}let N=Fv(_[2],_[3],D);if(N)return N;if(!/\s/.test(_[2].trim())&&!D.some(M=>W.has(M.subject)||W.has(M.object))){let M=of(qc(_[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${_[2]}" yet. Teach me "a ${M} can ${_[3]}" (or "a ${M} cannot ${_[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let I=c.match(KL);if(I){let D=X(a,I[1]),B=(await et(e,r)).filter(M=>(M.predicate==="mgx:capableOf"||M.predicate===tr)&&D.has(M.subject));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
206
206
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
207
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let P=c.match(DL);if(P){let D=X(a,P[1]),B=X(a,P[2]),W=await et(e,r),A=an(W.filter(L=>L.predicate==="mgx:capableOf"&&B.has(L.object))).filter(L=>va(new Set([L.subject]),B,W).verdict==="yes");if(A.length){let{findIsaChain:L,buildSubClassSuccessors:C,SUBCLASS_PREDICATE:N,TYPE_PREDICATE:M}=await Promise.resolve().then(()=>(Xt(),fn)),z=W.filter(oe=>oe.predicate===N),q=W.filter(oe=>oe.predicate===M),Q=z.map(oe=>[oe.subject,oe.object]),ae=q.map(oe=>[oe.subject,oe.object]),te=C(Q),ee=oe=>(oe.predicate===N?z:q).find(ke=>ke.subject===oe.subject&&ke.object===oe.object),Y=new Map,J=A.filter(oe=>D.has(oe.subject)?!0:(Y.has(oe.subject)||Y.set(oe.subject,L(oe.subject,D,ae,te,{maxHops:3})),!!Y.get(oe.subject))),xe=Ye(J.length?J:A,o).map(oe=>{let ke=J.length?Y.get(oe.subject):null;if(!ke||ke.length<2)return re(oe);let le=ke.map(ee);if(!le.every(Boolean))return re(oe);let H=le.map(se=>`${Ut(se)}${se.provenance?` (source: ${Kn(se.provenance)})`:""}`).join("; ");return`${re(oe)} \u2014 via: ${H}`}),Te=xe.slice(0,ve),ue=xe.slice(ve),Ie=ue.length?`
207
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let P=c.match(rN);if(P){let D=X(a,P[1]),B=X(a,P[2]),W=await et(e,r),A=an(W.filter(L=>L.predicate==="mgx:capableOf"&&B.has(L.object))).filter(L=>Sa(new Set([L.subject]),B,W).verdict==="yes");if(A.length){let{findIsaChain:L,buildSubClassSuccessors:C,SUBCLASS_PREDICATE:N,TYPE_PREDICATE:M}=await Promise.resolve().then(()=>(Xt(),fn)),z=W.filter(oe=>oe.predicate===N),q=W.filter(oe=>oe.predicate===M),Q=z.map(oe=>[oe.subject,oe.object]),ae=q.map(oe=>[oe.subject,oe.object]),te=C(Q),ee=oe=>(oe.predicate===N?z:q).find(ke=>ke.subject===oe.subject&&ke.object===oe.object),Y=new Map,J=A.filter(oe=>D.has(oe.subject)?!0:(Y.has(oe.subject)||Y.set(oe.subject,L(oe.subject,D,ae,te,{maxHops:3})),!!Y.get(oe.subject))),xe=Ye(J.length?J:A,o).map(oe=>{let ke=J.length?Y.get(oe.subject):null;if(!ke||ke.length<2)return re(oe);let le=ke.map(ee);if(!le.every(Boolean))return re(oe);let H=le.map(se=>`${Bt(se)}${se.provenance?` (source: ${Kn(se.provenance)})`:""}`).join("; ");return`${re(oe)} \u2014 via: ${H}`}),Te=xe.slice(0,ve),ue=xe.slice(ve),Ie=ue.length?`
208
208
  \u2026and ${ue.length} more \u2014 say 'more' to see them.`:"";return{text:(J.length?"":`nothing I remember ties these to "${P[1]}", but:
209
209
  `)+Te.join(`
210
- `)+Ie,replace:!0,...ue.length?{pending:{items:ue,noun:"facts"}}:{}}}}let T=c.match(FL);if(T&&T[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,T[1]),B=(await et(e,r)).filter(W=>W.predicate==="mgxneg:capableOf"&&D.has(W.object));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
210
+ `)+Ie,replace:!0,...ue.length?{pending:{items:ue,noun:"facts"}}:{}}}}let T=c.match(oN);if(T&&T[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,T[1]),B=(await et(e,r)).filter(W=>W.predicate==="mgxneg:capableOf"&&D.has(W.object));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
211
211
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
212
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${T[1].trim()}.`,replace:!0,miss:!0}}let F=c.match(ML);if(F&&F[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,F[1]),B=ku(D,await et(e,r));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
212
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${T[1].trim()}.`,replace:!0,miss:!0}}let F=c.match(sN);if(F&&F[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,F[1]),B=Cu(D,await et(e,r));if(B.length){let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
213
213
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
214
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let U=c.match(TL);if(U&&!YL.has(U[1].trim().split(/\s+/)[0]?.toLowerCase())){let D=X(a,U[1]),B=(await et(e,r)).filter(M=>M.predicate==="mgx:hasA"&&D.has(M.object));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
214
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let U=c.match(YL);if(U&&!mN.has(U[1].trim().split(/\s+/)[0]?.toLowerCase())){let D=X(a,U[1]),B=(await et(e,r)).filter(M=>M.predicate==="mgx:hasA"&&D.has(M.object));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
215
215
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
216
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let K=c.match(Cv),ce=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:K?.[1];if(ce){let D=X(a,ce),B=(await et(e,r)).filter(M=>qn.has(M.predicate)&&D.has(M.object));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
216
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let K=c.match(Dv),ce=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:K?.[1];if(ce){let D=X(a,ce),B=(await et(e,r)).filter(M=>qn.has(M.predicate)&&D.has(M.object));if(!B.length)return null;let A=Ye(an(B),o).map(re),L=A.slice(0,ve),C=A.slice(ve),N=C.length?`
217
217
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
218
- `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let ie=c.match(SL);if(ie){let D=X(a,ie[1]),B=await et(e,r),W=H=>!String(H.provenance||"").includes("corpus:")&&!String(H.provenance||"").includes("web:"),A=B.filter(H=>qn.has(H.predicate)&&W(H)),L=new Set,C=D;for(let H=0;H<8&&C.size;H+=1){let se=new Set;for(let De of A)C.has(De.object)&&!L.has(De.subject)&&se.add(De.subject);if(!se.size)break;for(let De of se)L.add(De);let He=new Set;for(let De of se)for(let tt of X(a,De))He.add(tt);C=He}let N=B.filter(H=>D.has(H.subject)||D.has(H.object)||L.has(H.subject));if(!N.length){let H=a(ie[1]).split(/\s+/).filter(se=>se.length>=4&&!Xv.has(se));if(H.length){let se=De=>new Set(String(De||"").split(/\s+/)),He=De=>{let tt=se(De);return H.some(cn=>tt.has(cn))};N=B.filter(De=>He(De.subject)||He(De.object))}}N=N.filter(H=>!Ev.has(H.predicate));let M=N.length>0&&!N.some(Mp);if(!N.length)return null;let{findConsistencyViolations:z,TYPE_PREDICATE:q,SUBCLASS_PREDICATE:Q,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(Xt(),fn)),te=H=>!H.provenance?.includes("corpus:")&&!H.provenance?.includes("web:"),ee=B.filter(H=>H.predicate===q&&te(H)).map(H=>[H.subject,H.object]),Y=B.filter(H=>H.predicate===Q&&te(H)).map(H=>[H.subject,H.object]),J=B.filter(H=>H.predicate===ae&&te(H)).map(H=>[H.subject,H.object]);if(J.length){let se=z(ee,Y,J,{focus:D,budget:5}).find(He=>D.has(He.subject));if(se)return{text:`I can't answer that \u2014 what I've been told about ${se.subject} is inconsistent: it's taught to be both ${se.classA} and ${se.classB}, but ${se.viaA} and ${se.viaB} are disjoint (${se.viaA} owl:disjointWith ${se.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let ne=N.find(H=>D.has(H.subject)||D.has(H.object)),xe=ne?D.has(ne.subject)?ne.subject:ne.object:ie[1].trim(),Te=N.some(H=>L.has(H.subject)&&!D.has(H.subject)&&!D.has(H.object));N=Ye(N,o);let ue=`${N.length} remembered fact${N.length===1?"":"s"} about ${xe}${Te?" (including its known subtypes)":""}:`,{lines:Ie,grouped:Ce}=kv(N,B,D,{indent:" "});if(Ce)return{...Ce,text:`${ue}
218
+ `)+N,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let ie=c.match(GL);if(ie){let D=X(a,ie[1]),B=await et(e,r),W=H=>!String(H.provenance||"").includes("corpus:")&&!String(H.provenance||"").includes("web:"),A=B.filter(H=>qn.has(H.predicate)&&W(H)),L=new Set,C=D;for(let H=0;H<8&&C.size;H+=1){let se=new Set;for(let De of A)C.has(De.object)&&!L.has(De.subject)&&se.add(De.subject);if(!se.size)break;for(let De of se)L.add(De);let He=new Set;for(let De of se)for(let tt of X(a,De))He.add(tt);C=He}let N=B.filter(H=>D.has(H.subject)||D.has(H.object)||L.has(H.subject));if(!N.length){let H=a(ie[1]).split(/\s+/).filter(se=>se.length>=4&&!sx.has(se));if(H.length){let se=De=>new Set(String(De||"").split(/\s+/)),He=De=>{let tt=se(De);return H.some(cn=>tt.has(cn))};N=B.filter(De=>He(De.subject)||He(De.object))}}N=N.filter(H=>!Av.has(H.predicate));let M=N.length>0&&!N.some(qp);if(!N.length)return null;let{findConsistencyViolations:z,TYPE_PREDICATE:q,SUBCLASS_PREDICATE:Q,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(Xt(),fn)),te=H=>!H.provenance?.includes("corpus:")&&!H.provenance?.includes("web:"),ee=B.filter(H=>H.predicate===q&&te(H)).map(H=>[H.subject,H.object]),Y=B.filter(H=>H.predicate===Q&&te(H)).map(H=>[H.subject,H.object]),J=B.filter(H=>H.predicate===ae&&te(H)).map(H=>[H.subject,H.object]);if(J.length){let se=z(ee,Y,J,{focus:D,budget:5}).find(He=>D.has(He.subject));if(se)return{text:`I can't answer that \u2014 what I've been told about ${se.subject} is inconsistent: it's taught to be both ${se.classA} and ${se.classB}, but ${se.viaA} and ${se.viaB} are disjoint (${se.viaA} owl:disjointWith ${se.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let ne=N.find(H=>D.has(H.subject)||D.has(H.object)),xe=ne?D.has(ne.subject)?ne.subject:ne.object:ie[1].trim(),Te=N.some(H=>L.has(H.subject)&&!D.has(H.subject)&&!D.has(H.object));N=Ye(N,o);let ue=`${N.length} remembered fact${N.length===1?"":"s"} about ${xe}${Te?" (including its known subtypes)":""}:`,{lines:Ie,grouped:Ce}=Cv(N,B,D,{indent:" "});if(Ce)return{...Ce,text:`${ue}
219
219
  ${Ce.text}`,...M?{weakOnly:!0}:{}};let oe=Ie.slice(0,ve),ke=Ie.slice(ve),le=ke.length?`
220
220
  \u2026and ${ke.length} more \u2014 say 'more' to see them.`:"";return{text:`${ue}
221
221
  ${oe.join(`
222
- `)}${le}`,replace:!0,...ke.length?{pending:{items:ke.map(H=>H.trim()),noun:"facts"}}:{},...M?{weakOnly:!0}:{}}}return null}async function cN(e,t){let n=await _i(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(()=>(jp(),pv)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Dc(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<uN;r+=1){let i=null;for(let a of e.relations||[])if(lN.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(l=>l?.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 nx(e,t,n,s,o=null,r=null,i={},a=null){return tx(await dN(e,t,n,s,o,r,i,a),n,t)}async function dN(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let l;try{({normFactTerm:l}=await Promise.resolve().then(()=>(Be(),Ds)))}catch{return null}let c=String(t).trim();if(o){let A=c.match(Vs);if(A){let L=await _i(o,A[1]);if(L){let C=X(l,nn(A[2])),N=Dc(o,L.id).find(z=>[...X(l,z.label)].some(q=>C.has(q)));if(N)return{text:`yes \u2014 the code graph says ${L.label} inherits ${N.label}.`,replace:!0};let M=await _i(o,nn(A[2]));if(M&&Dc(o,M.id).some(z=>z.id===L.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${M.label} inherits ${L.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=c.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await et(e,a);if(!d.length){if(!Vs.test(u)&&!zp.test(u)){let L=u.match(Lv);if(L){let C=L[1].trim(),N=ys.test(C)?r||null:C;if(N&&!/^there\b/i.test(N)&&!n?.parsed&&!Pv.test(C)&&!Nv.test(C)&&!xv.test(L[2].trim()))return Mv(N,L[2].trim().toLowerCase())}}let A=u.match(Vs)||Up(c);if(!(A&&!/^there\b/i.test(A[1].trim())||_v.test(c)))return null}let f=d.filter(A=>qn.has(A.predicate)),p=(A,L)=>L.trust-A.trust,h=A=>{let L=A.map(re),C=L.slice(0,ve),N=L.slice(ve),M=N.length?`
222
+ `)}${le}`,replace:!0,...ke.length?{pending:{items:ke.map(H=>H.trim()),noun:"facts"}}:{},...M?{weakOnly:!0}:{}}}return null}async function RN(e,t){let n=await Ai(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(()=>(Pp(),yv)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Hc(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<AN;r+=1){let i=null;for(let a of e.relations||[])if(TN.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(l=>l?.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 lx(e,t,n,s,o=null,r=null,i={},a=null){return cx(await IN(e,t,n,s,o,r,i,a),n,t)}async function IN(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let l;try{({normFactTerm:l}=await Promise.resolve().then(()=>(Be(),Ds)))}catch{return null}let c=String(t).trim();if(o){let A=c.match(Vs);if(A){let L=await Ai(o,A[1]);if(L){let C=X(l,nn(A[2])),N=Hc(o,L.id).find(z=>[...X(l,z.label)].some(q=>C.has(q)));if(N)return{text:`yes \u2014 the code graph says ${L.label} inherits ${N.label}.`,replace:!0};let M=await Ai(o,nn(A[2]));if(M&&Hc(o,M.id).some(z=>z.id===L.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${M.label} inherits ${L.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=c.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await et(e,a);if(!d.length){if(!Vs.test(u)&&!Xp.test(u)){let L=u.match(Uv);if(L){let C=L[1].trim(),N=ys.test(C)?r||null:C;if(N&&!/^there\b/i.test(N)&&!n?.parsed&&!Wv.test(C)&&!Bv.test(C)&&!Tv.test(L[2].trim()))return Gv(N,L[2].trim().toLowerCase())}}let A=u.match(Vs)||Jp(c);if(!(A&&!/^there\b/i.test(A[1].trim())||Lv.test(c)))return null}let f=d.filter(A=>qn.has(A.predicate)),p=(A,L)=>L.trust-A.trust,h=A=>{let L=A.map(re),C=L.slice(0,ve),N=L.slice(ve),M=N.length?`
223
223
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:C.join(`
224
- `)+M,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}};if(aN.test(c)){let A=Ye(f.length?f:d,i);return A.length?h(A):null}let m=u.match(zp);if(m){let A=m[1].trim(),L=ys.test(A)?r||null:A,C=m[2].trim().toLowerCase(),N=m[3].trim();if(L&&!Bp.has(C)){let M=Tp(d),{findIsaChain:z}=await Promise.resolve().then(()=>(Xt(),fn)),q=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ie=[];for(let Ce of d){let oe=Np(Ce.predicate);if(!oe)continue;if(oe===ue){Ie.push({fact:Ce,aliasFacts:[]});continue}let ke=Ap(z,oe,new Set([ue]),M,{maxHops:2});if(!ke)continue;let le=ke.map(H=>d.find(se=>se.predicate===Ri&&se.subject===H.subject&&se.object===H.object));le.every(Boolean)&&Ie.push({fact:Ce,aliasFacts:le})}return Ie},{loadMemory:Q,findRuleByName:ae,resolveRelationChase:te}=await Promise.resolve().then(()=>(Be(),Ds)),{findActionPath:ee}=await Promise.resolve().then(()=>(so(),Ui)),Y=await Q(e),ne=await te(Y,C,L,N,{relationFactsFor:q,renderFactLine:re,factPhrase:Ut,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Rp,findActionPath:ee});return ne?{text:`yes \u2014 ${ne.citation.join("; ")}`,replace:!0}:q(C).length>0||!!ae(Y,C)?{text:`I know the '${C}' relation, but I can't confirm ${L} is the ${C} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${C}' yet.`,replace:!0}}}let b=Uc(u).match(Jv)||Qv(u,A=>{let L=X(l,A);return d.some(C=>L.has(C.subject)||L.has(C.object))});if(b){let A=b[1].trim().toLowerCase(),L=b[2].trim(),C=ys.test(L)?r||null:L;if(C&&!Bp.has(A)){let N=Tp(d),{findIsaChain:M}=await Promise.resolve().then(()=>(Xt(),fn)),z=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ie=[];for(let Ce of d){let oe=Np(Ce.predicate);if(!oe)continue;if(oe===ue){Ie.push({fact:Ce,aliasFacts:[]});continue}let ke=Ap(M,oe,new Set([ue]),N,{maxHops:2});if(!ke)continue;let le=ke.map(H=>d.find(se=>se.predicate===Ri&&se.subject===H.subject&&se.object===H.object));le.every(Boolean)&&Ie.push({fact:Ce,aliasFacts:le})}return Ie},{loadMemory:q,findRuleByName:Q,resolveRelationChaseReverse:ae}=await Promise.resolve().then(()=>(Be(),Ds)),te=await q(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(so(),Ui)),J=await ae(te,A,C,{relationFactsFor:z,renderFactLine:re,factPhrase:Ut,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Rp,findReachableSet:ee});return J.length?{text:J.map(ue=>`${ue.subject} \u2014 ${ue.citation.join("; ")}`).join(`
225
- `),replace:!0}:z(A).length>0||!!Q(te,A)?{text:/^what\b/i.test(Uc(u))?`I don't know what the ${A} of ${C} is from what you've told me.`:`I don't know anyone who is the ${A} of ${C} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${A}' yet.`,replace:!0}}}{let A=u.match(pN);if(A){let L=X(l,A[1]),C=Ye(d.filter(N=>L.has(N.subject)||L.has(N.object)),i);if(C.length){let N=C.map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
224
+ `)+M,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}};if(_N.test(c)){let A=Ye(f.length?f:d,i);return A.length?h(A):null}let m=u.match(Xp);if(m){let A=m[1].trim(),L=ys.test(A)?r||null:A,C=m[2].trim().toLowerCase(),N=m[3].trim();if(L&&!Qp.has(C)){let M=Dp(d),{findIsaChain:z}=await Promise.resolve().then(()=>(Xt(),fn)),q=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ie=[];for(let Ce of d){let oe=Vp(Ce.predicate);if(!oe)continue;if(oe===ue){Ie.push({fact:Ce,aliasFacts:[]});continue}let ke=zp(z,oe,new Set([ue]),M,{maxHops:2});if(!ke)continue;let le=ke.map(H=>d.find(se=>se.predicate===Ii&&se.subject===H.subject&&se.object===H.object));le.every(Boolean)&&Ie.push({fact:Ce,aliasFacts:le})}return Ie},{loadMemory:Q,findRuleByName:ae,resolveRelationChase:te}=await Promise.resolve().then(()=>(Be(),Ds)),{findActionPath:ee}=await Promise.resolve().then(()=>(so(),Gi)),Y=await Q(e),ne=await te(Y,C,L,N,{relationFactsFor:q,renderFactLine:re,factPhrase:Bt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Fp,findActionPath:ee});return ne?{text:`yes \u2014 ${ne.citation.join("; ")}`,replace:!0}:q(C).length>0||!!ae(Y,C)?{text:`I know the '${C}' relation, but I can't confirm ${L} is the ${C} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${C}' yet.`,replace:!0}}}let b=Kc(u).match(ox)||rx(u,A=>{let L=X(l,A);return d.some(C=>L.has(C.subject)||L.has(C.object))});if(b){let A=b[1].trim().toLowerCase(),L=b[2].trim(),C=ys.test(L)?r||null:L;if(C&&!Qp.has(A)){let N=Dp(d),{findIsaChain:M}=await Promise.resolve().then(()=>(Xt(),fn)),z=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ie=[];for(let Ce of d){let oe=Vp(Ce.predicate);if(!oe)continue;if(oe===ue){Ie.push({fact:Ce,aliasFacts:[]});continue}let ke=zp(M,oe,new Set([ue]),N,{maxHops:2});if(!ke)continue;let le=ke.map(H=>d.find(se=>se.predicate===Ii&&se.subject===H.subject&&se.object===H.object));le.every(Boolean)&&Ie.push({fact:Ce,aliasFacts:le})}return Ie},{loadMemory:q,findRuleByName:Q,resolveRelationChaseReverse:ae}=await Promise.resolve().then(()=>(Be(),Ds)),te=await q(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(so(),Gi)),J=await ae(te,A,C,{relationFactsFor:z,renderFactLine:re,factPhrase:Bt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Fp,findReachableSet:ee});return J.length?{text:J.map(ue=>`${ue.subject} \u2014 ${ue.citation.join("; ")}`).join(`
225
+ `),replace:!0}:z(A).length>0||!!Q(te,A)?{text:/^what\b/i.test(Kc(u))?`I don't know what the ${A} of ${C} is from what you've told me.`:`I don't know anyone who is the ${A} of ${C} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${A}' yet.`,replace:!0}}}{let A=u.match(CN);if(A){let L=X(l,A[1]),C=Ye(d.filter(N=>L.has(N.subject)||L.has(N.object)),i);if(C.length){let N=C.map(re),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
226
226
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:M.join(`
227
- `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}}let g=u.match($L);if(g){let A=Kp(g[1].trim().toLowerCase()),L=g[2].trim(),C=ys.test(L)?r||null:L;if(C){let{loadMemory:N,findRuleByName:M,RULE_KIND_PROP:z,RULE_KIND_RECURSIVE:q}=await Promise.resolve().then(()=>(Be(),Ds)),Q=await N(e),ae=M(Q,A),te=ae?.attributes?.find(ee=>ee.prop===z)?.value;if(ae&&te===q){let ee=ae.attributes.find(ne=>ne.prop==="mgx:ruleBaseCase")?.value,Y=ae.attributes.find(ne=>ne.prop==="mgx:ruleRecStep")?.value,J=l(C);if(ee&&Y&&J){let ne=Tp(d),{findIsaChain:xe}=await Promise.resolve().then(()=>(Xt(),fn)),Te=ke=>{let le=String(ke||"").trim().toLowerCase(),H=[];for(let se of d){let He=Np(se.predicate);if(!He)continue;if(He===le){H.push({fact:se,aliasFacts:[]});continue}let De=Ap(xe,He,new Set([le]),ne,{maxHops:2});if(!De)continue;let tt=De.map(cn=>d.find(Qt=>Qt.predicate===Ri&&Qt.subject===cn.subject&&Qt.object===cn.object));tt.every(Boolean)&&H.push({fact:se,aliasFacts:tt})}return H},{findReachableSet:ue}=await Promise.resolve().then(()=>(so(),Ui)),oe=ue({entity:J,hop:0},ke=>{let le=ke.hop===0?ee:Y;return Te(le).filter(H=>H.fact.subject===ke.entity).map(H=>({action:H,nextState:{entity:H.fact.object,hop:ke.hop+1}}))},{maxDepth:20,stateKey:ke=>ke.entity});if(oe.length)return{text:oe.map(({node:le,path:H})=>{let se=new Set,He=[];for(let De of H.actions){He.push(re(De.fact));for(let tt of De.aliasFacts){let cn=tt.id||`${tt.subject}|${tt.predicate}|${tt.object}`;se.has(cn)||(se.add(cn),He.push(`${Ut(tt)}${tt.provenance?` (source: ${Kn(tt.provenance)})`:""}`))}}return`${le.entity} \u2014 ${He.join("; ")}`}).join(`
228
- `),replace:!0}}}return null}}let y=c.match(_v),w=c.match(Vs)||Up(c)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(Vs);if(w){let A=X(l,nn(w[2])),L=r&&ys.test(w[1].trim())?r:w[1],C=new Set(X(l,L));if([...C].some(G=>A.has(G))){let G=nn(w[2]).trim();return{text:`yes \u2014 ${$r(G)} ${G} is ${$r(G)} ${G}, trivially: every kind is a kind of itself.`,replace:!0}}let N=await cN(o,L);if(N)for(let G of X(l,N))C.add(G);let{findIsaChain:M,buildSubClassSuccessors:z,deriveDisjointViolations:q,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ae,DISJOINT_PREDICATE:te}=await Promise.resolve().then(()=>(Xt(),fn)),ee=ko,Y=f.filter(G=>G.predicate===Q&&ee(G)),J=f.filter(G=>G.predicate===ae&&ee(G)),ne=Y.map(G=>[G.subject,G.object]),xe=J.map(G=>[G.subject,G.object]),Te=f.filter(G=>G.predicate===Q),ue=f.filter(G=>G.predicate===ae),Ie=ue.map(G=>[G.subject,G.object]),Ce=Te.map(G=>[G.subject,G.object]),oe=z(ne),ke=z(Ce),le=d.filter(G=>G.predicate===te&&ee(G)),H=le.map(G=>[G.subject,G.object]),se=le.length?q(Ie.concat(Ce),Ce,H,{budget:20,focus:new Set([...C,...A])}):[],He=G=>{let be=se.find(Pe=>Pe.subject===G&&A.has(Pe.object));if(!be)return null;let we=f.filter(Pe=>A.has(Pe.object)&&(Pe.subject===be.viaClass||Pe.subject===be.subject)).sort(p)[0],je=le.find(Pe=>Pe.subject===be.viaClass&&Pe.object===be.object||Pe.subject===be.object&&Pe.object===be.viaClass);return!we||!je?null:fL(we,je)},De=f.filter(G=>C.has(G.subject)&&A.has(G.object)).sort(p)[0],tt=d.filter(G=>G.predicate===ya&&C.has(G.subject)&&A.has(G.object)).sort(p)[0],cn=le.find(G=>C.has(G.subject)&&A.has(G.object)||C.has(G.object)&&A.has(G.subject));if(De&&!tt){let G=He(De.subject);if(G)return G}let Qt=Yv(De,tt||cn);if(Qt)return Qt;if(le.length){let G=je=>{let Pe=new Set(je),Lt=new Set(je);for(let Oe=0;Oe<8&&Lt.size;Oe+=1){let ye=new Set;for(let[at,qs]of Ce)Lt.has(at)&&!Pe.has(qs)&&ye.add(qs);if(!ye.size)break;for(let at of ye)Pe.add(at);Lt=ye}return Pe},be=G(A),we=se.find(je=>C.has(je.subject)&&be.has(je.object)&&!G([je.viaClass]).has(je.object)&&!G([je.object]).has(je.viaClass));if(we){let je=f.filter(ye=>C.has(ye.subject)&&ye.object===we.viaClass).sort(p)[0],Pe=le.find(ye=>ye.subject===we.viaClass&&ye.object===we.object||ye.subject===we.object&&ye.object===we.viaClass),Lt=!A.has(we.object),Oe=Lt?f.filter(ye=>A.has(ye.subject)&&ye.object===we.object).sort(p)[0]:null;if(je&&Pe&&(!Lt||Oe)){let ye=nn(w[2]).trim();return{text:`no \u2014 ${[je,...Oe?[Oe]:[]].map(re).join("; ")}; and ${Ut(Pe)}${Pe.provenance?` (source: ${Kn(Pe.provenance)})`:""} \u2014 so ${L} can never be ${$r(ye)} ${ye}.`,replace:!0}}}}let Zt=await _i(o,L);if(Zt){let G=new Map;for(let we of Dc(o,Zt.id))for(let je of X(l,we.label))!C.has(je)&&!G.has(je)&&G.set(je,we.label);let be=f.filter(we=>G.has(we.subject)&&A.has(we.object)).sort(p)[0];if(be)return{text:`yes \u2014 the code graph says ${Zt.label} inherits ${G.get(be.subject)}, and ${re(be)}`,replace:!0}}let ln=G=>(G.predicate===Q?Y:J).find(be=>be.subject===G.subject&&be.object===G.object);for(let G of C){let be=M(G,A,xe,oe,{maxHops:2});if(!be)continue;let we=He(G);if(we)return we;let je=be.map(ln);if(je.every(Boolean))return{text:`yes \u2014 ${Mc(je)}`,replace:!0}}let Ti=G=>(G.predicate===Q?Te:ue).find(be=>be.subject===G.subject&&be.object===G.object);for(let G of C){let be=M(G,A,Ie,ke,{maxHops:2});if(!be)continue;let we=He(G);if(we)return we;let je=be.map(Ti);if(je.every(Boolean)&&je.some(ee))return{text:`yes \u2014 ${Mc(je)}`,replace:!0}}let j=L.match(/^(.*\S)\s+not$/i),pe=j&&[j[0],r&&ys.test(j[1].trim())?r:j[1]];if(pe){let G=X(l,pe[1]),be=A,we=f.filter(Oe=>G.has(Oe.subject)&&be.has(Oe.object)).sort(p)[0];if(we)return{text:`no \u2014 ${re(we)}`,replace:!0};let je=le.find(Oe=>G.has(Oe.subject)&&be.has(Oe.object)||G.has(Oe.object)&&be.has(Oe.subject));if(je)return{text:`yes \u2014 ${re(je)}`,replace:!0};let Pe=pe[1].trim(),Lt=nn(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Pe} and ${Lt}. If no ${Pe} is a ${Lt}, teach me: "no ${Pe} is a ${Lt}".`,replace:!0,miss:!0}}if(le.length){let G=q(xe.concat(ne),ne,H,{budget:10});for(let be of C){let we=G.find(Oe=>Oe.subject===be&&A.has(Oe.object));if(!we)continue;let je=J.concat(Y).find(Oe=>Oe.subject===we.subject&&Oe.object===we.viaType),Pe=le.find(Oe=>Oe.subject===we.viaClass&&Oe.object===we.object||Oe.subject===we.object&&Oe.object===we.viaClass),Lt=[je,Pe].filter(Boolean).map(re);return{text:`no \u2014 ${Lt.length?Lt.join("; "):`${we.viaClass} and ${we.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Ae,ON_PROPERTY_PREDICATE:un,SOME_VALUES_FROM_PREDICATE:Yn,deriveSomeValuesFromSubsumption:vx,ENTAILED_SCM_SVF_PROVENANCE:xx,SCM_SVF_RULE_CONFIDENCE:Ex,entailedTrustFrom:Qp}=await Promise.resolve().then(()=>(Xt(),fn)),Zp=d.filter(G=>G.predicate===un&&ee(G)),ef=d.filter(G=>G.predicate===Yn&&ee(G));if(Zp.length&&ef.length){let G=new Map(ef.map(ye=>[ye.subject,ye.object])),be=Zp.map(ye=>({restriction:ye.subject,property:ye.object,target:G.get(ye.subject)})).filter(ye=>ye.target),we=new Set([Q,ae,te,un,Yn,"owl:intersectionOf"]),je=d.filter(ye=>ee(ye)&&!we.has(ye.predicate)),Pe=je.map(ye=>[ye.subject,ye.predicate,ye.object]),Lt=Ae(Pe,xe,ne,be,{budget:10});for(let ye of C){let at=Lt.find(yn=>yn.subject===ye&&A.has(yn.object));if(!at)continue;let qs=je.find(yn=>yn.subject===at.subject&&yn.predicate===at.viaProperty&&yn.object===at.viaValue),Ks=J.find(yn=>yn.subject===at.viaValue&&yn.object===at.viaType),xr=[qs,Ks].filter(Boolean).map(re);return{text:`yes \u2014 ${xr.length?xr.join("; "):`${at.subject} ${at.viaProperty} ${at.viaValue}, and ${at.viaValue} is a ${at.viaType}.`}`,replace:!0}}let Oe=be.length>1?vx(be,ne,{budget:10}):[];if(Oe.length){let ye=z(ne.concat(Oe.map(Ee=>[Ee.subject,Ee.object]))),at=new Map(be.map(Ee=>[Ee.restriction,Ee])),qs=new Map;for(let Ee of d)qs.set(`${Ee.subject}\0${Ee.predicate}\0${Ee.object}`,Ee.trust);let Ks=(Ee,Tn,Bt)=>qs.get(`${Ee}\0${Tn}\0${Bt}`),xr=new Map;for(let Ee of Oe){let Tn=at.get(Ee.subject),Bt=at.get(Ee.object),en=[Tn&&Ks(Ee.subject,un,Tn.property),Ks(Ee.subject,Yn,Ee.viaY1),Bt&&Ks(Ee.object,un,Bt.property),Ks(Ee.object,Yn,Ee.viaY2),Ks(Ee.viaY1,Q,Ee.viaY2)].filter(jx=>typeof jx=="number"),Ai=Qp(en,Ex);Ai!==null&&xr.set(`${Ee.subject}\0${Ee.object}`,Ai)}let yn=Ee=>{if(Ee.predicate!==Q)return J.find(en=>en.subject===Ee.subject&&en.object===Ee.object);let Tn=Y.find(en=>en.subject===Ee.subject&&en.object===Ee.object);if(Tn)return Tn;let Bt=Oe.find(en=>en.subject===Ee.subject&&en.object===Ee.object);return Bt?{subject:Bt.subject,predicate:Q,object:Bt.object,provenance:xx,trust:xr.get(`${Bt.subject}\0${Bt.object}`)}:void 0};for(let Ee of C){let Tn=M(Ee,A,xe,ye,{maxHops:3});if(!Tn)continue;let Bt=Tn.map(yn);if(Bt.every(Boolean)){let en=Qp(Bt.map(Ai=>Ai.trust),1);return{text:`yes \u2014 ${Mc(Bt)}`,replace:!0,...en!==null?{trust:en}:{}}}}}}let Sx=X(l,L),tf=f.filter(G=>Sx.has(G.subject)).sort(p),Rn=L.trim(),Hs=nn(w[2]).trim(),kx=[...C].some(G=>M(G,A,xe,oe,{maxHops:vL}));if(tf.length){let G=tf.slice(0,3).map(re).join("; "),be=kx?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Rn}", then ask me again.`:`If it's true, teach me: "${Rn} is a kind of ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Rn} is a ${Hs}. I do know: ${G}. ${be}`,replace:!0,miss:!0}}let nf=f.filter(G=>C.has(G.object)&&A.has(G.subject)).sort(p)[0];return nf?{text:`I can't confirm that \u2014 what I know runs the other way: ${re(nf)}. A kind doesn't reverse. If it's true, teach me: "every ${Rn} is a ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`,replace:!0,miss:!0}:!Zt&&!N&&!UO(Rn)&&!d.some(G=>C.has(G.subject)||C.has(G.object))?{text:`I can't confirm that \u2014 I don't know "${Rn}" at all yet. If it's true, teach me: "${Rn} is a kind of ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`,replace:!0,miss:!0}:null}let v=c.match(ZL);if(v){let[,A,L,C]=v,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:M,buildCardinalityRestrictions:z,proveCardinalityAtLeast:q,CARDINALITY_RULE_CONFIDENCE:Q,entailedTrustFrom:ae}=await Promise.resolve().then(()=>(Xt(),fn)),te=ko,ee=f.filter(ne=>ne.predicate===N&&te(ne)).map(ne=>[ne.subject,ne.object]),Y=d.filter(ne=>(ne.predicate===M||Ov.has(ne.predicate))&&te(ne)),J=z(Y);if(J.length){let ne=X(l,A.trim()),xe=X(l,C.trim()),Te=Number(L),ue=jv(ne,xe,(Ie,Ce)=>q(ee,J,Ie,Ce,Te,{}));if(ue){let Ie=d.find(se=>se.predicate===N&&se.subject===ue.viaClass&&se.object===ue.viaRestriction),Ce=Ie?.provenance?` (source: ${Kn(Ie.provenance)})`:"",oe=ue.kind==="exactly"?"exactly":"at least",ke=(se,He)=>`${se}${He===1?"":"s"}`,le=[Ie?.trust,...Y.filter(se=>se.subject===ue.viaRestriction).map(se=>se.trust),...ue.viaClass!==ue.subject?[f.find(se=>se.predicate===N&&se.subject===ue.subject&&se.object===ue.viaClass)?.trust]:[]].filter(se=>typeof se=="number"),H=ae(le,Q);return{text:`yes \u2014 every ${ue.viaClass} has ${oe} ${ue.n} ${ke(ue.object,ue.n)}${Ce}, so at least ${Te} follows.`,replace:!0,...H!==null?{trust:H}:{}}}}}let k=c.match(eN);if(k){let[,A,L]=k,{SUBCLASS_PREDICATE:C,ON_PROPERTY_PREDICATE:N,buildCardinalityRestrictions:M,proveMaxCardinalityZeroDenial:z,CAX_MAXC0_RULE_CONFIDENCE:q,entailedTrustFrom:Q}=await Promise.resolve().then(()=>(Xt(),fn)),ae=ko,te=f.filter(J=>J.predicate===C&&ae(J)).map(J=>[J.subject,J.object]),ee=d.filter(J=>(J.predicate===N||Ov.has(J.predicate))&&ae(J)),Y=M(ee);if(Y.length){let J=X(l,A.trim()),ne=X(l,L.trim()),xe=jv(J,ne,(Te,ue)=>z(te,Y,Te,ue,{}));if(xe){let Te=d.find(oe=>oe.predicate===C&&oe.subject===xe.viaClass&&oe.object===xe.viaRestriction),ue=Te?.provenance?` (source: ${Kn(Te.provenance)})`:"",Ie=[Te?.trust,...ee.filter(oe=>oe.subject===xe.viaRestriction).map(oe=>oe.trust),...xe.viaClass!==xe.subject?[f.find(oe=>oe.predicate===C&&oe.subject===xe.subject&&oe.object===xe.viaClass)?.trust]:[]].filter(oe=>typeof oe=="number"),Ce=Q(Ie,q);return{text:`no \u2014 every ${xe.viaClass} has at most 0 ${xe.object}${ue}.`,replace:!0,...Ce!==null?{trust:Ce}:{}}}}}let $=c.match(tN);if($){let A=X(l,$[1]),L=d.filter(C=>C.predicate===_p&&A.has(C.subject)).sort(p);return L.length?h(L):null}let x=u.match(nN);if(x){let[,A,L]=x,C=X(l,A.trim()),N=X(l,L.replace(/^an?\s+/i,"").trim()),M=d.filter(z=>z.predicate===_p&&N.has(z.subject)&&C.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} owns/maintains ${L.trim()}.`,replace:!0}}let E=u.match(sN);if(E){let[,A,L]=E,C=X(l,A.replace(/^an?\s+/i,"").trim()),N=X(l,L.trim()),M=d.filter(z=>z.predicate===_p&&C.has(z.subject)&&N.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} is owned by ${L.trim()}.`,replace:!0}}let S=u.match(oN);if(S){let[,A,L]=S,C=X(l,A.trim()),N=X(l,`${L.trim()} method`),M=d.filter(z=>z.predicate===hr&&C.has(z.subject)&&N.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:null}let R=u.match(rN);if(R){let A=X(l,R[1].trim()),L=d.filter(C=>C.predicate===hr&&A.has(C.subject)&&/ method$/.test(C.object)).sort(p);return L.length?h(L):null}let _=u.match(Lv);if(_){let A=_[1].trim(),L=Pv.test(A)||Nv.test(A)?null:ys.test(A)?r||null:A,C=_[2].trim().toLowerCase();if(L){let N=X(l,L),M=new Map,z=null;if(o){let Y=await _i(o,L);if(z=Y,Y)for(let J of Dc(o,Y.id))for(let ne of X(l,J.label))!N.has(ne)&&!M.has(ne)&&M.set(ne,J.label),N.add(ne)}let q=Y=>Y.predicate===Rp&&l(Y.object)===C||Y.predicate===`tmct:${C}`&&Y.object==="true",Q=l(L).split(/\s+/).filter(Y=>Y.length>=4&&!Xv.has(Y)),ae=Y=>Q.some(J=>new Set(String(Y.subject||"").split(/\s+/)).has(J)),te=Y=>N.has(Y.subject)||Q.length&&ae(Y),ee=d.filter(Y=>te(Y)&&q(Y)).sort(p)[0];if(ee){let Y=M.get(ee.subject);return{text:Y?`yes \u2014 the code graph says ${z.label} inherits ${Y}, and ${re(ee)}`:`yes \u2014 ${re(ee)}`,replace:!0}}{let{findIsaChain:Y,SUBCLASS_PREDICATE:J,TYPE_PREDICATE:ne}=await Promise.resolve().then(()=>(Xt(),fn)),xe=ko,Te=d.filter(le=>le.predicate===J&&xe(le)),ue=d.filter(le=>le.predicate===ne&&xe(le)),Ie=Te.map(le=>[le.subject,le.object]),Ce=ue.map(le=>[le.subject,le.object]),oe=le=>(le.predicate===J?Te:ue).find(H=>H.subject===le.subject&&H.object===le.object),ke=X(l,C);for(let le of N){let H=Y(le,ke,Ce,Ie,{maxHops:2});if(!H)continue;let se=H.map(oe);if(se.every(Boolean))return{text:`yes \u2014 ${Mc(se)}`,replace:!0}}}if(d.some(te)&&!n?.parsed)return/^there\b/i.test(L)||iN.test(C)?null:{text:`I don't have a fact saying ${mL(L)} is ${C}.`,replace:!0};if(!n?.parsed&&!xv.test(C))return Mv(L,C)}}let I=Wp(c).match(QO);if(I&&!Cp.test(c)){let[,A,L,C]=I,N=L.toLowerCase();if(!Ip.test(N)&&!Lp.test(N)){let M=A.trim(),z=tL(await Op(N),C),q=z.object.replace(/^an?\s+/i,"").trim();if(M&&q){let Q=z.predicate,ae=X(l,M),te=X(l,q),ee=[Q,sr(Q)],Y=d.filter(ne=>ee.includes(ne.predicate)&&ae.has(ne.subject)&&te.has(ne.object)).sort(p)[0];if(Y)return{text:`${kg(Y.predicate)?"no":"yes"} \u2014 ${re(Y)}`,replace:!0,generalVerbQuery:!0};let J=d.filter(ne=>ee.includes(ne.predicate)&&ae.has(ne.subject));if(J.length){let ne=J.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Ut({subject:M,predicate:Q,object:q})}. I do know: ${ne}.`,replace:!0,miss:!0}}return null}}}let P=c.match(ZO);if(P&&!Cp.test(c)){let[,A,L]=P,[C,N]=L.toLowerCase().split(/\s+/);if(!Ip.test(C)&&!Lp.test(C)){let M=A.trim();if(M){let z=await Op(C);N&&/^mgx:[a-z]+$/.test(z)&&(z=`${z}-${N}`);let q=X(l,M),Q=[z,sr(z)],ae=Ye(d.filter(te=>Q.includes(te.predicate)&&q.has(te.subject)),i);if(ae.length)return{...h(ae),generalVerbQuery:!0}}}}let T=c.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(T&&!Cp.test(c)){let[,A,L,C]=T,N=A.toLowerCase();if(!Ip.test(N)&&!Lp.test(N)&&!JO.test(N)){let M=await Op(N);/^mgx:[a-z]+$/.test(M)&&(M=`${M}-${L.toLowerCase()}`);let z=X(l,C.replace(/^(?:an?|the)\s+/i,"").trim()),q=Ye(d.filter(Q=>Q.predicate===M&&z.has(Q.object)),i);if(q.length)return{...h(q),generalVerbQuery:!0}}}let F=c.match(JL);if(F){let A=X(l,F[1]),L=Ye(d.filter(Q=>A.has(Q.subject)||A.has(Q.object)),i);if(!L.length)return null;let C=A.has(L[0].subject)?L[0].subject:L[0].object,N=L.map(Q=>` ${re(Q)}`),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
227
+ `)+q,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}}}}let g=u.match(zL);if(g){let A=of(g[1].trim().toLowerCase()),L=g[2].trim(),C=ys.test(L)?r||null:L;if(C){let{loadMemory:N,findRuleByName:M,RULE_KIND_PROP:z,RULE_KIND_RECURSIVE:q}=await Promise.resolve().then(()=>(Be(),Ds)),Q=await N(e),ae=M(Q,A),te=ae?.attributes?.find(ee=>ee.prop===z)?.value;if(ae&&te===q){let ee=ae.attributes.find(ne=>ne.prop==="mgx:ruleBaseCase")?.value,Y=ae.attributes.find(ne=>ne.prop==="mgx:ruleRecStep")?.value,J=l(C);if(ee&&Y&&J){let ne=Dp(d),{findIsaChain:xe}=await Promise.resolve().then(()=>(Xt(),fn)),Te=ke=>{let le=String(ke||"").trim().toLowerCase(),H=[];for(let se of d){let He=Vp(se.predicate);if(!He)continue;if(He===le){H.push({fact:se,aliasFacts:[]});continue}let De=zp(xe,He,new Set([le]),ne,{maxHops:2});if(!De)continue;let tt=De.map(cn=>d.find(Qt=>Qt.predicate===Ii&&Qt.subject===cn.subject&&Qt.object===cn.object));tt.every(Boolean)&&H.push({fact:se,aliasFacts:tt})}return H},{findReachableSet:ue}=await Promise.resolve().then(()=>(so(),Gi)),oe=ue({entity:J,hop:0},ke=>{let le=ke.hop===0?ee:Y;return Te(le).filter(H=>H.fact.subject===ke.entity).map(H=>({action:H,nextState:{entity:H.fact.object,hop:ke.hop+1}}))},{maxDepth:20,stateKey:ke=>ke.entity});if(oe.length)return{text:oe.map(({node:le,path:H})=>{let se=new Set,He=[];for(let De of H.actions){He.push(re(De.fact));for(let tt of De.aliasFacts){let cn=tt.id||`${tt.subject}|${tt.predicate}|${tt.object}`;se.has(cn)||(se.add(cn),He.push(`${Bt(tt)}${tt.provenance?` (source: ${Kn(tt.provenance)})`:""}`))}}return`${le.entity} \u2014 ${He.join("; ")}`}).join(`
228
+ `),replace:!0}}}return null}}let y=c.match(Lv),w=c.match(Vs)||Jp(c)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(Vs);if(w){let A=X(l,nn(w[2])),L=r&&ys.test(w[1].trim())?r:w[1],C=new Set(X(l,L));if([...C].some(G=>A.has(G))){let G=nn(w[2]).trim();return{text:`yes \u2014 ${vr(G)} ${G} is ${vr(G)} ${G}, trivially: every kind is a kind of itself.`,replace:!0}}let N=await RN(o,L);if(N)for(let G of X(l,N))C.add(G);let{findIsaChain:M,buildSubClassSuccessors:z,deriveDisjointViolations:q,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ae,DISJOINT_PREDICATE:te}=await Promise.resolve().then(()=>(Xt(),fn)),ee=ko,Y=f.filter(G=>G.predicate===Q&&ee(G)),J=f.filter(G=>G.predicate===ae&&ee(G)),ne=Y.map(G=>[G.subject,G.object]),xe=J.map(G=>[G.subject,G.object]),Te=f.filter(G=>G.predicate===Q),ue=f.filter(G=>G.predicate===ae),Ie=ue.map(G=>[G.subject,G.object]),Ce=Te.map(G=>[G.subject,G.object]),oe=z(ne),ke=z(Ce),le=d.filter(G=>G.predicate===te&&ee(G)),H=le.map(G=>[G.subject,G.object]),se=le.length?q(Ie.concat(Ce),Ce,H,{budget:20,focus:new Set([...C,...A])}):[],He=G=>{let be=se.find(Pe=>Pe.subject===G&&A.has(Pe.object));if(!be)return null;let we=f.filter(Pe=>A.has(Pe.object)&&(Pe.subject===be.viaClass||Pe.subject===be.subject)).sort(p)[0],je=le.find(Pe=>Pe.subject===be.viaClass&&Pe.object===be.object||Pe.subject===be.object&&Pe.object===be.viaClass);return!we||!je?null:OL(we,je)},De=f.filter(G=>C.has(G.subject)&&A.has(G.object)).sort(p)[0],tt=d.filter(G=>G.predicate===xa&&C.has(G.subject)&&A.has(G.object)).sort(p)[0],cn=le.find(G=>C.has(G.subject)&&A.has(G.object)||C.has(G.object)&&A.has(G.subject));if(De&&!tt){let G=He(De.subject);if(G)return G}let Qt=nx(De,tt||cn);if(Qt)return Qt;if(le.length){let G=je=>{let Pe=new Set(je),Lt=new Set(je);for(let Oe=0;Oe<8&&Lt.size;Oe+=1){let ye=new Set;for(let[at,qs]of Ce)Lt.has(at)&&!Pe.has(qs)&&ye.add(qs);if(!ye.size)break;for(let at of ye)Pe.add(at);Lt=ye}return Pe},be=G(A),we=se.find(je=>C.has(je.subject)&&be.has(je.object)&&!G([je.viaClass]).has(je.object)&&!G([je.object]).has(je.viaClass));if(we){let je=f.filter(ye=>C.has(ye.subject)&&ye.object===we.viaClass).sort(p)[0],Pe=le.find(ye=>ye.subject===we.viaClass&&ye.object===we.object||ye.subject===we.object&&ye.object===we.viaClass),Lt=!A.has(we.object),Oe=Lt?f.filter(ye=>A.has(ye.subject)&&ye.object===we.object).sort(p)[0]:null;if(je&&Pe&&(!Lt||Oe)){let ye=nn(w[2]).trim();return{text:`no \u2014 ${[je,...Oe?[Oe]:[]].map(re).join("; ")}; and ${Bt(Pe)}${Pe.provenance?` (source: ${Kn(Pe.provenance)})`:""} \u2014 so ${L} can never be ${vr(ye)} ${ye}.`,replace:!0}}}}let Zt=await Ai(o,L);if(Zt){let G=new Map;for(let we of Hc(o,Zt.id))for(let je of X(l,we.label))!C.has(je)&&!G.has(je)&&G.set(je,we.label);let be=f.filter(we=>G.has(we.subject)&&A.has(we.object)).sort(p)[0];if(be)return{text:`yes \u2014 the code graph says ${Zt.label} inherits ${G.get(be.subject)}, and ${re(be)}`,replace:!0}}let ln=G=>(G.predicate===Q?Y:J).find(be=>be.subject===G.subject&&be.object===G.object);for(let G of C){let be=M(G,A,xe,oe,{maxHops:2});if(!be)continue;let we=He(G);if(we)return we;let je=be.map(ln);if(je.every(Boolean))return{text:`yes \u2014 ${Gc(je)}`,replace:!0}}let Ci=G=>(G.predicate===Q?Te:ue).find(be=>be.subject===G.subject&&be.object===G.object);for(let G of C){let be=M(G,A,Ie,ke,{maxHops:2});if(!be)continue;let we=He(G);if(we)return we;let je=be.map(Ci);if(je.every(Boolean)&&je.some(ee))return{text:`yes \u2014 ${Gc(je)}`,replace:!0}}let j=L.match(/^(.*\S)\s+not$/i),pe=j&&[j[0],r&&ys.test(j[1].trim())?r:j[1]];if(pe){let G=X(l,pe[1]),be=A,we=f.filter(Oe=>G.has(Oe.subject)&&be.has(Oe.object)).sort(p)[0];if(we)return{text:`no \u2014 ${re(we)}`,replace:!0};let je=le.find(Oe=>G.has(Oe.subject)&&be.has(Oe.object)||G.has(Oe.object)&&be.has(Oe.subject));if(je)return{text:`yes \u2014 ${re(je)}`,replace:!0};let Pe=pe[1].trim(),Lt=nn(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Pe} and ${Lt}. If no ${Pe} is a ${Lt}, teach me: "no ${Pe} is a ${Lt}".`,replace:!0,miss:!0}}if(le.length){let G=q(xe.concat(ne),ne,H,{budget:10});for(let be of C){let we=G.find(Oe=>Oe.subject===be&&A.has(Oe.object));if(!we)continue;let je=J.concat(Y).find(Oe=>Oe.subject===we.subject&&Oe.object===we.viaType),Pe=le.find(Oe=>Oe.subject===we.viaClass&&Oe.object===we.object||Oe.subject===we.object&&Oe.object===we.viaClass),Lt=[je,Pe].filter(Boolean).map(re);return{text:`no \u2014 ${Lt.length?Lt.join("; "):`${we.viaClass} and ${we.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Ae,ON_PROPERTY_PREDICATE:un,SOME_VALUES_FROM_PREDICATE:Yn,deriveSomeValuesFromSubsumption:Rx,ENTAILED_SCM_SVF_PROVENANCE:Tx,SCM_SVF_RULE_CONFIDENCE:Ax,entailedTrustFrom:lf}=await Promise.resolve().then(()=>(Xt(),fn)),uf=d.filter(G=>G.predicate===un&&ee(G)),df=d.filter(G=>G.predicate===Yn&&ee(G));if(uf.length&&df.length){let G=new Map(df.map(ye=>[ye.subject,ye.object])),be=uf.map(ye=>({restriction:ye.subject,property:ye.object,target:G.get(ye.subject)})).filter(ye=>ye.target),we=new Set([Q,ae,te,un,Yn,"owl:intersectionOf"]),je=d.filter(ye=>ee(ye)&&!we.has(ye.predicate)),Pe=je.map(ye=>[ye.subject,ye.predicate,ye.object]),Lt=Ae(Pe,xe,ne,be,{budget:10});for(let ye of C){let at=Lt.find(yn=>yn.subject===ye&&A.has(yn.object));if(!at)continue;let qs=je.find(yn=>yn.subject===at.subject&&yn.predicate===at.viaProperty&&yn.object===at.viaValue),Ks=J.find(yn=>yn.subject===at.viaValue&&yn.object===at.viaType),Er=[qs,Ks].filter(Boolean).map(re);return{text:`yes \u2014 ${Er.length?Er.join("; "):`${at.subject} ${at.viaProperty} ${at.viaValue}, and ${at.viaValue} is a ${at.viaType}.`}`,replace:!0}}let Oe=be.length>1?Rx(be,ne,{budget:10}):[];if(Oe.length){let ye=z(ne.concat(Oe.map(Ee=>[Ee.subject,Ee.object]))),at=new Map(be.map(Ee=>[Ee.restriction,Ee])),qs=new Map;for(let Ee of d)qs.set(`${Ee.subject}\0${Ee.predicate}\0${Ee.object}`,Ee.trust);let Ks=(Ee,Tn,Wt)=>qs.get(`${Ee}\0${Tn}\0${Wt}`),Er=new Map;for(let Ee of Oe){let Tn=at.get(Ee.subject),Wt=at.get(Ee.object),en=[Tn&&Ks(Ee.subject,un,Tn.property),Ks(Ee.subject,Yn,Ee.viaY1),Wt&&Ks(Ee.object,un,Wt.property),Ks(Ee.object,Yn,Ee.viaY2),Ks(Ee.viaY1,Q,Ee.viaY2)].filter(Ox=>typeof Ox=="number"),Oi=lf(en,Ax);Oi!==null&&Er.set(`${Ee.subject}\0${Ee.object}`,Oi)}let yn=Ee=>{if(Ee.predicate!==Q)return J.find(en=>en.subject===Ee.subject&&en.object===Ee.object);let Tn=Y.find(en=>en.subject===Ee.subject&&en.object===Ee.object);if(Tn)return Tn;let Wt=Oe.find(en=>en.subject===Ee.subject&&en.object===Ee.object);return Wt?{subject:Wt.subject,predicate:Q,object:Wt.object,provenance:Tx,trust:Er.get(`${Wt.subject}\0${Wt.object}`)}:void 0};for(let Ee of C){let Tn=M(Ee,A,xe,ye,{maxHops:3});if(!Tn)continue;let Wt=Tn.map(yn);if(Wt.every(Boolean)){let en=lf(Wt.map(Oi=>Oi.trust),1);return{text:`yes \u2014 ${Gc(Wt)}`,replace:!0,...en!==null?{trust:en}:{}}}}}}let Ix=X(l,L),pf=f.filter(G=>Ix.has(G.subject)).sort(p),Rn=L.trim(),Hs=nn(w[2]).trim(),Cx=[...C].some(G=>M(G,A,xe,oe,{maxHops:UL}));if(pf.length){let G=pf.slice(0,3).map(re).join("; "),be=Cx?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Rn}", then ask me again.`:`If it's true, teach me: "${Rn} is a kind of ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Rn} is a ${Hs}. I do know: ${G}. ${be}`,replace:!0,miss:!0}}let ff=f.filter(G=>C.has(G.object)&&A.has(G.subject)).sort(p)[0];return ff?{text:`I can't confirm that \u2014 what I know runs the other way: ${re(ff)}. A kind doesn't reverse. If it's true, teach me: "every ${Rn} is a ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`,replace:!0,miss:!0}:!Zt&&!N&&!aL(Rn)&&!d.some(G=>C.has(G.subject)||C.has(G.object))?{text:`I can't confirm that \u2014 I don't know "${Rn}" at all yet. If it's true, teach me: "${Rn} is a kind of ${Hs}". If it isn't, teach me: "no ${Rn} is a ${Hs}".`,replace:!0,miss:!0}:null}let v=c.match(yN);if(v){let[,A,L,C]=v,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:M,buildCardinalityRestrictions:z,proveCardinalityAtLeast:q,CARDINALITY_RULE_CONFIDENCE:Q,entailedTrustFrom:ae}=await Promise.resolve().then(()=>(Xt(),fn)),te=ko,ee=f.filter(ne=>ne.predicate===N&&te(ne)).map(ne=>[ne.subject,ne.object]),Y=d.filter(ne=>(ne.predicate===M||zv.has(ne.predicate))&&te(ne)),J=z(Y);if(J.length){let ne=X(l,A.trim()),xe=X(l,C.trim()),Te=Number(L),ue=Ov(ne,xe,(Ie,Ce)=>q(ee,J,Ie,Ce,Te,{}));if(ue){let Ie=d.find(se=>se.predicate===N&&se.subject===ue.viaClass&&se.object===ue.viaRestriction),Ce=Ie?.provenance?` (source: ${Kn(Ie.provenance)})`:"",oe=ue.kind==="exactly"?"exactly":"at least",ke=(se,He)=>`${se}${He===1?"":"s"}`,le=[Ie?.trust,...Y.filter(se=>se.subject===ue.viaRestriction).map(se=>se.trust),...ue.viaClass!==ue.subject?[f.find(se=>se.predicate===N&&se.subject===ue.subject&&se.object===ue.viaClass)?.trust]:[]].filter(se=>typeof se=="number"),H=ae(le,Q);return{text:`yes \u2014 every ${ue.viaClass} has ${oe} ${ue.n} ${ke(ue.object,ue.n)}${Ce}, so at least ${Te} follows.`,replace:!0,...H!==null?{trust:H}:{}}}}}let k=c.match($N);if(k){let[,A,L]=k,{SUBCLASS_PREDICATE:C,ON_PROPERTY_PREDICATE:N,buildCardinalityRestrictions:M,proveMaxCardinalityZeroDenial:z,CAX_MAXC0_RULE_CONFIDENCE:q,entailedTrustFrom:Q}=await Promise.resolve().then(()=>(Xt(),fn)),ae=ko,te=f.filter(J=>J.predicate===C&&ae(J)).map(J=>[J.subject,J.object]),ee=d.filter(J=>(J.predicate===N||zv.has(J.predicate))&&ae(J)),Y=M(ee);if(Y.length){let J=X(l,A.trim()),ne=X(l,L.trim()),xe=Ov(J,ne,(Te,ue)=>z(te,Y,Te,ue,{}));if(xe){let Te=d.find(oe=>oe.predicate===C&&oe.subject===xe.viaClass&&oe.object===xe.viaRestriction),ue=Te?.provenance?` (source: ${Kn(Te.provenance)})`:"",Ie=[Te?.trust,...ee.filter(oe=>oe.subject===xe.viaRestriction).map(oe=>oe.trust),...xe.viaClass!==xe.subject?[f.find(oe=>oe.predicate===C&&oe.subject===xe.subject&&oe.object===xe.viaClass)?.trust]:[]].filter(oe=>typeof oe=="number"),Ce=Q(Ie,q);return{text:`no \u2014 every ${xe.viaClass} has at most 0 ${xe.object}${ue}.`,replace:!0,...Ce!==null?{trust:Ce}:{}}}}}let $=c.match(vN);if($){let A=X(l,$[1]),L=d.filter(C=>C.predicate===Mp&&A.has(C.subject)).sort(p);return L.length?h(L):null}let x=u.match(xN);if(x){let[,A,L]=x,C=X(l,A.trim()),N=X(l,L.replace(/^an?\s+/i,"").trim()),M=d.filter(z=>z.predicate===Mp&&N.has(z.subject)&&C.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} owns/maintains ${L.trim()}.`,replace:!0}}let E=u.match(EN);if(E){let[,A,L]=E,C=X(l,A.replace(/^an?\s+/i,"").trim()),N=X(l,L.trim()),M=d.filter(z=>z.predicate===Mp&&C.has(z.subject)&&N.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${A.trim().toLowerCase()} is owned by ${L.trim()}.`,replace:!0}}let S=u.match(SN);if(S){let[,A,L]=S,C=X(l,A.trim()),N=X(l,`${L.trim()} method`),M=d.filter(z=>z.predicate===hr&&C.has(z.subject)&&N.has(z.object)).sort(p)[0];return M?{text:`yes \u2014 ${re(M)}`,replace:!0}:null}let R=u.match(kN);if(R){let A=X(l,R[1].trim()),L=d.filter(C=>C.predicate===hr&&A.has(C.subject)&&/ method$/.test(C.object)).sort(p);return L.length?h(L):null}let _=u.match(Uv);if(_){let A=_[1].trim(),L=Wv.test(A)||Bv.test(A)?null:ys.test(A)?r||null:A,C=_[2].trim().toLowerCase();if(L){let N=X(l,L),M=new Map,z=null;if(o){let Y=await Ai(o,L);if(z=Y,Y)for(let J of Hc(o,Y.id))for(let ne of X(l,J.label))!N.has(ne)&&!M.has(ne)&&M.set(ne,J.label),N.add(ne)}let q=Y=>Y.predicate===Fp&&l(Y.object)===C||Y.predicate===`tmct:${C}`&&Y.object==="true",Q=l(L).split(/\s+/).filter(Y=>Y.length>=4&&!sx.has(Y)),ae=Y=>Q.some(J=>new Set(String(Y.subject||"").split(/\s+/)).has(J)),te=Y=>N.has(Y.subject)||Q.length&&ae(Y),ee=d.filter(Y=>te(Y)&&q(Y)).sort(p)[0];if(ee){let Y=M.get(ee.subject);return{text:Y?`yes \u2014 the code graph says ${z.label} inherits ${Y}, and ${re(ee)}`:`yes \u2014 ${re(ee)}`,replace:!0}}{let{findIsaChain:Y,SUBCLASS_PREDICATE:J,TYPE_PREDICATE:ne}=await Promise.resolve().then(()=>(Xt(),fn)),xe=ko,Te=d.filter(le=>le.predicate===J&&xe(le)),ue=d.filter(le=>le.predicate===ne&&xe(le)),Ie=Te.map(le=>[le.subject,le.object]),Ce=ue.map(le=>[le.subject,le.object]),oe=le=>(le.predicate===J?Te:ue).find(H=>H.subject===le.subject&&H.object===le.object),ke=X(l,C);for(let le of N){let H=Y(le,ke,Ce,Ie,{maxHops:2});if(!H)continue;let se=H.map(oe);if(se.every(Boolean))return{text:`yes \u2014 ${Gc(se)}`,replace:!0}}}if(d.some(te)&&!n?.parsed)return/^there\b/i.test(L)||jN.test(C)?null:{text:`I don't have a fact saying ${NL(L)} is ${C}.`,replace:!0};if(!n?.parsed&&!Tv.test(C))return Gv(L,C)}}let I=Zp(c).match(wL);if(I&&!Bp.test(c)){let[,A,L,C]=I,N=L.toLowerCase();if(!Up.test(N)&&!Gp.test(N)){let M=A.trim(),z=vL(await Wp(N),C),q=z.object.replace(/^an?\s+/i,"").trim();if(M&&q){let Q=z.predicate,ae=X(l,M),te=X(l,q),ee=[Q,sr(Q)],Y=d.filter(ne=>ee.includes(ne.predicate)&&ae.has(ne.subject)&&te.has(ne.object)).sort(p)[0];if(Y)return{text:`${Ng(Y.predicate)?"no":"yes"} \u2014 ${re(Y)}`,replace:!0,generalVerbQuery:!0};let J=d.filter(ne=>ee.includes(ne.predicate)&&ae.has(ne.subject));if(J.length){let ne=J.slice(0,3).map(re).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Bt({subject:M,predicate:Q,object:q})}. I do know: ${ne}.`,replace:!0,miss:!0}}return null}}}let P=c.match(yL);if(P&&!Bp.test(c)){let[,A,L]=P,[C,N]=L.toLowerCase().split(/\s+/);if(!Up.test(C)&&!Gp.test(C)){let M=A.trim();if(M){let z=await Wp(C);N&&/^mgx:[a-z]+$/.test(z)&&(z=`${z}-${N}`);let q=X(l,M),Q=[z,sr(z)],ae=Ye(d.filter(te=>Q.includes(te.predicate)&&q.has(te.subject)),i);if(ae.length)return{...h(ae),generalVerbQuery:!0}}}}let T=c.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(T&&!Bp.test(c)){let[,A,L,C]=T,N=A.toLowerCase();if(!Up.test(N)&&!Gp.test(N)&&!bL.test(N)){let M=await Wp(N);/^mgx:[a-z]+$/.test(M)&&(M=`${M}-${L.toLowerCase()}`);let z=X(l,C.replace(/^(?:an?|the)\s+/i,"").trim()),q=Ye(d.filter(Q=>Q.predicate===M&&z.has(Q.object)),i);if(q.length)return{...h(q),generalVerbQuery:!0}}}let F=c.match(bN);if(F){let A=X(l,F[1]),L=Ye(d.filter(Q=>A.has(Q.subject)||A.has(Q.object)),i);if(!L.length)return null;let C=A.has(L[0].subject)?L[0].subject:L[0].object,N=L.map(Q=>` ${re(Q)}`),M=N.slice(0,ve),z=N.slice(ve),q=z.length?`
229
229
  \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:`${L.length} remembered fact${L.length===1?"":"s"} about ${C}:
230
230
  ${M.join(`
231
- `)}${q}`,replace:!0,...z.length?{pending:{items:z.map(Q=>Q.trim()),noun:"facts"}}:{}}}let U=n?.parsed?.shape==="meta"?n.parsed.object:null,K=!1,ce=c.match(QL);if(ce)U=ce[1],K=!0;else if(!U&&!n?.parsed){let A=c.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);A&&(U=A[1])}if(!U)return null;let ie=X(l,U),D=Ye(f.filter(A=>ie.has(A.subject)),i),B=Ye(f.filter(A=>ie.has(A.object)),i),W=K?D.length?D:B:B.length?B:D;return W.length?h(W):null}function Mp(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}var Vp,UO,wn,Pc,yv,Fv,i3,BO,a3,$v,WO,c3,Dv,zv,Uv,GO,vv,l3,u3,d3,p3,f3,qp,h3,VO,Xe,_p,Rp,Ri,HO,ko,m3,g3,b3,w3,y3,$3,v3,x3,E3,S3,k3,j3,_3,R3,T3,xv,YO,Bc,XO,A3,I3,Yp,Bv,C3,O3,L3,Ip,Cp,JO,N3,QO,ZO,Lp,eL,nL,P3,Wv,Gv,sL,M3,F3,Vv,D3,z3,U3,oL,B3,rL,vr,W3,G3,V3,Hv,H3,q3,iL,K3,Y3,X3,J3,jo,Ev,Xp,Ut,cL,uL,dL,Fc,gL,Xv,Q3,zp,Jv,bL,wL,Uc,yL,$L,Vs,qn,vL,xL,EL,Bp,_v,SL,ve,jL,_L,RL,TL,AL,IL,CL,OL,LL,NL,PL,ML,FL,DL,Tv,Zv,UL,BL,GL,VL,HL,qL,KL,Cv,YL,JL,QL,ZL,eN,Ov,tN,nN,sN,oN,rN,Lv,ys,iN,Nv,Pv,Mv,aN,lN,uN,Z3,sx,pN,fN,e5,Fp,Gp,hN,t5,n5,ox,s5,o5,r5,i5,a5,Wc,c5,l5,u5,d5,mN,p5,f5,Nc=O(()=>{Ue();cy();Gt();Le();Is();ic();ac();Ar();cc();wy();Be();xa();Vd();xy();Qn();vn();Go();ta();Md();Fd();Uo();Us();Rl();wi();Dy();qy();np();Ky();sp();Yy();Xy();yc();gc();Td();xi();F$();U$();Ws();hv();na(void 0);ea(rc);Vp=new Set(["it","this","that","here"]),UO=e=>Vp.has(String(e||"").trim().toLowerCase()),wn={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"},Pc=e=>e?`${String(e).toLowerCase()}(s)`:"entities",yv="look up a taught fact about a subject/verb/object";Fv={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}},i3=new Set(["stats","memory","focus",...Object.keys(Fv)]),BO=new Set(["have","has","holds","hold"]),a3=new RegExp(`\\b(?:${[...Object.keys(de),...Object.keys(xs)].filter(e=>!BO.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),$v=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,WO=(e,t)=>{let n=$v(e),s=$v(t);return n<s?-1:n>s?1:0},c3=new Set([...ay.map(e=>e.name),...Object.values(Fv).map(e=>e.tool)]),Dv=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"]),zv=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"]),Uv=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"]),GO=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),vv=e=>e.replace(/(.)\1+/g,"$1");l3=Hp(Dv),u3=Hp(zv),d3=Hp(Uv),p3=new RegExp(`^(?:${[...GO].map(Ze).join("|")})\\s+(.+)$`,"i"),f3=[...Dv,...zv,...Uv,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],qp="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",h3=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${qp})\\s+than\\s+(.+)$`,"i"),VO=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${qp})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Xe="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",_p="mgx:ownedBy",Rp="mgx:hasProperty",Ri="rdfs:subClassOf",HO=new Set(["operator","teach","entailed"]),ko=e=>!!e.sourceTypes?.some(t=>HO.has(t));m3=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),g3=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),b3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Xe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),w3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${qp})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),y3=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Xe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),$3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\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");v3=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),x3=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),E3=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),S3=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),k3=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Xe})\\s+([\\w-]+)[?.!]*$`,"i"),j3=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Xe})\\s+([\\w-]+)[?.!]*$`,"i"),_3=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Xe})\\s+([\\w-]+)$`,"i"),R3=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Xe})\\s+(.+?)[?.!\\s]*$`,"i"),T3=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Xe}))?[?.!\\s]*$`,"i"),xv=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,YO=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"]);Bc="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",XO="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",A3=new RegExp(`^(.+?)\\s+(${XO})\\s+(.+)$`,"i"),I3=new RegExp(`^([\\w'-]+)\\s+${Bc}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Yp="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",Bv="with|to|from|by|of|in|on|for|as|about|into",C3=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Bc}(${Yp})\\s+(${Bv})\\s+(.+)$`,"i"),O3=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Yp})\\s+(${Bv})\\s+(.+)$`,"i"),L3=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Xe})\\s+(.+?)[.!?]*$`,"i"),Ip=/^(?:is|are|am|owns|maintains)$/i,Cp=/\b(?:is|are|am|owns|maintains)\b/i,JO=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"),N3=new RegExp(`^(?:${Zs.filter(e=>!/\s/.test(e)).join("|")})$`,"i");QO=new RegExp(`^(?:does|did)\\s+([\\w'-]+)\\s+${Bc}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),ZO=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Bc}([a-z]+(?:\\s+(?:${Xe}))?)[?.!\\s]*$`,"i"),Lp=/^(?:be|own|maintain)$/i,eL=new RegExp(`^(${Xe})\\s+(.+)$`,"i");nL=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],P3=new RegExp(`^(?:${nL.join("|")})\\b\\s*,?\\s+`,"i"),Wv=Object.freeze(["you","i","it","they","he","she","we"]),Gv=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),sL=Object.freeze([...Gv,...Wv]),M3=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${sL.join("|")})\\s+\\S+`,"i"),F3=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${Wv.join("|")})\\s+(?:is|are|am|was|were)|(${Gv.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),Vv="forget|unlearn|delete|remove",D3=new RegExp(`^(?:${Vv})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),z3=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Xe})\\s+([\\w-]+)$`,"i"),U3=new RegExp(`^(?:${Vv})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Xe})\\s+([\\w-]+)$`,"i"),oL="collection|set|group|family",B3=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${oL})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),rL=Object.freeze(["mgx:memberOf","mgx:partOf"]),vr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",W3=new RegExp(`^what\\s+does\\s+(.+?)${vr}\\s+do${vr}\\??$`,"i"),G3=new RegExp(`^what\\s+(.+?)${vr}\\s+does${vr}\\??$`,"i"),V3=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${vr}\\s+do${vr}\\??$`,"i"),Hv="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",H3=new RegExp(`^who\\s+(?:is|was)\\s+${Hv}$`,"i"),q3=new RegExp(`^what\\s+(?:did|has)\\s+${Hv}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),iL="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",K3=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${iL}\\b`,"i"),Y3=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"),X3=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});J3=new Set([...Object.keys(de).flatMap(e=>e.split(/[\s-]+/)),...tn,...$n,"owns","maintains"].filter(e=>e.length>=3)),jo={"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","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"},Ev=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"]),Xp=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Ut=e=>`${e.subject} ${Kv(e.predicate)} ${e.object}`;cL=Object.entries(jo).filter(([e])=>!Xp.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);uL=/ \(source: [^)]*\)$/;dL=8;Fc=null;gL=/^(?:every|each|all|any)\s+/i;Xv=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"]),Q3=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("|"))),zp=/^(?: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,Jv=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,bL=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,wL=/^(who|what)'?s\s+/i,Uc=e=>String(e).replace(wL,(t,n)=>`${n} is `),yL=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;$L=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Vs=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,qn=new Set(["rdfs:subClassOf","rdf:type"]),vL=6,xL=/^why\s+(?=(?:is|are)\b)/i,EL=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;Bp=new Set(["kind","sort","type","subclass","superclass"]),_v=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,SL=/^(?: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,ve=32;jL=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,_L=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,RL=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,TL=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,AL=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,IL=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,CL=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,OL=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Xe})\\s+(.+?)\\s*[?.!]*$`,"i"),LL=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,NL=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,PL=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,ML=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,FL=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,DL=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;Tv=e=>String(e||"").replace(/\s+/g," ").trim();Zv="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",UL=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${Zv})[?.!\\s]*$`,"i"),BL=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${Zv})\\s+([\\w'-]+)[?.!\\s]*$`,"i");GL=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),VL=Object.entries(jo).filter(([e])=>!GL.has(e)&&!Xp.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Ze(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),HL=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),qL=new Set(["mgx:partOf","mgx:memberOf"]),KL=Object.entries(jo).filter(([e])=>!HL.has(e)&&!Xp.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=Ze(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[qv(s),...o].map(Ze).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),Cv=/^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,YL=new Set(["changed","change","changes","updated","modified","happened","occurred"]);JL=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,QL=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,ZL=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,eN=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,Ov=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),tN=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,nN=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,sN=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,oN=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,rN=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,Lv=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,ys=/^(?:it|this|that)$/i,iN=/^(?:it|them|this|that|in|on|of|to|at)$/i,Nv=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,Pv=/^(?:you|i|they|he|she|we)\b/i,Mv=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${zc(e)} is ${t}".`,replace:!0}),aN=/^(?: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;lN=/inherit|supertype|subclass|extend|specializ/i,uN=8;Z3=new RegExp(`\\b(?:${[...Vp].join("|")})\\b`,"i"),sx=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,pN=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,fN=/^(?: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;e5=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(We).join("|")})$`,"i"),Fp="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",Gp="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",hN=`(?:\\s+${Gp})?`,t5=[new RegExp(`^${Fp}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${hN}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Fp}architecture\\s+(?:${Gp}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Fp}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${Gp}(?:\\s+here)?\\??$`,"i")],n5={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:wn.contains,subclasses:wn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:wn.calls,callees:wn.calls,tests:wn.tests,untested:wn.tests,history:wn.touches,exports:wn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",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",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"},ox="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",s5=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+${ox}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),o5=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${ox}\\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"),r5=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"),i5=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"),a5=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"),Wc="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",c5=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Wc}\\s*\\??$`,"i"),l5=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Wc}\\s*\\??$`,"i"),u5=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Wc}\\s*\\??$`,"i"),d5=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Wc}\\s*[.!]*$`,"i"),mN=Object.freeze([...Vp].filter(e=>e!=="here").concat("they")),p5=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${mN.join("|")})\\b(\\s+\\S.*)?$`,"i"),f5=Z(".tmct","memory","corpus-seed.json")});Nc();Be();es();yc();var Gc={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 ax=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"}),_o=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Vc=e=>ax[e]||"other",bN=e=>Math.max(0,Math.min(1,e));function rx(e){let t=(e.sourceTypes||[]).map(n=>to[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:to.entailed}function wN(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function ix(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function cx(e,t,n={},s={}){let o={...Gc,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter($=>$&&$.object&&$.object!==e),a=[],l=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,c=[];for(let $ of i){if(Vc($.predicate)==="isa"){let x=ix($.object,n);if(l&&x>o.uninformativeClassMaxShare){a.push({row:$,family:"isa",reason:"uninformative-class",share:x});continue}}c.push($)}let u=c.filter($=>Vc($.predicate)==="isa").map($=>$.object),d=wc(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let $ of d.clusters){let x=0;for(let E of $.objects){p.set(E,$.label);let S=c.find(R=>R.object===E&&Vc(R.predicate)==="isa");x+=S?rx(S):0}f.set($.label,x)}let h=null,m=-1;for(let[$,x]of[...f].sort((E,S)=>E[0].localeCompare(S[0])))x>m&&(m=x,h=$);let b=[];for(let $ of c){let x=Vc($.predicate),E=rx($),S={provenance:E};if(wN($)&&(E-=o.entailedDepthPenalty,S.entailed=!0),x==="isa"){let _=.6+.4*(1-ix($.object,n));E*=_,S.informativeness=_;let I=p.get($.object);h&&I&&I!==h&&(E-=o.minoritySensePenalty,S.minoritySense=I)}E=bN(E),b.push({row:$,family:x,score:E,reasons:S})}let g=[];for(let $ of b)$.score<o.minScore?a.push({row:$.row,family:$.family,reason:"below-floor",score:$.score}):g.push($);let y=new Map;for(let $ of g)y.has($.family)||y.set($.family,[]),y.get($.family).push($);for(let $ of y.values())$.sort((x,E)=>E.score-x.score||x.row.object.localeCompare(E.row.object));let w=_o.filter($=>y.has($)).concat([...y.keys()].filter($=>!_o.includes($)).sort()),v=[],k=!1;for(;v.length<r&&!k;){k=!0;for(let $ of w){let x=y.get($);if(x&&x.length&&(v.push(x.shift()),k=!1,v.length>=r))break}}for(let $ of w)for(let x of y.get($)||[])a.push({row:x.row,family:x.family,reason:"over-budget",score:x.score});return v.sort(($,x)=>{let E=_o.indexOf($.family),S=_o.indexOf(x.family);return E-S||x.score-$.score||$.row.object.localeCompare(x.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:h}}}ra();Yt();var yN=new Set(["isa","location","partOf","capableOf","usedFor"]),$N=new Set(["single","several","chained","group","closer"]),lx=(e,t)=>`${e}:${t}`;function Jp(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!yN.has(n.family)||typeof n.form!="string"||!$N.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=lx(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 Ro=e=>`${Vo(e)} ${e}`;function vN(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Ro(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Mr(s.map(Ro))}`:n}function xN(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(l=>String(l||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:Ho(o),A_TERM:Ro(o),A_TERM_CAP:Ho(Ro(o)),TERMS:oa(o),TERMS_CAP:Ho(oa(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Ro(a):"",OBJECT:i,A_OBJECT:i?Ro(i):"",OBJECTS_A:Mr(r.map(Ro)),OBJECTS_PLURAL:Mr(r.map(oa)),OBJECTS_RAW:Mr(r),CHAIN:vN(n&&n.length?n:r.slice(0,1))}}function EN(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 $s(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(lx(t,i)):null,l=a?a.templates:null;if(!l||!l.length)return null;let c=s.variantSeed??"",u=ga(`${r}|${t}|${i}|${c}`)%l.length,d=s.objectsOverride||o.map(p=>p.object),f=EN(l[u],xN(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}ra();var SN=_o.filter(e=>e!=="isa"&&e!=="other");function kN(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 ux(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 jN(e,t){let n=l=>(t?.[l.object]||[])[1]||null,s=new Map;for(let l of e||[]){let c=n(l);c&&s.set(c,(s.get(c)||0)+1)}let o=new Map,r=[],i=[];for(let l of e||[]){let c=n(l);c&&s.get(c)>=2?(o.has(c)||(o.set(c,[]),r.push(c)),o.get(c).push(l)):i.push(l)}let a=r.map(l=>({parent:l,rows:o.get(l)}));return i.length&&a.push({parent:null,rows:i}),a}function _N(e,t,n){let s=new Map,o=new Map;for(let l of t||[]){let c=e?.[l.object];if(!Array.isArray(c)||c.length<2)continue;let u=c[c.length-1];!u||u===l.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(l))}let r=[...s.keys()].sort((l,c)=>s.get(c)-s.get(l)||l.localeCompare(c)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let l of r)for(let c of o.get(l)||[])a.has(c.id)||(a.add(c.id),i.push(c));return{roots:r,rows:i}}function RN(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",h=$s(s,"isa",e,{term:n,form:p,chain:f});return h&&r.push({...h,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let f=$s(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),l=$s(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});l&&r.push({...l,role:"names-term",paragraph:"definition"});let c=[];for(let f of jN(a,t))for(let p of ux(f.rows,o.maxObjectsPerBodySentence))c.push({parent:f.parent,rows:p});if(c.length>o.maxBodySentences){let f=c.slice(0,o.maxBodySentences),p=f[f.length-1];for(let h of c.slice(o.maxBodySentences))p.rows=p.rows.concat(h.rows);p.parent=null,c=f}for(let f of c){let p=f.parent?$s(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):$s(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=_N(t,e,o.closerRootCount);if(u.length){let f=$s(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 TN(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Ho(`${Vo(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function AN(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 dx(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Gc,...n.config||{}},a=kN(e?.selected||[]),l=[];for(let u of RN(a.get("isa")||[],r,s,t,i))l.push(u);for(let u of SN){let d=a.get(u);if(!(!d||!d.length))for(let f of ux(d,i.maxObjectsPerBodySentence)){let p=$s(t,u,f,{term:s});p&&l.push({...p,role:"describes",paragraph:"description"})}}TN(l,s);let c=new Map;for(let u of l)for(let d of u.rows)c.has(d.id)||c.set(d.id,d);return{term:s,sentences:l,paragraphs:AN(l,o),provenanceRows:[...c.values()]}}var IN=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function CN(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 ON=Object.freeze({facts:"show the facts",chains:"show the chains"});function LN(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:ON,facts:n.map(IN),factCount:n.length,chains:s}}function px(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:CN(t?.provenanceRows||[]),detail:LN(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function fx(e,t,n={},s=new Map,o={}){let r=cx(e,t,n,o),i=dx(r,s,o);return px(r,i,o)}yc();gc();var hx=new Set(["rdfs:subClassOf","rdf:type"]);function mx(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(hx.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 gx(e,t,n=6){let s=yi(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=bc(r,s,{cap:n,stopAt:mc});i.length>1&&(o[r]=i)}return o}function bx(e){let t=[],n=new Set;for(let s of e||[])!s||!hx.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Be();Nc();function NN(e,t,n,s,o={}){let r=Jp(s||[]);if(!r||r.size===0)return null;let i=t||[],a=mx(n||i),l=gx(a.subClassEdges,bx(i));return fx(e,i,a,r,{...o,chains:l})}function wx(e,t,n,s={}){let o=Et(e||{individuals:[],objectProperties:[]}),r=X(V,t),i=o.filter(l=>r.has(l.subject));if(!i.length)return null;let a=NN(t,i,o,n,s);return PN(a)}function PN(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 MN="no session is open on this page yet \u2014 await tmct.open() first",yx=Symbol.for("tmct.surface.fallback");function $x({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[yx])return a;let l=null,c=()=>{if(!l)throw new Error(MN);return l},u={async open(...d){return l=await e(...d),l},get session(){return l},async turn(d,f){let p=c();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,c()):{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,c()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[yx]=r,i.tmct=u,u}function FN({payload:e=null}={}){let t=ui();return e&&(t.payload=e),{memoryDir:t}}async function DN(e,t,n){let s=null;try{s=await ex(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await nx(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}}$x({open:FN,ask:DN,page:{normFactTerm:V,digestTermFromPayloadBrowser:wx},fallback:!0});})();
231
+ `)}${q}`,replace:!0,...z.length?{pending:{items:z.map(Q=>Q.trim()),noun:"facts"}}:{}}}let U=n?.parsed?.shape==="meta"?n.parsed.object:null,K=!1,ce=c.match(wN);if(ce)U=ce[1],K=!0;else if(!U&&!n?.parsed){let A=c.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);A&&(U=A[1])}if(!U)return null;let ie=X(l,U),D=Ye(f.filter(A=>ie.has(A.subject)),i),B=Ye(f.filter(A=>ie.has(A.object)),i),W=K?D.length?D:B:B.length?B:D;return W.length?h(W):null}function qp(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}var tf,aL,wn,Wc,jv,Vv,F3,cL,D3,_v,lL,z3,Hv,qv,Kv,uL,Rv,U3,B3,W3,G3,V3,sf,H3,dL,Xe,Mp,Fp,Ii,pL,ko,q3,K3,Y3,X3,J3,Q3,Z3,e5,t5,n5,s5,o5,r5,i5,a5,Tv,mL,Yc,gL,c5,l5,rf,Yv,u5,d5,p5,Up,Bp,bL,f5,wL,yL,Gp,$L,xL,h5,Xv,Jv,EL,m5,g5,Qv,b5,w5,y5,SL,$5,kL,xr,v5,x5,E5,Zv,S5,k5,jL,j5,_5,R5,T5,jo,Av,af,Bt,RL,AL,IL,Vc,PL,sx,A5,Xp,ox,ML,FL,Kc,DL,zL,Vs,qn,UL,BL,WL,Qp,Lv,GL,ve,HL,qL,KL,YL,XL,JL,QL,ZL,eN,tN,nN,sN,oN,rN,Pv,ix,aN,cN,uN,dN,pN,fN,hN,Dv,mN,bN,wN,yN,$N,zv,vN,xN,EN,SN,kN,Uv,ys,jN,Bv,Wv,Gv,_N,TN,AN,I5,ux,CN,ON,C5,Kp,ef,LN,O5,L5,dx,N5,P5,M5,F5,D5,Xc,z5,U5,B5,W5,NN,G5,V5,Bc=O(()=>{Ue();wy();Vt();Le();Is();lc();uc();Ir();dc();Ry();Be();ka();Qd();Cy();Qn();vn();Go();oa();Gd();Vd();Uo();Us();Nl();br();qy();Jy();e$();pp();t$();fp();n$();s$();jc();Ec();Pd();ki();V$();K$();Ws();vv();ra(void 0);sa(cc);tf=new Set(["it","this","that","here"]),aL=e=>tf.has(String(e||"").trim().toLowerCase()),wn={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"},Wc=e=>e?`${String(e).toLowerCase()}(s)`:"entities",jv="look up a taught fact about a subject/verb/object";Vv={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}},F3=new Set(["stats","memory","focus",...Object.keys(Vv)]),cL=new Set(["have","has","holds","hold"]),D3=new RegExp(`\\b(?:${[...Object.keys(de),...Object.keys(xs)].filter(e=>!cL.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),_v=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,lL=(e,t)=>{let n=_v(e),s=_v(t);return n<s?-1:n>s?1:0},z3=new Set([...by.map(e=>e.name),...Object.values(Vv).map(e=>e.tool)]),Hv=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"]),qv=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"]),Kv=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"]),uL=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),Rv=e=>e.replace(/(.)\1+/g,"$1");U3=nf(Hv),B3=nf(qv),W3=nf(Kv),G3=new RegExp(`^(?:${[...uL].map(Ze).join("|")})\\s+(.+)$`,"i"),V3=[...Hv,...qv,...Kv,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],sf="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",H3=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${sf})\\s+than\\s+(.+)$`,"i"),dL=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${sf})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Xe="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Mp="mgx:ownedBy",Fp="mgx:hasProperty",Ii="rdfs:subClassOf",pL=new Set(["operator","teach","entailed"]),ko=e=>!!e.sourceTypes?.some(t=>pL.has(t));q3=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),K3=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Y3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Xe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),X3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${sf})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),J3=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Xe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Q3=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\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");Z3=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),e5=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),t5=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Xe})\\s+([\\w-]+)[.!?]*$`,"i"),n5=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Xe})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),s5=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Xe})\\s+([\\w-]+)[?.!]*$`,"i"),o5=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Xe})\\s+([\\w-]+)[?.!]*$`,"i"),r5=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Xe})\\s+([\\w-]+)$`,"i"),i5=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Xe})\\s+(.+?)[?.!\\s]*$`,"i"),a5=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Xe}))?[?.!\\s]*$`,"i"),Tv=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,mL=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"]);Yc="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",gL="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",c5=new RegExp(`^(.+?)\\s+(${gL})\\s+(.+)$`,"i"),l5=new RegExp(`^([\\w'-]+)\\s+${Yc}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),rf="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",Yv="with|to|from|by|of|in|on|for|as|about|into",u5=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Yc}(${rf})\\s+(${Yv})\\s+(.+)$`,"i"),d5=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${rf})\\s+(${Yv})\\s+(.+)$`,"i"),p5=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Xe})\\s+(.+?)[.!?]*$`,"i"),Up=/^(?:is|are|am|owns|maintains)$/i,Bp=/\b(?:is|are|am|owns|maintains)\b/i,bL=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"),f5=new RegExp(`^(?:${Zs.filter(e=>!/\s/.test(e)).join("|")})$`,"i");wL=new RegExp(`^(?:does|did)\\s+([\\w'-]+)\\s+${Yc}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),yL=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Yc}([a-z]+(?:\\s+(?:${Xe}))?)[?.!\\s]*$`,"i"),Gp=/^(?:be|own|maintain)$/i,$L=new RegExp(`^(${Xe})\\s+(.+)$`,"i");xL=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],h5=new RegExp(`^(?:${xL.join("|")})\\b\\s*,?\\s+`,"i"),Xv=Object.freeze(["you","i","it","they","he","she","we"]),Jv=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),EL=Object.freeze([...Jv,...Xv]),m5=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${EL.join("|")})\\s+\\S+`,"i"),g5=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${Xv.join("|")})\\s+(?:is|are|am|was|were)|(${Jv.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),Qv="forget|unlearn|delete|remove",b5=new RegExp(`^(?:${Qv})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),w5=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Xe})\\s+([\\w-]+)$`,"i"),y5=new RegExp(`^(?:${Qv})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Xe})\\s+([\\w-]+)$`,"i"),SL="collection|set|group|family",$5=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${SL})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),kL=Object.freeze(["mgx:memberOf","mgx:partOf"]),xr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",v5=new RegExp(`^what\\s+does\\s+(.+?)${xr}\\s+do${xr}\\??$`,"i"),x5=new RegExp(`^what\\s+(.+?)${xr}\\s+does${xr}\\??$`,"i"),E5=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${xr}\\s+do${xr}\\??$`,"i"),Zv="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",S5=new RegExp(`^who\\s+(?:is|was)\\s+${Zv}$`,"i"),k5=new RegExp(`^what\\s+(?:did|has)\\s+${Zv}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),jL="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",j5=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${jL}\\b`,"i"),_5=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"),R5=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});T5=new Set([...Object.keys(de).flatMap(e=>e.split(/[\s-]+/)),...tn,...$n,"owns","maintains"].filter(e=>e.length>=3)),jo={"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","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"},Av=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"]),af=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Bt=e=>`${e.subject} ${tx(e.predicate)} ${e.object}`;RL=Object.entries(jo).filter(([e])=>!af.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);AL=/ \(source: [^)]*\)$/;IL=8;Vc=null;PL=/^(?:every|each|all|any)\s+/i;sx=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"]),A5=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("|"))),Xp=/^(?: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,ox=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,ML=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,FL=/^(who|what)'?s\s+/i,Kc=e=>String(e).replace(FL,(t,n)=>`${n} is `),DL=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;zL=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Vs=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,qn=new Set(["rdfs:subClassOf","rdf:type"]),UL=6,BL=/^why\s+(?=(?:is|are)\b)/i,WL=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;Qp=new Set(["kind","sort","type","subclass","superclass"]),Lv=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,GL=/^(?: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,ve=32;HL=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,qL=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,KL=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,YL=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,XL=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,JL=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,QL=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,ZL=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Xe})\\s+(.+?)\\s*[?.!]*$`,"i"),eN=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,tN=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,nN=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,sN=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,oN=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,rN=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;Pv=e=>String(e||"").replace(/\s+/g," ").trim();ix="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",aN=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${ix})[?.!\\s]*$`,"i"),cN=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${ix})\\s+([\\w'-]+)[?.!\\s]*$`,"i");uN=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),dN=Object.entries(jo).filter(([e])=>!uN.has(e)&&!af.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Ze(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),pN=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),fN=new Set(["mgx:partOf","mgx:memberOf"]),hN=Object.entries(jo).filter(([e])=>!pN.has(e)&&!af.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=Ze(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[ex(s),...o].map(Ze).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),Dv=/^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,mN=new Set(["changed","change","changes","updated","modified","happened","occurred"]);bN=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,wN=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,yN=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,$N=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,zv=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),vN=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,xN=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,EN=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,SN=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,kN=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,Uv=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,ys=/^(?:it|this|that)$/i,jN=/^(?:it|them|this|that|in|on|of|to|at)$/i,Bv=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,Wv=/^(?:you|i|they|he|she|we)\b/i,Gv=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${qc(e)} is ${t}".`,replace:!0}),_N=/^(?: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;TN=/inherit|supertype|subclass|extend|specializ/i,AN=8;I5=new RegExp(`\\b(?:${[...tf].join("|")})\\b`,"i"),ux=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,CN=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,ON=/^(?: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;C5=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(We).join("|")})$`,"i"),Kp="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",ef="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",LN=`(?:\\s+${ef})?`,O5=[new RegExp(`^${Kp}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${LN}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Kp}architecture\\s+(?:${ef}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Kp}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${ef}(?:\\s+here)?\\??$`,"i")],L5={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:wn.contains,subclasses:wn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:wn.calls,callees:wn.calls,tests:wn.tests,untested:wn.tests,history:wn.touches,exports:wn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",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"},dx="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",N5=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+${dx}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),P5=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${dx}\\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"),M5=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"),F5=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"),D5=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"),Xc="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",z5=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Xc}\\s*\\??$`,"i"),U5=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Xc}\\s*\\??$`,"i"),B5=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Xc}\\s*\\??$`,"i"),W5=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Xc}\\s*[.!]*$`,"i"),NN=Object.freeze([...tf].filter(e=>e!=="here").concat("they")),G5=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${NN.join("|")})\\b(\\s+\\S.*)?$`,"i"),V5=Z(".tmct","memory","corpus-seed.json")});Bc();Be();es();jc();var Jc={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 hx=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"}),_o=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Qc=e=>hx[e]||"other",MN=e=>Math.max(0,Math.min(1,e));function px(e){let t=(e.sourceTypes||[]).map(n=>to[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:to.entailed}function FN(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function fx(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function mx(e,t,n={},s={}){let o={...Jc,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter($=>$&&$.object&&$.object!==e),a=[],l=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,c=[];for(let $ of i){if(Qc($.predicate)==="isa"){let x=fx($.object,n);if(l&&x>o.uninformativeClassMaxShare){a.push({row:$,family:"isa",reason:"uninformative-class",share:x});continue}}c.push($)}let u=c.filter($=>Qc($.predicate)==="isa").map($=>$.object),d=kc(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let $ of d.clusters){let x=0;for(let E of $.objects){p.set(E,$.label);let S=c.find(R=>R.object===E&&Qc(R.predicate)==="isa");x+=S?px(S):0}f.set($.label,x)}let h=null,m=-1;for(let[$,x]of[...f].sort((E,S)=>E[0].localeCompare(S[0])))x>m&&(m=x,h=$);let b=[];for(let $ of c){let x=Qc($.predicate),E=px($),S={provenance:E};if(FN($)&&(E-=o.entailedDepthPenalty,S.entailed=!0),x==="isa"){let _=.6+.4*(1-fx($.object,n));E*=_,S.informativeness=_;let I=p.get($.object);h&&I&&I!==h&&(E-=o.minoritySensePenalty,S.minoritySense=I)}E=MN(E),b.push({row:$,family:x,score:E,reasons:S})}let g=[];for(let $ of b)$.score<o.minScore?a.push({row:$.row,family:$.family,reason:"below-floor",score:$.score}):g.push($);let y=new Map;for(let $ of g)y.has($.family)||y.set($.family,[]),y.get($.family).push($);for(let $ of y.values())$.sort((x,E)=>E.score-x.score||x.row.object.localeCompare(E.row.object));let w=_o.filter($=>y.has($)).concat([...y.keys()].filter($=>!_o.includes($)).sort()),v=[],k=!1;for(;v.length<r&&!k;){k=!0;for(let $ of w){let x=y.get($);if(x&&x.length&&(v.push(x.shift()),k=!1,v.length>=r))break}}for(let $ of w)for(let x of y.get($)||[])a.push({row:x.row,family:x.family,reason:"over-budget",score:x.score});return v.sort(($,x)=>{let E=_o.indexOf($.family),S=_o.indexOf(x.family);return E-S||x.score-$.score||$.row.object.localeCompare(x.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:h}}}ca();Mt();var DN=new Set(["isa","location","partOf","capableOf","usedFor"]),zN=new Set(["single","several","chained","group","closer"]),gx=(e,t)=>`${e}:${t}`;function cf(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!DN.has(n.family)||typeof n.form!="string"||!zN.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=gx(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 Ro=e=>`${Vo(e)} ${e}`;function UN(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Ro(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Fr(s.map(Ro))}`:n}function BN(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(l=>String(l||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:Ho(o),A_TERM:Ro(o),A_TERM_CAP:Ho(Ro(o)),TERMS:aa(o),TERMS_CAP:Ho(aa(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Ro(a):"",OBJECT:i,A_OBJECT:i?Ro(i):"",OBJECTS_A:Fr(r.map(Ro)),OBJECTS_PLURAL:Fr(r.map(aa)),OBJECTS_RAW:Fr(r),CHAIN:UN(n&&n.length?n:r.slice(0,1))}}function WN(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 $s(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(gx(t,i)):null,l=a?a.templates:null;if(!l||!l.length)return null;let c=s.variantSeed??"",u=ya(`${r}|${t}|${i}|${c}`)%l.length,d=s.objectsOverride||o.map(p=>p.object),f=WN(l[u],BN(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}ca();var GN=_o.filter(e=>e!=="isa"&&e!=="other");function VN(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 bx(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 HN(e,t){let n=l=>(t?.[l.object]||[])[1]||null,s=new Map;for(let l of e||[]){let c=n(l);c&&s.set(c,(s.get(c)||0)+1)}let o=new Map,r=[],i=[];for(let l of e||[]){let c=n(l);c&&s.get(c)>=2?(o.has(c)||(o.set(c,[]),r.push(c)),o.get(c).push(l)):i.push(l)}let a=r.map(l=>({parent:l,rows:o.get(l)}));return i.length&&a.push({parent:null,rows:i}),a}function qN(e,t,n){let s=new Map,o=new Map;for(let l of t||[]){let c=e?.[l.object];if(!Array.isArray(c)||c.length<2)continue;let u=c[c.length-1];!u||u===l.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(l))}let r=[...s.keys()].sort((l,c)=>s.get(c)-s.get(l)||l.localeCompare(c)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let l of r)for(let c of o.get(l)||[])a.has(c.id)||(a.add(c.id),i.push(c));return{roots:r,rows:i}}function KN(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",h=$s(s,"isa",e,{term:n,form:p,chain:f});return h&&r.push({...h,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let f=$s(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),l=$s(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});l&&r.push({...l,role:"names-term",paragraph:"definition"});let c=[];for(let f of HN(a,t))for(let p of bx(f.rows,o.maxObjectsPerBodySentence))c.push({parent:f.parent,rows:p});if(c.length>o.maxBodySentences){let f=c.slice(0,o.maxBodySentences),p=f[f.length-1];for(let h of c.slice(o.maxBodySentences))p.rows=p.rows.concat(h.rows);p.parent=null,c=f}for(let f of c){let p=f.parent?$s(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):$s(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=qN(t,e,o.closerRootCount);if(u.length){let f=$s(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 YN(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Ho(`${Vo(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function XN(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 wx(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Jc,...n.config||{}},a=VN(e?.selected||[]),l=[];for(let u of KN(a.get("isa")||[],r,s,t,i))l.push(u);for(let u of GN){let d=a.get(u);if(!(!d||!d.length))for(let f of bx(d,i.maxObjectsPerBodySentence)){let p=$s(t,u,f,{term:s});p&&l.push({...p,role:"describes",paragraph:"description"})}}YN(l,s);let c=new Map;for(let u of l)for(let d of u.rows)c.has(d.id)||c.set(d.id,d);return{term:s,sentences:l,paragraphs:XN(l,o),provenanceRows:[...c.values()]}}var JN=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function QN(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 ZN=Object.freeze({facts:"show the facts",chains:"show the chains"});function e0(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:ZN,facts:n.map(JN),factCount:n.length,chains:s}}function yx(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:QN(t?.provenanceRows||[]),detail:e0(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function $x(e,t,n={},s=new Map,o={}){let r=mx(e,t,n,o),i=wx(r,s,o);return yx(r,i,o)}jc();Ec();var vx=new Set(["rdfs:subClassOf","rdf:type"]);function xx(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(vx.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 Ex(e,t,n=6){let s=xi(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=Sc(r,s,{cap:n,stopAt:xc});i.length>1&&(o[r]=i)}return o}function Sx(e){let t=[],n=new Set;for(let s of e||[])!s||!vx.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Be();Bc();function t0(e,t,n,s,o={}){let r=cf(s||[]);if(!r||r.size===0)return null;let i=t||[],a=xx(n||i),l=Ex(a.subClassEdges,Sx(i));return $x(e,i,a,r,{...o,chains:l})}function kx(e,t,n,s={}){let o=Et(e||{individuals:[],objectProperties:[]}),r=X(V,t),i=o.filter(l=>r.has(l.subject));if(!i.length)return null;let a=t0(t,i,o,n,s);return n0(a)}function n0(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 s0="no session is open on this page yet \u2014 await tmct.open() first",jx=Symbol.for("tmct.surface.fallback");function _x({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[jx])return a;let l=null,c=()=>{if(!l)throw new Error(s0);return l},u={async open(...d){return l=await e(...d),l},get session(){return l},async turn(d,f){let p=c();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,c()):{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,c()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[jx]=r,i.tmct=u,u}function o0({payload:e=null}={}){let t=di();return e&&(t.payload=e),{memoryDir:t}}async function r0(e,t,n){let s=null;try{s=await ax(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await lx(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}}_x({open:o0,ask:r0,page:{normFactTerm:V,digestTermFromPayloadBrowser:kx},fallback:!0});})();