@polycode-projects/the-mechanical-code-talker 5.0.6 → 5.0.7

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.
Files changed (38) hide show
  1. package/README.md +6 -0
  2. package/bin/tmct.mjs +63 -2
  3. package/package.json +1 -1
  4. package/src/adapters/memory/core.mjs +23 -0
  5. package/src/domain/ask-vocab.mjs +19 -0
  6. package/src/domain/ask.mjs +8 -1
  7. package/src/domain/interpret/strategies/keywords.mjs +30 -1
  8. package/src/domain/memory/capability.mjs +15 -11
  9. package/src/domain/router/drive.mjs +36 -17
  10. package/src/domain/router/resolver.mjs +63 -17
  11. package/src/domain/spider-fly-world.mjs +2 -2
  12. package/src/domain/sprite-templates.mjs +19 -7
  13. package/src/domain/syllogise.mjs +16 -6
  14. package/src/domain/town-square-world.mjs +1 -1
  15. package/src/services/adventure.mjs +8 -1
  16. package/src/services/chat-page-viz.mjs +118 -23
  17. package/src/services/chat-session.mjs +60 -10
  18. package/src/services/chat.mjs +228 -24
  19. package/src/services/extract-facts.mjs +47 -7
  20. package/src/services/ingest-viz.mjs +108 -25
  21. package/src/services/ledger-viz.mjs +4 -2
  22. package/src/services/memory-panel-viz.mjs +44 -0
  23. package/src/services/mud-viz.mjs +17 -0
  24. package/src/services/mudiii-scene.mjs +271 -24
  25. package/src/services/mudiii-turn.mjs +65 -9
  26. package/src/services/mudiii-viz.mjs +302 -125
  27. package/src/services/plan-viz.mjs +23 -2
  28. package/src/services/predator-prey.mjs +82 -33
  29. package/src/services/research-viz.mjs +12 -19
  30. package/src/services/spider-fly-turn.mjs +7 -1
  31. package/src/services/spider-fly-viz.mjs +10 -3
  32. package/src/services/viz-ticker.mjs +15 -2
  33. package/src/surfaces/http/server-http.mjs +90 -13
  34. package/src/surfaces/web/memory-ask-browser.bundle.js +125 -125
  35. package/src/surfaces/web/mud-browser-entry.mjs +33 -1
  36. package/src/surfaces/web/tmct-surface.mjs +18 -6
  37. package/src/tools/handlers/tmct-ask.mjs +15 -2
  38. package/src/tools/server.mjs +31 -2
@@ -1,41 +1,41 @@
1
- (()=>{var V$=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 Bn=(e,t)=>{for(var n in t)V$(e,n,{get:t[n],enumerable:!0})};var ct,kO,jO,_O,RO,TO,AO,IO,CO,OO,LO,NO,PO,MO,FO,DO,zO,Q,ve,Qt,mp,UO,BO,WO,Ue=O(()=>{ct=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},kO=ct("createRequire"),jO=ct("readFileSync"),_O=ct("access"),RO=ct("readFile"),TO=ct("writeFile"),AO=ct("appendFile"),IO=ct("mkdir"),CO=ct("mkdtemp"),OO=ct("rename"),LO=ct("unlink"),NO=ct("rm"),PO=ct("stat"),MO=ct("copyFile"),FO=ct("readdir"),DO=ct("createReadStream"),zO=ct("createWriteStream"),Q=(...e)=>e.join("/"),ve=e=>String(e).replace(/\/[^/]*$/,""),Qt=(...e)=>e.join("/"),mp="/",UO=ct("randomBytes"),BO=ct("spawnSync"),WO=ct("createInterface")});var lt,qO,VO,hp,ze,$r,H$,jn,K$,xi,xc,Y$,X$,HO,J$,KO,YO,XO,JO,QO,_t=O(()=>{lt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},qO=lt("createRequire"),VO=lt("readFileSync"),hp=lt("access"),ze=lt("readFile"),$r=lt("writeFile"),H$=lt("appendFile"),jn=lt("mkdir"),K$=lt("mkdtemp"),xi=lt("rename"),xc=lt("unlink"),Y$=lt("rm"),X$=lt("stat"),HO=lt("copyFile"),J$=lt("readdir"),KO=lt("createReadStream"),YO=lt("createWriteStream"),XO=lt("randomBytes"),JO=lt("spawnSync"),QO=lt("createInterface")});function ko(e){let t=Z$.exec(String(e||""));return t?t[1].toLowerCase():null}function Ei(e){return String(e||"").replace(ev,"$1")}function Ws(e){return e.replace(tv,"").trim()}function an(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(sv,"").trim();if(s=s.replace(rv,"").trim(),s===t)break;t=s}return t}var gp,vr,Bs,bp,wp,Q$,Z$,xr,Zt,Ec,ev,wn,Sc,tv,nv,sv,ov,rv,de,Er,iv,yp,Be,en,gs,$p,kc,jc,_c,vp,Sr,Gs,xp,Ep,qs,Wn,Gn,jo,Xe,Sp,Vs,Hs,bs,_n,kp,kr,_o,Si,Ro,jp,qn=O(()=>{gp=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],vr={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",...gp]},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"]}},Bs=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"})}),bp=Object.freeze(Object.fromEntries(Object.entries(Bs).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),wp=Object.freeze(Object.values(Bs).map(e=>e.predicate)),Q$=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),Z$=new RegExp(`^mgx:[a-z]+-(${Q$.join("|")})$`,"i");xr=Object.freeze([...gp,"is the superclass of","are the superclass of","is the parent class of"]),Zt=Object.freeze(["defined","declared","located","implemented"]),Ec=Object.freeze(["now","currently","right now","at the moment","these days","today"]),ev=new RegExp(`\\s+(?:${[...Ec].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");wn=Object.freeze(["mentioned","referenced"]),Sc=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),tv=new RegExp(`\\s+(?:${Sc.join("|")})\\s*[?.!]*$`,"i");nv=Object.freeze(["then","though","too"]),sv=new RegExp(`\\s+(?:${nv.join("|")})\\s*[?.!]*$`,"i"),ov=Object.freeze(["please explain","explain"]),rv=new RegExp(`,\\s*(?:${ov.join("|")})\\s*[?.!]*$`,"i");de=Object.freeze(Object.fromEntries(Object.entries(vr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Er=Object.freeze(new Set(["has","have","holds","hold"])),iv=e=>!xr.includes(e),yp=Object.freeze([...new Set(Object.keys(de).filter(iv).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Be=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"}),en=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),gs=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"}),$p=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"}}),kc=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"}),jc=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"}),_c=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"}),vp=/\b([a-z]{3,})in'/gi,Sr=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"]),Gs=Object.freeze(["this","it","that","here","this one","that one"]),xp=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]}`}]),Ep=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`}]),qs=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),Wn=Object.freeze(["that","which","who"]),Gn=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),jo=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"}),Xe=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}}),Sp=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),Vs=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"]),Hs=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"]),bs=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"}),_n=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"}}),kp=Object.freeze({tests:"Module",test:"Module"}),kr=Object.freeze(["those","them","these"]),_o=Object.freeze(["contains","defines"]),Si=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"]),Ro=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),jp=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 We,To,Rc=O(()=>{We="#000000",To=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${We}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${We}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${We}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${We}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${We}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${We}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${We}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${We}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${We}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${We}" 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="${We}" 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="${We}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var av,cn,_p,Rp,Tc,Tp,oL,rL,Ap=O(()=>{qn();Rc();av=()=>Object.keys(To).sort(),cn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),_p=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Rp=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),Tc=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:Zt}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:cn("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:cn("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:_p("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:Rp("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:Rp("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:av(),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:_p("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:cn("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:cn("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:cn("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:cn("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:cn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:cn("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:cn("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:cn("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:cn("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:cn("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}}]),Tp=Tc.filter(e=>e.tier==="hot"),oL=Tc.filter(e=>e.tier==="cold"),rL=Object.freeze(Tc.map(e=>e.name))});var Ip,Re,Bt=O(()=>{Ue();Ip=Q(".tmct","graph.json"),Re=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function cv(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 Cp(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})=>cv(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(m=>u(m))),Array.isArray(p.mentions)&&(p.mentions=p.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(p)}for(let f of Array.isArray(l.objectProperties)?l.objectProperties:[]){if(!f)continue;let p={...f};Array.isArray(p.examples)&&(p.examples=p.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(p)}let d=l.proseIndex&&typeof l.proseIndex=="object"?l.proseIndex:{};for(let[f,p]of Object.entries(d)){let m=r.proseIndex[f]||(r.proseIndex[f]=[]);for(let h of Array.isArray(p)?p:[]){let g=u(h);m.includes(g)||m.push(g)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Op=O(()=>{});var Io={};Bn(Io,{clearCache:()=>lv,emptyEntities:()=>Ac,fetchEntities:()=>fv,registerProvider:()=>uv});function lv(){Ao=null,jr=null}function uv(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=ki;return ki=e??null,Ao=null,t}function Ac(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function dv(e){let t;try{t=await ze(e,"utf8")}catch(n){if(n?.code==="ENOENT")return Ac();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 pv(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(jr&&jr.key===n)return jr.payload;let s=[];for(let r=0;r<t.length;r++){let i=await dv(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Cp(s);return jr={key:n,payload:o},o}async function fv(e){if(ki){let s;try{s=await ki(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 pv(e);if(Ao&&Ao.file===e.graphFile)return Ao.payload;let t;try{t=await ze(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return Ac();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 Ao={file:e.graphFile,payload:n},n}var Ao,jr,ki,_r=O(()=>{_t();Bt();Op();Ao=null,jr=null,ki=null});function Rn(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<=Lp)}function Ic(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>Lp||mv.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=hv))break;return t}function ji({name:e,doc:t}={}){return[...new Set([...Rn(e),...Ic(t)])].sort()}function Np(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 Ks(e,t,{limit:n=10}={}){let s=[...new Set([...Rn(t),...Ic(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 Pp(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 mv,Lp,hv,ws=O(()=>{mv=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+/)),Lp=40,hv=120});function Mp(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 gv(e){if(!e.startsWith(Dp))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Fp);if(o<0)return null;let r=n.slice(o+Fp.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Dp.length,o),createdAt:s}:null}function Vn(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:wv(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",...Mp(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=gv(s);return o||{kind:"teach",...Mp(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 Gp(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Up;let n=Number(t);return Number.isFinite(n)?Math.max(Cc,Math.min(Wp,n)):Up}function qp(e,t=Date.now(),n=yv){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return zp+(1-zp)*Math.pow(.5,o/n)}function Vp(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let p of o){if(r.has(p))continue;r.add(p);let m=t[p],h=$v(m);if(!h)continue;i.push(h);let g=(Ys[h]??0)*Gp(m);a.push(Math.max(0,Math.min(1,g)))}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=qp(e?.createdAt,s,n.halfLifeMs),d=Co(Math.min(1,l*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Co(u)};return{score:d,inputs:f}}function Ri(e,t){let n=(Ys[e]??0)*Gp(t);return Co(Math.max(0,Math.min(1,n)))}function vv(e){if(e==="operator")return 1;let t=Ys[e];return t===void 0?1:(t+1)/2}function Ti(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=qp(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:Co(l)})}let i=1;for(let[a,l]of o){let c=Math.max(vv(a),l.strongest);i*=1-Math.min(1-l.complement,c)}return{score:s.length?Co(Math.min(1,1-i)):0,inputs:r}}function Hp(e){return Ti(e,{halfLifeMs:xv})}function Kp({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+Ev),i=(o*r+1)/2;return Co(Cc+(Wp-Cc)*i)}var Oo,_i,Je,ys,Fp,Dp,bv,wv,Ys,Oc,Bp,yv,zp,Cc,Wp,Up,Co,$v,xv,Ev,Hn=O(()=>{Oo="mgx:trustScore",_i="mgx:trustInputs",Je="mgx:createdAt",ys="mgx:updatedAt";Fp="#node:",Dp="peer:";bv="wikipedia-live",wv=e=>e===bv?"referenceLive":"reference";Ys=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),Oc=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"}}),Bp=new Set(Object.entries(Oc).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),yv=720*60*60*1e3,zp=.9,Cc=.5,Wp=1.5,Up=1,Co=(e,t=6)=>Number(e.toFixed(t)),$v=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";xv=1/0;Ev=19});var Xs,Lc=O(()=>{Xs=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function Nc(e,t){return Math.log(1+e/(1+t))}var Rr=O(()=>{});var Ii={};Bn(Ii,{bfsLevels:()=>Ai,findActionPath:()=>Pc,findReachableSet:()=>Mc});function Yp(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function Xp(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 Pc(e,t,n,{maxDepth:s=50,stateKey:o=Yp}={}){if(t(e))return{actions:[],states:[e]};let r=Xp(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 Mc(e,t,{maxDepth:n=50,stateKey:s=Yp}={}){let o=Xp(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*Ai(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 Js=O(()=>{});function Oi(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 Li(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function Jn(e){let t=String(e?.prop||"").toLowerCase();if(Jp[t])return Jp[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 Yn(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function Fc(e){let t=Yn(e).split("/");return t[t.length-1]}function Sv(e){return(e?.derived_from||[]).filter(df).length}function Qp(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+Sv(e)}function tn(e,t){let n=Yn(t);if(!n)return{match:null,candidates:[]};let s=Fc(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=Yn(i.label),l=String(i.id||"").toLowerCase(),c=0;a===n||l===n?c=100:a.endsWith(`/${n}`)||o&&(Fc(a)===s||Fc(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||Qp(a.ind)-Qp(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 Rt(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 kv(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 Zp(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function Xn(e){let t=e||"Entity",n=Rn(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 Gc(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${Xn(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(df);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}=kv(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(` ${Zp(l)} (${c.length}) \u2192 ${ut(c.map(u=>u.objectLabel||u.object),ef)}`);for(let{group:l,edges:c}of i)s.push(` \u2190 ${Zp(l)} (${c.length}) by ${ut(c.map(u=>u.subjectLabel||u.subject),ef)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${ut(a,jv)}`),n.length&&s.push(`other matches: ${n.map(l=>`${l.label} (${Xn(l.class)})`).join(", ")}`),e.truncated.length&&s.push(_v(e)),s.join(`
2
- `)}function _v(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 No(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=Jn(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=Kn(e,c.subject),d=Kn(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 Ai(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 pf(e,t,{maxDepth:n=8}={}){let s=No(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>=Rv){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,Dc)){let u=c.tests.length?`tests: ${ut(c.tests,Tv)}`:"tests: none recorded",d=l===0?`${c.via} it`:"reaches it through an intermediary";o.push(` - ${c.label} (${d}) \u2014 ${u}`)}a.length>Dc&&o.push(` \u2026+${a.length-Dc} more at depth ${l+1}`)});let i=e.truncated.filter(a=>{let l=Jn({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 ff(e){let t=new Map;for(let n of e.relations)if(Jn(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 nf(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function wf(e,t,n=null){let s=n||(i=>Kn(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of ke(e,i))r(s(a.subject),s(a.object));return o}function dx(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 m of c.values())u=Math.max(u,m);let d=[...c.entries()].sort((m,h)=>h[1]-m[1]),f=[],p=[];for(let[m,h]of d)h>=u*tx&&f.length<n?f.push([m,h]):p.length<tf&&p.push([m,h]);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<ox&&i.length;c++){let u=new Map,d=[];for(let f of rx){let p=wf(e,f),m=new Map;for(let[b,y]of i)for(let w of p.get(b)||[])o.has(w)&&m.set(w,Math.max(m.get(w)||0,y));let[h,g]=r(m);for(let[b,y]of h)u.set(b,Math.max(u.get(b)||0,y));d.push(...g)}a.push(...d);for(let[f,p]of u){if(l.has(f))continue;let m=s.get(f);m&&(m.score+=Math.min(p*nx,m.score*sx),l.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,tf).filter(([f])=>!l.has(f)))}}function px(e,t=[],{depth:n=hf,q:s=bf,nodeLimit:o=gf,kinds:r=ix,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:l=null,hubDegree:c=1/0}={}){let u=new Map(t.map(E=>[E.ind.id,E])),d=0;for(let E of t)d=Math.max(d,E.score);let f=t.length>0&&d>0,p=new Set(l??u.keys());if(!p.size)return[];let m=wf(e,r,a),h=E=>m.get(E)?.size||0,g=[],b=(E,R)=>E.hop!==R.hop?E.hop<R.hop:E.deg!==R.deg?E.deg<R.deg:E.id<R.id,y=(E,R)=>{let j=g[E];g[E]=g[R],g[R]=j},w=E=>{g.push(E);let R=g.length-1;for(;R>0;){let j=R-1>>1;if(b(g[R],g[j]))y(R,j),R=j;else break}},v=()=>{let E=g[0],R=g.pop();if(g.length){g[0]=R;let j=0;for(;;){let A=2*j+1,F=2*j+2,T=j;if(A<g.length&&b(g[A],g[T])&&(T=A),F<g.length&&b(g[F],g[T])&&(T=F),T===j)break;y(j,T),j=T}}return E},_=new Set(p);for(let E of p)w({id:E,hop:0,deg:h(E)});let $=null,x=0,S=[];for(;g.length&&x<o;){let E=v();if(S.push({id:E.id,hop:E.hop}),!p.has(E.id)){if(f){let A=d*ax*Math.pow(cx,E.hop-1),F=u.get(E.id);if(F)F.score+=Math.min(A*lx,F.score*ux);else{let T=e.byId?.get?.(E.id);if(T&&i(T)){$||($=ff(e));let M=$.get(T.id)||[],z={ind:T,score:A,defineCount:M.length,matching:[],density:0};t.push(z),u.set(E.id,z)}}}x++}if(E.hop>=n||E.hop>0&&h(E.id)>c)continue;let R=[];for(let A of m.get(E.id)||[]){if(_.has(A))continue;let F=e.byId?.get?.(A);!F||!i(F)||R.push({id:A,deg:h(A)})}if(!R.length)continue;R.sort((A,F)=>A.deg-F.deg||(A.id<F.id?-1:A.id>F.id?1:0));let j=Math.max(1,Math.floor(s*R.length));for(let A=0;A<j;A++){let F=R[A];_.add(F.id),w({id:F.id,hop:E.hop+1,deg:F.deg})}}return S}function yf(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=ff(e),m=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let _=String(v.label),$=_.toLowerCase(),x=p.get(v.id)||[],S=new Set(x.map(j=>j.toLowerCase())),E=new Set;for(let j of x)for(let A of nf(j))E.add(A);let R=u?String((v.attributes||[]).find(j=>j.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:v,label:_,labelLc:$,defines:x,symSet:S,symComps:E,dotted:R})}let h=m.length||1,g=new Map,b=v=>{let _=0;for(let $ of m)($.labelLc.includes(v)||$.symComps.has(v)||$.symSet.has(v))&&_++;return _},y=v=>(g.has(v)||g.set(v,Nc(h,b(v))),g.get(v));for(let v of t)y(v);let w=[];for(let v of m){let _=0,$=0,x=0,S=[];for(let F of t){let T=g.get(F)||0;T&&(v.symSet.has(F)?(_+=T*mf,x++):v.symComps.has(F)&&(S.push(T),x++),v.labelLc.includes(F)&&($+=T*Iv))}S.sort((F,T)=>T-F);let E=0;for(let F=0;F<Math.min(S.length,Ov);F++)E+=S[F]*Cv;let R=_+$+E;if(!R)continue;s&&(Xs(v.labelLc)||Mv(v.labelLc))?R*=Pv:Xs(v.labelLc)&&(R*=.4);let j=v.defines.filter(F=>{let T=F.toLowerCase(),M=nf(F);return t.some(z=>T===z||M.has(z))}),A=v.defines.length?x/v.defines.length:0;w.push({ind:v.ind,score:R,defineCount:v.defines.length,matching:j,density:A})}if(u&&d&&w.length){let v=String(d).toLowerCase(),_=E=>E!=null&&/[a-z0-9_./]/.test(E),$=E=>{for(let R=v.indexOf(E);R!==-1;R=v.indexOf(E,R+1))if(!_(v[R-1])&&!_(v[R+E.length]))return!0;return!1},x=new Map(m.map(E=>[E.ind.id,E])),S=0;for(let E of w)S=Math.max(S,E.score);for(let E of w){let R=x.get(E.ind.id);if(!R)continue;let j=0;for(let A of new Set([R.dotted,R.labelLc])){if(!A||A.split(/[./]+/).filter(Boolean).length<Jv||!$(A))continue;let F=[...new Set(A.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((M,z)=>z-M),T=0;for(let M=0;M<Math.min(F.length,Qv);M++)T+=F[M]*Xv;j=Math.max(j,T)}j&&(E.score+=Math.min(j*Zv,S*ex))}}if(w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of ke(e,"imports"))!v.has($.subject)&&!v.has($.object)||(_.has($.subject)||_.set($.subject,new Set),_.has($.object)||_.set($.object,new Set),_.get($.subject).add($.object),_.get($.object).add($.subject));for(let $ of w){let x=0;for(let S of _.get($.ind.id)||[])x=Math.max(x,v.get(S)||0);$.score+=Math.min(x*Lv,$.score*Nv)}}if(o&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of["calls","callsSymbol"])for(let x of ke(e,$)){let S=Kn(e,x.subject),E=Kn(e,x.object);!S||!E||S===E||!v.has(S)&&!v.has(E)||(_.has(S)||_.set(S,new Set),_.has(E)||_.set(E,new Set),_.get(S).add(E),_.get(E).add(S))}for(let $ of w){let x=0;for(let S of _.get($.ind.id)||[])x=Math.max(x,v.get(S)||0);$.score+=Math.min(x*Fv,$.score*Dv)}}if(r&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of e.individuals)($.class||"")==="Class"&&$.label&&_.set(String($.label),$);for(let $ of w){if(!Bv($.ind.label))continue;let x=0;for(let S of ke(e,"inherits")){if(Kn(e,S.subject)!==$.ind.id||!Wv(S.objectLabel))continue;let R=Kn(e,S.object);if(!R){let j=_.get(String(S.objectLabel||""));j&&(R=Tn(e,j))}R&&(x=Math.max(x,v.get(R)||0))}$.score+=Math.min(x*zv,$.score*Uv)}}if(l&&w.length&&e.proseIndex){let v=Ks(e.proseIndex,t.join(" "),{limit:Vv});if(v.length){let _=new Map;for(let{id:$,score:x}of v){let S=Kn(e,$);S&&_.set(S,(_.get(S)||0)+x)}for(let $ of w){let x=_.get($.ind.id)||0;x&&($.score+=Math.min(x*Gv,$.score*qv))}}}if(c&&w.length&&e.proseIndex){let v=new Map(w.map(x=>[x.ind.id,x])),_=new Map(m.map(x=>[x.ind.id,x])),$=new Map;for(let x of new Set(t)){let S=g.get(x)||0;if(!S)continue;let{ids:E}=Pp(e.proseIndex,x);if(!E.length)continue;let R=new Set;for(let j of E){let A=Kn(e,j);if(!A||R.has(A)||(R.add(A),!v.has(A)))continue;let F=_.get(A);F&&(F.symSet.has(x)||F.symComps.has(x)||F.labelLc.includes(x))||$.set(A,($.get(A)||0)+S*Yv)}}for(let x of w){let S=$.get(x.ind.id)||0;S&&(x.score+=Math.min(S*Hv,x.score*Kv))}}return i&&w.length>1&&dx(e,w,f),a&&w.length&&px(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:hf,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:bf,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:gf}),w.sort((v,_)=>_.score-v.score||_.density-v.density||v.defineCount-_.defineCount||String(v.ind.label).length-String(_.ind.label).length),w}function $f(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 yf(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function mx(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 qc(e,{now:t=Date.now}={}){let n=String(e);if(n.length>sf)return{error:`name pattern is ${n.length} characters; the limit is ${sf}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=mx(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>of)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${of}.`};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()+rf;else if(t()>a)throw new Ci(`name pattern "${n}" exceeded its ${rf}ms matching budget.`);return i.test(String(l).slice(0,fx))}}}function vf(e,t,{limit:n=Ni,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 m=qc(r);if(m.error)return m.error;u=m}if(l&&l!=="module")try{return yx(e,a,{limit:n,kind:l,decFilter:c,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof Ci)return m.message;throw m}if(!a.length&&!u&&!c)return"empty query";let d=yf(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let f=d.slice(0,n),p=[`${d.length} module(s) match "${t}" (top ${f.length}):`];for(let{ind:m,defineCount:h,matching:g}of f){let b=g.length?` \u2014 matching: ${ut([...new Set(g)],Av)}`:"";p.push(`- ${m.label} (defines ${h} symbol(s))${b}`)}return p.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),p.join(`
4
- `)}function ke(e,t){let n=af.get(e);n||(n=new Map,af.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Jn(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Kn(e,t){let n=e.byId?.get?.(t);if(n)return Tn(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Tn(e,t){if((t?.class||"")==="Module")return t.id;let n=Rt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Vc(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Lo(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function xf(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${Xn(t.class)} (id: ${t.id})`],o=ke(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=Vc(l?Rt(l):null),u=l?Lo(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,cf)}`),i.length&&s.push(`attributes (${i.length}): ${ut(i,cf)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
- `)}function Ef(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Rt(t),o=[`${t.label} \u2014 ${Xn(t.class)}${Vc(s)}`],r=Pe(t,"params"),i=Pe(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];Pe(t,"isStatic")&&a.push("static"),Pe(t,"isAbstract")&&a.push("abstract"),Pe(t,"isConstant")&&a.push("constant");let l=Pe(t,"visibility");l&&a.push(l),a.length&&o.push(`flags: ${a.join(", ")}`);let c=Lo(t);c&&o.push(`decorators: @${c.split(", ").join(", @")}`);let u=Pe(t,"raises");u&&o.push(`raises: ${u}`);let d=Pe(t,"catches");d&&o.push(`catches: ${d}`);let f=Pe(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=Pe(t,"value");p&&o.push(`value: ${p}`);let m=Pe(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
- `)}function Sf(e,t){let n=ke(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 ${Xn(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${ut(s,lf)}`:"extends: (no internal/recorded base classes)");let i=[];for(let l of Ai(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,lf)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
- `)}function Pi(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 Mi(e,t=""){let n=Yn(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||Yn(s.label).startsWith(n)))}function kf(e,{pkg:t=""}={}){let n=Yn(t),s=Mi(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Pi(s),r=new Map;for(let u of ke(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,gx).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})`),hx)}`),c.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),c.join(`
9
- `)}function _f(e,t){let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Rt(t)?.path||n,o=[...new Set(ke(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,jf,`
1
+ (()=>{var sv=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 Wn=(e,t)=>{for(var n in t)sv(e,n,{get:t[n],enumerable:!0})};var ct,DO,zO,UO,BO,WO,GO,VO,qO,HO,KO,YO,XO,JO,QO,ZO,eL,J,$e,Qt,yp,tL,nL,sL,Ue=O(()=>{ct=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},DO=ct("createRequire"),zO=ct("readFileSync"),UO=ct("access"),BO=ct("readFile"),WO=ct("writeFile"),GO=ct("appendFile"),VO=ct("mkdir"),qO=ct("mkdtemp"),HO=ct("rename"),KO=ct("unlink"),YO=ct("rm"),XO=ct("stat"),JO=ct("copyFile"),QO=ct("readdir"),ZO=ct("createReadStream"),eL=ct("createWriteStream"),J=(...e)=>e.join("/"),$e=e=>String(e).replace(/\/[^/]*$/,""),Qt=(...e)=>e.join("/"),yp="/",tL=ct("randomBytes"),nL=ct("spawnSync"),sL=ct("createInterface")});var lt,rL,iL,kc,ze,$r,ov,_n,rv,Ei,jc,iv,av,aL,cv,cL,lL,uL,dL,pL,_t=O(()=>{lt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},rL=lt("createRequire"),iL=lt("readFileSync"),kc=lt("access"),ze=lt("readFile"),$r=lt("writeFile"),ov=lt("appendFile"),_n=lt("mkdir"),rv=lt("mkdtemp"),Ei=lt("rename"),jc=lt("unlink"),iv=lt("rm"),av=lt("stat"),aL=lt("copyFile"),cv=lt("readdir"),cL=lt("createReadStream"),lL=lt("createWriteStream"),uL=lt("randomBytes"),dL=lt("spawnSync"),pL=lt("createInterface")});function ko(e){let t=uv.exec(String(e||""));return t?t[1].toLowerCase():null}function Si(e){return String(e||"").replace(dv,"$1")}function bs(e){return e.replace(pv,"").trim()}function en(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(hv,"").trim();if(s=s.replace(gv,"").trim(),s===t)break;t=s}return t}var $p,vr,Gs,vp,xp,lv,uv,xr,Zt,_c,dv,yn,Rc,pv,fv,hv,mv,gv,de,Er,ki,bv,Ep,Be,tn,ws,Sp,Tc,Ac,Ic,kp,Sr,Vs,jp,_p,qs,Gn,Vn,jo,Xe,Rp,Hs,Ks,ys,Rn,Tp,kr,_o,ji,Ro,Ap,qn=O(()=>{$p=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],vr={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",...$p]},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"]}},Gs=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"})}),vp=Object.freeze(Object.fromEntries(Object.entries(Gs).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),xp=Object.freeze(Object.values(Gs).map(e=>e.predicate)),lv=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),uv=new RegExp(`^mgx:[a-z]+-(${lv.join("|")})$`,"i");xr=Object.freeze([...$p,"is the superclass of","are the superclass of","is the parent class of"]),Zt=Object.freeze(["defined","declared","located","implemented"]),_c=Object.freeze(["now","currently","right now","at the moment","these days","today"]),dv=new RegExp(`\\s+(?:${[..._c].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");yn=Object.freeze(["mentioned","referenced"]),Rc=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),pv=new RegExp(`\\s+(?:${Rc.join("|")})\\s*[?.!]*$`,"i");fv=Object.freeze(["then","though","too"]),hv=new RegExp(`\\s+(?:${fv.join("|")})\\s*[?.!]*$`,"i"),mv=Object.freeze(["please explain","explain"]),gv=new RegExp(`,\\s*(?:${mv.join("|")})\\s*[?.!]*$`,"i");de=Object.freeze(Object.fromEntries(Object.entries(vr).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),Er=Object.freeze(new Set(["has","have","holds","hold"])),ki=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),bv=e=>!xr.includes(e),Ep=Object.freeze([...new Set(Object.keys(de).filter(bv).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),Be=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"}),tn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),ws=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"}),Sp=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"}}),Tc=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"}),Ac=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"}),Ic=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"}),kp=/\b([a-z]{3,})in'/gi,Sr=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"]),Vs=Object.freeze(["this","it","that","here","this one","that one"]),jp=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]}`}]),_p=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`}]),qs=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),Gn=Object.freeze(["that","which","who"]),Vn=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),jo=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"}),Xe=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}}),Rp=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),Hs=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"]),Ks=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"]),ys=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"}),Rn=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"}}),Tp=Object.freeze({tests:"Module",test:"Module"}),kr=Object.freeze(["those","them","these"]),_o=Object.freeze(["contains","defines"]),ji=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"]),Ro=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Ap=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 We,To,Cc=O(()=>{We="#000000",To=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${We}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${We}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${We}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${We}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${We}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${We}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${We}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${We}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${We}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${We}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${We}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${We}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${We}" 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="${We}" 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="${We}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var wv,ln,Ip,Cp,Oc,Op,wL,yL,Lp=O(()=>{qn();Cc();wv=()=>Object.keys(To).sort(),ln=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Ip=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Cp=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),Oc=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:Zt}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:ln("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:ln("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:Ip("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:Cp("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:Cp("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:wv(),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:Ip("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:ln("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:ln("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:ln("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:ln("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:ln("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:ln("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:ln("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:ln("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:ln("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:ln("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}}]),Op=Oc.filter(e=>e.tier==="hot"),wL=Oc.filter(e=>e.tier==="cold"),yL=Object.freeze(Oc.map(e=>e.name))});var Np,_e,Ut=O(()=>{Ue();Np=J(".tmct","graph.json"),_e=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function yv(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 Pp(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})=>yv(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 g=u(m);h.includes(g)||h.push(g)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Mp=O(()=>{});var Io={};Wn(Io,{clearCache:()=>$v,emptyEntities:()=>Lc,fetchEntities:()=>Sv,registerProvider:()=>vv});function $v(){Ao=null,jr=null}function vv(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=_i;return _i=e??null,Ao=null,t}function Lc(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function xv(e){let t;try{t=await ze(e,"utf8")}catch(n){if(n?.code==="ENOENT")return Lc();throw new _e(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new _e(`graph artifact ${e} is not valid JSON`)}}async function Ev(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(jr&&jr.key===n)return jr.payload;let s=[];for(let r=0;r<t.length;r++){let i=await xv(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Pp(s);return jr={key:n,payload:o},o}async function Sv(e){if(_i){let s;try{s=await _i(e)}catch(o){throw o instanceof _e?o:new _e(`graph provider failed (${o?.message||o})`)}if(!s||typeof s!="object")throw new _e("graph provider returned no entities payload");return s}if(Array.isArray(e.graphFiles)&&e.graphFiles.length>1)return Ev(e);if(Ao&&Ao.file===e.graphFile)return Ao.payload;let t;try{t=await ze(e.graphFile,"utf8")}catch(s){if(s?.code==="ENOENT")return Lc();throw new _e(`cannot read graph artifact at ${e.graphFile} (${s?.code||s?.message||s})`)}let n;try{n=JSON.parse(t)}catch{throw new _e(`graph artifact ${e.graphFile} is not valid JSON`)}return Ao={file:e.graphFile,payload:n},n}var Ao,jr,_i,_r=O(()=>{_t();Ut();Mp();Ao=null,jr=null,_i=null});function Tn(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<=Fp)}function Nc(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>Fp||kv.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=jv))break;return t}function Ri({name:e,doc:t}={}){return[...new Set([...Tn(e),...Nc(t)])].sort()}function Dp(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 Ys(e,t,{limit:n=10}={}){let s=[...new Set([...Tn(t),...Nc(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 zp(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 kv,Fp,jv,$s=O(()=>{kv=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+/)),Fp=40,jv=120});function Up(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 _v(e){if(!e.startsWith(Wp))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Bp);if(o<0)return null;let r=n.slice(o+Bp.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Wp.length,o),createdAt:s}:null}function Hn(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:Tv(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",...Up(n.slice(4))};if(n.startsWith("teach:")){let s=n.slice(6),o=_v(s);return o||{kind:"teach",...Up(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 Kp(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Vp;let n=Number(t);return Number.isFinite(n)?Math.max(Pc,Math.min(Hp,n)):Vp}function Yp(e,t=Date.now(),n=Av){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Gp+(1-Gp)*Math.pow(.5,o/n)}function Xp(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=Iv(h);if(!m)continue;i.push(m);let g=(Xs[m]??0)*Kp(h);a.push(Math.max(0,Math.min(1,g)))}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=Yp(e?.createdAt,s,n.halfLifeMs),d=Co(Math.min(1,l*u)),f={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Co(u)};return{score:d,inputs:f}}function Ai(e,t){let n=(Xs[e]??0)*Kp(t);return Co(Math.max(0,Math.min(1,n)))}function Cv(e){if(e==="operator")return 1;let t=Xs[e];return t===void 0?1:(t+1)/2}function Ii(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=Yp(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:Co(l)})}let i=1;for(let[a,l]of o){let c=Math.max(Cv(a),l.strongest);i*=1-Math.min(1-l.complement,c)}return{score:s.length?Co(Math.min(1,1-i)):0,inputs:r}}function Jp(e){return Ii(e,{halfLifeMs:Ov})}function Qp({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+Lv),i=(o*r+1)/2;return Co(Pc+(Hp-Pc)*i)}var Oo,Ti,Je,vs,Bp,Wp,Rv,Tv,Xs,Mc,qp,Av,Gp,Pc,Hp,Vp,Co,Iv,Ov,Lv,Kn=O(()=>{Oo="mgx:trustScore",Ti="mgx:trustInputs",Je="mgx:createdAt",vs="mgx:updatedAt";Bp="#node:",Wp="peer:";Rv="wikipedia-live",Tv=e=>e===Rv?"referenceLive":"reference";Xs=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),Mc=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"}}),qp=new Set(Object.entries(Mc).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),Av=720*60*60*1e3,Gp=.9,Pc=.5,Hp=1.5,Vp=1,Co=(e,t=6)=>Number(e.toFixed(t)),Iv=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";Ov=1/0;Lv=19});var Js,Fc=O(()=>{Js=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function Dc(e,t){return Math.log(1+e/(1+t))}var Rr=O(()=>{});var Oi={};Wn(Oi,{bfsLevels:()=>Ci,findActionPath:()=>zc,findReachableSet:()=>Uc});function Zp(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function ef(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 zc(e,t,n,{maxDepth:s=50,stateKey:o=Zp}={}){if(t(e))return{actions:[],states:[e]};let r=ef(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 Uc(e,t,{maxDepth:n=50,stateKey:s=Zp}={}){let o=ef(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*Ci(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 Qs=O(()=>{});function Ni(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 Pi(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function Qn(e){let t=String(e?.prop||"").toLowerCase();if(tf[t])return tf[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 Xn(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function Bc(e){let t=Xn(e).split("/");return t[t.length-1]}function Nv(e){return(e?.derived_from||[]).filter(mf).length}function nf(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+Nv(e)}function nn(e,t){let n=Xn(t);if(!n)return{match:null,candidates:[]};let s=Bc(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=Xn(i.label),l=String(i.id||"").toLowerCase(),c=0;a===n||l===n?c=100:a.endsWith(`/${n}`)||o&&(Bc(a)===s||Bc(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||nf(a.ind)-nf(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 Rt(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 Pv(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 sf(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function Jn(e){let t=e||"Entity",n=Tn(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 Kc(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${Jn(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(mf);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}=Pv(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(` ${sf(l)} (${c.length}) \u2192 ${ut(c.map(u=>u.objectLabel||u.object),of)}`);for(let{group:l,edges:c}of i)s.push(` \u2190 ${sf(l)} (${c.length}) by ${ut(c.map(u=>u.subjectLabel||u.subject),of)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${ut(a,Mv)}`),n.length&&s.push(`other matches: ${n.map(l=>`${l.label} (${Jn(l.class)})`).join(", ")}`),e.truncated.length&&s.push(Fv(e)),s.join(`
2
+ `)}function Fv(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 No(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=Qn(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=Yn(e,c.subject),d=Yn(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 Ci(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 gf(e,t,{maxDepth:n=8}={}){let s=No(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>=Dv){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,Wc)){let u=c.tests.length?`tests: ${ut(c.tests,zv)}`:"tests: none recorded",d=l===0?`${c.via} it`:"reaches it through an intermediary";o.push(` - ${c.label} (${d}) \u2014 ${u}`)}a.length>Wc&&o.push(` \u2026+${a.length-Wc} more at depth ${l+1}`)});let i=e.truncated.filter(a=>{let l=Qn({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 bf(e){let t=new Map;for(let n of e.relations)if(Qn(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 af(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function xf(e,t,n=null){let s=n||(i=>Yn(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 Ee(e,i))r(s(a.subject),s(a.object));return o}function xx(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*px&&f.length<n?f.push([h,m]):p.length<rf&&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<mx&&i.length;c++){let u=new Map,d=[];for(let f of gx){let p=xf(e,f),h=new Map;for(let[b,y]of i)for(let w of p.get(b)||[])o.has(w)&&h.set(w,Math.max(h.get(w)||0,y));let[m,g]=r(h);for(let[b,y]of m)u.set(b,Math.max(u.get(b)||0,y));d.push(...g)}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*fx,h.score*hx),l.add(f))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,rf).filter(([f])=>!l.has(f)))}}function Ex(e,t=[],{depth:n=yf,q:s=vf,nodeLimit:o=$f,kinds:r=bx,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:l=null,hubDegree:c=1/0}={}){let u=new Map(t.map(E=>[E.ind.id,E])),d=0;for(let E of t)d=Math.max(d,E.score);let f=t.length>0&&d>0,p=new Set(l??u.keys());if(!p.size)return[];let h=xf(e,r,a),m=E=>h.get(E)?.size||0,g=[],b=(E,R)=>E.hop!==R.hop?E.hop<R.hop:E.deg!==R.deg?E.deg<R.deg:E.id<R.id,y=(E,R)=>{let j=g[E];g[E]=g[R],g[R]=j},w=E=>{g.push(E);let R=g.length-1;for(;R>0;){let j=R-1>>1;if(b(g[R],g[j]))y(R,j),R=j;else break}},v=()=>{let E=g[0],R=g.pop();if(g.length){g[0]=R;let j=0;for(;;){let A=2*j+1,F=2*j+2,T=j;if(A<g.length&&b(g[A],g[T])&&(T=A),F<g.length&&b(g[F],g[T])&&(T=F),T===j)break;y(j,T),j=T}}return E},_=new Set(p);for(let E of p)w({id:E,hop:0,deg:m(E)});let $=null,x=0,S=[];for(;g.length&&x<o;){let E=v();if(S.push({id:E.id,hop:E.hop}),!p.has(E.id)){if(f){let A=d*wx*Math.pow(yx,E.hop-1),F=u.get(E.id);if(F)F.score+=Math.min(A*$x,F.score*vx);else{let T=e.byId?.get?.(E.id);if(T&&i(T)){$||($=bf(e));let M=$.get(T.id)||[],z={ind:T,score:A,defineCount:M.length,matching:[],density:0};t.push(z),u.set(E.id,z)}}}x++}if(E.hop>=n||E.hop>0&&m(E.id)>c)continue;let R=[];for(let A of h.get(E.id)||[]){if(_.has(A))continue;let F=e.byId?.get?.(A);!F||!i(F)||R.push({id:A,deg:m(A)})}if(!R.length)continue;R.sort((A,F)=>A.deg-F.deg||(A.id<F.id?-1:A.id>F.id?1:0));let j=Math.max(1,Math.floor(s*R.length));for(let A=0;A<j;A++){let F=R[A];_.add(F.id),w({id:F.id,hop:E.hop+1,deg:F.deg})}}return S}function Ef(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=bf(e),h=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let _=String(v.label),$=_.toLowerCase(),x=p.get(v.id)||[],S=new Set(x.map(j=>j.toLowerCase())),E=new Set;for(let j of x)for(let A of af(j))E.add(A);let R=u?String((v.attributes||[]).find(j=>j.key==="dotted")?.value||"").toLowerCase():"";h.push({ind:v,label:_,labelLc:$,defines:x,symSet:S,symComps:E,dotted:R})}let m=h.length||1,g=new Map,b=v=>{let _=0;for(let $ of h)($.labelLc.includes(v)||$.symComps.has(v)||$.symSet.has(v))&&_++;return _},y=v=>(g.has(v)||g.set(v,Dc(m,b(v))),g.get(v));for(let v of t)y(v);let w=[];for(let v of h){let _=0,$=0,x=0,S=[];for(let F of t){let T=g.get(F)||0;T&&(v.symSet.has(F)?(_+=T*wf,x++):v.symComps.has(F)&&(S.push(T),x++),v.labelLc.includes(F)&&($+=T*Bv))}S.sort((F,T)=>T-F);let E=0;for(let F=0;F<Math.min(S.length,Gv);F++)E+=S[F]*Wv;let R=_+$+E;if(!R)continue;s&&(Js(v.labelLc)||Kv(v.labelLc))?R*=Hv:Js(v.labelLc)&&(R*=.4);let j=v.defines.filter(F=>{let T=F.toLowerCase(),M=af(F);return t.some(z=>T===z||M.has(z))}),A=v.defines.length?x/v.defines.length:0;w.push({ind:v.ind,score:R,defineCount:v.defines.length,matching:j,density:A})}if(u&&d&&w.length){let v=String(d).toLowerCase(),_=E=>E!=null&&/[a-z0-9_./]/.test(E),$=E=>{for(let R=v.indexOf(E);R!==-1;R=v.indexOf(E,R+1))if(!_(v[R-1])&&!_(v[R+E.length]))return!0;return!1},x=new Map(h.map(E=>[E.ind.id,E])),S=0;for(let E of w)S=Math.max(S,E.score);for(let E of w){let R=x.get(E.ind.id);if(!R)continue;let j=0;for(let A of new Set([R.dotted,R.labelLc])){if(!A||A.split(/[./]+/).filter(Boolean).length<cx||!$(A))continue;let F=[...new Set(A.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((M,z)=>z-M),T=0;for(let M=0;M<Math.min(F.length,lx);M++)T+=F[M]*ax;j=Math.max(j,T)}j&&(E.score+=Math.min(j*ux,S*dx))}}if(w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of Ee(e,"imports"))!v.has($.subject)&&!v.has($.object)||(_.has($.subject)||_.set($.subject,new Set),_.has($.object)||_.set($.object,new Set),_.get($.subject).add($.object),_.get($.object).add($.subject));for(let $ of w){let x=0;for(let S of _.get($.ind.id)||[])x=Math.max(x,v.get(S)||0);$.score+=Math.min(x*Vv,$.score*qv)}}if(o&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of["calls","callsSymbol"])for(let x of Ee(e,$)){let S=Yn(e,x.subject),E=Yn(e,x.object);!S||!E||S===E||!v.has(S)&&!v.has(E)||(_.has(S)||_.set(S,new Set),_.has(E)||_.set(E,new Set),_.get(S).add(E),_.get(E).add(S))}for(let $ of w){let x=0;for(let S of _.get($.ind.id)||[])x=Math.max(x,v.get(S)||0);$.score+=Math.min(x*Yv,$.score*Xv)}}if(r&&w.length>1){let v=new Map(w.map($=>[$.ind.id,$.score])),_=new Map;for(let $ of e.individuals)($.class||"")==="Class"&&$.label&&_.set(String($.label),$);for(let $ of w){if(!Zv($.ind.label))continue;let x=0;for(let S of Ee(e,"inherits")){if(Yn(e,S.subject)!==$.ind.id||!ex(S.objectLabel))continue;let R=Yn(e,S.object);if(!R){let j=_.get(String(S.objectLabel||""));j&&(R=An(e,j))}R&&(x=Math.max(x,v.get(R)||0))}$.score+=Math.min(x*Jv,$.score*Qv)}}if(l&&w.length&&e.proseIndex){let v=Ys(e.proseIndex,t.join(" "),{limit:sx});if(v.length){let _=new Map;for(let{id:$,score:x}of v){let S=Yn(e,$);S&&_.set(S,(_.get(S)||0)+x)}for(let $ of w){let x=_.get($.ind.id)||0;x&&($.score+=Math.min(x*tx,$.score*nx))}}}if(c&&w.length&&e.proseIndex){let v=new Map(w.map(x=>[x.ind.id,x])),_=new Map(h.map(x=>[x.ind.id,x])),$=new Map;for(let x of new Set(t)){let S=g.get(x)||0;if(!S)continue;let{ids:E}=zp(e.proseIndex,x);if(!E.length)continue;let R=new Set;for(let j of E){let A=Yn(e,j);if(!A||R.has(A)||(R.add(A),!v.has(A)))continue;let F=_.get(A);F&&(F.symSet.has(x)||F.symComps.has(x)||F.labelLc.includes(x))||$.set(A,($.get(A)||0)+S*ix)}}for(let x of w){let S=$.get(x.ind.id)||0;S&&(x.score+=Math.min(S*ox,x.score*rx))}}return i&&w.length>1&&xx(e,w,f),a&&w.length&&Ex(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:yf,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:vf,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:$f}),w.sort((v,_)=>_.score-v.score||_.density-v.density||v.defineCount-_.defineCount||String(v.ind.label).length-String(_.ind.label).length),w}function Sf(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 Ef(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function kx(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 Yc(e,{now:t=Date.now}={}){let n=String(e);if(n.length>cf)return{error:`name pattern is ${n.length} characters; the limit is ${cf}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=kx(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>lf)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${lf}.`};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()+uf;else if(t()>a)throw new Li(`name pattern "${n}" exceeded its ${uf}ms matching budget.`);return i.test(String(l).slice(0,Sx))}}}function kf(e,t,{limit:n=Mi,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=Yc(r);if(h.error)return h.error;u=h}if(l&&l!=="module")try{return Ax(e,a,{limit:n,kind:l,decFilter:c,nameRe:u,toolNamePrefix:i})}catch(h){if(h instanceof Li)return h.message;throw h}if(!a.length&&!u&&!c)return"empty query";let d=Ef(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:g}of f){let b=g.length?` \u2014 matching: ${ut([...new Set(g)],Uv)}`:"";p.push(`- ${h.label} (defines ${m} symbol(s))${b}`)}return p.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),p.join(`
4
+ `)}function Ee(e,t){let n=df.get(e);n||(n=new Map,df.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Qn(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Yn(e,t){let n=e.byId?.get?.(t);if(n)return An(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function An(e,t){if((t?.class||"")==="Module")return t.id;let n=Rt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Xc(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Lo(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function jf(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${Jn(t.class)} (id: ${t.id})`],o=Ee(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=Xc(l?Rt(l):null),u=l?Lo(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,pf)}`),i.length&&s.push(`attributes (${i.length}): ${ut(i,pf)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
+ `)}function _f(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Rt(t),o=[`${t.label} \u2014 ${Jn(t.class)}${Xc(s)}`],r=Pe(t,"params"),i=Pe(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];Pe(t,"isStatic")&&a.push("static"),Pe(t,"isAbstract")&&a.push("abstract"),Pe(t,"isConstant")&&a.push("constant");let l=Pe(t,"visibility");l&&a.push(l),a.length&&o.push(`flags: ${a.join(", ")}`);let c=Lo(t);c&&o.push(`decorators: @${c.split(", ").join(", @")}`);let u=Pe(t,"raises");u&&o.push(`raises: ${u}`);let d=Pe(t,"catches");d&&o.push(`catches: ${d}`);let f=Pe(t,"self_fields");f&&o.push(`self fields: ${f}`);let p=Pe(t,"value");p&&o.push(`value: ${p}`);let h=Pe(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 Rf(e,t){let n=Ee(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 ${Jn(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${ut(s,ff)}`:"extends: (no internal/recorded base classes)");let i=[];for(let l of Ci(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,ff)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
+ `)}function Fi(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 Di(e,t=""){let n=Xn(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||Xn(s.label).startsWith(n)))}function Tf(e,{pkg:t=""}={}){let n=Xn(t),s=Di(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=Fi(s),r=new Map;for(let u of Ee(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,_x).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})`),jx)}`),c.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),c.join(`
9
+ `)}function If(e,t){let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Rt(t)?.path||n,o=[...new Set(Ee(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,Af,`
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
- ${bx}`}function Rf(e){let t=new Set,n=new Set;for(let r of ke(e,"tests"))t.add(r.object),n.add(r.subject);let s=e.individuals.filter(r=>(r.class||"")==="Module"&&!n.has(r.id)&&!Xs(String(r.label).toLowerCase()));if(!s.length)return Li(e)===0?`no modules to check for test coverage in this index. ${Wc}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.";let o=s.filter(r=>!t.has(r.id)).map(r=>r.label).sort();return o.length?`${o.length} source module(s) with no covering test module:
13
- ${ut(o,jf,`
14
- `)}`:"every source module has at least one covering test module."}function Tf(e,t){let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=ke(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,Wt)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function If(e,t,{toolNamePrefix:n="tmct_"}={}){if(Af.has(t.class)){let i=[...new Set(ke(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):
12
+ ${Rx}`}function Cf(e){let t=new Set,n=new Set;for(let r of Ee(e,"tests"))t.add(r.object),n.add(r.subject);let s=e.individuals.filter(r=>(r.class||"")==="Module"&&!n.has(r.id)&&!Js(String(r.label).toLowerCase()));if(!s.length)return Pi(e)===0?`no modules to check for test coverage in this index. ${Hc}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.";let o=s.filter(r=>!t.has(r.id)).map(r=>r.label).sort();return o.length?`${o.length} source module(s) with no covering test module:
13
+ ${ut(o,Af,`
14
+ `)}`:"every source module has at least one covering test module."}function Of(e,t){let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Ee(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,Bt)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Nf(e,t,{toolNamePrefix:n="tmct_"}={}){if(Lf.has(t.class)){let i=[...new Set(Ee(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
15
15
  ${ut(i,Tr,`
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=Tn(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(ke(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
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=An(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(Ee(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
17
  ${ut(r,Tr,`
18
- `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function Cf(e,t){if(Af.has(t.class)){let r=[...new Set(ke(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):
18
+ `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function Pf(e,t){if(Lf.has(t.class)){let r=[...new Set(Ee(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
19
  ${ut(r,Tr,`
20
- `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(ke(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
20
+ `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(Ee(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
21
21
  ${ut(o,Tr,`
22
- `)}`:`${s}: no recorded callees.`}function Of(e,t){let n=e.byId.get(t.object),s=n?Rt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function Hc(e,t){if(!t?.id)return"";let n=ke(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${ut(n.map(s=>Of(e,s)),wx)}`:""}function Lf(e,t){let n=ke(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${Xn(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=>Of(e,o));return`${t.label} \u2014 ${Xn(t.class)} calls ${n.length} in-repo symbol(s):
22
+ `)}`:`${s}: no recorded callees.`}function Mf(e,t){let n=e.byId.get(t.object),s=n?Rt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function Jc(e,t){if(!t?.id)return"";let n=Ee(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${ut(n.map(s=>Mf(e,s)),Tx)}`:""}function Ff(e,t){let n=Ee(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${Jn(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=>Mf(e,o));return`${t.label} \u2014 ${Jn(t.class)} calls ${n.length} in-repo symbol(s):
23
23
  ${ut(s,Tr,`
24
- `)}`}function Nf(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=Pe(s,"commitDate")||Pe(s,"date"),i=Pe(s,"commitAuthor")||Pe(s,"author"),a=Pe(s,"commitMessage")||Pe(s,"message"),l=[o,r,i].filter(Boolean).join(" ");return a?`${l} \u2014 ${a}`:l}function Pf(e,t){let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=ke(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,Wt).map(a=>` ${Nf(e,a.subject,a.subjectLabel)}`),i=o.length>Wt?`
25
- \u2026+${o.length-Wt} more`:"";return`${s}: touched by ${o.length} recent commit(s):
24
+ `)}`}function Df(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=Pe(s,"commitDate")||Pe(s,"date"),i=Pe(s,"commitAuthor")||Pe(s,"author"),a=Pe(s,"commitMessage")||Pe(s,"message"),l=[o,r,i].filter(Boolean).join(" ");return a?`${l} \u2014 ${a}`:l}function zf(e,t){let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Ee(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,Bt).map(a=>` ${Df(e,a.subject,a.subjectLabel)}`),i=o.length>Bt?`
25
+ \u2026+${o.length-Bt} more`:"";return`${s}: touched by ${o.length} recent commit(s):
26
26
  ${r.join(`
27
- `)}${i}`}function Mf(e,t){let n=ke(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${Xn(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,Wt).map(r=>` ${Nf(e,r.subject,r.subjectLabel)}`),o=n.length>Wt?`
28
- \u2026+${n.length-Wt} more`:"";return`${t.label} \u2014 ${Xn(t.class)}: touched by ${n.length} commit(s):
27
+ `)}${i}`}function Uf(e,t){let n=Ee(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${Jn(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,Bt).map(r=>` ${Df(e,r.subject,r.subjectLabel)}`),o=n.length>Bt?`
28
+ \u2026+${n.length-Bt} more`:"";return`${t.label} \u2014 ${Jn(t.class)}: touched by ${n.length} commit(s):
29
29
  ${s.join(`
30
- `)}${o}`}function Ff(e,t){return Mf(e,t)}function Df(e,t){return Mf(e,t)}function Kc(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=zf[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Lo(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 yx(e,t,{limit:n=Ni,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!zf[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let l=Kc(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}${Vc(Rt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
- `)}function Tx(e){return{paramCount:Fi(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function Ax(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>Fi(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:Rx(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function Ix(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(Fi(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 Cx(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of zc(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(zc(t)),c=l.size?l:new Set(i?[i]:[]),u=new Set(uf(n)),d=s?.start??null;for(let f of e){let p=zc(f.decorators).some(b=>c.has(b))?1:0,m=uf(f.label).filter(b=>u.has(b)).length,h=Ix(f,o),g=d!=null&&f.site?1/(1+Math.abs(f.site.start-d)):0;f._score=p*1e3+m*50+h+g}return[...e].sort((f,p)=>p._score-f._score||(f.site?.start||0)-(p.site?.start||0))}function Po(e,t){let n=Tn(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=ke(e,"defines").filter(j=>j.subject===n),r=new Map;for(let j of ke(e,"callsSymbol"))r.has(j.subject)||r.set(j.subject,new Set),r.get(j.subject).add(j.object);let i=[],a=[],l=0;for(let j of o){let A=e.byId.get(j.object);if(!A)continue;let F=A.class||"",T=Rt(A);F==="GlobalVariable"?(a.push({label:A.label,value:(A.attributes||[]).find(M=>M.key==="value")?.value||"",site:T}),T&&(l=Math.max(l,T.end))):(F==="Function"||F==="Class")&&(i.push({id:A.id,label:A.label,class:F,site:T,decorators:Lo(A),raises:Pe(A,"raises"),doc:Pe(A,"doc"),params:Pe(A,"params"),returns:Pe(A,"returns"),callees:r.get(A.id)||new Set}),T&&(l=Math.max(l,T.end)))}let c=Rt(t),u=c&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:c,decorators:Lo(t),raises:Pe(t,"raises"),params:Pe(t,"params"),returns:Pe(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?Tx(u):Ax(i);i=Cx(i,u||{label:t.label},f);let p=u?null:i.find(j=>j.site&&j.label!==t.label)||null,m=[...new Set(ke(e,"tests").filter(j=>j.object===n).map(j=>j.subjectLabel||j.subject))].slice(0,Ex),h=Gf(e,n).slice(0,xx),g=ke(e,"reexports").filter(j=>j.subject===n).map(j=>j.objectLabel||j.object).slice(0,20),b=Pe(e.byId.get(n),"all"),y=ke(e,"contains"),w=null;(t.class||"")==="Class"?w=t.id:(t.class||"")==="Method"&&(w=y.find(j=>j.object===t.id)?.subject||null);let v=null;if(w){let j=e.byId.get(w),A=y.filter(F=>F.subject===w).map(F=>{let T=e.byId.get(F.object);return{label:F.objectLabel||T?.label||F.object,class:T?.class||"",site:T?Rt(T):null,decorators:T?Lo(T):"",params:T?Pe(T,"params"):"",returns:T?Pe(T,"returns"):"",raises:T?Pe(T,"raises"):""}}).slice(0,vx);v={className:j?.label||String(w).replace(/^fn:.*#/,""),members:A,total:y.filter(F=>F.subject===w).length}}let _=null;for(let j of[...i,...a])j.site&&(!_||j.site.start>_.start)&&(_=j.site);let $=_?{start:_.start,end:_.end}:null,x=u||p,S=x?.id?e.byId.get(x.id):null,E=S?Hc(e,S):"",R=[];if(x?.callees)for(let j of x.callees){let A=e.byId.get(j),F=A?Rt(A):null;if(F&&R.push({label:A.label,site:F}),R.length>=_x)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:p,globals:a,tests:m,cochange:h,exports:g,allExports:b,classMembers:v,insertion:l,insertionRegion:$,calleeBodies:R,callHint:E,siblingCap:$x}}function Qs(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 Uf(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 Di(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=Fi(s.params);(i>Sx||a>kx||s.raises)&&(o="MID");let l=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),f=d?Rt(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)>=jx;(l||c)&&(o="LARGE")}else o="MID";return{tier:o,mask:Qs(o),topup:o!=="TINY"}}function Bf(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 Bf(e,t){return Uf(e,t)}function Wf(e,t){return Uf(e,t)}function Qc(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Gf[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Lo(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 Ax(e,t,{limit:n=Mi,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Gf[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let l=Qc(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}${Xc(Rt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
+ `)}function zx(e){return{paramCount:zi(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function Ux(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>zi(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:Dx(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function Bx(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(zi(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 Wx(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let f of e)for(let p of Gc(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(Gc(t)),c=l.size?l:new Set(i?[i]:[]),u=new Set(hf(n)),d=s?.start??null;for(let f of e){let p=Gc(f.decorators).some(b=>c.has(b))?1:0,h=hf(f.label).filter(b=>u.has(b)).length,m=Bx(f,o),g=d!=null&&f.site?1/(1+Math.abs(f.site.start-d)):0;f._score=p*1e3+h*50+m+g}return[...e].sort((f,p)=>p._score-f._score||(f.site?.start||0)-(p.site?.start||0))}function Po(e,t){let n=An(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Ee(e,"defines").filter(j=>j.subject===n),r=new Map;for(let j of Ee(e,"callsSymbol"))r.has(j.subject)||r.set(j.subject,new Set),r.get(j.subject).add(j.object);let i=[],a=[],l=0;for(let j of o){let A=e.byId.get(j.object);if(!A)continue;let F=A.class||"",T=Rt(A);F==="GlobalVariable"?(a.push({label:A.label,value:(A.attributes||[]).find(M=>M.key==="value")?.value||"",site:T}),T&&(l=Math.max(l,T.end))):(F==="Function"||F==="Class")&&(i.push({id:A.id,label:A.label,class:F,site:T,decorators:Lo(A),raises:Pe(A,"raises"),doc:Pe(A,"doc"),params:Pe(A,"params"),returns:Pe(A,"returns"),callees:r.get(A.id)||new Set}),T&&(l=Math.max(l,T.end)))}let c=Rt(t),u=c&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:c,decorators:Lo(t),raises:Pe(t,"raises"),params:Pe(t,"params"),returns:Pe(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,f=u?zx(u):Ux(i);i=Wx(i,u||{label:t.label},f);let p=u?null:i.find(j=>j.site&&j.label!==t.label)||null,h=[...new Set(Ee(e,"tests").filter(j=>j.object===n).map(j=>j.subjectLabel||j.subject))].slice(0,Lx),m=Kf(e,n).slice(0,Ox),g=Ee(e,"reexports").filter(j=>j.subject===n).map(j=>j.objectLabel||j.object).slice(0,20),b=Pe(e.byId.get(n),"all"),y=Ee(e,"contains"),w=null;(t.class||"")==="Class"?w=t.id:(t.class||"")==="Method"&&(w=y.find(j=>j.object===t.id)?.subject||null);let v=null;if(w){let j=e.byId.get(w),A=y.filter(F=>F.subject===w).map(F=>{let T=e.byId.get(F.object);return{label:F.objectLabel||T?.label||F.object,class:T?.class||"",site:T?Rt(T):null,decorators:T?Lo(T):"",params:T?Pe(T,"params"):"",returns:T?Pe(T,"returns"):"",raises:T?Pe(T,"raises"):""}}).slice(0,Cx);v={className:j?.label||String(w).replace(/^fn:.*#/,""),members:A,total:y.filter(F=>F.subject===w).length}}let _=null;for(let j of[...i,...a])j.site&&(!_||j.site.start>_.start)&&(_=j.site);let $=_?{start:_.start,end:_.end}:null,x=u||p,S=x?.id?e.byId.get(x.id):null,E=S?Jc(e,S):"",R=[];if(x?.callees)for(let j of x.callees){let A=e.byId.get(j),F=A?Rt(A):null;if(F&&R.push({label:A.label,site:F}),R.length>=Fx)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:p,globals:a,tests:h,cochange:m,exports:g,allExports:b,classMembers:v,insertion:l,insertionRegion:$,calleeBodies:R,callHint:E,siblingCap:Ix}}function Zs(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 Vf(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 Ui(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=zi(s.params);(i>Nx||a>Px||s.raises)&&(o="MID");let l=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),f=d?Rt(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)>=Mx;(l||c)&&(o="LARGE")}else o="MID";return{tier:o,mask:Zs(o),topup:o!=="TINY"}}function qf(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 Wf(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 Hf(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
39
39
  ## registration / module globals (replicate this pattern):`);for(let s of e.globals)n.push(` ${s.label} = ${s.value}${s.site?` [:${s.site.start}]`:""}`)}if(t.classMembers&&e.classMembers&&e.classMembers.members.length){n.push(`
40
40
  ## members of ${e.classMembers.className}:`);for(let s of e.classMembers.members){let o=String(s.label).split(".").pop(),r=s.params!=null&&s.params!==""?`(${s.params})${s.returns?` -> ${s.returns}`:""}`:"",i=s.decorators?`@${s.decorators} `:"",a=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${o}${s.site?` :${s.site.start}`:""} ${i}${o}${r}${a}`)}}if(t.siblings&&e.siblings.length){n.push(`
41
41
  ## sibling symbols to copy the style of (most relevant first; ${e.siblings.length} total):`);for(let s of e.siblings.slice(0,e.siblingCap)){let o=s.decorators?`@${s.decorators} `:"",r=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${s.label}${s.site?` :${s.site.start}`:""} ${o}${r}`)}e.siblings.length>e.siblingCap&&n.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return t.allExports&&e.allExports&&n.push(`
@@ -45,66 +45,66 @@ ${s.join(`
45
45
  ## insert the new sibling after line ~${e.insertion} (end of the last top-level definition).`)),t.tests&&e.tests.length&&n.push(`
46
46
  ## covering tests: ${e.tests.join(", ")}`),t.cochange&&e.cochange&&e.cochange.length&&n.push(`
47
47
  ## usually changed together (consider editing these too): ${e.cochange.map(s=>`${s.label} (\xD7${s.weight})`).join(", ")}`),n.join(`
48
- `)}function Gf(e,t){let n=[];for(let s of ke(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 qf(e,t){let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Gf(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,Uc).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
48
+ `)}function Kf(e,t){let n=[];for(let s of Ee(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 Yf(e,t){let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Kf(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,Vc).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>Uc?`
51
- \u2026+${o.length-Uc} more`:"")}function Vf(e,t){let n=Tn(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=ke(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,Bc).map(i=>{let a=e.byId.get(i.object),l=a?Rt(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>Vc?`
51
+ \u2026+${o.length-Vc} more`:"")}function Xf(e,t){let n=An(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Ee(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,qc).map(i=>{let a=e.byId.get(i.object),l=a?Rt(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>Bc?`
54
- \u2026+${o.length-Bc} more`:"")}var Wc,Jp,df,ef,jv,Rv,Dc,Tv,Ni,Av,Iv,Cv,mf,Ov,Lv,Nv,Pv,Mv,Fv,Dv,zv,Uv,Bv,Wv,Gv,qv,Vv,Hv,Kv,Yv,Xv,Jv,Qv,Zv,ex,tx,nx,sx,tf,ox,rx,hf,gf,bf,ix,ax,cx,lx,ux,sf,of,fx,rf,Ci,af,cf,lf,Tr,Pe,hx,gx,jf,bx,Wt,Af,wx,zf,$x,vx,xx,Ex,Sx,kx,jx,_x,zc,uf,Fi,Rx,Uc,Bc,Oe=O(()=>{ws();Hn();Lc();Rr();Js();Wc="This store holds no code index, so it records no modules or commits to look through.",Jp={"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"};df=e=>/^(git|turn):/.test(String(e||""));ef=30,jv=8;Rv=2,Dc=25,Tv=3;Ni=10,Av=8,Iv=3,Cv=2,mf=5,Ov=4,Lv=.2,Nv=.35,Pv=.15,Mv=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),Fv=.2,Dv=.35,zv=.2,Uv=.35,Bv=e=>/\.cs$/i.test(e),Wv=e=>/^I[A-Z]/.test(String(e||"")),Gv=.2,qv=.35,Vv=50,Hv=.2,Kv=.35,Yv=.5,Xv=mf,Jv=3,Qv=4,Zv=1,ex=.9,tx=.5,nx=.2,sx=.35,tf=4,ox=2,rx=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],hf=3,gf=12,bf=.9,ix=["imports","calls","callsSymbol","inherits"],ax=.5,cx=.6,lx=.2,ux=.35;sf=128,of=4,fx=64,rf=250,Ci=class extends Error{};af=new WeakMap;cf=40,lf=40,Tr=30;Pe=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";hx=25,gx=15;jf=40,bx="tests edges are recorded module to module, so this is module-grain coverage.";Wt=15;Af=new Set(["Function","Method"]);wx=8;zf={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};$x=8,vx=16,xx=4,Ex=6,Sx=12,kx=2,jx=8,_x=3,zc=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),uf=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),Fi=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},Rx=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};Uc=20;Bc=40});function Qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zf(e){let t=String(e||"");return Hf&&(t=t.replace(Hf," ")),t.replace(/\s+/g," ").trim()}function em(e){let t=String(e||"");t=t.replace(Yx," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(Vx);if(o&&(t=o[1].trim()),o=t.match(Hx),o&&(t=o[1].trim()),o=t.match(Kf),o&&(t=o[1].trim()),o=t.match(Yf),o&&(t=o[1].trim()),o=t.match(Xf),o&&(t=o[1].trim()),o=t.match(Kx),o&&(t=o[1].trim()),o=t.match(Jf),o&&(t=o[1].trim()),o=t.match(Xx),o&&(t=o[1].trim()),o=t.match(Jx),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Qx),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(Zx),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(eE),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(tE),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(nE),o&&$s.test(o[1].trim())&&(t=o[1].trim()),o=t.match(sE),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(oE),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(rE),o){let r=o[1].trim();qx(r)||(t=!iE.test(r)&&(Bx.test(r)||$s.test(r))?r:`describe ${r}`)}if(o=t.match(aE),o){let r=o[1].trim();($s.test(r)||cE.test(r)||Jf.test(r)||Kf.test(r)||Xf.test(r)||Yf.test(r)||lE.test(r))&&(t=r)}if(t===s)break}return t}function pE(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(uE);if(o&&(t=o[1].trim()),o=t.match(dE),o&&(t=o[1].trim()),t===s)break}return t}function mE(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(fE);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function bE(e){let t=String(e||""),n=t.match(gE);if(n){let o=nm[n[1].toLowerCase()],r=tm[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(sm);return s?`which modules transitively import ${s[1].trim()}`:t}function zi(e){return String(e||"").replace(Lx,t=>kc[t.toLowerCase()])}function Zs(e){let t=zi(e);return t=t.replace(Nx,n=>jc[n.toLowerCase()]),t=t.replace(Px,n=>_c[n.toLowerCase()]),t=t.replace(Mx,"with"),t=t.replace(Fx,(n,s)=>`${s} for`),t=t.replace(Dx,(n,s)=>`for ${s}`),t=t.replace(zx,(n,s)=>s),t=t.replace(wE,"$1$2"),t=t.replace(vp,"$1ing"),t=em(t),t=mE(t),t=pE(t),t=bE(t),t=Zf(t),t=an(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Ar(e){for(let t of[...Ep,...xp]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Yc(e){for(let t of yE){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function om(e){let t=String(e||"").match($E);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var Ox,Lx,Qf,Nx,Px,Mx,Fx,Dx,zx,Ux,Hf,Bx,$s,Wx,Gx,qx,Vx,Hx,Kf,Yf,Xf,Kx,Yx,Xx,Jx,Qx,Zx,eE,tE,nE,sE,oE,rE,iE,aE,cE,lE,Jf,uE,dE,fE,tm,nm,hE,gE,sm,wE,yE,$E,tt,Gt,me,yn=O(()=>{qn();Ox=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Qe).join("|")+")\\b","gi"),Lx=Ox(kc),Qf=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Qe).join("|")+")\\b(?!\\.[a-z0-9])","gi"),Nx=Qf(jc),Px=Qf(_c),Mx=/(?<=^|\s)w\/(?=\s|$)/gi,Fx=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Dx=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,zx=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,Ux=Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|"),Hf=Sr.length?new RegExp("\\b("+[...Sr].sort((e,t)=>t.length-e.length).map(Qe).join("|")+")\\b\\s*,?","gi"):null;Bx=new RegExp("\\b(?:"+Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|")+")\\b","i"),$s=/^(?:which|what|who|whose|where|when|why|how)\b/i,Wx=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),Gx=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,qx=e=>{if(Gx.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return Wx.has((t[t.length-1]||"").toLowerCase())},Vx=/^(?: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,Hx=/^(?: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,Kf=/^(?:(?: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,Yf=/^(?: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,Xf=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,Kx=/^(?:please[\s,]+)+(.+)$/i,Yx=/,?\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,Xx=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,Jx=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,Qx=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,Zx=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,eE=/^do\s+you\s+know\s+(.+?)\??$/i,tE=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,nE=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,sE=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,oE=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,rE=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,iE=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,aE=/^(?:and|also|so|then|now|but)\s+(.+)$/i,cE=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,lE=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,Jf=/^(?:(?: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;uE=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,dE=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;fE=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;tm=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),nm=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),hE="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",gE=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(nm).join("|")+")\\s+("+Object.keys(tm).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+hE+")\\??$","i"),sm=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;wE=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${Ec.map(Qe).join("|")})(\\s*[?.!]*)$`,"i");yE=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+(?:${Sc.map(Qe).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+(${Ux})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);$E=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");tt=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"]),Gt=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),me=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var im,rm=O(()=>{im={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","chapped","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","seifing","seiing","seined","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 Qn(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 Jc(e){return/^[a-z]+$/.test(e)&&!tt.has(e)&&!Xc.has(e)}function lm(e){return SE(e)?null:Ui(e,cm,Zn(e))}function Ui(e,t,n=Zn(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Qn(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 xE,Zn,Xc,am,cm,EE,SE,Mo=O(()=>{qn();rm();yn();xE=["used"];Zn=e=>e.length<=5?1:2,Xc=new Set([...Object.keys(de),...Object.keys(Be),...Object.keys(en),...xE].flatMap(e=>e.split(" "))),am=4,cm=[...new Set([...Object.keys(de),...Object.keys(en)].flatMap(e=>e.split(" ")).filter(e=>e.length>=am))],EE=new Set(im.words),SE=e=>EE.has(e)});function Fo(e){for(let t of RE){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Bi,kE,jE,_E,Qc,RE,um,Wi=O(()=>{qn();yn();Bi=Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|"),kE=Object.keys(Be).sort((e,t)=>t.length-e.length).map(Qe).join("|"),jE=Object.keys(en).sort((e,t)=>t.length-e.length).map(Qe).join("|"),_E=qs.slice().sort((e,t)=>t.length-e.length).map(Qe).join("|"),Qc=(e,t)=>e==="defines"&&Er.has(t),RE=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Bi})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];if(Qc(n,t))return null;let s=e[1].trim(),o=e[3].trim();return xr.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+(${kE})\\s+(?:(${jE})\\s+)?(${Bi})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=de[t];return Qc(n,t)?null:{shape:"reverse",entityType:Be[e[1].toLowerCase()],modifier:e[2]?en[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Bi})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];return Qc(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+(?:${_E})\\??$`,"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=an(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Be[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&yp.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Ws(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${wn.map(Qe).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+(?:${Zt.map(Qe).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+)?(${Bi})\\??$`,"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()})}];um={id:"grammar",class:"graph-query",run(e){let t=Fo(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function Tt(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 Cr(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(S=>S.toLowerCase());if(s.includes("where")&&!Tt(s,de)){let S=s.some(j=>wn.includes(j)),E=new Set([...Zt,...wn]),R=n.filter((j,A)=>!tt.has(s[A])&&!E.has(s[A])).join(" ").trim();if(R){let j=S?"mentions":"where";return{shape:j,entityType:null,modifier:"direct",kind:j,object:R}}}if(new Set(["has","have","had"]).has(s[0])){let S=s.length;for(;S>1&&(s[S-1]==="ever"||s[S-1]==="been");)S-=1;if((S>1?de[s[S-1]]:null)==="touches"){let R=n.slice(1,S-1).filter((j,A)=>!tt.has(s[1+A])).join(" ").trim();if(R)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:R}}}let r=s,i=Tt(s,de);if(!i&&t){let S=s.map(E=>{if(!Jc(E))return E;let R=t.lemma(E);return Xc.has(R)?R:E});i=Tt(S,de),i&&(r=S)}let a=null;if(!i){let S=s.map(E=>E.length>=4&&Jc(E)&&lm(E)||E);if(i=Tt(S,de),i){r=S;let E=s.slice(i.start,i.end).findIndex((j,A)=>j!==S[i.start+A]),R=i.start+Math.max(E,0);a={from:s[R],to:S[R]}}}let l=!1;if(!i)for(let S=0;S<s.length;S+=1){let E=gs[s[S]];if(!(E&&s[S]==="used"&&s[S+1]==="for")&&E&&s.slice(0,S).some(R=>Ir.has(R))){i={kind:E,start:S,end:S+1},l=!0;break}}if(!i)return null;!l&&i.end-i.start===1&&gs[s[i.start]]&&s.slice(0,i.start).some(S=>Ir.has(S))&&(l=!0);let c=S=>a?{...S,fuzzyVerb:a}:S;if(t&&i.end-i.start===1){let S=i.start,E=s[S-1];if((E==="the"||E==="these"||E==="those")&&s[S+1]==="of"&&t.posTags(n)[S]==="NOUN"){let j=n.slice(S+2).filter((A,F)=>!tt.has(s[S+2+F])).join(" ").trim();if(j)return c({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:j})}}let u=new Set,d=S=>{if(S)for(let E=S.start;E<S.end;E+=1)u.add(E)};d(i);for(let[S,E]of Object.entries(de)){if(E!==i.kind)continue;let R=S.split(" "),j=i.end;if(R.every((A,F)=>r[j+F]===A)){d({start:j,end:j+R.length});break}}let f=Tt(r,Be,u);d(f);let p=Tt(r,en,u);d(p);let m=(S,E)=>n.slice(S,E).filter((R,j)=>!u.has(S+j)&&!tt.has(s[S+j])).join(" ").trim(),h=m(0,i.start),g=m(i.end,n.length);l&&!s.includes("by")&&IE.has(g.toLowerCase())&&(g="");let b=i.kind,y=f?Be[r.slice(f.start,f.end).join(" ")]:null,w=p?en[r.slice(p.start,p.end).join(" ")]:"direct";if(b==="touches"&&s.includes("when")){let S=h||g;if(S)return c({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:S})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let S=h||g;if(S)return c({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:S})}let v=s.indexOf("by"),_=s.slice(0,i.start).findIndex(S=>Ir.has(S)),$=_>=0,x=$&&_>v;if(v>=0&&!u.has(v)&&$){let S=(j,A)=>n.slice(j,A).filter((F,T)=>{let M=j+T,z=s[M];return!u.has(M)&&!tt.has(z)&&z!=="by"&&!Ir.has(z)&&!TE.has(z)&&!AE.has(z)}).join(" ").trim(),[E,R]=x?[S(_+1,n.length),S(v+1,_)]:[S(0,v),S(v+1,n.length)];if(E&&R)return b==="defines"&&Er.has(r.slice(i.start,i.end).join(" "))?null:c({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:R,object:E});if(R)return c({shape:"forward",entityType:y,modifier:w,kind:b,object:R});if(E)return c({shape:"reverse",entityType:y,modifier:w,kind:b,object:E})}if(l&&v<0&&g&&s[i.start]==="called")return null;if(h&&g){let S=r.slice(i.start,i.end).join(" ");if(b==="defines"&&Er.has(S))return null;let E=h,R=g;return xr.includes(S)&&([E,R]=[R,E]),c({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:E,object:R})}if(g){let S=f&&f.start>=i.end?null:y;return c({shape:"reverse",entityType:S,modifier:w,kind:b,object:g})}if(b==="inherits"&&!h&&f&&f.start===i.end){let S=r.slice(f.start,f.end).join(" ");if(S)return c({shape:"reverse",entityType:null,modifier:w,kind:b,object:S})}if(h&&!g&&$&&i.end-i.start===1&&gs[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(b==="touches")return c({shape:"when",entityType:null,modifier:"direct",kind:b,object:h});let S=Ir.has(s[0]);return c({shape:"reverse",entityType:y,modifier:w,kind:b,object:h,...S?{polar:!0}:{}})}return h?c({shape:"forward",entityType:y,modifier:"direct",kind:b,object:h}):null}var Ir,TE,AE,IE,dm,Gi=O(()=>{qn();yn();Mo();Ir=new Set(["is","are","was","were","be","been","being","get","gets","got"]),TE=new Set(["which","what","who","whom","whose"]),AE=new Set(Gn.map(e=>e.toLowerCase())),IE=new Set(["recently","lately","yet","already","ever","again"]);dm={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Cr(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function OE(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)||pm.has(l)||!s.has(l)||o[i]==="VERB"&&r.push(l)}return r}function LE(e,t=null){let n=Gt(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!pm.has(a)&&(CE.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=OE(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var pm,CE,fm,mm=O(()=>{qn();yn();Wi();Gi();pm=new Set([...tt,...me(Gs),...me(Object.keys(de)),...me(Object.keys(Be)),...me(Object.keys(en)),...me(Object.keys(Xe)),...me(Vs),...me(Hs),...me(Object.keys(bs)),...me(Object.keys(_n)),...me(Object.keys(jo)),...me(Gn),...me(kr),...me(qs),...me(Zt),...me(wn),...me(Wn),...me(Object.keys(Ro))]),CE=new Set([...me(Sr),...me(Si)]);fm={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Fo(e))return null;let{text:n,dropped:s,maybeNoise:o}=LE(e,t.nlp||null);if(!s.length||!n)return null;let r=Fo(n)||Cr(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 qi,Vi=O(()=>{qi=()=>{}});function bm(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Do(e.subject)===Do(t.subject)&&Do(e.object)===Do(t.object):Do(e.object)===Do(t.object)}function Zc(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=>!wm(c))&&(n=n.filter(c=>!wm(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(m=>bm(m.parsed,f.parsed)&&m.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),gm(f.parsed)<gm(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=>bm(u.parsed,c.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:l}}function ME(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 ym(e,{describe:t=ME,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 Do,NE,gm,PE,wm,el=O(()=>{Do=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),NE=/^\s*(?:the|a|an)\s+/i,gm=e=>[e?.subject,e?.object].filter(t=>NE.test(String(t||""))).length;PE=new Set(["fuzzy","lemma","spell"]),wm=e=>PE.has(e.via)});function Hi(e){tl=e}function Ki(){return typeof tl=="function"?tl():null}var tl,zo=O(()=>{tl=null});function xm(e,t={},n=DE){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 FE,DE,Em=O(()=>{yn();Wi();Gi();mm();hm();Vi();el();zo();FE=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],DE=[um,dm,fm,...FE]});function Uo(e){return zE.test(String(e||"").trim())?"an":"a"}function Yi(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 Bo(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Or(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 zE,Xi=O(()=>{zE=/^[aeiou]/i});var Lr,nl=O(()=>{Lr=(e,t,n)=>n});var ph={};Bn(ph,{DYNAMIC_TAIL_OK_RE:()=>Al,applyNegationFrames:()=>Ar,ask:()=>Ss,classDisplayName:()=>es,degreeMetric:()=>sh,metaFallbackEntityAnswer:()=>Xm,normalizeQuery:()=>Zs,parseQuery:()=>Dr,parseQueryFull:()=>bl,render:()=>vn,rephraseHint:()=>Sl,resolveObject:()=>xn,traverse:()=>qt,worldRelationGraphPayload:()=>Lk});function Ke(e,t){let n=Sm.get(e);n||(n=new Map,Sm.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Jn(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Me(e,t){let[n,s]=cl[e]||["result","results"];return t===1?n:s}function Ur(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Me(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function es(e){let t=String(e||"");if(typeof Rn=="function"){let n=Rn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function eo(e){return BE[e]||e}function HE(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||VE.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return me(qs).includes(o)?t:e}function XE(e,t){if(!e||e.shape!=="where"||e.altObject||!KE.test(t))return e;let n=Ei(t),s=Ei(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=Gt(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||tt.has(i)||de[i]||i.endsWith("ing"))return o;let a=Gt(n).map(c=>c.toLowerCase());for(;a.length&&YE.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 Dr(e,{nlp:t=void 0}={}){return bl(e,{nlp:t}).parsed}function bl(e,{nlp:t=void 0}={}){let n=t===void 0?Ki():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Yc(Ar(Zs(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=QE(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Zc(xm(o,{nlp:n,raw:s}));return i?{parsed:XE(HE(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function ul(e,t){return t.length&&zm.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function qo(e,t){return Fo(e)||Cr(e,t)}function QE(e,t){let n=Gt(e),s=n.map(o=>o.toLowerCase());return wS(n,s)||$S(n,s)||nS(n,s,t)||Bm(e,t,0)||vS(n,s,t)||oS(n,s,t)||dS(n,s,t,0)||fS(n,s)||gS(n,s,t)||xS(n,s,t)||kS(n,s,t)||_S(n,s,t,0)||SS(n,s,t,0)||yl(n,s,t,0)||iS(n,s,t)||eS(n,s)||Km(n,s,t,0)}function eS(e,t){let n=0;ZE.has(t[n])&&(n+=1);let s=At(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?$p[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,l=-1,c;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){l=m,c=h;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=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},p=f(i,u);return p.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:p}},{op:"intersection",kind:"set",ast:{node:"clause",clause:f(c,d)}}]}}function Qi(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function nS(e,t,n){if(!["do","does","did"].includes(t[0])||!tS.has(t[1]))return null;let s=At(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=Tt(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)&&!tt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=Vo(`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:Qi(o,{op:"difference",kind:"set",ast:d})}}function Bm(e,t,n=0){let s=om(e);if(!s)return null;let o=At(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=Gt(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Xe[d]))return Qi(r,{op:"difference",kind:"qual",filters:a});let l=Tt(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)&&!tt.has(a[f])&&a[f]!=="from").length)return Qi(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:l.kind}});let u=Vo(`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"}:Qi(r,{op:"difference",kind:"set",ast:u})}function oS(e,t,n){let s=0;for(;s<t.length&&sS.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=Tt(r,de);if(!a)return null;let c=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!tt.has(r[d])).join(" ").trim();return c?{node:"forwardComplement",kind:a.kind,subjectTerm:c}:null}function Wm(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 Gm(e,t){let n=Ot(t),s=n.filter(r=>!Fm.has(r)),o=Wm(e,s.length?s:n);return o.size===1?[...o][0]:null}function Vo(e,t,n){if(n>Dm)return{node:"miss",reason:"too deep to resolve"};let s=Bm(e,t,n);if(s)return s;let o=Gt(e),r=o.map(c=>c.toLowerCase()),i=yl(o,r,t,n);if(i)return i;let a=Km(o,r,t,n);if(a)return a;let l=qo(e,t);return l?{node:"clause",clause:l}:null}function yl(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=Wn.includes(t[o]),i=!r&&Um(t[o]);if(!r&&!i||r&&o+1>=t.length||!At(t[o-1]))continue;let l=e.slice(0,o-1);if(!l.length||l.every(f=>Xe[f.toLowerCase()]))continue;let c=qo([...l,ll].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=Vo(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 iS(e,t,n){for(let s=0;s<t.length;s+=1){if(!rS.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),ll,...e.slice(s+1)],a=qo(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===ll&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function dS(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!aS.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(cS.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&&lS.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&uS.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>Wn.includes(d)))return null;let l=wl.has(a[0])?i.join(" "):`which ${i.join(" ")}`,c=Vo(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=At(a[0]);return{node:"temporal",inner:c,entityType:u&&u.entityType||null}}function fS(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!pS.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 hS(e){let t=new Set,n=[];for(let s of e){if(!s||!mS.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function gS(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(!kr.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&&(Vs.includes(f)||Hs.includes(f))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=Vs.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=bS(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=hS(e.slice(0,l)),u={node:"anaphora",mode:i,filter:a};return c.length>=2&&(u.candidateTerms=c),u}function bS(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&JE.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Xe[a]))return{type:"qual",filters:r};if(o.length===1){let a=At(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=qo(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function wS(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?At(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 yS(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Ws(n).slice(e.length).trim(),o=Gt(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 $S(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(Xe[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&&gs[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&&!Sp.has(u))return null}let r=yS(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 vS(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=qo(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function xS(e,t,n){let s=Vs.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&&Xe[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?At(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=>!tt.has(d)&&!qm.has(d)),u;if(c){let d=Vo(`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 SS(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&&$l.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Xe[t[o]];)a.push(t[o]),o+=1;let l=o<t.length?At(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]]&&!Gn.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=>!tt.has(y)&&!qm.has(y)),p=t.slice(o),m=d;(p[0]==="is"||p[0]==="are")&&(p=p.slice(1),m=m.slice(1));let h=r&&ES.has(p[0]);if(r&&(f&&!h||d.length===0))return null;let g,b=!1;if(f){let y=h?m:d,w=Vo(`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"};g=w,b=!0}else g={node:"allOfClass",entityType:c},a.length&&(g={node:"qualifier",filters:a,inner:g});return{node:"list",entityType:c,base:g,scoped:b}}function kS(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(bs[h]){s=bs[h],o=m;break}if(bs[t[m]]){s=bs[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(_n[t[m]]){r=_n[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(_n[t[m]]){r=_n[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),l=["important","significant","central","key","core","essential","critical","principal"],c=t.some(m=>l.includes(m));!r&&(a||c)&&(r=_n.connections,i="connections");let u,d=null;for(let m of t){let h=At(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?kp[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let f=["needs","need","needing","lacks","lack","lacking","misses","missing"],p=t.some(m=>f.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:p}}function _S(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&$l.has(t[o]);)o+=1;if(o>=t.length)return null;let r=At(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&jS.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=At(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=>Wn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Gn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Hm}`}:null}function RS(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&$l.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(Wn.includes(t[i])){s=i;break}if(s<0)return null;let o=At(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 TS(e,t,n,s,o,r){let{branches:i,ops:a}=Zi(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],m=ul(d,f);if(m.blc.length&&m.blc.every(y=>Xe[y])){c.push({op:p,kind:"qual",filters:m.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 h=d,g=Tt(f,de);g?l=d.slice(g.start,g.end):l&&(h=[...l,...d]);let b=Ym(`${t} ${h.join(" ")}`,o,r);if(!b||b.node==="miss")return{miss:b&&b.reason||"a clause in the combination didn't parse"};c.push({op:p,kind:"set",ast:b})}return{atoms:c}}function Km(e,t,n,s){let o=RS(e,t);if(o){let{entityType:R,term:j,relIdx:A}=o,F=t.slice(A+1),T=e.slice(A+1);if(!F.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[A]}"`};let M=TS(R,`which ${t[A-1]}`,F,T,n,s+1);if(M.miss)return{node:"miss",reason:M.miss};let z=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:j}},...M.atoms];return z.length===1?z[0].ast:{node:"boolean",entityType:R,atoms:z}}let r=0;for(;r<t.length&&wl.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Xe[t[r]];)a.push(t[r]),r+=1;let l=r<t.length?At(t[r]):null;if(!l){let R=r+1<t.length?At(t[r+1]):null;if(km.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(zm.has(t[r])){let j=r+1;j<t.length&&(t[j]==="the"||t[j]==="a"||t[j]==="an")&&(j+=1);let A=j+1<t.length?At(t[j+1]):null;if(km.has(t[j])&&A&&A.entityType==="Commit"&&j+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!de[t[r]]&&!tt.has(t[r])&&!Rl.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&&Wn.includes(d[0])&&(p=!0,d=d.slice(1),f=f.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&Um(d[0]),g=f.length>0&&Zi(d,f).branches.some(R=>{let{blc:j}=ul(R,R.map(A=>A.toLowerCase()));return j.length&&j.every(A=>Xe[A])}),b=f.length>0?Zi(d,f).branches:[],y=!1;if(b.length>1){let R=b[0].map(A=>A.toLowerCase()),j=Tt(R,de);j&&j.start===0&&(y=b.slice(1).every(A=>{let F=A.map(M=>M.toLowerCase()),T=Tt(F,de);return T&&T.start===0?T.kind===j.kind:!T}))}let w=!1;if(b.length>1){let R=b[0].map(A=>A.toLowerCase()),j=Tt(R,de);j&&j.start===0&&(w=b.slice(1).every(A=>{let F=A.map(M=>M.toLowerCase()),T=Tt(F,de);return!!T&&T.start===0&&T.end-T.start===1}))}if(!(a.length||p||m||h||g||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:_,ops:$}=Zi(d,f),x=null,S=[];for(let R=0;R<_.length;R+=1){let j=_[R],A=j.map(ae=>ae.toLowerCase()),F=R===0?"seed":$[R-1],T=ul(j,A);if(T.blc.length&&T.blc.every(ae=>Xe[ae])){S.push({op:F,kind:"qual",filters:T.blc});continue}if(A[0]==="of"||A[0]==="in"){S.push({op:F,kind:"set",ast:{node:"membership",entityType:c,term:j.slice(1).join(" ")}});continue}let M=j,z=Tt(A,de);z?x=j.slice(z.start,z.end):x&&(M=[...x,...j]);let Y=Ym(`${v} ${M.join(" ")}`,n,s+1);if(!Y||Y.node==="miss")return{node:"miss",reason:Y&&Y.reason||"a clause in the combination didn't parse"};S.push({op:F,kind:"set",ast:Y})}if(S[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let E;return S.length===1?E=S[0].ast:E={node:"boolean",entityType:c,atoms:S},a.length&&(E={node:"qualifier",filters:a,inner:E,entityType:c}),E}function Ym(e,t,n){if(n>Dm)return{node:"miss",reason:"too deep to resolve"};let s=Gt(e),o=s.map(a=>a.toLowerCase()),r=yl(s,o,t,n);if(r)return r;let i=qo(e,t);return i?{node:"clause",clause:i}:null}function Zi(e,t){let n=Object.keys(jo).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(jo[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 vl(e,t,n,s){let o=Wo[t];if(o&&Es.has(n)){let u=Ke(e,o).filter(d=>s.has(d.object));return ns(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>Es.has(e.byId.get(u)?.class))?[...Ot(t),o]:Ot(t)).flatMap(u=>Ke(e,u)).filter(u=>s.has(u.object)),l=ns(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")?kl(e,new Set(l.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function IS(e,t){let n=new Set(vl(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=AS.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function Mr(e,t,n){let s=Ot(t).flatMap(o=>Ke(e,o)).filter(o=>n.has(o.subject));return ns(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ns(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 CS(e,t){let n=Yn(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&Yn(o.label).startsWith(s))}function dl(e){let t=jm.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},jm.set(e,t),t}function Go(e,t){return t?t.class==="Module"?t.id:dl(e).moduleOfSymbol.get(t.id)||null:null}function Xm(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>OS.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Go(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Me(o.class,1),l=a==="attribute"?"an":"a",c=i?`, ${Lr("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 pl(e,t,n){let s=ns(_o.flatMap(o=>Mr(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function xl(e,t,n=null){let s=ts(e,t,n);if(!(s.match&&s.tier===1)){let o=CS(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 Jm(e,t,n,s,o){let r=o||(()=>!0),i=pl(e,t,s).filter(r);if(i.length||!Zm(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of Qm(e,t)){let l=e.byId.get(a);if(!l)continue;let c=pl(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 to(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=dl(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=Go(e,t),o=dl(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&Xs(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function El(e){return Ke(e,"inherits")}function fl(e,t){return El(e).filter(n=>n.object===t).map(n=>n.subject)}function _m(e,t){return El(e).filter(n=>n.subject===t).map(n=>n.object)}function LS(e,t){let n=new Set,s=[...fl(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of fl(e,o))n.has(r)||s.push(r)}}return n}function Qm(e,t){let n=new Set,s=[..._m(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of _m(e,o))n.has(r)||s.push(r)}}return n}function Zm(e,t){let n=Rm.get(e);if(n||(n=new Map,Rm.set(e,n)),n.has(t))return n.get(t);let s=El(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 Tm(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 Im(e){return e.slice().sort((t,n)=>Am[n.via]-Am[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Cm(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Zn(n);if(Qn(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of no(e.label))if(Qn(o,n,s)<=s)return!0;return!1}function eh(e,t,n){let s=e.individuals.filter(l=>l.class===t),o=[...no(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=Zm(e,t),i=[];for(let l of s){let c=Tm(l,o);if(c){i.push({ind:l,via:c});continue}if(!r)continue;[...LS(e,l.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!Tm(f,o)})&&i.push({ind:l,via:"chain"})}if(i.length||!r)return{narrow:Im(i),broad:[]};let a=new Map;for(let l of s)for(let c of Qm(e,l.id)){if(!a.has(c)){let u=e.byId.get(c);u&&u.class===t&&Cm(u,n)&&a.set(c,{ind:u,via:"chain"})}for(let u of fl(e,c)){if(u===l.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Cm(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Im([...a.values()])}}function NS(e){return[...Pi(Mi(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function ln(e,t,n){switch(t.node){case"clause":return qt(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?NS(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=eh(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Ot(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=ts(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=Gm(e,t.kind);if(!o)return[];let r=new Set(Mr(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(ln(e,t.inner,n).map(o=>o.id));return vl(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(ln(e,t.inner,n).map(o=>o.id));return Mr(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=xl(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 ns(_o.flatMap(l=>Mr(e,l,i))).filter(l=>l.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=Jm(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?oh(e,t,n).matches:ln(e,t.inner,n).filter(o=>t.filters.every(r=>to(e,o,Xe[r])));case"boolean":return th(e,t,n);case"anaphora":return nh(e,t,n).matches;default:return[]}}function th(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=ln(e,o.ast,n);continue}if(o.kind==="qual"){let i=l=>o.filters.every(c=>to(e,l,Xe[c])),a=l=>o.filters.every(c=>{let u=PS(Xe[c]);return u?to(e,l,u):!to(e,l,Xe[c])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(ln(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 ln(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function MS(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=xn(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 nh(e,t,n){let o=MS(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=>to(e,d,Xe[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=xn(e,i.clause.object);if(!d.match)r=[];else{let f=Wo[i.clause.kind],p=[...Ot(i.clause.kind),...f?[f]:[]],m=new Set(p.flatMap(h=>Ke(e,h)).filter(h=>h.object===d.match.id).map(h=>h.subject));r=r.filter(h=>m.has(h.id))}}let a=d=>d.length&&d.every(f=>f.class===d[0].class)?d[0].class:null,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=Ur(c,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:c,referents:u}}function sh(e,t,n){let s=n.kind==="*"?FS:[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 DS(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 US(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(zS.test(s))r=s;else{let{match:u,ambiguous:d}=xn(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 BS(e,t,n){let s=ln(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=vl(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 WS(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)&&!Xs(String(l.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:sh(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?Ur(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 oh(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?m=>s.filters.every(h=>to(e,m,Xe[h])):null,a=m=>Ur(r,m,"membership"),l=xl(e,o.term,n&&n.contextId);if(l.kind==="dir"){let m;if(!r||r==="Module")m=l.mods;else{let h=new Set(l.mods.map(g=>g.id));m=ns(_o.flatMap(g=>Mr(e,g,h))).filter(g=>g.class===r)}return i&&(m=m.filter(i)),{compositeKind:"set",matches:m,entityType:r,referents:a(m)}}if(l.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:c,inherited:u,viaLabel:d}=Jm(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 GS(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=xn(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=xn(e,s,{expectedClass:n}),l=!r||a.match&&Go(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?kl(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 qS(e,t,n){let s=Go(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||pl(e,n.id).some(o=>o.id===t.id)}function VS(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=ts(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=xl(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!qS(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=to(e,a.match,Xe[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 HS(e,t,n){let s=xn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=ln(e,{node:"allOfClass",entityType:t.entityType},n),r=th(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 KS(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(ln(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 YS(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return GS(e,t);if(t.node==="qualCheck")return VS(e,t,n);if(t.node==="universal")return HS(e,t,n);if(t.node==="count"){let i=KS(e,t.base,n);return i?{compositeKind:"count",count:IS(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:ln(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:ln(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return Ik(e,t);if(t.node==="superlative")return WS(e,t);if(t.node==="temporal")return BS(e,t,n);if(t.node==="recentCommits")return DS(e);if(t.node==="commitFilter")return US(e,t);if(t.node==="anaphora")return nh(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return oh(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=eh(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=ln(e,t,n),o=t.entityType||null,r=Ur(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function rh(){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 XS(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=zr(e);return n?`${t} in ${n}`:t}function ml(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(ml):Array.isArray(e.filters)&&e.filters.some(t=>Xe[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(ml)}function JS(e,t){return!["Function","Method"].includes(t)||!ml(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 QS(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})`:""}. ${rh()}.`,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=Me(t.entityType,1),o=Me(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=zr(i),l=i.class==="Module"?"":a?`, ${Lr("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 ${vs(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=Me(t.entityType,t.total),o=GE(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}: ${vs(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Me(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 ${Me(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>He?` \u2014 narrow with "${Me(t.entityType,2)} in <module>"`:"";return{content:`${vs(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=$n(t.asked),o=Bs[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?` (${Me(t.entityType,2)})`:""}. ${xs(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Me(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${vs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${vs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Me(t.entityType,1);if(!t.matches.length)return{content:`no ${Me(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?XS(t.matches[0]):vs(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Me(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,Wt).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>Wt?` \u2026+${t.matches.length-Wt} 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,Wt).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>Wt?` \u2026+${t.matches.length-Wt} 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 ${Me(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:`${vs(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?Me(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. ${xs(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. ${xs(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=JS(e,t.entityType)||xs(n);return{content:`nothing in the index matches that${t.entityType?` (${Me(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${vs(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function Sl(){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). `+rh()}function xs(e=null){return e&&Li(e)===0?Wc:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function no(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function ta(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 ih(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function ZS(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Nr(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(g=>g.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let g=i[2],b=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${g}`)||String(y.label).toLowerCase().startsWith(g)));if(b.length===1)return{match:b[0],candidates:[],tier:1,ambiguous:!1};if(b.length>1)return{match:b[0],candidates:b.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(g=>String(g.label).toLowerCase()===o||String(g.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let l=`ext:${o}`,c=null;e:for(let g of e.relations)for(let b of g.edges)if(String(b.object).toLowerCase()===l){c=b.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(g=>g.trim()).filter(Boolean);if(u.length>1){let g=new Set;for(let b of u){let y=Nr(e,b,{expectedClass:n});y.match&&!y.ambiguous&&g.add(y.match.id)}if(g.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],f=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(f){let g=o.split(".").pop();for(let b of r){let y=String(b.label||"").toLowerCase();b.class==="Module"?y.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:b,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs(y.length-o.length)})}}else{let g=[...no(s)],b=o.split(/\s+/).find($=>$.includes("/")),y=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,_=v?ZS(s):null;for(let $ of r){let x=String($.label||"").toLowerCase(),S=x.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(S===o){d.push({ind:$,score:5e3});continue}if(o.length>=4&&(S.startsWith(o)||S.endsWith(o))){d.push({ind:$,score:4e3-Math.abs(S.length-o.length)});continue}if(v){let j=ih($.label);if(j&&j===_){d.push({ind:$,score:5e3});continue}let A=/[/_-]/.test($.label)||/\.[a-z0-9]+$/i.test(String($.label||""));if(j&&A&&_.length>=4&&j.includes(_)){d.push({ind:$,score:2e3-Math.abs(j.length-_.length)});continue}}if($.class==="Module"){let j=ta(o);if(j!==o&&j===ta(S)){let A=Zn(o);if(Qn(S,o,A)>A){d.push({ind:$,score:3e3-Math.abs(S.length-o.length)});continue}}}if(o.length>=4&&x.includes(o)){d.push({ind:$,score:1e3-Math.abs(x.length-o.length)});continue}let E=no($.label),R=g.filter(j=>E.has(j)).length;R>0&&(!y||E.has(y))&&d.push({ind:$,score:R/g.length*ol})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,y=b.filter(v=>v.score===g.score),w=g.score>=ol?b.filter(v=>v.score>=ol):b;return{match:g.ind,candidates:w.slice(0,4).map(v=>v.ind),tier:3,ambiguous:y.length>0}}let p=f||o.includes("/"),m=null,h=!p&&typeof Ks=="function"?Ks(e.proseIndex,s).filter(g=>!n||e.byId.get(g.id)?.class===n):[];if(h.length){let[g,...b]=h,y=e.byId.get(g.id);if(y){let w=b.filter(v=>v.score===g.score);if(m={match:y,candidates:b.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!m.ambiguous&&g.via!=="spell")return m}}if(!i&&o.length>=4){let g=Zn(o),b=g+1,y=[];for(let w of r){let v=Qn(String(w.label||"").toLowerCase(),o,g);if(v>0)for(let _ of no(w.label)){if(v<=0)break;v=Math.min(v,Qn(_,o,g))}v<b?(b=v,y=[w]):v===b&&v<=g&&y.push(w)}if(b<=g&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&y.length>1&&!m){let[w,...v]=y;return{match:w,candidates:v.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function rl(e,t){let n=ih(t),s=[...no(t)],o=[];for(let r of no(e))n.includes(r)||s.some(i=>ta(i)===ta(r))||ea.has(r)||lh.has(r)||o.push(r);return o}function Ji(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(rl(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),rl(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:$n(s.slice(0,4).map(r=>r.label))}:e}let n=rl(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function xn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(ek,"").trim(),i=r.match(tk);if(i){let a=r.slice(0,i.index).trim(),l=Be[i[1].toLowerCase()];if(a&&l){let c=Ji(Nr(e,a,{expectedClass:l}),a);if(c?.match?.id&&!c.ambiguous)return c}}if(r&&r!==o){let a=Ji(Nr(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ji(Nr(e,t,n),t)}return Ji(Nr(e,t,n),t)}function ts(e,t,n){if(Gs.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 xn(e,t)}function kl(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 nk(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||Es.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&&Es.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 ik(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&jl.has(Om(s.label))).map(s=>({ind:s,named:n.has(Om(s.label))?1:0,depth:String(s.label).split("/").length,fixture:rk(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 ak(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function _l(e){return(e?.attributes||[]).find(t=>t.prop===ck)?.value||null}function lk(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Uo(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 YS(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let T=t.candidates.map(M=>{let z=qt(e,M,{contextId:n,prev:s});return{parsed:M,result:z,rendered:vn(M,z,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(),M=T.toLowerCase(),z=(e.individuals||[]).find(Y=>{if(!_l(Y))return!1;if(String(Y.label).toLowerCase()===M)return!0;let ae=(Y.attributes||[]).find(Z=>Z.key==="token")?.value;return ae&&String(ae).toLowerCase()===M});if(!z){let Y=Xm(e,T);return Y?{matches:[Y.hit],objMatch:Y.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:Y.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:[z],objMatch:z,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}if(r==="mentions"){let T=String(t.object||"").trim();return{matches:(typeof Ks=="function"?Ks(e.proseIndex,T):[]).map(Y=>e.byId.get(Y.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${T}"`}}if(r==="where"&&sk.test(String(t.object||"").trim())){let T=ik(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 (${[...jl].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!ak(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=ts(e,t.subject,n),M=ts(e,t.object,n);if(!T.match||!M.match||T.ambiguous||M.ambiguous)return{matches:[],objMatch:M.match,candidates:M.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(T.unresolvedPronoun||M.unresolvedPronoun)};let[z,Y]=[T.match,M.match];i==="touches"&&Y.class==="Commit"&&z.class!=="Commit"&&([z,Y]=[Y,z]);let ae=Wo[i],Z=[...new Set(ae?[...Ot(i),ae]:Ot(i))],D=Z.flatMap(U=>Ke(e,U)).filter(U=>U.subject===z.id&&U.object===Y.id);return{matches:D,answer:t.negated?D.length===0:D.length>0,objMatch:M.match,subjMatch:T.match,candidates:[],traversal:`${Z.join("+")} edge from ${z.label} to ${Y.label}`,ambiguous:!1}}let l;if(o)l={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(l=ts(e,t.object,n),t.altObject&&t.altObject!==t.object){let T=ts(e,t.altObject,n),M=!!l.match&&!l.ambiguous,z=!!T.match&&!T.ambiguous;!M&&z?l=T:M&&z&&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=Y=>Y.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),M=T(String(t.object||"").trim().toLowerCase()),z=(e.individuals||[]).find(Y=>{if(Y.class!=="Module"||Y.id===l.match.id)return!1;let ae=String(Y.label||"").toLowerCase().split("/").pop();return ae!==T(ae)&&T(ae)===M});z&&(l={...l,ambiguous:!0,candidates:[z,...l.candidates||[]]})}}let{match:c,candidates:u,ambiguous:d,unresolvedPronoun:f,matchedVia:p,unplacedWords:m,nearestLabel:h}=l;if(!c)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:f,unplacedWords:m,nearestLabel:h};if(d){let M=ns([c,...u||[]]).slice(0,He).map(z=>{let Y=qt(e,t,{contextId:n,prev:s,pinnedObjMatch:z});return{candidate:z,result:Y,rendered:vn(t,Y,e)}});return{matches:[],objMatch:c,candidates:u,traversal:null,ambiguous:!0,branches:M}}if(r==="where"){let T=(c.attributes||[]).find(M=>M.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=Y=>String((Y.attributes||[]).find(ae=>ae.key==="date")?.value||""),M;if(c.class==="Commit")M=[c];else{let Y=["touches","touchesSymbol"].flatMap(Z=>Ke(e,Z)).filter(Z=>Z.object===c.id),ae=new Set;M=[];for(let Z of Y){if(ae.has(Z.subject))continue;ae.add(Z.subject);let D=e.byId.get(Z.subject);D&&D.class==="Commit"&&M.push(D)}M.sort((Z,D)=>T(D).localeCompare(T(Z)))}let z=M.length&&T(M[0])?[{kind:"event",class:"Commit",label:M[0].label,ids:[M[0].id],attrs:{date:T(M[0]).slice(0,10)},lane:"when"}]:[];return{matches:M,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:z,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit date first`}}if(r==="whoLast"){let T=Z=>String((Z.attributes||[]).find(D=>D.key==="date")?.value||""),M=["touches","touchesSymbol"].flatMap(Z=>Ke(e,Z)).filter(Z=>Z.object===c.id),z=new Set,Y=[];for(let Z of M){if(z.has(Z.subject))continue;z.add(Z.subject);let D=e.byId.get(Z.subject);D&&D.class==="Commit"&&Y.push(D)}Y.sort((Z,D)=>T(D).localeCompare(T(Z)));let ae=Y.length&&T(Y[0])?[{kind:"event",class:"Commit",label:Y[0].label,ids:[Y[0].id],attrs:{date:T(Y[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:Y,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whoLastShape:!0,referents:ae,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit's author`}}if(i==="touches"&&c.class==="Commit")return nk(e,c,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let T=Wo[i],z=!!(T&&c.class&&Es.has(c.class))?[...new Set([...Ot(i),T])]:Ot(i);if(a&&a!=="Change"){let G=Wm(e,z),I=sl[a];if(G.size&&!G.has(a)&&!(I&&G.has(I)))return{matches:[],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...G],traversal:`${z.join("+")} edges where subject = ${c.label} (grain mismatch: this "${i}" relation never targets a ${es(a)})`}}let ae=z.flatMap(G=>Ke(e,G)).filter(G=>G.subject===c.id).map(G=>e.byId.get(G.object)).filter(Boolean),Z=ns(ae),D=Z,U="";if(a&&a!=="Change"){D=Z.filter(I=>I.class===a);let G=sl[a];if(!D.length&&G){let I=Z.filter(L=>L.class===G);I.length&&(D=I,U=`, widened to ${G} subjects (no ${a} recorded)`)}}return{matches:D,objMatch:c,candidates:u,traversal:`${z.join("+")} edges where subject = ${c.label}${U}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:No(e,c,{maxDepth:Lm}).flat().map(z=>e.byId.get(z.id)).filter(Boolean),objMatch:c,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${c.label} (impactClosure, maxDepth=${Lm})`};let g=Wo[i]||Ot(i).find(T=>Fm.has(T))||null,b=!!(c.class&&Es.has(c.class));if(g&&(Es.has(a)||b)){let T=Ke(e,g).filter(U=>U.object===c.id),M=ns(T.map(U=>e.byId.get(U.subject)).filter(Boolean)),z=!a||a==="Change"?M:M.filter(U=>U.class===a),Y="",ae=sl[a];if(!z.length&&ae){let U=M.filter(G=>G.class===ae);U.length&&(z=U,Y=`, widened to ${ae} subjects (no ${a} recorded)`)}let Z=(i==="touches"||i==="calls"||i==="uses")&&c.class==="Class"&&!Ke(e,"contains").some(U=>U.subject===c.id),D=Z?e.byId.get(Go(e,c)||""):null;if(z.length||!(Z&&D))return{matches:z,objMatch:c,candidates:u,traversal:`${g} edges where object = ${c.label}${Y}`,ambiguous:d,matchedVia:p}}let y=c,w=u,v=d,_=p,$="",x=Gm(e,i);if(x&&y.class&&y.class!==x){let T=xn(e,t.object,{expectedClass:x});if(T.match&&!T.ambiguous)y=T.match,w=T.candidates,v=T.ambiguous,_=T.matchedVia;else if(x==="Module"){let M=Go(e,y),z=M&&e.byId.get(M);if(z)$=`, refined from ${y.label} to its containing module`,y=z;else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:_,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${es(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${es(x)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:_,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${es(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${es(x)})`}}let S=Ot(i).flatMap(T=>Ke(e,T)).filter(T=>T.object===y.id);i==="cochange"&&(S=S.concat(Ot(i).flatMap(T=>Ke(e,T)).filter(T=>T.subject===y.id).map(T=>({...T,subject:T.object,object:T.subject}))));let E="";if(!S.length&&y.class){let T=`ext:${String(y.label).toLowerCase()}`;S=Ot(i).flatMap(M=>Ke(e,M)).filter(M=>String(M.object).toLowerCase()===T),S.length&&(E=` (by name, via unresolved ${T} references)`)}let R=[],j=new Set;for(let T of S){let M=e.byId.get(T.subject);M&&!j.has(M.id)&&(j.add(M.id),R.push(M))}let A,F="";if(!a||a==="Change")A=R;else{let T=R.filter(M=>M.class===a);if(T.length)A=T;else if(a!=="Module"&&R.some(M=>M.class==="Module")){let M=new Set(R.filter(z=>z.class==="Module").map(z=>z.id));A=kl(e,M,a),F=`, then ${es(a)} defined in the matched module(s)`}else A=[]}return{matches:A,objMatch:y,candidates:w,traversal:`${Ot(i).join("+")} edges where object = ${y.label}${E}${F}${$}`,ambiguous:v,matchedVia:_}}function zr(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 il(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function uk(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function $n(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function Pr(e){let t=e.object??e.subject??"?";return`${e.entityType?Me(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function hl(e){return vr[e]?.bare||e}function dk(e){let t=hl(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function pk(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=Me(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 ${hl(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 ${hl(o.kind)} ${JSON.stringify(String(r))}`}function ah(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(Pr).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>ah(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?pk(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 ":""}${eo(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?Me(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${eo(e.kind)}`:`${r}${eo(e.kind)} "${e.object}"`}return{english:o,machine:s}}function vn(e,t,n=null){let s=ch(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function ch(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${Sl()}`,miss:!0,ambiguous:!1};if(e.node)return QS(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
53
+ `)}`+(o.length>qc?`
54
+ \u2026+${o.length-qc} more`:"")}var Hc,tf,mf,of,Mv,Dv,Wc,zv,Mi,Uv,Bv,Wv,wf,Gv,Vv,qv,Hv,Kv,Yv,Xv,Jv,Qv,Zv,ex,tx,nx,sx,ox,rx,ix,ax,cx,lx,ux,dx,px,fx,hx,rf,mx,gx,yf,$f,vf,bx,wx,yx,$x,vx,cf,lf,Sx,uf,Li,df,pf,ff,Tr,Pe,jx,_x,Af,Rx,Bt,Lf,Tx,Gf,Ix,Cx,Ox,Lx,Nx,Px,Mx,Fx,Gc,hf,zi,Dx,Vc,qc,Oe=O(()=>{$s();Kn();Fc();Rr();Qs();Hc="This store holds no code index, so it records no modules or commits to look through.",tf={"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"};mf=e=>/^(git|turn):/.test(String(e||""));of=30,Mv=8;Dv=2,Wc=25,zv=3;Mi=10,Uv=8,Bv=3,Wv=2,wf=5,Gv=4,Vv=.2,qv=.35,Hv=.15,Kv=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),Yv=.2,Xv=.35,Jv=.2,Qv=.35,Zv=e=>/\.cs$/i.test(e),ex=e=>/^I[A-Z]/.test(String(e||"")),tx=.2,nx=.35,sx=50,ox=.2,rx=.35,ix=.5,ax=wf,cx=3,lx=4,ux=1,dx=.9,px=.5,fx=.2,hx=.35,rf=4,mx=2,gx=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],yf=3,$f=12,vf=.9,bx=["imports","calls","callsSymbol","inherits"],wx=.5,yx=.6,$x=.2,vx=.35;cf=128,lf=4,Sx=64,uf=250,Li=class extends Error{};df=new WeakMap;pf=40,ff=40,Tr=30;Pe=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";jx=25,_x=15;Af=40,Rx="tests edges are recorded module to module, so this is module-grain coverage.";Bt=15;Lf=new Set(["Function","Method"]);Tx=8;Gf={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};Ix=8,Cx=16,Ox=4,Lx=6,Nx=12,Px=2,Mx=8,Fx=3,Gc=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),hf=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),zi=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},Dx=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};Vc=20;qc=40});function Qe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sh(e){let t=String(e||"");return Jf&&(t=t.replace(Jf," ")),t.replace(/\s+/g," ").trim()}function oh(e){let t=String(e||"");t=t.replace(iE," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(sE);if(o&&(t=o[1].trim()),o=t.match(oE),o&&(t=o[1].trim()),o=t.match(Qf),o&&(t=o[1].trim()),o=t.match(Zf),o&&(t=o[1].trim()),o=t.match(eh),o&&(t=o[1].trim()),o=t.match(rE),o&&(t=o[1].trim()),o=t.match(th),o&&(t=o[1].trim()),o=t.match(aE),o&&(t=o[1].trim()),o=t.match(cE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(lE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(uE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(dE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(pE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(fE),o&&xs.test(o[1].trim())&&(t=o[1].trim()),o=t.match(hE),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(mE),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(gE),o){let r=o[1].trim();nE(r)||(t=!bE.test(r)&&(Zx.test(r)||xs.test(r))?r:`describe ${r}`)}if(o=t.match(wE),o){let r=o[1].trim();(xs.test(r)||yE.test(r)||th.test(r)||Qf.test(r)||eh.test(r)||Zf.test(r)||$E.test(r))&&(t=r)}if(t===s)break}return t}function EE(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(vE);if(o&&(t=o[1].trim()),o=t.match(xE),o&&(t=o[1].trim()),t===s)break}return t}function kE(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(SE);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function RE(e){let t=String(e||""),n=t.match(_E);if(n){let o=ih[n[1].toLowerCase()],r=rh[n[2].toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${n[4].toLowerCase()}`}let s=t.match(ah);return s?`which modules transitively import ${s[1].trim()}`:t}function Bi(e){return String(e||"").replace(Vx,t=>Tc[t.toLowerCase()])}function eo(e){let t=Bi(e);return t=t.replace(qx,n=>Ac[n.toLowerCase()]),t=t.replace(Hx,n=>Ic[n.toLowerCase()]),t=t.replace(Kx,"with"),t=t.replace(Yx,(n,s)=>`${s} for`),t=t.replace(Xx,(n,s)=>`for ${s}`),t=t.replace(Jx,(n,s)=>s),t=t.replace(TE,"$1$2"),t=t.replace(kp,"$1ing"),t=oh(t),t=kE(t),t=EE(t),t=RE(t),t=sh(t),t=en(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Ar(e){for(let t of[..._p,...jp]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Zc(e){for(let t of AE){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function ch(e){let t=String(e||"").match(IE);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var Gx,Vx,nh,qx,Hx,Kx,Yx,Xx,Jx,Qx,Jf,Zx,xs,eE,tE,nE,sE,oE,Qf,Zf,eh,rE,iE,aE,cE,lE,uE,dE,pE,fE,hE,mE,gE,bE,wE,yE,$E,th,vE,xE,SE,rh,ih,jE,_E,ah,TE,AE,IE,tt,Wt,fe,$n=O(()=>{qn();Gx=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Qe).join("|")+")\\b","gi"),Vx=Gx(Tc),nh=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(Qe).join("|")+")\\b(?!\\.[a-z0-9])","gi"),qx=nh(Ac),Hx=nh(Ic),Kx=/(?<=^|\s)w\/(?=\s|$)/gi,Yx=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,Xx=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,Jx=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,Qx=Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|"),Jf=Sr.length?new RegExp("\\b("+[...Sr].sort((e,t)=>t.length-e.length).map(Qe).join("|")+")\\b\\s*,?","gi"):null;Zx=new RegExp("\\b(?:"+Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|")+")\\b","i"),xs=/^(?:which|what|who|whose|where|when|why|how)\b/i,eE=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),tE=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,nE=e=>{if(tE.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return eE.has((t[t.length-1]||"").toLowerCase())},sE=/^(?: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,oE=/^(?: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,Qf=/^(?:(?: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,Zf=/^(?: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,eh=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,rE=/^(?:please[\s,]+)+(.+)$/i,iE=/,?\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,aE=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,cE=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,lE=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,uE=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,dE=/^do\s+you\s+know\s+(.+?)\??$/i,pE=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,fE=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,hE=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,mE=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,gE=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,bE=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,wE=/^(?:and|also|so|then|now|but)\s+(.+)$/i,yE=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,$E=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,th=/^(?:(?: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;vE=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,xE=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;SE=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;rh=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),ih=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),jE="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",_E=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(ih).join("|")+")\\s+("+Object.keys(rh).join("|")+")\\s+(.+?),\\s*(?:is|are)\\s+(?:it|that|they|this)\\s+("+jE+")\\??$","i"),ah=/^if\s+(.+?)\s+(?:were|was)\s+(?:deleted|removed),?\s*what\s+(?:would|might|could)\s+(?:break|fail|be\s+affected)\??$/i;TE=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${_c.map(Qe).join("|")})(\\s*[?.!]*)$`,"i");AE=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+(?:${Rc.map(Qe).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+(${Qx})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);IE=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");tt=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"]),Wt=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),fe=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var uh,lh=O(()=>{uh={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","chapped","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","seifing","seiing","seined","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 Zn(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 tl(e){return/^[a-z]+$/.test(e)&&!tt.has(e)&&!el.has(e)}function fh(e){return NE(e)?null:Wi(e,ph,es(e))}function Wi(e,t,n=es(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Zn(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 OE,es,el,dh,ph,LE,NE,Mo=O(()=>{qn();lh();$n();OE=["used"];es=e=>e.length<=5?1:2,el=new Set([...Object.keys(de),...Object.keys(Be),...Object.keys(tn),...OE].flatMap(e=>e.split(" "))),dh=4,ph=[...new Set([...Object.keys(de),...Object.keys(tn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=dh))],LE=new Set(uh.words),NE=e=>LE.has(e)});function Fo(e){for(let t of DE){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var Gi,PE,ME,FE,nl,DE,hh,Vi=O(()=>{qn();$n();Gi=Object.keys(de).sort((e,t)=>t.length-e.length).map(Qe).join("|"),PE=Object.keys(Be).sort((e,t)=>t.length-e.length).map(Qe).join("|"),ME=Object.keys(tn).sort((e,t)=>t.length-e.length).map(Qe).join("|"),FE=qs.slice().sort((e,t)=>t.length-e.length).map(Qe).join("|"),nl=(e,t)=>e==="defines"&&Er.has(t),DE=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${Gi})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];if(nl(n,t))return null;let s=e[1].trim(),o=e[3].trim();return xr.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+(${PE})\\s+(?:(${ME})\\s+)?(${Gi})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=de[t];return nl(n,t)?null:{shape:"reverse",entityType:Be[e[1].toLowerCase()],modifier:e[2]?tn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()}}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${Gi})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=de[t];return nl(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+(?:${FE})\\??$`,"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=en(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!Be[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&Ep.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:bs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${yn.map(Qe).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+(?:${Zt.map(Qe).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+)?(${Gi})\\??$`,"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()})}];hh={id:"grammar",class:"graph-query",run(e){let t=Fo(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function mh(e){let t=e.trim().split(/\s+/);return t.length>1&&ki.has(t[0].toLowerCase())}function WE(e){return de[e.trim().toLowerCase()]==="calls"}function Tt(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 Cr(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(S=>S.toLowerCase());if(s.includes("where")&&!Tt(s,de)){let S=s.some(j=>yn.includes(j)),E=new Set([...Zt,...yn]),R=n.filter((j,A)=>!tt.has(s[A])&&!E.has(s[A])).join(" ").trim();if(R){let j=S?"mentions":"where";return{shape:j,entityType:null,modifier:"direct",kind:j,object:R}}}if(new Set(["has","have","had"]).has(s[0])){let S=s.length;for(;S>1&&(s[S-1]==="ever"||s[S-1]==="been");)S-=1;if((S>1?de[s[S-1]]:null)==="touches"){let R=n.slice(1,S-1).filter((j,A)=>!tt.has(s[1+A])).join(" ").trim();if(R)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:R}}}let r=s,i=Tt(s,de);if(!i&&t){let S=s.map(E=>{if(!tl(E))return E;let R=t.lemma(E);return el.has(R)?R:E});i=Tt(S,de),i&&(r=S)}let a=null;if(!i){let S=s.map(E=>E.length>=4&&tl(E)&&fh(E)||E);if(i=Tt(S,de),i){r=S;let E=s.slice(i.start,i.end).findIndex((j,A)=>j!==S[i.start+A]),R=i.start+Math.max(E,0);a={from:s[R],to:S[R]}}}let l=!1;if(!i)for(let S=0;S<s.length;S+=1){let E=ws[s[S]];if(!(E&&s[S]==="used"&&s[S+1]==="for")&&E&&s.slice(0,S).some(R=>Ir.has(R))){i={kind:E,start:S,end:S+1},l=!0;break}}if(!i)return null;!l&&i.end-i.start===1&&ws[s[i.start]]&&s.slice(0,i.start).some(S=>Ir.has(S))&&(l=!0);let c=S=>a?{...S,fuzzyVerb:a}:S;if(t&&i.end-i.start===1){let S=i.start,E=s[S-1];if((E==="the"||E==="these"||E==="those")&&s[S+1]==="of"&&t.posTags(n)[S]==="NOUN"){let j=n.slice(S+2).filter((A,F)=>!tt.has(s[S+2+F])).join(" ").trim();if(j)return c({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:j})}}let u=new Set,d=S=>{if(S)for(let E=S.start;E<S.end;E+=1)u.add(E)};d(i);for(let[S,E]of Object.entries(de)){if(E!==i.kind)continue;let R=S.split(" "),j=i.end;if(R.every((A,F)=>r[j+F]===A)){d({start:j,end:j+R.length});break}}let f=Tt(r,Be,u);d(f);let p=Tt(r,tn,u);d(p);let h=(S,E)=>n.slice(S,E).filter((R,j)=>!u.has(S+j)&&!tt.has(s[S+j])).join(" ").trim(),m=h(0,i.start),g=h(i.end,n.length);l&&!s.includes("by")&&BE.has(g.toLowerCase())&&(g="");let b=i.kind,y=f?Be[r.slice(f.start,f.end).join(" ")]:null,w=p?tn[r.slice(p.start,p.end).join(" ")]:"direct";if(b==="touches"&&s.includes("when")){let S=m||g;if(S)return c({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:S})}if(b==="touches"&&s.includes("who")&&s.includes("last")){let S=m||g;if(S)return c({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:S})}let v=s.indexOf("by"),_=s.slice(0,i.start).findIndex(S=>Ir.has(S)),$=_>=0,x=$&&_>v;if(v>=0&&!u.has(v)&&$){let S=(j,A)=>n.slice(j,A).filter((F,T)=>{let M=j+T,z=s[M];return!u.has(M)&&!tt.has(z)&&z!=="by"&&!Ir.has(z)&&!zE.has(z)&&!UE.has(z)}).join(" ").trim(),[E,R]=x?[S(_+1,n.length),S(v+1,_)]:[S(0,v),S(v+1,n.length)];if(E&&R)return b==="defines"&&Er.has(r.slice(i.start,i.end).join(" "))?null:c({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:R,object:E});if(R)return c({shape:"forward",entityType:y,modifier:w,kind:b,object:R});if(E)return c({shape:"reverse",entityType:y,modifier:w,kind:b,object:E})}if(l&&v<0&&g&&s[i.start]==="called")return null;if(m&&g){let S=r.slice(i.start,i.end).join(" ");if(b==="defines"&&Er.has(S)||b==="calls"&&(mh(g)||WE(m)))return null;let E=m,R=g;return xr.includes(S)&&([E,R]=[R,E]),c({shape:"ask",entityType:null,modifier:"direct",kind:b,subject:E,object:R})}if(g){if(b==="calls"&&mh(g))return null;let S=f&&f.start>=i.end?null:y;return c({shape:"reverse",entityType:S,modifier:w,kind:b,object:g})}if(b==="inherits"&&!m&&f&&f.start===i.end){let S=r.slice(f.start,f.end).join(" ");if(S)return c({shape:"reverse",entityType:null,modifier:w,kind:b,object:S})}if(m&&!g&&$&&i.end-i.start===1&&ws[s[i.start]]){if(m.split(/\s+/).length>1)return null;if(b==="touches")return c({shape:"when",entityType:null,modifier:"direct",kind:b,object:m});let S=Ir.has(s[0]);return c({shape:"reverse",entityType:y,modifier:w,kind:b,object:m,...S?{polar:!0}:{}})}return m?c({shape:"forward",entityType:y,modifier:"direct",kind:b,object:m}):null}var Ir,zE,UE,BE,gh,qi=O(()=>{qn();$n();Mo();Ir=new Set(["is","are","was","were","be","been","being","get","gets","got"]),zE=new Set(["which","what","who","whom","whose"]),UE=new Set(Vn.map(e=>e.toLowerCase())),BE=new Set(["recently","lately","yet","already","ever","again"]);gh={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Cr(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function VE(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)||bh.has(l)||!s.has(l)||o[i]==="VERB"&&r.push(l)}return r}function qE(e,t=null){let n=Wt(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!bh.has(a)&&(GE.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=VE(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var bh,GE,wh,yh=O(()=>{qn();$n();Vi();qi();bh=new Set([...tt,...fe(Vs),...fe(Object.keys(de)),...fe(Object.keys(Be)),...fe(Object.keys(tn)),...fe(Object.keys(Xe)),...fe(Hs),...fe(Ks),...fe(Object.keys(ys)),...fe(Object.keys(Rn)),...fe(Object.keys(jo)),...fe(Vn),...fe(kr),...fe(qs),...fe(Zt),...fe(yn),...fe(Gn),...fe(Object.keys(Ro))]),GE=new Set([...fe(Sr),...fe(ji)]);wh={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Fo(e))return null;let{text:n,dropped:s,maybeNoise:o}=qE(e,t.nlp||null);if(!s.length||!n)return null;let r=Fo(n)||Cr(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 $h=O(()=>{});var Hi,Ki=O(()=>{Hi=()=>{}});function xh(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Do(e.subject)===Do(t.subject)&&Do(e.object)===Do(t.object):Do(e.object)===Do(t.object)}function sl(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=>!Eh(c))&&(n=n.filter(c=>!Eh(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=>xh(h.parsed,f.parsed)&&h.via===f.via);if(p){p.agreed+=1,p.confidence=Math.max(p.confidence,f.confidence),vh(f.parsed)<vh(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=>xh(u.parsed,c.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:l}}function YE(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 Sh(e,{describe:t=YE,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 Do,HE,vh,KE,Eh,ol=O(()=>{Do=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),HE=/^\s*(?:the|a|an)\s+/i,vh=e=>[e?.subject,e?.object].filter(t=>HE.test(String(t||""))).length;KE=new Set(["fuzzy","lemma","spell"]),Eh=e=>KE.has(e.via)});function Yi(e){rl=e}function Xi(){return typeof rl=="function"?rl():null}var rl,zo=O(()=>{rl=null});function _h(e,t={},n=JE){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 XE,JE,Rh=O(()=>{$n();Vi();qi();yh();$h();Ki();ol();zo();XE=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],JE=[hh,gh,wh,...XE]});function Uo(e){return QE.test(String(e||"").trim())?"an":"a"}function Ji(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 Bo(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Or(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 QE,Qi=O(()=>{QE=/^[aeiou]/i});var Lr,il=O(()=>{Lr=(e,t,n)=>n});var bm={};Wn(bm,{DYNAMIC_TAIL_OK_RE:()=>Ll,applyNegationFrames:()=>Ar,ask:()=>js,classDisplayName:()=>ts,degreeMetric:()=>cm,metaFallbackEntityAnswer:()=>tm,normalizeQuery:()=>eo,parseQuery:()=>Dr,parseQueryFull:()=>vl,render:()=>xn,rephraseHint:()=>Rl,resolveObject:()=>En,traverse:()=>Gt,worldRelationGraphPayload:()=>qk});function Ke(e,t){let n=Th.get(e);n||(n=new Map,Th.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Qn(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Me(e,t){let[n,s]=pl[e]||["result","results"];return t===1?n:s}function Ur(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${Me(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function ts(e){let t=String(e||"");if(typeof Tn=="function"){let n=Tn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function to(e){return eS[e]||e}function rS(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||oS.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return fe(qs).includes(o)?t:e}function cS(e,t){if(!e||e.shape!=="where"||e.altObject||!iS.test(t))return e;let n=Si(t),s=Si(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=Wt(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||tt.has(i)||de[i]||i.endsWith("ing"))return o;let a=Wt(n).map(c=>c.toLowerCase());for(;a.length&&aS.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 Dr(e,{nlp:t=void 0}={}){return vl(e,{nlp:t}).parsed}function vl(e,{nlp:t=void 0}={}){let n=t===void 0?Xi():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Zc(Ar(eo(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=uS(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=sl(_h(o,{nlp:n,raw:s}));return i?{parsed:cS(rS(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function hl(e,t){return t.length&&Vh.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Vo(e,t){return Fo(e)||Cr(e,t)}function uS(e,t){let n=Wt(e),s=n.map(o=>o.toLowerCase());return AS(n,s)||CS(n,s)||hS(n,s,t)||Hh(e,t,0)||OS(n,s,t)||gS(n,s,t)||ES(n,s,t,0)||kS(n,s)||RS(n,s,t)||LS(n,s,t)||MS(n,s,t)||DS(n,s,t,0)||PS(n,s,t,0)||El(n,s,t,0)||wS(n,s,t)||pS(n,s)||Zh(n,s,t,0)}function pS(e,t){let n=0;dS.has(t[n])&&(n+=1);let s=At(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=h=>h+1<t.length?Sp[`${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 ea(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function hS(e,t,n){if(!["do","does","did"].includes(t[0])||!fS.has(t[1]))return null;let s=At(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=Tt(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)&&!tt.has(a[p])&&a[p]!=="from").join(" ").trim();if(!u)return null;let d=qo(`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:ea(o,{op:"difference",kind:"set",ast:d})}}function Hh(e,t,n=0){let s=ch(e);if(!s)return null;let o=At(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=Wt(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Xe[d]))return ea(r,{op:"difference",kind:"qual",filters:a});let l=Tt(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)&&!tt.has(a[f])&&a[f]!=="from").length)return ea(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:l.kind}});let u=qo(`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"}:ea(r,{op:"difference",kind:"set",ast:u})}function gS(e,t,n){let s=0;for(;s<t.length&&mS.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=Tt(r,de);if(!a)return null;let c=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!tt.has(r[d])).join(" ").trim();return c?{node:"forwardComplement",kind:a.kind,subjectTerm:c}:null}function Kh(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 Yh(e,t){let n=Lt(t),s=n.filter(r=>!Wh.has(r)),o=Kh(e,s.length?s:n);return o.size===1?[...o][0]:null}function qo(e,t,n){if(n>Gh)return{node:"miss",reason:"too deep to resolve"};let s=Hh(e,t,n);if(s)return s;let o=Wt(e),r=o.map(c=>c.toLowerCase()),i=El(o,r,t,n);if(i)return i;let a=Zh(o,r,t,n);if(a)return a;let l=Vo(e,t);return l?{node:"clause",clause:l}:null}function El(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=Gn.includes(t[o]),i=!r&&qh(t[o]);if(!r&&!i||r&&o+1>=t.length||!At(t[o-1]))continue;let l=e.slice(0,o-1);if(!l.length||l.every(f=>Xe[f.toLowerCase()]))continue;let c=Vo([...l,fl].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=qo(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 wS(e,t,n){for(let s=0;s<t.length;s+=1){if(!bS.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),fl,...e.slice(s+1)],a=Vo(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===fl&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function ES(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!yS.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if($S.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&&vS.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&xS.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>Gn.includes(d)))return null;let l=xl.has(a[0])?i.join(" "):`which ${i.join(" ")}`,c=qo(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=At(a[0]);return{node:"temporal",inner:c,entityType:u&&u.entityType||null}}function kS(e,t){if(t[0]!=="what"||t[1]!=="changed")return null;let n=2;if(t[n]==="ever"&&(n+=1),!SS.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 _S(e){let t=new Set,n=[];for(let s of e){if(!s||!jS.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function RS(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(!kr.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&&(Hs.includes(f)||Ks.includes(f))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=Hs.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=TS(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=_S(e.slice(0,l)),u={node:"anaphora",mode:i,filter:a};return c.length>=2&&(u.candidateTerms=c),u}function TS(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&lS.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Xe[a]))return{type:"qual",filters:r};if(o.length===1){let a=At(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Vo(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function AS(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?At(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 IS(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=bs(n).slice(e.length).trim(),o=Wt(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 CS(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(Xe[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&&ws[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&&!Rp.has(u))return null}let r=IS(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 OS(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=Vo(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function LS(e,t,n){let s=Hs.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&&Xe[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?At(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=>!tt.has(d)&&!Xh.has(d)),u;if(c){let d=qo(`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 PS(e,t,n,s){let o=0,r=!1,i=null;for(let y of Jh){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&&Sl.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Xe[t[o]];)a.push(t[o]),o+=1;let l=o<t.length?At(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]]&&!Vn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Qh}`}:null;let c=l.entityType,u=t[o];o+=1;let d=e.slice(o),f=t.slice(o).some(y=>!tt.has(y)&&!Xh.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&&NS.has(p[0]);if(r&&(f&&!m||d.length===0))return null;let g,b=!1;if(f){let y=m?h:d,w=qo(`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"};g=w,b=!0}else g={node:"allOfClass",entityType:c},a.length&&(g={node:"qualifier",filters:a,inner:g});return{node:"list",entityType:c,base:g,scoped:b}}function MS(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(ys[m]){s=ys[m],o=h;break}if(ys[t[h]]){s=ys[t[h]],o=h;break}}if(!s)return null;let r=null,i=null;for(let h=o;h<t.length;h+=1)if(Rn[t[h]]){r=Rn[t[h]],i=t[h];break}if(!r){for(let h=o-1;h>=0;h-=1)if(Rn[t[h]]){r=Rn[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=Rn.connections,i="connections");let u,d=null;for(let h of t){let m=At(h);if(m&&!m.placeholder){u=m.entityType,d=h;break}}if(!d&&(u=i?Tp[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 DS(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&Sl.has(t[o]);)o+=1;if(o>=t.length)return null;let r=At(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&FS.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=At(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=>Gn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!de[t[o]]&&!Vn.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${Qh}`}:null}function zS(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&Sl.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(Gn.includes(t[i])){s=i;break}if(s<0)return null;let o=At(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 US(e,t,n,s,o,r){let{branches:i,ops:a}=ta(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=hl(d,f);if(h.blc.length&&h.blc.every(y=>Xe[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,g=Tt(f,de);g?l=d.slice(g.start,g.end):l&&(m=[...l,...d]);let b=em(`${t} ${m.join(" ")}`,o,r);if(!b||b.node==="miss")return{miss:b&&b.reason||"a clause in the combination didn't parse"};c.push({op:p,kind:"set",ast:b})}return{atoms:c}}function Zh(e,t,n,s){let o=zS(e,t);if(o){let{entityType:R,term:j,relIdx:A}=o,F=t.slice(A+1),T=e.slice(A+1);if(!F.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[A]}"`};let M=US(R,`which ${t[A-1]}`,F,T,n,s+1);if(M.miss)return{node:"miss",reason:M.miss};let z=[{op:"seed",kind:"set",ast:{node:"find",entityType:R,term:j}},...M.atoms];return z.length===1?z[0].ast:{node:"boolean",entityType:R,atoms:z}}let r=0;for(;r<t.length&&xl.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Xe[t[r]];)a.push(t[r]),r+=1;let l=r<t.length?At(t[r]):null;if(!l){let R=r+1<t.length?At(t[r+1]):null;if(Ah.has(t[r])&&R&&R.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(Vh.has(t[r])){let j=r+1;j<t.length&&(t[j]==="the"||t[j]==="a"||t[j]==="an")&&(j+=1);let A=j+1<t.length?At(t[j+1]):null;if(Ah.has(t[j])&&A&&A.entityType==="Commit"&&j+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&R&&/^[a-z]+$/.test(t[r])&&!de[t[r]]&&!tt.has(t[r])&&!Cl.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&&Gn.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&&qh(d[0]),g=f.length>0&&ta(d,f).branches.some(R=>{let{blc:j}=hl(R,R.map(A=>A.toLowerCase()));return j.length&&j.every(A=>Xe[A])}),b=f.length>0?ta(d,f).branches:[],y=!1;if(b.length>1){let R=b[0].map(A=>A.toLowerCase()),j=Tt(R,de);j&&j.start===0&&(y=b.slice(1).every(A=>{let F=A.map(M=>M.toLowerCase()),T=Tt(F,de);return T&&T.start===0?T.kind===j.kind:!T}))}let w=!1;if(b.length>1){let R=b[0].map(A=>A.toLowerCase()),j=Tt(R,de);j&&j.start===0&&(w=b.slice(1).every(A=>{let F=A.map(M=>M.toLowerCase()),T=Tt(F,de);return!!T&&T.start===0&&T.end-T.start===1}))}if(!(a.length||p||h||m||g||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:_,ops:$}=ta(d,f),x=null,S=[];for(let R=0;R<_.length;R+=1){let j=_[R],A=j.map(ce=>ce.toLowerCase()),F=R===0?"seed":$[R-1],T=hl(j,A);if(T.blc.length&&T.blc.every(ce=>Xe[ce])){S.push({op:F,kind:"qual",filters:T.blc});continue}if(A[0]==="of"||A[0]==="in"){S.push({op:F,kind:"set",ast:{node:"membership",entityType:c,term:j.slice(1).join(" ")}});continue}let M=j,z=Tt(A,de);z?x=j.slice(z.start,z.end):x&&(M=[...x,...j]);let K=em(`${v} ${M.join(" ")}`,n,s+1);if(!K||K.node==="miss")return{node:"miss",reason:K&&K.reason||"a clause in the combination didn't parse"};S.push({op:F,kind:"set",ast:K})}if(S[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let E;return S.length===1?E=S[0].ast:E={node:"boolean",entityType:c,atoms:S},a.length&&(E={node:"qualifier",filters:a,inner:E,entityType:c}),E}function em(e,t,n){if(n>Gh)return{node:"miss",reason:"too deep to resolve"};let s=Wt(e),o=s.map(a=>a.toLowerCase()),r=El(s,o,t,n);if(r)return r;let i=Vo(e,t);return i?{node:"clause",clause:i}:null}function ta(e,t){let n=Object.keys(jo).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(jo[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 kl(e,t,n,s){let o=Wo[t];if(o&&ks.has(n)){let u=Ke(e,o).filter(d=>s.has(d.object));return ss(u.map(d=>e.byId.get(d.subject)).filter(d=>d&&d.class===n))}let a=(!!o&&[...s].some(u=>ks.has(e.byId.get(u)?.class))?[...Lt(t),o]:Lt(t)).flatMap(u=>Ke(e,u)).filter(u=>s.has(u.object)),l=ss(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")?Tl(e,new Set(l.filter(u=>u.class==="Module").map(u=>u.id)),n):[]}function WS(e,t){let n=new Set(kl(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=BS.exec(String(o||""));r&&n.add(r[1].toLowerCase())}return n.size}function Mr(e,t,n){let s=Lt(t).flatMap(o=>Ke(e,o)).filter(o=>n.has(o.subject));return ss(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function ss(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 GS(e,t){let n=Xn(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&Xn(o.label).startsWith(s))}function ml(e){let t=Ih.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},Ih.set(e,t),t}function Go(e,t){return t?t.class==="Module"?t.id:ml(e).moduleOfSymbol.get(t.id)||null:null}function tm(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>VS.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Go(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=Me(o.class,1),l=a==="attribute"?"an":"a",c=i?`, ${Lr("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 gl(e,t,n){let s=ss(_o.flatMap(o=>Mr(e,o,new Set([t]))));return n?s.filter(o=>o.class===n):s}function jl(e,t,n=null){let s=ns(e,t,n);if(!(s.match&&s.tier===1)){let o=GS(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 nm(e,t,n,s,o){let r=o||(()=>!0),i=gl(e,t,s).filter(r);if(i.length||!om(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of sm(e,t)){let l=e.byId.get(a);if(!l)continue;let c=gl(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 no(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=Go(e,t),o=ml(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&Js(String(r.label).toLowerCase()))?!1:(!!s&&o.testedModules.has(s))===n.value}default:return!1}}function _l(e){return Ke(e,"inherits")}function bl(e,t){return _l(e).filter(n=>n.object===t).map(n=>n.subject)}function Ch(e,t){return _l(e).filter(n=>n.subject===t).map(n=>n.object)}function qS(e,t){let n=new Set,s=[...bl(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of bl(e,o))n.has(r)||s.push(r)}}return n}function sm(e,t){let n=new Set,s=[...Ch(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Ch(e,o))n.has(r)||s.push(r)}}return n}function om(e,t){let n=Oh.get(e);if(n||(n=new Map,Oh.set(e,n)),n.has(t))return n.get(t);let s=_l(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 Lh(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 Ph(e){return e.slice().sort((t,n)=>Nh[n.via]-Nh[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Mh(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=es(n);if(Zn(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of so(e.label))if(Zn(o,n,s)<=s)return!0;return!1}function rm(e,t,n){let s=e.individuals.filter(l=>l.class===t),o=[...so(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=om(e,t),i=[];for(let l of s){let c=Lh(l,o);if(c){i.push({ind:l,via:c});continue}if(!r)continue;[...qS(e,l.id)].some(d=>{let f=e.byId.get(d);return!!f&&!!Lh(f,o)})&&i.push({ind:l,via:"chain"})}if(i.length||!r)return{narrow:Ph(i),broad:[]};let a=new Map;for(let l of s)for(let c of sm(e,l.id)){if(!a.has(c)){let u=e.byId.get(c);u&&u.class===t&&Mh(u,n)&&a.set(c,{ind:u,via:"chain"})}for(let u of bl(e,c)){if(u===l.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Mh(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Ph([...a.values()])}}function HS(e){return[...Fi(Di(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function un(e,t,n){switch(t.node){case"clause":return Gt(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?HS(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=rm(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Lt(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=ns(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=Yh(e,t.kind);if(!o)return[];let r=new Set(Mr(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(un(e,t.inner,n).map(o=>o.id));return kl(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(un(e,t.inner,n).map(o=>o.id));return Mr(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=jl(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 ss(_o.flatMap(l=>Mr(e,l,i))).filter(l=>l.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=nm(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"qualifier":return t.inner.node==="membership"?lm(e,t,n).matches:un(e,t.inner,n).filter(o=>t.filters.every(r=>no(e,o,Xe[r])));case"boolean":return im(e,t,n);case"anaphora":return am(e,t,n).matches;default:return[]}}function im(e,t,n){let s=[];for(let o of t.atoms){if(o.op==="seed"){s=un(e,o.ast,n);continue}if(o.kind==="qual"){let i=l=>o.filters.every(c=>no(e,l,Xe[c])),a=l=>o.filters.every(c=>{let u=KS(Xe[c]);return u?no(e,l,u):!no(e,l,Xe[c])});s=o.op==="difference"?s.filter(a):s.filter(i);continue}let r=new Set(un(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 un(e,o.ast,n))i.has(a.id)||(i.add(a.id),s.push(a))}}return s}function YS(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=En(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 am(e,t,n){let o=YS(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=>no(e,d,Xe[f])));else if(i&&i.type==="entity")r=r.filter(d=>d.class===i.entityType);else if(i&&i.type==="clause"){let d=En(e,i.clause.object);if(!d.match)r=[];else{let f=Wo[i.clause.kind],p=[...Lt(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=Ur(c,r,"anaphora",{bound:!0});return{compositeKind:"set",matches:r,entityType:c,referents:u}}function cm(e,t,n){let s=n.kind==="*"?XS:[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 JS(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 ZS(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(QS.test(s))r=s;else{let{match:u,ambiguous:d}=En(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 ek(e,t,n){let s=un(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=kl(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 tk(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)&&!Js(String(l.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:cm(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?Ur(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 lm(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=>no(e,h,Xe[m])):null,a=h=>Ur(r,h,"membership"),l=jl(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(g=>g.id));h=ss(_o.flatMap(g=>Mr(e,g,m))).filter(g=>g.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}=nm(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 nk(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=En(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=En(e,s,{expectedClass:n}),l=!r||a.match&&Go(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?Tl(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 sk(e,t,n){let s=Go(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||gl(e,n.id).some(o=>o.id===t.id)}function ok(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=ns(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=jl(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!sk(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=no(e,a.match,Xe[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 rk(e,t,n){let s=En(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=un(e,{node:"allOfClass",entityType:t.entityType},n),r=im(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 ik(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(un(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}=Gt(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function ak(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};if(t.node==="exists")return nk(e,t);if(t.node==="qualCheck")return ok(e,t,n);if(t.node==="universal")return rk(e,t,n);if(t.node==="count"){let i=ik(e,t.base,n);return i?{compositeKind:"count",count:WS(e,i),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:un(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:un(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return Wk(e,t);if(t.node==="superlative")return tk(e,t);if(t.node==="temporal")return ek(e,t,n);if(t.node==="recentCommits")return JS(e);if(t.node==="commitFilter")return ZS(e,t);if(t.node==="anaphora")return am(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return lm(e,t,n);if(t.node==="find"){let{narrow:i,broad:a}=rm(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=un(e,t,n),o=t.entityType||null,r=Ur(o,s,t.node==="qualifier"?"qualifierListing":"compositeSet");return{compositeKind:"set",matches:s,entityType:o,referents:r}}function um(){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 ck(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=zr(e);return n?`${t} in ${n}`:t}function wl(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(wl):Array.isArray(e.filters)&&e.filters.some(t=>Xe[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(wl)}function lk(e,t){return!["Function","Method"].includes(t)||!wl(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 uk(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})`:""}. ${um()}.`,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=Me(t.entityType,1),o=Me(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=zr(i),l=i.class==="Module"?"":a?`, ${Lr("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 ${Es(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=Me(t.entityType,t.total),o=nS(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}: ${Es(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?Me(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 ${Me(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>He?` \u2014 narrow with "${Me(t.entityType,2)} in <module>"`:"";return{content:`${Es(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=vn(t.asked),o=Gs[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?` (${Me(t.entityType,2)})`:""}. ${Ss(n)}`,miss:!0,ambiguous:!1,matches:[]};if(t.inheritedNotOwn){let s=Me(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${Es(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${Es(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=Me(t.entityType,1);if(!t.matches.length)return{content:`no ${Me(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?ck(t.matches[0]):Es(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:Me(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,Bt).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>Bt?` \u2026+${t.matches.length-Bt} 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,Bt).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>Bt?` \u2026+${t.matches.length-Bt} 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 ${Me(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:`${Es(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?Me(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. ${Ss(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. ${Ss(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=lk(e,t.entityType)||Ss(n);return{content:`nothing in the index matches that${t.entityType?` (${Me(t.entityType,2)})`:""}. ${s}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${Es(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function Rl(){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). `+um()}function Ss(e=null){return e&&Pi(e)===0?Hc:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function so(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function sa(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 dm(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function dk(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Nr(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(g=>g.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let g=i[2],b=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${g}`)||String(y.label).toLowerCase().startsWith(g)));if(b.length===1)return{match:b[0],candidates:[],tier:1,ambiguous:!1};if(b.length>1)return{match:b[0],candidates:b.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(g=>String(g.label).toLowerCase()===o||String(g.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let l=`ext:${o}`,c=null;e:for(let g of e.relations)for(let b of g.edges)if(String(b.object).toLowerCase()===l){c=b.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(g=>g.trim()).filter(Boolean);if(u.length>1){let g=new Set;for(let b of u){let y=Nr(e,b,{expectedClass:n});y.match&&!y.ambiguous&&g.add(y.match.id)}if(g.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],f=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(f){let g=o.split(".").pop();for(let b of r){let y=String(b.label||"").toLowerCase();b.class==="Module"?y.split("/").pop()===o&&d.push({ind:b,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:b,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${g}`)&&d.push({ind:b,score:1500-Math.abs(y.length-o.length)})}}else{let g=[...so(s)],b=o.split(/\s+/).find($=>$.includes("/")),y=b?b.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,_=v?dk(s):null;for(let $ of r){let x=String($.label||"").toLowerCase(),S=x.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(S===o){d.push({ind:$,score:5e3});continue}if(o.length>=4&&(S.startsWith(o)||S.endsWith(o))){d.push({ind:$,score:4e3-Math.abs(S.length-o.length)});continue}if(v){let j=dm($.label);if(j&&j===_){d.push({ind:$,score:5e3});continue}let A=/[/_-]/.test($.label)||/\.[a-z0-9]+$/i.test(String($.label||""));if(j&&A&&_.length>=4&&j.includes(_)){d.push({ind:$,score:2e3-Math.abs(j.length-_.length)});continue}}if($.class==="Module"){let j=sa(o);if(j!==o&&j===sa(S)){let A=es(o);if(Zn(S,o,A)>A){d.push({ind:$,score:3e3-Math.abs(S.length-o.length)});continue}}}if(o.length>=4&&x.includes(o)){d.push({ind:$,score:1e3-Math.abs(x.length-o.length)});continue}let E=so($.label),R=g.filter(j=>E.has(j)).length;R>0&&(!y||E.has(y))&&d.push({ind:$,score:R/g.length*cl})}}if(d.sort((g,b)=>b.score-g.score),d.length){let[g,...b]=d,y=b.filter(v=>v.score===g.score),w=g.score>=cl?b.filter(v=>v.score>=cl):b;return{match:g.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 Ys=="function"?Ys(e.proseIndex,s).filter(g=>!n||e.byId.get(g.id)?.class===n):[];if(m.length){let[g,...b]=m,y=e.byId.get(g.id);if(y){let w=b.filter(v=>v.score===g.score);if(h={match:y,candidates:b.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!h.ambiguous&&g.via!=="spell")return h}}if(!i&&o.length>=4){let g=es(o),b=g+1,y=[];for(let w of r){let v=Zn(String(w.label||"").toLowerCase(),o,g);if(v>0)for(let _ of so(w.label)){if(v<=0)break;v=Math.min(v,Zn(_,o,g))}v<b?(b=v,y=[w]):v===b&&v<=g&&y.push(w)}if(b<=g&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(b<=g&&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 ll(e,t){let n=dm(t),s=[...so(t)],o=[];for(let r of so(e))n.includes(r)||s.some(i=>sa(i)===sa(r))||na.has(r)||hm.has(r)||o.push(r);return o}function Zi(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(ll(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),ll(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:vn(s.slice(0,4).map(r=>r.label))}:e}let n=ll(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function En(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(pk,"").trim(),i=r.match(fk);if(i){let a=r.slice(0,i.index).trim(),l=Be[i[1].toLowerCase()];if(a&&l){let c=Zi(Nr(e,a,{expectedClass:l}),a);if(c?.match?.id&&!c.ambiguous)return c}}if(r&&r!==o){let a=Zi(Nr(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Zi(Nr(e,t,n),t)}return Zi(Nr(e,t,n),t)}function ns(e,t,n){if(Vs.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 En(e,t)}function Tl(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 hk(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||ks.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],l=a.flatMap(c=>Ke(e,c)).filter(c=>c.subject===t.id).map(c=>e.byId.get(c.object)).filter(Boolean);return n&&ks.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 wk(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&Al.has(Fh(s.label))).map(s=>({ind:s,named:n.has(Fh(s.label))?1:0,depth:String(s.label).split("/").length,fixture:bk(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 yk(e,t,n){return e==="reverse"&&(t==="imports"||t==="calls")&&(!n||n==="Module")}function Il(e){return(e?.attributes||[]).find(t=>t.prop===$k)?.value||null}function vk(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Uo(e)} ${e} in this graph's vocabulary`}function Gt(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 ak(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let T=t.candidates.map(M=>{let z=Gt(e,M,{contextId:n,prev:s});return{parsed:M,result:z,rendered:xn(M,z,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(),M=T.toLowerCase(),z=(e.individuals||[]).find(K=>{if(!Il(K))return!1;if(String(K.label).toLowerCase()===M)return!0;let ce=(K.attributes||[]).find(Z=>Z.key==="token")?.value;return ce&&String(ce).toLowerCase()===M});if(!z){let K=tm(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:[z],objMatch:z,candidates:[],traversal:`schema lookup for "${T}"`,ambiguous:!1}}if(r==="mentions"){let T=String(t.object||"").trim();return{matches:(typeof Ys=="function"?Ys(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"&&mk.test(String(t.object||"").trim())){let T=wk(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 (${[...Al].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!yk(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=ns(e,t.subject,n),M=ns(e,t.object,n);if(!T.match||!M.match||T.ambiguous||M.ambiguous)return{matches:[],objMatch:M.match,candidates:M.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(T.unresolvedPronoun||M.unresolvedPronoun)};let[z,K]=[T.match,M.match];i==="touches"&&K.class==="Commit"&&z.class!=="Commit"&&([z,K]=[K,z]);let ce=Wo[i],Z=[...new Set(ce?[...Lt(i),ce]:Lt(i))],D=Z.flatMap(U=>Ke(e,U)).filter(U=>U.subject===z.id&&U.object===K.id);return{matches:D,answer:t.negated?D.length===0:D.length>0,objMatch:M.match,subjMatch:T.match,candidates:[],traversal:`${Z.join("+")} edge from ${z.label} to ${K.label}`,ambiguous:!1}}let l;if(o)l={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(l=ns(e,t.object,n),t.altObject&&t.altObject!==t.object){let T=ns(e,t.altObject,n),M=!!l.match&&!l.ambiguous,z=!!T.match&&!T.ambiguous;!M&&z?l=T:M&&z&&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)(?=\.[^.]+$)/,""),M=T(String(t.object||"").trim().toLowerCase()),z=(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)===M});z&&(l={...l,ambiguous:!0,candidates:[z,...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 M=ss([c,...u||[]]).slice(0,He).map(z=>{let K=Gt(e,t,{contextId:n,prev:s,pinnedObjMatch:z});return{candidate:z,result:K,rendered:xn(t,K,e)}});return{matches:[],objMatch:c,candidates:u,traversal:null,ambiguous:!0,branches:M}}if(r==="where"){let T=(c.attributes||[]).find(M=>M.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||""),M;if(c.class==="Commit")M=[c];else{let K=["touches","touchesSymbol"].flatMap(Z=>Ke(e,Z)).filter(Z=>Z.object===c.id),ce=new Set;M=[];for(let Z of K){if(ce.has(Z.subject))continue;ce.add(Z.subject);let D=e.byId.get(Z.subject);D&&D.class==="Commit"&&M.push(D)}M.sort((Z,D)=>T(D).localeCompare(T(Z)))}let z=M.length&&T(M[0])?[{kind:"event",class:"Commit",label:M[0].label,ids:[M[0].id],attrs:{date:T(M[0]).slice(0,10)},lane:"when"}]:[];return{matches:M,objMatch:c,candidates:u,ambiguous:d,matchedVia:p,whenShape:!0,referents:z,traversal:`touches+touchesSymbol edges where object = ${c.label}, newest commit date first`}}if(r==="whoLast"){let T=Z=>String((Z.attributes||[]).find(D=>D.key==="date")?.value||""),M=["touches","touchesSymbol"].flatMap(Z=>Ke(e,Z)).filter(Z=>Z.object===c.id),z=new Set,K=[];for(let Z of M){if(z.has(Z.subject))continue;z.add(Z.subject);let D=e.byId.get(Z.subject);D&&D.class==="Commit"&&K.push(D)}K.sort((Z,D)=>T(D).localeCompare(T(Z)));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 hk(e,c,a,{candidates:u,ambiguous:d,matchedVia:p});if(r==="forward"){let T=Wo[i],z=!!(T&&c.class&&ks.has(c.class))?[...new Set([...Lt(i),T])]:Lt(i);if(a&&a!=="Change"){let G=Kh(e,z),I=al[a];if(G.size&&!G.has(a)&&!(I&&G.has(I)))return{matches:[],objMatch:c,candidates:u,ambiguous:d,matchedVia:p,forwardGrainMiss:!0,wantClasses:[...G],traversal:`${z.join("+")} edges where subject = ${c.label} (grain mismatch: this "${i}" relation never targets a ${ts(a)})`}}let ce=z.flatMap(G=>Ke(e,G)).filter(G=>G.subject===c.id).map(G=>e.byId.get(G.object)).filter(Boolean),Z=ss(ce),D=Z,U="";if(a&&a!=="Change"){D=Z.filter(I=>I.class===a);let G=al[a];if(!D.length&&G){let I=Z.filter(L=>L.class===G);I.length&&(D=I,U=`, widened to ${G} subjects (no ${a} recorded)`)}}return{matches:D,objMatch:c,candidates:u,traversal:`${z.join("+")} edges where subject = ${c.label}${U}`,ambiguous:d,matchedVia:p}}if(t.modifier==="transitive")return{matches:No(e,c,{maxDepth:Dh}).flat().map(z=>e.byId.get(z.id)).filter(Boolean),objMatch:c,candidates:u,ambiguous:d,matchedVia:p,traversal:`reverse dependency closure over imports+calls edges from ${c.label} (impactClosure, maxDepth=${Dh})`};let g=Wo[i]||Lt(i).find(T=>Wh.has(T))||null,b=!!(c.class&&ks.has(c.class));if(g&&(ks.has(a)||b)){let T=Ke(e,g).filter(U=>U.object===c.id),M=ss(T.map(U=>e.byId.get(U.subject)).filter(Boolean)),z=!a||a==="Change"?M:M.filter(U=>U.class===a),K="",ce=al[a];if(!z.length&&ce){let U=M.filter(G=>G.class===ce);U.length&&(z=U,K=`, widened to ${ce} subjects (no ${a} recorded)`)}let Z=(i==="touches"||i==="calls"||i==="uses")&&c.class==="Class"&&!Ke(e,"contains").some(U=>U.subject===c.id),D=Z?e.byId.get(Go(e,c)||""):null;if(z.length||!(Z&&D))return{matches:z,objMatch:c,candidates:u,traversal:`${g} edges where object = ${c.label}${K}`,ambiguous:d,matchedVia:p}}let y=c,w=u,v=d,_=p,$="",x=Yh(e,i);if(x&&y.class&&y.class!==x){let T=En(e,t.object,{expectedClass:x});if(T.match&&!T.ambiguous)y=T.match,w=T.candidates,v=T.ambiguous,_=T.matchedVia;else if(x==="Module"){let M=Go(e,y),z=M&&e.byId.get(M);if(z)$=`, refined from ${y.label} to its containing module`,y=z;else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:_,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${ts(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ts(x)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:v,matchedVia:_,wrongGrainMiss:!0,wantClass:x,traversal:`"${t.object}" resolved to ${ts(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${ts(x)})`}}let S=Lt(i).flatMap(T=>Ke(e,T)).filter(T=>T.object===y.id);i==="cochange"&&(S=S.concat(Lt(i).flatMap(T=>Ke(e,T)).filter(T=>T.subject===y.id).map(T=>({...T,subject:T.object,object:T.subject}))));let E="";if(!S.length&&y.class){let T=`ext:${String(y.label).toLowerCase()}`;S=Lt(i).flatMap(M=>Ke(e,M)).filter(M=>String(M.object).toLowerCase()===T),S.length&&(E=` (by name, via unresolved ${T} references)`)}let R=[],j=new Set;for(let T of S){let M=e.byId.get(T.subject);M&&!j.has(M.id)&&(j.add(M.id),R.push(M))}let A,F="";if(!a||a==="Change")A=R;else{let T=R.filter(M=>M.class===a);if(T.length)A=T;else if(a!=="Module"&&R.some(M=>M.class==="Module")){let M=new Set(R.filter(z=>z.class==="Module").map(z=>z.id));A=Tl(e,M,a),F=`, then ${ts(a)} defined in the matched module(s)`}else A=[]}return{matches:A,objMatch:y,candidates:w,traversal:`${Lt(i).join("+")} edges where object = ${y.label}${E}${F}${$}`,ambiguous:v,matchedVia:_}}function zr(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 ul(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function xk(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function vn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function Pr(e){let t=e.object??e.subject??"?";return`${e.entityType?Me(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function yl(e){return vr[e]?.bare||e}function Ek(e){let t=yl(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function Sk(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=Me(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 ${yl(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 ${yl(o.kind)} ${JSON.stringify(String(r))}`}function pm(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(Pr).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>pm(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?Sk(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 ":""}${to(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?Me(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${to(e.kind)}`:`${r}${to(e.kind)} "${e.object}"`}return{english:o,machine:s}}function xn(e,t,n=null){let s=fm(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function fm(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${Rl()}`,miss:!0,ambiguous:!1};if(e.node)return uk(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
55
  ${t.branches.map((l,c)=>`${c+1}) as ${Pr(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(Pr),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,l)=>`${l+1}) ${Pr(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Pr),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?Me(t.objMatch.class,1):"term",a=Me(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=>Me(a,2));return{content:`${t.objMatch.label}'s "${eo(e.kind)}" relation in this index never produces ${Me(e.entityType,2)} \u2014 only ${$n(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=_l(t.objMatch)||"";return{content:`${t.objMatch.label} is ${lk(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,He).map(l=>`${l.label} (${Me(l.class,1)})`),a=t.matches.length>He?`, \u2026and ${t.matches.length-He} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${$n(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 ${$n([...jl])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,l=a.slice(0,He).map(d=>d.label),c=a.length>He?`, \u2026and ${a.length-He} more`:"",u=a.length?` \u2014 also matched: ${$n(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&&cl[e.entityType]?Me(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=$n(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. ${xs(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(b=>b.class==="Commit")){let b=w=>!["Commit","Session","Source","Utterance"].includes(w?.class),y=i.filter(b);y.length&&(i=y,a?.length&&(a=a.filter(w=>b(w.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),y=new Set(Rn(String(e.object||"")).filter(x=>x.length>=3)),w=new Set(i.map(x=>x.id)),v=null,_=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 S=Rn(String(x.label)).filter(R=>y.has(R)).length;if(!S||S<_)continue;let E=Qn(String(x.label).toLowerCase(),b,8);(S>_||E<$)&&(v=x,_=S,$=E)}if(v&&(i=[...i,v],a)){let x=qt(n,e,{pinnedObjMatch:v});a=[...a,{candidate:v,result:x,rendered:vn(e,x,n)}]}}let l=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,c=l?cl[l]?Me(l,1):es(l):"module",u=i.slice(0,He).map(b=>b.label),d=i.length>He?`, \u2026and ${i.length-He} more`:"",f=`"${e.object}" matches more than one ${c} ambiguously \u2014 did you mean ${$n(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,p=String(e.object||""),m=p?new RegExp(`\\b${Qe(p)}\\b`,"gi"):null,h=b=>{let y=String(b.candidate.label||"");return!m||!y?b.rendered.content:b.rendered.content.split(y).map(w=>w.replace(m,y)).join(y)};return{content:a&&a.length?`${f}
58
- ${a.map((b,y)=>`${y+1}) ${b.candidate.label}: ${h(b)}`).join(`
59
- `)}`:f,miss:!1,ambiguous:!0,candidates:i.map(b=>b.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let c=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${il(i)} is defined in ${a[1]} at ${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}let l=zr(i);return l?{content:`${il(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. ${xs(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} ${Lr("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. ${xs(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,He)){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])=>`${Me(u,d.length)} ${$n(d)}`),c=t.matches.length>He?`; \u2026and ${t.matches.length-He} 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(_o.includes(e.kind)&&n&&t.objMatch)for(let l of _o){if(l===e.kind)continue;let c={...e,kind:l},u=qt(n,c,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return ch(c,u,n)}return{content:`${t.objMatch.label} has no ${eo(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(qE,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=Me(e.entityType||"Module",2),a=t.objMatch&&Gs.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${eo(e.kind)} ${a}. ${xs(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${dk(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=>!Es.has(i.class))){let i=t.matches.slice(0,He).map(l=>l.class==="Commit"?uk(l):l.label),a=t.matches.length>He?`, \u2026and ${t.matches.length-He} 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,He)){let a=zr(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(il(i))}let o=[...s.entries()].map(([i,a],l)=>{let c=$n(a);return l===0?`in ${i} there is ${c}`:`there is ${c} in ${i}`}),r=t.matches.length>He?` \u2026and ${t.matches.length-He} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function uh(e){if(e.length<4||hk.has(e))return null;let t=Zn(e),n=t+1,s=null,o=!1;for(let r of mk){let i=Qn(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 Nm(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!_l(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=uh(n);return!!s&&s!==n&&!!Be[s]}function dh(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=ts(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Nm(s,t.object))return!1;if(t.shape==="ask"){let o=ts(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Nm(o,t.subject))}return!0}function gk(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return jp.includes(t)}function bk(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Ar(Zs(String(t||""))),i=Gt(r);if(!i.length)return null;let a=[],l=[],c=j=>{let A=xn(e,j);return!!A.match&&A.tier!=null&&A.tier<=2},u=j=>{let A=xn(e,j);return!!A.match&&A.tier!=null&&A.tier<=3},d=j=>{let A=String(j||"").trim().toLowerCase();return Gs.includes(A)?!0:Gt(A).some(F=>{let T=F.toLowerCase();return!ea.has(T)&&!gl.has(T)})},f=new Set(["reverse","forward","where","when","ask"]),p=j=>{let A=j.join(" "),F=Dr(A,{nlp:n});return dh(e,F,s)!==!0||F&&!F.node&&f.has(F.shape)&&(F.object!=null&&!d(F.object)||F.shape==="ask"&&F.subject!=null&&!d(F.subject))||vn(F,qt(e,F,{contextId:s,prev:o}),e).miss?null:{parsed:F,text:A}},m=j=>({parsed:j.parsed,from:r,to:j.text,dropped:[...a],steps:l}),h=0,g=Math.max(i.length,1)+12;for(;h<g;h+=1){let j=-1;for(let T=0;T<i.length;T+=1){let M=i[T].toLowerCase();if(Rl.has(M)&&!ea.has(M)&&!c(i[T])){j=T;break}}if(j<0)break;let A=i[j];i=i.filter((T,M)=>M!==j),a.push(A),l.push(`strip noise "${A}" \u2192 "${i.join(" ")}"`);let F=p(i);if(F)return m(F)}let b=Dr(i.join(" "),{nlp:n}),y=new Set;if(b&&!b.node&&f.has(b.shape))for(let j of[b.object,b.subject])for(let A of Gt(String(j||"").toLowerCase()))y.add(A);let w=[],v=[],_=[];for(let j of i){let A=j.toLowerCase();if(!/^[a-z]+$/.test(A)||ea.has(A)||gl.has(A)||u(j)){w.push(j);continue}let T=uh(A);if(T&&T!==A){w.push(T),_.push(`${j}\u2192${T}`);continue}if(y.has(A)){w.push(j);continue}v.push(j)}if((_.length||v.length)&&w.length){i=w,a.push(...v),_.length&&l.push(`fuzzy-correct ${JSON.stringify(_)} \u2192 "${i.join(" ")}"`),v.length&&l.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let j=p(i);if(j)return m(j)}let $=!1,x=i.map(j=>{let A=j.toLowerCase();return Ro[A]&&!u(j)?($=!0,Ro[A]):j});if($){l.push(`normalise synonyms \u2192 "${x.join(" ")}"`);let j=p(x);if(j)return m(j)}let S=Gt(r).map(j=>j.toLowerCase()),E=[],R=[];for(let j of S){if(lh.has(j))continue;let A=Be[j];A&&A!=="Change"?E.push(j):R.push(j)}if(E.length===1&&R.length===0){let j=p(["count",E[0]]);if(j)return l.push(`bare kind "${E[0]}" \u2192 count`),m(j)}return null}function yk(e,t){let n=String(t||"");if(!e||!Pm.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(Pm,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return wk.test(a)?`${a} touched`:i}function $k(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 Tl(e,t){let n=$k(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function Ek(e,t){let n=String(t||"").trim(),s=n.match(vk),o=s?null:n.match(xk),r=s||o;if(!r||!Al.test(r[2]||"")||Be[r[1].toLowerCase()])return null;let i=Tl(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 Sk(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=Tl(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function Rk(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 Tk(e,t){let n=Ei(String(t||"").trim()),s=n.match(kk),o=s?bp[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(jk)?.[1]||n.match(_k)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Bs[o].predicate},a=Sk(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let l=Rk(e,r);return l?{...i,subjects:[l],asked:[l]}:null}function Ak(e,t){return Bs[e].matchesLocativePredicates?ko(Fr(t.prop))||ko(Fr(t.predicate)):null}function Ik(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Bs[t.relation],r=Fr(o.predicate),i=new Map,a=new Map;for(let c of e?.relations||[]){let u=Fr(c.prop),d=Fr(c.predicate),f=u===r||d===r,p=f?null:Ak(t.relation,c);if(!(!f&&!p))for(let m of c.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let b={subject:h,object:m.object,reads:f?o.reads:`is ${p}`};f?i.set(m.subject,b):a.set(`${u||d}\0${m.subject}`,b)}}let 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 al(e){let t=Ck.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 Lk(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(al(a.subject).base,String(a.object));let s=new Set(wp),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}=al(a.subject),d=n.get(l)||t(l);if(!d)continue;let f=`${a.predicate}\0${l}`;Ok(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:al(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 Mk(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=Tl(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 Ss(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(gk(t))return{content:Sl(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=yk(e,t);let r=bl(t,{nlp:s}),i=r.parsed,a=i,l=null;if(dh(e,i,n)===!1){let f=bk(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=vn(a,c,e);if(Mm(e,a,c,u)){let f=Ek(e,t);if(f){let p=qt(e,f,{contextId:n,prev:o}),m=vn(f,p,e);m.miss||(a=f,c=p,u=m,l=null)}}if(Mm(e,a,c,u)){let f=Tk(e,t);if(f){let p=qt(e,f,{contextId:n,prev:o}),m=vn(f,p,e);m.miss||(a=f,c=p,u=m,l=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=zi(String(t||"")).trim().match(Nk)?.[1]?.trim();if(p&&!/\s+(?:for|about)$/i.test(p)){let m=Dr(`what is a ${p}`,{nlp:s});m?.shape==="meta"&&(c=qt(e,m,{contextId:n,prev:o}),u=vn(m,c,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=Zs(String(t||"")).match(Pk)?.[1]?.trim();if(p){let m=Dr(`what is a ${p}`,{nlp:s});if(m?.shape==="meta"){let h=qt(e,m,{contextId:n,prev:o}),g=vn(m,h,e);!g.miss&&!g.ambiguous&&(c=h,u=g)}}}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 m=qt(e,p.parsed,{contextId:n,prev:o}),h=vn(p.parsed,m,e);return h.miss?null:{a:p,text:h.content}}).filter(Boolean);if(f.length){let p=ym(f.map(m=>m.a),{answerFor:m=>f.find(h=>h.a===m)?.text||null});d=`${d}
57
+ (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Pr),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,l)=>`${l+1}) ${Pr(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Pr),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?Me(t.objMatch.class,1):"term",a=Me(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=>Me(a,2));return{content:`${t.objMatch.label}'s "${to(e.kind)}" relation in this index never produces ${Me(e.entityType,2)} \u2014 only ${vn(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=Il(t.objMatch)||"";return{content:`${t.objMatch.label} is ${vk(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,He).map(l=>`${l.label} (${Me(l.class,1)})`),a=t.matches.length>He?`, \u2026and ${t.matches.length-He} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${vn(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 ${vn([...Al])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,l=a.slice(0,He).map(d=>d.label),c=a.length>He?`, \u2026and ${a.length-He} more`:"",u=a.length?` \u2014 also matched: ${vn(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&&pl[e.entityType]?Me(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=vn(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. ${Ss(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(b=>b.class==="Commit")){let b=w=>!["Commit","Session","Source","Utterance"].includes(w?.class),y=i.filter(b);y.length&&(i=y,a?.length&&(a=a.filter(w=>b(w.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let b=String(e.object||"").toLowerCase(),y=new Set(Tn(String(e.object||"")).filter(x=>x.length>=3)),w=new Set(i.map(x=>x.id)),v=null,_=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 S=Tn(String(x.label)).filter(R=>y.has(R)).length;if(!S||S<_)continue;let E=Zn(String(x.label).toLowerCase(),b,8);(S>_||E<$)&&(v=x,_=S,$=E)}if(v&&(i=[...i,v],a)){let x=Gt(n,e,{pinnedObjMatch:v});a=[...a,{candidate:v,result:x,rendered:xn(e,x,n)}]}}let l=i.length&&i.every(b=>b.class===i[0].class)?i[0].class:null,c=l?pl[l]?Me(l,1):ts(l):"module",u=i.slice(0,He).map(b=>b.label),d=i.length>He?`, \u2026and ${i.length-He} more`:"",f=`"${e.object}" matches more than one ${c} ambiguously \u2014 did you mean ${vn(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${Qe(p)}\\b`,"gi"):null,m=b=>{let y=String(b.candidate.label||"");return!h||!y?b.rendered.content:b.rendered.content.split(y).map(w=>w.replace(h,y)).join(y)};return{content:a&&a.length?`${f}
58
+ ${a.map((b,y)=>`${y+1}) ${b.candidate.label}: ${m(b)}`).join(`
59
+ `)}`:f,miss:!1,ambiguous:!0,candidates:i.map(b=>b.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=String(t.site||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(a){let c=a[3]&&a[3]!==a[2]?`lines ${a[2]}-${a[3]}`:`line ${a[2]}`;return{content:`${ul(i)} is defined in ${a[1]} at ${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}let l=zr(i);return l?{content:`${ul(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. ${Ss(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} ${Lr("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. ${Ss(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,He)){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])=>`${Me(u,d.length)} ${vn(d)}`),c=t.matches.length>He?`; \u2026and ${t.matches.length-He} 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(_o.includes(e.kind)&&n&&t.objMatch)for(let l of _o){if(l===e.kind)continue;let c={...e,kind:l},u=Gt(n,c,{pinnedObjMatch:t.objMatch});if(u?.matches?.length&&!u.ambiguous)return fm(c,u,n)}return{content:`${t.objMatch.label} has no ${to(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(sS,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=Me(e.entityType||"Module",2),a=t.objMatch&&Vs.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object;return{content:`No ${i} found whose module directly ${to(e.kind)} ${a}. ${Ss(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${Ek(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!ks.has(i.class))){let i=t.matches.slice(0,He).map(l=>l.class==="Commit"?xk(l):l.label),a=t.matches.length>He?`, \u2026and ${t.matches.length-He} 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,He)){let a=zr(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(ul(i))}let o=[...s.entries()].map(([i,a],l)=>{let c=vn(a);return l===0?`in ${i} there is ${c}`:`there is ${c} in ${i}`}),r=t.matches.length>He?` \u2026and ${t.matches.length-He} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function mm(e){if(e.length<4||_k.has(e))return null;let t=es(e),n=t+1,s=null,o=!1;for(let r of jk){let i=Zn(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 zh(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!Il(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=mm(n);return!!s&&s!==n&&!!Be[s]}function gm(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=ns(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||zh(s,t.object))return!1;if(t.shape==="ask"){let o=ns(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!zh(o,t.subject))}return!0}function Rk(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Ap.includes(t)}function Tk(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Ar(eo(String(t||""))),i=Wt(r);if(!i.length)return null;let a=[],l=[],c=j=>{let A=En(e,j);return!!A.match&&A.tier!=null&&A.tier<=2},u=j=>{let A=En(e,j);return!!A.match&&A.tier!=null&&A.tier<=3},d=j=>{let A=String(j||"").trim().toLowerCase();return Vs.includes(A)?!0:Wt(A).some(F=>{let T=F.toLowerCase();return!na.has(T)&&!$l.has(T)})},f=new Set(["reverse","forward","where","when","ask"]),p=j=>{let A=j.join(" "),F=Dr(A,{nlp:n});return gm(e,F,s)!==!0||F&&!F.node&&f.has(F.shape)&&(F.object!=null&&!d(F.object)||F.shape==="ask"&&F.subject!=null&&!d(F.subject))||xn(F,Gt(e,F,{contextId:s,prev:o}),e).miss?null:{parsed:F,text:A}},h=j=>({parsed:j.parsed,from:r,to:j.text,dropped:[...a],steps:l}),m=0,g=Math.max(i.length,1)+12;for(;m<g;m+=1){let j=-1;for(let T=0;T<i.length;T+=1){let M=i[T].toLowerCase();if(Cl.has(M)&&!na.has(M)&&!c(i[T])){j=T;break}}if(j<0)break;let A=i[j];i=i.filter((T,M)=>M!==j),a.push(A),l.push(`strip noise "${A}" \u2192 "${i.join(" ")}"`);let F=p(i);if(F)return h(F)}let b=Dr(i.join(" "),{nlp:n}),y=new Set;if(b&&!b.node&&f.has(b.shape))for(let j of[b.object,b.subject])for(let A of Wt(String(j||"").toLowerCase()))y.add(A);let w=[],v=[],_=[];for(let j of i){let A=j.toLowerCase();if(!/^[a-z]+$/.test(A)||na.has(A)||$l.has(A)||u(j)){w.push(j);continue}let T=mm(A);if(T&&T!==A){w.push(T),_.push(`${j}\u2192${T}`);continue}if(y.has(A)){w.push(j);continue}v.push(j)}if((_.length||v.length)&&w.length){i=w,a.push(...v),_.length&&l.push(`fuzzy-correct ${JSON.stringify(_)} \u2192 "${i.join(" ")}"`),v.length&&l.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let j=p(i);if(j)return h(j)}let $=!1,x=i.map(j=>{let A=j.toLowerCase();return Ro[A]&&!u(j)?($=!0,Ro[A]):j});if($){l.push(`normalise synonyms \u2192 "${x.join(" ")}"`);let j=p(x);if(j)return h(j)}let S=Wt(r).map(j=>j.toLowerCase()),E=[],R=[];for(let j of S){if(hm.has(j))continue;let A=Be[j];A&&A!=="Change"?E.push(j):R.push(j)}if(E.length===1&&R.length===0){let j=p(["count",E[0]]);if(j)return l.push(`bare kind "${E[0]}" \u2192 count`),h(j)}return null}function Ik(e,t){let n=String(t||"");if(!e||!Uh.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(Uh,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return Ak.test(a)?`${a} touched`:i}function Ck(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 Ol(e,t){let n=Ck(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function Nk(e,t){let n=String(t||"").trim(),s=n.match(Ok),o=s?null:n.match(Lk),r=s||o;if(!r||!Ll.test(r[2]||"")||Be[r[1].toLowerCase()])return null;let i=Ol(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 Pk(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=Ol(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function zk(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 Uk(e,t){let n=Si(String(t||"").trim()),s=n.match(Mk),o=s?vp[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(Fk)?.[1]||n.match(Dk)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Gs[o].predicate},a=Pk(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let l=zk(e,r);return l?{...i,subjects:[l],asked:[l]}:null}function Bk(e,t){return Gs[e].matchesLocativePredicates?ko(Fr(t.prop))||ko(Fr(t.predicate)):null}function Wk(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Gs[t.relation],r=Fr(o.predicate),i=new Map,a=new Map;for(let c of e?.relations||[]){let u=Fr(c.prop),d=Fr(c.predicate),f=u===r||d===r,p=f?null:Bk(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 b={subject:m,object:h.object,reads:f?o.reads:`is ${p}`};f?i.set(h.subject,b):a.set(`${u||d}\0${h.subject}`,b)}}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 dl(e){let t=Gk.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 qk(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(dl(a.subject).base,String(a.object));let s=new Set(xp),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}=dl(a.subject),d=n.get(l)||t(l);if(!d)continue;let f=`${a.predicate}\0${l}`;Vk(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:dl(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 Yk(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=Ol(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 js(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(Rk(t))return{content:Rl(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};t=Ik(e,t);let r=vl(t,{nlp:s}),i=r.parsed,a=i,l=null;if(gm(e,i,n)===!1){let f=Tk(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=Gt(e,a,{contextId:n,prev:o}),u=xn(a,c,e);if(Bh(e,a,c,u)){let f=Nk(e,t);if(f){let p=Gt(e,f,{contextId:n,prev:o}),h=xn(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(Bh(e,a,c,u)){let f=Uk(e,t);if(f){let p=Gt(e,f,{contextId:n,prev:o}),h=xn(f,p,e);h.miss||(a=f,c=p,u=h,l=null)}}if(a===null&&u.miss&&!u.ambiguous){let p=Bi(String(t||"")).trim().match(Hk)?.[1]?.trim();if(p&&!/\s+(?:for|about)$/i.test(p)){let h=Dr(`what is a ${p}`,{nlp:s});h?.shape==="meta"&&(c=Gt(e,h,{contextId:n,prev:o}),u=xn(h,c,e))}}if(a===null&&u.miss&&!u.ambiguous){let p=eo(String(t||"")).match(Kk)?.[1]?.trim();if(p){let h=Dr(`what is a ${p}`,{nlp:s});if(h?.shape==="meta"){let m=Gt(e,h,{contextId:n,prev:o}),g=xn(h,m,e);!g.miss&&!g.ambiguous&&(c=m,u=g)}}}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=Gt(e,p.parsed,{contextId:n,prev:o}),m=xn(p.parsed,h,e);return m.miss?null:{a:p,text:m.content}}).filter(Boolean);if(f.length){let p=Sh(f.map(h=>h.a),{answerFor:h=>f.find(m=>m.a===h)?.text||null});d=`${d}
60
60
  ${p.join(`
61
- `)}`}}if(!u.ambiguous&&c.objMatch&&Array.isArray(c.candidates)&&c.candidates.length){let f=new Set((c.matches||[]).map(m=>m&&m.id)),p=c.candidates.filter(m=>m&&m.id&&m.id!==c.objMatch.id&&!f.has(m.id));if(p.length){let m=p.slice(0,3).map(b=>b.label).filter(Boolean),h=p.length-m.length,g=m.join(", ")+(h>0?`, +${h} more`:"");d=`${d}
62
- (answering for ${c.objMatch.label} \u2014 ${p.length} other match${p.length===1?"":"es"}: ${g})`}}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:Ur(a.entityType,c.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:ah(a),matches:(c.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?zr(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 Sm,Wo,Es,sl,UE,Ot,Fm,He,cl,BE,WE,GE,qE,VE,KE,YE,Dm,ll,JE,wl,zm,At,Um,ZE,tS,sS,rS,aS,cS,lS,uS,pS,mS,qm,$l,Vm,Hm,ES,jS,km,AS,jm,OS,Rm,Am,PS,FS,zS,vs,ol,ek,tk,sk,jl,ok,Om,rk,Lm,ck,ea,gl,Rl,lh,fk,mk,hk,Pm,wk,vk,xk,Al,kk,jk,_k,Fr,Ck,Ok,Nk,Pk,Mm,ks=O(()=>{Oe();Lc();qn();yn();Mo();Wi();Gi();Em();el();ws();Xi();nl();zo();Sm=new WeakMap;Wo={calls:"callsSymbol",touches:"touchesSymbol"},Es=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),sl={Function:"Method",Method:"Function"},UE={uses:["imports","calls","callsSymbol"]},Ot=e=>UE[e]||[e],Fm=new Set(Object.values(Wo)),He=12,cl={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"]};BE={cochange:"cochanges",reexports:"export"};WE={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"},GE=e=>WE[e]||eo(e),qE=new RegExp(`^(?:${Object.keys(de).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),VE=new Set(["imports"]);KE=/^where\s+(?:does|do|did)\s+/i,YE=new Set(me(Zt));Dm=4,ll="zzinnerset",JE=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),wl=new Set(["which","what","who","list","show","find","give","me","us","all"]),zm=new Set(["are","is","was","were"]);At=e=>Be[e]?{entityType:Be[e],placeholder:!1}:Gn.includes(e)?{entityType:null,placeholder:!0}:null,Um=e=>!!de[e]&&e.endsWith("ing");ZE=new Set(["which","the","all"]);tS=new Set(["all","every","each"]);sS=new Set(["what","which","thing","things","one","ones","stuff"]);rS=new Set(["those","them"]);aS=new Set(["did","was","were","do","does","has","have","had"]),cS=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),lS=new Set(["last","recently","ever","get","got","been","then","now","already"]),uS=new Set(["the","a","an","all","those","these","any"]);pS=new Set(["since","before","after","on"]);mS=/\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/;qm=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);$l=new Set(["the","a","an","all","me","us"]),Vm=[...Hs].sort((e,t)=>t.split(" ").length-e.split(" ").length),Hm="functions, classes, methods, modules, packages, attributes, variables, or commits",ES=new Set(["in","inside","under"]);jS=new Set(["called","named","about","like","containing","matching","with"]);km=new Set(["recent","latest","newest"]);AS=/^git:(.+)$/i;jm=new WeakMap;OS=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Rm=new WeakMap;Am={label:3,chain:2,attr:1};PS=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;FS=["imports","calls","callsSymbol","inherits","contains","tests"];zS=/^\d{4}-\d{2}-\d{2}$/;vs=e=>$n(e.slice(0,He).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>He?`, \u2026and ${e.length-He} more`:"");ol=10;ek=/^(?:the|a|an)\s+/i,tk=new RegExp(`\\s+(${Object.keys(Be).join("|")})$`,"i");sk=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,jl=new Set(["index","main","app","server","cli","__main__"]),ok=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Om=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),rk=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>ok.has(t));Lm=8,ck="mgx:schemaDoc";ea=new Set([...me(Object.keys(de)),...me(Object.keys(Be)),...me(Object.keys(en)),...me(Object.keys(Xe)),...me(Vs),...me(Object.keys(bs)),...me(Object.keys(_n)),...me(Object.keys(jo)),...me(Gn),...me(kr),...me(qs),...me(Zt),...me(wn),...me(Wn),...me(Object.keys(Ro))]),gl=new Set([...tt,...wl,...Gs]),Rl=new Set(me(Si)),lh=new Set([...Rl,...gl]),fk=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],mk=[...new Set([...me(Object.keys(de)),...Object.keys(Be),...fk])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!tt.has(e)),hk=new Set(["impact","impacts","impacted"]);Pm=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,wk=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;vk=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,xk=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,Al=/^(?: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;kk=new RegExp(`^(?:${Vm.map(Qe).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),jk=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,_k=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Fr=e=>String(e||"").toLowerCase();Ck=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;Ok=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;Nk=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,Pk=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;Mm=(e,t,n,s)=>s.ambiguous?Mk(e,t,n):!!s.miss});function js(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 ss({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Qt(t),a=Qt(i,n);if(a!==i&&!a.startsWith(i+mp))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,...js(c,s,o,r)}}var na=O(()=>{Ue();Bt()});function yt(e){return{ok:!0,value:e}}function $t(e,{detail:t="",term:n=null}={}){if(!ot[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function An(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 sa(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 Cl,Fk,ot,Ol,vN,fh,Ll,Dk,En,Il,It,xN,mh=O(()=>{Cl="1.1.0",Fk="urn:tmct:core",ot=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),Ol=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),vN=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"}),fh=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),Ll=Object.freeze(Object.values(fh).flat()),Dk=Object.freeze(new Set(fh.source));En="Individual",Il="Edge",It="concurrent-safe: reads immutable graph truth; no shared mutable state",xN=Object.freeze({version:Cl,ontology:Fk,missReasons:Object.values(ot),edgeKinds:[...Ol],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: ${En}, candidates: ${En}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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: ${En}, out: ${Il}[], incoming: ${Il}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${En}[], attributes: ${En}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${En}[], subclasses: ${En}[], levels: Array<${En}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:It,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: ${En}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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:It,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: ${Il}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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:It,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:It,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:It,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:It,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${En}[] }`,misses:[],concurrency:It,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:It,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:It,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: ${En}[] }`,misses:[],concurrency:It,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:It,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function zk(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(sa(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(sa(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function Uk(e,t){for(let n of e.relations)if(Jn(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function Wk(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await ss({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
- ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(js(o,i,a,Nl).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(js(o,i,a,Nl).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=Bk;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 ss({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=js(u,l,a.site.end,i);r.push(`
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(b=>b.label).filter(Boolean),m=p.length-h.length,g=h.join(", ")+(m>0?`, +${m} more`:"");d=`${d}
62
+ (answering for ${c.objMatch.label} \u2014 ${p.length} other match${p.length===1?"":"es"}: ${g})`}}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:Ur(a.entityType,c.matches,"relationListing")}),{content:d,tmct_ask:{mechanical:!0,parsed:a&&!a.ambiguousParse?a:null,canonical:pm(a),matches:(c.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?zr(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 Th,Wo,ks,al,ZE,Lt,Wh,He,pl,eS,tS,nS,sS,oS,iS,aS,Gh,fl,lS,xl,Vh,At,qh,dS,fS,mS,bS,yS,$S,vS,xS,SS,jS,Xh,Sl,Jh,Qh,NS,FS,Ah,BS,Ih,VS,Oh,Nh,KS,XS,QS,Es,cl,pk,fk,mk,Al,gk,Fh,bk,Dh,$k,na,$l,Cl,hm,kk,jk,_k,Uh,Ak,Ok,Lk,Ll,Mk,Fk,Dk,Fr,Gk,Vk,Hk,Kk,Bh,_s=O(()=>{Oe();Fc();qn();$n();Mo();Vi();qi();Rh();ol();$s();Qi();il();zo();Th=new WeakMap;Wo={calls:"callsSymbol",touches:"touchesSymbol"},ks=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),al={Function:"Method",Method:"Function"},ZE={uses:["imports","calls","callsSymbol"]},Lt=e=>ZE[e]||[e],Wh=new Set(Object.values(Wo)),He=12,pl={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"]};eS={cochange:"cochanges",reexports:"export"};tS={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"},nS=e=>tS[e]||to(e),sS=new RegExp(`^(?:${Object.keys(de).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),oS=new Set(["imports"]);iS=/^where\s+(?:does|do|did)\s+/i,aS=new Set(fe(Zt));Gh=4,fl="zzinnerset",lS=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),xl=new Set(["which","what","who","list","show","find","give","me","us","all"]),Vh=new Set(["are","is","was","were"]);At=e=>Be[e]?{entityType:Be[e],placeholder:!1}:Vn.includes(e)?{entityType:null,placeholder:!0}:null,qh=e=>!!de[e]&&e.endsWith("ing");dS=new Set(["which","the","all"]);fS=new Set(["all","every","each"]);mS=new Set(["what","which","thing","things","one","ones","stuff"]);bS=new Set(["those","them"]);yS=new Set(["did","was","were","do","does","has","have","had"]),$S=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),vS=new Set(["last","recently","ever","get","got","been","then","now","already"]),xS=new Set(["the","a","an","all","those","these","any"]);SS=new Set(["since","before","after","on"]);jS=/\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/;Xh=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);Sl=new Set(["the","a","an","all","me","us"]),Jh=[...Ks].sort((e,t)=>t.split(" ").length-e.split(" ").length),Qh="functions, classes, methods, modules, packages, attributes, variables, or commits",NS=new Set(["in","inside","under"]);FS=new Set(["called","named","about","like","containing","matching","with"]);Ah=new Set(["recent","latest","newest"]);BS=/^git:(.+)$/i;Ih=new WeakMap;VS=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Oh=new WeakMap;Nh={label:3,chain:2,attr:1};KS=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;XS=["imports","calls","callsSymbol","inherits","contains","tests"];QS=/^\d{4}-\d{2}-\d{2}$/;Es=e=>vn(e.slice(0,He).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>He?`, \u2026and ${e.length-He} more`:"");cl=10;pk=/^(?:the|a|an)\s+/i,fk=new RegExp(`\\s+(${Object.keys(Be).join("|")})$`,"i");mk=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,Al=new Set(["index","main","app","server","cli","__main__"]),gk=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Fh=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),bk=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>gk.has(t));Dh=8,$k="mgx:schemaDoc";na=new Set([...fe(Object.keys(de)),...fe(Object.keys(Be)),...fe(Object.keys(tn)),...fe(Object.keys(Xe)),...fe(Hs),...fe(Object.keys(ys)),...fe(Object.keys(Rn)),...fe(Object.keys(jo)),...fe(Vn),...fe(kr),...fe(qs),...fe(Zt),...fe(yn),...fe(Gn),...fe(Object.keys(Ro)),...fe([...ki])]),$l=new Set([...tt,...xl,...Vs]),Cl=new Set(fe(ji)),hm=new Set([...Cl,...$l]),kk=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],jk=[...new Set([...fe(Object.keys(de)),...Object.keys(Be),...kk])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!tt.has(e)),_k=new Set(["impact","impacts","impacted"]);Uh=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,Ak=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;Ok=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,Lk=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,Ll=/^(?: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;Mk=new RegExp(`^(?:${Jh.map(Qe).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),Fk=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,Dk=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Fr=e=>String(e||"").toLowerCase();Gk=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;Vk=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;Hk=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,Kk=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;Bh=(e,t,n,s)=>s.ambiguous?Yk(e,t,n):!!s.miss});function Rs(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 os({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Qt(t),a=Qt(i,n);if(a!==i&&!a.startsWith(i+yp))throw new _e(`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,...Rs(c,s,o,r)}}var oa=O(()=>{Ue();Ut()});function yt(e){return{ok:!0,value:e}}function $t(e,{detail:t="",term:n=null}={}){if(!ot[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function In(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 ra(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 Pl,Xk,ot,Ml,NN,wm,Fl,Jk,Sn,Nl,It,PN,ym=O(()=>{Pl="1.1.0",Xk="urn:tmct:core",ot=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),Ml=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),NN=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"}),wm=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),Fl=Object.freeze(Object.values(wm).flat()),Jk=Object.freeze(new Set(wm.source));Sn="Individual",Nl="Edge",It="concurrent-safe: reads immutable graph truth; no shared mutable state",PN=Object.freeze({version:Pl,ontology:Xk,missReasons:Object.values(ot),edgeKinds:[...Ml],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: ${Sn}, candidates: ${Sn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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: ${Sn}, out: ${Nl}[], incoming: ${Nl}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${Sn}[], attributes: ${Sn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${Sn}[], subclasses: ${Sn}[], levels: Array<${Sn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:It,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: ${Sn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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:It,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: ${Nl}[] }`,misses:["UNRESOLVED_TERM"],concurrency:It,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:It,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:It,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:It,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:It,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${Sn}[] }`,misses:[],concurrency:It,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:It,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:It,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: ${Sn}[] }`,misses:[],concurrency:It,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:It,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function Qk(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(ra(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(ra(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function Zk(e,t){for(let n of e.relations)if(Qn(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function tj(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await os({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(Rs(o,i,a,Dl).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(Rs(o,i,a,Dl).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=ej;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 os({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=Rs(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 oa(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:Cl,capabilities:[...Ll],sourceAccess:!!t,graph:e,resolve(c){let{match:u,candidates:d}=tn(e,String(c??""));return u?yt({match:An(u),candidates:d.map(An)}):$t(ot.UNRESOLVED_TERM,{term:String(c??"")})},describe(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let{out:d,incoming:f}=zk(e,c);return yt({individual:An(u),out:d,incoming:f})},members(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=ke(e,"contains").filter(m=>m.subject===c),f=[],p=[];for(let m of d){let h=i.get(m.object),g=h?An(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?p.push(g):f.push(g)}return yt({methods:f,attributes:p})},subclasses(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=ke(e,"inherits"),f=d.filter(y=>y.subject===c).map(y=>i.get(y.object)?An(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),p=new Map;for(let y of d)p.has(y.object)||p.set(y.object,[]),p.get(y.object).push(y.subject);let m=new Set([c]),h=[],g=[],b=[c];for(let y=0;y<8&&b.length;y+=1){let w=[],v=[];for(let _ of b)for(let $ of p.get(_)||[]){if(m.has($))continue;m.add($);let x=i.get($),S=x?An(x):{id:$,label:$,class:"Class",attributes:[]};h.push(S),v.push(S),w.push($)}v.length&&g.push(v),b=w}return yt({bases:f,subclasses:h,levels:g})},exports(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let f=ke(e,"reexports").filter(p=>p.subject===c).map(p=>i.get(p.object)?An(i.get(p.object)):{id:p.object,label:p.objectLabel||p.object,class:"Entity",attributes:[]});return yt({exports:f})},signature(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let d=[];for(let[p,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])Vt(u,p)&&d.push(m);let f=Vt(u,"visibility");return f&&d.push(f),yt({id:u.id,label:u.label,class:u.class||"Entity",params:Vt(u,"params"),returns:Vt(u,"returns"),raises:Vt(u,"raises"),decorators:Vt(u,"decorators"),doc:Vt(u,"doc"),selfFields:Vt(u,"self_fields"),flags:d})},edges(c,u,{limit:d,offset:f=0}={}){if(!Ol.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let m=Uk(e,u),h=ke(e,u).filter(g=>g.subject===c).map(g=>sa(g,m));return h=d==null?h.slice(f):h.slice(f,f+d),yt({kind:u,edges:h})},impact(c,{maxDepth:u}={}){let d=a(c);if(!d)return $t(ot.UNRESOLVED_TERM,{term:c});let f=u==null?No(e,d):No(e,d,{maxDepth:u}),p=f.reduce((m,h)=>m+h.length,0);return yt({total:p,levels:f})},async snippet(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let d=Rt(u);if(!l.sourceAccess)return $t(ot.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 $t(ot.NO_SOURCE,{term:c,detail:"no source span in the graph (likely a module)"});try{let f=await ss({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:Nl});return yt({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return $t(ot.NO_SOURCE,{term:c,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(c,{depth:u="auto"}={}){let{match:d}=tn(e,String(c??""));if(!d)return $t(ot.UNRESOLVED_TERM,{term:String(c??"")});let f=Po(e,d),p=String(u||"auto").trim().toLowerCase(),m,h;p==="min"?(m="TINY",h=Qs("TINY")):p==="full"?(m="FULL",h=Qs("FULL")):{tier:m,mask:h}=Di(f,e,{});let g=Wf(f,h);if(!l.sourceAccess)return yt({text:g,tier:m});let b=await Wk(f,h,{readFile:s,repoRoot:n});return yt({text:b?`${g}
69
- ${b}`:g,tier:m})},architecture({package:c=""}={}){let u=String(c||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(b=>(b.class||"")==="Module"&&(!u||String(b.label||"").toLowerCase().startsWith(u))),f=new Map;for(let b of d){let y=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";f.set(y,(f.get(y)||0)+1)}let p=new Set(d.map(b=>b.id)),m=new Map;for(let b of ke(e,"imports"))p.has(b.object)&&m.set(b.object,(m.get(b.object)||0)+1);let h=[...m.entries()].sort((b,y)=>y[1]-b[1]).map(([b,y])=>({id:b,label:i.get(b)?.label||b,importers:y})),g=[...f.entries()].sort((b,y)=>y[1]-b[1]);return yt({modules:d.length,packages:g,hubs:h})},untested(){let c=new Set(ke(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!c.has(d.id)&&!/\.test\./.test(d.label||"")).map(An);return yt({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 yt({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=[...ke(e,"touches"),...ke(e,"touchesSymbol")].filter(m=>m.object===c),f=new Set,p=[];for(let m of d){if(f.has(m.subject))continue;f.add(m.subject);let h=i.get(m.subject);p.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?Vt(h,"author")??Vt(h,"commitAuthor"):null,date:h?Vt(h,"date")??Vt(h,"commitDate"):null,message:h?Vt(h,"message")??Vt(h,"commitMessage"):null})}return yt({commits:p})},search(c,{kind:u="",name:d="",decorator:f="",limit:p=Ni,offset:m=0}={}){let h=String(c||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),y=String(f||"").trim().toLowerCase(),w;if(g&&g!=="module"){let _=null;if(b){let x=qc(b);if(x.error)return $t(ot.UNRESOLVED_TERM,{term:b,detail:x.error});_=x}let $=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{w=Kc(e,$,{kind:g,decFilter:y,nameRe:_}).map(x=>x.ind)}catch(x){return $t(ot.UNRESOLVED_TERM,{term:b,detail:String(x?.message||x)})}}else{let _=new Map;for(let $ of e.individuals)($.class||"")==="Module"&&_.set($.label,$);w=$f(e,h).map(({path:$})=>_.get($)).filter(Boolean)}let v=w.slice(m,m+p).map(An);return yt({results:v})},ask(c){if(typeof r!="function")return $t(ot.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(c||""));return yt({content:u,tmct_ask:d})}};if(o)for(let c of Ll){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(m=>(hh(o,c,performance.now()-f,m),m)):(hh(o,c,performance.now()-f,p),p)})}return l}function hh(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:Gk(s)})}catch{}}function Gk(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 Vt,Nl,Bk,ra=O(()=>{Oe();na();mh();Vt=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;Nl=200,Bk=120});async function Br(e,t){let n=await t.fetchEntities(e),s=Oi(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 ia=O(()=>{Bt();Oe()});function _s({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function nt(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Re(`${t} is required`);return n}function xt(e,t,n){let{match:s,candidates:o}=tn(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 Wr,rt,Ge=O(()=>{Bt();Oe();Wr=200;rt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=xt(s,nt(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function gh(e,{config:t,source:n=Io,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 Br(t,n),f=ve(ve(t.graphFile)),p=oa(d,{sourceAccess:!0,repoRoot:f,readFile:ze,tel:o,ask:Ss}),{match:m}=xt(p,r,"symbol"),h=Po(d,m),g,b,y=!1;a||i==="min"?(g="TINY",b=Qs("TINY")):c||i==="full"?(g="FULL",b=Qs("FULL"),y=!0):{tier:g,mask:b,topup:y}=Di(h,d,{untuned:l}),s&&!c&&(b=Uf(b));let w=null;if(h.moduleLabel)try{({lines:w}=await ss({readFile:ze,repoRoot:f,path:h.moduleLabel}))}catch{w=null}let v=x=>w&&w[x-1]!=null?w[x-1].trim():"",_=(x,S)=>js(w,x,S,Wr).text,$=[`Edit context for ${h.moduleLabel} [${g}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(b.anchor&&h.anchor?.site&&w){let{start:x,end:S}=h.anchor.site;$.push(`
70
- ## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${x}-${S}`),$.push(_(x,S)),h.callHint&&$.push(h.callHint)}if(b.registration&&h.globals.length){$.push(`
71
- ## registration / module globals (replicate this pattern):`);for(let x of h.globals)$.push(` ${x.label} = ${x.value}${x.site?` [:${x.site.start}]`:""}`)}if(b.exemplar&&h.exemplar?.site&&w){let{start:x,end:S}=h.exemplar.site,E=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";$.push(`
72
- ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${E} @ ${h.moduleLabel}:${x}-${S}`),$.push(_(x,S)),h.callHint&&$.push(h.callHint)}if(b.inlinedCallees&&h.calleeBodies.length&&w){let x=120;for(let S of h.calleeBodies){if(x<=0)break;let E=S.site.start,j=S.site.path===h.moduleLabel&&w?w:await ss({readFile:ze,repoRoot:f,path:S.site.path}).then(F=>F.lines).catch(()=>null);if(!j)continue;let A=js(j,E,S.site.end,x);$.push(`
73
- ## inlined callee body (depth-1 in-repo call): ${S.label} @ ${S.site.path}:${E}-${S.site.end}`),$.push(A.text),x-=A.end-E+1}}if(b.classMembers&&h.classMembers&&h.classMembers.members.length){$.push(`
74
- ## members of ${h.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let x of h.classMembers.members){let S=String(x.label).split(".").pop(),E=x.params!=null&&x.params!==""?`(${x.params})${x.returns?` -> ${x.returns}`:""}`:"",R=x.decorators?`@${x.decorators} `:"",j=x.raises?` raises=${x.raises}`:"";$.push(` ${x.class} ${S}${x.site?` :${x.site.start}`:""} ${R}${S}${E}${j}`)}}if(b.siblings&&h.siblings.length){$.push(`
75
- ## sibling symbols to copy the style of (most relevant first; ${h.siblings.length} total):`);for(let x of h.siblings.slice(0,h.siblingCap)){let S=x.site?v(x.site.start):"",E=x.decorators?`@${x.decorators} `:"",R=x.raises?` raises=${x.raises}`:"";$.push(` ${x.class} ${x.label}${x.site?` :${x.site.start}`:""} ${E}${S}${R}`)}h.siblings.length>h.siblingCap&&$.push(` \u2026+${h.siblings.length-h.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(b.allExports&&h.allExports&&$.push(`
68
+ `)}function ia(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:Pl,capabilities:[...Fl],sourceAccess:!!t,graph:e,resolve(c){let{match:u,candidates:d}=nn(e,String(c??""));return u?yt({match:In(u),candidates:d.map(In)}):$t(ot.UNRESOLVED_TERM,{term:String(c??"")})},describe(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let{out:d,incoming:f}=Qk(e,c);return yt({individual:In(u),out:d,incoming:f})},members(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=Ee(e,"contains").filter(h=>h.subject===c),f=[],p=[];for(let h of d){let m=i.get(h.object),g=m?In(m):{id:h.object,label:h.objectLabel||h.object,class:"Entity",attributes:[]};(m?.class||"")==="Attribute"?p.push(g):f.push(g)}return yt({methods:f,attributes:p})},subclasses(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=Ee(e,"inherits"),f=d.filter(y=>y.subject===c).map(y=>i.get(y.object)?In(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=[],g=[],b=[c];for(let y=0;y<8&&b.length;y+=1){let w=[],v=[];for(let _ of b)for(let $ of p.get(_)||[]){if(h.has($))continue;h.add($);let x=i.get($),S=x?In(x):{id:$,label:$,class:"Class",attributes:[]};m.push(S),v.push(S),w.push($)}v.length&&g.push(v),b=w}return yt({bases:f,subclasses:m,levels:g})},exports(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let f=Ee(e,"reexports").filter(p=>p.subject===c).map(p=>i.get(p.object)?In(i.get(p.object)):{id:p.object,label:p.objectLabel||p.object,class:"Entity",attributes:[]});return yt({exports:f})},signature(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let d=[];for(let[p,h]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])Vt(u,p)&&d.push(h);let f=Vt(u,"visibility");return f&&d.push(f),yt({id:u.id,label:u.label,class:u.class||"Entity",params:Vt(u,"params"),returns:Vt(u,"returns"),raises:Vt(u,"raises"),decorators:Vt(u,"decorators"),doc:Vt(u,"doc"),selfFields:Vt(u,"self_fields"),flags:d})},edges(c,u,{limit:d,offset:f=0}={}){if(!Ml.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let h=Zk(e,u),m=Ee(e,u).filter(g=>g.subject===c).map(g=>ra(g,h));return m=d==null?m.slice(f):m.slice(f,f+d),yt({kind:u,edges:m})},impact(c,{maxDepth:u}={}){let d=a(c);if(!d)return $t(ot.UNRESOLVED_TERM,{term:c});let f=u==null?No(e,d):No(e,d,{maxDepth:u}),p=f.reduce((h,m)=>h+m.length,0);return yt({total:p,levels:f})},async snippet(c){let u=a(c);if(!u)return $t(ot.UNRESOLVED_TERM,{term:c});let d=Rt(u);if(!l.sourceAccess)return $t(ot.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 $t(ot.NO_SOURCE,{term:c,detail:"no source span in the graph (likely a module)"});try{let f=await os({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:Dl});return yt({path:d.path,span:{start:d.start,end:d.end},body:f.text})}catch(f){return $t(ot.NO_SOURCE,{term:c,detail:`could not read ${d.path}: ${f?.message||f}`})}},async context(c,{depth:u="auto"}={}){let{match:d}=nn(e,String(c??""));if(!d)return $t(ot.UNRESOLVED_TERM,{term:String(c??"")});let f=Po(e,d),p=String(u||"auto").trim().toLowerCase(),h,m;p==="min"?(h="TINY",m=Zs("TINY")):p==="full"?(h="FULL",m=Zs("FULL")):{tier:h,mask:m}=Ui(f,e,{});let g=Hf(f,m);if(!l.sourceAccess)return yt({text:g,tier:h});let b=await tj(f,m,{readFile:s,repoRoot:n});return yt({text:b?`${g}
69
+ ${b}`:g,tier:h})},architecture({package:c=""}={}){let u=String(c||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(b=>(b.class||"")==="Module"&&(!u||String(b.label||"").toLowerCase().startsWith(u))),f=new Map;for(let b of d){let y=b.label.includes("/")?b.label.slice(0,b.label.lastIndexOf("/")):"(root)";f.set(y,(f.get(y)||0)+1)}let p=new Set(d.map(b=>b.id)),h=new Map;for(let b of Ee(e,"imports"))p.has(b.object)&&h.set(b.object,(h.get(b.object)||0)+1);let m=[...h.entries()].sort((b,y)=>y[1]-b[1]).map(([b,y])=>({id:b,label:i.get(b)?.label||b,importers:y})),g=[...f.entries()].sort((b,y)=>y[1]-b[1]);return yt({modules:d.length,packages:g,hubs:m})},untested(){let c=new Set(Ee(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!c.has(d.id)&&!/\.test\./.test(d.label||"")).map(In);return yt({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 yt({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(c){if(!a(c))return $t(ot.UNRESOLVED_TERM,{term:c});let d=[...Ee(e,"touches"),...Ee(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?Vt(m,"author")??Vt(m,"commitAuthor"):null,date:m?Vt(m,"date")??Vt(m,"commitDate"):null,message:m?Vt(m,"message")??Vt(m,"commitMessage"):null})}return yt({commits:p})},search(c,{kind:u="",name:d="",decorator:f="",limit:p=Mi,offset:h=0}={}){let m=String(c||""),g=String(u||"").trim().toLowerCase(),b=String(d||"").trim(),y=String(f||"").trim().toLowerCase(),w;if(g&&g!=="module"){let _=null;if(b){let x=Yc(b);if(x.error)return $t(ot.UNRESOLVED_TERM,{term:b,detail:x.error});_=x}let $=m.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{w=Qc(e,$,{kind:g,decFilter:y,nameRe:_}).map(x=>x.ind)}catch(x){return $t(ot.UNRESOLVED_TERM,{term:b,detail:String(x?.message||x)})}}else{let _=new Map;for(let $ of e.individuals)($.class||"")==="Module"&&_.set($.label,$);w=Sf(e,m).map(({path:$})=>_.get($)).filter(Boolean)}let v=w.slice(h,h+p).map(In);return yt({results:v})},ask(c){if(typeof r!="function")return $t(ot.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(c||""));return yt({content:u,tmct_ask:d})}};if(o)for(let c of Fl){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=>($m(o,c,performance.now()-f,h),h)):($m(o,c,performance.now()-f,p),p)})}return l}function $m(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:nj(s)})}catch{}}function nj(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 Vt,Dl,ej,aa=O(()=>{Oe();oa();ym();Vt=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;Dl=200,ej=120});async function Br(e,t){let n=await t.fetchEntities(e),s=Ni(n);if(!s.individuals.length){let o=new _e(`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 ca=O(()=>{Ut();Oe()});function Ts({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function nt(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new _e(`${t} is required`);return n}function xt(e,t,n){let{match:s,candidates:o}=nn(e.graph,t);if(!s)throw new _e(`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 Wr,rt,Ge=O(()=>{Ut();Oe();Wr=200;rt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=xt(s,nt(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function vm(e,{config:t,source:n=Io,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new _e("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 Br(t,n),f=$e($e(t.graphFile)),p=ia(d,{sourceAccess:!0,repoRoot:f,readFile:ze,tel:o,ask:js}),{match:h}=xt(p,r,"symbol"),m=Po(d,h),g,b,y=!1;a||i==="min"?(g="TINY",b=Zs("TINY")):c||i==="full"?(g="FULL",b=Zs("FULL"),y=!0):{tier:g,mask:b,topup:y}=Ui(m,d,{untuned:l}),s&&!c&&(b=Vf(b));let w=null;if(m.moduleLabel)try{({lines:w}=await os({readFile:ze,repoRoot:f,path:m.moduleLabel}))}catch{w=null}let v=x=>w&&w[x-1]!=null?w[x-1].trim():"",_=(x,S)=>Rs(w,x,S,Wr).text,$=[`Edit context for ${m.moduleLabel} [${g}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(b.anchor&&m.anchor?.site&&w){let{start:x,end:S}=m.anchor.site;$.push(`
70
+ ## anchor: ${m.anchor.label} (${m.anchor.class}) @ ${m.moduleLabel}:${x}-${S}`),$.push(_(x,S)),m.callHint&&$.push(m.callHint)}if(b.registration&&m.globals.length){$.push(`
71
+ ## registration / module globals (replicate this pattern):`);for(let x of m.globals)$.push(` ${x.label} = ${x.value}${x.site?` [:${x.site.start}]`:""}`)}if(b.exemplar&&m.exemplar?.site&&w){let{start:x,end:S}=m.exemplar.site,E=m.exemplar.decorators?` @${m.exemplar.decorators}`:"";$.push(`
72
+ ## closest example (full body) \u2014 copy this style: ${m.exemplar.label} (${m.exemplar.class})${E} @ ${m.moduleLabel}:${x}-${S}`),$.push(_(x,S)),m.callHint&&$.push(m.callHint)}if(b.inlinedCallees&&m.calleeBodies.length&&w){let x=120;for(let S of m.calleeBodies){if(x<=0)break;let E=S.site.start,j=S.site.path===m.moduleLabel&&w?w:await os({readFile:ze,repoRoot:f,path:S.site.path}).then(F=>F.lines).catch(()=>null);if(!j)continue;let A=Rs(j,E,S.site.end,x);$.push(`
73
+ ## inlined callee body (depth-1 in-repo call): ${S.label} @ ${S.site.path}:${E}-${S.site.end}`),$.push(A.text),x-=A.end-E+1}}if(b.classMembers&&m.classMembers&&m.classMembers.members.length){$.push(`
74
+ ## members of ${m.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let x of m.classMembers.members){let S=String(x.label).split(".").pop(),E=x.params!=null&&x.params!==""?`(${x.params})${x.returns?` -> ${x.returns}`:""}`:"",R=x.decorators?`@${x.decorators} `:"",j=x.raises?` raises=${x.raises}`:"";$.push(` ${x.class} ${S}${x.site?` :${x.site.start}`:""} ${R}${S}${E}${j}`)}}if(b.siblings&&m.siblings.length){$.push(`
75
+ ## sibling symbols to copy the style of (most relevant first; ${m.siblings.length} total):`);for(let x of m.siblings.slice(0,m.siblingCap)){let S=x.site?v(x.site.start):"",E=x.decorators?`@${x.decorators} `:"",R=x.raises?` raises=${x.raises}`:"";$.push(` ${x.class} ${x.label}${x.site?` :${x.site.start}`:""} ${E}${S}${R}`)}m.siblings.length>m.siblingCap&&$.push(` \u2026+${m.siblings.length-m.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(b.allExports&&m.allExports&&$.push(`
76
76
  ## module __all__ \u2014 this module curates its public API; ADD your new public symbol to this list so it is importable:
77
- ${h.allExports}`),b.reexports&&h.exports&&h.exports.length&&$.push(`
78
- ## re-exported symbols (resolved __all__ \u2192 defining module): ${h.exports.join(", ")}`),b.insertionRegion&&h.insertionRegion&&w){let x=h.insertionRegion.start,S=Math.min(w.length,x+40-1);$.push(`
79
- ## insertion region (write your new sibling here) \u2014 ${h.moduleLabel}:${x}-${S}`),$.push(w.slice(x-1,S).map((E,R)=>`${x+R} ${E}`).join(`
80
- `))}else h.insertion&&$.push(`
81
- ## insert the new sibling after line ~${h.insertion} (end of the last top-level definition).`);return b.tests&&h.tests.length&&$.push(`
82
- ## covering tests: ${h.tests.join(", ")}`),b.cochange&&h.cochange&&h.cochange.length&&$.push(`
83
- ## usually changed together (consider editing these too): ${h.cochange.map(x=>`${x.label} (\xD7${x.weight})`).join(", ")}`),$.push(`
84
- You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${h.moduleLabel}.`),g!=="FULL"&&$.push(`(bundle tier ${g}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:$.join(`
85
- `),tier:g,topup:y}}async function Pl(e,{config:t,source:n,tel:s}){return(await gh(e,{config:t,source:n,tel:s})).text}var Ml=O(()=>{_t();Ue();Bt();na();_r();Oe();ks();ra();ia();Ge();Pl.ownsGraphLoad=!0});function bh(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"symbol"),"symbol");return Bf(Po(t,s))}var wh=O(()=>{Oe();Ge()});function aa(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 Gr(e){return aa(e).toString(16).padStart(8,"0")}function Vk(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,_=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+v+i[w-7]+_>>>0}let[d,f,p,m,h,g,b,y]=r;for(let w=0;w<64;w+=1){let v=a(h,6)^a(h,11)^a(h,25),_=h&g^~h&b,$=y+v+_+qk[w]+i[w]>>>0,x=a(d,2)^a(d,13)^a(d,22),S=d&f^d&p^f&p,E=x+S>>>0;y=b,b=g,g=h,h=m+$>>>0,m=p,p=f,f=d,d=$+E>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+f>>>0,r[2]=r[2]+p>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+g>>>0,r[6]=r[6]+b>>>0,r[7]=r[7]+y>>>0}let 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 Hk(e,t){let n=Vk(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function J(e){let t=os(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 rs(e){let t=os(e);return Yk.get(t)??t}function ge(e,t,n){return Ho(J(e),rs(t),J(n))}var qk,Kk,os,Yk,Ho,nn=O(()=>{qk=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]);Kk=2e3,os=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,Kk);Yk=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"]]);Ho=(e,t,n)=>`fact:${Hk(`${e}\0${t}\0${n}`,8)}`});var un={};Bn(un,{CARDINALITY_RULE_CONFIDENCE:()=>nj,CAX_DW_RULE:()=>Dl,CAX_DW_RULE_CONFIDENCE:()=>Ul,CAX_MAXC0_RULE_CONFIDENCE:()=>oj,CLS_SVF1_RULE:()=>Bl,CLS_SVF1_RULE_CONFIDENCE:()=>Gl,DEFAULT_MAX_ENVIRONMENTS:()=>ca,DISJOINT_PREDICATE:()=>Ko,ENTAILED_DISJOINT_PROVENANCE:()=>zl,ENTAILED_PROVENANCE:()=>vh,ENTAILED_SCM_SVF_PROVENANCE:()=>Hl,ENTAILED_SVF1_PROVENANCE:()=>Wl,ENTAILED_TYPE_PROVENANCE:()=>Eh,ON_PROPERTY_PREDICATE:()=>In,SCM_SVF_RULE:()=>Vl,SCM_SVF_RULE_CONFIDENCE:()=>Kl,SOME_VALUES_FROM_PREDICATE:()=>Cn,SUBCLASS_PREDICATE:()=>Fe,TYPE_PREDICATE:()=>Lt,buildCardinalityRestrictions:()=>tj,buildRelevanceFrontier:()=>Fl,deriveDisjointViolations:()=>_h,deriveSomeValuesFromApplication:()=>Rh,deriveSomeValuesFromSubsumption:()=>Th,deriveSubClassClosure:()=>Sh,deriveSubClassClosureDelta:()=>kh,deriveTypePropagation:()=>jh,entailedTrustFrom:()=>Jk,findConsistencyViolations:()=>ij,findIsaChain:()=>Yl,proveCardinalityAtLeast:()=>sj,proveMaxCardinalityZeroDenial:()=>rj,retractSubClassOf:()=>dj,syllogise:()=>aj});function yh(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 Jk(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 is(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=J(s);o&&n.add(o)}return n.size?n:null}function Sh(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}${Le}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:is(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,m]of r)for(let h of m){let g=r.get(h);if(g)for(let b of g){if(p===b)continue;let y=`${p}${Le}${b}`;o.has(y)||c.has(y)||a(p,h,b)&&d.push([p,h,b,y])}}if(!d.length)break;d.sort((p,m)=>p[0].localeCompare(m[0])||p[2].localeCompare(m[2])||p[1].localeCompare(m[1]));let f=!1;for(let[p,m,h,g]of d)if(!c.has(g)){if(l.length>=n)break;c.add(g),l.push({subject:p,object:h,via:m}),r.has(p)||r.set(p,new Set),r.get(p).add(h),f=!0}if(l.length>=n||!f)break}return l}function kh(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[m,h]of e||[])!m||!h||m===h||(r.add(`${m}${Le}${h}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),a.has(h)||a.set(h,new Set),a.get(h).add(m));let l=[],c=new Set;for(let[m,h]of t||[]){if(!m||!h||m===h)continue;let g=`${m}${Le}${h}`;c.has(g)||(c.add(g),l.push([m,h]))}let u=o instanceof Set?o.size?o:null:is(o),d=(m,h,g)=>!u||u.has(m)||u.has(h)||u.has(g),f=[],p=new Set;for(let m=0;m<n&&l.length;m+=1){let h=[],g=(w,v,_)=>{if(w===_)return;let $=`${w}${Le}${_}`;r.has($)||p.has($)||d(w,v,_)&&h.push([w,v,_,$])};for(let[w,v]of l){for(let _ of i.get(v)||[])g(w,v,_);for(let _ of a.get(w)||[])g(_,w,v)}if(!h.length)break;h.sort((w,v)=>w[0].localeCompare(v[0])||w[2].localeCompare(v[2])||w[1].localeCompare(v[1]));let b=!1,y=[];for(let[w,v,_,$]of h)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:w,object:_,via:v}),i.has(w)||i.set(w,new Set),i.get(w).add(_),a.has(_)||a.set(_,new Set),a.get(_).add(w),y.push([w,_]),b=!0}if(f.length>=s||!b)break;l=y}return f}function On(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 Qk(e){return On((e||[]).map(([t,n])=>[n,t]))}function Fl(e,t){let n=[],s=[],o=new Map,r=new Map;for(let c of e||[])!c||!c.subject||!c.predicate||!c.object||(Rs(c.predicate)?n.push([c.subject,c.object]):oo(c.predicate)?s.push([c.subject,c.object]):Yo(c.predicate)?o.set(c.subject,c.object):Vr(c.predicate)&&r.set(c.subject,c.object));let i=Qk(n),a=new Set;for(let c of t||[]){let u=J(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 jh(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=On(t),i=new Set,a=new Set;for(let[p,m]of o||[])p&&m&&i.add(`${p}${Le}${m}`);let l=s instanceof Set?s.size?s:null:is(s),c=(p,m,h)=>!l||l.has(p)||l.has(m)||l.has(h),u=[];for(let[p,m]of e||[]){if(!p||!m)continue;let h=`${p}${Le}${m}`;if(!a.has(h)){a.add(h);for(let g of r(m)){if(g===m||g===p)continue;let b=`${p}${Le}${g}`;i.has(b)||c(p,m,g)&&u.push([p,m,g,b])}}}u.sort((p,m)=>p[0].localeCompare(m[0])||p[2].localeCompare(m[2])||p[1].localeCompare(m[1]));let d=[],f=new Set;for(let[p,m,h,g]of u)if(!f.has(g)){if(d.length>=n)break;f.add(g),d.push({subject:p,object:h,via:m})}return d}function _h(e,t,n,{budget:s=50,focus:o=null}={}){let r=On(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${Le}${h}`),a.add(`${h}${Le}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let l=new Set,c=o instanceof Set?o.size?o:null:is(o),u=(m,h,g)=>!c||c.has(m)||c.has(h)||c.has(g),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let g=`${m}${Le}${h}`;if(!l.has(g)){l.add(g);for(let b of[h,...r(h)]){let y=i.get(b);if(y)for(let w of y){if(w===m)continue;let v=`${m}${Le}${w}`;a.has(v)||u(m,h,w)&&d.push([m,h,b,w,v])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let f=[],p=new Set;for(let[m,h,g,b,y]of d)if(!p.has(y)){if(f.length>=s)break;p.add(y),f.push({subject:m,object:b,viaType:h,viaClass:g})}return f}function Rh(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=On(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${Le}${g.target}`;a.has(b)||a.set(b,new Set),a.get(b).add(g.restriction)}if(!a.size)return[];let l=new Set,c=new Map;for(let[g,b]of t||[])!g||!b||(l.add(`${g}${Le}${b}`),c.has(g)||c.set(g,new Set),c.get(g).add(b));let u=r instanceof Set?r.size?r:null:is(r),d=(g,b,y)=>!u||u.has(g)||u.has(b)||u.has(y),f=new Set,p=[];for(let[g,b,y]of e||[]){if(!g||!b||!y)continue;let w=J(b),v=`${g}${Le}${w}${Le}${y}`;if(f.has(v))continue;f.add(v);let _=c.get(y);if(_)for(let $ of _)for(let x of[$,...i($)]){let S=a.get(`${w}${Le}${x}`);if(S)for(let E of S){if(g===E)continue;let R=`${g}${Le}${E}`;l.has(R)||d(g,y,E)&&p.push([g,b,w,y,$,x,E,R])}}}p.sort((g,b)=>g[0].localeCompare(b[0])||g[6].localeCompare(b[6])||g[1].localeCompare(b[1])||g[3].localeCompare(b[3]));let m=[],h=new Set;for(let[g,b,y,w,v,_,$,x]of p)if(!h.has(x)){if(m.length>=o)break;h.add(x),m.push({subject:g,object:$,viaProperty:b,viaPropertyKey:y,viaValue:w,viaType:v,viaTarget:_})}return m}function tj(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Yo(r.predicate))t.set(r.subject,r.object);else if(Xk(r.predicate))s.set(r.subject,r.object);else{let i=ej[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)!==Zk)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 Th(e,t,{budget:n=50,focus:s=null}={}){let o=On(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=J(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}${Le}${p}`);let a=s instanceof Set?s.size?s:null:is(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 m of f){if(p.restriction===m.restriction||p.target===m.target||!o(p.target).has(m.target))continue;let h=`${p.restriction}${Le}${m.restriction}`;i.has(h)||l(p.restriction,m.restriction)&&c.push([p.restriction,m.restriction,p.target,m.target,h])}c.sort((f,p)=>f[0].localeCompare(p[0])||f[1].localeCompare(p[1]));let u=[],d=new Set;for(let[f,p,m,h,g]of c)if(!d.has(g)){if(u.length>=n)break;d.add(g),u.push({subject:f,object:p,viaY1:m,viaY2:h})}return u}function Ah(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=On(e),a=r instanceof Set?r.size?r:null:is(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 m=u.get(p);if(m&&s(m))return{viaClass:f,viaRestriction:p,record:m}}}return null}function sj(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Ah(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 rj(e,t,n,s,o={}){if(!s)return null;let r=Ah(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 ij(e,t,n,{budget:s=50,focus:o=null}={}){let r=On(t),i=new Map;for(let[p,m]of n||[])!p||!m||p===m||(i.has(p)||i.set(p,new Set),i.get(p).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(p));if(!i.size)return[];let a=new Map;for(let[p,m]of e||[])!p||!m||(a.has(p)||a.set(p,new Set),a.get(p).add(m));let l=o instanceof Set?o.size?o:null:is(o),c=p=>!l||l.has(p),u=[],d=new Set;for(let[p,m]of a){if(!c(p))continue;let h=[...m].sort();for(let g=0;g<h.length;g+=1)for(let b=g+1;b<h.length;b+=1){let[y,w]=[h[g],h[b]],v=[y,...r(y)],_=[w,...r(w)],$=null;for(let S of v){let E=i.get(S);if(E){for(let R of _)if(E.has(R)){$=[S,R];break}if($)break}}if(!$)continue;let x=`${p}${Le}${y}${Le}${w}`;d.has(x)||(d.add(x),u.push([p,y,w,$[0],$[1]]))}}u.sort((p,m)=>p[0].localeCompare(m[0])||p[1].localeCompare(m[1])||p[2].localeCompare(m[2]));let f=[];for(let[p,m,h,g,b]of u){if(f.length>=s)break;f.push({subject:p,classA:m,classB:h,viaA:g,viaB:b})}return f}async function aj(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=ca,full:i=!1,store:a}={}){let{loadMemory:l,readFactRows:c,appendFacts:u}=yh(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await l(e),p=c(f),m=p.filter(k=>Rs(k.predicate)).map(k=>[k.subject,k.object]),h=p.filter(k=>oo(k.predicate)).map(k=>[k.subject,k.object]),g=p.filter(k=>so(k.predicate)).map(k=>[k.subject,k.object]),b=new Map,y=new Map,w=[];for(let k of p){let le=String(k.predicate||"").trim().toLowerCase();Yo(k.predicate)?b.set(k.subject,k.object):Vr(k.predicate)?y.set(k.subject,k.object):ql.has(le)||w.push([k.subject,k.predicate,k.object])}let v=[];for(let[k,le]of b){let Te=y.get(k);Te&&v.push({restriction:k,property:le,target:Te})}let _=is(s),$=o&&_?Fl(p,[..._]):_,x=$===null&&d?await a.loadSyllogiseState(e):null,S=new Set(p.map(k=>k.id)),E=Array.isArray(x?.factIds)?x.factIds.filter(k=>!S.has(k)):[],R=x&&Array.isArray(x.factIds)&&!E.length&&!i?"delta":"full",j=R==="delta"?new Set(x.factIds):null,A=R==="delta"?p.filter(k=>!j.has(k.id)):p,F=A.length,T=new Map;for(let k of p)T.set(`${k.subject}${Le}${k.predicate}${Le}${k.object}`,k.trust);let M=(k,le,Te)=>T.get(`${k}${Le}${le}${Le}${Te}`),z=(k,le,Te)=>T.has(`${k}${Le}${le}${Le}${Te}`),Y=k=>k.filter(le=>typeof le=="number"),ae=R==="delta"&&!A.length,Z=R==="delta"?A.filter(k=>Rs(k.predicate)).map(k=>[k.subject,k.object]):[],D=R==="delta"?Z.length?kh(m,Z,{depth:t,budget:n,focus:$}):[]:Sh(m,{depth:t,budget:n,focus:$}),U=m.concat(D.map(k=>[k.subject,k.object])),G=$,I=null;if(R==="delta"&&!ae){let k=p.concat(D.map(Te=>({subject:Te.subject,predicate:Fe,object:Te.object}))),le=[];for(let Te of A)le.push(Te.subject,Te.object);I=Fl(k,le),G=I}let L=k=>!I||I.has(k),C=I?h.filter(([k,le])=>L(k)||L(le)):h,P=new Set;if(I)for(let k of A)so(k.predicate)&&(P.add(k.subject),P.add(k.object));let N=I&&P.size?On(U):null,W=I?h.filter(([k,le])=>L(k)||L(le)||N&&[...N(le)].some(Te=>P.has(Te))):h,V=new Set;if(I){for(let k of A)if(Yo(k.predicate)||Vr(k.predicate)){let le=b.get(k.subject);le&&V.add(J(le))}}let ie=I?w.filter(([k,le,Te])=>L(k)||L(Te)||V.has(J(le))):w,ce=Math.max(0,n-D.length),K=ce>0&&!ae?jh(C,U,{budget:ce,focus:G,presentTypeEdges:h}):[],ee=Math.max(0,n-D.length-K.length),q=ee>0&&!ae?_h(W,U,g,{budget:ee,focus:G}):[],ne=Math.max(0,n-D.length-K.length-q.length),te=ne>0&&v.length&&!ae?Rh(ie,h,U,v,{budget:ne,focus:G}):[],xe=Math.max(0,n-D.length-K.length-q.length-te.length),Ae=xe>0&&v.length>1&&!ae?Th(v,U,{budget:xe,focus:G}):[],pe=new Map(v.map(k=>[k.restriction,k])),re=[...D.map(k=>({subject:k.subject,predicate:Fe,object:k.object,provenance:vh,justification:[[ge(k.subject,Fe,k.via),ge(k.via,Fe,k.object)]]})),...K.map(k=>({subject:k.subject,predicate:Lt,object:k.object,provenance:Eh,justification:[[ge(k.subject,Lt,k.via),ge(k.via,Fe,k.object)]]})),...q.map(k=>{let le=z(k.viaClass,Ko,k.object),[Te,Un]=le?[k.viaClass,k.object]:[k.object,k.viaClass],So=Y([M(k.subject,Lt,k.viaType),M(Te,Ko,Un),...k.viaClass!==k.viaType?[M(k.viaType,Fe,k.viaClass)]:[]]);return{subject:k.subject,predicate:Ko,object:k.object,provenance:zl,justification:[[ge(k.subject,Lt,k.viaType),ge(Te,Ko,Un),...k.viaClass!==k.viaType?[ge(k.viaType,Fe,k.viaClass)]:[]]],...So.length?{premiseTrusts:So,ruleConfidence:Ul}:{}}}),...te.map(k=>{let le=Y([M(k.subject,k.viaProperty,k.viaValue),M(k.viaValue,Lt,k.viaType),M(k.object,In,k.viaPropertyKey),M(k.object,Cn,k.viaTarget),...k.viaType!==k.viaTarget?[M(k.viaType,Fe,k.viaTarget)]:[]]);return{subject:k.subject,predicate:Lt,object:k.object,provenance:Wl,justification:[[ge(k.subject,k.viaProperty,k.viaValue),ge(k.viaValue,Lt,k.viaType),ge(k.object,In,k.viaPropertyKey),ge(k.object,Cn,k.viaTarget),...k.viaType!==k.viaTarget?[ge(k.viaType,Fe,k.viaTarget)]:[]]],...le.length?{premiseTrusts:le,ruleConfidence:Gl}:{}}}),...Ae.map(k=>{let le=pe.get(k.subject),Te=pe.get(k.object),Un=Y([le&&M(k.subject,In,le.property),M(k.subject,Cn,k.viaY1),Te&&M(k.object,In,Te.property),M(k.object,Cn,k.viaY2),M(k.viaY1,Fe,k.viaY2)]);return{subject:k.subject,predicate:Fe,object:k.object,provenance:Hl,justification:[[...le?[ge(k.subject,In,le.property)]:[],ge(k.subject,Cn,k.viaY1),...Te?[ge(k.object,In,Te.property)]:[],ge(k.object,Cn,k.viaY2),ge(k.viaY1,Fe,k.viaY2)]],...Un.length?{premiseTrusts:Un,ruleConfidence:Kl}:{}}})],fe=re.map(k=>({id:ge(k.subject,k.predicate,k.object),subject:k.subject,predicate:k.predicate,object:k.object,environments:k.justification,write:k})),be=Ch(p.concat(fe.map(k=>({id:k.id,subject:k.subject,predicate:k.predicate,object:k.object})))),Ie=new Map(p.map(k=>[k.id,k])),ue=k=>Rs(k)||oo(k)||so(k),H=k=>R!=="delta"||I!==null&&(I.has(k.subject)||I.has(k.object)),se=p.filter(k=>ue(k.predicate)&&Ih(k.provenance)&&qr(k).length<r&&H(k)).map(k=>({id:k.id,subject:k.subject,predicate:k.predicate,object:k.object,environments:qr(k),provenance:k.provenance})),et=[...fe,...se].sort((k,le)=>k.subject.localeCompare(le.subject)||k.predicate.localeCompare(le.predicate)||k.object.localeCompare(le.object)),De=0,Ve=!1,on=0;for(let k of et){if(on>=n){Ve=!0;break}on+=1;let le=be(k,{maxEnvironments:r+1}),{kept:Te,truncated:Un}=lj(k.environments,le,r);if(Un&&(Ve=!0),!(Te.length<=k.environments.length)){if(De+=Te.length-k.environments.length,k.write){k.write.justification=Te;continue}re.push({subject:k.subject,predicate:k.predicate,object:k.object,justification:Te,...Oh(k.provenance,Te,So=>Ie.get(So)?.trust)||{}})}}let{ids:rn}=await u(e,re),Xt=[],zt=0;for(let k of D)Xt.push({id:rn[zt],subject:k.subject,object:k.object,via:k.via,rule:$h}),zt+=1;for(let k of K)Xt.push({id:rn[zt],subject:k.subject,object:k.object,via:k.via,rule:xh}),zt+=1;for(let k of q)Xt.push({id:rn[zt],subject:k.subject,object:k.object,via:k.viaClass,rule:Dl}),zt+=1;for(let k of te)Xt.push({id:rn[zt],subject:k.subject,object:k.object,via:k.viaValue,rule:Bl}),zt+=1;for(let k of Ae)Xt.push({id:rn[zt],subject:k.subject,object:k.object,via:k.viaY1,rule:Vl}),zt+=1;let yi=Xt.length>=n;if($===null&&d&&!yi){let k=new Set(S);for(let le of rn)k.add(le);await a.saveSyllogiseState(e,{version:1,factIds:[...k].sort(),completedAt:new Date().toISOString()})}return{derived:Xt,count:Xt.length,budget:n,depth:t,truncated:yi,mode:R,deltaSize:F,environmentsAdded:De,alternatesTruncated:Ve}}function Ih(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function cj(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();Rs(u.predicate)?t.push([u.subject,u.object]):oo(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):so(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)):Yo(u.predicate)?o.set(u.subject,u.object):Vr(u.predicate)?r.set(u.subject,u.object):ql.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([J(u.predicate),u.object]))}let a=On(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:J(d),target:f}:null};return u=>{if(Rs(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(oo(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 m of n.get(p)||[])if(m===d.target||l(m,d.target))return!0}}return!1}if(so(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 Ch(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 m=String(p.predicate||"").trim().toLowerCase();Rs(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)):oo(p.predicate)?(o.has(p.subject)||o.set(p.subject,new Set),o.get(p.subject).add(p.object)):so(p.predicate)?(r.add(`${p.subject}${Le}${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)):Yo(p.predicate)?a.set(p.subject,p.object):Vr(p.predicate)?l.set(p.subject,p.object):ql.has(m)||(c.has(p.subject)||c.set(p.subject,[]),c.get(p.subject).push([p.predicate,p.object]))}let u=On(n),d=p=>s.get(p)||new Set,f=p=>{let m=a.get(p),h=l.get(p);return m&&h?{property:m,propertyKey:J(m),target:h}:null};return(p,{maxEnvironments:m=ca}={})=>{let h=[],g=new Set,b=y=>{if(h.length>=m||p.id&&y.includes(p.id)||!y.every(v=>t.has(v)))return;let w=[...y].sort().join(" ");g.has(w)||(g.add(w),h.push(y))};if(Rs(p.predicate)){for(let y of[...d(p.subject)].sort()){if(h.length>=m)break;y===p.subject||y===p.object||d(y).has(p.object)&&b([ge(p.subject,Fe,y),ge(y,Fe,p.object)])}if(h.length<m){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)&&b([ge(p.subject,In,y.property),ge(p.subject,Cn,y.target),ge(p.object,In,w.property),ge(p.object,Cn,w.target),ge(y.target,Fe,w.target)])}return h}if(oo(p.predicate)){for(let w of[...o.get(p.subject)||[]].sort()){if(h.length>=m)break;w!==p.object&&d(w).has(p.object)&&b([ge(p.subject,Lt,w),ge(w,Fe,p.object)])}let y=f(p.object);if(y){let w=[...c.get(p.subject)||[]].filter(([v])=>J(v)===y.propertyKey).sort((v,_)=>v[0].localeCompare(_[0])||v[1].localeCompare(_[1]));for(let[v,_]of w){if(h.length>=m)break;for(let $ of[...o.get(_)||[]].sort()){if(h.length>=m)break;$!==y.target&&!d($).has(y.target)||b([ge(p.subject,v,_),ge(_,Lt,$),ge(p.object,In,y.propertyKey),ge(p.object,Cn,y.target),...$!==y.target?[ge($,Fe,y.target)]:[]])}}}return h}if(so(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(h.length>=m)break;let _=r.has(`${v}${Le}${p.object}`),[$,x]=_?[v,p.object]:[p.object,v];b([ge(p.subject,Lt,w),ge($,Ko,x),...v!==w?[ge(w,Fe,v)]:[]])}return h}return h}}function lj(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 Oh(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=uj.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 dj(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=ca,store:i,sourceTags:a=[]}={}){let{loadMemory:l,readFactRows:c,removeFacts:u}=yh(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),d=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,p=(a||[]).filter(Boolean);if(p.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let m=J(t),h=J(n),g=ge(m,Fe,h),b=await l(e),y=c(b),w=new Map(y.map(M=>[M.id,M]));if(!w.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let v=w.get(g).sourceIds||[],_=p.map(M=>f(g,M).slice(g.length+1)),$=p.length?v.filter(M=>_.includes(M)):[],x=!p.length||$.length>0;if(p.length&&!x)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=p.length>0&&$.length<v.length,E=new Set([g]),R=[g],j=new Map,A=!1;if(!S){let M=y.filter(Z=>qr(Z).length&&Ih(Z.provenance)),z=new Map;for(let Z of M)for(let D of qr(Z))for(let U of D)z.has(U)||z.set(U,new Set),z.get(U).add(Z.id);let Y=0,ae=[g];for(;Y<o;Y+=1){let Z=new Set;for(let N of ae)for(let W of z.get(N)||[])E.has(W)||Z.add(W);let D=[...Z].map(N=>w.get(N)).sort((N,W)=>N.subject.localeCompare(W.subject)||N.predicate.localeCompare(W.predicate)||N.object.localeCompare(W.object));if(!D.length)break;let U=y.filter(N=>!E.has(N.id)&&!Z.has(N.id)),G=new Set(U.map(N=>N.id)),I=Ch(U),L=cj(U),C=!1,P=!1;ae=[];for(let N of D){if(E.size>=s){P=!0;break}let W=qr(N),V=W.filter(ce=>ce.every(K=>G.has(K)));if(V.length){V.length!==W.length&&j.set(N.id,V);continue}let ie=I(N,{maxEnvironments:r});if(ie.length){j.set(N.id,ie);continue}L(N)||(E.add(N.id),R.push(N.id),ae.push(N.id),C=!0)}if(P){A=!0;break}if(!C)break}!A&&Y>=o&&(A=M.some(Z=>!E.has(Z.id)&&Z.justification.some(D=>E.has(D))))}let F=p.length?[...$.map(M=>`${g}@${M}`),...R.slice(1)]:R,{removed:T}=await u(e,F);if(d){let M=[...j.entries()].filter(([z])=>!E.has(z)).sort((z,Y)=>z[0].localeCompare(Y[0])).map(([z,Y])=>{let ae=w.get(z);return{subject:ae.subject,predicate:ae.predicate,object:ae.object,justification:Y,...Oh(ae.provenance,Y,Z=>w.get(Z)?.trust)||{}}});M.length&&await d(e,M)}return{retracted:T,count:T.length,budget:s,depth:o,truncated:A,found:!0,...p.length?{ownRecord:!0,stillStands:S}:{}}}function Yl(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=new Map;for(let[c,u]of s||[])!c||!u||c===u||(i.has(c)||i.set(c,new Set),i.get(c).add(u));let a=[];for(let[c,u]of n||[])c===e&&u&&a.push({node:u,path:[{subject:c,predicate:Lt,object:u}]});for(let c of i.get(e)||[])a.push({node:c,path:[{subject:e,predicate:Fe,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:Fe,object:p}]})}a=u}return null}var Fe,$h,vh,Lt,xh,Eh,Ko,Dl,zl,Ul,In,Cn,Bl,Wl,Gl,ca,Le,Rs,oo,so,Yo,Vr,Xk,ql,Zk,ej,Vl,Hl,Kl,nj,oj,qr,uj,Ht=O(()=>{nn();Fe="rdfs:subClassOf",$h="subClassOf",vh=`entailed:${$h}`,Lt="rdf:type",xh="type",Eh=`entailed:${xh}`,Ko="owl:disjointWith",Dl="disjointWith",zl=`entailed:${Dl}`,Ul=.95,In="owl:onProperty",Cn="owl:someValuesFrom",Bl="someValuesFrom",Wl=`entailed:${Bl}`,Gl=.95,ca=4,Le="\u241F",Rs=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",oo=e=>String(e||"").trim().toLowerCase()==="rdf:type",so=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Yo=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",Vr=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",Xk=e=>String(e||"").trim().toLowerCase()==="owl:onclass",ql=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);Zk="has",ej={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Vl="someValuesFromSubsumption",Hl=`entailed:${Vl}`,Kl=.95;nj=.95;oj=.95;qr=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);uj=new Map([[zl,Ul],[Wl,Gl],[Hl,Kl]])});function Zo(e){let t=String(e||""),n=Lh.get(t);return n||(t.startsWith(Xl)?Xo+t.slice(Xl.length):t)}function Nh(e){let t=String(e||""),n=pj.get(t);return n||(t.startsWith(Xo)?Xl+t.slice(Xo.length):null)}function Fh(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Yl(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function da(e,t,n,{maxHops:s=3}={}){let o=Qo(e),r=Qo(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassEdges:l}=Mh(i),c=i.filter(b=>(b.predicate===ua||b.predicate===Jo)&&r.has(b.object)),u=[];for(let b of c){let y=b.predicate===Jo?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:y,hops:0,chain:null});continue}let w=Fh(o,b.subject,a,l,s);w&&w.length&&u.push({fact:b,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Ql(o,r,i,{maxHops:s})};u.sort((b,y)=>b.hops-y.hops||(y.fact.trust||0)-(b.fact.trust||0));let d=u[0].hops,f=u.filter(b=>b.hops===d),p=f.filter(b=>b.polarity==="positive").map(b=>b.fact),m=f.filter(b=>b.polarity==="negative").map(b=>b.fact),h=m.length&&!p.length?"negative":"positive",g=u.find(b=>b.hops>d&&b.polarity!==h)||null;return{verdict:p.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:p,negative:m,chain:u[0].chain,overrides:g?{fact:g.fact,chain:g.chain}:null,baseRate:null}}function Ql(e,t,n,{maxHops:s=3}={}){let o=Qo(e),r=Qo(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===Fe||h.predicate===Lt),l=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!l.length)return null;let c=l[0],u=[...new Set(a.filter(h=>h.object===c&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let g=i.find(b=>b.subject===h&&r.has(b.object)&&(b.predicate===ua||b.predicate===Jo));return g?{name:h,polarity:g.predicate===Jo?"negative":"positive",fact:g}:{name:h,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassEdges:m}=Mh(i);return{klass:c,kinds:u.length,positive:f.filter(h=>h.polarity==="positive"),negative:f.filter(h=>h.polarity==="negative"),unknown:f.filter(h=>h.polarity==="unknown"),chain:Fh(o,c,p,m,s)}}function Zl(e,t,{exclude:n=[],maxHops:s=3}={}){let o=Qo(e),r=Qo(n),i=Array.isArray(t)?t:[],a=new Set,l=[];for(let c of i)c.predicate!==ua||!o.has(c.object)||r.has(c.subject)||a.has(c.subject)||(a.add(c.subject),da(new Set([c.subject]),o,i,{maxHops:s}).verdict==="yes"&&l.push(c));return l.sort(fj)}var Xo,Xl,la,Lh,pj,Ph,ua,Jo,Jl,fj,Qo,Mh,pa=O(()=>{Ht();Xo="mgxneg:",Xl="mgx:",la="mgxneg:subClassOf",Lh=new Map([[Fe,la]]),pj=new Map([...Lh].map(([e,t])=>[t,e]));Ph=e=>String(e||"").startsWith(Xo),ua="mgx:capableOf",Jo=Zo(ua),Jl=6,fj=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),Qo=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),Mh=e=>({typeEdges:e.filter(t=>t.predicate===Lt).map(t=>[t.subject,t.object]),subClassEdges:e.filter(t=>t.predicate===Fe).map(t=>[t.subject,t.object])})});function fa(e){let t=String(e||"");return nu.has(t)?eu:hj.has(t)||gj.test(t)?Hr:bj.has(t)?Dh:tu}function wj(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(Bp.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function yj(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(wj(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function su(e,t){let n=t===Dh;if(!n&&t!==Hr)return null;let s=(e||[]).map(r=>({row:r,at:yj(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 eu,Hr,Dh,tu,mj,nu,hj,gj,bj,zh=O(()=>{pa();Hn();eu="merge",Hr="latest-observation-wins",Dh="first-claim-wins",tu="contradiction",mj=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","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(mj.flatMap(e=>[e,Zo(e)])),hj=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"]),gj=/^mgx:has-exit-([a-z]+)$/,bj=new Set(["mgx:playedBy"])});function Xr(e){let t=String(e||""),n=t.indexOf(ma);return n<0?"":t.slice(n+ma.length)}function Sj(e){let t=1,n=0;for(let s of e)t*=1-xj(s),n+=1;return n?Ej(Math.min(1,1-t)):0}function qh(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 Kh(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 Yh(e,t="",n=""){let s=t,o=n;for(let r of e)s=Vh(s,r.assertedAt),o=Hh(o,r.assertedAt);return{earliest:s,latest:o}}function au({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?Sj(l.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:$j,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===er?"rollupSourceIds":"rollupRecordIds",value:l.join(" ")},{prop:Yr,key:"rollupCount",value:String(l.length)},{prop:Ln,key:"rollupEarliest",value:r},{prop:Nn,key:"rollupLatest",value:i},...c===void 0?[]:[{prop:tr,key:"rollupPrior",value:String(c)}]]}}function Xh({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(Kh).slice(8);if(!i.length)return null;let{earliest:a,latest:l}=Yh(i,Et(s,Ln),Et(s,Nn));return{rollup:au({id:ou(e,t),sourceKey:`rollup:${t}`,template:cu(i[0].record||s),idsProp:er,ids:[...ba(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 Jh({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(Kh),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:l}=Yh(i,Et(s,Ln),Et(s,Nn));return{rollup:au({id:ru(e,t),sourceKey:t,template:cu(i[0].record||s),idsProp:Kr,ids:[...vj(s),...i.map(u=>u.id)],earliest:a,latest:l}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function lu(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Ts(s),r=o?er:Kr,i=a=>iu(Et(a,r));return au({id:s,sourceKey:Et(e,"mgx:sourceId")||Et(t,"mgx:sourceId"),template:cu(Et(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Vh(Et(e,Ln),Et(t,Ln)),latest:Hh(Et(e,Nn),Et(t,Nn)),priorFor:o?n:void 0})}function Qh(e,t){if(!t)return!1;for(let n of e||[])if(ba(n).includes(t))return!0;return!1}var $j,Uh,Bh,ha,Wh,er,Kr,Yr,Ln,Nn,tr,ma,Gh,ou,ru,Ts,nr,ga,Et,iu,ba,vj,xj,Ej,Vh,Hh,cu,uu=O(()=>{$j="Fact",Uh=64,Bh=8,ha=8,Wh=2,er="mgx:rollupSourceIds",Kr="mgx:rollupRecordIds",Yr="mgx:rollupCount",Ln="mgx:rollupEarliest",Nn="mgx:rollupLatest",tr="mgx:rollupPrior",ma="@rollup:",Gh="#rollup",ou=(e,t)=>`${e}${ma}${t}`,ru=(e,t)=>`${e}@${t}${Gh}`,Ts=e=>String(e||"").includes(ma),nr=e=>String(e||"").endsWith(Gh),ga=e=>Ts(e)||nr(e);Et=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",iu=e=>String(e||"").split(" ").filter(Boolean),ba=e=>iu(Et(e,er)),vj=e=>iu(Et(e,Kr)),xj=e=>Math.max(0,Math.min(1,Number(e)||0)),Ej=e=>Number(e.toFixed(6));Vh=(e,t)=>qh(e,t,Math.min),Hh=(e,t)=>qh(e,t,Math.max);cu=e=>({label:e?.label||"",subject:Et(e,"rdf:subject"),predicate:Et(e,"rdf:predicate"),object:Et(e,"rdf:object")})});function mu(e){let t=String(e||"");return fu(t)?t.slice(0,-va.length):""}function Zh(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 hu({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:sn,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:ya,key:"retractedRecordIds",value:i.join(" ")},{prop:du,key:"retractedCount",value:String(i.length)},{prop:$a,key:"retractedAt",value:o||""},...a.length?[{prop:Jr,key:"provenance",value:a.join(" | ")}]:[]]}}function tg({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...ro(o),...n].filter(Boolean);return a.length?hu({id:pu(e,t),sourceId:t,template:r||eg(o),ids:a,retractedAt:Zh(io(o),s),tags:[...Qr(dn(o,Jr)),...Qr(i)]}):null}function ng(e,t){let n=eg(dn(e,"rdf:subject")?e:t);return hu({id:e?.id||t?.id,sourceId:dn(e,"mgx:sourceId")||dn(t,"mgx:sourceId"),template:n,ids:[...ro(e),...ro(t)],retractedAt:Zh(io(e),io(t)),tags:[...Qr(dn(e,Jr)),...Qr(dn(t,Jr))]})}function jj(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function _j(e,t,n=""){return!e||!t||!ro(e).includes(t)?!1:jj(n,io(e))}function xa(e,t,n=""){for(let s of e||[])if(_j(s,t,n))return!0;return!1}function Rj(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function Tj(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 Ea(e){let t=mu(e?.id);return t?{id:e.id,subject:t,predicate:wa,object:Rj(io(e),ro(e)),provenance:dn(e,Jr)}:null}function Sa(e){if(!e||e.predicate!==wa)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=Tj(e.object);return o.length?hu({id:`${t}${va}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:Qr(e.provenance)}):null}var sn,wa,ya,$a,du,va,Jr,pu,fu,dn,kj,Qr,ro,io,eg,gu=O(()=>{sn="Retraction",wa="mgx:retracted",ya="mgx:retractedRecordIds",$a="mgx:retractedAt",du="mgx:retractedCount",va="#retracted",Jr="mgx:factProvenance",pu=(e,t)=>`${e}@${t}${va}`,fu=e=>String(e||"").endsWith(va);dn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",kj=e=>String(e||"").split(" ").filter(Boolean),Qr=e=>String(e||"").split(" | ").filter(Boolean),ro=e=>kj(dn(e,ya)),io=e=>dn(e,$a);eg=e=>({label:e?.label||"",subject:dn(e,"rdf:subject"),predicate:dn(e,"rdf:predicate"),object:dn(e,"rdf:object")})});var Aj,Ij,Cj,Oj,bu,s0,sg=O(()=>{Hn();Aj="mgx:worldName",Ij="mgx:nodeName",Cj="mgx:playedBy",Oj="mgx:waved",bu="mgx:invitedBy",s0=Object.freeze([Aj,Ij,Cj,Oj,bu])});function ka(e){let t=new Set;for(let n of e||[])n?.predicate===bu&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function wu(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function ja({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=wu(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 yu=O(()=>{sg()});function as(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function Dj(e,t){(!e?.class||!Lj.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function zj(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Zr(as(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=as(e,i);a!==void 0&&Pj.test(a)&&t.push(`a Fact's ${i} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(a)})`)}let n=as(e,"mgx:factProvenance");n!==void 0&&!Zr(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";Mj(s)&&!rg.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=as(e,"mgx:sourceId");o!==void 0&&!Zr(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=as(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);for(let i of Fj){let a=as(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)rg.test(c)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(c)})`)}}function Uj(e,t){Zr(as(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=as(e,"mgx:ruleKind");if(!n||!og.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...og].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of Nj[n])Zr(as(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function Bj(e){let t=[];return Dj(e,t),e?.class==="Fact"&&zj(e,t),e?.class==="Rule"&&Uj(e,t),{ok:t.length===0,violations:t}}function $u(e){let t=Bj(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 Lj,og,Nj,Pj,rg,Mj,Fj,Zr,ig=O(()=>{Lj=new Set(["Utterance","Fact","Session","Source","Rule"]),og=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),Nj={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"]},Pj=/[.!?]\s+\w/,rg=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,Mj=e=>e.includes("@")||/#v\d/.test(e),Fj=["mgx:supersedes","mgx:supersededBy"];Zr=e=>typeof e=="string"&&e.trim().length>0});var ag={};Bn(ag,{access:()=>qj,appendFile:()=>Kj,basename:()=>u_,copyFile:()=>t_,createInterface:()=>h_,createReadStream:()=>s_,createRequire:()=>Wj,createWriteStream:()=>o_,default:()=>b_,dirname:()=>a_,existsSync:()=>r_,fileURLToPath:()=>p_,isAbsolute:()=>l_,join:()=>i_,mkdir:()=>Yj,mkdtemp:()=>Xj,randomBytes:()=>f_,readFile:()=>Vj,readFileSync:()=>Gj,readdir:()=>n_,rename:()=>Jj,resolve:()=>c_,rm:()=>Zj,sep:()=>d_,spawnSync:()=>m_,stat:()=>e_,tmpdir:()=>g_,unlink:()=>Qj,writeFile:()=>Hj});var dt,Wj,Gj,qj,Vj,Hj,Kj,Yj,Xj,Jj,Qj,Zj,e_,t_,n_,s_,o_,r_,i_,a_,c_,l_,u_,d_,p_,f_,m_,h_,g_,b_,cg=O(()=>{dt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},Wj=dt("createRequire"),Gj=dt("readFileSync"),qj=dt("access"),Vj=dt("readFile"),Hj=dt("writeFile"),Kj=dt("appendFile"),Yj=dt("mkdir"),Xj=dt("mkdtemp"),Jj=dt("rename"),Qj=dt("unlink"),Zj=dt("rm"),e_=dt("stat"),t_=dt("copyFile"),n_=dt("readdir"),s_=dt("createReadStream"),o_=dt("createWriteStream"),r_=()=>!1,i_=(...e)=>e.join("/"),a_=e=>String(e).replace(/\/[^/]*$/,""),c_=(...e)=>e.join("/"),l_=e=>String(e).startsWith("/"),u_=e=>String(e).split("/").pop(),d_="/",p_=e=>String(e),f_=dt("randomBytes"),m_=dt("spawnSync"),h_=dt("createInterface"),g_=()=>"/tmp",b_={}});var w_,ei,vu=O(()=>{w_=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ei=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(w_);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 y_(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function $_(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
77
+ ${m.allExports}`),b.reexports&&m.exports&&m.exports.length&&$.push(`
78
+ ## re-exported symbols (resolved __all__ \u2192 defining module): ${m.exports.join(", ")}`),b.insertionRegion&&m.insertionRegion&&w){let x=m.insertionRegion.start,S=Math.min(w.length,x+40-1);$.push(`
79
+ ## insertion region (write your new sibling here) \u2014 ${m.moduleLabel}:${x}-${S}`),$.push(w.slice(x-1,S).map((E,R)=>`${x+R} ${E}`).join(`
80
+ `))}else m.insertion&&$.push(`
81
+ ## insert the new sibling after line ~${m.insertion} (end of the last top-level definition).`);return b.tests&&m.tests.length&&$.push(`
82
+ ## covering tests: ${m.tests.join(", ")}`),b.cochange&&m.cochange&&m.cochange.length&&$.push(`
83
+ ## usually changed together (consider editing these too): ${m.cochange.map(x=>`${x.label} (\xD7${x.weight})`).join(", ")}`),$.push(`
84
+ You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${m.moduleLabel}.`),g!=="FULL"&&$.push(`(bundle tier ${g}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:$.join(`
85
+ `),tier:g,topup:y}}async function zl(e,{config:t,source:n,tel:s}){return(await vm(e,{config:t,source:n,tel:s})).text}var Ul=O(()=>{_t();Ue();Ut();oa();_r();Oe();_s();aa();ca();Ge();zl.ownsGraphLoad=!0});function xm(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"symbol"),"symbol");return qf(Po(t,s))}var Em=O(()=>{Oe();Ge()});function la(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 Gr(e){return la(e).toString(16).padStart(8,"0")}function oj(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,_=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+v+i[w-7]+_>>>0}let[d,f,p,h,m,g,b,y]=r;for(let w=0;w<64;w+=1){let v=a(m,6)^a(m,11)^a(m,25),_=m&g^~m&b,$=y+v+_+sj[w]+i[w]>>>0,x=a(d,2)^a(d,13)^a(d,22),S=d&f^d&p^f&p,E=x+S>>>0;y=b,b=g,g=m,m=h+$>>>0,h=p,p=f,f=d,d=$+E>>>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]+g>>>0,r[6]=r[6]+b>>>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 rj(e,t){let n=oj(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function Q(e){let t=rs(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 is(e){let t=rs(e);return aj.get(t)??t}function me(e,t,n){return Ho(Q(e),is(t),Q(n))}var sj,ij,rs,aj,Ho,sn=O(()=>{sj=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]);ij=2e3,rs=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,ij);aj=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"]]);Ho=(e,t,n)=>`fact:${rj(`${e}\0${t}\0${n}`,8)}`});var dn={};Wn(dn,{CARDINALITY_RULE_CONFIDENCE:()=>hj,CAX_DW_RULE:()=>Wl,CAX_DW_RULE_CONFIDENCE:()=>Vl,CAX_MAXC0_RULE_CONFIDENCE:()=>gj,CLS_SVF1_RULE:()=>ql,CLS_SVF1_RULE_CONFIDENCE:()=>Kl,DEFAULT_MAX_ENVIRONMENTS:()=>ua,DISJOINT_PREDICATE:()=>Ko,ENTAILED_DISJOINT_PROVENANCE:()=>Gl,ENTAILED_PROVENANCE:()=>jm,ENTAILED_SCM_SVF_PROVENANCE:()=>Jl,ENTAILED_SVF1_PROVENANCE:()=>Hl,ENTAILED_TYPE_PROVENANCE:()=>Rm,ON_PROPERTY_PREDICATE:()=>Cn,SCM_SVF_RULE:()=>Xl,SCM_SVF_RULE_CONFIDENCE:()=>Ql,SOME_VALUES_FROM_PREDICATE:()=>On,SUBCLASS_PREDICATE:()=>De,TYPE_PREDICATE:()=>Nt,buildCardinalityRestrictions:()=>fj,buildRelevanceFrontier:()=>Bl,buildSubClassSuccessors:()=>da,deriveDisjointViolations:()=>Cm,deriveSomeValuesFromApplication:()=>Om,deriveSomeValuesFromSubsumption:()=>Lm,deriveSubClassClosure:()=>Tm,deriveSubClassClosureDelta:()=>Am,deriveTypePropagation:()=>Im,entailedTrustFrom:()=>lj,findConsistencyViolations:()=>wj,findIsaChain:()=>Zl,proveCardinalityAtLeast:()=>mj,proveMaxCardinalityZeroDenial:()=>bj,retractSubClassOf:()=>Ej,syllogise:()=>yj});function Sm(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 lj(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 as(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=Q(s);o&&n.add(o)}return n.size?n:null}function Tm(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}${Le}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:as(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 g=r.get(m);if(g)for(let b of g){if(p===b)continue;let y=`${p}${Le}${b}`;o.has(y)||c.has(y)||a(p,m,b)&&d.push([p,m,b,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,g]of d)if(!c.has(g)){if(l.length>=n)break;c.add(g),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 Am(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}${Le}${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 g=`${h}${Le}${m}`;c.has(g)||(c.add(g),l.push([h,m]))}let u=o instanceof Set?o.size?o:null:as(o),d=(h,m,g)=>!u||u.has(h)||u.has(m)||u.has(g),f=[],p=new Set;for(let h=0;h<n&&l.length;h+=1){let m=[],g=(w,v,_)=>{if(w===_)return;let $=`${w}${Le}${_}`;r.has($)||p.has($)||d(w,v,_)&&m.push([w,v,_,$])};for(let[w,v]of l){for(let _ of i.get(v)||[])g(w,v,_);for(let _ of a.get(w)||[])g(_,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 b=!1,y=[];for(let[w,v,_,$]of m)if(!p.has($)){if(f.length>=s)break;p.add($),f.push({subject:w,object:_,via:v}),i.has(w)||i.set(w,new Set),i.get(w).add(_),a.has(_)||a.set(_,new Set),a.get(_).add(w),y.push([w,_]),b=!0}if(f.length>=s||!b)break;l=y}return f}function Ln(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 uj(e){return Ln((e||[]).map(([t,n])=>[n,t]))}function Bl(e,t){let n=[],s=[],o=new Map,r=new Map;for(let c of e||[])!c||!c.subject||!c.predicate||!c.object||(As(c.predicate)?n.push([c.subject,c.object]):ro(c.predicate)?s.push([c.subject,c.object]):Yo(c.predicate)?o.set(c.subject,c.object):qr(c.predicate)&&r.set(c.subject,c.object));let i=uj(n),a=new Set;for(let c of t||[]){let u=Q(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 Im(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=Ln(t),i=new Set,a=new Set;for(let[p,h]of o||[])p&&h&&i.add(`${p}${Le}${h}`);let l=s instanceof Set?s.size?s:null:as(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}${Le}${h}`;if(!a.has(m)){a.add(m);for(let g of r(h)){if(g===h||g===p)continue;let b=`${p}${Le}${g}`;i.has(b)||c(p,h,g)&&u.push([p,h,g,b])}}}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,g]of u)if(!f.has(g)){if(d.length>=n)break;f.add(g),d.push({subject:p,object:m,via:h})}return d}function Cm(e,t,n,{budget:s=50,focus:o=null}={}){let r=Ln(t),i=new Map,a=new Set;for(let[h,m]of n||[])!h||!m||h===m||(a.add(`${h}${Le}${m}`),a.add(`${m}${Le}${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:as(o),u=(h,m,g)=>!c||c.has(h)||c.has(m)||c.has(g),d=[];for(let[h,m]of e||[]){if(!h||!m)continue;let g=`${h}${Le}${m}`;if(!l.has(g)){l.add(g);for(let b of[m,...r(m)]){let y=i.get(b);if(y)for(let w of y){if(w===h)continue;let v=`${h}${Le}${w}`;a.has(v)||u(h,m,w)&&d.push([h,m,b,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,g,b,y]of d)if(!p.has(y)){if(f.length>=s)break;p.add(y),f.push({subject:h,object:b,viaType:m,viaClass:g})}return f}function Om(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=Ln(n),a=new Map;for(let g of s||[]){if(!g||!g.restriction||!g.property||!g.target)continue;let b=`${g.property}${Le}${g.target}`;a.has(b)||a.set(b,new Set),a.get(b).add(g.restriction)}if(!a.size)return[];let l=new Set,c=new Map;for(let[g,b]of t||[])!g||!b||(l.add(`${g}${Le}${b}`),c.has(g)||c.set(g,new Set),c.get(g).add(b));let u=r instanceof Set?r.size?r:null:as(r),d=(g,b,y)=>!u||u.has(g)||u.has(b)||u.has(y),f=new Set,p=[];for(let[g,b,y]of e||[]){if(!g||!b||!y)continue;let w=Q(b),v=`${g}${Le}${w}${Le}${y}`;if(f.has(v))continue;f.add(v);let _=c.get(y);if(_)for(let $ of _)for(let x of[$,...i($)]){let S=a.get(`${w}${Le}${x}`);if(S)for(let E of S){if(g===E)continue;let R=`${g}${Le}${E}`;l.has(R)||d(g,y,E)&&p.push([g,b,w,y,$,x,E,R])}}}p.sort((g,b)=>g[0].localeCompare(b[0])||g[6].localeCompare(b[6])||g[1].localeCompare(b[1])||g[3].localeCompare(b[3]));let h=[],m=new Set;for(let[g,b,y,w,v,_,$,x]of p)if(!m.has(x)){if(h.length>=o)break;m.add(x),h.push({subject:g,object:$,viaProperty:b,viaPropertyKey:y,viaValue:w,viaType:v,viaTarget:_})}return h}function fj(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Yo(r.predicate))t.set(r.subject,r.object);else if(cj(r.predicate))s.set(r.subject,r.object);else{let i=pj[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)!==dj)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 Lm(e,t,{budget:n=50,focus:s=null}={}){let o=Ln(t),r=new Map;for(let f of e||[]){if(!f||!f.restriction||!f.property||!f.target)continue;let p=Q(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}${Le}${p}`);let a=s instanceof Set?s.size?s:null:as(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}${Le}${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,g]of c)if(!d.has(g)){if(u.length>=n)break;d.add(g),u.push({subject:f,object:p,viaY1:h,viaY2:m})}return u}function Nm(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=Ln(e),a=r instanceof Set?r.size?r:null:as(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 mj(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Nm(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 bj(e,t,n,s,o={}){if(!s)return null;let r=Nm(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 wj(e,t,n,{budget:s=50,focus:o=null}={}){let r=Ln(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:as(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 g=0;g<m.length;g+=1)for(let b=g+1;b<m.length;b+=1){let[y,w]=[m[g],m[b]],v=[y,...r(y)],_=[w,...r(w)],$=null;for(let S of v){let E=i.get(S);if(E){for(let R of _)if(E.has(R)){$=[S,R];break}if($)break}}if(!$)continue;let x=`${p}${Le}${y}${Le}${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,g,b]of u){if(f.length>=s)break;f.push({subject:p,classA:h,classB:m,viaA:g,viaB:b})}return f}async function yj(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=ua,full:i=!1,store:a}={}){let{loadMemory:l,readFactRows:c,appendFacts:u}=Sm(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await l(e),p=c(f),h=p.filter(k=>As(k.predicate)).map(k=>[k.subject,k.object]),m=p.filter(k=>ro(k.predicate)).map(k=>[k.subject,k.object]),g=p.filter(k=>oo(k.predicate)).map(k=>[k.subject,k.object]),b=new Map,y=new Map,w=[];for(let k of p){let pe=String(k.predicate||"").trim().toLowerCase();Yo(k.predicate)?b.set(k.subject,k.object):qr(k.predicate)?y.set(k.subject,k.object):Yl.has(pe)||w.push([k.subject,k.predicate,k.object])}let v=[];for(let[k,pe]of b){let Re=y.get(k);Re&&v.push({restriction:k,property:pe,target:Re})}let _=as(s),$=o&&_?Bl(p,[..._]):_,x=$===null&&d?await a.loadSyllogiseState(e):null,S=new Set(p.map(k=>k.id)),E=Array.isArray(x?.factIds)?x.factIds.filter(k=>!S.has(k)):[],R=x&&Array.isArray(x.factIds)&&!E.length&&!i?"delta":"full",j=R==="delta"?new Set(x.factIds):null,A=R==="delta"?p.filter(k=>!j.has(k.id)):p,F=A.length,T=new Map;for(let k of p)T.set(`${k.subject}${Le}${k.predicate}${Le}${k.object}`,k.trust);let M=(k,pe,Re)=>T.get(`${k}${Le}${pe}${Le}${Re}`),z=(k,pe,Re)=>T.has(`${k}${Le}${pe}${Le}${Re}`),K=k=>k.filter(pe=>typeof pe=="number"),ce=R==="delta"&&!A.length,Z=R==="delta"?A.filter(k=>As(k.predicate)).map(k=>[k.subject,k.object]):[],D=R==="delta"?Z.length?Am(h,Z,{depth:t,budget:n,focus:$}):[]:Tm(h,{depth:t,budget:n,focus:$}),U=h.concat(D.map(k=>[k.subject,k.object])),G=$,I=null;if(R==="delta"&&!ce){let k=p.concat(D.map(Re=>({subject:Re.subject,predicate:De,object:Re.object}))),pe=[];for(let Re of A)pe.push(Re.subject,Re.object);I=Bl(k,pe),G=I}let L=k=>!I||I.has(k),C=I?m.filter(([k,pe])=>L(k)||L(pe)):m,P=new Set;if(I)for(let k of A)oo(k.predicate)&&(P.add(k.subject),P.add(k.object));let N=I&&P.size?Ln(U):null,B=I?m.filter(([k,pe])=>L(k)||L(pe)||N&&[...N(pe)].some(Re=>P.has(Re))):m,H=new Set;if(I){for(let k of A)if(Yo(k.predicate)||qr(k.predicate)){let pe=b.get(k.subject);pe&&H.add(Q(pe))}}let se=I?w.filter(([k,pe,Re])=>L(k)||L(Re)||H.has(Q(pe))):w,ae=Math.max(0,n-D.length),X=ae>0&&!ce?Im(C,U,{budget:ae,focus:G,presentTypeEdges:m}):[],ee=Math.max(0,n-D.length-X.length),V=ee>0&&!ce?Cm(B,U,g,{budget:ee,focus:G}):[],re=Math.max(0,n-D.length-X.length-V.length),oe=re>0&&v.length&&!ce?Om(se,m,U,v,{budget:re,focus:G}):[],ge=Math.max(0,n-D.length-X.length-V.length-oe.length),Te=ge>0&&v.length>1&&!ce?Lm(v,U,{budget:ge,focus:G}):[],ue=new Map(v.map(k=>[k.restriction,k])),Ae=[...D.map(k=>({subject:k.subject,predicate:De,object:k.object,provenance:jm,justification:[[me(k.subject,De,k.via),me(k.via,De,k.object)]]})),...X.map(k=>({subject:k.subject,predicate:Nt,object:k.object,provenance:Rm,justification:[[me(k.subject,Nt,k.via),me(k.via,De,k.object)]]})),...V.map(k=>{let pe=z(k.viaClass,Ko,k.object),[Re,cn]=pe?[k.viaClass,k.object]:[k.object,k.viaClass],Bn=K([M(k.subject,Nt,k.viaType),M(Re,Ko,cn),...k.viaClass!==k.viaType?[M(k.viaType,De,k.viaClass)]:[]]);return{subject:k.subject,predicate:Ko,object:k.object,provenance:Gl,justification:[[me(k.subject,Nt,k.viaType),me(Re,Ko,cn),...k.viaClass!==k.viaType?[me(k.viaType,De,k.viaClass)]:[]]],...Bn.length?{premiseTrusts:Bn,ruleConfidence:Vl}:{}}}),...oe.map(k=>{let pe=K([M(k.subject,k.viaProperty,k.viaValue),M(k.viaValue,Nt,k.viaType),M(k.object,Cn,k.viaPropertyKey),M(k.object,On,k.viaTarget),...k.viaType!==k.viaTarget?[M(k.viaType,De,k.viaTarget)]:[]]);return{subject:k.subject,predicate:Nt,object:k.object,provenance:Hl,justification:[[me(k.subject,k.viaProperty,k.viaValue),me(k.viaValue,Nt,k.viaType),me(k.object,Cn,k.viaPropertyKey),me(k.object,On,k.viaTarget),...k.viaType!==k.viaTarget?[me(k.viaType,De,k.viaTarget)]:[]]],...pe.length?{premiseTrusts:pe,ruleConfidence:Kl}:{}}}),...Te.map(k=>{let pe=ue.get(k.subject),Re=ue.get(k.object),cn=K([pe&&M(k.subject,Cn,pe.property),M(k.subject,On,k.viaY1),Re&&M(k.object,Cn,Re.property),M(k.object,On,k.viaY2),M(k.viaY1,De,k.viaY2)]);return{subject:k.subject,predicate:De,object:k.object,provenance:Jl,justification:[[...pe?[me(k.subject,Cn,pe.property)]:[],me(k.subject,On,k.viaY1),...Re?[me(k.object,Cn,Re.property)]:[],me(k.object,On,k.viaY2),me(k.viaY1,De,k.viaY2)]],...cn.length?{premiseTrusts:cn,ruleConfidence:Ql}:{}}})],Ie=Ae.map(k=>({id:me(k.subject,k.predicate,k.object),subject:k.subject,predicate:k.predicate,object:k.object,environments:k.justification,write:k})),ne=Mm(p.concat(Ie.map(k=>({id:k.id,subject:k.subject,predicate:k.predicate,object:k.object})))),ke=new Map(p.map(k=>[k.id,k])),le=k=>As(k)||ro(k)||oo(k),q=k=>R!=="delta"||I!==null&&(I.has(k.subject)||I.has(k.object)),te=p.filter(k=>le(k.predicate)&&Pm(k.provenance)&&Vr(k).length<r&&q(k)).map(k=>({id:k.id,subject:k.subject,predicate:k.predicate,object:k.object,environments:Vr(k),provenance:k.provenance})),qe=[...Ie,...te].sort((k,pe)=>k.subject.localeCompare(pe.subject)||k.predicate.localeCompare(pe.predicate)||k.object.localeCompare(pe.object)),Fe=0,et=!1,rn=0;for(let k of qe){if(rn>=n){et=!0;break}rn+=1;let pe=ne(k,{maxEnvironments:r+1}),{kept:Re,truncated:cn}=vj(k.environments,pe,r);if(cn&&(et=!0),!(Re.length<=k.environments.length)){if(Fe+=Re.length-k.environments.length,k.write){k.write.justification=Re;continue}Ae.push({subject:k.subject,predicate:k.predicate,object:k.object,justification:Re,...Fm(k.provenance,Re,Bn=>ke.get(Bn)?.trust)||{}})}}let{ids:Yt}=await u(e,Ae),Xt=[],an=0;for(let k of D)Xt.push({id:Yt[an],subject:k.subject,object:k.object,via:k.via,rule:km}),an+=1;for(let k of X)Xt.push({id:Yt[an],subject:k.subject,object:k.object,via:k.via,rule:_m}),an+=1;for(let k of V)Xt.push({id:Yt[an],subject:k.subject,object:k.object,via:k.viaClass,rule:Wl}),an+=1;for(let k of oe)Xt.push({id:Yt[an],subject:k.subject,object:k.object,via:k.viaValue,rule:ql}),an+=1;for(let k of Te)Xt.push({id:Yt[an],subject:k.subject,object:k.object,via:k.viaY1,rule:Xl}),an+=1;let $i=Xt.length>=n;if($===null&&d&&!$i){let k=new Set(S);for(let pe of Yt)k.add(pe);await a.saveSyllogiseState(e,{version:1,factIds:[...k].sort(),completedAt:new Date().toISOString()})}return{derived:Xt,count:Xt.length,budget:n,depth:t,truncated:$i,mode:R,deltaSize:F,environmentsAdded:Fe,alternatesTruncated:et}}function Pm(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function $j(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();As(u.predicate)?t.push([u.subject,u.object]):ro(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):oo(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)):Yo(u.predicate)?o.set(u.subject,u.object):qr(u.predicate)?r.set(u.subject,u.object):Yl.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([Q(u.predicate),u.object]))}let a=Ln(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:Q(d),target:f}:null};return u=>{if(As(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(ro(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(oo(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 Mm(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();As(p.predicate)?(n.push([p.subject,p.object]),s.has(p.subject)||s.set(p.subject,new Set),s.get(p.subject).add(p.object)):ro(p.predicate)?(o.has(p.subject)||o.set(p.subject,new Set),o.get(p.subject).add(p.object)):oo(p.predicate)?(r.add(`${p.subject}${Le}${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)):Yo(p.predicate)?a.set(p.subject,p.object):qr(p.predicate)?l.set(p.subject,p.object):Yl.has(h)||(c.has(p.subject)||c.set(p.subject,[]),c.get(p.subject).push([p.predicate,p.object]))}let u=Ln(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:Q(h),target:m}:null};return(p,{maxEnvironments:h=ua}={})=>{let m=[],g=new Set,b=y=>{if(m.length>=h||p.id&&y.includes(p.id)||!y.every(v=>t.has(v)))return;let w=[...y].sort().join(" ");g.has(w)||(g.add(w),m.push(y))};if(As(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)&&b([me(p.subject,De,y),me(y,De,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)&&b([me(p.subject,Cn,y.property),me(p.subject,On,y.target),me(p.object,Cn,w.property),me(p.object,On,w.target),me(y.target,De,w.target)])}return m}if(ro(p.predicate)){for(let w of[...o.get(p.subject)||[]].sort()){if(m.length>=h)break;w!==p.object&&d(w).has(p.object)&&b([me(p.subject,Nt,w),me(w,De,p.object)])}let y=f(p.object);if(y){let w=[...c.get(p.subject)||[]].filter(([v])=>Q(v)===y.propertyKey).sort((v,_)=>v[0].localeCompare(_[0])||v[1].localeCompare(_[1]));for(let[v,_]of w){if(m.length>=h)break;for(let $ of[...o.get(_)||[]].sort()){if(m.length>=h)break;$!==y.target&&!d($).has(y.target)||b([me(p.subject,v,_),me(_,Nt,$),me(p.object,Cn,y.propertyKey),me(p.object,On,y.target),...$!==y.target?[me($,De,y.target)]:[]])}}}return m}if(oo(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 _=r.has(`${v}${Le}${p.object}`),[$,x]=_?[v,p.object]:[p.object,v];b([me(p.subject,Nt,w),me($,Ko,x),...v!==w?[me(w,De,v)]:[]])}return m}return m}}function vj(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 Fm(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=xj.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 Ej(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=ua,store:i,sourceTags:a=[]}={}){let{loadMemory:l,readFactRows:c,removeFacts:u}=Sm(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),d=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,p=(a||[]).filter(Boolean);if(p.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=Q(t),m=Q(n),g=me(h,De,m),b=await l(e),y=c(b),w=new Map(y.map(M=>[M.id,M]));if(!w.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let v=w.get(g).sourceIds||[],_=p.map(M=>f(g,M).slice(g.length+1)),$=p.length?v.filter(M=>_.includes(M)):[],x=!p.length||$.length>0;if(p.length&&!x)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let S=p.length>0&&$.length<v.length,E=new Set([g]),R=[g],j=new Map,A=!1;if(!S){let M=y.filter(Z=>Vr(Z).length&&Pm(Z.provenance)),z=new Map;for(let Z of M)for(let D of Vr(Z))for(let U of D)z.has(U)||z.set(U,new Set),z.get(U).add(Z.id);let K=0,ce=[g];for(;K<o;K+=1){let Z=new Set;for(let N of ce)for(let B of z.get(N)||[])E.has(B)||Z.add(B);let D=[...Z].map(N=>w.get(N)).sort((N,B)=>N.subject.localeCompare(B.subject)||N.predicate.localeCompare(B.predicate)||N.object.localeCompare(B.object));if(!D.length)break;let U=y.filter(N=>!E.has(N.id)&&!Z.has(N.id)),G=new Set(U.map(N=>N.id)),I=Mm(U),L=$j(U),C=!1,P=!1;ce=[];for(let N of D){if(E.size>=s){P=!0;break}let B=Vr(N),H=B.filter(ae=>ae.every(X=>G.has(X)));if(H.length){H.length!==B.length&&j.set(N.id,H);continue}let se=I(N,{maxEnvironments:r});if(se.length){j.set(N.id,se);continue}L(N)||(E.add(N.id),R.push(N.id),ce.push(N.id),C=!0)}if(P){A=!0;break}if(!C)break}!A&&K>=o&&(A=M.some(Z=>!E.has(Z.id)&&Z.justification.some(D=>E.has(D))))}let F=p.length?[...$.map(M=>`${g}@${M}`),...R.slice(1)]:R,{removed:T}=await u(e,F);if(d){let M=[...j.entries()].filter(([z])=>!E.has(z)).sort((z,K)=>z[0].localeCompare(K[0])).map(([z,K])=>{let ce=w.get(z);return{subject:ce.subject,predicate:ce.predicate,object:ce.object,justification:K,...Fm(ce.provenance,K,Z=>w.get(Z)?.trust)||{}}});M.length&&await d(e,M)}return{retracted:T,count:T.length,budget:s,depth:o,truncated:A,found:!0,...p.length?{ownRecord:!0,stillStands:S}:{}}}function da(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 Zl(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:da(s),a=[];for(let[c,u]of n||[])c===e&&u&&a.push({node:u,path:[{subject:c,predicate:Nt,object:u}]});for(let c of i.get(e)||[])a.push({node:c,path:[{subject:e,predicate:De,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:De,object:p}]})}a=u}return null}var De,km,jm,Nt,_m,Rm,Ko,Wl,Gl,Vl,Cn,On,ql,Hl,Kl,ua,Le,As,ro,oo,Yo,qr,cj,Yl,dj,pj,Xl,Jl,Ql,hj,gj,Vr,xj,qt=O(()=>{sn();De="rdfs:subClassOf",km="subClassOf",jm=`entailed:${km}`,Nt="rdf:type",_m="type",Rm=`entailed:${_m}`,Ko="owl:disjointWith",Wl="disjointWith",Gl=`entailed:${Wl}`,Vl=.95,Cn="owl:onProperty",On="owl:someValuesFrom",ql="someValuesFrom",Hl=`entailed:${ql}`,Kl=.95,ua=4,Le="\u241F",As=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",ro=e=>String(e||"").trim().toLowerCase()==="rdf:type",oo=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Yo=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",qr=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",cj=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Yl=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);dj="has",pj={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Xl="someValuesFromSubsumption",Jl=`entailed:${Xl}`,Ql=.95;hj=.95;gj=.95;Vr=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);xj=new Map([[Gl,Vl],[Hl,Kl],[Jl,Ql]])});function Zo(e){let t=String(e||""),n=Dm.get(t);return n||(t.startsWith(eu)?Xo+t.slice(eu.length):t)}function zm(e){let t=String(e||""),n=Sj.get(t);return n||(t.startsWith(Xo)?eu+t.slice(Xo.length):null)}function Wm(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Zl(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function ha(e,t,n,{maxHops:s=3}={}){let o=Qo(e),r=Qo(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:l}=Bm(i),c=i.filter(b=>(b.predicate===fa||b.predicate===Jo)&&r.has(b.object)),u=[];for(let b of c){let y=b.predicate===Jo?"negative":"positive";if(o.has(b.subject)){u.push({fact:b,polarity:y,hops:0,chain:null});continue}let w=Wm(o,b.subject,a,l,s);w&&w.length&&u.push({fact:b,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:nu(o,r,i,{maxHops:s})};u.sort((b,y)=>b.hops-y.hops||(y.fact.trust||0)-(b.fact.trust||0));let d=u[0].hops,f=u.filter(b=>b.hops===d),p=f.filter(b=>b.polarity==="positive").map(b=>b.fact),h=f.filter(b=>b.polarity==="negative").map(b=>b.fact),m=h.length&&!p.length?"negative":"positive",g=u.find(b=>b.hops>d&&b.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:g?{fact:g.fact,chain:g.chain}:null,baseRate:null}}function nu(e,t,n,{maxHops:s=3}={}){let o=Qo(e),r=Qo(t),i=Array.isArray(n)?n:[],a=i.filter(m=>m.predicate===De||m.predicate===Nt),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 g=i.find(b=>b.subject===m&&r.has(b.object)&&(b.predicate===fa||b.predicate===Jo));return g?{name:m,polarity:g.predicate===Jo?"negative":"positive",fact:g}:{name:m,polarity:"unknown",fact:null}},f=u.map(d),{typeEdges:p,subClassSucc:h}=Bm(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:Wm(o,c,p,h,s)}}function su(e,t,{exclude:n=[],maxHops:s=3}={}){let o=Qo(e),r=Qo(n),i=Array.isArray(t)?t:[],a=new Set,l=[];for(let c of i)c.predicate!==fa||!o.has(c.object)||r.has(c.subject)||a.has(c.subject)||(a.add(c.subject),ha(new Set([c.subject]),o,i,{maxHops:s}).verdict==="yes"&&l.push(c));return l.sort(kj)}var Xo,eu,pa,Dm,Sj,Um,fa,Jo,tu,kj,Qo,Bm,ma=O(()=>{qt();Xo="mgxneg:",eu="mgx:",pa="mgxneg:subClassOf",Dm=new Map([[De,pa]]),Sj=new Map([...Dm].map(([e,t])=>[t,e]));Um=e=>String(e||"").startsWith(Xo),fa="mgx:capableOf",Jo=Zo(fa),tu=6,kj=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),Qo=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),Bm=e=>{let t=e.filter(s=>s.predicate===Nt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===De).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:da(n)}}});function ga(e){let t=String(e||"");return iu.has(t)?ou:_j.has(t)||Rj.test(t)?Hr:Tj.has(t)?Gm:ru}function Aj(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(qp.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function Ij(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(Aj(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function au(e,t){let n=t===Gm;if(!n&&t!==Hr)return null;let s=(e||[]).map(r=>({row:r,at:Ij(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,Hr,Gm,ru,jj,iu,_j,Rj,Tj,Vm=O(()=>{ma();Kn();ou="merge",Hr="latest-observation-wins",Gm="first-claim-wins",ru="contradiction",jj=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","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"],iu=new Set(jj.flatMap(e=>[e,Zo(e)])),_j=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"]),Rj=/^mgx:has-exit-([a-z]+)$/,Tj=new Set(["mgx:playedBy"])});function Xr(e){let t=String(e||""),n=t.indexOf(ba);return n<0?"":t.slice(n+ba.length)}function Pj(e){let t=1,n=0;for(let s of e)t*=1-Lj(s),n+=1;return n?Nj(Math.min(1,1-t)):0}function Xm(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 Zm(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 eg(e,t="",n=""){let s=t,o=n;for(let r of e)s=Jm(s,r.assertedAt),o=Qm(o,r.assertedAt);return{earliest:s,latest:o}}function du({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?Pj(l.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:Cj,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===er?"rollupSourceIds":"rollupRecordIds",value:l.join(" ")},{prop:Yr,key:"rollupCount",value:String(l.length)},{prop:Nn,key:"rollupEarliest",value:r},{prop:Pn,key:"rollupLatest",value:i},...c===void 0?[]:[{prop:tr,key:"rollupPrior",value:String(c)}]]}}function tg({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(Zm).slice(8);if(!i.length)return null;let{earliest:a,latest:l}=eg(i,Et(s,Nn),Et(s,Pn));return{rollup:du({id:cu(e,t),sourceKey:`rollup:${t}`,template:pu(i[0].record||s),idsProp:er,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 ng({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(Zm),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:l}=eg(i,Et(s,Nn),Et(s,Pn));return{rollup:du({id:lu(e,t),sourceKey:t,template:pu(i[0].record||s),idsProp:Kr,ids:[...Oj(s),...i.map(u=>u.id)],earliest:a,latest:l}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function fu(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Is(s),r=o?er:Kr,i=a=>uu(Et(a,r));return du({id:s,sourceKey:Et(e,"mgx:sourceId")||Et(t,"mgx:sourceId"),template:pu(Et(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:Jm(Et(e,Nn),Et(t,Nn)),latest:Qm(Et(e,Pn),Et(t,Pn)),priorFor:o?n:void 0})}function sg(e,t){if(!t)return!1;for(let n of e||[])if($a(n).includes(t))return!0;return!1}var Cj,qm,Hm,wa,Km,er,Kr,Yr,Nn,Pn,tr,ba,Ym,cu,lu,Is,nr,ya,Et,uu,$a,Oj,Lj,Nj,Jm,Qm,pu,hu=O(()=>{Cj="Fact",qm=64,Hm=8,wa=8,Km=2,er="mgx:rollupSourceIds",Kr="mgx:rollupRecordIds",Yr="mgx:rollupCount",Nn="mgx:rollupEarliest",Pn="mgx:rollupLatest",tr="mgx:rollupPrior",ba="@rollup:",Ym="#rollup",cu=(e,t)=>`${e}${ba}${t}`,lu=(e,t)=>`${e}@${t}${Ym}`,Is=e=>String(e||"").includes(ba),nr=e=>String(e||"").endsWith(Ym),ya=e=>Is(e)||nr(e);Et=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",uu=e=>String(e||"").split(" ").filter(Boolean),$a=e=>uu(Et(e,er)),Oj=e=>uu(Et(e,Kr)),Lj=e=>Math.max(0,Math.min(1,Number(e)||0)),Nj=e=>Number(e.toFixed(6));Jm=(e,t)=>Xm(e,t,Math.min),Qm=(e,t)=>Xm(e,t,Math.max);pu=e=>({label:e?.label||"",subject:Et(e,"rdf:subject"),predicate:Et(e,"rdf:predicate"),object:Et(e,"rdf:object")})});function wu(e){let t=String(e||"");return bu(t)?t.slice(0,-Sa.length):""}function og(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 yu({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:on,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:xa,key:"retractedRecordIds",value:i.join(" ")},{prop:mu,key:"retractedCount",value:String(i.length)},{prop:Ea,key:"retractedAt",value:o||""},...a.length?[{prop:Jr,key:"provenance",value:a.join(" | ")}]:[]]}}function ig({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...io(o),...n].filter(Boolean);return a.length?yu({id:gu(e,t),sourceId:t,template:r||rg(o),ids:a,retractedAt:og(ao(o),s),tags:[...Qr(pn(o,Jr)),...Qr(i)]}):null}function ag(e,t){let n=rg(pn(e,"rdf:subject")?e:t);return yu({id:e?.id||t?.id,sourceId:pn(e,"mgx:sourceId")||pn(t,"mgx:sourceId"),template:n,ids:[...io(e),...io(t)],retractedAt:og(ao(e),ao(t)),tags:[...Qr(pn(e,Jr)),...Qr(pn(t,Jr))]})}function Fj(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function Dj(e,t,n=""){return!e||!t||!io(e).includes(t)?!1:Fj(n,ao(e))}function ka(e,t,n=""){for(let s of e||[])if(Dj(s,t,n))return!0;return!1}function zj(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function Uj(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 ja(e){let t=wu(e?.id);return t?{id:e.id,subject:t,predicate:va,object:zj(ao(e),io(e)),provenance:pn(e,Jr)}:null}function _a(e){if(!e||e.predicate!==va)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=Uj(e.object);return o.length?yu({id:`${t}${Sa}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:Qr(e.provenance)}):null}var on,va,xa,Ea,mu,Sa,Jr,gu,bu,pn,Mj,Qr,io,ao,rg,$u=O(()=>{on="Retraction",va="mgx:retracted",xa="mgx:retractedRecordIds",Ea="mgx:retractedAt",mu="mgx:retractedCount",Sa="#retracted",Jr="mgx:factProvenance",gu=(e,t)=>`${e}@${t}${Sa}`,bu=e=>String(e||"").endsWith(Sa);pn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Mj=e=>String(e||"").split(" ").filter(Boolean),Qr=e=>String(e||"").split(" | ").filter(Boolean),io=e=>Mj(pn(e,xa)),ao=e=>pn(e,Ea);rg=e=>({label:e?.label||"",subject:pn(e,"rdf:subject"),predicate:pn(e,"rdf:predicate"),object:pn(e,"rdf:object")})});var Bj,Wj,Gj,Vj,vu,b0,cg=O(()=>{Kn();Bj="mgx:worldName",Wj="mgx:nodeName",Gj="mgx:playedBy",Vj="mgx:waved",vu="mgx:invitedBy",b0=Object.freeze([Bj,Wj,Gj,Vj,vu])});function Ra(e){let t=new Set;for(let n of e||[])n?.predicate===vu&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function xu(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Ta({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=xu(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 Eu=O(()=>{cg()});function cs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function Jj(e,t){(!e?.class||!qj.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function Qj(e,t){for(let i of["rdf:subject","rdf:predicate","rdf:object"])Zr(cs(e,i))||t.push(`a Fact needs a non-empty ${i}`);for(let i of["rdf:subject","rdf:object"]){let a=cs(e,i);a!==void 0&&Kj.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=cs(e,"mgx:factProvenance");n!==void 0&&!Zr(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";Yj(s)&&!ug.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=cs(e,"mgx:sourceId");o!==void 0&&!Zr(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=cs(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 Xj){let a=cs(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)ug.test(c)||t.push(`${i} must name Fact record ids (got ${JSON.stringify(c)})`)}}function Zj(e,t){Zr(cs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=cs(e,"mgx:ruleKind");if(!n||!lg.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...lg].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of Hj[n])Zr(cs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function e_(e){let t=[];return Jj(e,t),e?.class==="Fact"&&Qj(e,t),e?.class==="Rule"&&Zj(e,t),{ok:t.length===0,violations:t}}function Su(e){let t=e_(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 qj,lg,Hj,Kj,ug,Yj,Xj,Zr,dg=O(()=>{qj=new Set(["Utterance","Fact","Session","Source","Rule"]),lg=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),Hj={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"]},Kj=/[.!?]\s+\w/,ug=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,Yj=e=>e.includes("@")||/#v\d/.test(e),Xj=["mgx:supersedes","mgx:supersededBy"];Zr=e=>typeof e=="string"&&e.trim().length>0});var pg={};Wn(pg,{access:()=>s_,appendFile:()=>i_,basename:()=>x_,copyFile:()=>f_,createInterface:()=>__,createReadStream:()=>m_,createRequire:()=>t_,createWriteStream:()=>g_,default:()=>T_,dirname:()=>y_,existsSync:()=>b_,fileURLToPath:()=>S_,isAbsolute:()=>v_,join:()=>w_,mkdir:()=>a_,mkdtemp:()=>c_,randomBytes:()=>k_,readFile:()=>o_,readFileSync:()=>n_,readdir:()=>h_,rename:()=>l_,resolve:()=>$_,rm:()=>d_,sep:()=>E_,spawnSync:()=>j_,stat:()=>p_,tmpdir:()=>R_,unlink:()=>u_,writeFile:()=>r_});var dt,t_,n_,s_,o_,r_,i_,a_,c_,l_,u_,d_,p_,f_,h_,m_,g_,b_,w_,y_,$_,v_,x_,E_,S_,k_,j_,__,R_,T_,fg=O(()=>{dt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},t_=dt("createRequire"),n_=dt("readFileSync"),s_=dt("access"),o_=dt("readFile"),r_=dt("writeFile"),i_=dt("appendFile"),a_=dt("mkdir"),c_=dt("mkdtemp"),l_=dt("rename"),u_=dt("unlink"),d_=dt("rm"),p_=dt("stat"),f_=dt("copyFile"),h_=dt("readdir"),m_=dt("createReadStream"),g_=dt("createWriteStream"),b_=()=>!1,w_=(...e)=>e.join("/"),y_=e=>String(e).replace(/\/[^/]*$/,""),$_=(...e)=>e.join("/"),v_=e=>String(e).startsWith("/"),x_=e=>String(e).split("/").pop(),E_="/",S_=e=>String(e),k_=dt("randomBytes"),j_=dt("spawnSync"),__=dt("createInterface"),R_=()=>"/tmp",T_={}});var A_,ei,ku=O(()=>{A_=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,ei=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(A_);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 I_(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function C_(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 he,ao=O(()=>{he=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=y_(n.toml,n.ptr),r=$_(n.toml,s,o);super(`Invalid TOML document: ${t}
87
+ `))}return o}var he,co=O(()=>{he=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=I_(n.toml,n.ptr),r=C_(n.toml,s,o);super(`Invalid TOML document: ${t}
88
88
 
89
- ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function _a(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 Aa(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
- `))l=l&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new he("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),m=p>=48&&p<=57?p-48:p>=65&&p<=70?p-65+10:p>=97&&p<=102?p-97+10:-1;if(m<0)throw new he("invalid non-hex character in unicode escape",{toml:e,ptr:c+1});u=u<<4|m}if(u<0||u>1114111||u>=55296&&u<=57343)throw new he("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 he("unrecognized escape sequence",{toml:e,ptr:c});a=c+1,l=0}else if(n!==" "&&n!==" "){if(l===2)throw new he("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});l=!o&&n==="\\"?1:0,a=c}}throw new he("unfinished string",{toml:e,ptr:t})}function lg(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=v_.test(e);if(o||x_.test(e)){if(E_.test(e))throw new he("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new he("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new he("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new ei(e);if(!r.isValid())throw new he("invalid value",{toml:t,ptr:n});return r}var v_,x_,E_,xu=O(()=>{vu();ao();v_=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,x_=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,E_=/^[+-]?0[0-9_]/});function Ra(e,t=0,n=e.length){let s=e.indexOf(`
93
+ `))l=l&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new he("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 he("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 he("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 he("unrecognized escape sequence",{toml:e,ptr:c});a=c+1,l=0}else if(n!==" "&&n!==" "){if(l===2)throw new he("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});l=!o&&n==="\\"?1:0,a=c}}throw new he("unfinished string",{toml:e,ptr:t})}function hg(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=O_.test(e);if(o||L_.test(e)){if(N_.test(e))throw new he("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new he("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new he("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new ei(e);if(!r.isValid())throw new he("invalid value",{toml:t,ptr:n});return r}var O_,L_,N_,ju=O(()=>{ku();co();O_=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,L_=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,N_=/^[+-]?0[0-9_]/});function Ia(e,t=0,n=e.length){let s=e.indexOf(`
95
95
  `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function sr(e,t){for(let n=t;n<e.length;n++){let s=e[n];if(s===`
96
96
  `)return n;if(s==="\r"&&e[n+1]===`
97
- `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new he("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function Pn(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
97
+ `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new he("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function Mn(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=sr(e,t)}return t}function ug(e,t,n,s,o=!1){if(!s)return t=Ra(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=Ra(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
99
+ `);)t++;if(s||o!=="#")break;t=sr(e,t)}return t}function mg(e,t,n,s,o=!1){if(!s)return t=Ia(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=Ia(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 he("cannot find end of structure",{toml:e,ptr:t})}var Ta=O(()=>{ao();});function S_(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(sr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ti(e,t,n,s,o){if(s===0)throw new he("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[l,c]=r==="["?pg(e,t,s,o):dg(e,t,s,o);if(n){if(c=Pn(e,c),e[c]===",")c++;else if(e[c]!==n)throw new he("expected comma or end of structure",{toml:e,ptr:c})}return[l,c]}if(r==='"'||r==="'"){let[l,c]=_a(e,t);if(n){if(c=Pn(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
102
- `&&e[c]!=="\r")throw new he("unexpected character encountered",{toml:e,ptr:c});e[c]===","&&c++}return[l,c]}let i=ug(e,t,",",n),a=S_(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new he("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=Pn(e,t+a[1]),e[i]===","&&i++),[lg(a[0],e,t,o),i]}var Eu=O(()=>{xu();Su();Ta();ao();});function Aa(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new he("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 he("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,l]=_a(e,t);s=e.indexOf(".",l);let c=e.slice(l,s<0||s>r?r:s),u=Ra(c);if(u>-1)throw new he("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(c.trimStart())throw new he("found extra tokens after the string part",{toml:e,ptr:l});if(r<l&&(r=e.indexOf(n,l),r<0))throw new he("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(!k_.test(a))throw new he("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,Pn(e,r+1,!0,!0)]}function dg(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new he("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=sr(e,t);else if(i!==" "&&i!==" "&&i!==`
103
- `&&i!=="\r"){let a,l=o,c=!1,[u,d]=Aa(e,t-1);for(let m=0;m<u.length;m++){if(m&&(l=c?l[a]:l[a]={}),a=u[m],(c=Object.hasOwn(l,a))&&(typeof l[a]!="object"||r.has(l[a])))throw new he("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 he("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=ti(e,d,"}",n-1,s);r.add(f),l[a]=f,t=p}}if(!i)throw new he("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function pg(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new he("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=sr(e,t);else if(r!==" "&&r!==" "&&r!==`
104
- `&&r!=="\r"){let i=ti(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new he("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var k_,Su=O(()=>{xu();Eu();Ta();ao();k_=/^[a-zA-Z0-9-_]+[ \t]*$/});function fg(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 or(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=Pn(e,0);a<e.length;){if(e[a]==="["){let l=e[++a]==="[",c=Aa(e,a+=+l,"]");if(l){if(e[c[1]-1]!=="]")throw new he("expected end of table declaration",{toml:e,ptr:c[1]-1});c[1]++}let u=fg(c[0],s,o,l?2:1);if(!u)throw new he("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=Aa(e,a),c=fg(l[0],r,i,0);if(!c)throw new he("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ti(e,l[1],void 0,t,n);c[1][c[0]]=u[0],a=u[1]}if(a=Pn(e,a,!0),e[a]&&e[a]!==`
105
- `&&e[a]!=="\r")throw new he("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=Pn(e,a)}return s}var mg=O(()=>{Su();Eu();Ta();ao();});var hg=O(()=>{});var Ia=O(()=>{mg();hg();vu();ao();});var wg={};Bn(wg,{CONFIG_FILE:()=>Oa,loadTomlConfig:()=>ku,mergeEffective:()=>bg,normalizeConfig:()=>gg});async function ku(e,{file:t}={}){let n=t||Q(e,Oa),s;try{s=await ze(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return or(s)}catch(o){throw new Error(`Invalid ${Oa} at ${n}: ${o&&o.message?o.message:o}`)}}async function j_(e,t){let n;if(Array.isArray(e))n=e;else{let o=Qt(t,String(e));n=(await ze(o,"utf8")).split(`
106
- `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Qt(t,r))}return s}async function gg(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await j_(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Qt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Qt(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=>Qt(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||{},m={};p.strategy!==void 0&&(m.strategy=p.strategy),p.nodes!==void 0&&(m.nodes=p.nodes),p.q!==void 0&&(m.q=p.q),p.depth!==void 0&&(m.depth=p.depth),Object.keys(m).length&&(f.expansion=m),Object.keys(f).length&&(o.tune=f);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let g=n.memory||{},b={};g.retention_versions!==void 0&&(b.retentionVersions=g.retention_versions),g.backend!==void 0&&(b.backend=g.backend),Object.keys(b).length&&(o.memory=b);let y=[];for(let[w,v]of __)n[w]&&n[w][v]!==void 0&&y.push(`${w}.${v}`);return o.unwired=y,o}function Ca(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:Ca(o,r,n)}return n}function bg({args:e={},toml:t=null,defaults:n={}}={}){let s=Ca(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Ca(o):{},i=Ca(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 Oa,__,La=O(()=>{_t();Ue();Ia();Oa="tmct.toml";__=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Os={};Bn(Os,{CANONICALISED_FROM_PROP:()=>Du,CAPABLE_OF_PREDICATE:()=>MR,CHAIN_KEEP_DEPTH:()=>Wh,CHAIN_ROLLUP_THRESHOLD:()=>ha,CREATED_AT_PROP:()=>Je,DEFAULT_RETENTION:()=>Iu,FACT_CLASS:()=>St,GROUP_ROLLUP_THRESHOLD:()=>Uh,HAS_A_PREDICATE:()=>dr,IN_REPLY_TO_PROP:()=>Fu,MEMORY_DIR_REL:()=>ir,MEMORY_GRAPH_REL:()=>Lu,MEMORY_MANIFEST_REL:()=>Dg,MEMORY_SESSION_CLASS:()=>Pu,MULTI_VALUED_PREDICATES:()=>FR,NODE_ID_REL:()=>Wu,OPERATOR_SOURCE_ID:()=>Na,RETRACTED_AT_PROP:()=>$a,RETRACTED_COUNT_PROP:()=>du,RETRACTED_RECORD_IDS_PROP:()=>ya,RETRACTION_CLASS:()=>sn,RETRACTION_PREDICATE:()=>wa,ROLLUP_COUNT_PROP:()=>Yr,ROLLUP_EARLIEST_PROP:()=>Ln,ROLLUP_KEEP_PER_TYPE:()=>Bh,ROLLUP_LATEST_PROP:()=>Nn,ROLLUP_PRIOR_PROP:()=>tr,ROLLUP_RECORD_IDS_PROP:()=>Kr,ROLLUP_SOURCE_IDS_PROP:()=>er,RULE_CLASS:()=>cr,RULE_KIND_ACTION_CONSTRAINT:()=>Xu,RULE_KIND_ACTION_EFFECT:()=>li,RULE_KIND_ACTION_PRECOND:()=>Ba,RULE_KIND_ACTION_SIGNATURE:()=>Yu,RULE_KIND_COMPOSE2:()=>ai,RULE_KIND_FILTER:()=>ci,RULE_KIND_PROP:()=>ur,RULE_KIND_RECURSIVE:()=>Ku,SAID_IN_SESSION_PROP:()=>Mu,SOURCE_CLASS:()=>ar,SOURCE_RELIABILITY_PROP:()=>xg,STATED_BY_PROP:()=>pn,SYLLOGISE_STATE_REL:()=>Bu,UPDATED_AT_PROP:()=>ys,UTTERANCE_CLASS:()=>Nu,admittedNodes:()=>ka,appendCanonicalisedFromEdges:()=>$R,appendFact:()=>SR,appendFacts:()=>uo,appendRetractions:()=>OR,appendRule:()=>Ga,appendUtterance:()=>yR,appendUtterances:()=>Vg,applySeedPayload:()=>I_,attachFactHeads:()=>Ig,chainRollupIdFor:()=>ru,cloneMemoryPayload:()=>C_,closeSqliteMemoryStore:()=>Ng,createInMemoryStore:()=>Fa,createSqliteMemoryStore:()=>Lg,emptyMemory:()=>ri,factGroupId:()=>Nt,factHeadsOf:()=>Cg,factIdForTriple:()=>ge,factRecordIdForTag:()=>L_,factRecordIdsFor:()=>lo,findContradictions:()=>eb,findRuleByName:()=>Ju,findRulesByName:()=>TR,headRollupIdFor:()=>ou,isChainRollupId:()=>nr,isHeadRollupId:()=>Ts,isMemoryOrSqliteHandle:()=>Uu,isRetractionId:()=>fu,isRollupId:()=>ga,loadMemory:()=>Pt,loadNodeId:()=>aR,loadSyllogiseState:()=>rR,normFactPredicate:()=>rs,normFactTerm:()=>J,openConfiguredMemoryBackend:()=>Cs,openMemoryBackend:()=>Pg,peersToConvince:()=>wu,provSourceClassFor:()=>uR,provenanceTagToSource:()=>Vn,readFactRows:()=>vt,readObjectSupersessions:()=>B_,readRetractions:()=>CR,readRuleRows:()=>Qu,removeFacts:()=>IR,resolveMemoryGraphFile:()=>ni,resolveRelationChase:()=>Zu,resolveRelationChaseReverse:()=>Zg,retirableRetractions:()=>LR,retireRetractions:()=>NR,retractedAtOf:()=>io,retractedRecordIds:()=>ro,retractionFromWire:()=>Sa,retractionIdFor:()=>pu,retractionScopeOf:()=>mu,retractionWireFact:()=>Ea,saveNodeId:()=>cR,saveSyllogiseState:()=>iR,snapshotMemory:()=>eR,stableRecordIds:()=>ja});function ri(){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:A_.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function ni(e,t=null){if(Is(e)||Fn(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?Q(e,Lu):Q(e,ir,`graph.v${t}.json`)}function Is(e){return!!e&&typeof e=="object"&&e.backend===zu}function Fn(e){return!!e&&typeof e=="object"&&e.backend===Sg}function Uu(e){return Is(e)||Fn(e)}function Fa(){return{backend:zu,payload:ri()}}function I_(e,t){t&&(e.payload={...e.payload,...t})}function C_(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function kg(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=qu(Vn(t));if(n)return n}return{id:cs,type:""}}function Nt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function L_(e,t){return`${e}@${jg(t).id}`}function jg(e){return qu(Vn(e))||{id:cs,type:""}}function _g(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=jg(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(cs,{sourceId:cs,sourceType:"",tags:[]}),[...t.values()]}function Tu(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Vn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function lr(e,t="",n=Math.max){return Tu(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function N_(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 Rg(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=kg(n("mgx:factProvenance")),o=n(ii).split(" ").filter(Boolean)[0]||null,r=Xr(e.id);return[e.id,Nt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(co)||s.id,r||s.type,Number(n(r?tr:Oo))||0,n(Je),n(si)||null,o,t]}function P_(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(St))return;let t=e.prepare(Tg);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(St))t.run(...Rg(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function M_(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Ig(e,t){return e&&t&&(e[Ag]=t),e}function D_(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 Og(e,t,n,s){let o=e.prepare(F_),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=ls();for(let a of n){let l=t.groups.get(a);if(!l?.length){r.run(a),s?.delete(a);continue}let c=M_(td(a,l,t).assertions),u=Hp(c).score;o.run(a,u,JSON.stringify(c),i),s?.set(a,{trustBase:u,inputs:c})}}function z_(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(St))return;let n=ed(Mg(e));t.exec("BEGIN IMMEDIATE");try{Og(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function U_(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=ls();for(let i of n){let[a,l]=i.split("\0");if(fa(l)!==Hr)continue;let c=t.groupsByPair.get(i)||[];if(c.length<2)continue;let u=c.map(p=>{let m=td(p,t.groups.get(p),t);return m.trust=Ti(m.assertions).score,m});if(new Set(u.map(p=>p.object)).size<2)continue;let d=su(u,Hr)?.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 B_(e,{subject:t,predicate:n}={}){if(!Fn(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 G_(){if($g)return;$g=!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 Lg(e){G_();let{DatabaseSync:t}=await Promise.resolve().then(()=>(cg(),ag)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(O_),P_(n);let s={backend:Sg,db:n,dbPath:e};return z_(s),s}function Ng(e){Fn(e)&&e.db.close()}async function Pg(e,t){if(t===zu)return{dir:Fa(),close:async()=>{}};let n=Q(e,".tmct","memory","graph.sqlite"),s=r=>hp(r).then(()=>!0,()=>!1);!await s(n)&&await s(Q(e,Lu))&&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 jn(ve(n),{recursive:!0});let o=await Lg(n);return{dir:o,close:async()=>Ng(o)}}async function Cs(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(La(),wg));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return Pg(e,n)}function q_(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=Mg(e),e.cachedFactHeads=D_(e.db),e.cachedDataVersion=t),Ig(Sn(e.cachedPayload),e.cachedFactHeads)}function Mg(e){let t=e.db,n=ri(),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 V_(e,t){let n=Sn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function H_(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function K_(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 Y_(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,Sn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function X_(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function J_(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function Q_(e,t){let n=e.db,s=ri(),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=Sn(t.generated_at??s.generated_at),o.memory=Sn(t.memory??s.memory),o.prefixes=Sn(t.prefixes??s.prefixes),o.vocabulary=Sn(t.vocabulary??s.vocabulary),o.classes=Sn(t.classes??s.classes),o.proseIndex=Sn(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(Tg),d=new Set,f=new Set,p=new Set;for(let E of t.individuals||[]){d.add(E.id);let R=JSON.stringify(E),j=i.get(E.id);if(j&&j.json===R)continue;let A=j?j.ord:l++;c.run(E.id,A,E.class??null,E.label??null,R),E.class===St&&(u.run(...Rg(E,R)),f.add(Nt(E.id)),p.add(Au(oi(E,"subject"),oi(E,"predicate")))),o&&V_(o,E)}let m=n.prepare("DELETE FROM individuals WHERE id = ?"),h=n.prepare("DELETE FROM facts WHERE id = ?"),g=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let E of n.prepare("SELECT id FROM individuals").all()){if(d.has(E.id))continue;let R=g.get(E.id);R&&(f.add(R.triple_hash),p.add(Au(R.subject,R.predicate))),m.run(E.id),h.run(E.id)}o&&H_(o,d);let b=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 (?, ?, ?, ?)"),_=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 = ?"),S=new Set;for(let E of t.objectProperties||[]){S.add(E.prop);let R=_.all(E.prop),j=new Map(R.map(z=>[`${z.subject}\0${z.object}`,z])),A=new Set,F=o?K_(o,E.prop):null;for(let z of E.examples||[]){let Y=`${z.subject}\0${z.object}`;A.add(Y);let ae=Object.keys(z).filter(G=>!W_.has(G)),Z=ae.length?JSON.stringify(Object.fromEntries(ae.map(G=>[G,z[G]]))):null,D=j.get(Y);D&&(D.subject_label??null)===(z.subjectLabel??null)&&(D.object_label??null)===(z.objectLabel??null)&&(D.extra??null)===(Z??null)||($.run(E.prop,z.subject,z.object,z.subjectLabel??null,z.objectLabel??null,Z),F&&Y_(F,z,ae))}for(let z of j.keys()){if(A.has(z))continue;let[Y,ae]=z.split("\0");x.run(E.prop,Y,ae)}F&&X_(F,A);let T=Number.isFinite(E.count)?E.count:(E.examples||[]).length,M=b.get(E.prop)?.ord??w++;v.run(E.prop,M,E.predicate??null,T),F&&(F.predicate=E.predicate??null,F.count=T)}for(let E of n.prepare("SELECT prop FROM relations").all())S.has(E.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(E.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(E.prop));if(o&&J_(o,S),f.size){let E=ed(t);Og(n,E,f,e.cachedFactHeads),U_(n,E,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Fg(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await $r(n,t),await xi(n,e)}async function Da(e,t){await Fg(e,JSON.stringify(t))}async function eR(e,{retentionVersions:t}={}){if(Uu(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=ni(e),s;try{s=await ze(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=Z_(e),r;try{r=JSON.parse(await ze(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??Iu}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??Iu);let i=r.version,a=ni(e,i);await jn(ve(a),{recursive:!0}),await Fg(a,s),r.version=i+1;let l=null,c=i-r.retentionVersions;if(c>=0)try{await xc(ni(e,c)),l=c}catch(u){if(u?.code!=="ENOENT")throw u}return await Da(o,r),{skipped:!1,version:i,prunedVersion:l}}async function Pt(e){if(Is(e))return ju(e.payload);if(Fn(e))return ju(q_(e));let t;try{t=await ze(Ru(e),"utf8")}catch(n){if(n?.code==="ENOENT")return ri();throw n}return ju(JSON.parse(t))}function nR(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==St||!tR.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Ho(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 sR(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(l=>l?.prop===pn),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!==St||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=Ho(u,d,f),m=c(Je),h=c("mgx:factProvenance"),g=n.get(l.id)||[],b=h?_g(h):[];for(let w of g)b.some(v=>v.sourceId===w.object)||b.push({sourceId:w.object,sourceType:"",tags:[]});b.length||b.push({sourceId:cs,sourceType:"",tags:[]});let y=[];for(let w of b){let v={id:`${p}@${w.sourceId}`,label:l.label,class:St,derived_from:Sn(l.derived_from)||[],mentions:Sn(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:Je,key:"createdAt",value:lr(w.tags,m,Math.min)||m||ls()},{prop:co,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!==cs){let _=g.find($=>$?.object===w.sourceId);i.push({..._||{},subject:v.id,object:w.sourceId,subjectLabel:v.label,objectLabel:Vu(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:pn,count:i.length,examples:i}));for(let l of e.objectProperties||[]){if(l?.prop===pn||!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 m of f)c.push({...u,subject:p,object:m})}l.examples=c,l.count=c.length}e.individuals=a,Bg(e);for(let l of r)rr(e,l);return Dn(e),e}async function oR(e,t){if(Is(e)){e.payload=t;return}if(Fn(e)){Q_(e,t);return}await jn(ve(Ru(e)),{recursive:!0}),await Da(Ru(e),t)}async function rR(e){if(Is(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(Fn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(zg);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await ze(Q(e,Bu),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function iR(e,t){if(Is(e)){e.syllogiseState=structuredClone(t);return}if(Fn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(zg,JSON.stringify(t));return}let n=Q(e,Bu);await jn(ve(n),{recursive:!0}),await Da(n,t)}async function aR(e){if(Is(e))return e.nodeId||null;if(Fn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Ug);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await ze(Q(e,Wu),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function cR(e,t){if(Is(e)){e.nodeId=t;return}if(Fn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Ug,JSON.stringify({nodeId:t}));return}let n=Q(e,Wu);await jn(ve(n),{recursive:!0}),await Da(n,{nodeId:t})}function Bg(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===ar&&n.set(a.id,a),a.class===sn&&Ou(r,a),a.class===St)){let l=Nt(a.id),c=o.get(l);c?c.push(a.id):o.set(l,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===pn);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[Cu]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[Cu]}function Ou(e,t){let n=Nt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function lR(e,t){let n=Mt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===sn&&Nt(s.id)===t)}async function ds(e,t){let n=await Pt(e);Bg(n);let s=await t(n)??n;return mR(s),gR(s),s.proseIndex=Np(s.individuals),await oR(e,s),s}function Gu(e,t){return e?.attributes?.find(n=>n?.prop===Je)?.value||t||ls()}function fn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function qu(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Na}:${e.sessionId}`:Na,type:"operator"};case"teach":return{id:e.sessionId?`${_u}:${e.sessionId}`:_u,type:"teach"};case"teachNode":return{id:`${Eg}:${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:${Gr(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 uR(e){return Oc[e]||null}function dR(e,t,n){let s=qu(t);if(!s)return null;let o=Mt(e),r=o?o.individualsById.get(s.id):e.individuals.find(c=>c?.id===s.id),i=Gu(r,t?.createdAt||n),a={id:s.id,label:Vu(s.id),class:ar,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:Je,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=us(e,a);return o&&o.sourcesById.set(s.id,l),s.id}function Ua(e){let t=Mt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===ar&&(n[s.id]=s);return n}function Wg(e,t){let n=Mt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===pn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function pR(e,t,n=Date.now(),s={}){let o=Wg(e,t.id),r=(t.attributes||[]).find(l=>l?.prop===Je)?.value||"",{score:i,inputs:a}=Vp({sourceIds:o,createdAt:r},Ua(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});fn(t,Oo,"trustScore",String(i)),fn(t,_i,"trustInputs",JSON.stringify(a)),fn(t,ys,"updatedAt",new Date(n).toISOString())}function fR(e,t,n=Date.now(),s={}){let[o]=Wg(e,t.id),r=o?Ua(e)[o]:null,i=(r?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||"",a=Ri(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===Je)?.value||"";fn(t,Oo,"trustScore",String(a)),fn(t,_i,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:l})),fn(t,ys,"updatedAt",new Date(n).toISOString())}function Gg(e,t,n,s){t?.class===St?fR(e,t,n,s):pR(e,t,n,s)}function rr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===Je)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Vn(i);if(!a)continue;let l=dR(e,a,r);l&&Ma(e,{predicate:"statedBy",prop:pn},{subject:t.id,object:l,subjectLabel:t.label,objectLabel:Vu(l)})}Gg(e,t,n,s)}function mR(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===pn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==St||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(rr(e,r,o),s=!0);s&&Dn(e)}function gR(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=vt(e),n=new Set;for(let a of eb(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(!hR(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=Mt(e);for(let[a,l]of s){let c=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);c&&(fn(c,xg,"sourceReliability",String(Kp(l))),fn(c,ys,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===pn),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&&Gg(e,l)}}function bR(e,t,n){if(!ga(n?.id))return n;let s=Xr(n.id);if(!s)return lu(t,n);let o=Ua(e);return lu(t,n,{priorFor:r=>Ri(s,o[r])})}function vg(e,t,n){return n?.class===sn?ng(t,n):bR(e,t,n)}function us(e,t){let n=Mt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,vg(e,o,t)),o.class===sn&&Ou(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===sn&&Ou(n.retractionsByGroup,t),t.class===St){let r=Nt(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]=vg(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Ma(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===pn?Mt(e):null;if(r){let l=r.statedByBySubject.get(s.subject);if(!l||!l.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||ls()}),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||ls();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 Dn(e){let t=[Pu,Nu,St,ar,cr];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 wR(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:Pu,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Je,key:"createdAt",value:n||ls()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function qg(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:l=""}){if(!T_.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=os(n),d=`utt:${o}#${c}#${t}`,f=za(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=ji({doc:u}),m=e.individuals.find(y=>y?.id===d),h=Gu(m,l||c),g={id:d,label:f,class:Nu,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:Je,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...p.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:p.join(" ")}]:[]]};us(e,g);let b=wR(e,o,r);if(Ma(e,{predicate:"saidInSession",prop:Mu},{subject:d,object:b,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&Ma(e,{predicate:"inReplyTo",prop:Fu},{subject:d,object:a,subjectLabel:f,objectLabel:y.label})}return c&&c>String(e.generated_at||"")&&(e.generated_at=c),d}async function yR(e,t){let n;return await ds(e,s=>{n=qg(s,t),Dn(s)}),{id:n}}async function Vg(e,t){let n=[];return t?.length?(await ds(e,s=>{for(let o of t)n.push(qg(s,o));Dn(s)}),{ids:n}):{ids:n}}async function $R(e,t){t?.length&&await ds(e,n=>{for(let s of t)for(let o of lo(n,s.factId))Ma(n,{predicate:"canonicalisedFrom",prop:Du},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function lo(e,t){let n=Mt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===St&&Nt(s.id)===t).map(s=>s.id)}function Hg(e,t,n,s=""){let o=_g(n);if(o.length===1&&o[0].sourceId===cs&&lo(e,t).length)return[];let r=lR(e,t);if(r.length&&(o=o.filter(a=>!xa(r,`${t}@${a.sourceId}`,lr(a.tags,s))),!o.length))return o;let i=vR(e,t);return i.length?o.filter(a=>!Qh(i,a.sourceId)):o}function vR(e,t){let n=Mt(e),s=n?n.factRecordsByGroup.get(t):lo(e,t),o=[];for(let r of s||[]){if(!Ts(r))continue;let i=As(e,r);i&&o.push(i)}return o}function Kg(e,t,{quantifier:n,environments:s}){let o=lo(e,t).map(i=>As(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===ii)),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)fn(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")||(fn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function xR(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Pa)?.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 Yg(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}`,m=Mt(e),h=m?m.individualsById.get(p):e.individuals.find(R=>R?.id===p),g=R=>(h?.attributes||[]).find(j=>j?.prop===R)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:Tu(l.tags),observedAt:u},w=null,v=l.tags,_=y.assertedAt||c||ls(),$=u,x=[],S=d;if(h){let R={assertedAt:Tu(b),observedAt:g(si)};N_(y,R)?(w={head:h,id:`${p}#v${xR(h)}`},x=[w.id]):(v=[...new Set([...b,...l.tags])],_=g(Je)||_,$=u||g(si),x=g(Pa).split(" ").filter(Boolean)),S=d||g("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:St,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:Je,key:"createdAt",value:_},{prop:co,key:"sourceId",value:l.sourceId},...v.length?[{prop:"mgx:factProvenance",key:"provenance",value:v.join(" | ")}]:[],...$?[{prop:si,key:"observedAt",value:$}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...S?[{prop:"mgx:factQuantifier",key:"quantifier",value:S}]:[],...f?[{prop:"mgx:factJustification",key:"justification",value:f.map(R=>R.join(" ")).join(" | ")}]:[],...x.length?[{prop:Pa,key:"supersedes",value:x.join(" ")}]:[]]},demote:w}}function ER(e,t){let n=`${t}@${cs}`,s=Mt(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 Xg(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${cs}`)||ER(e,Nt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};fn(o,ii,"supersededBy",t.id),us(e,o),s.push(o.id)}return us(e,t),s.push(t.id),s}function As(e,t){let n=Mt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function Hu(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=Mt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Nt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Jg(e,t){let n=Mt(e),s=(n?n.factRecordsByGroup.get(t):lo(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=As(e,u);if(!d)continue;let f=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(Ts(u)){i.set(Xr(u),d);continue}if(nr(u)){a.set(f(co),d);continue}let p=f("mgx:factProvenance"),m=kg(p),h=p.split(" | ").filter(Boolean),g={id:u,sourceId:f(co)||m.id,assertedAt:lr(h,f(Je)),record:d};if(f(ii)){let y=r.get(g.sourceId);y?y.push(g):r.set(g.sourceId,[g]);continue}if(!m.type)continue;let b=o.get(m.type);b?b.push(g):o.set(m.type,[g])}let l=Ua(e),c=[];for(let[u,d]of o){let f=Xh({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>Ri(u,l[p])});if(f){us(e,f.rollup),c.push(...f.absorbed);for(let p of f.absorbedSourceIds){for(let h of r.get(p)||[])c.push(h.id);r.delete(p);let m=a.get(p);m&&c.push(m.id),a.delete(p)}}}for(let[u,d]of r){let f=Jh({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;us(e,f.rollup),c.push(...f.absorbed);let p=As(e,f.rewire);p&&fn(p,Pa,"supersedes",f.rollup.id)}return c}async function SR(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:l,ruleConfidence:c}={}){let u=J(t),d=rs(n),f=J(s);if(!u||!d||!f)throw new Error("a fact needs subject, predicate and object");let p=Ho(u,d,f),m=`${u} ${d} ${f}`,h=ji({doc:m}),g=os(a);return await ds(e,async b=>{let y=Hg(b,p,os(o),r);for(let w of y.length?[]:Kg(b,p,{quantifier:g}))rr(b,As(b,w),void 0,{premiseTrusts:l,ruleConfidence:c});for(let w of y){let v=Yg(b,{groupId:p,s:u,p:d,o:f,label:za(m),tokens:h,group:w,createdAt:r,observedAt:i,quantifier:g});await $u(v.candidate);for(let _ of Xg(b,v))rr(b,As(b,_),void 0,_===v.candidate.id?{premiseTrusts:l,ruleConfidence:c}:void 0)}Hu(b,Jg(b,p)),Dn(b)}),{id:p}}function kR(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 uo(e,t){let n=[],s=0;for(let r of t||[]){let i=J(r?.subject),a=rs(r?.predicate),l=J(r?.object);if(!i||!a||!l){s+=1;continue}let c=`${i} ${a} ${l}`;n.push({id:Ho(i,a,l),s:i,p:a,o:l,text:c,tokens:ji({doc:c}),provenance:os(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:os(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:kR(r?.justification)})}let o=[];return n.length?(await ds(e,r=>{let i=[],a=new Set,l=new Map;for(let u of n){let d=Hg(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:Kg(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=Yg(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 m of Xg(r,p))a.has(m)||(a.add(m),i.push(m));(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)rr(r,As(r,u),void 0,l.get(u));let c=[];for(let u of new Set(o))c.push(...Jg(r,u));Hu(r,c),Dn(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Ga(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Qg[n];if(!i)throw new Error(`a rule kind must be one of ${jR.join(", ")}, got ${JSON.stringify(n)}`);let a=J(t);if(!a)throw new Error("a rule needs a name");let l=_R[n]||new Set,c=i.map(([p])=>J(s?.[p])),u=i.filter(([p],m)=>!l.has(p)&&!c[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([p])=>p).join(" + ")}`);if(n===li){let p=c[i.findIndex(([h])=>h==="objectRole")],m=c[i.findIndex(([h])=>h==="value")];if(!p&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=RR(n,a,c),f=za(`${a} = ${n}(${c.join(", ")})`);return await ds(e,async p=>{let m=p.individuals.find(w=>w?.id===d),h=m?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...h.split(" | "),os(o)].filter(Boolean))],b=Gu(m,r),y={id:d,label:f,class:cr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Wa,key:"ruleName",value:a},{prop:ur,key:"ruleKind",value:n},...i.map(([w,v],_)=>({prop:v,key:w,value:c[_],skip:!c[_]&&l.has(w)})).filter(w=>!w.skip).map(({skip:w,...v})=>v),{prop:Je,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await $u(y),us(p,y),rr(p,p.individuals.find(w=>w?.id===d)),Dn(p)}),{id:d}}function Ju(e,t){let n=J(t);return(e?.individuals||[]).find(s=>s?.class===cr&&(s.attributes||[]).find(o=>o?.prop===Wa)?.value===n)}function TR(e,t){let n=J(t),s=o=>(o.attributes||[]).find(r=>r?.prop===ur)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===cr&&(o.attributes||[]).find(r=>r?.prop===Wa)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Qu(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==cr)continue;let s=a=>(n.attributes||[]).find(l=>l?.prop===a)?.value,o=s(ur),r=Qg[o];if(!r)continue;let i={};for(let[a,l]of r)i[a]=s(l)??"";t.push({id:n.id,name:s(Wa)||"",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 Zu(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(),m=l(J,n),h=l(J,s),g=r(p).filter(w=>m.has(w.fact.subject)&&h.has(w.fact.object));if(g.length){let w=g.slice().sort((v,_)=>c(v.fact,_.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let b=Ju(e,p),y=b?.attributes?.find(w=>w.prop===ur)?.value;if(b&&y===ai){let w=b.attributes.find(F=>F.prop==="mgx:ruleBase1")?.value,v=b.attributes.find(F=>F.prop==="mgx:ruleBase2")?.value,_=J(n),$=J(s);if(!w||!v||!_||!$)return null;let R=f({entity:_,hopsTaken:0},F=>F.hopsTaken===2&&F.entity===$,F=>{if(F.hopsTaken>=2)return[];let T=F.hopsTaken===0?w:v;return r(T).filter(M=>M.fact.subject===F.entity).map(M=>({action:M,nextState:{entity:M.fact.object,hopsTaken:F.hopsTaken+1}}))},{maxDepth:2,stateKey:F=>`${F.entity}#${F.hopsTaken}`});if(!R)return null;let j=new Set,A=[];for(let F of R.actions){A.push(i(F.fact));for(let T of F.aliasFacts){let M=T.id||`${T.subject}|${T.predicate}|${T.object}`;j.has(M)||(j.add(M),A.push(`${a(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{citation:A}}if(b&&y===ci){let w=b.attributes.find(E=>E.prop==="mgx:ruleBase1")?.value,v=b.attributes.find(E=>E.prop==="mgx:ruleFilterProperty")?.value;if(!w||!v)return null;let _=await Zu(e,w,n,s,o);if(!_)return null;let $=J(n),x=J(v),S=u.find(E=>E.predicate===d&&E.subject===$&&J(E.object)===x);return S?{citation:[..._.citation,i(S)]}:null}return null}async function Zg(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(J,n),m=o(f).filter(b=>p.has(b.fact.object));if(m.length){let b=new Map;for(let y of m)b.has(y.fact.subject)||b.set(y.fact.subject,[]),b.get(y.fact.subject).push(y);return[...b.entries()].map(([y,w])=>{let v=w.slice().sort((_,$)=>l(_.fact,$.fact))[0];return{subject:y,citation:[r(v.fact),...v.aliasFacts.map(_=>`${i(_)}${_.provenance?` (source: ${_.provenance})`:""}`)]}})}let h=Ju(e,f),g=h?.attributes?.find(b=>b.prop===ur)?.value;if(h&&g===ai){let b=h.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(x=>x.prop==="mgx:ruleBase2")?.value,w=J(n);return!b||!y||!w?[]:d({entity:w,hopsTaken:0},x=>{if(x.hopsTaken>=2)return[];let S=x.hopsTaken===0?y:b;return o(S).filter(E=>E.fact.object===x.entity).map(E=>({action:E,nextState:{entity:E.fact.subject,hopsTaken:x.hopsTaken+1}}))},{maxDepth:2,stateKey:x=>`${x.entity}#${x.hopsTaken}`}).filter(x=>x.node.hopsTaken===2).map(({node:x,path:S})=>{let E=new Set,R=[];for(let j of S.actions.slice().reverse()){R.push(r(j.fact));for(let A of j.aliasFacts){let F=A.id||`${A.subject}|${A.predicate}|${A.object}`;E.has(F)||(E.add(F),R.push(`${i(A)}${A.provenance?` (source: ${A.provenance})`:""}`))}}return{subject:x.entity,citation:R}})}if(h&&g===ci){let b=h.attributes.find($=>$.prop==="mgx:ruleBase1")?.value,y=h.attributes.find($=>$.prop==="mgx:ruleFilterProperty")?.value;if(!b||!y)return[];let w=await Zg(e,b,n,s),v=J(y),_=[];for(let $ of w){let x=J($.subject),S=c.find(E=>E.predicate===u&&E.subject===x&&J(E.object)===v);S&&_.push({subject:$.subject,citation:[...$.citation,r(S)]})}return _}return[]}function vt(e,t={}){let n=ed(e),s=Cg(e),o=[];for(let[r,i]of n.groups){let a=td(r,i,n),l=s?.get(r);a.trust=Ti(l?l.inputs:a.assertions,t).score,o.push(a)}return o}function ed(e){let t=e?.individuals||[],n=new Map(t.filter(l=>l?.class===ar).map(l=>[l.id,l])),s=(e?.objectProperties||[]).find(l=>l?.prop===pn),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===sn){let d=Nt(l.id),f=i.get(d);f?f.push(l):i.set(d,[l]);continue}if(l?.class!==St||(l.attributes||[]).some(d=>d?.prop===ii)||nr(l.id))continue;let c=Nt(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=>!xa(c,f.id,lr(Mn(f,"mgx:factProvenance").split(" | ").filter(Boolean),Mn(f,Je))));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=Au(oi(c[0],"subject"),oi(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 td(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=Mn,i=oi,a=[],l=[],c=[],u=new Set,d=[],f=new Set,p="";for(let g of t){if(Ts(g.id)){let x=Xr(g.id),S=ba(g);for(let E of S)l.includes(E)||(l.push(E),x&&c.push(x));a.push({id:g.id,sourceId:"",sourceType:x,provenance:"",createdAt:r(g,Ln),ownTrust:Number(r(g,tr))||0,assertedAt:r(g,Nn),rollup:{count:Number(r(g,Yr))||S.length,sourceIds:S,earliest:r(g,Ln),latest:r(g,Nn)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let x of b)u.add(x);let[y]=s.get(g.id)||[],w=y||r(g,co),v=o(w);y&&!l.includes(y)&&(l.push(y),v&&c.push(v));let _=r(g,Je),$=r(g,si);a.push({id:g.id,sourceId:w,sourceType:v,provenance:b.join(" | "),createdAt:_,...$?{observedAt:$}:{},ownTrust:Number(r(g,Oo))||0,assertedAt:lr(b,_)}),p=p||i(g,"quantifier");for(let x of i(g,"justification").split(" | ")){let S=x.split(" ").filter(Boolean);if(!S.length)continue;let E=S.join(" ");f.has(E)||(f.add(E),d.push(S))}}let m=[],h=new Set;for(let g of d)for(let b of g)h.has(b)||(h.add(b),m.push(b));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:p,sourceIds:l,sourceTypes:c,environments:d,justification:m,assertions:a}}function AR(e){let t=Mn(e,co);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 IR(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||ls();return await ds(e,l=>{let c=new Set,u=new Set,d=new Map;l.individuals=(l.individuals||[]).filter(f=>{if(f?.class!==St)return!0;let p=Nt(f.id),m=o.has(f.id)?f.id:o.has(p)?p:"";if(!m)return!0;u.add(m),c.add(f.id);let h=AR(f),g=`${p}\0${h}`,b=Mn(f,"mgx:factProvenance"),y=d.get(g);return y?(y.ids.push(f.id),b&&y.tags.push(b)):d.set(g,{groupId:p,sourceId:h,ids:[f.id],tags:b?[b]:[],template:{label:f.label||"",subject:Mn(f,"rdf:subject"),predicate:Mn(f,"rdf:predicate"),object:Mn(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(m=>!c.has(m?.subject)&&!c.has(m?.object)),f.count=f.examples.length}for(let f of d.values()){let p=tg({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&us(l,p)}Dn(l)}}),{removed:r,records:i}}function CR(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==sn)continue;let s=Ea(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function OR(e,t){let n=[];for(let o of t||[]){let r=Sa(o);r&&n.push(r)}let s=[];return n.length?(await ds(e,o=>{let r=new Map;for(let a of n){let l=us(o,a),c=Nt(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 lo(o,a)){let u=As(o,c);if(!u)continue;let d=Mn(u,"mgx:factProvenance").split(" | ").filter(Boolean);xa(l,c,lr(d,Mn(u,Je)))&&i.add(c)}if(i.size){Hu(o,i);for(let a of i)s.push(a)}Dn(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function LR(e,{self:t="",acknowledgedBy:n=null}={}){let s=ka(vt(e)),o=[];for(let r of e?.individuals||[])r?.class===sn&&r.id&&o.push(r.id);return{roster:s,retirable:ja({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function NR(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await ds(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==sn||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Mt(o);if(i)for(let a of r){i.individualsById.delete(a);let l=Nt(a),c=(i.retractionsByGroup.get(l)||[]).filter(u=>!r.has(u.id));c.length?i.retractionsByGroup.set(l,c):i.retractionsByGroup.delete(l)}Dn(o)}),{retired:s}):{retired:s}}function eb(e,{floor:t=PR}={}){let n=vt(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(fa(r.predicate)===eu)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=fa(r[0].predicate);i!==tu&&!su(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 ir,Lu,Nu,St,Pu,ar,cr,Mu,Fu,R_,pn,Du,xg,Na,_u,Eg,T_,yg,A_,Ru,zu,Sg,O_,cs,si,co,Pa,ii,Tg,Mn,oi,Au,Ag,Cg,F_,W_,$g,Sn,Dg,Iu,Z_,ju,tR,Bu,zg,Wu,Ug,Cu,Mt,za,ls,Vu,hR,ai,ci,Ku,Yu,Ba,li,Xu,jR,Wa,ur,Qg,_R,RR,PR,dr,MR,FR,qe=O(()=>{_t();Ue();ws();nn();nn();Hn();zh();Hn();pa();uu();gu();yu();ig();uu();gu();yu();ir=Q(".tmct","memory"),Lu=Q(ir,"graph.json"),Nu="Utterance",St="Fact",Pu="Session",ar="Source",cr="Rule",Mu="mgx:saidInSession",Fu="mgx:inReplyTo",R_="mgx:derivedFrom",pn="mgx:statedBy",Du="mgx:canonicalisedFrom",xg="mgx:sourceReliability",Na="src:operator-chat",_u="src:teach-chat",Eg="src:teach-node",T_=new Set(["visitor","tmct"]),yg=48,A_=[{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:Mu,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:Fu,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:Je,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:ys,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:R_,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:pn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:Du,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:Oo,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:_i,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:Xo,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)"}];Ru=e=>ni(e),zu="memory",Sg="sqlite";O_=`
101
+ `))return r}}throw new he("cannot find end of structure",{toml:e,ptr:t})}var Ca=O(()=>{co();});function P_(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(sr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ti(e,t,n,s,o){if(s===0)throw new he("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[l,c]=r==="["?bg(e,t,s,o):gg(e,t,s,o);if(n){if(c=Mn(e,c),e[c]===",")c++;else if(e[c]!==n)throw new he("expected comma or end of structure",{toml:e,ptr:c})}return[l,c]}if(r==='"'||r==="'"){let[l,c]=Aa(e,t);if(n){if(c=Mn(e,c),e[c]&&e[c]!==","&&e[c]!==n&&e[c]!==`
102
+ `&&e[c]!=="\r")throw new he("unexpected character encountered",{toml:e,ptr:c});e[c]===","&&c++}return[l,c]}let i=mg(e,t,",",n),a=P_(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new he("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=Mn(e,t+a[1]),e[i]===","&&i++),[hg(a[0],e,t,o),i]}var _u=O(()=>{ju();Ru();Ca();co();});function Oa(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new he("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 he("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,l]=Aa(e,t);s=e.indexOf(".",l);let c=e.slice(l,s<0||s>r?r:s),u=Ia(c);if(u>-1)throw new he("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(c.trimStart())throw new he("found extra tokens after the string part",{toml:e,ptr:l});if(r<l&&(r=e.indexOf(n,l),r<0))throw new he("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(!M_.test(a))throw new he("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,Mn(e,r+1,!0,!0)]}function gg(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new he("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=sr(e,t);else if(i!==" "&&i!==" "&&i!==`
103
+ `&&i!=="\r"){let a,l=o,c=!1,[u,d]=Oa(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 he("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 he("trying to redefine an already defined value",{toml:e,ptr:t});let[f,p]=ti(e,d,"}",n-1,s);r.add(f),l[a]=f,t=p}}if(!i)throw new he("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function bg(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new he("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=sr(e,t);else if(r!==" "&&r!==" "&&r!==`
104
+ `&&r!=="\r"){let i=ti(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new he("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var M_,Ru=O(()=>{ju();_u();Ca();co();M_=/^[a-zA-Z0-9-_]+[ \t]*$/});function wg(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 or(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=Mn(e,0);a<e.length;){if(e[a]==="["){let l=e[++a]==="[",c=Oa(e,a+=+l,"]");if(l){if(e[c[1]-1]!=="]")throw new he("expected end of table declaration",{toml:e,ptr:c[1]-1});c[1]++}let u=wg(c[0],s,o,l?2:1);if(!u)throw new he("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=Oa(e,a),c=wg(l[0],r,i,0);if(!c)throw new he("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ti(e,l[1],void 0,t,n);c[1][c[0]]=u[0],a=u[1]}if(a=Mn(e,a,!0),e[a]&&e[a]!==`
105
+ `&&e[a]!=="\r")throw new he("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=Mn(e,a)}return s}var yg=O(()=>{Ru();_u();Ca();co();});var $g=O(()=>{});var La=O(()=>{yg();$g();ku();co();});var Eg={};Wn(Eg,{CONFIG_FILE:()=>Pa,loadTomlConfig:()=>Tu,mergeEffective:()=>xg,normalizeConfig:()=>vg});async function Tu(e,{file:t}={}){let n=t||J(e,Pa),s;try{s=await ze(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return or(s)}catch(o){throw new Error(`Invalid ${Pa} at ${n}: ${o&&o.message?o.message:o}`)}}async function F_(e,t){let n;if(Array.isArray(e))n=e;else{let o=Qt(t,String(e));n=(await ze(o,"utf8")).split(`
106
+ `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Qt(t,r))}return s}async function vg(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await F_(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Qt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Qt(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=>Qt(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 g=n.memory||{},b={};g.retention_versions!==void 0&&(b.retentionVersions=g.retention_versions),g.backend!==void 0&&(b.backend=g.backend),Object.keys(b).length&&(o.memory=b);let y=[];for(let[w,v]of D_)n[w]&&n[w][v]!==void 0&&y.push(`${w}.${v}`);return o.unwired=y,o}function Na(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:Na(o,r,n)}return n}function xg({args:e={},toml:t=null,defaults:n={}}={}){let s=Na(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?Na(o):{},i=Na(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 Pa,D_,Ma=O(()=>{_t();Ue();La();Pa="tmct.toml";D_=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Ns={};Wn(Ns,{CANONICALISED_FROM_PROP:()=>Wu,CAPABLE_OF_PREDICATE:()=>YR,CHAIN_KEEP_DEPTH:()=>Km,CHAIN_ROLLUP_THRESHOLD:()=>wa,CREATED_AT_PROP:()=>Je,DEFAULT_RETENTION:()=>Nu,FACT_CLASS:()=>St,GROUP_ROLLUP_THRESHOLD:()=>qm,HAS_A_PREDICATE:()=>dr,IN_REPLY_TO_PROP:()=>Bu,MEMORY_DIR_REL:()=>ir,MEMORY_GRAPH_REL:()=>Fu,MEMORY_MANIFEST_REL:()=>Vg,MEMORY_SESSION_CLASS:()=>zu,MULTI_VALUED_PREDICATES:()=>XR,NODE_ID_REL:()=>Ku,OPERATOR_SOURCE_ID:()=>Fa,RETRACTED_AT_PROP:()=>Ea,RETRACTED_COUNT_PROP:()=>mu,RETRACTED_RECORD_IDS_PROP:()=>xa,RETRACTION_CLASS:()=>on,RETRACTION_PREDICATE:()=>va,ROLLUP_COUNT_PROP:()=>Yr,ROLLUP_EARLIEST_PROP:()=>Nn,ROLLUP_KEEP_PER_TYPE:()=>Hm,ROLLUP_LATEST_PROP:()=>Pn,ROLLUP_PRIOR_PROP:()=>tr,ROLLUP_RECORD_IDS_PROP:()=>Kr,ROLLUP_SOURCE_IDS_PROP:()=>er,RULE_CLASS:()=>cr,RULE_KIND_ACTION_CONSTRAINT:()=>td,RULE_KIND_ACTION_EFFECT:()=>ui,RULE_KIND_ACTION_PRECOND:()=>Ga,RULE_KIND_ACTION_SIGNATURE:()=>ed,RULE_KIND_COMPOSE2:()=>ci,RULE_KIND_FILTER:()=>li,RULE_KIND_PROP:()=>ur,RULE_KIND_RECURSIVE:()=>Zu,SAID_IN_SESSION_PROP:()=>Uu,SOURCE_CLASS:()=>ar,SOURCE_RELIABILITY_PROP:()=>_g,STATED_BY_PROP:()=>fn,SYLLOGISE_STATE_REL:()=>Hu,UPDATED_AT_PROP:()=>vs,UTTERANCE_CLASS:()=>Du,admittedNodes:()=>Ra,appendCanonicalisedFromEdges:()=>CR,appendFact:()=>PR,appendFacts:()=>po,appendRetractions:()=>VR,appendRule:()=>qa,appendUtterance:()=>IR,appendUtterances:()=>Qg,applySeedPayload:()=>Ag,attachFactHeads:()=>Fg,chainRollupIdFor:()=>lu,cloneMemoryPayload:()=>Ig,closeSqliteMemoryStore:()=>Bg,createInMemoryStore:()=>ii,createSqliteMemoryStore:()=>Ug,emptyMemory:()=>ri,factGroupId:()=>Pt,factHeadsOf:()=>Dg,factIdForTriple:()=>me,factRecordIdForTag:()=>G_,factRecordIdsFor:()=>uo,findContradictions:()=>ib,findRuleByName:()=>nd,findRulesByName:()=>UR,headRollupIdFor:()=>cu,isChainRollupId:()=>nr,isHeadRollupId:()=>Is,isMemoryOrSqliteHandle:()=>Vu,isRetractionId:()=>bu,isRollupId:()=>ya,loadMemory:()=>Ct,loadNodeId:()=>yR,loadSyllogiseState:()=>bR,normFactPredicate:()=>is,normFactTerm:()=>Q,openConfiguredMemoryBackend:()=>Ls,openExistingMemoryBackend:()=>tR,openMemoryBackend:()=>qu,peersToConvince:()=>xu,provSourceClassFor:()=>xR,provenanceTagToSource:()=>Hn,readFactRows:()=>vt,readObjectSupersessions:()=>Q_,readOnlyMemorySnapshot:()=>nR,readRetractions:()=>GR,readRuleRows:()=>sd,removeFacts:()=>WR,resolveMemoryGraphFile:()=>ni,resolveRelationChase:()=>od,resolveRelationChaseReverse:()=>rb,retirableRetractions:()=>qR,retireRetractions:()=>HR,retractedAtOf:()=>ao,retractedRecordIds:()=>io,retractionFromWire:()=>_a,retractionIdFor:()=>gu,retractionScopeOf:()=>wu,retractionWireFact:()=>ja,saveNodeId:()=>$R,saveSyllogiseState:()=>wR,snapshotMemory:()=>pR,stableRecordIds:()=>Ta});function ri(){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:B_.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function ni(e,t=null){if(Os(e)||Dn(e))throw new Error("resolveMemoryGraphFile: dir is a memory/sqlite handle, not a file path (Backend A only)");return t===null?J(e,Fu):J(e,ir,`graph.v${t}.json`)}function Os(e){return!!e&&typeof e=="object"&&e.backend===Gu}function Dn(e){return!!e&&typeof e=="object"&&e.backend===Tg}function Vu(e){return Os(e)||Dn(e)}function ii(){return{backend:Gu,payload:ri()}}function Ag(e,t){t&&(e.payload={...e.payload,...t})}function Ig(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Cg(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Xu(Hn(t));if(n)return n}return{id:ls,type:""}}function Pt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function G_(e,t){return`${e}@${Og(t).id}`}function Og(e){return Xu(Hn(e))||{id:ls,type:""}}function Lg(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=Og(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(ls,{sourceId:ls,sourceType:"",tags:[]}),[...t.values()]}function Ou(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Hn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function lr(e,t="",n=Math.max){return Ou(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function V_(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 Ng(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Cg(n("mgx:factProvenance")),o=n(ai).split(" ").filter(Boolean)[0]||null,r=Xr(e.id);return[e.id,Pt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(lo)||s.id,r||s.type,Number(n(r?tr:Oo))||0,n(Je),n(si)||null,o,t]}function q_(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(St))return;let t=e.prepare(Pg);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(St))t.run(...Ng(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function H_(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function Fg(e,t){return e&&t&&(e[Mg]=t),e}function Y_(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 zg(e,t,n,s){let o=e.prepare(K_),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=us();for(let a of n){let l=t.groups.get(a);if(!l?.length){r.run(a),s?.delete(a);continue}let c=H_(id(a,l,t).assertions),u=Jp(c).score;o.run(a,u,JSON.stringify(c),i),s?.set(a,{trustBase:u,inputs:c})}}function X_(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(St))return;let n=rd(Wg(e));t.exec("BEGIN IMMEDIATE");try{zg(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function J_(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=us();for(let i of n){let[a,l]=i.split("\0");if(ga(l)!==Hr)continue;let c=t.groupsByPair.get(i)||[];if(c.length<2)continue;let u=c.map(p=>{let h=id(p,t.groups.get(p),t);return h.trust=Ii(h.assertions).score,h});if(new Set(u.map(p=>p.object)).size<2)continue;let d=au(u,Hr)?.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 Q_(e,{subject:t,predicate:n}={}){if(!Dn(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 eR(){if(kg)return;kg=!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 Ug(e){eR();let{DatabaseSync:t}=await Promise.resolve().then(()=>(fg(),pg)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(W_),q_(n);let s={backend:Tg,db:n,dbPath:e};return X_(s),s}function Bg(e){Dn(e)&&e.db.close()}async function qu(e,t){if(t===Gu)return{dir:ii(),close:async()=>{}};let n=J(e,".tmct","memory","graph.sqlite"),s=r=>kc(r).then(()=>!0,()=>!1);!await s(n)&&await s(J(e,Fu))&&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 _n($e(n),{recursive:!0});let o=await Ug(n);return{dir:o,close:async()=>Bg(o)}}async function tR(e,t=""){if(!e||typeof e!="string")return null;let n=J(e,".tmct","memory","graph.sqlite");try{await kc(n)}catch{return null}return qu(e,t)}async function nR(e){if(!e)return null;let t=ii();return Ag(t,Ig(await Ct(e))),t}async function Ls(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(Ma(),Eg));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return qu(e,n)}function sR(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=Wg(e),e.cachedFactHeads=Y_(e.db),e.cachedDataVersion=t),Fg(kn(e.cachedPayload),e.cachedFactHeads)}function Wg(e){let t=e.db,n=ri(),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 oR(e,t){let n=kn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function rR(e,t){e.individuals=e.individuals.filter(n=>t.has(n?.id))}function iR(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 aR(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,kn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function cR(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function lR(e,t){e.objectProperties=e.objectProperties.filter(n=>t.has(n?.prop))}function uR(e,t){let n=e.db,s=ri(),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=kn(t.generated_at??s.generated_at),o.memory=kn(t.memory??s.memory),o.prefixes=kn(t.prefixes??s.prefixes),o.vocabulary=kn(t.vocabulary??s.vocabulary),o.classes=kn(t.classes??s.classes),o.proseIndex=kn(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(Pg),d=new Set,f=new Set,p=new Set;for(let E of t.individuals||[]){d.add(E.id);let R=JSON.stringify(E),j=i.get(E.id);if(j&&j.json===R)continue;let A=j?j.ord:l++;c.run(E.id,A,E.class??null,E.label??null,R),E.class===St&&(u.run(...Ng(E,R)),f.add(Pt(E.id)),p.add(Lu(oi(E,"subject"),oi(E,"predicate")))),o&&oR(o,E)}let h=n.prepare("DELETE FROM individuals WHERE id = ?"),m=n.prepare("DELETE FROM facts WHERE id = ?"),g=n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?");for(let E of n.prepare("SELECT id FROM individuals").all()){if(d.has(E.id))continue;let R=g.get(E.id);R&&(f.add(R.triple_hash),p.add(Lu(R.subject,R.predicate))),h.run(E.id),m.run(E.id)}o&&rR(o,d);let b=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 (?, ?, ?, ?)"),_=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 = ?"),S=new Set;for(let E of t.objectProperties||[]){S.add(E.prop);let R=_.all(E.prop),j=new Map(R.map(z=>[`${z.subject}\0${z.object}`,z])),A=new Set,F=o?iR(o,E.prop):null;for(let z of E.examples||[]){let K=`${z.subject}\0${z.object}`;A.add(K);let ce=Object.keys(z).filter(G=>!Z_.has(G)),Z=ce.length?JSON.stringify(Object.fromEntries(ce.map(G=>[G,z[G]]))):null,D=j.get(K);D&&(D.subject_label??null)===(z.subjectLabel??null)&&(D.object_label??null)===(z.objectLabel??null)&&(D.extra??null)===(Z??null)||($.run(E.prop,z.subject,z.object,z.subjectLabel??null,z.objectLabel??null,Z),F&&aR(F,z,ce))}for(let z of j.keys()){if(A.has(z))continue;let[K,ce]=z.split("\0");x.run(E.prop,K,ce)}F&&cR(F,A);let T=Number.isFinite(E.count)?E.count:(E.examples||[]).length,M=b.get(E.prop)?.ord??w++;v.run(E.prop,M,E.predicate??null,T),F&&(F.predicate=E.predicate??null,F.count=T)}for(let E of n.prepare("SELECT prop FROM relations").all())S.has(E.prop)||(n.prepare("DELETE FROM edges WHERE prop = ?").run(E.prop),n.prepare("DELETE FROM relations WHERE prop = ?").run(E.prop));if(o&&lR(o,S),f.size){let E=rd(t);zg(n,E,f,e.cachedFactHeads),J_(n,E,p)}n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}async function Gg(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await $r(n,t),await Ei(n,e)}async function Ua(e,t){await Gg(e,JSON.stringify(t))}async function pR(e,{retentionVersions:t}={}){if(Vu(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=ni(e),s;try{s=await ze(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=dR(e),r;try{r=JSON.parse(await ze(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??Nu}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??Nu);let i=r.version,a=ni(e,i);await _n($e(a),{recursive:!0}),await Gg(a,s),r.version=i+1;let l=null,c=i-r.retentionVersions;if(c>=0)try{await jc(ni(e,c)),l=c}catch(u){if(u?.code!=="ENOENT")throw u}return await Ua(o,r),{skipped:!1,version:i,prunedVersion:l}}async function Ct(e){if(Os(e))return Au(e.payload);if(Dn(e))return Au(sR(e));let t;try{t=await ze(Cu(e),"utf8")}catch(n){if(n?.code==="ENOENT")return ri();throw n}return Au(JSON.parse(t))}function hR(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==St||!fR.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Ho(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 mR(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(l=>l?.prop===fn),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!==St||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=Ho(u,d,f),h=c(Je),m=c("mgx:factProvenance"),g=n.get(l.id)||[],b=m?Lg(m):[];for(let w of g)b.some(v=>v.sourceId===w.object)||b.push({sourceId:w.object,sourceType:"",tags:[]});b.length||b.push({sourceId:ls,sourceType:"",tags:[]});let y=[];for(let w of b){let v={id:`${p}@${w.sourceId}`,label:l.label,class:St,derived_from:kn(l.derived_from)||[],mentions:kn(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:Je,key:"createdAt",value:lr(w.tags,h,Math.min)||h||us()},{prop:lo,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!==ls){let _=g.find($=>$?.object===w.sourceId);i.push({..._||{},subject:v.id,object:w.sourceId,subjectLabel:v.label,objectLabel:Ju(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:fn,count:i.length,examples:i}));for(let l of e.objectProperties||[]){if(l?.prop===fn||!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,Kg(e);for(let l of r)rr(e,l);return zn(e),e}async function gR(e,t){if(Os(e)){e.payload=t;return}if(Dn(e)){uR(e,t);return}await _n($e(Cu(e)),{recursive:!0}),await Ua(Cu(e),t)}async function bR(e){if(Os(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(Dn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(qg);return t?.v?JSON.parse(t.v):null}try{return JSON.parse(await ze(J(e,Hu),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function wR(e,t){if(Os(e)){e.syllogiseState=structuredClone(t);return}if(Dn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(qg,JSON.stringify(t));return}let n=J(e,Hu);await _n($e(n),{recursive:!0}),await Ua(n,t)}async function yR(e){if(Os(e))return e.nodeId||null;if(Dn(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Hg);return t?.v&&JSON.parse(t.v).nodeId||null}try{return JSON.parse(await ze(J(e,Ku),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function $R(e,t){if(Os(e)){e.nodeId=t;return}if(Dn(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Hg,JSON.stringify({nodeId:t}));return}let n=J(e,Ku);await _n($e(n),{recursive:!0}),await Ua(n,{nodeId:t})}function Kg(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===ar&&n.set(a.id,a),a.class===on&&Mu(r,a),a.class===St)){let l=Pt(a.id),c=o.get(l);c?c.push(a.id):o.set(l,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===fn);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[Pu]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[Pu]}function Mu(e,t){let n=Pt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function vR(e,t){let n=Mt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===on&&Pt(s.id)===t)}async function ps(e,t){let n=await Ct(e);Kg(n);let s=await t(n)??n;return jR(s),RR(s),s.proseIndex=Dp(s.individuals),await gR(e,s),s}function Yu(e,t){return e?.attributes?.find(n=>n?.prop===Je)?.value||t||us()}function hn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Xu(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Fa}:${e.sessionId}`:Fa,type:"operator"};case"teach":return{id:e.sessionId?`${Iu}:${e.sessionId}`:Iu,type:"teach"};case"teachNode":return{id:`${Rg}:${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:${Gr(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 xR(e){return Mc[e]||null}function ER(e,t,n){let s=Xu(t);if(!s)return null;let o=Mt(e),r=o?o.individualsById.get(s.id):e.individuals.find(c=>c?.id===s.id),i=Yu(r,t?.createdAt||n),a={id:s.id,label:Ju(s.id),class:ar,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:Je,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=ds(e,a);return o&&o.sourcesById.set(s.id,l),s.id}function Wa(e){let t=Mt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===ar&&(n[s.id]=s);return n}function Yg(e,t){let n=Mt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===fn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function SR(e,t,n=Date.now(),s={}){let o=Yg(e,t.id),r=(t.attributes||[]).find(l=>l?.prop===Je)?.value||"",{score:i,inputs:a}=Xp({sourceIds:o,createdAt:r},Wa(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});hn(t,Oo,"trustScore",String(i)),hn(t,Ti,"trustInputs",JSON.stringify(a)),hn(t,vs,"updatedAt",new Date(n).toISOString())}function kR(e,t,n=Date.now(),s={}){let[o]=Yg(e,t.id),r=o?Wa(e)[o]:null,i=(r?.attributes||[]).find(c=>c?.prop==="mgx:sourceType")?.value||"",a=Ai(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===Je)?.value||"";hn(t,Oo,"trustScore",String(a)),hn(t,Ti,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:l})),hn(t,vs,"updatedAt",new Date(n).toISOString())}function Xg(e,t,n,s){t?.class===St?kR(e,t,n,s):SR(e,t,n,s)}function rr(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===Je)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Hn(i);if(!a)continue;let l=ER(e,a,r);l&&za(e,{predicate:"statedBy",prop:fn},{subject:t.id,object:l,subjectLabel:t.label,objectLabel:Ju(l)})}Xg(e,t,n,s)}function jR(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===fn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==St||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(rr(e,r,o),s=!0);s&&zn(e)}function RR(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=vt(e),n=new Set;for(let a of ib(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(!_R(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=Mt(e);for(let[a,l]of s){let c=o?o.individualsById.get(a):e.individuals.find(u=>u?.id===a);c&&(hn(c,_g,"sourceReliability",String(Qp(l))),hn(c,vs,"updatedAt",new Date().toISOString()))}let r=e.objectProperties.find(a=>a?.prop===fn),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&&Xg(e,l)}}function TR(e,t,n){if(!ya(n?.id))return n;let s=Xr(n.id);if(!s)return fu(t,n);let o=Wa(e);return fu(t,n,{priorFor:r=>Ai(s,o[r])})}function jg(e,t,n){return n?.class===on?ag(t,n):TR(e,t,n)}function ds(e,t){let n=Mt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,jg(e,o,t)),o.class===on&&Mu(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===on&&Mu(n.retractionsByGroup,t),t.class===St){let r=Pt(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]=jg(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function za(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===fn?Mt(e):null;if(r){let l=r.statedByBySubject.get(s.subject);if(!l||!l.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||us()}),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||us();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 zn(e){let t=[zu,Du,St,ar,cr];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 AR(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:zu,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Je,key:"createdAt",value:n||us()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Jg(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:l=""}){if(!U_.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=rs(n),d=`utt:${o}#${c}#${t}`,f=Ba(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),p=Ri({doc:u}),h=e.individuals.find(y=>y?.id===d),m=Yu(h,l||c),g={id:d,label:f,class:Du,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:Je,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(" ")}]:[]]};ds(e,g);let b=AR(e,o,r);if(za(e,{predicate:"saidInSession",prop:Uu},{subject:d,object:b,subjectLabel:f,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&za(e,{predicate:"inReplyTo",prop:Bu},{subject:d,object:a,subjectLabel:f,objectLabel:y.label})}return c&&c>String(e.generated_at||"")&&(e.generated_at=c),d}async function IR(e,t){let n;return await ps(e,s=>{n=Jg(s,t),zn(s)}),{id:n}}async function Qg(e,t){let n=[];return t?.length?(await ps(e,s=>{for(let o of t)n.push(Jg(s,o));zn(s)}),{ids:n}):{ids:n}}async function CR(e,t){t?.length&&await ps(e,n=>{for(let s of t)for(let o of uo(n,s.factId))za(n,{predicate:"canonicalisedFrom",prop:Wu},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function uo(e,t){let n=Mt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===St&&Pt(s.id)===t).map(s=>s.id)}function Zg(e,t,n,s=""){let o=Lg(n);if(o.length===1&&o[0].sourceId===ls&&uo(e,t).length)return[];let r=vR(e,t);if(r.length&&(o=o.filter(a=>!ka(r,`${t}@${a.sourceId}`,lr(a.tags,s))),!o.length))return o;let i=OR(e,t);return i.length?o.filter(a=>!sg(i,a.sourceId)):o}function OR(e,t){let n=Mt(e),s=n?n.factRecordsByGroup.get(t):uo(e,t),o=[];for(let r of s||[]){if(!Is(r))continue;let i=Cs(e,r);i&&o.push(i)}return o}function eb(e,t,{quantifier:n,environments:s}){let o=uo(e,t).map(i=>Cs(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===ai)),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)hn(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")||(hn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function LR(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===Da)?.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 tb(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=Mt(e),m=h?h.individualsById.get(p):e.individuals.find(R=>R?.id===p),g=R=>(m?.attributes||[]).find(j=>j?.prop===R)?.value||"",b=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:Ou(l.tags),observedAt:u},w=null,v=l.tags,_=y.assertedAt||c||us(),$=u,x=[],S=d;if(m){let R={assertedAt:Ou(b),observedAt:g(si)};V_(y,R)?(w={head:m,id:`${p}#v${LR(m)}`},x=[w.id]):(v=[...new Set([...b,...l.tags])],_=g(Je)||_,$=u||g(si),x=g(Da).split(" ").filter(Boolean)),S=d||g("mgx:factQuantifier")}return{candidate:{id:p,label:i,class:St,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:Je,key:"createdAt",value:_},{prop:lo,key:"sourceId",value:l.sourceId},...v.length?[{prop:"mgx:factProvenance",key:"provenance",value:v.join(" | ")}]:[],...$?[{prop:si,key:"observedAt",value:$}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...S?[{prop:"mgx:factQuantifier",key:"quantifier",value:S}]:[],...f?[{prop:"mgx:factJustification",key:"justification",value:f.map(R=>R.join(" ")).join(" | ")}]:[],...x.length?[{prop:Da,key:"supersedes",value:x.join(" ")}]:[]]},demote:w}}function NR(e,t){let n=`${t}@${ls}`,s=Mt(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 nb(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${ls}`)||NR(e,Pt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};hn(o,ai,"supersededBy",t.id),ds(e,o),s.push(o.id)}return ds(e,t),s.push(t.id),s}function Cs(e,t){let n=Mt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function Qu(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=Mt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Pt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function sb(e,t){let n=Mt(e),s=(n?n.factRecordsByGroup.get(t):uo(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=Cs(e,u);if(!d)continue;let f=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(Is(u)){i.set(Xr(u),d);continue}if(nr(u)){a.set(f(lo),d);continue}let p=f("mgx:factProvenance"),h=Cg(p),m=p.split(" | ").filter(Boolean),g={id:u,sourceId:f(lo)||h.id,assertedAt:lr(m,f(Je)),record:d};if(f(ai)){let y=r.get(g.sourceId);y?y.push(g):r.set(g.sourceId,[g]);continue}if(!h.type)continue;let b=o.get(h.type);b?b.push(g):o.set(h.type,[g])}let l=Wa(e),c=[];for(let[u,d]of o){let f=tg({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:p=>Ai(u,l[p])});if(f){ds(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=ng({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!f)continue;ds(e,f.rollup),c.push(...f.absorbed);let p=Cs(e,f.rewire);p&&hn(p,Da,"supersedes",f.rollup.id)}return c}async function PR(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",premiseTrusts:l,ruleConfidence:c}={}){let u=Q(t),d=is(n),f=Q(s);if(!u||!d||!f)throw new Error("a fact needs subject, predicate and object");let p=Ho(u,d,f),h=`${u} ${d} ${f}`,m=Ri({doc:h}),g=rs(a);return await ps(e,async b=>{let y=Zg(b,p,rs(o),r);for(let w of y.length?[]:eb(b,p,{quantifier:g}))rr(b,Cs(b,w),void 0,{premiseTrusts:l,ruleConfidence:c});for(let w of y){let v=tb(b,{groupId:p,s:u,p:d,o:f,label:Ba(h),tokens:m,group:w,createdAt:r,observedAt:i,quantifier:g});await Su(v.candidate);for(let _ of nb(b,v))rr(b,Cs(b,_),void 0,_===v.candidate.id?{premiseTrusts:l,ruleConfidence:c}:void 0)}Qu(b,sb(b,p)),zn(b)}),{id:p}}function MR(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 po(e,t){let n=[],s=0;for(let r of t||[]){let i=Q(r?.subject),a=is(r?.predicate),l=Q(r?.object);if(!i||!a||!l){s+=1;continue}let c=`${i} ${a} ${l}`;n.push({id:Ho(i,a,l),s:i,p:a,o:l,text:c,tokens:Ri({doc:c}),provenance:rs(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:rs(r?.quantifier),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:MR(r?.justification)})}let o=[];return n.length?(await ps(e,r=>{let i=[],a=new Set,l=new Map;for(let u of n){let d=Zg(r,u.id,u.provenance,u.createdAt);for(let f of d.length?[]:eb(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=tb(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Ba(u.text),tokens:u.tokens,group:f,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments});for(let h of nb(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)rr(r,Cs(r,u),void 0,l.get(u));let c=[];for(let u of new Set(o))c.push(...sb(r,u));Qu(r,c),zn(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function qa(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=ob[n];if(!i)throw new Error(`a rule kind must be one of ${FR.join(", ")}, got ${JSON.stringify(n)}`);let a=Q(t);if(!a)throw new Error("a rule needs a name");let l=DR[n]||new Set,c=i.map(([p])=>Q(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===ui){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=zR(n,a,c),f=Ba(`${a} = ${n}(${c.join(", ")})`);return await ps(e,async p=>{let h=p.individuals.find(w=>w?.id===d),m=h?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",g=[...new Set([...m.split(" | "),rs(o)].filter(Boolean))],b=Yu(h,r),y={id:d,label:f,class:cr,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Va,key:"ruleName",value:a},{prop:ur,key:"ruleKind",value:n},...i.map(([w,v],_)=>({prop:v,key:w,value:c[_],skip:!c[_]&&l.has(w)})).filter(w=>!w.skip).map(({skip:w,...v})=>v),{prop:Je,key:"createdAt",value:b},...g.length?[{prop:"mgx:factProvenance",key:"provenance",value:g.join(" | ")}]:[]]};await Su(y),ds(p,y),rr(p,p.individuals.find(w=>w?.id===d)),zn(p)}),{id:d}}function nd(e,t){let n=Q(t);return(e?.individuals||[]).find(s=>s?.class===cr&&(s.attributes||[]).find(o=>o?.prop===Va)?.value===n)}function UR(e,t){let n=Q(t),s=o=>(o.attributes||[]).find(r=>r?.prop===ur)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===cr&&(o.attributes||[]).find(r=>r?.prop===Va)?.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!==cr)continue;let s=a=>(n.attributes||[]).find(l=>l?.prop===a)?.value,o=s(ur),r=ob[o];if(!r)continue;let i={};for(let[a,l]of r)i[a]=s(l)??"";t.push({id:n.id,name:s(Va)||"",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 od(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(Q,n),m=l(Q,s),g=r(p).filter(w=>h.has(w.fact.subject)&&m.has(w.fact.object));if(g.length){let w=g.slice().sort((v,_)=>c(v.fact,_.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let b=nd(e,p),y=b?.attributes?.find(w=>w.prop===ur)?.value;if(b&&y===ci){let w=b.attributes.find(F=>F.prop==="mgx:ruleBase1")?.value,v=b.attributes.find(F=>F.prop==="mgx:ruleBase2")?.value,_=Q(n),$=Q(s);if(!w||!v||!_||!$)return null;let R=f({entity:_,hopsTaken:0},F=>F.hopsTaken===2&&F.entity===$,F=>{if(F.hopsTaken>=2)return[];let T=F.hopsTaken===0?w:v;return r(T).filter(M=>M.fact.subject===F.entity).map(M=>({action:M,nextState:{entity:M.fact.object,hopsTaken:F.hopsTaken+1}}))},{maxDepth:2,stateKey:F=>`${F.entity}#${F.hopsTaken}`});if(!R)return null;let j=new Set,A=[];for(let F of R.actions){A.push(i(F.fact));for(let T of F.aliasFacts){let M=T.id||`${T.subject}|${T.predicate}|${T.object}`;j.has(M)||(j.add(M),A.push(`${a(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{citation:A}}if(b&&y===li){let w=b.attributes.find(E=>E.prop==="mgx:ruleBase1")?.value,v=b.attributes.find(E=>E.prop==="mgx:ruleFilterProperty")?.value;if(!w||!v)return null;let _=await od(e,w,n,s,o);if(!_)return null;let $=Q(n),x=Q(v),S=u.find(E=>E.predicate===d&&E.subject===$&&Q(E.object)===x);return S?{citation:[..._.citation,i(S)]}:null}return null}async function rb(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(Q,n),h=o(f).filter(b=>p.has(b.fact.object));if(h.length){let b=new Map;for(let y of h)b.has(y.fact.subject)||b.set(y.fact.subject,[]),b.get(y.fact.subject).push(y);return[...b.entries()].map(([y,w])=>{let v=w.slice().sort((_,$)=>l(_.fact,$.fact))[0];return{subject:y,citation:[r(v.fact),...v.aliasFacts.map(_=>`${i(_)}${_.provenance?` (source: ${_.provenance})`:""}`)]}})}let m=nd(e,f),g=m?.attributes?.find(b=>b.prop===ur)?.value;if(m&&g===ci){let b=m.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,y=m.attributes.find(x=>x.prop==="mgx:ruleBase2")?.value,w=Q(n);return!b||!y||!w?[]:d({entity:w,hopsTaken:0},x=>{if(x.hopsTaken>=2)return[];let S=x.hopsTaken===0?y:b;return o(S).filter(E=>E.fact.object===x.entity).map(E=>({action:E,nextState:{entity:E.fact.subject,hopsTaken:x.hopsTaken+1}}))},{maxDepth:2,stateKey:x=>`${x.entity}#${x.hopsTaken}`}).filter(x=>x.node.hopsTaken===2).map(({node:x,path:S})=>{let E=new Set,R=[];for(let j of S.actions.slice().reverse()){R.push(r(j.fact));for(let A of j.aliasFacts){let F=A.id||`${A.subject}|${A.predicate}|${A.object}`;E.has(F)||(E.add(F),R.push(`${i(A)}${A.provenance?` (source: ${A.provenance})`:""}`))}}return{subject:x.entity,citation:R}})}if(m&&g===li){let b=m.attributes.find($=>$.prop==="mgx:ruleBase1")?.value,y=m.attributes.find($=>$.prop==="mgx:ruleFilterProperty")?.value;if(!b||!y)return[];let w=await rb(e,b,n,s),v=Q(y),_=[];for(let $ of w){let x=Q($.subject),S=c.find(E=>E.predicate===u&&E.subject===x&&Q(E.object)===v);S&&_.push({subject:$.subject,citation:[...$.citation,r(S)]})}return _}return[]}function vt(e,t={}){let n=rd(e),s=Dg(e),o=[];for(let[r,i]of n.groups){let a=id(r,i,n),l=s?.get(r);a.trust=Ii(l?l.inputs:a.assertions,t).score,o.push(a)}return o}function rd(e){let t=e?.individuals||[],n=new Map(t.filter(l=>l?.class===ar).map(l=>[l.id,l])),s=(e?.objectProperties||[]).find(l=>l?.prop===fn),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===on){let d=Pt(l.id),f=i.get(d);f?f.push(l):i.set(d,[l]);continue}if(l?.class!==St||(l.attributes||[]).some(d=>d?.prop===ai)||nr(l.id))continue;let c=Pt(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=>!ka(c,f.id,lr(Fn(f,"mgx:factProvenance").split(" | ").filter(Boolean),Fn(f,Je))));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=Lu(oi(c[0],"subject"),oi(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 id(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=Fn,i=oi,a=[],l=[],c=[],u=new Set,d=[],f=new Set,p="";for(let g of t){if(Is(g.id)){let x=Xr(g.id),S=$a(g);for(let E of S)l.includes(E)||(l.push(E),x&&c.push(x));a.push({id:g.id,sourceId:"",sourceType:x,provenance:"",createdAt:r(g,Nn),ownTrust:Number(r(g,tr))||0,assertedAt:r(g,Pn),rollup:{count:Number(r(g,Yr))||S.length,sourceIds:S,earliest:r(g,Nn),latest:r(g,Pn)}});continue}let b=r(g,"mgx:factProvenance").split(" | ").filter(Boolean);for(let x of b)u.add(x);let[y]=s.get(g.id)||[],w=y||r(g,lo),v=o(w);y&&!l.includes(y)&&(l.push(y),v&&c.push(v));let _=r(g,Je),$=r(g,si);a.push({id:g.id,sourceId:w,sourceType:v,provenance:b.join(" | "),createdAt:_,...$?{observedAt:$}:{},ownTrust:Number(r(g,Oo))||0,assertedAt:lr(b,_)}),p=p||i(g,"quantifier");for(let x of i(g,"justification").split(" | ")){let S=x.split(" ").filter(Boolean);if(!S.length)continue;let E=S.join(" ");f.has(E)||(f.add(E),d.push(S))}}let h=[],m=new Set;for(let g of d)for(let b of g)m.has(b)||(m.add(b),h.push(b));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:p,sourceIds:l,sourceTypes:c,environments:d,justification:h,assertions:a}}function BR(e){let t=Fn(e,lo);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 WR(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||us();return await ps(e,l=>{let c=new Set,u=new Set,d=new Map;l.individuals=(l.individuals||[]).filter(f=>{if(f?.class!==St)return!0;let p=Pt(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=BR(f),g=`${p}\0${m}`,b=Fn(f,"mgx:factProvenance"),y=d.get(g);return y?(y.ids.push(f.id),b&&y.tags.push(b)):d.set(g,{groupId:p,sourceId:m,ids:[f.id],tags:b?[b]:[],template:{label:f.label||"",subject:Fn(f,"rdf:subject"),predicate:Fn(f,"rdf:predicate"),object:Fn(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=ig({groupId:f.groupId,sourceId:f.sourceId,recordIds:f.ids,retractedAt:a,template:f.template,provenance:[...f.tags,n].filter(Boolean).join(" | ")});p&&ds(l,p)}zn(l)}}),{removed:r,records:i}}function GR(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==on)continue;let s=ja(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function VR(e,t){let n=[];for(let o of t||[]){let r=_a(o);r&&n.push(r)}let s=[];return n.length?(await ps(e,o=>{let r=new Map;for(let a of n){let l=ds(o,a),c=Pt(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 uo(o,a)){let u=Cs(o,c);if(!u)continue;let d=Fn(u,"mgx:factProvenance").split(" | ").filter(Boolean);ka(l,c,lr(d,Fn(u,Je)))&&i.add(c)}if(i.size){Qu(o,i);for(let a of i)s.push(a)}zn(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function qR(e,{self:t="",acknowledgedBy:n=null}={}){let s=Ra(vt(e)),o=[];for(let r of e?.individuals||[])r?.class===on&&r.id&&o.push(r.id);return{roster:s,retirable:Ta({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function HR(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await ps(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==on||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Mt(o);if(i)for(let a of r){i.individualsById.delete(a);let l=Pt(a),c=(i.retractionsByGroup.get(l)||[]).filter(u=>!r.has(u.id));c.length?i.retractionsByGroup.set(l,c):i.retractionsByGroup.delete(l)}zn(o)}),{retired:s}):{retired:s}}function ib(e,{floor:t=KR}={}){let n=vt(e).filter(r=>r.trust>=t),s=new Map;for(let r of n){if(ga(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=ga(r[0].predicate);i!==ru&&!au(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 ir,Fu,Du,St,zu,ar,cr,Uu,Bu,z_,fn,Wu,_g,Fa,Iu,Rg,U_,Sg,B_,Cu,Gu,Tg,W_,ls,si,lo,Da,ai,Pg,Fn,oi,Lu,Mg,Dg,K_,Z_,kg,kn,Vg,Nu,dR,Au,fR,Hu,qg,Ku,Hg,Pu,Mt,Ba,us,Ju,_R,ci,li,Zu,ed,Ga,ui,td,FR,Va,ur,ob,DR,zR,KR,dr,YR,XR,Ve=O(()=>{_t();Ue();$s();sn();sn();Kn();Vm();Kn();ma();hu();$u();Eu();dg();hu();$u();Eu();ir=J(".tmct","memory"),Fu=J(ir,"graph.json"),Du="Utterance",St="Fact",zu="Session",ar="Source",cr="Rule",Uu="mgx:saidInSession",Bu="mgx:inReplyTo",z_="mgx:derivedFrom",fn="mgx:statedBy",Wu="mgx:canonicalisedFrom",_g="mgx:sourceReliability",Fa="src:operator-chat",Iu="src:teach-chat",Rg="src:teach-node",U_=new Set(["visitor","tmct"]),Sg=48,B_=[{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:Uu,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:Bu,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:Je,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:vs,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:z_,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:fn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:Wu,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:Oo,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:Ti,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:Xo,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)"}];Cu=e=>ni(e),Gu="memory",Tg="sqlite";W_=`
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,85 +143,85 @@ CREATE TABLE IF NOT EXISTS fact_object_supersessions (
143
143
  recorded_at TEXT NOT NULL,
144
144
  PRIMARY KEY (subject, predicate, ord)
145
145
  );
146
- `,cs="src:none",si="mgx:observedAt",co="mgx:sourceId",Pa="mgx:supersedes",ii="mgx:supersededBy";Tg="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";Mn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",oi=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",Au=(e,t)=>`${e}\0${t}`;Ag=Symbol("materialised fact_heads index");Cg=e=>e?.[Ag]||null,F_="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";W_=new Set(["subject","object","subjectLabel","objectLabel"]),$g=!1;Sn=e=>e===void 0?e:structuredClone(e);Dg=Q(ir,"manifest.json"),Iu=5,Z_=e=>Q(e,Dg);ju=e=>sR(nR(e)),tR=/^fact:[0-9a-f]{8}$/;Bu=Q(ir,"syllogise-state.json"),zg="syllogiseState";Wu=Q(ir,"node-id.json"),Ug="nodeId";Cu=Symbol("mutateMemory lookup index");Mt=e=>e?.[Cu]||null;za=e=>e.length>yg?e.slice(0,yg-1)+"\u2026":e,ls=()=>new Date().toISOString();Vu=e=>String(e).replace(/^src:/,"");hR=e=>typeof e=="string"&&(e.startsWith(`${Na}:`)||e.startsWith(`${_u}:`)||e.startsWith(`${Eg}:`));ai="compose2",ci="filter",Ku="recursive",Yu="action-signature",Ba="action-precond",li="action-effect",Xu="action-constraint",jR=Object.freeze([ai,ci,Ku,Yu,Ba,li,Xu]),Wa="mgx:ruleName",ur="mgx:ruleKind",Qg={[ai]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[ci]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Ku]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[Yu]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Ba]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[li]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[Xu]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},_R={[Ba]:new Set(["value","negate"]),[li]:new Set(["objectRole","value"])},RR=(e,t,n)=>`rule:${Gr([e,t,...n].join("\0"))}`;PR=.5,dr="mgx:hasA",MR="mgx:capableOf",FR=nu});async function mn(e,t=null){try{if(t)return vt(await Pt(t));let{dir:n,close:s}=await Cs(ve(ve(e.graphFile)));try{return vt(await Pt(n))}finally{await s()}}catch{return[]}}function nb(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 qa(e,t){let n=J(t),s=e.filter(a=>tb.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,po),i=o.length>po?`
147
- \u2026+${o.length-po} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
146
+ `,ls="src:none",si="mgx:observedAt",lo="mgx:sourceId",Da="mgx:supersedes",ai="mgx:supersededBy";Pg="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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";Fn=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",oi=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",Lu=(e,t)=>`${e}\0${t}`;Mg=Symbol("materialised fact_heads index");Dg=e=>e?.[Mg]||null,K_="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";Z_=new Set(["subject","object","subjectLabel","objectLabel"]),kg=!1;kn=e=>e===void 0?e:structuredClone(e);Vg=J(ir,"manifest.json"),Nu=5,dR=e=>J(e,Vg);Au=e=>mR(hR(e)),fR=/^fact:[0-9a-f]{8}$/;Hu=J(ir,"syllogise-state.json"),qg="syllogiseState";Ku=J(ir,"node-id.json"),Hg="nodeId";Pu=Symbol("mutateMemory lookup index");Mt=e=>e?.[Pu]||null;Ba=e=>e.length>Sg?e.slice(0,Sg-1)+"\u2026":e,us=()=>new Date().toISOString();Ju=e=>String(e).replace(/^src:/,"");_R=e=>typeof e=="string"&&(e.startsWith(`${Fa}:`)||e.startsWith(`${Iu}:`)||e.startsWith(`${Rg}:`));ci="compose2",li="filter",Zu="recursive",ed="action-signature",Ga="action-precond",ui="action-effect",td="action-constraint",FR=Object.freeze([ci,li,Zu,ed,Ga,ui,td]),Va="mgx:ruleName",ur="mgx:ruleKind",ob={[ci]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[li]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[Zu]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[ed]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Ga]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[ui]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[td]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},DR={[Ga]:new Set(["value","negate"]),[ui]:new Set(["objectRole","value"])},zR=(e,t,n)=>`rule:${Gr([e,t,...n].join("\0"))}`;KR=.5,dr="mgx:hasA",YR="mgx:capableOf",XR=iu});async function mn(e,t=null){try{if(t)return vt(await Ct(t));let{dir:n,close:s}=await Ls($e($e(e.graphFile)));try{return vt(await Ct(n))}finally{await s()}}catch{return[]}}function cb(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 Ha(e,t){let n=Q(t),s=e.filter(a=>ab.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,fo),i=o.length>fo?`
147
+ \u2026+${o.length-fo} 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
- (${nb(s)})`}function Va(e,t){let n=J(t),s=e.filter(a=>tb.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,po).join(", ")}`),r.length){let a=r.length>po?`, +${r.length-po} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,po).join(", ")}${a}`)}return i.push(`(${nb(s)})`),i.join(`
151
- `)}var tb,po,fo=O(()=>{Ue();qe();tb=new Set(["rdfs:subClassOf","rdf:type"]),po=40});async function sb(e,{graph:t,svc:n,config:s}){let o=nt(e,"symbol"),{match:r,candidates:i}=tn(n.graph,o);if(r)return Gc(t,r,{candidates:i});let a=Va(await mn(s),o);if(a)return a;xt(n,o,"symbol")}var ob=O(()=>{Oe();fo();Ge()});async function rb(e,{graph:t,svc:n,repoRoot:s}){let o=nt(e,"symbol"),{match:r,candidates:i}=xt(n,o,"symbol"),a=Rt(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 ss({readFile:ze,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Wr})}catch(g){throw g instanceof Re?g:new Re(`could not read ${a.path} (${g?.code||g?.message||g})`)}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 ${Wr} lines; full span ${d})`:"",m=i.length?`
153
- (other matches: ${i.map(g=>g.label).join(", ")})`:"",h=Hc(t,r);return`${f}
154
- ${c}${p}${h?`
155
- ${h}`:""}${m}`}var ib=O(()=>{_t();Bt();na();Oe();Ge()});var ab,cb=O(()=>{Oe();Ge();ab=rt(Ef)});function lb(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"module"),"module");return pf(t,s)}var ub=O(()=>{Oe();Ge()});async function db(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=vf(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=Va(await mn(n),s);if(i)return i}return r}var pb=O(()=>{Bt();Oe();fo()});async function fb(e,{graph:t,svc:n,config:s}){let o=nt(e,"class"),{match:r}=tn(n.graph,o);if(r)return xf(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=qa(await mn(s),o);if(i)return i;xt(n,o,"class")}var mb=O(()=>{Oe();fo();Ge()});async function hb(e,{graph:t,svc:n,config:s}){let o=nt(e,"class"),{match:r}=tn(n.graph,o);if(r)return Sf(t,r);let i=qa(await mn(s),o);if(i)return i;xt(n,o,"class")}var gb=O(()=>{Oe();fo();Ge()});function UR(e,{conceptBase:t="concept:",relationMap:n=zR}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=g=>{r.has(g)||r.set(g,g)},a=g=>{let b=g;for(;r.get(b)!==b;)b=r.get(b);for(;r.get(g)!==b;){let y=r.get(g);r.set(g,b),g=y}return b},l=(g,b)=>{let y=a(g),w=a(b);y!==w&&(y<w?r.set(w,y):r.set(y,w))},c=[];for(let g of e){let b=g.predicate;if(!s.has(b)&&!o.has(b))continue;let y=J(g.subject),w=J(g.object);!y||!w||(i(y),i(w),s.has(b)?l(y,w):c.push({s:y,o:w}))}let u=g=>t+g.replace(/ /g,"_"),d=new Map;for(let g of r.keys()){let b=a(g);d.has(b)||d.set(b,new Set),d.get(b).add(g)}let f=[];for(let[g,b]of d){let y=[...b].sort();f.push({id:u(g),prefLabel:g,altLabels:y.filter(w=>w!==g)})}f.sort((g,b)=>g.id<b.id?-1:g.id>b.id?1:0);let p=new Set,m=[];for(let{s:g,o:b}of c){let y=u(a(g)),w=u(a(b));if(y===w)continue;let v=y<w?`${y}\0${w}`:`${w}\0${y}`;p.has(v)||(p.add(v),m.push({subject:y,object:w}))}return m.sort((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:f,related:m,conceptIdForTerm:g=>{let b=J(g);return r.has(b)?u(a(b)):null},namespace:DR}}function nd(e,t,n={}){let s=UR(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=J(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 DR,zR,sd=O(()=>{nn();DR="http://www.w3.org/2004/02/skos/core#",zR={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function od(e,{config:t,memoryBackend:n=null}){let s=nt(e,"term"),o=nd(await mn(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)"),_s({content:r.join(`
156
- `),data:o})}var bb=O(()=>{Bt();sd();fo();Ge();od.ownsGraphLoad=!0});function tT(e,t){let n=[];for(let s of t||[])s?.predicate===BR&&J(s.subject)===e&&n.push(J(s.object));return n}function Ha(e,t){let n=J(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 tT(i,t))s.has(a)||o.push(a)}}return r}var BR,WR,GR,qR,VR,HR,KR,YR,XR,JR,QR,ZR,eT,wb,rd=O(()=>{nn();BR="rdfs:subClassOf",WR='<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>',GR='<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>',qR='<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>',VR='<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>',HR='<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>',KR='<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>',YR='<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>',XR='<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>',JR='<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>',QR='<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>',ZR='<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>',eT='<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>',wb=Object.freeze({spider:WR,fly:GR,egg:qR,poodle:VR,dog:HR,animal:KR,room:YR,furniture:XR,portable:JR,person:QR,adventurer:ZR,container:eT})});function nT(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function yb(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 nT(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var $b=O(()=>{});function sT(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function oT(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function Eb(e){return oT(e).filter(t=>t?.property&&t.value!==void 0)}function rT(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function iT(e,t){let n=null,s=0;for(let o of e){let r=Eb(o);r.length<=s||rT(r,t)&&(n=o,s=r.length)}return n}function aT(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 vb(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=aT(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function cT(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 lT(e,t){let n=t;for(let s of cT(e))n=n.split(s).join("");return n}function xb(e,t,n){let s=sT(e,n),o=iT(s,t);if(o&&!o.parameters)return o.svg;if(o)return lT(o,vb(o,t)||o.svg);for(let i of s){if(i.match||!i.parameters)continue;let a=vb(i,t);if(a)return a}let r=s.find(i=>!i.match&&!i.parameters);return r?r.svg:null}function uT(e,t,n,s,o,r){for(let a of Ha(e,t)){let l=xb(a,n,s);if(l)return l;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=xb(r,n,s);return i||o[r]}function Sb(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=uT(e,t,n,s,o,r);return i?yb(a,i):a}var H1,K1,id=O(()=>{rd();$b();H1=Object.freeze(["left","half-left","half-right","right"]),K1=Object.freeze(["moving"])});function ad(e){for(let t of e||[])if(t?.predicate===dT&&Object.prototype.hasOwnProperty.call(kb,t.object))return kb[t.object];return 1}var dT,kb,jb=O(()=>{dT="mgx:hasProperty",kb=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function _b(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,m=a.sizeScaleFor,h=a.expressionPalette,g=[];r&&g.push({predicate:n,object:r}),i&&g.push({predicate:s,object:i});let b={rootFallback:f};a.instanceKey&&(b.instanceKey=a.instanceKey);let y=l(o,d,g,c,u,b),w=R=>l(R,[],g,c,{},{rootFallback:R}),v=R=>Object.prototype.hasOwnProperty.call(u,R),_=(R,j)=>{let A=c.filter(M=>M&&Array.isArray(M.classes)&&M.classes.indexOf(R)>=0),T=A.find(M=>M.svg===j)||A.find(M=>!M.match&&M.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 j=w(R);if($.push({term:R,template:!!j,registry:v(R)}),j){x={term:R,via:"template",hops:$.length-1,root:!1,template:_(R,j)};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?_(f,R):null}}}let S=a.instanceKey?l(o,d,g,c,u,{rootFallback:f}):y,E=r?l(o,d,g.filter(R=>R.predicate!==n),c,u,{rootFallback:f}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof m=="function"?m(g):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?S!==E:null,rootFallback:f,fellBackToRoot:x?!!x.root:null,chain:$,matched:x}}var Rb=O(()=>{});var Tb,Ab,pT,Z1,Ib=O(()=>{id();Tb="icon tier",Ab="sprite tier",pT=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."})}),Z1=Object.freeze(Object.values(pT).map(e=>e.predicate))});var Cb,Ob=O(()=>{Cb=()=>[]});var Lb,Nb=O(()=>{Lb=()=>[]});function gT(){let e=Lb();return e.length?{templates:e,tier:Ab}:{templates:Cb(),tier:Tb}}function Pb(e){return e.map(t=>t.term).join(" -> ")}async function cd(e,{config:t,memoryBackend:n=null}){let s=nt(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(To,o))throw new Re(`"${o}" is not a sprite expression. The palette holds: ${mT().join(", ")}.`);if(r&&!hT(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}=gT(),l=await mn(t,n),c=_b({class:s,expression:o,size:r},{factRows:l,templates:i,spriteRegistry:wb,resolveSpriteAsset:Sb,classAncestorChain:Ha,sizeScaleFor:ad,expressionPalette:To});if(!c.svg||c.fellBackToRoot)throw new Re(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${Pb(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: ${Pb(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`),_s({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 fT,mT,hT,Mb=O(()=>{Bt();rd();id();Rc();jb();Rb();Ib();Ob();Nb();fo();Ge();fT="mgx:hasProperty",mT=()=>Object.keys(To).sort(),hT=e=>!!e&&ad([{predicate:fT,object:String(e)}])!==1;cd.ownsGraphLoad=!0});function Fb(e,{graph:t}){return kf(t,{pkg:String(e?.package||"").trim()})}var Db=O(()=>{Oe()});function zb(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"module"),"module");return Vf(t,s)}var Ub=O(()=>{Oe();Ge()});function Bb(e,{graph:t}){return Rf(t)}var Wb=O(()=>{Oe()});function qb(e,{graph:t}){let{content:n,tmct_ask:s}=Ss(t,nt(e,"query"));return _s({content:n,data:s,text:`${n}${Gb}${JSON.stringify(s,null,2)}`})}var Gb,ld=O(()=>{ks();Ge();Gb=`
150
+ (${cb(s)})`}function Ka(e,t){let n=Q(t),s=e.filter(a=>ab.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,fo).join(", ")}`),r.length){let a=r.length>fo?`, +${r.length-fo} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,fo).join(", ")}${a}`)}return i.push(`(${cb(s)})`),i.join(`
151
+ `)}var ab,fo,ho=O(()=>{Ue();Ve();ab=new Set(["rdfs:subClassOf","rdf:type"]),fo=40});async function lb(e,{graph:t,svc:n,config:s}){let o=nt(e,"symbol"),{match:r,candidates:i}=nn(n.graph,o);if(r)return Kc(t,r,{candidates:i});let a=Ka(await mn(s),o);if(a)return a;xt(n,o,"symbol")}var ub=O(()=>{Oe();ho();Ge()});async function db(e,{graph:t,svc:n,repoRoot:s}){let o=nt(e,"symbol"),{match:r,candidates:i}=xt(n,o,"symbol"),a=Rt(r);if(!a)throw new _e(`"${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 os({readFile:ze,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Wr})}catch(g){throw g instanceof _e?g:new _e(`could not read ${a.path} (${g?.code||g?.message||g})`)}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 ${Wr} lines; full span ${d})`:"",h=i.length?`
153
+ (other matches: ${i.map(g=>g.label).join(", ")})`:"",m=Jc(t,r);return`${f}
154
+ ${c}${p}${m?`
155
+ ${m}`:""}${h}`}var pb=O(()=>{_t();Ut();oa();Oe();Ge()});var fb,hb=O(()=>{Oe();Ge();fb=rt(_f)});function mb(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"module"),"module");return gf(t,s)}var gb=O(()=>{Oe();Ge()});async function bb(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new _e("query is required");let r=kf(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=Ka(await mn(n),s);if(i)return i}return r}var wb=O(()=>{Ut();Oe();ho()});async function yb(e,{graph:t,svc:n,config:s}){let o=nt(e,"class"),{match:r}=nn(n.graph,o);if(r)return jf(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Ha(await mn(s),o);if(i)return i;xt(n,o,"class")}var $b=O(()=>{Oe();ho();Ge()});async function vb(e,{graph:t,svc:n,config:s}){let o=nt(e,"class"),{match:r}=nn(n.graph,o);if(r)return Rf(t,r);let i=Ha(await mn(s),o);if(i)return i;xt(n,o,"class")}var xb=O(()=>{Oe();ho();Ge()});function ZR(e,{conceptBase:t="concept:",relationMap:n=QR}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=g=>{r.has(g)||r.set(g,g)},a=g=>{let b=g;for(;r.get(b)!==b;)b=r.get(b);for(;r.get(g)!==b;){let y=r.get(g);r.set(g,b),g=y}return b},l=(g,b)=>{let y=a(g),w=a(b);y!==w&&(y<w?r.set(w,y):r.set(y,w))},c=[];for(let g of e){let b=g.predicate;if(!s.has(b)&&!o.has(b))continue;let y=Q(g.subject),w=Q(g.object);!y||!w||(i(y),i(w),s.has(b)?l(y,w):c.push({s:y,o:w}))}let u=g=>t+g.replace(/ /g,"_"),d=new Map;for(let g of r.keys()){let b=a(g);d.has(b)||d.set(b,new Set),d.get(b).add(g)}let f=[];for(let[g,b]of d){let y=[...b].sort();f.push({id:u(g),prefLabel:g,altLabels:y.filter(w=>w!==g)})}f.sort((g,b)=>g.id<b.id?-1:g.id>b.id?1:0);let p=new Set,h=[];for(let{s:g,o:b}of c){let y=u(a(g)),w=u(a(b));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((g,b)=>`${g.subject}${g.object}`<`${b.subject}${b.object}`?-1:1),{concepts:f,related:h,conceptIdForTerm:g=>{let b=Q(g);return r.has(b)?u(a(b)):null},namespace:JR}}function ad(e,t,n={}){let s=ZR(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=Q(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 JR,QR,cd=O(()=>{sn();JR="http://www.w3.org/2004/02/skos/core#",QR={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function ld(e,{config:t,memoryBackend:n=null}){let s=nt(e,"term"),o=ad(await mn(t,n),s);if(!o)throw new _e(`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)"),Ts({content:r.join(`
156
+ `),data:o})}var Eb=O(()=>{Ut();cd();ho();Ge();ld.ownsGraphLoad=!0});function fT(e,t){let n=[];for(let s of t||[])s?.predicate===eT&&Q(s.subject)===e&&n.push(Q(s.object));return n}function Ya(e,t){let n=Q(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 fT(i,t))s.has(a)||o.push(a)}}return r}var eT,tT,nT,sT,oT,rT,iT,aT,cT,lT,uT,dT,pT,Sb,ud=O(()=>{sn();eT="rdfs:subClassOf",tT='<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>',nT='<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>',sT='<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>',oT='<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>',rT='<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>',iT='<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>',aT='<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>',cT='<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>',lT='<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>',uT='<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>',dT='<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>',pT='<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>',Sb=Object.freeze({spider:tT,fly:nT,egg:sT,poodle:oT,dog:rT,animal:iT,room:aT,furniture:cT,portable:lT,person:uT,adventurer:dT,container:pT})});function hT(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function kb(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 hT(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var jb=O(()=>{});function mT(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function gT(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function Ab(e){return gT(e).filter(t=>t?.property&&t.value!==void 0)}function bT(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function wT(e,t){let n=null,s=0;for(let o of e){let r=Ab(o);r.length<=s||bT(r,t)&&(n=o,s=r.length)}return n}function yT(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 _b(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=yT(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function $T(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 Rb(e,t){let n=t;for(let s of $T(e))n=n.split(s).join("");return n}function Tb(e,t,n){let s=mT(e,n),o=wT(s,t);if(o&&!o.parameters)return o.svg;if(o)return Rb(o,_b(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let l=_b(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?Rb(i,i.svg):null}function vT(e,t,n,s,o,r){for(let a of Ya(e,t)){let l=Tb(a,n,s);if(l)return l;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=Tb(r,n,s);return i||o[r]}function Ib(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=vT(e,t,n,s,o,r);return i?kb(a,i):a}var aP,cP,dd=O(()=>{ud();jb();aP=Object.freeze(["left","half-left","half-right","right"]),cP=Object.freeze(["moving"])});function pd(e){for(let t of e||[])if(t?.predicate===xT&&Object.prototype.hasOwnProperty.call(Cb,t.object))return Cb[t.object];return 1}var xT,Cb,Ob=O(()=>{xT="mgx:hasProperty",Cb=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function Lb(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,g=[];r&&g.push({predicate:n,object:r}),i&&g.push({predicate:s,object:i});let b={rootFallback:f};a.instanceKey&&(b.instanceKey=a.instanceKey);let y=l(o,d,g,c,u,b),w=R=>l(R,[],g,c,{},{rootFallback:R}),v=R=>Object.prototype.hasOwnProperty.call(u,R),_=(R,j)=>{let A=c.filter(M=>M&&Array.isArray(M.classes)&&M.classes.indexOf(R)>=0),T=A.find(M=>M.svg===j)||A.find(M=>!M.match&&M.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 j=w(R);if($.push({term:R,template:!!j,registry:v(R)}),j){x={term:R,via:"template",hops:$.length-1,root:!1,template:_(R,j)};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?_(f,R):null}}}let S=a.instanceKey?l(o,d,g,c,u,{rootFallback:f}):y,E=r?l(o,d,g.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(g):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?S!==E:null,rootFallback:f,fellBackToRoot:x?!!x.root:null,chain:$,matched:x}}var Nb=O(()=>{});var Pb,Mb,ET,fP,Fb=O(()=>{dd();Pb="icon tier",Mb="sprite tier",ET=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."})}),fP=Object.freeze(Object.values(ET).map(e=>e.predicate))});var Db,zb=O(()=>{Db=()=>[]});var Ub,Bb=O(()=>{Ub=()=>[]});function _T(){let e=Ub();return e.length?{templates:e,tier:Mb}:{templates:Db(),tier:Pb}}function Wb(e){return e.map(t=>t.term).join(" -> ")}async function fd(e,{config:t,memoryBackend:n=null}){let s=nt(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(To,o))throw new _e(`"${o}" is not a sprite expression. The palette holds: ${kT().join(", ")}.`);if(r&&!jT(r))throw new _e(`"${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}=_T(),l=await mn(t,n),c=Lb({class:s,expression:o,size:r},{factRows:l,templates:i,spriteRegistry:Sb,resolveSpriteAsset:Ib,classAncestorChain:Ya,sizeScaleFor:pd,expressionPalette:To});if(!c.svg||c.fellBackToRoot)throw new _e(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${Wb(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 _e(`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: ${Wb(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`),Ts({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 ST,kT,jT,Gb=O(()=>{Ut();ud();dd();Cc();Ob();Nb();Fb();zb();Bb();ho();Ge();ST="mgx:hasProperty",kT=()=>Object.keys(To).sort(),jT=e=>!!e&&pd([{predicate:ST,object:String(e)}])!==1;fd.ownsGraphLoad=!0});function Vb(e,{graph:t}){return Tf(t,{pkg:String(e?.package||"").trim()})}var qb=O(()=>{Oe()});function Hb(e,{graph:t,svc:n}){let{match:s}=xt(n,nt(e,"module"),"module");return Xf(t,s)}var Kb=O(()=>{Oe();Ge()});function Yb(e,{graph:t}){return Cf(t)}var Xb=O(()=>{Oe()});function Qb(e,t){return Ts({content:e,data:t,text:`${e}${Jb}${JSON.stringify(t,null,2)}`})}function Zb(e,{graph:t}){let{content:n,tmct_ask:s}=js(t,nt(e,"query"));return Qb(n,s)}var Jb,Xa=O(()=>{_s();Ge();Jb=`
158
158
 
159
159
  ---tmct_ask---
160
- `});var Vb,Hb=O(()=>{Oe();Ge();Vb=rt(_f)});var Kb,Yb=O(()=>{Oe();Ge();Kb=rt(Tf)});var Xb,Jb=O(()=>{Oe();Ge();Xb=rt(Pf)});var Qb,Zb=O(()=>{Oe();Ge();Qb=rt(Ff)});var ew,tw=O(()=>{Oe();Ge();ew=rt(Df)});var nw,sw=O(()=>{Oe();Ge();nw=rt(If)});var ow,rw=O(()=>{Oe();Ge();ow=rt(Cf)});var iw,aw=O(()=>{Oe();Ge();iw=rt(Lf)});var cw,lw=O(()=>{Oe();Ge();cw=rt(qf)});function bT(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function wT(e){let t=(e||[]).map(bT);return t.map(n=>JSON.stringify(n)).join(`
160
+ `});var ew,tw=O(()=>{Oe();Ge();ew=rt(If)});var nw,sw=O(()=>{Oe();Ge();nw=rt(Of)});var ow,rw=O(()=>{Oe();Ge();ow=rt(zf)});var iw,aw=O(()=>{Oe();Ge();iw=rt(Bf)});var cw,lw=O(()=>{Oe();Ge();cw=rt(Wf)});var uw,dw=O(()=>{Oe();Ge();uw=rt(Nf)});var pw,fw=O(()=>{Oe();Ge();pw=rt(Pf)});var hw,mw=O(()=>{Oe();Ge();hw=rt(Ff)});var gw,bw=O(()=>{Oe();Ge();gw=rt(Yf)});function RT(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function TT(e){let t=(e||[]).map(RT);return t.map(n=>JSON.stringify(n)).join(`
161
161
  `)+(t.length?`
162
- `:"")}function uw(e){return wT(vt(e))}var dw=O(()=>{qe()});async function ud(e,{config:t,memoryBackend:n=null}){let s=n?null:await Cs(ve(ve(t.graphFile))),o=n||s.dir;try{return uw(await Pt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var pw=O(()=>{dw();Ue();qe();ud.ownsGraphLoad=!0});async function dd(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 Cs(ve(ve(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 _s({content:l?`${c}
162
+ `:"")}function ww(e){return TT(vt(e))}var yw=O(()=>{Ve()});async function hd(e,{config:t,memoryBackend:n=null}){let s=n?null:await Ls($e($e(t.graphFile))),o=n||s.dir;try{return ww(await Ct(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var $w=O(()=>{yw();Ue();Ve();hd.ownsGraphLoad=!0});async function md(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 Ls($e($e(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 Ts({content:l?`${c}
163
163
  ${a.canonical.join(`
164
- `)}`:c,data:{...a,grounded:l}})}finally{await i()}}var fw=O(()=>{Ue();qe();Ge();dd.ownsGraphLoad=!0});var yT,mw=O(()=>{Ml();wh();ob();ib();cb();ub();pb();mb();gb();bb();Mb();Db();Ub();Wb();ld();Hb();Yb();Jb();Zb();tw();sw();rw();aw();lw();pw();fw();yT=Object.freeze({tmct_context:Pl,tmct_context_more:bh,tmct_describe:sb,tmct_snippet:rb,tmct_signature:ab,tmct_impact:lb,tmct_search:db,tmct_members:fb,tmct_subclasses:hb,tmct_related:od,tmct_sprite:cd,tmct_architecture:Fb,tmct_exports:zb,tmct_untested:Bb,tmct_ask:qb,tmct_tests_for:Vb,tmct_history:Kb,tmct_file_history:Xb,tmct_method_history:Qb,tmct_class_history:ew,tmct_callers:nw,tmct_callees:ow,tmct_calls:iw,tmct_cochanges:cw,tmct_export:ud,tmct_ingest:dd})});var pd=O(()=>{});var Ka,fd=O(()=>{Ka=()=>({relations:[],constructions:[]})});var hw,gw=O(()=>{_t();Ue();Ap();Bt();_r();ks();ra();ia();mw();Ge();zo();Vi();pd();fd();ia();Ml();ld();Hi(void 0);qi(Ka);hw=Tp.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var tF,nF,sF,Ya=O(()=>{tF=Object.freeze(["entity","set","event","measure"]),nF=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),sF=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 pt,rF,iF,aF,cF,lF,uF,dF,pF,fF,mF,hF,gF,bF,wF,yF,$F,$T,vF,xF,bw=O(()=>{pt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},rF=pt("createRequire"),iF=pt("readFileSync"),aF=pt("access"),cF=pt("readFile"),lF=pt("writeFile"),uF=pt("appendFile"),dF=pt("mkdir"),pF=pt("mkdtemp"),fF=pt("rename"),mF=pt("unlink"),hF=pt("rm"),gF=pt("stat"),bF=pt("copyFile"),wF=pt("readdir"),yF=pt("createReadStream"),$F=pt("createWriteStream"),$T=pt("randomBytes"),vF=pt("spawnSync"),xF=pt("createInterface")});var Xa=O(()=>{bw()});var ft,jF,_F,RF,TF,AF,IF,CF,OF,LF,NF,PF,MF,FF,DF,zF,UF,Kt,BF,WF,GF,Ls=O(()=>{ft=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},jF=ft("createRequire"),_F=ft("readFileSync"),RF=ft("access"),TF=ft("readFile"),AF=ft("writeFile"),IF=ft("appendFile"),CF=ft("mkdir"),OF=ft("mkdtemp"),LF=ft("rename"),NF=ft("unlink"),PF=ft("rm"),MF=ft("stat"),FF=ft("copyFile"),DF=ft("readdir"),zF=ft("createReadStream"),UF=ft("createWriteStream"),Kt=e=>String(e),BF=ft("randomBytes"),WF=ft("spawnSync"),GF=ft("createInterface")});var vT,ww,YF,XF,JF,hd=O(()=>{_t();Ls();Ue();vT={},ww=Q(ve(Kt(vT.url)),"..","..",".."),YF=Q(ww,"data","templates","responses.jsonl"),XF=Q(ww,"data","phrasebook","software-phrases.txt"),JF=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]))});function ET(e,t={}){let n=xT.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function ST(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>ET(s,t))):1}function Ze(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:ST(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 xT,yw=O(()=>{xT=/^src:corpus:(.+)$/});var mt,eD,pr,tD,nD,sD,oD,rD,iD,aD,cD,lD,uD,dD,pD,kT,jT,fD,mD,hD,mo=O(()=>{mt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},eD=mt("createRequire"),pr=mt("readFileSync"),tD=mt("access"),nD=mt("readFile"),sD=mt("writeFile"),oD=mt("appendFile"),rD=mt("mkdir"),iD=mt("mkdtemp"),aD=mt("rename"),cD=mt("unlink"),lD=mt("rm"),uD=mt("stat"),dD=mt("copyFile"),pD=mt("readdir"),kT=mt("createReadStream"),jT=mt("createWriteStream"),fD=mt("randomBytes"),mD=mt("spawnSync"),hD=mt("createInterface")});function $w(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 AT(e=RT){let t=or(pr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function gd(){if(Ja===null)try{Ja=AT()}catch{Ja=[]}return Ja}var IT,_T,RT,TT,ED,Ja,bd=O(()=>{mo();Ls();Ue();Ia();hd();IT={},_T=ve(Kt(IT.url)),RT=Q(_T,"..","..","data","templates","grammar-rules.toml"),TT=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),ED=Object.freeze(new Set(TT.filter(e=>e!=="prose")));Ja=null});function CT(){if(ui!==void 0)return ui;try{let e=vw?vw():OT();ui=e&&e.winkNLP&&e.model?e:null}catch{ui=null}return ui}function OT(){let e=process.getBuiltinModule("node:module").createRequire(LT.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function wd(){if(fr!==void 0)return fr;let e=CT();if(!e)return fr=null,null;try{fr=e.winkNLP(e.model)}catch{fr=null}return fr}var LT,vw,ui,fr,yd=O(()=>{LT={}});var xw=O(()=>{yd()});var Sw,Ew=O(()=>{Sw={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:{},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"},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"]}});function DT(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 kw(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!zT.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(!UT.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 Ns(e,t=PT){if(!e&&$d.has(t))return $d.get(t);let n=Sw,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return kw(s,n),e?(kw(s,e),s):($d.set(t,s),s)}function di(e,t,n={}){return BT(e,t,n)[0]??null}function BT(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 DT(s))l(e.nouns.get(c));return i}var PT,AD,ID,MT,FT,CD,zT,UT,$d,ho=O(()=>{Ew();PT="tmct:",AD=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),ID=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),MT=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),FT=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),CD=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});zT=new Set(["data","object"]),UT=new Set(["subclass","data"]);$d=new Map});var PD,MD,FD,WT,DD,zD,UD,jw=O(()=>{ks();Oe();PD=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),MD=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),FD=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`]}),WT=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"}),DD=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"]}),zD=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"}}),UD=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}`}]})});var Qa=O(()=>{nn();ho();jw()});var Za,ec=O(()=>{Za=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var qT,ez,_w=O(()=>{mo();ec();Ls();Ue();Qa();qT={},ez=Q(ve(Kt(qT.url)),"..","..","..")});var Rw=O(()=>{nn();ho();Qa()});var VT,HT,pz,vd=O(()=>{nn();ho();zo();VT=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3}),HT=["this","is","about","the"],pz=HT.length});var Tw=O(()=>{_t();Ue()});var xd=O(()=>{nn()});var KT,_z,Aw=O(()=>{mo();ec();Ls();Ue();xd();nn();KT={},_z=Q(ve(Kt(KT.url)),"..","..","..")});var Tz,Az,Iz,Iw=O(()=>{Tz=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),Az=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"})}),Iz=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"})});function pi(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 tc(e,t,{cap:n=6}={}){let s=[e],o=new Set([e]),r=e;for(;s.length<n;){let i=[...t.get(r)||[]].filter(a=>!o.has(a)).sort();if(!i.length)break;r=i[0],o.add(r),s.push(r)}return s}function Cw(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 Ed(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,Ed(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function YT(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 XT(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let l=Cw(e,n),c=Cw(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 h of l){let g=s.get(h);if(g){for(let b of c)if(g.has(b))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...l].filter(h=>c.has(h));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=h=>Ed(h,n,o,new Set),f=u[0],p=d(f);for(let h of u){let g=d(h);(g>p||g===p&&h<f)&&(f=h,p=g)}if(p<=i)return{distinct:!0,reason:"root-subsumer",lcs:f};if(a){let h=a.get(f);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:f}:{distinct:!1,reason:"shared-lineage",lcs:f}}return 2*p/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:f}:{distinct:!1,reason:"shared-lineage",lcs:f}}function nc(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||pi(t),c=YT(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),_=f(w);v!==_&&d.set(v<_?_:v,v<_?v:_)},m=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let v=XT(a[y],a[w],l,c,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[y],b:a[w],...v}),v.distinct||p(a[y],a[w])}let h=new Map;for(let y of a){let w=f(y);h.has(w)||h.set(w,[]),h.get(w).push(y)}let g=y=>Ed(y,l,u,new Set),b=[...h.values()].map(y=>{let w=[...y].sort(),v=w[0],_=g(v);for(let $ of w){let x=g($);x>_&&(_=x,v=$)}return{objects:w,label:v}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:b.length>1,clusters:b,pairs:m}}var sc=O(()=>{Ht()});function Sd(e){return typeof e=="string"&&JT.test(e)}function Ow(e){return!!e&&typeof e=="object"&&go(e.s)}function kd(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&Sd(e.world)&&go(e.subject)&&go(e.predicate)&&go(e.object)}function jd(e){if(!e||typeof e!="object"||e.kind!=="rule"||!Sd(e.world)||!go(e.name)||!ZT.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(go)}function _d(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&Sd(e.world)&&go(e.opening)}function Lw(e){return kd(e)||jd(e)||_d(e)}function Nw(e){let t=e||[],n=t.filter(c=>c.predicate===eA).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 JT,QT,ZT,go,eA,bo=O(()=>{JT=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,QT=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),ZT=new Set(QT),go=e=>typeof e=="string"&&e.trim()!=="";eA="mgx:default-contains"});var nA,sA,oA,rA,iA,aA,cA,lA,uA,Wz,dA,Pw,Gz,qz,Mw=O(()=>{ho();Mo();nA="subClassOf",sA="typeAssertion",oA="relation",rA="someValuesFrom",iA="cardinality",aA="disjointWith",cA="possessive",lA="adjective",uA="capability",Wz=Object.freeze([nA,sA,oA,rA,iA,aA,cA,lA,uA]),dA=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Pw=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"]]),Gz=Math.max(...[...Pw.keys()].map(e=>e.split(" ").length)),qz=[...new Set([...dA,...[...Pw.keys()].map(e=>e.split(" ")[0])])]});var wo=O(()=>{});var Rd=O(()=>{Oe();ks();wo()});function jt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Ps.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 pA,Ps,Ee,Qz,mi,st,Ft,Yt,fA,Fw,kt,mA,hA,Dw,Zz,e2,t2,zw=O(()=>{pA=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Ps=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),Ee=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),Qz=Object.freeze([Ee.MemoryTerm]),mi=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),st=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Ps.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Ft=()=>Object.freeze({type:Ps.Precondition,pred:mi.graphLoaded}),Yt=(e,t)=>Object.freeze({type:Ps.Precondition,pred:mi.resolves,param:e,as:t}),fA=e=>Object.freeze({type:Ps.Precondition,pred:mi.anyPresent,params:Object.freeze([...e])}),Fw=()=>Object.freeze({type:Ps.Precondition,pred:mi.memoryFacts}),kt=(e,t=null)=>Object.freeze({type:Ps.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});mA=Object.freeze([jt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[st("query",Ee.Query,{required:!1,note:"required unless a kind filter is given"}),st("kind",Ee.Kind,{required:!1}),st("name",Ee.Query,{required:!1}),st("decorator",Ee.Query,{required:!1})],preconditions:[Ft(),fA(["query","kind"])],add:[kt("matches","query")]}),jt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("description","symbol")]}),jt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("signature","symbol")]}),jt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[st("module",Ee.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Ft(),Yt("module",Ee.Symbol)],add:[kt("impact","module")]}),jt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[st("class",Ee.Class,{arg:"class"})],preconditions:[Ft(),Yt("class",Ee.Class)],add:[kt("members","class")]}),jt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[st("class",Ee.Class,{arg:"class"})],preconditions:[Ft(),Yt("class",Ee.Class)],add:[kt("subclasses","class")]}),jt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[st("module",Ee.Module)],preconditions:[Ft(),Yt("module",Ee.Module)],add:[kt("exports","module")]}),jt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("callers","symbol")]}),jt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("callees","symbol")]}),jt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("calls","symbol")]}),jt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("tests","symbol")]}),jt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Ft()],add:[kt("untested",null)]}),jt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("history","symbol")]}),jt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[st("symbol",Ee.Symbol)],preconditions:[Ft(),Yt("symbol",Ee.Symbol)],add:[kt("cochanges","symbol")]}),jt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[st("package",Ee.Package,{required:!1})],preconditions:[Ft()],add:[kt("architecture","package")]}),jt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[st("term",Ee.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[Fw(),Yt("term",Ee.MemoryTerm)],add:[kt("related","term")]}),jt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[st("class",Ee.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),st("expression",Ee.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),st("size",Ee.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[Fw(),Yt("class",Ee.MemoryTerm)],add:[kt("sprite","class")]})]),hA=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Dw=mA,Zz=hA(Dw),e2=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"}),t2=Object.freeze({prefixes:pA,vocab:Ps,kinds:Ee,precond:mi,get capabilities(){return Dw}})});var Uw=O(()=>{zw()});var Bw=O(()=>{Hn()});function bA(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||Q(gA,"corpus","worlds")}function Ww(e){try{return Za(pr(e))}catch{return null}}function Gw(e){if(Td.has(e))return Td.get(e);let t=null,n=Ww(Q(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 Td.set(e,t),t}function wA(e,t){let n=Gw(e);if(!n)return null;let s=n[String(t??"")];if(!Ow(s))return null;let o=`${e}\0${t}`;if(Ad.has(o))return Ad.get(o);let r=null,i=Ww(Q(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],l=[],c=null;for(let u of i.toString("utf8").split(`
165
- `))if(u.trim())try{let d=JSON.parse(u);if(!Lw(d)||d.world!==t)continue;kd(d)?a.push(d):jd(d)?l.push(d):_d(d)&&!c&&(c=d)}catch{}(a.length||l.length||c)&&(r={name:t,facts:Nw(a),rules:l,meta:c})}return Ad.set(o,r),r}var $A,gA,Td,Ad,yA,m2,oc=O(()=>{mo();ec();Ls();Ue();bo();$A={},gA=Q(ve(Kt($A.url)),"..","..","..");Td=new Map,Ad=new Map;yA=e=>({list:async()=>{let t=Gw(e());return t?Object.keys(t).sort():null},load:async t=>wA(e(),t)}),m2=yA(()=>bA())});var E2,qw=O(()=>{_t();Ue();ws();Rr();Hn();qe();E2=Q(".tmct","memory","blocks")});var Vw=O(()=>{wo()});var Kw=O(()=>{ws();Rr();wo()});var Id=O(()=>{ws();Rr();wo()});var Yw=O(()=>{Id();ws();Js();wo()});var Xw=O(()=>{});var Jw=O(()=>{Vw();Kw();Id();Yw();Xw();wo()});var Qw=O(()=>{qw();qe();ra();bd();Jw();Rd()});var Zw=O(()=>{yn();Mo()});function mr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function ic(e){let t=n=>SA.map((s,o)=>`--${n}-t${o+1}: ${mr(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: ${mr(e.taught,.12)}; --corpus-soft: ${mr(e.corpus,.12)};`,`--entail-soft: ${mr(e.entail,.14)}; --alert-soft: ${mr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${mr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var rc,SA,yU,Cd=O(()=>{Zw();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)"})}),SA=[.35,.65,1];yU=`
166
- :root { color-scheme: light dark; ${ic(rc.light)} }
167
- @media (prefers-color-scheme: dark) { :root { ${ic(rc.dark)} } }
168
- :root[data-theme="dark"] { ${ic(rc.dark)} }
169
- :root[data-theme="light"] { ${ic(rc.light)} }
170
- `});var ey=O(()=>{Cd()});var ty=O(()=>{Cd()});var oy=O(()=>{qe();bo();yn();hi()});var Od,TA,AA,IA,CA,OA,LA,aB,cB,hi=O(()=>{bo();Mw();ho();Ya();Rd();Uw();Bw();oc();qe();Qw();ey();ty();oy();Od="mgx:world-epoch",TA=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),AA=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),IA="mgx:is-open",CA="mgx:hasMass",OA="mgx:knows-about",LA="mgx:display-name",aB=new Set([...TA,...AA,IA,CA,OA,LA,"rdf:type",Od]),cB=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 hr,uB,dB,pB,fB,mB,hB,Ms=O(()=>{hr=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})}),uB=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"}),dB=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"}),pB=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"}),fB=Object.freeze({teach:"teach"}),mB=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),hB=Object.freeze({max_depth:"maxDepth"})});var ay,NA,cc,PA,MA,cy,ly,FA,DA,wB,zA,UA,uy=O(()=>{Ms();ay="spider-fly",NA=10,cc=Object.freeze({x:2,y:2}),PA=1,MA=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly"}),food:null}),cy=(e,t)=>`cell-${e}-${t}`,ly=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),FA=(e,t)=>ly(e,t,cc.x,cc.y)<=PA,DA=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})}),wB=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"])]),zA="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.",UA=Object.freeze({name:ay,gridSize:NA,opening:zA,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:FA,webHomeCell:cy(cc.x,cc.y)})});var dy,hy,vB,xB,EB,Ld,py,fy,my,Nd,SB,kB,lc=O(()=>{Ms();dy=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),hy=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})}),vB=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),xB=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),EB=Object.freeze([dy.spawnedFood,dy.placedFood]),Ld=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),py=Ld({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"}]}),fy=Ld({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"}]}),my=Ld({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"}]}),Nd=Object.freeze({[py.name]:py,[fy.name]:fy,[my.name]:my}),SB=Object.freeze(Object.keys(Nd)),kB=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 gy=O(()=>{});var by=O(()=>{});var gi,KA,YA,XA,JA,QA,ZA,eI,tI,nI,sI,oI,rI,iI,aI,cI,lI,uI,KB,Pd=O(()=>{lc();gy();Js();qe();bo();by();nn();Ms();hi();gi=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin"},food:{spawnedKind:"crumb",placedKind:"morsel"}}),KA="mgx:currently-in",YA="mgx:hasMass",XA="mgx:feels",JA="mgx:facing",QA="mgx:driven-facing",ZA="mgx:eaten-by",eI="mgx:starved",tI="mgx:placed-by",nI="mgx:model",sI="mgx:rotation",oI="mgx:carrying",rI="mgx:prey-eaten",iI="mgx:web-built-at-turn",aI="mgx:laid-at-turn",cI="mgx:hatched-into",lI="mgx:turn-played",uI=new Set([KA,YA,XA,JA,QA,ZA,eI,tI,nI,sI,lI,oI,rI,iI,aI,cI,"rdf:type",Od]),KB=Object.freeze([...uI].sort())});var pW,fW,yy=O(()=>{uy();lc();Pd();bo();oc();qe();Ms();pW=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"),fW=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var IW,CW,OW,LW,NW,PW,mI,hI,gI,bI,$y,vy,wI,MW,FW,xy=O(()=>{lc();Pd();hi();yn();bo();oc();qe();Ms();IW=gi.predator.kind,CW=gi.prey.kind,OW=gi.food.spawnedKind,LW=gi.food.placedKind,NW=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"),PW=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"),mI="mgx:currently-in",hI="mgx:hasMass",gI="mgx:feels",bI="mgx:facing",$y="(fox|goblin|crumb|morsel)(?:-(\\d+))?",vy="(fox|goblin)(?:-(\\d+))?",wI="(crumb|morsel)(?:-(\\d+))?",MW=[{kind:"placement",predicate:mI,re:new RegExp(`^(?:the\\s+)?${$y}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:hI,re:new RegExp(`^(?:the\\s+)?${$y}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:gI,re:new RegExp(`^(?:the\\s+)?${vy}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:bI,re:new RegExp(`^(?:the\\s+)?${vy}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],FW=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${wI}\\s+there[.!\\s]*$`,"i")});var ht,zW,UW,BW,WW,GW,qW,VW,HW,KW,YW,XW,JW,QW,ZW,eG,tG,nG,sG,oG,Ey=O(()=>{ht=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},zW=ht("createRequire"),UW=ht("readFileSync"),BW=ht("access"),WW=ht("readFile"),GW=ht("writeFile"),qW=ht("appendFile"),VW=ht("mkdir"),HW=ht("mkdtemp"),KW=ht("rename"),YW=ht("unlink"),XW=ht("rm"),JW=ht("stat"),QW=ht("copyFile"),ZW=ht("readdir"),eG=ht("createReadStream"),tG=ht("createWriteStream"),nG=ht("randomBytes"),sG=ht("spawnSync"),oG=ht("createInterface")});var gt,iG,aG,cG,lG,uG,dG,pG,fG,mG,hG,gG,bG,wG,yG,$G,vG,xG,EG,yI,Sy=O(()=>{gt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},iG=gt("createRequire"),aG=gt("readFileSync"),cG=gt("access"),lG=gt("readFile"),uG=gt("writeFile"),dG=gt("appendFile"),pG=gt("mkdir"),fG=gt("mkdtemp"),mG=gt("rename"),hG=gt("unlink"),gG=gt("rm"),bG=gt("stat"),wG=gt("copyFile"),yG=gt("readdir"),$G=gt("createReadStream"),vG=gt("createWriteStream"),xG=gt("randomBytes"),EG=gt("spawnSync"),yI=gt("createInterface")});var bt,kG,jG,_G,RG,TG,AG,IG,CG,OG,LG,NG,PG,MG,FG,DG,zG,UG,ky,BG,Md=O(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},kG=bt("createRequire"),jG=bt("readFileSync"),_G=bt("access"),RG=bt("readFile"),TG=bt("writeFile"),AG=bt("appendFile"),IG=bt("mkdir"),CG=bt("mkdtemp"),OG=bt("rename"),LG=bt("unlink"),NG=bt("rm"),PG=bt("stat"),MG=bt("copyFile"),FG=bt("readdir"),DG=bt("createReadStream"),zG=bt("createWriteStream"),UG=bt("randomBytes"),ky=bt("spawnSync"),BG=bt("createInterface")});var jy=O(()=>{Md();Ue();_t();Ue();La();Bt()});var _y=O(()=>{});var $I,Ry=O(()=>{_t();Ue();qe();_y();$I=Q(".tmct","sessions")});var Ay=O(()=>{_t();Ue();Xa()});var wt,lq,uq,dq,pq,fq,mq,hq,gq,bq,wq,yq,$q,vq,xq,Eq,Sq,kq,jq,vI,Iy=O(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},lq=wt("createRequire"),uq=wt("readFileSync"),dq=wt("access"),pq=wt("readFile"),fq=wt("writeFile"),mq=wt("appendFile"),hq=wt("mkdir"),gq=wt("mkdtemp"),bq=wt("rename"),wq=wt("unlink"),yq=wt("rm"),$q=wt("stat"),vq=wt("copyFile"),xq=wt("readdir"),Eq=wt("createReadStream"),Sq=wt("createWriteStream"),kq=wt("randomBytes"),jq=wt("spawnSync"),vI=wt("createInterface")});var EI,gr,Cy,xI,Oy,Nq,ps,Pq,uc,Mq,Ly=O(()=>{mo();_t();Iy();Ls();Ue();Ia();qe();EI={},gr=Q(ve(Kt(EI.url)),"..","..",".."),Cy=Q(gr,"corpus","conceptnet","slice.jsonl"),xI=Q(gr,"src","adapters","corpus","conceptnet-map.toml"),Oy=Q(gr,"corpus","seon","concepts.jsonl"),Nq=Q(gr,"corpus","seon","definitions.jsonl"),ps=Q(gr,"corpus","tier2"),Pq=Q(ps,"manifest.json"),uc=Q(gr,"corpus","wordnet"),Mq=Q(uc,"manifest.json")});function jI(){return{seon:{kind:"corpus",active:!1,corpusPath:Oy,provenancePrefix:"corpus:seon"},conceptnet:{kind:"corpus",active:!1,corpusPath:Cy,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:kI},human:{kind:"corpus",active:!0,corpusPath:Q(ps,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:Q(ps,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:Q(ps,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"corpus",active:!1,corpusPath:Q(ps,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws"},"tier2-python":{kind:"corpus",active:!1,corpusPath:Q(ps,"python.jsonl"),provenancePrefix:"corpus:tier2-python"},"tier2-java":{kind:"corpus",active:!1,corpusPath:Q(ps,"java.jsonl"),provenancePrefix:"corpus:tier2-java"},"tier2-general":{kind:"corpus",active:!1,corpusPath:Q(ps,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:Q(uc,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:Q(uc,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:Q(SI,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}var _I,SI,Kq,kI,Yq,Ny=O(()=>{Ue();_t();Ls();La();Ly();_I={},SI=Q(ve(Kt(_I.url)),"..","..","corpus","namenet"),Kq=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),kI=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];Yq=Object.freeze(jI())});var Py=O(()=>{});var My=O(()=>{Ue();mo();_t();Ey();Sy();Md();Bt();jy();Oe();Ry();Xa();Ay();_r();Ny();dc();Ms();Ya();vd();Py()});var Fy={};Bn(Fy,{proseLemma:()=>TI});function TI(){if(yo!==void 0)return yo;try{let e=wd();if(!e)return yo=null,yo;let t=e.its,n=new Map;yo=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{yo=null}return yo}var yo,Dy=O(()=>{yd()});var zy={};Bn(zy,{digestTermFromRows:()=>CI,loadDigestStructureTable:()=>II,readDigestStructures:()=>AI});var AI,II,CI,Uy=O(()=>{AI=()=>null,II=()=>null,CI=()=>null});function Xd(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 Xd(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&&gn[o]?gn[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&&gn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?gn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function sp(e){let t=new Map;for(let n of e)t.has(Gy(n))||t.set(Gy(n),n);return t}function zd(e,t=wi){let n=[],s=[];for(let o of e)o.predicate===t&&(s.push([o.subject,o.object]),$o(o)&&n.push([o.subject,o.object]));return{strictEdges:n,broadEdges:s}}function Ud(e,t,n,s,o){return e(t,n,[],s.strictEdges,o)||e(t,n,[],s.broadEdges,o)}function FI(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function DI(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Dy(),Fy)),s=n();return s?FI(t,s(t)):t}catch{return t}}function rp(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)||zI.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 Gd(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return dr;if(t==="can")return"mgx:capableOf";try{let n=await DI(t);return n==="have"?dr:rs(`mgx:${n}`)}catch{return rs(`mgx:${t}`)}}function VI(e,t){let n=String(t||"").match(qI);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function bi(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(ks(),ph)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function XI(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 h$(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 g$(e){if(vo[e])return vo[e];let t=String(e||""),n=Nh(t);if(n){let a=g$(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",h$(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:(${ip})-([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?`${XI(i[1])}${i[2]?` ${i[2]}`:""}`:e}function Vd(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function QI(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of JI)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 zn(e){return e.replace(/#node:[0-9a-f]+/g,"")}function oe(e){let t=e.provenance?` (source: ${zn(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Dt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Dt(e)}${t}`:e.provenance.includes("corpus:")?`${Dt(e)}${t}`:e.provenance.includes("reference:")?`${Dt(e)}${t}`:`i learned: ${Dt(e)}${t}`}function Hy(e,t,n){let s=oe(e);if(!ms.has(e.predicate)||!n.has(e.subject))return s;let o=tc(e.object,t,{cap:6});if(o.length<=1)return s;let r=` \u2192 ${o.slice(1).join(" \u2192 ")}`,i=s.match(ZI);return i?s.slice(0,i.index)+r+i[0]:s+r}function Ky(e,t,n,{indent:s=""}={}){let o=t.filter(_=>_.predicate===wi).map(_=>[_.subject,_.object]),r=pi(o),i=e.map(_=>`${s}${Hy(_,r,n)}`),a=e.filter(_=>ms.has(_.predicate)&&n.has(_.subject)),l=[...new Set(a.map(_=>_.object))];if(l.length<2)return{lines:i,grouped:null};let c=t.filter(_=>_.predicate==="owl:disjointWith").map(_=>[_.subject,_.object]),{split:u,clusters:d}=nc(l,{parents:r,disjointEdges:c});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let _ of d)for(let $ of _.objects)p.set($,_);let m=e.filter(_=>!(ms.has(_.predicate)&&n.has(_.subject))),h=[],g=[],b=0,y=_=>{let $=Hy(_,r,n);return b<je?(b+=1,`${s}${$}`):(g.push($),null)};for(let _ of d){let $=a.filter(x=>p.get(x.object)===_).map(y).filter(Boolean);$.length&&h.push(`${s}${f}, the ${_.label}:
164
+ `)}`:c,data:{...a,grounded:l}})}finally{await i()}}var vw=O(()=>{Ue();Ve();Ge();md.ownsGraphLoad=!0});var AT,xw=O(()=>{Ul();Em();ub();pb();hb();gb();wb();$b();xb();Eb();Gb();qb();Kb();Xb();Xa();tw();sw();rw();aw();lw();dw();fw();mw();bw();$w();vw();AT=Object.freeze({tmct_context:zl,tmct_context_more:xm,tmct_describe:lb,tmct_snippet:db,tmct_signature:fb,tmct_impact:mb,tmct_search:bb,tmct_members:yb,tmct_subclasses:vb,tmct_related:ld,tmct_sprite:fd,tmct_architecture:Vb,tmct_exports:Hb,tmct_untested:Yb,tmct_ask:Zb,tmct_tests_for:ew,tmct_history:nw,tmct_file_history:ow,tmct_method_history:iw,tmct_class_history:cw,tmct_callers:uw,tmct_callees:pw,tmct_calls:hw,tmct_cochanges:gw,tmct_export:hd,tmct_ingest:md})});var gd=O(()=>{});var Ja,bd=O(()=>{Ja=()=>({relations:[],constructions:[]})});var Ew,Sw=O(()=>{_t();Ue();Lp();Ut();_r();_s();aa();ca();xw();Xa();Ge();zo();Ki();gd();bd();ca();Ul();Xa();Yi(void 0);Hi(Ja);Ew=Op.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});var gF,bF,wF,Qa=O(()=>{gF=Object.freeze(["entity","set","event","measure"]),bF=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),wF=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 pt,$F,vF,xF,EF,SF,kF,jF,_F,RF,TF,AF,IF,CF,OF,LF,NF,IT,PF,MF,kw=O(()=>{pt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},$F=pt("createRequire"),vF=pt("readFileSync"),xF=pt("access"),EF=pt("readFile"),SF=pt("writeFile"),kF=pt("appendFile"),jF=pt("mkdir"),_F=pt("mkdtemp"),RF=pt("rename"),TF=pt("unlink"),AF=pt("rm"),IF=pt("stat"),CF=pt("copyFile"),OF=pt("readdir"),LF=pt("createReadStream"),NF=pt("createWriteStream"),IT=pt("randomBytes"),PF=pt("spawnSync"),MF=pt("createInterface")});var Za=O(()=>{kw()});var ft,UF,BF,WF,GF,VF,qF,HF,KF,YF,XF,JF,QF,ZF,eD,tD,nD,Ht,sD,oD,rD,Ps=O(()=>{ft=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},UF=ft("createRequire"),BF=ft("readFileSync"),WF=ft("access"),GF=ft("readFile"),VF=ft("writeFile"),qF=ft("appendFile"),HF=ft("mkdir"),KF=ft("mkdtemp"),YF=ft("rename"),XF=ft("unlink"),JF=ft("rm"),QF=ft("stat"),ZF=ft("copyFile"),eD=ft("readdir"),tD=ft("createReadStream"),nD=ft("createWriteStream"),Ht=e=>String(e),sD=ft("randomBytes"),oD=ft("spawnSync"),rD=ft("createInterface")});var CT,jw,uD,dD,pD,yd=O(()=>{_t();Ps();Ue();CT={},jw=J($e(Ht(CT.url)),"..","..",".."),uD=J(jw,"data","templates","responses.jsonl"),dD=J(jw,"data","phrasebook","software-phrases.txt"),pD=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]))});function LT(e,t={}){let n=OT.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function NT(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>LT(s,t))):1}function Ze(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:NT(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 OT,_w=O(()=>{OT=/^src:corpus:(.+)$/});var ht,mD,pr,gD,bD,wD,yD,$D,vD,xD,ED,SD,kD,jD,_D,PT,MT,RD,TD,AD,mo=O(()=>{ht=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},mD=ht("createRequire"),pr=ht("readFileSync"),gD=ht("access"),bD=ht("readFile"),wD=ht("writeFile"),yD=ht("appendFile"),$D=ht("mkdir"),vD=ht("mkdtemp"),xD=ht("rename"),ED=ht("unlink"),SD=ht("rm"),kD=ht("stat"),jD=ht("copyFile"),_D=ht("readdir"),PT=ht("createReadStream"),MT=ht("createWriteStream"),RD=ht("randomBytes"),TD=ht("spawnSync"),AD=ht("createInterface")});function Rw(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 UT(e=DT){let t=or(pr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function $d(){if(ec===null)try{ec=UT()}catch{ec=[]}return ec}var BT,FT,DT,zT,FD,ec,vd=O(()=>{mo();Ps();Ue();La();yd();BT={},FT=$e(Ht(BT.url)),DT=J(FT,"..","..","data","templates","grammar-rules.toml"),zT=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),FD=Object.freeze(new Set(zT.filter(e=>e!=="prose")));ec=null});function WT(){if(di!==void 0)return di;try{let e=Tw?Tw():GT();di=e&&e.winkNLP&&e.model?e:null}catch{di=null}return di}function GT(){let e=process.getBuiltinModule("node:module").createRequire(VT.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function xd(){if(fr!==void 0)return fr;let e=WT();if(!e)return fr=null,null;try{fr=e.winkNLP(e.model)}catch{fr=null}return fr}var VT,Tw,di,fr,Ed=O(()=>{VT={}});var Aw=O(()=>{Ed()});var Cw,Iw=O(()=>{Cw={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:{},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"},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"]}});function XT(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 Ow(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!JT.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(!QT.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 Ms(e,t=HT){if(!e&&Sd.has(t))return Sd.get(t);let n=Cw,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return Ow(s,n),e?(Ow(s,e),s):(Sd.set(t,s),s)}function pi(e,t,n={}){return ZT(e,t,n)[0]??null}function ZT(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 XT(s))l(e.nouns.get(c));return i}var HT,VD,qD,KT,YT,HD,JT,QT,Sd,go=O(()=>{Iw();HT="tmct:",VD=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),qD=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),KT=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),YT=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),HD=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});JT=new Set(["data","object"]),QT=new Set(["subclass","data"]);Sd=new Map});var JD,QD,ZD,eA,ez,tz,nz,Lw=O(()=>{_s();Oe();JD=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),QD=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),ZD=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`]}),eA=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"}),ez=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"]}),tz=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"}}),nz=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}`}]})});var tc=O(()=>{sn();go();Lw()});var nc,sc=O(()=>{nc=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});var nA,mz,Nw=O(()=>{mo();sc();Ps();Ue();tc();nA={},mz=J($e(Ht(nA.url)),"..","..","..")});var Pw=O(()=>{sn();go();tc()});var sA,oA,_z,kd=O(()=>{sn();go();zo();sA=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3}),oA=["this","is","about","the"],_z=oA.length});var Mw=O(()=>{_t();Ue()});var jd=O(()=>{sn()});var rA,Bz,Fw=O(()=>{mo();sc();Ps();Ue();jd();sn();rA={},Bz=J($e(Ht(rA.url)),"..","..","..")});var Gz,Vz,qz,Dw=O(()=>{Gz=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),Vz=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"})}),qz=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"})});function fi(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 oc(e,t,{cap:n=6}={}){let s=[e],o=new Set([e]),r=e;for(;s.length<n;){let i=[...t.get(r)||[]].filter(a=>!o.has(a)).sort();if(!i.length)break;r=i[0],o.add(r),s.push(r)}return s}function zw(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 _d(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,_d(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function iA(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 aA(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let l=zw(e,n),c=zw(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 g=s.get(m);if(g){for(let b of c)if(g.has(b))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=>_d(m,n,o,new Set),f=u[0],p=d(f);for(let m of u){let g=d(m);(g>p||g===p&&m<f)&&(f=m,p=g)}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 rc(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||fi(t),c=iA(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),_=f(w);v!==_&&d.set(v<_?_:v,v<_?v:_)},h=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let v=aA(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 g=y=>_d(y,l,u,new Set),b=[...m.values()].map(y=>{let w=[...y].sort(),v=w[0],_=g(v);for(let $ of w){let x=g($);x>_&&(_=x,v=$)}return{objects:w,label:v}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:b.length>1,clusters:b,pairs:h}}var ic=O(()=>{qt()});function Rd(e){return typeof e=="string"&&cA.test(e)}function Uw(e){return!!e&&typeof e=="object"&&bo(e.s)}function Td(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&Rd(e.world)&&bo(e.subject)&&bo(e.predicate)&&bo(e.object)}function Ad(e){if(!e||typeof e!="object"||e.kind!=="rule"||!Rd(e.world)||!bo(e.name)||!uA.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(bo)}function Id(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&Rd(e.world)&&bo(e.opening)}function Bw(e){return Td(e)||Ad(e)||Id(e)}function Ww(e){let t=e||[],n=t.filter(c=>c.predicate===dA).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 cA,lA,uA,bo,dA,wo=O(()=>{cA=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,lA=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),uA=new Set(lA),bo=e=>typeof e=="string"&&e.trim()!=="";dA="mgx:default-contains"});var fA,hA,mA,gA,bA,wA,yA,$A,vA,o2,xA,Gw,r2,i2,Vw=O(()=>{go();Mo();fA="subClassOf",hA="typeAssertion",mA="relation",gA="someValuesFrom",bA="cardinality",wA="disjointWith",yA="possessive",$A="adjective",vA="capability",o2=Object.freeze([fA,hA,mA,gA,bA,wA,yA,$A,vA]),xA=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Gw=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"]]),r2=Math.max(...[...Gw.keys()].map(e=>e.split(" ").length)),i2=[...new Set([...xA,...[...Gw.keys()].map(e=>e.split(" ")[0])])]});var yo=O(()=>{});var Cd=O(()=>{Oe();_s();yo()});function jt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Fs.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 EA,Fs,ve,f2,mi,st,Ft,Kt,SA,qw,kt,kA,jA,Hw,h2,m2,g2,Kw=O(()=>{EA=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Fs=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),ve=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),f2=Object.freeze([ve.MemoryTerm]),mi=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),st=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Fs.Parameter,name:e,kind:t,arg:n,required:s,note:o}),Ft=()=>Object.freeze({type:Fs.Precondition,pred:mi.graphLoaded}),Kt=(e,t)=>Object.freeze({type:Fs.Precondition,pred:mi.resolves,param:e,as:t}),SA=e=>Object.freeze({type:Fs.Precondition,pred:mi.anyPresent,params:Object.freeze([...e])}),qw=()=>Object.freeze({type:Fs.Precondition,pred:mi.memoryFacts}),kt=(e,t=null)=>Object.freeze({type:Fs.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});kA=Object.freeze([jt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[st("query",ve.Query,{required:!1,note:"required unless a kind filter is given"}),st("kind",ve.Kind,{required:!1}),st("name",ve.Query,{required:!1}),st("decorator",ve.Query,{required:!1})],preconditions:[Ft(),SA(["query","kind"])],add:[kt("matches","query")]}),jt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("description","symbol")]}),jt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("signature","symbol")]}),jt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[st("module",ve.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[Ft(),Kt("module",ve.Symbol)],add:[kt("impact","module")]}),jt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[st("class",ve.Class,{arg:"class"})],preconditions:[Ft(),Kt("class",ve.Class)],add:[kt("members","class")]}),jt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[st("class",ve.Class,{arg:"class"})],preconditions:[Ft(),Kt("class",ve.Class)],add:[kt("subclasses","class")]}),jt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[st("module",ve.Module)],preconditions:[Ft(),Kt("module",ve.Module)],add:[kt("exports","module")]}),jt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("callers","symbol")]}),jt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("callees","symbol")]}),jt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("calls","symbol")]}),jt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("tests","symbol")]}),jt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[Ft()],add:[kt("untested",null)]}),jt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("history","symbol")]}),jt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[st("symbol",ve.Symbol)],preconditions:[Ft(),Kt("symbol",ve.Symbol)],add:[kt("cochanges","symbol")]}),jt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[st("package",ve.Package,{required:!1})],preconditions:[Ft()],add:[kt("architecture","package")]}),jt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[st("term",ve.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[qw(),Kt("term",ve.MemoryTerm)],add:[kt("related","term")]}),jt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[st("class",ve.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),st("expression",ve.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),st("size",ve.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[qw(),Kt("class",ve.MemoryTerm)],add:[kt("sprite","class")]})]),jA=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Hw=kA,h2=jA(Hw),m2=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"}),g2=Object.freeze({prefixes:EA,vocab:Fs,kinds:ve,precond:mi,get capabilities(){return Hw}})});var Yw=O(()=>{Kw()});var Xw=O(()=>{Kn()});function RA(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||J(_A,"corpus","worlds")}function Jw(e){try{return nc(pr(e))}catch{return null}}function Qw(e){if(Od.has(e))return Od.get(e);let t=null,n=Jw(J(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 Od.set(e,t),t}function TA(e,t){let n=Qw(e);if(!n)return null;let s=n[String(t??"")];if(!Uw(s))return null;let o=`${e}\0${t}`;if(Ld.has(o))return Ld.get(o);let r=null,i=Jw(J(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],l=[],c=null;for(let u of i.toString("utf8").split(`
165
+ `))if(u.trim())try{let d=JSON.parse(u);if(!Bw(d)||d.world!==t)continue;Td(d)?a.push(d):Ad(d)?l.push(d):Id(d)&&!c&&(c=d)}catch{}(a.length||l.length||c)&&(r={name:t,facts:Ww(a),rules:l,meta:c})}return Ld.set(o,r),r}var IA,_A,Od,Ld,AA,T2,ac=O(()=>{mo();sc();Ps();Ue();wo();IA={},_A=J($e(Ht(IA.url)),"..","..","..");Od=new Map,Ld=new Map;AA=e=>({list:async()=>{let t=Qw(e());return t?Object.keys(t).sort():null},load:async t=>TA(e(),t)}),T2=AA(()=>RA())});var F2,Zw=O(()=>{_t();Ue();$s();Rr();Kn();Ve();F2=J(".tmct","memory","blocks")});var ey=O(()=>{yo()});var ny=O(()=>{$s();Rr();yo()});var Nd=O(()=>{$s();Rr();yo()});var sy=O(()=>{Nd();$s();Qs();yo()});var oy=O(()=>{});var ry=O(()=>{ey();ny();Nd();sy();oy();yo()});var iy=O(()=>{Zw();Ve();aa();vd();ry();Cd()});var ay=O(()=>{$n();Mo()});function hr(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function lc(e){let t=n=>NA.map((s,o)=>`--${n}-t${o+1}: ${hr(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: ${hr(e.taught,.12)}; --corpus-soft: ${hr(e.corpus,.12)};`,`--entail-soft: ${hr(e.entail,.14)}; --alert-soft: ${hr(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${hr(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var cc,NA,LU,Pd=O(()=>{ay();cc=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)"})}),NA=[.35,.65,1];LU=`
166
+ :root { color-scheme: light dark; ${lc(cc.light)} }
167
+ @media (prefers-color-scheme: dark) { :root { ${lc(cc.dark)} } }
168
+ :root[data-theme="dark"] { ${lc(cc.dark)} }
169
+ :root[data-theme="light"] { ${lc(cc.light)} }
170
+ `});var cy=O(()=>{Pd()});var ly=O(()=>{Pd()});var py=O(()=>{Ve();wo();$n();gi()});var Md,zA,UA,BA,WA,GA,VA,xB,EB,gi=O(()=>{wo();Vw();go();Qa();Cd();Yw();Xw();ac();Ve();iy();cy();ly();py();Md="mgx:world-epoch",zA=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),UA=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),BA="mgx:is-open",WA="mgx:hasMass",GA="mgx:knows-about",VA="mgx:display-name",xB=new Set([...zA,...UA,BA,WA,GA,VA,"rdf:type",Md]),EB=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 mr,kB,jB,_B,RB,TB,AB,Ds=O(()=>{mr=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})}),kB=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"}),jB=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"}),_B=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"}),RB=Object.freeze({teach:"teach"}),TB=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),AB=Object.freeze({max_depth:"maxDepth"})});var my,qA,dc,HA,KA,gy,by,YA,XA,OB,JA,QA,wy=O(()=>{Ds();my="spider-fly",qA=10,dc=Object.freeze({x:2,y:2}),HA=1,KA=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}),gy=(e,t)=>`cell-${e}-${t}`,by=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),YA=(e,t)=>by(e,t,dc.x,dc.y)<=HA,XA=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})}),OB=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"])]),JA="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.",QA=Object.freeze({name:my,gridSize:qA,opening:JA,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:YA,webHomeCell:gy(dc.x,dc.y)})});var yy,Ey,PB,MB,FB,Fd,$y,vy,xy,Dd,DB,zB,pc=O(()=>{Ds();yy=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),Ey=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})}),PB=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),MB=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),FB=Object.freeze([yy.spawnedFood,yy.placedFood]),Fd=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),$y=Fd({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"}]}),vy=Fd({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"}]}),xy=Fd({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"}]}),Dd=Object.freeze({[$y.name]:$y,[vy.name]:vy,[xy.name]:xy}),DB=Object.freeze(Object.keys(Dd)),zB=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 Sy=O(()=>{});var ky=O(()=>{});var bi,cW,iI,aI,cI,lI,uI,dI,pI,fI,hI,mI,gI,bI,wI,yI,$I,vI,xI,lW,zd=O(()=>{pc();Sy();Qs();Ve();wo();ky();sn();Ds();gi();bi=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"}}),cW=Object.freeze(["predator","prey"]),iI="mgx:currently-in",aI="mgx:hasMass",cI="mgx:feels",lI="mgx:facing",uI="mgx:driven-facing",dI="mgx:eaten-by",pI="mgx:starved",fI="mgx:placed-by",hI="mgx:model",mI="mgx:rotation",gI="mgx:carrying",bI="mgx:prey-eaten",wI="mgx:web-built-at-turn",yI="mgx:laid-at-turn",$I="mgx:hatched-into",vI="mgx:turn-played",xI=new Set([iI,aI,cI,lI,uI,dI,pI,fI,hI,mI,vI,gI,bI,wI,yI,$I,"rdf:type",Md]),lW=Object.freeze([...xI].sort())});var _W,RW,_y=O(()=>{wy();pc();zd();wo();ac();Ve();Ds();_W=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"),RW=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var qW,HW,KW,YW,XW,JW,jI,_I,RI,TI,Ry,Ty,AI,QW,ZW,Ay=O(()=>{pc();zd();gi();$n();wo();ac();Ve();Ds();qW=bi.predator.kind,HW=bi.prey.kind,KW=bi.food.spawnedKind,YW=bi.food.placedKind,XW=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"),JW=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"),jI="mgx:currently-in",_I="mgx:hasMass",RI="mgx:feels",TI="mgx:facing",Ry="(fox|goblin|crumb|morsel)(?:-(\\d+))?",Ty="(fox|goblin)(?:-(\\d+))?",AI="(crumb|morsel)(?:-(\\d+))?",QW=[{kind:"placement",predicate:jI,re:new RegExp(`^(?:the\\s+)?${Ry}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:_I,re:new RegExp(`^(?:the\\s+)?${Ry}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:RI,re:new RegExp(`^(?:the\\s+)?${Ty}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:TI,re:new RegExp(`^(?:the\\s+)?${Ty}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],ZW=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${AI}\\s+there[.!\\s]*$`,"i")});var mt,tG,nG,sG,oG,rG,iG,aG,cG,lG,uG,dG,pG,fG,hG,mG,gG,bG,wG,yG,Iy=O(()=>{mt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},tG=mt("createRequire"),nG=mt("readFileSync"),sG=mt("access"),oG=mt("readFile"),rG=mt("writeFile"),iG=mt("appendFile"),aG=mt("mkdir"),cG=mt("mkdtemp"),lG=mt("rename"),uG=mt("unlink"),dG=mt("rm"),pG=mt("stat"),fG=mt("copyFile"),hG=mt("readdir"),mG=mt("createReadStream"),gG=mt("createWriteStream"),bG=mt("randomBytes"),wG=mt("spawnSync"),yG=mt("createInterface")});var gt,vG,xG,EG,SG,kG,jG,_G,RG,TG,AG,IG,CG,OG,LG,NG,PG,MG,FG,II,Cy=O(()=>{gt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},vG=gt("createRequire"),xG=gt("readFileSync"),EG=gt("access"),SG=gt("readFile"),kG=gt("writeFile"),jG=gt("appendFile"),_G=gt("mkdir"),RG=gt("mkdtemp"),TG=gt("rename"),AG=gt("unlink"),IG=gt("rm"),CG=gt("stat"),OG=gt("copyFile"),LG=gt("readdir"),NG=gt("createReadStream"),PG=gt("createWriteStream"),MG=gt("randomBytes"),FG=gt("spawnSync"),II=gt("createInterface")});var bt,zG,UG,BG,WG,GG,VG,qG,HG,KG,YG,XG,JG,QG,ZG,eV,tV,nV,Oy,sV,Ud=O(()=>{bt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},zG=bt("createRequire"),UG=bt("readFileSync"),BG=bt("access"),WG=bt("readFile"),GG=bt("writeFile"),VG=bt("appendFile"),qG=bt("mkdir"),HG=bt("mkdtemp"),KG=bt("rename"),YG=bt("unlink"),XG=bt("rm"),JG=bt("stat"),QG=bt("copyFile"),ZG=bt("readdir"),eV=bt("createReadStream"),tV=bt("createWriteStream"),nV=bt("randomBytes"),Oy=bt("spawnSync"),sV=bt("createInterface")});var Ly=O(()=>{Ud();Ue();_t();Ue();Ma();Ut()});var Ny=O(()=>{});var CI,Py=O(()=>{_t();Ue();Ve();Ny();CI=J(".tmct","sessions")});var Fy=O(()=>{_t();Ue();Za()});var wt,SV,kV,jV,_V,RV,TV,AV,IV,CV,OV,LV,NV,PV,MV,FV,DV,zV,UV,OI,Dy=O(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},SV=wt("createRequire"),kV=wt("readFileSync"),jV=wt("access"),_V=wt("readFile"),RV=wt("writeFile"),TV=wt("appendFile"),AV=wt("mkdir"),IV=wt("mkdtemp"),CV=wt("rename"),OV=wt("unlink"),LV=wt("rm"),NV=wt("stat"),PV=wt("copyFile"),MV=wt("readdir"),FV=wt("createReadStream"),DV=wt("createWriteStream"),zV=wt("randomBytes"),UV=wt("spawnSync"),OI=wt("createInterface")});var NI,gr,zy,LI,Uy,XV,fs,JV,fc,QV,By=O(()=>{mo();_t();Dy();Ps();Ue();La();Ve();NI={},gr=J($e(Ht(NI.url)),"..","..",".."),zy=J(gr,"corpus","conceptnet","slice.jsonl"),LI=J(gr,"src","adapters","corpus","conceptnet-map.toml"),Uy=J(gr,"corpus","seon","concepts.jsonl"),XV=J(gr,"corpus","seon","definitions.jsonl"),fs=J(gr,"corpus","tier2"),JV=J(fs,"manifest.json"),fc=J(gr,"corpus","wordnet"),QV=J(fc,"manifest.json")});function FI(){return{seon:{kind:"corpus",active:!1,corpusPath:Uy,provenancePrefix:"corpus:seon"},conceptnet:{kind:"corpus",active:!1,corpusPath:zy,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:MI},human:{kind:"corpus",active:!0,corpusPath:J(fs,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:J(fs,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:J(fs,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"corpus",active:!1,corpusPath:J(fs,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws"},"tier2-python":{kind:"corpus",active:!1,corpusPath:J(fs,"python.jsonl"),provenancePrefix:"corpus:tier2-python"},"tier2-java":{kind:"corpus",active:!1,corpusPath:J(fs,"java.jsonl"),provenancePrefix:"corpus:tier2-java"},"tier2-general":{kind:"corpus",active:!1,corpusPath:J(fs,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:J(fc,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:J(fc,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:J(PI,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}var DI,PI,lq,MI,uq,Wy=O(()=>{Ue();_t();Ps();Ma();By();DI={},PI=J($e(Ht(DI.url)),"..","..","corpus","namenet"),lq=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),MI=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf"];uq=Object.freeze(FI())});var Gy=O(()=>{});var Vy=O(()=>{Ue();mo();_t();Iy();Cy();Ud();Ut();Ly();Oe();Py();Za();Fy();_r();Wy();hc();Ds();Qa();kd();Gy()});var qy={};Wn(qy,{proseLemma:()=>UI});function UI(){if($o!==void 0)return $o;try{let e=xd();if(!e)return $o=null,$o;let t=e.its,n=new Map;$o=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{$o=null}return $o}var $o,Hy=O(()=>{Ed()});var Ky={};Wn(Ky,{digestTermFromRows:()=>GI,loadDigestStructureTable:()=>WI,readDigestStructures:()=>BI});var BI,WI,GI,Yy=O(()=>{BI=()=>null,WI=()=>null,GI=()=>null});function ep(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 ${mc(e.entityType)}`;if(t==="list")return`list/enumerate ${mc(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${mc(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 ep(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&&bn[o]?bn[o]:`filter/traverse ${mc(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&&bn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?bn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function cp(e){let t=new Map;for(let n of e)t.has(Jy(n))||t.set(Jy(n),n);return t}function Gd(e,t=yi){let n=[],s=[];for(let l of e)l.predicate===t&&(s.push([l.subject,l.object]),vo(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 Vd(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 JI(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function QI(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Hy(),qy)),s=n();return s?JI(t,s(t)):t}catch{return t}}function up(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)||ZI.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 Kd(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return dr;if(t==="can")return"mgx:capableOf";try{let n=await QI(t);return n==="have"?dr:is(`mgx:${n}`)}catch{return is(`mgx:${t}`)}}function rC(e,t){let n=String(t||"").match(oC);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function wi(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(_s(),bm)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function lC(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 E$(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 S$(e){if(xo[e])return xo[e];let t=String(e||""),n=zm(t);if(n){let a=S$(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",E$(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:(${dp})-([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?`${lC(i[1])}${i[2]?` ${i[2]}`:""}`:e}function Xd(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function dC(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of uC)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 Un(e){return e.replace(/#node:[0-9a-f]+/g,"")}function ie(e){let t=e.provenance?` (source: ${Un(e.provenance)})`:"";return e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Dt(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Dt(e)}${t}`:e.provenance.includes("corpus:")?`${Dt(e)}${t}`:e.provenance.includes("reference:")?`${Dt(e)}${t}`:`i learned: ${Dt(e)}${t}`}function e$(e,t,n){let s=ie(e);if(!ms.has(e.predicate)||!n.has(e.subject))return s;let o=oc(e.object,t,{cap:6});if(o.length<=1)return s;let r=` \u2192 ${o.slice(1).join(" \u2192 ")}`,i=s.match(pC);return i?s.slice(0,i.index)+r+i[0]:s+r}function t$(e,t,n,{indent:s=""}={}){let o=t.filter(_=>_.predicate===yi).map(_=>[_.subject,_.object]),r=fi(o),i=e.map(_=>`${s}${e$(_,r,n)}`),a=e.filter(_=>ms.has(_.predicate)&&n.has(_.subject)),l=[...new Set(a.map(_=>_.object))];if(l.length<2)return{lines:i,grouped:null};let c=t.filter(_=>_.predicate==="owl:disjointWith").map(_=>[_.subject,_.object]),{split:u,clusters:d}=rc(l,{parents:r,disjointEdges:c});if(!u)return{lines:i,grouped:null};let f=a[0].subject,p=new Map;for(let _ of d)for(let $ of _.objects)p.set($,_);let h=e.filter(_=>!(ms.has(_.predicate)&&n.has(_.subject))),m=[],g=[],b=0,y=_=>{let $=e$(_,r,n);return b<Se?(b+=1,`${s}${$}`):(g.push($),null)};for(let _ of d){let $=a.filter(x=>p.get(x.object)===_).map(y).filter(Boolean);$.length&&m.push(`${s}${f}, the ${_.label}:
171
171
  ${$.join(`
172
- `)}`)}if(m.length){let _=m.map(y).filter(Boolean);_.length&&h.push(`${s}also about ${f}:
172
+ `)}`)}if(h.length){let _=h.map(y).filter(Boolean);_.length&&m.push(`${s}also about ${f}:
173
173
  ${_.join(`
174
174
  `)}`)}let w=g.length?`
175
- ${s}\u2026and ${g.length} more \u2014 say 'more' to see them.`:"",v={text:h.join(`
176
- `)+w,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:v}}async function tC(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Uy(),zy)))}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("; ")})
175
+ ${s}\u2026and ${g.length} more \u2014 say 'more' to see them.`:"",v={text:m.join(`
176
+ `)+w,replace:!0,...g.length?{pending:{items:g,noun:"facts"}}:{}};return{lines:i,grouped:v}}async function hC(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Yy(),Ky)))}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("; ")})
177
177
  `:"",l=`Say 'show the facts' for all ${s.length} stored facts.`;return{text:`${r.paragraphs.join(`
178
178
 
179
179
  `)}
180
180
 
181
- ${a}${l}`,pending:{items:s,noun:"facts"}}}function br(e){let t=gd().find(n=>n.kind==="article");return t&&$w(String(e||""),t)?"an":"a"}function b$(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${oe(e)}; ${oe(t)}. To settle it, say "forget that ${e.subject} is ${br(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${oe(t)}`,replace:!0}:e?{text:`yes \u2014 ${oe(e)}`,replace:!0}:null}function nC(e,t){let n=s=>`${Dt(s)}${s.provenance?` (source: ${zn(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 ${br(e.object)} ${e.object}".`,replace:!0}}function fc(e){let t=o=>`${Dt(o)}${o.provenance?` (source: ${zn(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Hd(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(qe(),Os)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=i=>(o.attributes||[]).find(a=>a.key===i)?.value||"";s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance")})}return s}catch{return[]}}async function it(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(qe(),Os)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function sC(e){if(!mc)try{mc=Ns().nounPlurals}catch{mc=new Map}return mc.get(e)??null}function gc(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return di(Ns(),t)?.lemma||t}catch{return t}}function oC(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return gc(e);let n=gc(rp(t[1]));return`${br(n)} ${n}`}function X(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(rC,"").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=sC(i);a&&s.add(e(a))}return s}function Yy(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 $$(e,t=null){let n=bc(e),s=n.match(iC);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(cC);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function Qd(e){let t=String(e||"").replace(dC,"");if(t!==e){let s=t.match(Fs);if(s)return s}let n=String(e||"").match(pC);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(Fs):null}function ep(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 Jy(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function _C(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=>`${Dt(s)}${s.provenance?` (source: ${zn(s.provenance)})`:""}`).join("; ")}function Zy(e,t,n,{maxHops:s=3}={}){let o=X(J,e),r=X(J,t),i=da(o,r,n,{maxHops:s}),a=l=>{let c=l&&l.length?_C(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:
182
- ${[...i.negative,...i.positive].map(oe).join(`
183
- `)}`,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 ${oe(l)}${a(i.chain)}`;return i.overrides&&(c+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${oe(i.overrides.fact)}`),{text:c,replace:!0}}return null}function e$(e,t,n,{maxHops:s=3}={}){let o=X(J,e),r=X(J,t),i=Ql(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,Jl).map(f=>oe(f.fact));return{text:`${l} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
181
+ ${a}${l}`,pending:{items:s,noun:"facts"}}}function br(e){let t=$d().find(n=>n.kind==="article");return t&&Rw(String(e||""),t)?"an":"a"}function k$(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${ie(e)}; ${ie(t)}. To settle it, say "forget that ${e.subject} is ${br(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${ie(t)}`,replace:!0}:e?{text:`yes \u2014 ${ie(e)}`,replace:!0}:null}function mC(e,t){let n=s=>`${Dt(s)}${s.provenance?` (source: ${Un(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 ${br(e.object)} ${e.object}".`,replace:!0}}function gc(e){let t=o=>`${Dt(o)}${o.provenance?` (source: ${Un(o.provenance)})`:""}`,n=e[0],s=e[e.length-1];return`${e.map(t).join("; ")}; so ${n.subject} is a ${s.object}`}async function Jd(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Ve(),Ns)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=i=>(o.attributes||[]).find(a=>a.key===i)?.value||"";s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance")})}return s}catch{return[]}}async function it(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(Ve(),Ns)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function gC(e){if(!bc)try{bc=Ms().nounPlurals}catch{bc=new Map}return bc.get(e)??null}function yc(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return pi(Ms(),t)?.lemma||t}catch{return t}}function bC(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return yc(e);let n=yc(up(t[1]));return`${br(n)} ${n}`}function Y(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(wC,"").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=gC(i);a&&s.add(e(a))}return s}function n$(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 R$(e,t=null){let n=$c(e),s=n.match(yC);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(vC);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function sp(e){let t=String(e||"").replace(SC,"");if(t!==e){let s=t.match(zs);if(s)return s}let n=String(e||"").match(kC);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(zs):null}function rp(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 o$(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function zC(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=>`${Dt(s)}${s.provenance?` (source: ${Un(s.provenance)})`:""}`).join("; ")}function i$(e,t,n,{maxHops:s=3}={}){let o=Y(Q,e),r=Y(Q,t),i=ha(o,r,n,{maxHops:s}),a=l=>{let c=l&&l.length?zC(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:
182
+ ${[...i.negative,...i.positive].map(ie).join(`
183
+ `)}`,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 ${ie(l)}${a(i.chain)}`;return i.overrides&&(c+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${ie(i.overrides.fact)}`),{text:c,replace:!0}}return null}function a$(e,t,n,{maxHops:s=3}={}){let o=Y(Q,e),r=Y(Q,t),i=nu(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,tu).map(f=>ie(f.fact));return{text:`${l} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
184
184
  ${d.join(`
185
- `)}`,replace:!0,miss:!0}}let c=Zl(r,n,{exclude:new Set([...o,i.klass])});if(c.length){let u=c.slice(0,Jl),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)`:""}:
186
- ${u.map(oe).join(`
187
- `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(oe),noun:"facts"}}:{}}}return{text:`${l} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function AC(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 hn(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 x$(e,t,n,s,o={},r=null,i=null){return E$(await PC(e,t,n,s,o,r,i),n,t)}function E$(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Xd(t?.parsed);if(!o&&e.generalVerbQuery&&(o=By),!o){let r=s.match(Jd),i=r?null:bc(s).match(y$)||$$(s),a=r?r[2]:i?i[1]:null;a&&!Zd.has(a.toLowerCase())&&(o=By)}if(!o){let r=s.match(k$);r&&(o=Xd({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function PC(e,t,n,s,o={},r=null,i=null){let a,l;try{({normFactTerm:a,normFactPredicate:l}=await Promise.resolve().then(()=>(qe(),Os)))}catch{return null}let c=String(t).trim(),u=c.match(wC);if(u){let D=X(a,u[1]),U=(await it(e,r)).filter(G=>G.predicate==="mgx:usedFor"&&D.has(G.object));if(U.length){let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
185
+ `)}`,replace:!0,miss:!0}}let c=su(r,n,{exclude:new Set([...o,i.klass])});if(c.length){let u=c.slice(0,tu),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)`:""}:
186
+ ${u.map(ie).join(`
187
+ `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(ie),noun:"facts"}}:{}}}return{text:`${l} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function WC(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 gn(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 A$(e,t,n,s,o={},r=null,i=null){return I$(await YC(e,t,n,s,o,r,i),n,t)}function I$(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=ep(t?.parsed);if(!o&&e.generalVerbQuery&&(o=Xy),!o){let r=s.match(np),i=r?null:$c(s).match(_$)||R$(s),a=r?r[2]:i?i[1]:null;a&&!op.has(a.toLowerCase())&&(o=Xy)}if(!o){let r=s.match(O$);r&&(o=ep({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function YC(e,t,n,s,o={},r=null,i=null){let a,l;try{({normFactTerm:a,normFactPredicate:l}=await Promise.resolve().then(()=>(Ve(),Ns)))}catch{return null}let c=String(t).trim(),u=c.match(IC);if(u){let D=Y(a,u[1]),U=(await it(e,r)).filter(G=>G.predicate==="mgx:usedFor"&&D.has(G.object));if(U.length){let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
188
188
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
189
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}for(let{predicate:D,re:U}of CC){let G=c.match(U);if(!G)continue;let I=X(a,G[1]),L=(await it(e,r)).filter(ie=>ie.predicate===D&&I.has(ie.object));if(!L.length)continue;let P=Ze(hn(L),o).map(oe),N=P.slice(0,je),W=P.slice(je),V=W.length?`
190
- \u2026and ${W.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
191
- `)+V,replace:!0,...W.length?{pending:{items:W,noun:"facts"}}:{}}}let d=c.match(RC),f=d?null:c.match(TC),p=d?d[1]:f?.[2],m=d?d[2]:f?.[1],h=p&&m?AC(m):null;if(h){let D=`mgx:${h.replace(/\s+/g,"-")}-than`,U=await it(e,r),G=X(a,p),I=[...G].sort((P,N)=>P.length-N.length)[0],L=P=>G.has(P)||P.startsWith(`${I}-`)||P.startsWith(`${I} `)||U.some(N=>ms.has(N.predicate)&&N.subject===P&&G.has(N.object)),C=hn(U.filter(P=>P.predicate===D&&$o(P))).filter(P=>P.subject!==P.object&&L(P.subject)&&L(P.object));if(C.length){let P=new Set,N=new Map;for(let K of C)P.add(K.subject),P.add(K.object),N.set(K.object,(N.get(K.object)||0)+1),N.has(K.subject)||N.set(K.subject,N.get(K.subject)||0);let W=new Map(N),V=[],ie=null;for(;W.size;){let K=[...W.keys()].filter(q=>W.get(q)===0);if(K.length!==1){ie=K.length===0?{text:`I can't order the ${I}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${I} from what I know \u2014 nothing compares ${K[0]} and ${K[1]}. Teach me, e.g. "${K[0]} is ${h} than ${K[1]}".`,replace:!0,miss:!0};break}let ee=K[0];V.push(ee),W.delete(ee);for(let q of C)q.subject===ee&&W.has(q.object)&&W.set(q.object,W.get(q.object)-1)}if(ie)return ie;let ce=V.slice(0,-1).map((K,ee)=>C.find(q=>q.subject===K&&q.object===V[ee+1]));if(ce.every(Boolean)){let K=ce.map(ee=>`${Dt(ee)}${ee.provenance?` (source: ${zn(ee.provenance)})`:""}`).join("; ");return{text:`${V[0]} \u2014 ${K}; so ${V[0]} is the ${m} ${I}`,replace:!0}}}}let g=s?c.match(yC)||c.match($C):null;if(g){let D=X(a,g[1]),U=(await it(e,r)).filter(G=>ko(G.predicate)!==null&&D.has(G.subject));if(U.length){let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
189
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}for(let{predicate:D,re:U}of VC){let G=c.match(U);if(!G)continue;let I=Y(a,G[1]),L=(await it(e,r)).filter(se=>se.predicate===D&&I.has(se.object));if(!L.length)continue;let P=Ze(gn(L),o).map(ie),N=P.slice(0,Se),B=P.slice(Se),H=B.length?`
190
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
191
+ `)+H,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let d=c.match(UC),f=d?null:c.match(BC),p=d?d[1]:f?.[2],h=d?d[2]:f?.[1],m=p&&h?WC(h):null;if(m){let D=`mgx:${m.replace(/\s+/g,"-")}-than`,U=await it(e,r),G=Y(a,p),I=[...G].sort((P,N)=>P.length-N.length)[0],L=P=>G.has(P)||P.startsWith(`${I}-`)||P.startsWith(`${I} `)||U.some(N=>ms.has(N.predicate)&&N.subject===P&&G.has(N.object)),C=gn(U.filter(P=>P.predicate===D&&vo(P))).filter(P=>P.subject!==P.object&&L(P.subject)&&L(P.object));if(C.length){let P=new Set,N=new Map;for(let X of C)P.add(X.subject),P.add(X.object),N.set(X.object,(N.get(X.object)||0)+1),N.has(X.subject)||N.set(X.subject,N.get(X.subject)||0);let B=new Map(N),H=[],se=null;for(;B.size;){let X=[...B.keys()].filter(V=>B.get(V)===0);if(X.length!==1){se=X.length===0?{text:`I can't order the ${I}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} ${I} from what I know \u2014 nothing compares ${X[0]} and ${X[1]}. Teach me, e.g. "${X[0]} is ${m} than ${X[1]}".`,replace:!0,miss:!0};break}let ee=X[0];H.push(ee),B.delete(ee);for(let V of C)V.subject===ee&&B.has(V.object)&&B.set(V.object,B.get(V.object)-1)}if(se)return se;let ae=H.slice(0,-1).map((X,ee)=>C.find(V=>V.subject===X&&V.object===H[ee+1]));if(ae.every(Boolean)){let X=ae.map(ee=>`${Dt(ee)}${ee.provenance?` (source: ${Un(ee.provenance)})`:""}`).join("; ");return{text:`${H[0]} \u2014 ${X}; so ${H[0]} is the ${h} ${I}`,replace:!0}}}}let g=s?c.match(CC)||c.match(OC):null;if(g){let D=Y(a,g[1]),U=(await it(e,r)).filter(G=>ko(G.predicate)!==null&&D.has(G.subject));if(U.length){let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
192
192
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
193
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let b=c.match(vC);if(b){let D=b[1].toLowerCase(),U=X(a,b[2].replace(/^(?:an?|the)\s+/i,"").trim()),G=(await it(e,r)).filter(I=>ko(I.predicate)===D&&U.has(I.object));if(G.length){let L=Ze(hn(G),o).map(oe),C=L.slice(0,je),P=L.slice(je),N=P.length?`
193
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let b=c.match(LC);if(b){let D=b[1].toLowerCase(),U=Y(a,b[2].replace(/^(?:an?|the)\s+/i,"").trim()),G=(await it(e,r)).filter(I=>ko(I.predicate)===D&&U.has(I.object));if(G.length){let L=Ze(gn(G),o).map(ie),C=L.slice(0,Se),P=L.slice(Se),N=P.length?`
194
194
  \u2026and ${P.length} more \u2014 say 'more' to see them.`:"";return{text:C.join(`
195
- `)+N,replace:!0,...P.length?{pending:{items:P,noun:"facts"}}:{}}}}let y=c.match(xC);if(y){let D=y[3].toLowerCase(),U=X(a,y[2]),G=new Set([...X(a,y[1])].map(L=>l(`mgx:${D}-${L.replace(/\s+/g,"-")}`))),I=(await it(e,r)).filter(L=>G.has(l(L.predicate))&&U.has(a(L.subject)));if(I.length){let C=Ze(hn(I),o).map(oe),P=C.slice(0,je),N=C.slice(je),W=N.length?`
195
+ `)+N,replace:!0,...P.length?{pending:{items:P,noun:"facts"}}:{}}}}let y=c.match(NC);if(y){let D=y[3].toLowerCase(),U=Y(a,y[2]),G=new Set([...Y(a,y[1])].map(L=>l(`mgx:${D}-${L.replace(/\s+/g,"-")}`))),I=(await it(e,r)).filter(L=>G.has(l(L.predicate))&&U.has(a(L.subject)));if(I.length){let C=Ze(gn(I),o).map(ie),P=C.slice(0,Se),N=C.slice(Se),B=N.length?`
196
196
  \u2026and ${N.length} more \u2014 say 'more' to see them.`:"";return{text:P.join(`
197
- `)+W,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}let w=n?.parsed?.shape==="meta"?n.parsed.object:null,v=n?.parsed&&n.parsed.node!=="miss";if(!w&&s&&!v&&!t$.test(c)){let D=c.match(k$)||c.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);D&&(w=Ws(D[1]))}if(!w&&n?.ambiguous&&Array.isArray(n.candidateParses)){let D=n.candidateParses.find(U=>U?.shape==="meta"&&U.object);D&&(w=Ws(String(D.object)))}if(w){let D=QI(w),{predicate:U}=D,G=D.subject.replace(/^(?:the|an?)\s+/i,"").trim()||D.subject,I=!1;if(U&&fs.test(G)){if(!i){let q=String(vo[U]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${G.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${q?` ${q}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}G=i,I=!0}let L=X(a,G),C=(await it(e,r)).filter(q=>L.has(q.subject)&&!Vy.has(q.predicate)),P=U?C.filter(q=>l(q.predicate)===U):C;if(!U&&P.length&&!P.some(Kd)&&(P=[]),!P.length){if(U&&(C.length||I))return{text:`I don't have any "${vo[U]}" facts about ${G}.`,replace:s,...C.length?{}:{miss:!0}};if(!U){let q=Ze((await it(e,r)).filter(ne=>L.has(ne.object)),o);if(q.length&&!q.some(Kd)&&(q=[]),q.length){let ne=q.map(oe),te=ne.slice(0,je),xe=ne.slice(je),Ae=xe.length?`
198
- \u2026and ${xe.length} more \u2014 say 'more' to see them.`:"";return{text:te.join(`
199
- `)+Ae,replace:s,...xe.length?{pending:{items:xe,noun:"facts"}}:{}}}}return null}P=Ze(P,o);let N=await it(e,r),{lines:W,grouped:V}=Ky(P,N,L),ie=!U&&W.length>eC?await tC(G,P,N,W):null;if(ie)return{...ie,replace:s};if(V)return{...V,replace:s};let ce=W.slice(0,je),K=W.slice(je),ee=K.length?`
200
- \u2026and ${K.length} more \u2014 say 'more' to see them.`:"";return{text:ce.join(`
201
- `)+ee,replace:s,...K.length?{pending:{items:K,noun:"facts"}}:{}}}if(!s)return null;let _=c.match(PI);if(_){let U=`mgx:${_[2].toLowerCase().replace(/\s+/g,"-")}-than`,G=await Hd(e),I=ce=>{let K=ce.replace(/^(?:an?|the)\s+/i,"").trim();return i&&fs.test(K)?i:K},L=I(_[1]),C=I(_[3]),P=X(a,L),N=X(a,C),W=G.find(ce=>ce.predicate===U&&P.has(ce.subject)&&N.has(ce.object));if(W){let ce=G.find(ee=>ee.predicate===U&&P.has(ee.object)&&N.has(ee.subject)),K=ce?` \u2014 though you also told me the opposite: ${oe(ce)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${oe(W)}${K}`,replace:!0}}let V=G.filter(ce=>ce.predicate===U&&(P.has(ce.subject)||P.has(ce.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${V.length?` I do know: ${V.slice(0,3).map(oe).join("; ")}.`:""} If it's true, teach me: "${L} is ${_[2].toLowerCase()} than ${C}".`,replace:!0,miss:!0}}for(let{predicate:D,phrase:U,re:G}of LC){let I=c.match(G);if(!I)continue;let L=await Hd(e),C=X(a,I[1]),P=X(a,I[2]),N=L.find(V=>V.predicate===D&&C.has(V.subject)&&P.has(V.object));if(N)return{text:`yes \u2014 ${oe(N)}`,replace:!0};let W=L.filter(V=>V.predicate===D&&C.has(V.subject));if(W.length){let V=W.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${I[1]} ${U} ${I[2]}. I do know: ${V}.`,replace:!0,miss:!0}}if(!n?.parsed&&L.some(V=>C.has(V.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${I[1]} ${U} ${I[2]}.`,replace:!0,miss:!0};break}let $=c.match(Fs)||Qd(c);if($){let D=X(a,$[1]),U=X(a,$[2]),G=await it(e,r),I=N=>D.has(N.subject)&&U.has(N.object),{DISJOINT_PREDICATE:L}=await Promise.resolve().then(()=>(Ht(),un)),C=N=>D.has(N.subject)||D.has(N.object)||U.has(N.subject)||U.has(N.object);return G.some(N=>N.predicate===L&&$o(N)&&C(N))?null:b$(G.find(N=>ms.has(N.predicate)&&I(N)),G.find(N=>N.predicate===la&&I(N)))}let x=ep(c),S=x.match(mC);if(S){let D=await it(e,r),U=S[1],G=Zy(S[2],S[3],D);if(G&&x!==Qy(c)&&(G=Jy(G)),G&&U)return{text:`I can't speak for ${U.trim()} ${S[2]} \u2014 what I remember is generic, not universal. ${G.text}.`,replace:!0};if(G)return G;let I=X(a,S[2]),L=D.filter(C=>C.predicate==="mgx:capableOf"&&I.has(C.subject));if(L.length){let C=L.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${S[2]} can ${S[3]}. I do know: ${C}. If it's true, teach me: "a ${L[0].subject} can ${S[3]}".`,replace:!0,miss:!0}}return e$(S[2],S[3],D)}let E=c.match(hC);if(E){let D=X(a,E[1]),U=X(a,E[2]),G=new Set(["mgx:hasA","tmct:has"]),I=await Hd(e),L=W=>I.find(V=>G.has(V.predicate)&&W.has(V.subject)&&U.has(V.object)),C=L(D);if(C)return{text:`yes \u2014 ${oe(C)}`,replace:!0};let P=[{terms:D,chain:[]}],N=new Set;for(let W=0;W<4;W+=1){let V=[];for(let{terms:ie,chain:ce}of P){let K=I.filter(ee=>ms.has(ee.predicate)&&ie.has(ee.subject)&&!N.has(ee.object));for(let ee of K){if(N.has(ee.object))continue;N.add(ee.object);let q=[...ce,ee],ne=L(X(a,ee.object));if(ne)return{text:`yes \u2014 ${[...q.map(oe),oe(ne)].join("; ")}`,replace:!0};V.push({terms:X(a,ee.object),chain:q})}}if(!V.length)break;P=V}return null}let R=ep(c),j=R.match(EC);if(j){let D=await it(e,r),U=!!j[1],G=X(a,j[2]),I=X(a,j[3]),L=Zy(j[2],j[3],D);if(L&&R!==Qy(c)&&(L=Jy(L)),L&&U)return{text:`I can't speak for ${j[1].trim()} ${j[2]} \u2014 what I remember is generic, not universal. ${L.text}.`,replace:!0};if(L)return L;if(s){let C=D.filter(N=>N.predicate==="mgx:capableOf"&&G.has(N.subject));if(C.length){let N=C.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${j[2]} can ${j[3]}. I do know: ${N}. If it's true, teach me: "a ${C[0].subject} can ${j[3]}".`,replace:!0,miss:!0}}let P=e$(j[2],j[3],D);if(P)return P;if(!/\s/.test(j[2].trim())&&!D.some(N=>G.has(N.subject)||G.has(N.object))){let N=rp(gc(j[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${j[2]}" yet. Teach me "a ${N} can ${j[3]}" (or "a ${N} cannot ${j[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let A=c.match(gC);if(A){let D=X(a,A[1]),U=(await it(e,r)).filter(N=>(N.predicate==="mgx:capableOf"||N.predicate===Jo)&&D.has(N.subject));if(!U.length)return null;let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
197
+ `)+B,replace:!0,...N.length?{pending:{items:N,noun:"facts"}}:{}}}}let w=n?.parsed?.shape==="meta"?n.parsed.object:null,v=n?.parsed&&n.parsed.node!=="miss";if(!w&&s&&!v&&!c$.test(c)){let D=c.match(O$)||c.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);D&&(w=bs(D[1]))}if(!w&&s){let D=c.match(dO);D&&(w=bs(en(D[1].trim())))}if(!w&&n?.ambiguous&&Array.isArray(n.candidateParses)){let D=n.candidateParses.find(U=>U?.shape==="meta"&&U.object);D&&(w=bs(String(D.object)))}if(w){let D=dC(w),{predicate:U}=D,G=D.subject.replace(/^(?:the|an?)\s+/i,"").trim()||D.subject,I=!1;if(U&&hs.test(G)){if(!i){let V=String(xo[U]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${G.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${V?` ${V}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}G=i,I=!0}let L=Y(a,G),C=(await it(e,r)).filter(V=>L.has(V.subject)&&!Zy.has(V.predicate)),P=U?C.filter(V=>l(V.predicate)===U):C;if(!U&&P.length&&!P.some(Qd)&&(P=[]),!P.length){if(U&&(C.length||I))return{text:`I don't have any "${xo[U]}" facts about ${G}.`,replace:s,...C.length?{}:{miss:!0}};if(!U){let V=Ze((await it(e,r)).filter(re=>L.has(re.object)),o);if(V.length&&!V.some(Qd)&&(V=[]),V.length){let re=V.map(ie),oe=re.slice(0,Se),ge=re.slice(Se),Te=ge.length?`
198
+ \u2026and ${ge.length} more \u2014 say 'more' to see them.`:"";return{text:oe.join(`
199
+ `)+Te,replace:s,...ge.length?{pending:{items:ge,noun:"facts"}}:{}}}}return null}P=Ze(P,o);let N=await it(e,r),{lines:B,grouped:H}=t$(P,N,L),se=!U&&B.length>fC?await hC(G,P,N,B):null;if(se)return{...se,replace:s};if(H)return{...H,replace:s};let ae=B.slice(0,Se),X=B.slice(Se),ee=X.length?`
200
+ \u2026and ${X.length} more \u2014 say 'more' to see them.`:"";return{text:ae.join(`
201
+ `)+ee,replace:s,...X.length?{pending:{items:X,noun:"facts"}}:{}}}if(!s)return null;let _=c.match(YI);if(_){let U=`mgx:${_[2].toLowerCase().replace(/\s+/g,"-")}-than`,G=await Jd(e),I=ae=>{let X=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&hs.test(X)?i:X},L=I(_[1]),C=I(_[3]),P=Y(a,L),N=Y(a,C),B=G.find(ae=>ae.predicate===U&&P.has(ae.subject)&&N.has(ae.object));if(B){let ae=G.find(ee=>ee.predicate===U&&P.has(ee.object)&&N.has(ee.subject)),X=ae?` \u2014 though you also told me the opposite: ${ie(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${ie(B)}${X}`,replace:!0}}let H=G.filter(ae=>ae.predicate===U&&(P.has(ae.subject)||P.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${H.length?` I do know: ${H.slice(0,3).map(ie).join("; ")}.`:""} If it's true, teach me: "${L} is ${_[2].toLowerCase()} than ${C}".`,replace:!0,miss:!0}}for(let{predicate:D,phrase:U,re:G}of HC){let I=c.match(G);if(!I)continue;let L=await Jd(e),C=Y(a,I[1]),P=Y(a,I[2]),N=L.find(H=>H.predicate===D&&C.has(H.subject)&&P.has(H.object));if(N)return{text:`yes \u2014 ${ie(N)}`,replace:!0};let B=L.filter(H=>H.predicate===D&&C.has(H.subject));if(B.length){let H=B.slice(0,3).map(ie).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${I[1]} ${U} ${I[2]}. I do know: ${H}.`,replace:!0,miss:!0}}if(!n?.parsed&&L.some(H=>C.has(H.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${I[1]} ${U} ${I[2]}.`,replace:!0,miss:!0};break}let $=c.match(zs)||sp(c);if($){let D=Y(a,$[1]),U=Y(a,$[2]),G=await it(e,r),I=N=>D.has(N.subject)&&U.has(N.object),{DISJOINT_PREDICATE:L}=await Promise.resolve().then(()=>(qt(),dn)),C=N=>D.has(N.subject)||D.has(N.object)||U.has(N.subject)||U.has(N.object);return G.some(N=>N.predicate===L&&vo(N)&&C(N))?null:k$(G.find(N=>ms.has(N.predicate)&&I(N)),G.find(N=>N.predicate===pa&&I(N)))}let x=rp(c),S=x.match(_C);if(S){let D=await it(e,r),U=S[1],G=i$(S[2],S[3],D);if(G&&x!==r$(c)&&(G=o$(G)),G&&U)return{text:`I can't speak for ${U.trim()} ${S[2]} \u2014 what I remember is generic, not universal. ${G.text}.`,replace:!0};if(G)return G;let I=Y(a,S[2]),L=D.filter(C=>C.predicate==="mgx:capableOf"&&I.has(C.subject));if(L.length){let C=L.slice(0,3).map(ie).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${S[2]} can ${S[3]}. I do know: ${C}. If it's true, teach me: "a ${L[0].subject} can ${S[3]}".`,replace:!0,miss:!0}}return a$(S[2],S[3],D)}let E=c.match(RC);if(E){let D=Y(a,E[1]),U=Y(a,E[2]),G=new Set(["mgx:hasA","tmct:has"]),I=await Jd(e),L=B=>I.find(H=>G.has(H.predicate)&&B.has(H.subject)&&U.has(H.object)),C=L(D);if(C)return{text:`yes \u2014 ${ie(C)}`,replace:!0};let P=[{terms:D,chain:[]}],N=new Set;for(let B=0;B<4;B+=1){let H=[];for(let{terms:se,chain:ae}of P){let X=I.filter(ee=>ms.has(ee.predicate)&&se.has(ee.subject)&&!N.has(ee.object));for(let ee of X){if(N.has(ee.object))continue;N.add(ee.object);let V=[...ae,ee],re=L(Y(a,ee.object));if(re)return{text:`yes \u2014 ${[...V.map(ie),ie(re)].join("; ")}`,replace:!0};H.push({terms:Y(a,ee.object),chain:V})}}if(!H.length)break;P=H}return null}let R=rp(c),j=R.match(PC);if(j){let D=await it(e,r),U=!!j[1],G=Y(a,j[2]),I=Y(a,j[3]),L=i$(j[2],j[3],D);if(L&&R!==r$(c)&&(L=o$(L)),L&&U)return{text:`I can't speak for ${j[1].trim()} ${j[2]} \u2014 what I remember is generic, not universal. ${L.text}.`,replace:!0};if(L)return L;if(s){let C=D.filter(N=>N.predicate==="mgx:capableOf"&&G.has(N.subject));if(C.length){let N=C.slice(0,3).map(ie).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${j[2]} can ${j[3]}. I do know: ${N}. If it's true, teach me: "a ${C[0].subject} can ${j[3]}".`,replace:!0,miss:!0}}let P=a$(j[2],j[3],D);if(P)return P;if(!/\s/.test(j[2].trim())&&!D.some(N=>G.has(N.subject)||G.has(N.object))){let N=up(yc(j[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${j[2]}" yet. Teach me "a ${N} can ${j[3]}" (or "a ${N} cannot ${j[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let A=c.match(TC);if(A){let D=Y(a,A[1]),U=(await it(e,r)).filter(N=>(N.predicate==="mgx:capableOf"||N.predicate===Jo)&&D.has(N.subject));if(!U.length)return null;let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
202
202
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
203
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let F=c.match(jC);if(F){let D=X(a,F[1]),U=X(a,F[2]),G=await it(e,r),I=hn(G.filter(L=>L.predicate==="mgx:capableOf"&&U.has(L.object))).filter(L=>da(new Set([L.subject]),U,G).verdict==="yes");if(I.length){let{findIsaChain:L,SUBCLASS_PREDICATE:C,TYPE_PREDICATE:P}=await Promise.resolve().then(()=>(Ht(),un)),N=G.filter(re=>re.predicate===C),W=G.filter(re=>re.predicate===P),V=N.map(re=>[re.subject,re.object]),ie=W.map(re=>[re.subject,re.object]),ce=re=>(re.predicate===C?N:W).find(fe=>fe.subject===re.subject&&fe.object===re.object),K=new Map,ee=I.filter(re=>D.has(re.subject)?!0:(K.has(re.subject)||K.set(re.subject,L(re.subject,D,ie,V,{maxHops:3})),!!K.get(re.subject))),ne=Ze(ee.length?ee:I,o).map(re=>{let fe=ee.length?K.get(re.subject):null;if(!fe||fe.length<2)return oe(re);let be=fe.map(ce);if(!be.every(Boolean))return oe(re);let Ie=be.map(ue=>`${Dt(ue)}${ue.provenance?` (source: ${zn(ue.provenance)})`:""}`).join("; ");return`${oe(re)} \u2014 via: ${Ie}`}),te=ne.slice(0,je),xe=ne.slice(je),Ae=xe.length?`
204
- \u2026and ${xe.length} more \u2014 say 'more' to see them.`:"";return{text:(ee.length?"":`nothing I remember ties these to "${F[1]}", but:
205
- `)+te.join(`
206
- `)+Ae,replace:!0,...xe.length?{pending:{items:xe,noun:"facts"}}:{}}}}let T=c.match(kC);if(T&&T[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,T[1]),U=(await it(e,r)).filter(G=>G.predicate==="mgxneg:capableOf"&&D.has(G.object));if(U.length){let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
203
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let F=c.match(DC);if(F){let D=Y(a,F[1]),U=Y(a,F[2]),G=await it(e,r),I=gn(G.filter(L=>L.predicate==="mgx:capableOf"&&U.has(L.object))).filter(L=>ha(new Set([L.subject]),U,G).verdict==="yes");if(I.length){let{findIsaChain:L,buildSubClassSuccessors:C,SUBCLASS_PREDICATE:P,TYPE_PREDICATE:N}=await Promise.resolve().then(()=>(qt(),dn)),B=G.filter(ne=>ne.predicate===P),H=G.filter(ne=>ne.predicate===N),se=B.map(ne=>[ne.subject,ne.object]),ae=H.map(ne=>[ne.subject,ne.object]),X=C(se),ee=ne=>(ne.predicate===P?B:H).find(ke=>ke.subject===ne.subject&&ke.object===ne.object),V=new Map,re=I.filter(ne=>D.has(ne.subject)?!0:(V.has(ne.subject)||V.set(ne.subject,L(ne.subject,D,ae,X,{maxHops:3})),!!V.get(ne.subject))),ge=Ze(re.length?re:I,o).map(ne=>{let ke=re.length?V.get(ne.subject):null;if(!ke||ke.length<2)return ie(ne);let le=ke.map(ee);if(!le.every(Boolean))return ie(ne);let q=le.map(te=>`${Dt(te)}${te.provenance?` (source: ${Un(te.provenance)})`:""}`).join("; ");return`${ie(ne)} \u2014 via: ${q}`}),Te=ge.slice(0,Se),ue=ge.slice(Se),Ae=ue.length?`
204
+ \u2026and ${ue.length} more \u2014 say 'more' to see them.`:"";return{text:(re.length?"":`nothing I remember ties these to "${F[1]}", but:
205
+ `)+Te.join(`
206
+ `)+Ae,replace:!0,...ue.length?{pending:{items:ue,noun:"facts"}}:{}}}}let T=c.match(FC);if(T&&T[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=Y(a,T[1]),U=(await it(e,r)).filter(G=>G.predicate==="mgxneg:capableOf"&&D.has(G.object));if(U.length){let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
207
207
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
208
- `)+P,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 M=c.match(SC);if(M&&M[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=X(a,M[1]),U=Zl(D,await it(e,r));if(U.length){let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
208
+ `)+P,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 M=c.match(MC);if(M&&M[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let D=Y(a,M[1]),U=su(D,await it(e,r));if(U.length){let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
209
209
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
210
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let z=c.match(bC);if(z&&!NC.has(z[1].trim().split(/\s+/)[0]?.toLowerCase())){let D=X(a,z[1]),U=(await it(e,r)).filter(N=>N.predicate==="mgx:hasA"&&D.has(N.object));if(!U.length)return null;let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
210
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}}let z=c.match(AC);if(z&&!KC.has(z[1].trim().split(/\s+/)[0]?.toLowerCase())){let D=Y(a,z[1]),U=(await it(e,r)).filter(N=>N.predicate==="mgx:hasA"&&D.has(N.object));if(!U.length)return null;let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
211
211
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
212
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let Y=c.match(t$),ae=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:Y?.[1];if(ae){let D=X(a,ae),U=(await it(e,r)).filter(N=>ms.has(N.predicate)&&D.has(N.object));if(!U.length)return null;let I=Ze(hn(U),o).map(oe),L=I.slice(0,je),C=I.slice(je),P=C.length?`
212
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let K=c.match(c$),ce=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:K?.[1];if(ce){let D=Y(a,ce),U=(await it(e,r)).filter(N=>ms.has(N.predicate)&&D.has(N.object));if(!U.length)return null;let I=Ze(gn(U),o).map(ie),L=I.slice(0,Se),C=I.slice(Se),P=C.length?`
213
213
  \u2026and ${C.length} more \u2014 say 'more' to see them.`:"";return{text:L.join(`
214
- `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let Z=c.match(fC);if(Z){let D=X(a,Z[1]),U=await it(e,r),G=H=>!String(H.provenance||"").includes("corpus:")&&!String(H.provenance||"").includes("web:"),I=U.filter(H=>ms.has(H.predicate)&&G(H)),L=new Set,C=D;for(let H=0;H<8&&C.size;H+=1){let se=new Set;for(let De of I)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 et=new Set;for(let De of se)for(let Ve of X(a,De))et.add(Ve);C=et}let P=U.filter(H=>D.has(H.subject)||D.has(H.object)||L.has(H.subject));if(!P.length){let H=a(Z[1]).split(/\s+/).filter(se=>se.length>=4&&!w$.has(se));if(H.length){let se=De=>new Set(String(De||"").split(/\s+/)),et=De=>{let Ve=se(De);return H.some(on=>Ve.has(on))};P=U.filter(De=>et(De.subject)||et(De.object))}}P=P.filter(H=>!Vy.has(H.predicate));let N=P.length>0&&!P.some(Kd);if(!P.length)return null;let{findConsistencyViolations:W,TYPE_PREDICATE:V,SUBCLASS_PREDICATE:ie,DISJOINT_PREDICATE:ce}=await Promise.resolve().then(()=>(Ht(),un)),K=H=>!H.provenance?.includes("corpus:")&&!H.provenance?.includes("web:"),ee=U.filter(H=>H.predicate===V&&K(H)).map(H=>[H.subject,H.object]),q=U.filter(H=>H.predicate===ie&&K(H)).map(H=>[H.subject,H.object]),ne=U.filter(H=>H.predicate===ce&&K(H)).map(H=>[H.subject,H.object]);if(ne.length){let se=W(ee,q,ne,{focus:D,budget:5}).find(et=>D.has(et.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 te=P.find(H=>D.has(H.subject)||D.has(H.object)),xe=te?D.has(te.subject)?te.subject:te.object:Z[1].trim(),Ae=P.some(H=>L.has(H.subject)&&!D.has(H.subject)&&!D.has(H.object));P=Ze(P,o);let pe=`${P.length} remembered fact${P.length===1?"":"s"} about ${xe}${Ae?" (including its known subtypes)":""}:`,{lines:re,grouped:fe}=Ky(P,U,D,{indent:" "});if(fe)return{...fe,text:`${pe}
215
- ${fe.text}`,...N?{weakOnly:!0}:{}};let be=re.slice(0,je),Ie=re.slice(je),ue=Ie.length?`
216
- \u2026and ${Ie.length} more \u2014 say 'more' to see them.`:"";return{text:`${pe}
217
- ${be.join(`
218
- `)}${ue}`,replace:!0,...Ie.length?{pending:{items:Ie.map(H=>H.trim()),noun:"facts"}}:{},...N?{weakOnly:!0}:{}}}return null}async function HC(e,t){let n=await bi(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(o=>o?.id===n.id))?.class;return s&&Wy[s]?Wy[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<YC;r+=1){let i=null;for(let a of e.relations||[])if(KC.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 S$(e,t,n,s,o=null,r=null,i={},a=null){return E$(await XC(e,t,n,s,o,r,i,a),n,t)}async function XC(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let l;try{({normFactTerm:l}=await Promise.resolve().then(()=>(qe(),Os)))}catch{return null}let c=String(t).trim();if(o){let I=c.match(Fs);if(I){let L=await bi(o,I[1]);if(L){let C=X(l,an(I[2])),P=hc(o,L.id).find(W=>[...X(l,W.label)].some(V=>C.has(V)));if(P)return{text:`yes \u2014 the code graph says ${L.label} inherits ${P.label}.`,replace:!0};let N=await bi(o,an(I[2]));if(N&&hc(o,N.id).some(W=>W.id===L.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${N.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 it(e,a);if(!d.length){if(!Fs.test(u)&&!Jd.test(u)){let L=u.match(s$);if(L){let C=L[1].trim(),P=fs.test(C)?r||null:C;if(P&&!/^there\b/i.test(P)&&!n?.parsed&&!r$.test(C)&&!o$.test(C)&&!qy.test(L[2].trim()))return i$(P,L[2].trim().toLowerCase())}}let I=u.match(Fs)||Qd(c);if(!(I&&!/^there\b/i.test(I[1].trim())||Xy.test(c)))return null}let f=d.filter(I=>ms.has(I.predicate)),p=(I,L)=>L.trust-I.trust,m=I=>{let L=I.map(oe),C=L.slice(0,je),P=L.slice(je),N=P.length?`
214
+ `)+P,replace:!0,...C.length?{pending:{items:C,noun:"facts"}}:{}}}let Z=c.match(jC);if(Z){let D=Y(a,Z[1]),U=await it(e,r),G=q=>!String(q.provenance||"").includes("corpus:")&&!String(q.provenance||"").includes("web:"),I=U.filter(q=>ms.has(q.predicate)&&G(q)),L=new Set,C=D;for(let q=0;q<8&&C.size;q+=1){let te=new Set;for(let Fe of I)C.has(Fe.object)&&!L.has(Fe.subject)&&te.add(Fe.subject);if(!te.size)break;for(let Fe of te)L.add(Fe);let qe=new Set;for(let Fe of te)for(let et of Y(a,Fe))qe.add(et);C=qe}let P=U.filter(q=>D.has(q.subject)||D.has(q.object)||L.has(q.subject));if(!P.length){let q=a(Z[1]).split(/\s+/).filter(te=>te.length>=4&&!j$.has(te));if(q.length){let te=Fe=>new Set(String(Fe||"").split(/\s+/)),qe=Fe=>{let et=te(Fe);return q.some(rn=>et.has(rn))};P=U.filter(Fe=>qe(Fe.subject)||qe(Fe.object))}}P=P.filter(q=>!Zy.has(q.predicate));let N=P.length>0&&!P.some(Qd);if(!P.length)return null;let{findConsistencyViolations:B,TYPE_PREDICATE:H,SUBCLASS_PREDICATE:se,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(qt(),dn)),X=q=>!q.provenance?.includes("corpus:")&&!q.provenance?.includes("web:"),ee=U.filter(q=>q.predicate===H&&X(q)).map(q=>[q.subject,q.object]),V=U.filter(q=>q.predicate===se&&X(q)).map(q=>[q.subject,q.object]),re=U.filter(q=>q.predicate===ae&&X(q)).map(q=>[q.subject,q.object]);if(re.length){let te=B(ee,V,re,{focus:D,budget:5}).find(qe=>D.has(qe.subject));if(te)return{text:`I can't answer that \u2014 what I've been told about ${te.subject} is inconsistent: it's taught to be both ${te.classA} and ${te.classB}, but ${te.viaA} and ${te.viaB} are disjoint (${te.viaA} owl:disjointWith ${te.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let oe=P.find(q=>D.has(q.subject)||D.has(q.object)),ge=oe?D.has(oe.subject)?oe.subject:oe.object:Z[1].trim(),Te=P.some(q=>L.has(q.subject)&&!D.has(q.subject)&&!D.has(q.object));P=Ze(P,o);let ue=`${P.length} remembered fact${P.length===1?"":"s"} about ${ge}${Te?" (including its known subtypes)":""}:`,{lines:Ae,grouped:Ie}=t$(P,U,D,{indent:" "});if(Ie)return{...Ie,text:`${ue}
215
+ ${Ie.text}`,...N?{weakOnly:!0}:{}};let ne=Ae.slice(0,Se),ke=Ae.slice(Se),le=ke.length?`
216
+ \u2026and ${ke.length} more \u2014 say 'more' to see them.`:"";return{text:`${ue}
217
+ ${ne.join(`
218
+ `)}${le}`,replace:!0,...ke.length?{pending:{items:ke.map(q=>q.trim()),noun:"facts"}}:{},...N?{weakOnly:!0}:{}}}return null}async function iO(e,t){let n=await wi(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(o=>o?.id===n.id))?.class;return s&&tp[s]?tp[s][0]:null}function wc(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<cO;r+=1){let i=null;for(let a of e.relations||[])if(aO.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 C$(e,t,n,s,o=null,r=null,i={},a=null){return I$(await lO(e,t,n,s,o,r,i,a),n,t)}async function lO(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let l;try{({normFactTerm:l}=await Promise.resolve().then(()=>(Ve(),Ns)))}catch{return null}let c=String(t).trim();if(o){let I=c.match(zs);if(I){let L=await wi(o,I[1]);if(L){let C=Y(l,en(I[2])),P=wc(o,L.id).find(B=>[...Y(l,B.label)].some(H=>C.has(H)));if(P)return{text:`yes \u2014 the code graph says ${L.label} inherits ${P.label}.`,replace:!0};let N=await wi(o,en(I[2]));if(N&&wc(o,N.id).some(B=>B.id===L.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${N.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 it(e,a);if(!d.length){if(!zs.test(u)&&!np.test(u)){let L=u.match(u$);if(L){let C=L[1].trim(),P=hs.test(C)?r||null:C;if(P&&!/^there\b/i.test(P)&&!n?.parsed&&!p$.test(C)&&!d$.test(C)&&!Qy.test(L[2].trim()))return f$(P,L[2].trim().toLowerCase())}}let I=u.match(zs)||sp(c);if(!(I&&!/^there\b/i.test(I[1].trim())||s$.test(c)))return null}let f=d.filter(I=>ms.has(I.predicate)),p=(I,L)=>L.trust-I.trust,h=I=>{let L=I.map(ie),C=L.slice(0,Se),P=L.slice(Se),N=P.length?`
219
219
  \u2026and ${P.length} more \u2014 say 'more' to see them.`:"";return{text:C.join(`
220
- `)+N,replace:!0,...P.length?{pending:{items:P,noun:"facts"}}:{}}};if(VC.test(c)){let I=Ze(f.length?f:d,i);return I.length?m(I):null}let h=u.match(Jd);if(h){let I=h[1].trim(),L=fs.test(I)?r||null:I,C=h[2].trim().toLowerCase(),P=h[3].trim();if(L&&!Zd.has(C)){let N=zd(d),{findIsaChain:W}=await Promise.resolve().then(()=>(Ht(),un)),V=Ae=>{let pe=String(Ae||"").trim().toLowerCase(),re=[];for(let fe of d){let be=Vd(fe.predicate);if(!be)continue;if(be===pe){re.push({fact:fe,aliasFacts:[]});continue}let Ie=Ud(W,be,new Set([pe]),N,{maxHops:2});if(!Ie)continue;let ue=Ie.map(H=>d.find(se=>se.predicate===wi&&se.subject===H.subject&&se.object===H.object));ue.every(Boolean)&&re.push({fact:fe,aliasFacts:ue})}return re},{loadMemory:ie,findRuleByName:ce,resolveRelationChase:K}=await Promise.resolve().then(()=>(qe(),Os)),{findActionPath:ee}=await Promise.resolve().then(()=>(Js(),Ii)),q=await ie(e),te=await K(q,C,L,P,{relationFactsFor:V,renderFactLine:oe,factPhrase:Dt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Dd,findActionPath:ee});return te?{text:`yes \u2014 ${te.citation.join("; ")}`,replace:!0}:V(C).length>0||!!ce(q,C)?{text:`I know the '${C}' relation, but I can't confirm ${L} is the ${C} of ${P} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${C}' yet.`,replace:!0}}}let g=bc(u).match(y$)||$$(u,I=>{let L=X(l,I);return d.some(C=>L.has(C.subject)||L.has(C.object))});if(g){let I=g[1].trim().toLowerCase(),L=g[2].trim(),C=fs.test(L)?r||null:L;if(C&&!Zd.has(I)){let P=zd(d),{findIsaChain:N}=await Promise.resolve().then(()=>(Ht(),un)),W=Ae=>{let pe=String(Ae||"").trim().toLowerCase(),re=[];for(let fe of d){let be=Vd(fe.predicate);if(!be)continue;if(be===pe){re.push({fact:fe,aliasFacts:[]});continue}let Ie=Ud(N,be,new Set([pe]),P,{maxHops:2});if(!Ie)continue;let ue=Ie.map(H=>d.find(se=>se.predicate===wi&&se.subject===H.subject&&se.object===H.object));ue.every(Boolean)&&re.push({fact:fe,aliasFacts:ue})}return re},{loadMemory:V,findRuleByName:ie,resolveRelationChaseReverse:ce}=await Promise.resolve().then(()=>(qe(),Os)),K=await V(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(Js(),Ii)),ne=await ce(K,I,C,{relationFactsFor:W,renderFactLine:oe,factPhrase:Dt,factTermVariants:X,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Dd,findReachableSet:ee});return ne.length?{text:ne.map(pe=>`${pe.subject} \u2014 ${pe.citation.join("; ")}`).join(`
221
- `),replace:!0}:W(I).length>0||!!ie(K,I)?{text:/^what\b/i.test(bc(u))?`I don't know what the ${I} of ${C} is from what you've told me.`:`I don't know anyone who is the ${I} of ${C} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${I}' yet.`,replace:!0}}}{let I=u.match(JC);if(I){let L=X(l,I[1]),C=Ze(d.filter(P=>L.has(P.subject)||L.has(P.object)),i);if(C.length){let P=C.map(oe),N=P.slice(0,je),W=P.slice(je),V=W.length?`
222
- \u2026and ${W.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
223
- `)+V,replace:!0,...W.length?{pending:{items:W,noun:"facts"}}:{}}}}}let b=u.match(lC);if(b){let I=rp(b[1].trim().toLowerCase()),L=b[2].trim(),C=fs.test(L)?r||null:L;if(C){let{loadMemory:P,findRuleByName:N,RULE_KIND_PROP:W,RULE_KIND_RECURSIVE:V}=await Promise.resolve().then(()=>(qe(),Os)),ie=await P(e),ce=N(ie,I),K=ce?.attributes?.find(ee=>ee.prop===W)?.value;if(ce&&K===V){let ee=ce.attributes.find(te=>te.prop==="mgx:ruleBaseCase")?.value,q=ce.attributes.find(te=>te.prop==="mgx:ruleRecStep")?.value,ne=l(C);if(ee&&q&&ne){let te=zd(d),{findIsaChain:xe}=await Promise.resolve().then(()=>(Ht(),un)),Ae=Ie=>{let ue=String(Ie||"").trim().toLowerCase(),H=[];for(let se of d){let et=Vd(se.predicate);if(!et)continue;if(et===ue){H.push({fact:se,aliasFacts:[]});continue}let De=Ud(xe,et,new Set([ue]),te,{maxHops:2});if(!De)continue;let Ve=De.map(on=>d.find(rn=>rn.predicate===wi&&rn.subject===on.subject&&rn.object===on.object));Ve.every(Boolean)&&H.push({fact:se,aliasFacts:Ve})}return H},{findReachableSet:pe}=await Promise.resolve().then(()=>(Js(),Ii)),be=pe({entity:ne,hop:0},Ie=>{let ue=Ie.hop===0?ee:q;return Ae(ue).filter(H=>H.fact.subject===Ie.entity).map(H=>({action:H,nextState:{entity:H.fact.object,hop:Ie.hop+1}}))},{maxDepth:20,stateKey:Ie=>Ie.entity});if(be.length)return{text:be.map(({node:ue,path:H})=>{let se=new Set,et=[];for(let De of H.actions){et.push(oe(De.fact));for(let Ve of De.aliasFacts){let on=Ve.id||`${Ve.subject}|${Ve.predicate}|${Ve.object}`;se.has(on)||(se.add(on),et.push(`${Dt(Ve)}${Ve.provenance?` (source: ${zn(Ve.provenance)})`:""}`))}}return`${ue.entity} \u2014 ${et.join("; ")}`}).join(`
224
- `),replace:!0}}}return null}}let y=c.match(Xy),w=c.match(Fs)||Qd(c)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(Fs);if(w){let I=X(l,an(w[2])),L=r&&fs.test(w[1].trim())?r:w[1],C=new Set(X(l,L));if([...C].some(B=>I.has(B))){let B=an(w[2]).trim();return{text:`yes \u2014 ${br(B)} ${B} is ${br(B)} ${B}, trivially: every kind is a kind of itself.`,replace:!0}}let P=await HC(o,L);if(P)for(let B of X(l,P))C.add(B);let{findIsaChain:N,deriveDisjointViolations:W,SUBCLASS_PREDICATE:V,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:ce}=await Promise.resolve().then(()=>(Ht(),un)),K=$o,ee=f.filter(B=>B.predicate===V&&K(B)),q=f.filter(B=>B.predicate===ie&&K(B)),ne=ee.map(B=>[B.subject,B.object]),te=q.map(B=>[B.subject,B.object]),xe=f.filter(B=>B.predicate===V),Ae=f.filter(B=>B.predicate===ie),pe=Ae.map(B=>[B.subject,B.object]),re=xe.map(B=>[B.subject,B.object]),fe=d.filter(B=>B.predicate===ce&&K(B)),be=fe.map(B=>[B.subject,B.object]),Ie=fe.length?W(pe.concat(re),re,be,{budget:20,focus:new Set([...C,...I])}):[],ue=B=>{let we=Ie.find(Ne=>Ne.subject===B&&I.has(Ne.object));if(!we)return null;let ye=f.filter(Ne=>I.has(Ne.object)&&(Ne.subject===we.viaClass||Ne.subject===we.subject)).sort(p)[0],_e=fe.find(Ne=>Ne.subject===we.viaClass&&Ne.object===we.object||Ne.subject===we.object&&Ne.object===we.viaClass);return!ye||!_e?null:nC(ye,_e)},H=f.filter(B=>C.has(B.subject)&&I.has(B.object)).sort(p)[0],se=d.filter(B=>B.predicate===la&&C.has(B.subject)&&I.has(B.object)).sort(p)[0],et=fe.find(B=>C.has(B.subject)&&I.has(B.object)||C.has(B.object)&&I.has(B.subject));if(H&&!se){let B=ue(H.subject);if(B)return B}let De=b$(H,se||et);if(De)return De;if(fe.length){let B=_e=>{let Ne=new Set(_e),Ct=new Set(_e);for(let Ce=0;Ce<8&&Ct.size;Ce+=1){let $e=new Set;for(let[at,zs]of re)Ct.has(at)&&!Ne.has(zs)&&$e.add(zs);if(!$e.size)break;for(let at of $e)Ne.add(at);Ct=$e}return Ne},we=B(I),ye=Ie.find(_e=>C.has(_e.subject)&&we.has(_e.object)&&!B([_e.viaClass]).has(_e.object)&&!B([_e.object]).has(_e.viaClass));if(ye){let _e=f.filter($e=>C.has($e.subject)&&$e.object===ye.viaClass).sort(p)[0],Ne=fe.find($e=>$e.subject===ye.viaClass&&$e.object===ye.object||$e.subject===ye.object&&$e.object===ye.viaClass),Ct=!I.has(ye.object),Ce=Ct?f.filter($e=>I.has($e.subject)&&$e.object===ye.object).sort(p)[0]:null;if(_e&&Ne&&(!Ct||Ce)){let $e=an(w[2]).trim();return{text:`no \u2014 ${[_e,...Ce?[Ce]:[]].map(oe).join("; ")}; and ${Dt(Ne)}${Ne.provenance?` (source: ${zn(Ne.provenance)})`:""} \u2014 so ${L} can never be ${br($e)} ${$e}.`,replace:!0}}}}let Ve=await bi(o,L);if(Ve){let B=new Map;for(let ye of hc(o,Ve.id))for(let _e of X(l,ye.label))!C.has(_e)&&!B.has(_e)&&B.set(_e,ye.label);let we=f.filter(ye=>B.has(ye.subject)&&I.has(ye.object)).sort(p)[0];if(we)return{text:`yes \u2014 the code graph says ${Ve.label} inherits ${B.get(we.subject)}, and ${oe(we)}`,replace:!0}}let on=B=>(B.predicate===V?ee:q).find(we=>we.subject===B.subject&&we.object===B.object);for(let B of C){let we=N(B,I,te,ne,{maxHops:2});if(!we)continue;let ye=ue(B);if(ye)return ye;let _e=we.map(on);if(_e.every(Boolean))return{text:`yes \u2014 ${fc(_e)}`,replace:!0}}let rn=B=>(B.predicate===V?xe:Ae).find(we=>we.subject===B.subject&&we.object===B.object);for(let B of C){let we=N(B,I,pe,re,{maxHops:2});if(!we)continue;let ye=ue(B);if(ye)return ye;let _e=we.map(rn);if(_e.every(Boolean)&&_e.some(K))return{text:`yes \u2014 ${fc(_e)}`,replace:!0}}let Xt=L.match(/^(.*\S)\s+not$/i),zt=Xt&&[Xt[0],r&&fs.test(Xt[1].trim())?r:Xt[1]];if(zt){let B=X(l,zt[1]),we=I,ye=f.filter(Ce=>B.has(Ce.subject)&&we.has(Ce.object)).sort(p)[0];if(ye)return{text:`no \u2014 ${oe(ye)}`,replace:!0};let _e=fe.find(Ce=>B.has(Ce.subject)&&we.has(Ce.object)||B.has(Ce.object)&&we.has(Ce.subject));if(_e)return{text:`yes \u2014 ${oe(_e)}`,replace:!0};let Ne=zt[1].trim(),Ct=an(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Ne} and ${Ct}. If no ${Ne} is a ${Ct}, teach me: "no ${Ne} is a ${Ct}".`,replace:!0,miss:!0}}if(fe.length){let B=W(te.concat(ne),ne,be,{budget:10});for(let we of C){let ye=B.find(Ce=>Ce.subject===we&&I.has(Ce.object));if(!ye)continue;let _e=q.concat(ee).find(Ce=>Ce.subject===ye.subject&&Ce.object===ye.viaType),Ne=fe.find(Ce=>Ce.subject===ye.viaClass&&Ce.object===ye.object||Ce.subject===ye.object&&Ce.object===ye.viaClass),Ct=[_e,Ne].filter(Boolean).map(oe);return{text:`no \u2014 ${Ct.length?Ct.join("; "):`${ye.viaClass} and ${ye.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:yi,ON_PROPERTY_PREDICATE:k,SOME_VALUES_FROM_PREDICATE:le,deriveSomeValuesFromSubsumption:Te,ENTAILED_SCM_SVF_PROVENANCE:Un,SCM_SVF_RULE_CONFIDENCE:So,entailedTrustFrom:lp}=await Promise.resolve().then(()=>(Ht(),un)),up=d.filter(B=>B.predicate===k&&K(B)),dp=d.filter(B=>B.predicate===le&&K(B));if(up.length&&dp.length){let B=new Map(dp.map($e=>[$e.subject,$e.object])),we=up.map($e=>({restriction:$e.subject,property:$e.object,target:B.get($e.subject)})).filter($e=>$e.target),ye=new Set([V,ie,ce,k,le,"owl:intersectionOf"]),_e=d.filter($e=>K($e)&&!ye.has($e.predicate)),Ne=_e.map($e=>[$e.subject,$e.predicate,$e.object]),Ct=yi(Ne,te,ne,we,{budget:10});for(let $e of C){let at=Ct.find(bn=>bn.subject===$e&&I.has(bn.object));if(!at)continue;let zs=_e.find(bn=>bn.subject===at.subject&&bn.predicate===at.viaProperty&&bn.object===at.viaValue),Us=q.find(bn=>bn.subject===at.viaValue&&bn.object===at.viaType),yr=[zs,Us].filter(Boolean).map(oe);return{text:`yes \u2014 ${yr.length?yr.join("; "):`${at.subject} ${at.viaProperty} ${at.viaValue}, and ${at.viaValue} is a ${at.viaType}.`}`,replace:!0}}let Ce=we.length>1?Te(we,ne,{budget:10}):[];if(Ce.length){let $e=ne.concat(Ce.map(Se=>[Se.subject,Se.object])),at=new Map(we.map(Se=>[Se.restriction,Se])),zs=new Map;for(let Se of d)zs.set(`${Se.subject}\0${Se.predicate}\0${Se.object}`,Se.trust);let Us=(Se,kn,Ut)=>zs.get(`${Se}\0${kn}\0${Ut}`),yr=new Map;for(let Se of Ce){let kn=at.get(Se.subject),Ut=at.get(Se.object),Jt=[kn&&Us(Se.subject,k,kn.property),Us(Se.subject,le,Se.viaY1),Ut&&Us(Se.object,k,Ut.property),Us(Se.object,le,Se.viaY2),Us(Se.viaY1,V,Se.viaY2)].filter(q$=>typeof q$=="number"),vi=lp(Jt,So);vi!==null&&yr.set(`${Se.subject}\0${Se.object}`,vi)}let bn=Se=>{if(Se.predicate!==V)return q.find(Jt=>Jt.subject===Se.subject&&Jt.object===Se.object);let kn=ee.find(Jt=>Jt.subject===Se.subject&&Jt.object===Se.object);if(kn)return kn;let Ut=Ce.find(Jt=>Jt.subject===Se.subject&&Jt.object===Se.object);return Ut?{subject:Ut.subject,predicate:V,object:Ut.object,provenance:Un,trust:yr.get(`${Ut.subject}\0${Ut.object}`)}:void 0};for(let Se of C){let kn=N(Se,I,te,$e,{maxHops:3});if(!kn)continue;let Ut=kn.map(bn);if(Ut.every(Boolean)){let Jt=lp(Ut.map(vi=>vi.trust),1);return{text:`yes \u2014 ${fc(Ut)}`,replace:!0,...Jt!==null?{trust:Jt}:{}}}}}}let W$=X(l,L),pp=f.filter(B=>W$.has(B.subject)).sort(p),Ds=L.trim(),$i=an(w[2]).trim(),G$=[...C].some(B=>N(B,I,te,ne,{maxHops:uC}));if(pp.length){let B=pp.slice(0,3).map(oe).join("; "),we=G$?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Ds}", then ask me again.`:`If it's true, teach me: "${Ds} is a kind of ${$i}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Ds} is a ${$i}. I do know: ${B}. ${we}`,replace:!0,miss:!0}}let fp=f.filter(B=>C.has(B.object)&&I.has(B.subject)).sort(p)[0];return fp?{text:`I can't confirm that \u2014 what I know runs the other way: ${oe(fp)}. A kind doesn't reverse. If it's true, teach me: "every ${Ds} is a ${$i}".`,replace:!0,miss:!0}:!Ve&&!P&&!OI(Ds)&&!d.some(B=>C.has(B.subject)||C.has(B.object))?{text:`I can't confirm that \u2014 I don't know "${Ds}" at all yet. If it's true, teach me: "${Ds} is a kind of ${$i}".`,replace:!0,miss:!0}:null}let v=c.match(DC);if(v){let[,I,L,C]=v,{SUBCLASS_PREDICATE:P,ON_PROPERTY_PREDICATE:N,buildCardinalityRestrictions:W,proveCardinalityAtLeast:V,CARDINALITY_RULE_CONFIDENCE:ie,entailedTrustFrom:ce}=await Promise.resolve().then(()=>(Ht(),un)),K=$o,ee=f.filter(te=>te.predicate===P&&K(te)).map(te=>[te.subject,te.object]),q=d.filter(te=>(te.predicate===N||n$.has(te.predicate))&&K(te)),ne=W(q);if(ne.length){let te=X(l,I.trim()),xe=X(l,C.trim()),Ae=Number(L),pe=Yy(te,xe,(re,fe)=>V(ee,ne,re,fe,Ae,{}));if(pe){let re=d.find(se=>se.predicate===P&&se.subject===pe.viaClass&&se.object===pe.viaRestriction),fe=re?.provenance?` (source: ${zn(re.provenance)})`:"",be=pe.kind==="exactly"?"exactly":"at least",Ie=(se,et)=>`${se}${et===1?"":"s"}`,ue=[re?.trust,...q.filter(se=>se.subject===pe.viaRestriction).map(se=>se.trust),...pe.viaClass!==pe.subject?[f.find(se=>se.predicate===P&&se.subject===pe.subject&&se.object===pe.viaClass)?.trust]:[]].filter(se=>typeof se=="number"),H=ce(ue,ie);return{text:`yes \u2014 every ${pe.viaClass} has ${be} ${pe.n} ${Ie(pe.object,pe.n)}${fe}, so at least ${Ae} follows.`,replace:!0,...H!==null?{trust:H}:{}}}}}let _=c.match(zC);if(_){let[,I,L]=_,{SUBCLASS_PREDICATE:C,ON_PROPERTY_PREDICATE:P,buildCardinalityRestrictions:N,proveMaxCardinalityZeroDenial:W,CAX_MAXC0_RULE_CONFIDENCE:V,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(Ht(),un)),ce=$o,K=f.filter(ne=>ne.predicate===C&&ce(ne)).map(ne=>[ne.subject,ne.object]),ee=d.filter(ne=>(ne.predicate===P||n$.has(ne.predicate))&&ce(ne)),q=N(ee);if(q.length){let ne=X(l,I.trim()),te=X(l,L.trim()),xe=Yy(ne,te,(Ae,pe)=>W(K,q,Ae,pe,{}));if(xe){let Ae=d.find(be=>be.predicate===C&&be.subject===xe.viaClass&&be.object===xe.viaRestriction),pe=Ae?.provenance?` (source: ${zn(Ae.provenance)})`:"",re=[Ae?.trust,...ee.filter(be=>be.subject===xe.viaRestriction).map(be=>be.trust),...xe.viaClass!==xe.subject?[f.find(be=>be.predicate===C&&be.subject===xe.subject&&be.object===xe.viaClass)?.trust]:[]].filter(be=>typeof be=="number"),fe=ie(re,V);return{text:`no \u2014 every ${xe.viaClass} has at most 0 ${xe.object}${pe}.`,replace:!0,...fe!==null?{trust:fe}:{}}}}}let $=c.match(UC);if($){let I=X(l,$[1]),L=d.filter(C=>C.predicate===Fd&&I.has(C.subject)).sort(p);return L.length?m(L):null}let x=u.match(BC);if(x){let[,I,L]=x,C=X(l,I.trim()),P=X(l,L.replace(/^an?\s+/i,"").trim()),N=d.filter(W=>W.predicate===Fd&&P.has(W.subject)&&C.has(W.object)).sort(p)[0];return N?{text:`yes \u2014 ${oe(N)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} owns/maintains ${L.trim()}.`,replace:!0}}let S=u.match(WC);if(S){let[,I,L]=S,C=X(l,I.replace(/^an?\s+/i,"").trim()),P=X(l,L.trim()),N=d.filter(W=>W.predicate===Fd&&C.has(W.subject)&&P.has(W.object)).sort(p)[0];return N?{text:`yes \u2014 ${oe(N)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} is owned by ${L.trim()}.`,replace:!0}}let E=u.match(GC);if(E){let[,I,L]=E,C=X(l,I.trim()),P=X(l,`${L.trim()} method`),N=d.filter(W=>W.predicate===dr&&C.has(W.subject)&&P.has(W.object)).sort(p)[0];return N?{text:`yes \u2014 ${oe(N)}`,replace:!0}:null}let R=u.match(qC);if(R){let I=X(l,R[1].trim()),L=d.filter(C=>C.predicate===dr&&I.has(C.subject)&&/ method$/.test(C.object)).sort(p);return L.length?m(L):null}let j=u.match(s$);if(j){let I=j[1].trim(),L=r$.test(I)||o$.test(I)?null:fs.test(I)?r||null:I,C=j[2].trim().toLowerCase();if(L){let P=X(l,L),N=new Map,W=null;if(o){let q=await bi(o,L);if(W=q,q)for(let ne of hc(o,q.id))for(let te of X(l,ne.label))!P.has(te)&&!N.has(te)&&N.set(te,ne.label),P.add(te)}let V=q=>q.predicate===Dd&&l(q.object)===C||q.predicate===`tmct:${C}`&&q.object==="true",ie=l(L).split(/\s+/).filter(q=>q.length>=4&&!w$.has(q)),ce=q=>ie.some(ne=>new Set(String(q.subject||"").split(/\s+/)).has(ne)),K=q=>P.has(q.subject)||ie.length&&ce(q),ee=d.filter(q=>K(q)&&V(q)).sort(p)[0];if(ee){let q=N.get(ee.subject);return{text:q?`yes \u2014 the code graph says ${W.label} inherits ${q}, and ${oe(ee)}`:`yes \u2014 ${oe(ee)}`,replace:!0}}{let{findIsaChain:q,SUBCLASS_PREDICATE:ne,TYPE_PREDICATE:te}=await Promise.resolve().then(()=>(Ht(),un)),xe=$o,Ae=d.filter(ue=>ue.predicate===ne&&xe(ue)),pe=d.filter(ue=>ue.predicate===te&&xe(ue)),re=Ae.map(ue=>[ue.subject,ue.object]),fe=pe.map(ue=>[ue.subject,ue.object]),be=ue=>(ue.predicate===ne?Ae:pe).find(H=>H.subject===ue.subject&&H.object===ue.object),Ie=X(l,C);for(let ue of P){let H=q(ue,Ie,fe,re,{maxHops:2});if(!H)continue;let se=H.map(be);if(se.every(Boolean))return{text:`yes \u2014 ${fc(se)}`,replace:!0}}}if(d.some(K)&&!n?.parsed)return{text:`I don't have a fact saying ${oC(L)} is ${C}.`,replace:!0};if(!n?.parsed&&!qy.test(C))return i$(L,C)}}let A=ep(c).match(WI);if(A&&!Wd.test(c)){let[,I,L,C]=A,P=L.toLowerCase();if(!Bd.test(P)&&!qd.test(P)){let N=I.trim(),W=VI(await Gd(P),C),V=W.object.replace(/^an?\s+/i,"").trim();if(N&&V){let ie=W.predicate,ce=X(l,N),K=X(l,V),ee=[ie,Zo(ie)],q=d.filter(te=>ee.includes(te.predicate)&&ce.has(te.subject)&&K.has(te.object)).sort(p)[0];if(q)return{text:`${Ph(q.predicate)?"no":"yes"} \u2014 ${oe(q)}`,replace:!0,generalVerbQuery:!0};let ne=d.filter(te=>ee.includes(te.predicate)&&ce.has(te.subject));if(ne.length){let te=ne.slice(0,3).map(oe).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Dt({subject:N,predicate:ie,object:V})}. I do know: ${te}.`,replace:!0,miss:!0}}return null}}}let F=c.match(GI);if(F&&!Wd.test(c)){let[,I,L]=F,[C,P]=L.toLowerCase().split(/\s+/);if(!Bd.test(C)&&!qd.test(C)){let N=I.trim();if(N){let W=await Gd(C);P&&/^mgx:[a-z]+$/.test(W)&&(W=`${W}-${P}`);let V=X(l,N),ie=[W,Zo(W)],ce=Ze(d.filter(K=>ie.includes(K.predicate)&&V.has(K.subject)),i);if(ce.length)return{...m(ce),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&&!Wd.test(c)){let[,I,L,C]=T,P=I.toLowerCase();if(!Bd.test(P)&&!qd.test(P)&&!BI.test(P)){let N=await Gd(P);/^mgx:[a-z]+$/.test(N)&&(N=`${N}-${L.toLowerCase()}`);let W=X(l,C.replace(/^(?:an?|the)\s+/i,"").trim()),V=Ze(d.filter(ie=>ie.predicate===N&&W.has(ie.object)),i);if(V.length)return{...m(V),generalVerbQuery:!0}}}let M=c.match(MC);if(M){let I=X(l,M[1]),L=Ze(d.filter(ie=>I.has(ie.subject)||I.has(ie.object)),i);if(!L.length)return null;let C=I.has(L[0].subject)?L[0].subject:L[0].object,P=L.map(ie=>` ${oe(ie)}`),N=P.slice(0,je),W=P.slice(je),V=W.length?`
225
- \u2026and ${W.length} more \u2014 say 'more' to see them.`:"";return{text:`${L.length} remembered fact${L.length===1?"":"s"} about ${C}:
220
+ `)+N,replace:!0,...P.length?{pending:{items:P,noun:"facts"}}:{}}};if(rO.test(c)){let I=Ze(f.length?f:d,i);return I.length?h(I):null}let m=u.match(np);if(m){let I=m[1].trim(),L=hs.test(I)?r||null:I,C=m[2].trim().toLowerCase(),P=m[3].trim();if(L&&!op.has(C)){let N=Gd(d),{findIsaChain:B}=await Promise.resolve().then(()=>(qt(),dn)),H=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ae=[];for(let Ie of d){let ne=Xd(Ie.predicate);if(!ne)continue;if(ne===ue){Ae.push({fact:Ie,aliasFacts:[]});continue}let ke=Vd(B,ne,new Set([ue]),N,{maxHops:2});if(!ke)continue;let le=ke.map(q=>d.find(te=>te.predicate===yi&&te.subject===q.subject&&te.object===q.object));le.every(Boolean)&&Ae.push({fact:Ie,aliasFacts:le})}return Ae},{loadMemory:se,findRuleByName:ae,resolveRelationChase:X}=await Promise.resolve().then(()=>(Ve(),Ns)),{findActionPath:ee}=await Promise.resolve().then(()=>(Qs(),Oi)),V=await se(e),oe=await X(V,C,L,P,{relationFactsFor:H,renderFactLine:ie,factPhrase:Dt,factTermVariants:Y,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Wd,findActionPath:ee});return oe?{text:`yes \u2014 ${oe.citation.join("; ")}`,replace:!0}:H(C).length>0||!!ae(V,C)?{text:`I know the '${C}' relation, but I can't confirm ${L} is the ${C} of ${P} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${C}' yet.`,replace:!0}}}let g=$c(u).match(_$)||R$(u,I=>{let L=Y(l,I);return d.some(C=>L.has(C.subject)||L.has(C.object))});if(g){let I=g[1].trim().toLowerCase(),L=g[2].trim(),C=hs.test(L)?r||null:L;if(C&&!op.has(I)){let P=Gd(d),{findIsaChain:N}=await Promise.resolve().then(()=>(qt(),dn)),B=Te=>{let ue=String(Te||"").trim().toLowerCase(),Ae=[];for(let Ie of d){let ne=Xd(Ie.predicate);if(!ne)continue;if(ne===ue){Ae.push({fact:Ie,aliasFacts:[]});continue}let ke=Vd(N,ne,new Set([ue]),P,{maxHops:2});if(!ke)continue;let le=ke.map(q=>d.find(te=>te.predicate===yi&&te.subject===q.subject&&te.object===q.object));le.every(Boolean)&&Ae.push({fact:Ie,aliasFacts:le})}return Ae},{loadMemory:H,findRuleByName:se,resolveRelationChaseReverse:ae}=await Promise.resolve().then(()=>(Ve(),Ns)),X=await H(e),{findReachableSet:ee}=await Promise.resolve().then(()=>(Qs(),Oi)),re=await ae(X,I,C,{relationFactsFor:B,renderFactLine:ie,factPhrase:Dt,factTermVariants:Y,byTrust:p,rows:d,HAS_PROPERTY_PREDICATE:Wd,findReachableSet:ee});return re.length?{text:re.map(ue=>`${ue.subject} \u2014 ${ue.citation.join("; ")}`).join(`
221
+ `),replace:!0}:B(I).length>0||!!se(X,I)?{text:/^what\b/i.test($c(u))?`I don't know what the ${I} of ${C} is from what you've told me.`:`I don't know anyone who is the ${I} of ${C} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${I}' yet.`,replace:!0}}}{let I=u.match(uO);if(I){let L=Y(l,I[1]),C=Ze(d.filter(P=>L.has(P.subject)||L.has(P.object)),i);if(C.length){let P=C.map(ie),N=P.slice(0,Se),B=P.slice(Se),H=B.length?`
222
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
223
+ `)+H,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}}let b=u.match(xC);if(b){let I=up(b[1].trim().toLowerCase()),L=b[2].trim(),C=hs.test(L)?r||null:L;if(C){let{loadMemory:P,findRuleByName:N,RULE_KIND_PROP:B,RULE_KIND_RECURSIVE:H}=await Promise.resolve().then(()=>(Ve(),Ns)),se=await P(e),ae=N(se,I),X=ae?.attributes?.find(ee=>ee.prop===B)?.value;if(ae&&X===H){let ee=ae.attributes.find(oe=>oe.prop==="mgx:ruleBaseCase")?.value,V=ae.attributes.find(oe=>oe.prop==="mgx:ruleRecStep")?.value,re=l(C);if(ee&&V&&re){let oe=Gd(d),{findIsaChain:ge}=await Promise.resolve().then(()=>(qt(),dn)),Te=ke=>{let le=String(ke||"").trim().toLowerCase(),q=[];for(let te of d){let qe=Xd(te.predicate);if(!qe)continue;if(qe===le){q.push({fact:te,aliasFacts:[]});continue}let Fe=Vd(ge,qe,new Set([le]),oe,{maxHops:2});if(!Fe)continue;let et=Fe.map(rn=>d.find(Yt=>Yt.predicate===yi&&Yt.subject===rn.subject&&Yt.object===rn.object));et.every(Boolean)&&q.push({fact:te,aliasFacts:et})}return q},{findReachableSet:ue}=await Promise.resolve().then(()=>(Qs(),Oi)),ne=ue({entity:re,hop:0},ke=>{let le=ke.hop===0?ee:V;return Te(le).filter(q=>q.fact.subject===ke.entity).map(q=>({action:q,nextState:{entity:q.fact.object,hop:ke.hop+1}}))},{maxDepth:20,stateKey:ke=>ke.entity});if(ne.length)return{text:ne.map(({node:le,path:q})=>{let te=new Set,qe=[];for(let Fe of q.actions){qe.push(ie(Fe.fact));for(let et of Fe.aliasFacts){let rn=et.id||`${et.subject}|${et.predicate}|${et.object}`;te.has(rn)||(te.add(rn),qe.push(`${Dt(et)}${et.provenance?` (source: ${Un(et.provenance)})`:""}`))}}return`${le.entity} \u2014 ${qe.join("; ")}`}).join(`
224
+ `),replace:!0}}}return null}}let y=c.match(s$),w=c.match(zs)||sp(c)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(zs);if(w){let I=Y(l,en(w[2])),L=r&&hs.test(w[1].trim())?r:w[1],C=new Set(Y(l,L));if([...C].some(W=>I.has(W))){let W=en(w[2]).trim();return{text:`yes \u2014 ${br(W)} ${W} is ${br(W)} ${W}, trivially: every kind is a kind of itself.`,replace:!0}}let P=await iO(o,L);if(P)for(let W of Y(l,P))C.add(W);let{findIsaChain:N,buildSubClassSuccessors:B,deriveDisjointViolations:H,SUBCLASS_PREDICATE:se,TYPE_PREDICATE:ae,DISJOINT_PREDICATE:X}=await Promise.resolve().then(()=>(qt(),dn)),ee=vo,V=f.filter(W=>W.predicate===se&&ee(W)),re=f.filter(W=>W.predicate===ae&&ee(W)),oe=V.map(W=>[W.subject,W.object]),ge=re.map(W=>[W.subject,W.object]),Te=f.filter(W=>W.predicate===se),ue=f.filter(W=>W.predicate===ae),Ae=ue.map(W=>[W.subject,W.object]),Ie=Te.map(W=>[W.subject,W.object]),ne=B(oe),ke=B(Ie),le=d.filter(W=>W.predicate===X&&ee(W)),q=le.map(W=>[W.subject,W.object]),te=le.length?H(Ae.concat(Ie),Ie,q,{budget:20,focus:new Set([...C,...I])}):[],qe=W=>{let be=te.find(Ne=>Ne.subject===W&&I.has(Ne.object));if(!be)return null;let we=f.filter(Ne=>I.has(Ne.object)&&(Ne.subject===be.viaClass||Ne.subject===be.subject)).sort(p)[0],je=le.find(Ne=>Ne.subject===be.viaClass&&Ne.object===be.object||Ne.subject===be.object&&Ne.object===be.viaClass);return!we||!je?null:mC(we,je)},Fe=f.filter(W=>C.has(W.subject)&&I.has(W.object)).sort(p)[0],et=d.filter(W=>W.predicate===pa&&C.has(W.subject)&&I.has(W.object)).sort(p)[0],rn=le.find(W=>C.has(W.subject)&&I.has(W.object)||C.has(W.object)&&I.has(W.subject));if(Fe&&!et){let W=qe(Fe.subject);if(W)return W}let Yt=k$(Fe,et||rn);if(Yt)return Yt;if(le.length){let W=je=>{let Ne=new Set(je),Ot=new Set(je);for(let Ce=0;Ce<8&&Ot.size;Ce+=1){let ye=new Set;for(let[at,Bs]of Ie)Ot.has(at)&&!Ne.has(Bs)&&ye.add(Bs);if(!ye.size)break;for(let at of ye)Ne.add(at);Ot=ye}return Ne},be=W(I),we=te.find(je=>C.has(je.subject)&&be.has(je.object)&&!W([je.viaClass]).has(je.object)&&!W([je.object]).has(je.viaClass));if(we){let je=f.filter(ye=>C.has(ye.subject)&&ye.object===we.viaClass).sort(p)[0],Ne=le.find(ye=>ye.subject===we.viaClass&&ye.object===we.object||ye.subject===we.object&&ye.object===we.viaClass),Ot=!I.has(we.object),Ce=Ot?f.filter(ye=>I.has(ye.subject)&&ye.object===we.object).sort(p)[0]:null;if(je&&Ne&&(!Ot||Ce)){let ye=en(w[2]).trim();return{text:`no \u2014 ${[je,...Ce?[Ce]:[]].map(ie).join("; ")}; and ${Dt(Ne)}${Ne.provenance?` (source: ${Un(Ne.provenance)})`:""} \u2014 so ${L} can never be ${br(ye)} ${ye}.`,replace:!0}}}}let Xt=await wi(o,L);if(Xt){let W=new Map;for(let we of wc(o,Xt.id))for(let je of Y(l,we.label))!C.has(je)&&!W.has(je)&&W.set(je,we.label);let be=f.filter(we=>W.has(we.subject)&&I.has(we.object)).sort(p)[0];if(be)return{text:`yes \u2014 the code graph says ${Xt.label} inherits ${W.get(be.subject)}, and ${ie(be)}`,replace:!0}}let an=W=>(W.predicate===se?V:re).find(be=>be.subject===W.subject&&be.object===W.object);for(let W of C){let be=N(W,I,ge,ne,{maxHops:2});if(!be)continue;let we=qe(W);if(we)return we;let je=be.map(an);if(je.every(Boolean))return{text:`yes \u2014 ${gc(je)}`,replace:!0}}let $i=W=>(W.predicate===se?Te:ue).find(be=>be.subject===W.subject&&be.object===W.object);for(let W of C){let be=N(W,I,Ae,ke,{maxHops:2});if(!be)continue;let we=qe(W);if(we)return we;let je=be.map($i);if(je.every(Boolean)&&je.some(ee))return{text:`yes \u2014 ${gc(je)}`,replace:!0}}let k=L.match(/^(.*\S)\s+not$/i),pe=k&&[k[0],r&&hs.test(k[1].trim())?r:k[1]];if(pe){let W=Y(l,pe[1]),be=I,we=f.filter(Ce=>W.has(Ce.subject)&&be.has(Ce.object)).sort(p)[0];if(we)return{text:`no \u2014 ${ie(we)}`,replace:!0};let je=le.find(Ce=>W.has(Ce.subject)&&be.has(Ce.object)||W.has(Ce.object)&&be.has(Ce.subject));if(je)return{text:`yes \u2014 ${ie(je)}`,replace:!0};let Ne=pe[1].trim(),Ot=en(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Ne} and ${Ot}. If no ${Ne} is a ${Ot}, teach me: "no ${Ne} is a ${Ot}".`,replace:!0,miss:!0}}if(le.length){let W=H(ge.concat(oe),oe,q,{budget:10});for(let be of C){let we=W.find(Ce=>Ce.subject===be&&I.has(Ce.object));if(!we)continue;let je=re.concat(V).find(Ce=>Ce.subject===we.subject&&Ce.object===we.viaType),Ne=le.find(Ce=>Ce.subject===we.viaClass&&Ce.object===we.object||Ce.subject===we.object&&Ce.object===we.viaClass),Ot=[je,Ne].filter(Boolean).map(ie);return{text:`no \u2014 ${Ot.length?Ot.join("; "):`${we.viaClass} and ${we.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Re,ON_PROPERTY_PREDICATE:cn,SOME_VALUES_FROM_PREDICATE:Bn,deriveSomeValuesFromSubsumption:J$,ENTAILED_SCM_SVF_PROVENANCE:Q$,SCM_SVF_RULE_CONFIDENCE:Z$,entailedTrustFrom:hp}=await Promise.resolve().then(()=>(qt(),dn)),mp=d.filter(W=>W.predicate===cn&&ee(W)),gp=d.filter(W=>W.predicate===Bn&&ee(W));if(mp.length&&gp.length){let W=new Map(gp.map(ye=>[ye.subject,ye.object])),be=mp.map(ye=>({restriction:ye.subject,property:ye.object,target:W.get(ye.subject)})).filter(ye=>ye.target),we=new Set([se,ae,X,cn,Bn,"owl:intersectionOf"]),je=d.filter(ye=>ee(ye)&&!we.has(ye.predicate)),Ne=je.map(ye=>[ye.subject,ye.predicate,ye.object]),Ot=Re(Ne,ge,oe,be,{budget:10});for(let ye of C){let at=Ot.find(wn=>wn.subject===ye&&I.has(wn.object));if(!at)continue;let Bs=je.find(wn=>wn.subject===at.subject&&wn.predicate===at.viaProperty&&wn.object===at.viaValue),Ws=re.find(wn=>wn.subject===at.viaValue&&wn.object===at.viaType),yr=[Bs,Ws].filter(Boolean).map(ie);return{text:`yes \u2014 ${yr.length?yr.join("; "):`${at.subject} ${at.viaProperty} ${at.viaValue}, and ${at.viaValue} is a ${at.viaType}.`}`,replace:!0}}let Ce=be.length>1?J$(be,oe,{budget:10}):[];if(Ce.length){let ye=B(oe.concat(Ce.map(xe=>[xe.subject,xe.object]))),at=new Map(be.map(xe=>[xe.restriction,xe])),Bs=new Map;for(let xe of d)Bs.set(`${xe.subject}\0${xe.predicate}\0${xe.object}`,xe.trust);let Ws=(xe,jn,zt)=>Bs.get(`${xe}\0${jn}\0${zt}`),yr=new Map;for(let xe of Ce){let jn=at.get(xe.subject),zt=at.get(xe.object),Jt=[jn&&Ws(xe.subject,cn,jn.property),Ws(xe.subject,Bn,xe.viaY1),zt&&Ws(xe.object,cn,zt.property),Ws(xe.object,Bn,xe.viaY2),Ws(xe.viaY1,se,xe.viaY2)].filter(nv=>typeof nv=="number"),xi=hp(Jt,Z$);xi!==null&&yr.set(`${xe.subject}\0${xe.object}`,xi)}let wn=xe=>{if(xe.predicate!==se)return re.find(Jt=>Jt.subject===xe.subject&&Jt.object===xe.object);let jn=V.find(Jt=>Jt.subject===xe.subject&&Jt.object===xe.object);if(jn)return jn;let zt=Ce.find(Jt=>Jt.subject===xe.subject&&Jt.object===xe.object);return zt?{subject:zt.subject,predicate:se,object:zt.object,provenance:Q$,trust:yr.get(`${zt.subject}\0${zt.object}`)}:void 0};for(let xe of C){let jn=N(xe,I,ge,ye,{maxHops:3});if(!jn)continue;let zt=jn.map(wn);if(zt.every(Boolean)){let Jt=hp(zt.map(xi=>xi.trust),1);return{text:`yes \u2014 ${gc(zt)}`,replace:!0,...Jt!==null?{trust:Jt}:{}}}}}}let ev=Y(l,L),bp=f.filter(W=>ev.has(W.subject)).sort(p),Us=L.trim(),vi=en(w[2]).trim(),tv=[...C].some(W=>N(W,I,ge,ne,{maxHops:EC}));if(bp.length){let W=bp.slice(0,3).map(ie).join("; "),be=tv?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Us}", then ask me again.`:`If it's true, teach me: "${Us} is a kind of ${vi}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Us} is a ${vi}. I do know: ${W}. ${be}`,replace:!0,miss:!0}}let wp=f.filter(W=>C.has(W.object)&&I.has(W.subject)).sort(p)[0];return wp?{text:`I can't confirm that \u2014 what I know runs the other way: ${ie(wp)}. A kind doesn't reverse. If it's true, teach me: "every ${Us} is a ${vi}".`,replace:!0,miss:!0}:!Xt&&!P&&!VI(Us)&&!d.some(W=>C.has(W.subject)||C.has(W.object))?{text:`I can't confirm that \u2014 I don't know "${Us}" at all yet. If it's true, teach me: "${Us} is a kind of ${vi}".`,replace:!0,miss:!0}:null}let v=c.match(QC);if(v){let[,I,L,C]=v,{SUBCLASS_PREDICATE:P,ON_PROPERTY_PREDICATE:N,buildCardinalityRestrictions:B,proveCardinalityAtLeast:H,CARDINALITY_RULE_CONFIDENCE:se,entailedTrustFrom:ae}=await Promise.resolve().then(()=>(qt(),dn)),X=vo,ee=f.filter(oe=>oe.predicate===P&&X(oe)).map(oe=>[oe.subject,oe.object]),V=d.filter(oe=>(oe.predicate===N||l$.has(oe.predicate))&&X(oe)),re=B(V);if(re.length){let oe=Y(l,I.trim()),ge=Y(l,C.trim()),Te=Number(L),ue=n$(oe,ge,(Ae,Ie)=>H(ee,re,Ae,Ie,Te,{}));if(ue){let Ae=d.find(te=>te.predicate===P&&te.subject===ue.viaClass&&te.object===ue.viaRestriction),Ie=Ae?.provenance?` (source: ${Un(Ae.provenance)})`:"",ne=ue.kind==="exactly"?"exactly":"at least",ke=(te,qe)=>`${te}${qe===1?"":"s"}`,le=[Ae?.trust,...V.filter(te=>te.subject===ue.viaRestriction).map(te=>te.trust),...ue.viaClass!==ue.subject?[f.find(te=>te.predicate===P&&te.subject===ue.subject&&te.object===ue.viaClass)?.trust]:[]].filter(te=>typeof te=="number"),q=ae(le,se);return{text:`yes \u2014 every ${ue.viaClass} has ${ne} ${ue.n} ${ke(ue.object,ue.n)}${Ie}, so at least ${Te} follows.`,replace:!0,...q!==null?{trust:q}:{}}}}}let _=c.match(ZC);if(_){let[,I,L]=_,{SUBCLASS_PREDICATE:C,ON_PROPERTY_PREDICATE:P,buildCardinalityRestrictions:N,proveMaxCardinalityZeroDenial:B,CAX_MAXC0_RULE_CONFIDENCE:H,entailedTrustFrom:se}=await Promise.resolve().then(()=>(qt(),dn)),ae=vo,X=f.filter(re=>re.predicate===C&&ae(re)).map(re=>[re.subject,re.object]),ee=d.filter(re=>(re.predicate===P||l$.has(re.predicate))&&ae(re)),V=N(ee);if(V.length){let re=Y(l,I.trim()),oe=Y(l,L.trim()),ge=n$(re,oe,(Te,ue)=>B(X,V,Te,ue,{}));if(ge){let Te=d.find(ne=>ne.predicate===C&&ne.subject===ge.viaClass&&ne.object===ge.viaRestriction),ue=Te?.provenance?` (source: ${Un(Te.provenance)})`:"",Ae=[Te?.trust,...ee.filter(ne=>ne.subject===ge.viaRestriction).map(ne=>ne.trust),...ge.viaClass!==ge.subject?[f.find(ne=>ne.predicate===C&&ne.subject===ge.subject&&ne.object===ge.viaClass)?.trust]:[]].filter(ne=>typeof ne=="number"),Ie=se(Ae,H);return{text:`no \u2014 every ${ge.viaClass} has at most 0 ${ge.object}${ue}.`,replace:!0,...Ie!==null?{trust:Ie}:{}}}}}let $=c.match(eO);if($){let I=Y(l,$[1]),L=d.filter(C=>C.predicate===Bd&&I.has(C.subject)).sort(p);return L.length?h(L):null}let x=u.match(tO);if(x){let[,I,L]=x,C=Y(l,I.trim()),P=Y(l,L.replace(/^an?\s+/i,"").trim()),N=d.filter(B=>B.predicate===Bd&&P.has(B.subject)&&C.has(B.object)).sort(p)[0];return N?{text:`yes \u2014 ${ie(N)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} owns/maintains ${L.trim()}.`,replace:!0}}let S=u.match(nO);if(S){let[,I,L]=S,C=Y(l,I.replace(/^an?\s+/i,"").trim()),P=Y(l,L.trim()),N=d.filter(B=>B.predicate===Bd&&C.has(B.subject)&&P.has(B.object)).sort(p)[0];return N?{text:`yes \u2014 ${ie(N)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${I.trim().toLowerCase()} is owned by ${L.trim()}.`,replace:!0}}let E=u.match(sO);if(E){let[,I,L]=E,C=Y(l,I.trim()),P=Y(l,`${L.trim()} method`),N=d.filter(B=>B.predicate===dr&&C.has(B.subject)&&P.has(B.object)).sort(p)[0];return N?{text:`yes \u2014 ${ie(N)}`,replace:!0}:null}let R=u.match(oO);if(R){let I=Y(l,R[1].trim()),L=d.filter(C=>C.predicate===dr&&I.has(C.subject)&&/ method$/.test(C.object)).sort(p);return L.length?h(L):null}let j=u.match(u$);if(j){let I=j[1].trim(),L=p$.test(I)||d$.test(I)?null:hs.test(I)?r||null:I,C=j[2].trim().toLowerCase();if(L){let P=Y(l,L),N=new Map,B=null;if(o){let V=await wi(o,L);if(B=V,V)for(let re of wc(o,V.id))for(let oe of Y(l,re.label))!P.has(oe)&&!N.has(oe)&&N.set(oe,re.label),P.add(oe)}let H=V=>V.predicate===Wd&&l(V.object)===C||V.predicate===`tmct:${C}`&&V.object==="true",se=l(L).split(/\s+/).filter(V=>V.length>=4&&!j$.has(V)),ae=V=>se.some(re=>new Set(String(V.subject||"").split(/\s+/)).has(re)),X=V=>P.has(V.subject)||se.length&&ae(V),ee=d.filter(V=>X(V)&&H(V)).sort(p)[0];if(ee){let V=N.get(ee.subject);return{text:V?`yes \u2014 the code graph says ${B.label} inherits ${V}, and ${ie(ee)}`:`yes \u2014 ${ie(ee)}`,replace:!0}}{let{findIsaChain:V,SUBCLASS_PREDICATE:re,TYPE_PREDICATE:oe}=await Promise.resolve().then(()=>(qt(),dn)),ge=vo,Te=d.filter(le=>le.predicate===re&&ge(le)),ue=d.filter(le=>le.predicate===oe&&ge(le)),Ae=Te.map(le=>[le.subject,le.object]),Ie=ue.map(le=>[le.subject,le.object]),ne=le=>(le.predicate===re?Te:ue).find(q=>q.subject===le.subject&&q.object===le.object),ke=Y(l,C);for(let le of P){let q=V(le,ke,Ie,Ae,{maxHops:2});if(!q)continue;let te=q.map(ne);if(te.every(Boolean))return{text:`yes \u2014 ${gc(te)}`,replace:!0}}}if(d.some(X)&&!n?.parsed)return{text:`I don't have a fact saying ${bC(L)} is ${C}.`,replace:!0};if(!n?.parsed&&!Qy.test(C))return f$(L,C)}}let A=rp(c).match(nC);if(A&&!Hd.test(c)){let[,I,L,C]=A,P=L.toLowerCase();if(!qd.test(P)&&!Yd.test(P)){let N=I.trim(),B=rC(await Kd(P),C),H=B.object.replace(/^an?\s+/i,"").trim();if(N&&H){let se=B.predicate,ae=Y(l,N),X=Y(l,H),ee=[se,Zo(se)],V=d.filter(oe=>ee.includes(oe.predicate)&&ae.has(oe.subject)&&X.has(oe.object)).sort(p)[0];if(V)return{text:`${Um(V.predicate)?"no":"yes"} \u2014 ${ie(V)}`,replace:!0,generalVerbQuery:!0};let re=d.filter(oe=>ee.includes(oe.predicate)&&ae.has(oe.subject));if(re.length){let oe=re.slice(0,3).map(ie).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Dt({subject:N,predicate:se,object:H})}. I do know: ${oe}.`,replace:!0,miss:!0}}return null}}}let F=c.match(sC);if(F&&!Hd.test(c)){let[,I,L]=F,[C,P]=L.toLowerCase().split(/\s+/);if(!qd.test(C)&&!Yd.test(C)){let N=I.trim();if(N){let B=await Kd(C);P&&/^mgx:[a-z]+$/.test(B)&&(B=`${B}-${P}`);let H=Y(l,N),se=[B,Zo(B)],ae=Ze(d.filter(X=>se.includes(X.predicate)&&H.has(X.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&&!Hd.test(c)){let[,I,L,C]=T,P=I.toLowerCase();if(!qd.test(P)&&!Yd.test(P)&&!tC.test(P)){let N=await Kd(P);/^mgx:[a-z]+$/.test(N)&&(N=`${N}-${L.toLowerCase()}`);let B=Y(l,C.replace(/^(?:an?|the)\s+/i,"").trim()),H=Ze(d.filter(se=>se.predicate===N&&B.has(se.object)),i);if(H.length)return{...h(H),generalVerbQuery:!0}}}let M=c.match(XC);if(M){let I=Y(l,M[1]),L=Ze(d.filter(se=>I.has(se.subject)||I.has(se.object)),i);if(!L.length)return null;let C=I.has(L[0].subject)?L[0].subject:L[0].object,P=L.map(se=>` ${ie(se)}`),N=P.slice(0,Se),B=P.slice(Se),H=B.length?`
225
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:`${L.length} remembered fact${L.length===1?"":"s"} about ${C}:
226
226
  ${N.join(`
227
- `)}${V}`,replace:!0,...W.length?{pending:{items:W.map(ie=>ie.trim()),noun:"facts"}}:{}}}let z=n?.parsed?.shape==="meta"?n.parsed.object:null,Y=!1,ae=c.match(FC);if(ae)z=ae[1],Y=!0;else if(!z&&!n?.parsed){let I=c.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);I&&(z=I[1])}if(!z)return null;let Z=X(l,z),D=Ze(f.filter(I=>Z.has(I.subject)),i),U=Ze(f.filter(I=>Z.has(I.object)),i),G=Y?D.length?D:U:U.length?U:D;return G.length?m(G):null}function Kd(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}var np,OI,gn,pc,By,a$,oK,Wy,LI,rK,iK,c$,l$,u$,NI,Gy,aK,cK,lK,uK,dK,op,pK,PI,Ye,Fd,Dd,wi,MI,$o,fK,mK,hK,gK,bK,wK,yK,$K,vK,xK,EK,SK,kK,jK,_K,qy,zI,wc,UI,RK,TK,ip,d$,AK,IK,CK,Bd,Wd,BI,OK,WI,GI,qd,qI,HI,LK,p$,f$,KI,NK,PK,MK,FK,wr,DK,zK,UK,m$,BK,WK,YI,GK,qK,VK,vo,Vy,ap,Dt,JI,ZI,eC,mc,rC,w$,HK,Jd,y$,iC,aC,bc,cC,lC,Fs,ms,uC,dC,pC,Zd,Xy,fC,je,mC,hC,gC,bC,wC,yC,$C,vC,xC,EC,SC,kC,jC,Qy,v$,RC,TC,IC,CC,OC,LC,t$,NC,MC,FC,DC,zC,n$,UC,BC,WC,GC,qC,s$,fs,o$,r$,i$,VC,KC,YC,KK,k$,JC,YK,Yd,tp,QC,XK,JK,j$,QK,ZK,eY,tY,nY,yc,sY,oY,rY,iY,ZC,aY,cY,dc=O(()=>{Ue();gw();Bt();Oe();ks();Ya();Xa();_r();hd();yw();qe();pa();bd();xw();qn();yn();zo();Vi();pd();fd();Mo();ho();nl();Qa();_w();Rw();vd();Tw();xd();Aw();Iw();sc();sd();hi();yy();xy();Ms();My();Hi(void 0);qi(Ka);np=new Set(["it","this","that","here"]),OI=e=>np.has(String(e||"").trim().toLowerCase()),gn={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",By="look up a taught fact about a subject/verb/object";a$={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}},oK=new Set(["stats","memory","focus",...Object.keys(a$)]),Wy={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"]},LI=new Set(["have","has","holds","hold"]),rK=new RegExp(`\\b(?:${[...Object.keys(de),...Object.keys(gs)].filter(e=>!LI.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),iK=new Set([...hw.map(e=>e.name),...Object.values(a$).map(e=>e.tool)]),c$=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"]),l$=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"]),u$=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"]),NI=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),Gy=e=>e.replace(/(.)\1+/g,"$1");aK=sp(c$),cK=sp(l$),lK=sp(u$),uK=new RegExp(`^(?:${[...NI].map(Qe).join("|")})\\s+(.+)$`,"i"),dK=[...c$,...l$,...u$,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],op="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",pK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${op})\\s+than\\s+(.+)$`,"i"),PI=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${op})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ye="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Fd="mgx:ownedBy",Dd="mgx:hasProperty",wi="rdfs:subClassOf",MI=new Set(["operator","teach","entailed"]),$o=e=>!!e.sourceTypes?.some(t=>MI.has(t));fK=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),mK=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),hK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),gK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${op})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),bK=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),wK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");yK=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),$K=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),vK=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),xK=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),EK=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),SK=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),kK=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)$`,"i"),jK=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ye})\\s+(.+?)[?.!\\s]*$`,"i"),_K=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ye}))?[?.!\\s]*$`,"i"),qy=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,zI=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"]);wc="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",UI="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",RK=new RegExp(`^(.+?)\\s+(${UI})\\s+(.+)$`,"i"),TK=new RegExp(`^([\\w'-]+)\\s+${wc}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),ip="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",d$="with|to|from|by|of|in|on|for|as|about|into",AK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${wc}(${ip})\\s+(${d$})\\s+(.+)$`,"i"),IK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${ip})\\s+(${d$})\\s+(.+)$`,"i"),CK=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),Bd=/^(?:is|are|am|owns|maintains)$/i,Wd=/\b(?:is|are|am|owns|maintains)\b/i,BI=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"),OK=new RegExp(`^(?:${Hs.filter(e=>!/\s/.test(e)).join("|")})$`,"i");WI=new RegExp(`^(?:does|did)\\s+([\\w'-]+)\\s+${wc}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),GI=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${wc}([a-z]+(?:\\s+(?:${Ye}))?)[?.!\\s]*$`,"i"),qd=/^(?:be|own|maintain)$/i,qI=new RegExp(`^(${Ye})\\s+(.+)$`,"i");HI=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],LK=new RegExp(`^(?:${HI.join("|")})\\b\\s*,?\\s+`,"i"),p$=Object.freeze(["you","i","it","they","he","she","we"]),f$=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),KI=Object.freeze([...f$,...p$]),NK=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${KI.join("|")})\\s+\\S+`,"i"),PK=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${p$.join("|")})\\s+(?:is|are|am|was|were)|(${f$.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),MK=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),FK=new RegExp(`^forget\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),wr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",DK=new RegExp(`^what\\s+does\\s+(.+?)${wr}\\s+do${wr}\\??$`,"i"),zK=new RegExp(`^what\\s+(.+?)${wr}\\s+does${wr}\\??$`,"i"),UK=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${wr}\\s+do${wr}\\??$`,"i"),m$="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",BK=new RegExp(`^who\\s+(?:is|was)\\s+${m$}$`,"i"),WK=new RegExp(`^what\\s+(?:did|has)\\s+${m$}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),YI="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",GK=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${YI}\\b`,"i"),qK=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");VK=new Set([...Object.keys(de).flatMap(e=>e.split(/[\s-]+/)),...Zt,...wn,"owns","maintains"].filter(e=>e.length>=3)),vo={"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: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"},Vy=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"]),ap=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Dt=e=>`${e.subject} ${g$(e.predicate)} ${e.object}`;JI=Object.entries(vo).filter(([e])=>!ap.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);ZI=/ \(source: [^)]*\)$/;eC=8;mc=null;rC=/^(?:every|each|all|any)\s+/i;w$=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"]),HK=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("|"))),Jd=/^(?: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,y$=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,iC=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,aC=/^(who|what)'?s\s+/i,bc=e=>String(e).replace(aC,(t,n)=>`${n} is `),cC=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;lC=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Fs=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,ms=new Set(["rdfs:subClassOf","rdf:type"]),uC=6,dC=/^why\s+(?=(?:is|are)\b)/i,pC=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;Zd=new Set(["kind","sort","type","subclass","superclass"]),Xy=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,fC=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,je=32,mC=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,hC=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,gC=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,bC=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,wC=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,yC=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,$C=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,vC=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ye})\\s+(.+?)\\s*[?.!]*$`,"i"),xC=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,EC=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,SC=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,kC=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,jC=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;Qy=e=>String(e||"").replace(/\s+/g," ").trim();v$="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",RC=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${v$})[?.!\\s]*$`,"i"),TC=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${v$})\\s+([\\w'-]+)[?.!\\s]*$`,"i");IC=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),CC=Object.entries(vo).filter(([e])=>!IC.has(e)&&!ap.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Qe(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),OC=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),LC=Object.entries(vo).filter(([e])=>!OC.has(e)&&!ap.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=Qe(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=[h$(s),...o].map(Qe).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),t$=/^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,NC=new Set(["changed","change","changes","updated","modified","happened","occurred"]);MC=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,FC=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,DC=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,zC=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,n$=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),UC=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,BC=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,WC=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,GC=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,qC=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,s$=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,fs=/^(?:it|this|that)$/i,o$=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,r$=/^(?:you|i|they|he|she|we)\b/i,i$=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${gc(e)} is ${t}".`,replace:!0}),VC=/^(?: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;KC=/inherit|supertype|subclass|extend|specializ/i,YC=8;KK=new RegExp(`\\b(?:${[...np].join("|")})\\b`,"i"),k$=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,JC=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i;YK=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Be).join("|")})$`,"i"),Yd="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",tp="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",QC=`(?:\\s+${tp})?`,XK=[new RegExp(`^${Yd}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${QC}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Yd}architecture\\s+(?:${tp}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Yd}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${tp}(?:\\s+here)?\\??$`,"i")],JK={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:gn.contains,subclasses:gn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:gn.calls,callees:gn.calls,tests:gn.tests,untested:gn.tests,history:gn.touches,exports:gn.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"},j$="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",QK=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+${j$}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),ZK=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${j$}\\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"),eY=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"),tY=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"),nY=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"),yc="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",sY=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${yc}\\s*\\??$`,"i"),oY=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${yc}\\s*\\??$`,"i"),rY=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${yc}\\s*\\??$`,"i"),iY=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${yc}\\s*[.!]*$`,"i"),ZC=Object.freeze([...np].filter(e=>e!=="here").concat("they")),aY=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${ZC.join("|")})\\b(\\s+\\S.*)?$`,"i"),cY=Q(".tmct","memory","corpus-seed.json")});dc();qe();Hn();sc();var $c={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 T$=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),xo=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),vc=e=>T$[e]||"other",tO=e=>Math.max(0,Math.min(1,e));function _$(e){let t=(e.sourceTypes||[]).map(n=>Ys[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:Ys.entailed}function nO(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function R$(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function A$(e,t,n={},s={}){let o={...$c,...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=R$($.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=nc(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let $ of d.clusters){let x=0;for(let S of $.objects){p.set(S,$.label);let E=c.find(R=>R.object===S&&vc(R.predicate)==="isa");x+=E?_$(E):0}f.set($.label,x)}let m=null,h=-1;for(let[$,x]of[...f].sort((S,E)=>S[0].localeCompare(E[0])))x>h&&(h=x,m=$);let g=[];for(let $ of c){let x=vc($.predicate),S=_$($),E={provenance:S};if(nO($)&&(S-=o.entailedDepthPenalty,E.entailed=!0),x==="isa"){let j=.6+.4*(1-R$($.object,n));S*=j,E.informativeness=j;let A=p.get($.object);m&&A&&A!==m&&(S-=o.minoritySensePenalty,E.minoritySense=A)}S=tO(S),g.push({row:$,family:x,score:S,reasons:E})}let b=[];for(let $ of g)$.score<o.minScore?a.push({row:$.row,family:$.family,reason:"below-floor",score:$.score}):b.push($);let y=new Map;for(let $ of b)y.has($.family)||y.set($.family,[]),y.get($.family).push($);for(let $ of y.values())$.sort((x,S)=>S.score-x.score||x.row.object.localeCompare(S.row.object));let w=xo.filter($=>y.has($)).concat([...y.keys()].filter($=>!xo.includes($)).sort()),v=[],_=!1;for(;v.length<r&&!_;){_=!0;for(let $ of w){let x=y.get($);if(x&&x.length&&(v.push(x.shift()),_=!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 S=xo.indexOf($.family),E=xo.indexOf(x.family);return S-E||x.score-$.score||$.row.object.localeCompare(x.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}Xi();nn();var sO=new Set(["isa","location","partOf","capableOf","usedFor"]),oO=new Set(["single","several","chained","group","closer"]),I$=(e,t)=>`${e}:${t}`;function cp(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!sO.has(n.family)||typeof n.form!="string"||!oO.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=I$(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 Eo=e=>`${Uo(e)} ${e}`;function rO(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Eo(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Or(s.map(Eo))}`:n}function iO(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:Bo(o),A_TERM:Eo(o),A_TERM_CAP:Bo(Eo(o)),TERMS:Yi(o),TERMS_CAP:Bo(Yi(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Eo(a):"",OBJECT:i,A_OBJECT:i?Eo(i):"",OBJECTS_A:Or(r.map(Eo)),OBJECTS_PLURAL:Or(r.map(Yi)),OBJECTS_RAW:Or(r),CHAIN:rO(n&&n.length?n:r.slice(0,1))}}function aO(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 hs(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(I$(t,i)):null,l=a?a.templates:null;if(!l||!l.length)return null;let c=s.variantSeed??"",u=aa(`${r}|${t}|${i}|${c}`)%l.length,d=s.objectsOverride||o.map(p=>p.object),f=aO(l[u],iO(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}Xi();var cO=xo.filter(e=>e!=="isa"&&e!=="other");function lO(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 C$(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 uO(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 dO(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 pO(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let f=t[e[0].object],p=f&&f.length>1?"chained":"single",m=hs(s,"isa",e,{term:n,form:p,chain:f});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let f=hs(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=hs(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 uO(a,t))for(let p of C$(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 m of c.slice(o.maxBodySentences))p.rows=p.rows.concat(m.rows);p.parent=null,c=f}for(let f of c){let p=f.parent?hs(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):hs(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=dO(t,e,o.closerRootCount);if(u.length){let f=hs(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 fO(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Bo(`${Uo(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function mO(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 O$(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...$c,...n.config||{}},a=lO(e?.selected||[]),l=[];for(let u of pO(a.get("isa")||[],r,s,t,i))l.push(u);for(let u of cO){let d=a.get(u);if(!(!d||!d.length))for(let f of C$(d,i.maxObjectsPerBodySentence)){let p=hs(t,u,f,{term:s});p&&l.push({...p,role:"describes",paragraph:"description"})}}fO(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:mO(l,o),provenanceRows:[...c.values()]}}var hO=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function gO(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 bO=Object.freeze({facts:"show the facts",chains:"show the chains"});function wO(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:bO,facts:n.map(hO),factCount:n.length,chains:s}}function L$(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:gO(t?.provenanceRows||[]),detail:wO(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function N$(e,t,n={},s=new Map,o={}){let r=A$(e,t,n,o),i=O$(r,s,o);return L$(r,i,o)}sc();var P$=new Set(["rdfs:subClassOf","rdf:type"]);function M$(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(P$.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 F$(e,t,n=6){let s=pi(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=tc(r,s,{cap:n});i.length>1&&(o[r]=i)}return o}function D$(e){let t=[],n=new Set;for(let s of e||[])!s||!P$.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}qe();dc();function yO(e,t,n,s,o={}){let r=cp(s||[]);if(!r||r.size===0)return null;let i=t||[],a=M$(n||i),l=F$(a.subClassEdges,D$(i));return N$(e,i,a,r,{...o,chains:l})}function z$(e,t,n,s={}){let o=vt(e||{individuals:[],objectProperties:[]}),r=X(J,t),i=o.filter(l=>r.has(l.subject));if(!i.length)return null;let a=yO(t,i,o,n,s);return $O(a)}function $O(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 vO="no session is open on this page yet \u2014 await tmct.open() first",U$=Symbol.for("tmct.surface.fallback");function B$({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[U$])return a;let l=null,c=()=>{if(!l)throw new Error(vO);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[U$]=r,i.tmct=u,u}function xO({payload:e=null}={}){let t=Fa();return e&&(t.payload=e),{memoryDir:t}}async function EO(e,t,n){let s=null;try{s=await x$(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await S$(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}}B$({open:xO,ask:EO,page:{normFactTerm:J,digestTermFromPayloadBrowser:z$},fallback:!0});})();
227
+ `)}${H}`,replace:!0,...B.length?{pending:{items:B.map(se=>se.trim()),noun:"facts"}}:{}}}let z=n?.parsed?.shape==="meta"?n.parsed.object:null,K=!1,ce=c.match(JC);if(ce)z=ce[1],K=!0;else if(!z&&!n?.parsed){let I=c.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);I&&(z=I[1])}if(!z)return null;let Z=Y(l,z),D=Ze(f.filter(I=>Z.has(I.subject)),i),U=Ze(f.filter(I=>Z.has(I.object)),i),G=K?D.length?D:U:U.length?U:D;return G.length?h(G):null}function Qd(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}var ap,VI,bn,mc,Xy,h$,yK,qI,tp,$K,HI,vK,xK,m$,g$,b$,KI,Jy,EK,SK,kK,jK,_K,lp,RK,YI,Ye,Bd,Wd,yi,XI,vo,TK,AK,IK,CK,OK,LK,NK,PK,MK,FK,DK,zK,UK,BK,WK,Qy,ZI,vc,eC,GK,VK,dp,w$,qK,HK,KK,qd,Hd,tC,YK,nC,sC,Yd,oC,iC,XK,y$,$$,aC,JK,QK,v$,ZK,eY,tY,wr,nY,sY,oY,x$,rY,iY,cC,aY,cY,lY,uY,xo,Zy,pp,Dt,uC,pC,fC,bc,wC,j$,dY,np,_$,yC,$C,$c,vC,xC,zs,ms,EC,SC,kC,op,s$,jC,Se,_C,RC,TC,AC,IC,CC,OC,LC,NC,PC,MC,FC,DC,r$,T$,UC,BC,GC,VC,qC,HC,c$,KC,XC,JC,QC,ZC,l$,eO,tO,nO,sO,oO,u$,hs,d$,p$,f$,rO,aO,cO,pY,O$,uO,dO,fY,Zd,ip,pO,hY,mY,L$,gY,bY,wY,yY,$Y,xc,vY,xY,EY,SY,fO,kY,jY,hc=O(()=>{Ue();Sw();Ut();Oe();_s();Qa();Za();_r();yd();_w();Ve();ma();vd();Aw();qn();$n();zo();Ki();gd();bd();Mo();go();il();tc();Nw();Pw();kd();Mw();jd();Fw();Dw();ic();cd();gi();_y();Ay();Ds();Vy();Yi(void 0);Hi(Ja);ap=new Set(["it","this","that","here"]),VI=e=>ap.has(String(e||"").trim().toLowerCase()),bn={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"},mc=e=>e?`${String(e).toLowerCase()}(s)`:"entities",Xy="look up a taught fact about a subject/verb/object";h$={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}},yK=new Set(["stats","memory","focus",...Object.keys(h$)]),qI={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"},tp={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"]},$K=[...new Set(Object.values(qI))].map(e=>tp[e]?.[1]??`${e}s`),HI=new Set(["have","has","holds","hold"]),vK=new RegExp(`\\b(?:${[...Object.keys(de),...Object.keys(ws)].filter(e=>!HI.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),xK=new Set([...Ew.map(e=>e.name),...Object.values(h$).map(e=>e.tool)]),m$=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"]),g$=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"]),b$=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"]),KI=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),Jy=e=>e.replace(/(.)\1+/g,"$1");EK=cp(m$),SK=cp(g$),kK=cp(b$),jK=new RegExp(`^(?:${[...KI].map(Qe).join("|")})\\s+(.+)$`,"i"),_K=[...m$,...g$,...b$,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],lp="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",RK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${lp})\\s+than\\s+(.+)$`,"i"),YI=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${lp})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ye="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Bd="mgx:ownedBy",Wd="mgx:hasProperty",yi="rdfs:subClassOf",XI=new Set(["operator","teach","entailed"]),vo=e=>!!e.sourceTypes?.some(t=>XI.has(t));TK=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),AK=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),IK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),CK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${lp})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),OK=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),LK=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");NK=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),PK=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),MK=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),FK=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),DK=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),zK=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),UK=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)$`,"i"),BK=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ye})\\s+(.+?)[?.!\\s]*$`,"i"),WK=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ye}))?[?.!\\s]*$`,"i"),Qy=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,ZI=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"]);vc="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",eC="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",GK=new RegExp(`^(.+?)\\s+(${eC})\\s+(.+)$`,"i"),VK=new RegExp(`^([\\w'-]+)\\s+${vc}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),dp="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned",w$="with|to|from|by|of|in|on|for|as|about|into",qK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${vc}(${dp})\\s+(${w$})\\s+(.+)$`,"i"),HK=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${dp})\\s+(${w$})\\s+(.+)$`,"i"),KK=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),qd=/^(?:is|are|am|owns|maintains)$/i,Hd=/\b(?:is|are|am|owns|maintains)\b/i,tC=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"),YK=new RegExp(`^(?:${Ks.filter(e=>!/\s/.test(e)).join("|")})$`,"i");nC=new RegExp(`^(?:does|did)\\s+([\\w'-]+)\\s+${vc}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),sC=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${vc}([a-z]+(?:\\s+(?:${Ye}))?)[?.!\\s]*$`,"i"),Yd=/^(?:be|own|maintain)$/i,oC=new RegExp(`^(${Ye})\\s+(.+)$`,"i");iC=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],XK=new RegExp(`^(?:${iC.join("|")})\\b\\s*,?\\s+`,"i"),y$=Object.freeze(["you","i","it","they","he","she","we"]),$$=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),aC=Object.freeze([...$$,...y$]),JK=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${aC.join("|")})\\s+\\S+`,"i"),QK=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${y$.join("|")})\\s+(?:is|are|am|was|were)|(${$$.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),v$="forget|unlearn|delete|remove",ZK=new RegExp(`^(?:${v$})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),eY=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),tY=new RegExp(`^(?:${v$})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),wr="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",nY=new RegExp(`^what\\s+does\\s+(.+?)${wr}\\s+do${wr}\\??$`,"i"),sY=new RegExp(`^what\\s+(.+?)${wr}\\s+does${wr}\\??$`,"i"),oY=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${wr}\\s+do${wr}\\??$`,"i"),x$="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",rY=new RegExp(`^who\\s+(?:is|was)\\s+${x$}$`,"i"),iY=new RegExp(`^what\\s+(?:did|has)\\s+${x$}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),cC="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",aY=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${cC}\\b`,"i"),cY=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"),lY=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});uY=new Set([...Object.keys(de).flatMap(e=>e.split(/[\s-]+/)),...Zt,...yn,"owns","maintains"].filter(e=>e.length>=3)),xo={"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: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"},Zy=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"]),pp=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]);Dt=e=>`${e.subject} ${S$(e.predicate)} ${e.object}`;uC=Object.entries(xo).filter(([e])=>!pp.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);pC=/ \(source: [^)]*\)$/;fC=8;bc=null;wC=/^(?:every|each|all|any)\s+/i;j$=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"]),dY=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("|"))),np=/^(?: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,_$=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,yC=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,$C=/^(who|what)'?s\s+/i,$c=e=>String(e).replace($C,(t,n)=>`${n} is `),vC=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;xC=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,zs=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,ms=new Set(["rdfs:subClassOf","rdf:type"]),EC=6,SC=/^why\s+(?=(?:is|are)\b)/i,kC=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;op=new Set(["kind","sort","type","subclass","superclass"]),s$=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,jC=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,Se=32,_C=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,RC=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,TC=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,AC=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,IC=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,CC=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,OC=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,LC=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ye})\\s+(.+?)\\s*[?.!]*$`,"i"),NC=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,PC=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,MC=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,FC=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,DC=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;r$=e=>String(e||"").replace(/\s+/g," ").trim();T$="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",UC=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${T$})[?.!\\s]*$`,"i"),BC=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${T$})\\s+([\\w'-]+)[?.!\\s]*$`,"i");GC=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),VC=Object.entries(xo).filter(([e])=>!GC.has(e)&&!pp.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${Qe(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),qC=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),HC=Object.entries(xo).filter(([e])=>!qC.has(e)&&!pp.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=Qe(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=[E$(s),...o].map(Qe).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),c$=/^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,KC=new Set(["changed","change","changes","updated","modified","happened","occurred"]);XC=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,JC=/^what\s+kind\s+of\s+(?:thing|class|type|category|entity)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,QC=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,ZC=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,l$=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),eO=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,tO=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,nO=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,sO=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,oO=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,u$=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,hs=/^(?:it|this|that)$/i,d$=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,p$=/^(?:you|i|they|he|she|we)\b/i,f$=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${yc(e)} is ${t}".`,replace:!0}),rO=/^(?: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;aO=/inherit|supertype|subclass|extend|specializ/i,cO=8;pY=new RegExp(`\\b(?:${[...ap].join("|")})\\b`,"i"),O$=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,uO=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,dO=/^(?: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;fY=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(Be).join("|")})$`,"i"),Zd="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",ip="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",pO=`(?:\\s+${ip})?`,hY=[new RegExp(`^${Zd}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${pO}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Zd}architecture\\s+(?:${ip}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Zd}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${ip}(?:\\s+here)?\\??$`,"i")],mY={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:bn.contains,subclasses:bn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:bn.calls,callees:bn.calls,tests:bn.tests,untested:bn.tests,history:bn.touches,exports:bn.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"},L$="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",gY=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+${L$}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),bY=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${L$}\\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"),wY=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"),yY=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"),$Y=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)",vY=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${xc}\\s*\\??$`,"i"),xY=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${xc}\\s*\\??$`,"i"),EY=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${xc}\\s*\\??$`,"i"),SY=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${xc}\\s*[.!]*$`,"i"),fO=Object.freeze([...ap].filter(e=>e!=="here").concat("they")),kY=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${fO.join("|")})\\b(\\s+\\S.*)?$`,"i"),jY=J(".tmct","memory","corpus-seed.json")});hc();Ve();Kn();ic();var Ec={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 M$=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Eo=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Sc=e=>M$[e]||"other",mO=e=>Math.max(0,Math.min(1,e));function N$(e){let t=(e.sourceTypes||[]).map(n=>Xs[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:Xs.entailed}function gO(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function P$(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function F$(e,t,n={},s={}){let o={...Ec,...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(Sc($.predicate)==="isa"){let x=P$($.object,n);if(l&&x>o.uninformativeClassMaxShare){a.push({row:$,family:"isa",reason:"uninformative-class",share:x});continue}}c.push($)}let u=c.filter($=>Sc($.predicate)==="isa").map($=>$.object),d=rc(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),f=new Map,p=new Map;for(let $ of d.clusters){let x=0;for(let S of $.objects){p.set(S,$.label);let E=c.find(R=>R.object===S&&Sc(R.predicate)==="isa");x+=E?N$(E):0}f.set($.label,x)}let h=null,m=-1;for(let[$,x]of[...f].sort((S,E)=>S[0].localeCompare(E[0])))x>m&&(m=x,h=$);let g=[];for(let $ of c){let x=Sc($.predicate),S=N$($),E={provenance:S};if(gO($)&&(S-=o.entailedDepthPenalty,E.entailed=!0),x==="isa"){let j=.6+.4*(1-P$($.object,n));S*=j,E.informativeness=j;let A=p.get($.object);h&&A&&A!==h&&(S-=o.minoritySensePenalty,E.minoritySense=A)}S=mO(S),g.push({row:$,family:x,score:S,reasons:E})}let b=[];for(let $ of g)$.score<o.minScore?a.push({row:$.row,family:$.family,reason:"below-floor",score:$.score}):b.push($);let y=new Map;for(let $ of b)y.has($.family)||y.set($.family,[]),y.get($.family).push($);for(let $ of y.values())$.sort((x,S)=>S.score-x.score||x.row.object.localeCompare(S.row.object));let w=Eo.filter($=>y.has($)).concat([...y.keys()].filter($=>!Eo.includes($)).sort()),v=[],_=!1;for(;v.length<r&&!_;){_=!0;for(let $ of w){let x=y.get($);if(x&&x.length&&(v.push(x.shift()),_=!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 S=Eo.indexOf($.family),E=Eo.indexOf(x.family);return S-E||x.score-$.score||$.row.object.localeCompare(x.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:h}}}Qi();sn();var bO=new Set(["isa","location","partOf","capableOf","usedFor"]),wO=new Set(["single","several","chained","group","closer"]),D$=(e,t)=>`${e}:${t}`;function fp(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!bO.has(n.family)||typeof n.form!="string"||!wO.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=D$(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 So=e=>`${Uo(e)} ${e}`;function yO(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=So(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Or(s.map(So))}`:n}function $O(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:Bo(o),A_TERM:So(o),A_TERM_CAP:Bo(So(o)),TERMS:Ji(o),TERMS_CAP:Bo(Ji(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?So(a):"",OBJECT:i,A_OBJECT:i?So(i):"",OBJECTS_A:Or(r.map(So)),OBJECTS_PLURAL:Or(r.map(Ji)),OBJECTS_RAW:Or(r),CHAIN:yO(n&&n.length?n:r.slice(0,1))}}function vO(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 gs(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(D$(t,i)):null,l=a?a.templates:null;if(!l||!l.length)return null;let c=s.variantSeed??"",u=la(`${r}|${t}|${i}|${c}`)%l.length,d=s.objectsOverride||o.map(p=>p.object),f=vO(l[u],$O(r,d,s.chain,s.parent));return f?{text:f,rows:o,family:t,form:i}:null}Qi();var xO=Eo.filter(e=>e!=="isa"&&e!=="other");function EO(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 z$(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 SO(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 kO(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 jO(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=gs(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=gs(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=gs(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 SO(a,t))for(let p of z$(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?gs(s,"isa",f.rows,{term:n,form:"group",parent:f.parent,variantSeed:f.parent}):gs(s,"isa",f.rows,{term:n,form:"several",variantSeed:n});p&&r.push({...p,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=kO(t,e,o.closerRootCount);if(u.length){let f=gs(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 _O(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Bo(`${Uo(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function RO(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 U$(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Ec,...n.config||{}},a=EO(e?.selected||[]),l=[];for(let u of jO(a.get("isa")||[],r,s,t,i))l.push(u);for(let u of xO){let d=a.get(u);if(!(!d||!d.length))for(let f of z$(d,i.maxObjectsPerBodySentence)){let p=gs(t,u,f,{term:s});p&&l.push({...p,role:"describes",paragraph:"description"})}}_O(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:RO(l,o),provenanceRows:[...c.values()]}}var TO=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function AO(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 IO=Object.freeze({facts:"show the facts",chains:"show the chains"});function CO(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:IO,facts:n.map(TO),factCount:n.length,chains:s}}function B$(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:AO(t?.provenanceRows||[]),detail:CO(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function W$(e,t,n={},s=new Map,o={}){let r=F$(e,t,n,o),i=U$(r,s,o);return B$(r,i,o)}ic();var G$=new Set(["rdfs:subClassOf","rdf:type"]);function V$(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(G$.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 q$(e,t,n=6){let s=fi(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=oc(r,s,{cap:n});i.length>1&&(o[r]=i)}return o}function H$(e){let t=[],n=new Set;for(let s of e||[])!s||!G$.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Ve();hc();function OO(e,t,n,s,o={}){let r=fp(s||[]);if(!r||r.size===0)return null;let i=t||[],a=V$(n||i),l=q$(a.subClassEdges,H$(i));return W$(e,i,a,r,{...o,chains:l})}function K$(e,t,n,s={}){let o=vt(e||{individuals:[],objectProperties:[]}),r=Y(Q,t),i=o.filter(l=>r.has(l.subject));if(!i.length)return null;let a=OO(t,i,o,n,s);return LO(a)}function LO(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 NO="no session is open on this page yet \u2014 await tmct.open() first",Y$=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[Y$])return a;let l=null,c=()=>{if(!l)throw new Error(NO);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[Y$]=r,i.tmct=u,u}function PO({payload:e=null}={}){let t=ii();return e&&(t.payload=e),{memoryDir:t}}async function MO(e,t,n){let s=null;try{s=await A$(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await C$(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:PO,ask:MO,page:{normFactTerm:Q,digestTermFromPayloadBrowser:K$},fallback:!0});})();