[{"data":1,"prerenderedAt":2029},["ShallowReactive",2],{"i-mdi:magnify":3,"i-simple-icons:visualstudiocode":8,"i-mdi:github":11,"i-mdi:discord":13,"i-mdi:youtube":15,"i-mdi:flask-outline":17,"i-vscode-icons:default-folder-opened":19,"i-vscode-icons:default-folder":22,"i-vscode-icons:folder-type-plugin":24,"i-vscode-icons:folder-type-src":26,"i-vscode-icons:file-type-typescript":28,"i-vscode-icons:file-type-json":30,"docs-\u002Fdocs\u002Fv2\u002Fcognets\u002Fapi\u002Fengine":32},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"currentColor\" d=\"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9,"hidden":10},"\u003Cpath fill=\"currentColor\" d=\"M23.15 2.587L18.21.21a1.49 1.49 0 0 0-1.705.29l-9.46 8.63l-4.12-3.128a1 1 0 0 0-1.276.057L.327 7.261A1 1 0 0 0 .326 8.74L3.899 12L.326 15.26a1 1 0 0 0 .001 1.479L1.65 17.94a1 1 0 0 0 1.276.057l4.12-3.128l9.46 8.63a1.49 1.49 0 0 0 1.704.29l4.942-2.377A1.5 1.5 0 0 0 24 20.06V3.939a1.5 1.5 0 0 0-.85-1.352m-5.146 14.861L10.826 12l7.178-5.448z\"\u002F>",true,{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":12},"\u003Cpath fill=\"currentColor\" d=\"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":14,"hidden":10},"\u003Cpath fill=\"currentColor\" d=\"m22 24l-5.25-5l.63 2H4.5A2.5 2.5 0 0 1 2 18.5v-15A2.5 2.5 0 0 1 4.5 1h15A2.5 2.5 0 0 1 22 3.5V24M12 6.8c-2.68 0-4.56 1.15-4.56 1.15c1.03-.92 2.83-1.45 2.83-1.45l-.17-.17c-1.69.03-3.22 1.2-3.22 1.2c-1.72 3.59-1.61 6.69-1.61 6.69c1.4 1.81 3.48 1.68 3.48 1.68l.71-.9c-1.25-.27-2.04-1.38-2.04-1.38S9.3 14.9 12 14.9s4.58-1.28 4.58-1.28s-.79 1.11-2.04 1.38l.71.9s2.08.13 3.48-1.68c0 0 .11-3.1-1.61-6.69c0 0-1.53-1.17-3.22-1.2l-.17.17s1.8.53 2.83 1.45c0 0-1.88-1.15-4.56-1.15m-2.07 3.79c.65 0 1.18.57 1.17 1.27c0 .69-.52 1.27-1.17 1.27c-.64 0-1.16-.58-1.16-1.27c0-.7.51-1.27 1.16-1.27m4.17 0c.65 0 1.17.57 1.17 1.27c0 .69-.52 1.27-1.17 1.27c-.64 0-1.16-.58-1.16-1.27c0-.7.51-1.27 1.16-1.27Z\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":16},"\u003Cpath fill=\"currentColor\" d=\"m10 15l5.19-3L10 9zm11.56-7.83c.13.47.22 1.1.28 1.9c.07.8.1 1.49.1 2.09L22 12c0 2.19-.16 3.8-.44 4.83c-.25.9-.83 1.48-1.73 1.73c-.47.13-1.33.22-2.65.28c-1.3.07-2.49.1-3.59.1L12 19c-4.19 0-6.8-.16-7.83-.44c-.9-.25-1.48-.83-1.73-1.73c-.13-.47-.22-1.1-.28-1.9c-.07-.8-.1-1.49-.1-2.09L2 12c0-2.19.16-3.8.44-4.83c.25-.9.83-1.48 1.73-1.73c.47-.13 1.33-.22 2.65-.28c1.3-.07 2.49-.1 3.59-.1L12 5c4.19 0 6.8.16 7.83.44c.9.25 1.48.83 1.73 1.73\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":18},"\u003Cpath fill=\"currentColor\" d=\"M5 19a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1c0-.21-.07-.41-.18-.57L13 8.35V4h-2v4.35L5.18 18.43c-.11.16-.18.36-.18.57m1 3a3 3 0 0 1-3-3c0-.6.18-1.16.5-1.63L9 7.81V6a1 1 0 0 1-1-1V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1v1.81l5.5 9.56c.32.47.5 1.03.5 1.63a3 3 0 0 1-3 3zm7-6l1.34-1.34L16.27 18H7.73l2.66-4.61zm-.5-4a.5.5 0 0 1 .5.5a.5.5 0 0 1-.5.5a.5.5 0 0 1-.5-.5a.5.5 0 0 1 .5-.5\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":21},32,"\u003Cpath fill=\"#dcb67a\" d=\"M27.4 5.5h-9.2l-2.1 4.2H4.3v16.8h25.2v-21Zm0 18.7H6.6V11.8h20.8Zm0-14.5h-8.2l1-2.1h7.1v2.1Z\"\u002F>\u003Cpath fill=\"#dcb67a\" d=\"M25.7 13.7H.5l3.8 12.8h25.2z\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":23},"\u003Cpath fill=\"#c09553\" d=\"M27.5 5.5h-9.3l-2.1 4.2H4.4v16.8h25.2v-21Zm0 4.2h-8.2l1.1-2.1h7.1Z\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":25},"\u003Cpath fill=\"#ffba58\" d=\"M27.5 5.5h-9.3l-2.1 4.2H4.4v16.8h25.2v-21Zm0 4.2h-8.2l1.1-2.1h7.1Z\"\u002F>\u003Cpath fill=\"#e76a00\" d=\"M20 12.5V14h-4a2.006 2.006 0 0 0-2 2v4h-1.5a2.5 2.5 0 0 0 0 5H14v4a2.006 2.006 0 0 0 2 2h3.8v-1.5a2.7 2.7 0 0 1 5.4 0V31H29a2.006 2.006 0 0 0 2-2v-3.8h-1.5a2.7 2.7 0 0 1 0-5.4H31V16a2.006 2.006 0 0 0-2-2h-4v-1.5a2.5 2.5 0 0 0-5 0\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":27},"\u003Cpath fill=\"#14622a\" d=\"M27.5 5.5h-9.3l-2.1 4.2H4.4v16.8h25.2v-21Zm0 4.2h-8.2l1.1-2.1h7.1Z\"\u002F>\u003Cpath fill=\"#06cc14\" d=\"M19.146 30.989a1 1 0 0 1-.207-.025a1.04 1.04 0 0 1-.726-1.213l2.709-14.431a1.04 1.04 0 0 1 .444-.683a.9.9 0 0 1 .7-.122a1.043 1.043 0 0 1 .727 1.213L20.077 30.16a1.03 1.03 0 0 1-.442.681a.9.9 0 0 1-.489.148m5.432-2.045h-.068a.93.93 0 0 1-.668-.377a1.1 1.1 0 0 1 .1-1.419l4.658-4.553l-4.638-4.239a1.1 1.1 0 0 1-.141-1.416a.94.94 0 0 1 .661-.4a.9.9 0 0 1 .709.237l5.47 5a1.1 1.1 0 0 1 .144 1.416a1 1 0 0 1-.142.163l-5.447 5.324a.92.92 0 0 1-.638.264m-8.155.003a.9.9 0 0 1-.639-.267l-5.452-5.327a1 1 0 0 1-.132-.153a1.094 1.094 0 0 1 .141-1.414l5.471-5a.88.88 0 0 1 .7-.238a.94.94 0 0 1 .665.4a1.1 1.1 0 0 1-.14 1.417L12.4 22.6l4.659 4.551a1.09 1.09 0 0 1 .1 1.419a.93.93 0 0 1-.669.377Z\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":29},"\u003Cpath fill=\"#007acc\" d=\"M23.827 8.243a4.4 4.4 0 0 1 2.223 1.281a6 6 0 0 1 .852 1.143c.011.045-1.534 1.083-2.471 1.662c-.034.023-.169-.124-.322-.35a2.01 2.01 0 0 0-1.67-1c-1.077-.074-1.771.49-1.766 1.433a1.3 1.3 0 0 0 .153.666c.237.49.677.784 2.059 1.383c2.544 1.095 3.636 1.817 4.31 2.843a5.16 5.16 0 0 1 .416 4.333a4.76 4.76 0 0 1-3.932 2.815a11 11 0 0 1-2.708-.028a6.53 6.53 0 0 1-3.616-1.884a6.3 6.3 0 0 1-.926-1.371a3 3 0 0 1 .327-.208c.158-.09.756-.434 1.32-.761l1.024-.6l.214.312a4.8 4.8 0 0 0 1.35 1.292a3.3 3.3 0 0 0 3.458-.175a1.545 1.545 0 0 0 .2-1.974c-.276-.395-.84-.727-2.443-1.422a8.8 8.8 0 0 1-3.349-2.055a4.7 4.7 0 0 1-.976-1.777a7.1 7.1 0 0 1-.062-2.268a4.33 4.33 0 0 1 3.644-3.374a9 9 0 0 1 2.691.084m-8.343 1.483l.011 1.454h-4.63v13.148H7.6V11.183H2.97V9.755a14 14 0 0 1 .04-1.466c.017-.023 2.832-.034 6.245-.028l6.211.017Z\"\u002F>",{"left":4,"top":4,"width":20,"height":20,"rotate":4,"vFlip":6,"hFlip":6,"body":31},"\u003Cpath fill=\"#f5de19\" d=\"M4.014 14.976a2.5 2.5 0 0 0 1.567-.518a2.38 2.38 0 0 0 .805-1.358a15.3 15.3 0 0 0 .214-2.944q.012-2.085.075-2.747a5.2 5.2 0 0 1 .418-1.686a3 3 0 0 1 .755-1.018A3.05 3.05 0 0 1 9 4.125A6.8 6.8 0 0 1 10.544 4h.7v1.96h-.387a2.34 2.34 0 0 0-1.723.468a3.4 3.4 0 0 0-.425 2.092a36 36 0 0 1-.137 4.133a4.7 4.7 0 0 1-.768 2.06A4.6 4.6 0 0 1 6.1 16a3.8 3.8 0 0 1 1.992 1.754a8.9 8.9 0 0 1 .618 3.865q0 2.435.05 2.9a1.76 1.76 0 0 0 .504 1.181a2.64 2.64 0 0 0 1.592.337h.387V28h-.7a5.7 5.7 0 0 1-1.773-.2a2.97 2.97 0 0 1-1.324-.93a3.35 3.35 0 0 1-.681-1.63a24 24 0 0 1-.165-3.234a16.5 16.5 0 0 0-.214-3.106a2.4 2.4 0 0 0-.805-1.361a2.5 2.5 0 0 0-1.567-.524Zm23.972 2.035a2.5 2.5 0 0 0-1.567.524a2.4 2.4 0 0 0-.805 1.361a16.5 16.5 0 0 0-.212 3.109a24 24 0 0 1-.169 3.234a3.35 3.35 0 0 1-.681 1.63a2.97 2.97 0 0 1-1.324.93a5.7 5.7 0 0 1-1.773.2h-.7V26.04h.387a2.64 2.64 0 0 0 1.592-.337a1.76 1.76 0 0 0 .506-1.186q.05-.462.05-2.9a8.9 8.9 0 0 1 .618-3.865A3.8 3.8 0 0 1 25.9 16a4.6 4.6 0 0 1-1.7-1.286a4.7 4.7 0 0 1-.768-2.06a36 36 0 0 1-.137-4.133a3.4 3.4 0 0 0-.425-2.092a2.34 2.34 0 0 0-1.723-.468h-.387V4h.7a6.8 6.8 0 0 1 1.54.125a3.05 3.05 0 0 1 1.149.581a3 3 0 0 1 .755 1.018a5.2 5.2 0 0 1 .418 1.686q.062.662.075 2.747a15.3 15.3 0 0 0 .212 2.947a2.38 2.38 0 0 0 .805 1.355a2.5 2.5 0 0 0 1.567.518Z\"\u002F>",{"id":33,"title":34,"body":35,"description":2022,"extension":2023,"meta":2024,"navigation":10,"path":2025,"seo":2026,"stem":2027,"__hash__":2028},"docs\u002Fdocs\u002Fv2\u002Fcognets\u002Fapi\u002Fengine.md","kernel.engine",{"type":36,"value":37,"toc":2004},"minimark",[38,42,56,551,558,563,725,823,826,840,844,851,939,945,952,958,1017,1020,1035,1041,1176,1277,1301,1307,1320,1325,1394,1413,1422,1426,1494,1501,1515,1521,1571,1596,1609,1615,1753,1764,1777,1783,1906,1966,1976,1986,1989,1993,2000],[39,40,34],"h1",{"id":41},"kernelengine",[43,44,45,46,50,51,55],"p",{},"Inference, by ",[47,48,49],"strong",{},"role",". A cognet names what an engine is ",[52,53,54],"em",{},"for"," and never which model fills\nit — that is decided at boot against whatever providers the user declared.",[57,58,63],"pre",{"className":59,"code":60,"language":61,"meta":62,"style":62},"language-ts shiki shiki-themes dark-plus","type KernelEngines = {\n    \u002F** The handle for a declared role. THROWS for an unbound one. *\u002F\n    (role: string): KernelEngine\n    \u002F** Is this role filled? The entire degradation contract. *\u002F\n    has(role: string): boolean\n}\n\ntype KernelEngine = GenerateEngine | TransformEngine | StreamEngine\n\n\u002F** What every handle reports about what it actually got. *\u002F\ntype EngineFacts = {\n    \u002F** Usable context window. Undefined when the source does not report one. *\u002F\n    readonly context: number | undefined\n    readonly modalities: { in: readonly Modality[]; out: readonly Modality[] }\n    \u002F** Concurrent calls this role may run. At least 1, never 0. *\u002F\n    readonly slots: number\n}\n\ntype GenerateEngine = EngineFacts & {\n    readonly type: \"generate\"\n    stream(req: CognetEngineCall): AsyncGenerator\u003CAxonEngineEvent>\n    request(req: CognetEngineCall): Promise\u003CAxonEngineResponse>\n}\n\ntype TransformEngine = EngineFacts & {\n    readonly type: \"transform\"\n    transform(input: unknown, opts?: TransformOptions): Promise\u003Cunknown>\n}\n\ntype StreamEngine = EngineFacts & {\n    readonly type: \"stream\"\n    \u002F** Begin one sequence. Every push into it shares the model's hidden state. *\u002F\n    open(): EngineSession\n}\n\ntype Modality = \"text\" | \"image\" | \"audio\" | \"video\" | \"vector\" | \"score\" | \"depth\"\n","ts","",[64,65,66,83,90,111,117,138,144,150,175,180,186,196,202,221,258,264,277,282,287,303,317,347,373,378,382,396,408,446,451,456,470,482,487,499,504,509],"code",{"__ignoreMap":62},[67,68,71,75,79],"span",{"class":69,"line":70},"line",1,[67,72,74],{"class":73},"scz_3","type",[67,76,78],{"class":77},"sNl3T"," KernelEngines",[67,80,82],{"class":81},"sTNBD"," = {\n",[67,84,86],{"class":69,"line":85},2,[67,87,89],{"class":88},"sOLPB","    \u002F** The handle for a declared role. THROWS for an unbound one. *\u002F\n",[67,91,93,96,99,102,105,108],{"class":69,"line":92},3,[67,94,95],{"class":81},"    (",[67,97,49],{"class":98},"s3F5K",[67,100,101],{"class":81},": ",[67,103,104],{"class":77},"string",[67,106,107],{"class":81},"): ",[67,109,110],{"class":77},"KernelEngine\n",[67,112,114],{"class":69,"line":113},4,[67,115,116],{"class":88},"    \u002F** Is this role filled? The entire degradation contract. *\u002F\n",[67,118,120,124,127,129,131,133,135],{"class":69,"line":119},5,[67,121,123],{"class":122},"sCudf","    has",[67,125,126],{"class":81},"(",[67,128,49],{"class":98},[67,130,101],{"class":81},[67,132,104],{"class":77},[67,134,107],{"class":81},[67,136,137],{"class":77},"boolean\n",[67,139,141],{"class":69,"line":140},6,[67,142,143],{"class":81},"}\n",[67,145,147],{"class":69,"line":146},7,[67,148,149],{"emptyLinePlaceholder":10},"\n",[67,151,153,155,158,161,164,167,170,172],{"class":69,"line":152},8,[67,154,74],{"class":73},[67,156,157],{"class":77}," KernelEngine",[67,159,160],{"class":81}," = ",[67,162,163],{"class":77},"GenerateEngine",[67,165,166],{"class":81}," | ",[67,168,169],{"class":77},"TransformEngine",[67,171,166],{"class":81},[67,173,174],{"class":77},"StreamEngine\n",[67,176,178],{"class":69,"line":177},9,[67,179,149],{"emptyLinePlaceholder":10},[67,181,183],{"class":69,"line":182},10,[67,184,185],{"class":88},"\u002F** What every handle reports about what it actually got. *\u002F\n",[67,187,189,191,194],{"class":69,"line":188},11,[67,190,74],{"class":73},[67,192,193],{"class":77}," EngineFacts",[67,195,82],{"class":81},[67,197,199],{"class":69,"line":198},12,[67,200,201],{"class":88},"    \u002F** Usable context window. Undefined when the source does not report one. *\u002F\n",[67,203,205,208,211,213,216,218],{"class":69,"line":204},13,[67,206,207],{"class":73},"    readonly",[67,209,210],{"class":98}," context",[67,212,101],{"class":81},[67,214,215],{"class":77},"number",[67,217,166],{"class":81},[67,219,220],{"class":77},"undefined\n",[67,222,224,226,229,232,235,237,240,243,246,249,251,253,255],{"class":69,"line":223},14,[67,225,207],{"class":73},[67,227,228],{"class":98}," modalities",[67,230,231],{"class":81},": { ",[67,233,234],{"class":98},"in",[67,236,101],{"class":81},[67,238,239],{"class":73},"readonly",[67,241,242],{"class":77}," Modality",[67,244,245],{"class":81},"[]; ",[67,247,248],{"class":98},"out",[67,250,101],{"class":81},[67,252,239],{"class":73},[67,254,242],{"class":77},[67,256,257],{"class":81},"[] }\n",[67,259,261],{"class":69,"line":260},15,[67,262,263],{"class":88},"    \u002F** Concurrent calls this role may run. At least 1, never 0. *\u002F\n",[67,265,267,269,272,274],{"class":69,"line":266},16,[67,268,207],{"class":73},[67,270,271],{"class":98}," slots",[67,273,101],{"class":81},[67,275,276],{"class":77},"number\n",[67,278,280],{"class":69,"line":279},17,[67,281,143],{"class":81},[67,283,285],{"class":69,"line":284},18,[67,286,149],{"emptyLinePlaceholder":10},[67,288,290,292,295,297,300],{"class":69,"line":289},19,[67,291,74],{"class":73},[67,293,294],{"class":77}," GenerateEngine",[67,296,160],{"class":81},[67,298,299],{"class":77},"EngineFacts",[67,301,302],{"class":81}," & {\n",[67,304,306,308,311,313],{"class":69,"line":305},20,[67,307,207],{"class":73},[67,309,310],{"class":98}," type",[67,312,101],{"class":81},[67,314,316],{"class":315},"sKc5r","\"generate\"\n",[67,318,320,323,325,328,330,333,335,338,341,344],{"class":69,"line":319},21,[67,321,322],{"class":122},"    stream",[67,324,126],{"class":81},[67,326,327],{"class":98},"req",[67,329,101],{"class":81},[67,331,332],{"class":77},"CognetEngineCall",[67,334,107],{"class":81},[67,336,337],{"class":77},"AsyncGenerator",[67,339,340],{"class":81},"\u003C",[67,342,343],{"class":77},"AxonEngineEvent",[67,345,346],{"class":81},">\n",[67,348,350,353,355,357,359,361,363,366,368,371],{"class":69,"line":349},22,[67,351,352],{"class":122},"    request",[67,354,126],{"class":81},[67,356,327],{"class":98},[67,358,101],{"class":81},[67,360,332],{"class":77},[67,362,107],{"class":81},[67,364,365],{"class":77},"Promise",[67,367,340],{"class":81},[67,369,370],{"class":77},"AxonEngineResponse",[67,372,346],{"class":81},[67,374,376],{"class":69,"line":375},23,[67,377,143],{"class":81},[67,379,380],{"class":69,"line":5},[67,381,149],{"emptyLinePlaceholder":10},[67,383,385,387,390,392,394],{"class":69,"line":384},25,[67,386,74],{"class":73},[67,388,389],{"class":77}," TransformEngine",[67,391,160],{"class":81},[67,393,299],{"class":77},[67,395,302],{"class":81},[67,397,399,401,403,405],{"class":69,"line":398},26,[67,400,207],{"class":73},[67,402,310],{"class":98},[67,404,101],{"class":81},[67,406,407],{"class":315},"\"transform\"\n",[67,409,411,414,416,419,421,424,427,430,433,436,438,440,442,444],{"class":69,"line":410},27,[67,412,413],{"class":122},"    transform",[67,415,126],{"class":81},[67,417,418],{"class":98},"input",[67,420,101],{"class":81},[67,422,423],{"class":77},"unknown",[67,425,426],{"class":81},", ",[67,428,429],{"class":98},"opts",[67,431,432],{"class":81},"?: ",[67,434,435],{"class":77},"TransformOptions",[67,437,107],{"class":81},[67,439,365],{"class":77},[67,441,340],{"class":81},[67,443,423],{"class":77},[67,445,346],{"class":81},[67,447,449],{"class":69,"line":448},28,[67,450,143],{"class":81},[67,452,454],{"class":69,"line":453},29,[67,455,149],{"emptyLinePlaceholder":10},[67,457,459,461,464,466,468],{"class":69,"line":458},30,[67,460,74],{"class":73},[67,462,463],{"class":77}," StreamEngine",[67,465,160],{"class":81},[67,467,299],{"class":77},[67,469,302],{"class":81},[67,471,473,475,477,479],{"class":69,"line":472},31,[67,474,207],{"class":73},[67,476,310],{"class":98},[67,478,101],{"class":81},[67,480,481],{"class":315},"\"stream\"\n",[67,483,484],{"class":69,"line":20},[67,485,486],{"class":88},"    \u002F** Begin one sequence. Every push into it shares the model's hidden state. *\u002F\n",[67,488,490,493,496],{"class":69,"line":489},33,[67,491,492],{"class":122},"    open",[67,494,495],{"class":81},"(): ",[67,497,498],{"class":77},"EngineSession\n",[67,500,502],{"class":69,"line":501},34,[67,503,143],{"class":81},[67,505,507],{"class":69,"line":506},35,[67,508,149],{"emptyLinePlaceholder":10},[67,510,512,514,516,518,521,523,526,528,531,533,536,538,541,543,546,548],{"class":69,"line":511},36,[67,513,74],{"class":73},[67,515,242],{"class":77},[67,517,160],{"class":81},[67,519,520],{"class":315},"\"text\"",[67,522,166],{"class":81},[67,524,525],{"class":315},"\"image\"",[67,527,166],{"class":81},[67,529,530],{"class":315},"\"audio\"",[67,532,166],{"class":81},[67,534,535],{"class":315},"\"video\"",[67,537,166],{"class":81},[67,539,540],{"class":315},"\"vector\"",[67,542,166],{"class":81},[67,544,545],{"class":315},"\"score\"",[67,547,166],{"class":81},[67,549,550],{"class":315},"\"depth\"\n",[43,552,553,554,557],{},"Callable with ",[64,555,556],{},"has"," hung off it, so the common case reads as one verb and the degradation\ncheck reads as a question.",[559,560,562],"h2",{"id":561},"declaring-roles","Declaring roles",[57,564,566],{"className":59,"code":565,"language":61,"meta":62,"style":62},"\u002F\u002F cognet.config.ts\nexport default defineCognet({\n    engines: {\n        main:    { type: \"generate\", in: \"text\", out: \"text\", context: 100_000 },\n        percept: { type: \"generate\", in: [\"text\", \"image\"], out: \"text\", parallel: true, optional: true },\n        vad:     { type: \"stream\", in: \"audio\", out: \"score\" },\n    },\n})\n",[64,567,568,573,588,596,637,686,715,720],{"__ignoreMap":62},[67,569,570],{"class":69,"line":70},[67,571,572],{"class":88},"\u002F\u002F cognet.config.ts\n",[67,574,575,579,582,585],{"class":69,"line":85},[67,576,578],{"class":577},"sYbnZ","export",[67,580,581],{"class":577}," default",[67,583,584],{"class":122}," defineCognet",[67,586,587],{"class":81},"({\n",[67,589,590,593],{"class":69,"line":92},[67,591,592],{"class":98},"    engines:",[67,594,595],{"class":81}," {\n",[67,597,598,601,604,607,610,612,615,618,620,623,625,627,630,634],{"class":69,"line":113},[67,599,600],{"class":98},"        main:",[67,602,603],{"class":81},"    { ",[67,605,606],{"class":98},"type:",[67,608,609],{"class":315}," \"generate\"",[67,611,426],{"class":81},[67,613,614],{"class":98},"in:",[67,616,617],{"class":315}," \"text\"",[67,619,426],{"class":81},[67,621,622],{"class":98},"out:",[67,624,617],{"class":315},[67,626,426],{"class":81},[67,628,629],{"class":98},"context:",[67,631,633],{"class":632},"sDGX8"," 100_000",[67,635,636],{"class":81}," },\n",[67,638,639,642,645,647,649,651,653,656,658,660,662,665,667,669,671,674,677,679,682,684],{"class":69,"line":119},[67,640,641],{"class":98},"        percept:",[67,643,644],{"class":81}," { ",[67,646,606],{"class":98},[67,648,609],{"class":315},[67,650,426],{"class":81},[67,652,614],{"class":98},[67,654,655],{"class":81}," [",[67,657,520],{"class":315},[67,659,426],{"class":81},[67,661,525],{"class":315},[67,663,664],{"class":81},"], ",[67,666,622],{"class":98},[67,668,617],{"class":315},[67,670,426],{"class":81},[67,672,673],{"class":98},"parallel:",[67,675,676],{"class":73}," true",[67,678,426],{"class":81},[67,680,681],{"class":98},"optional:",[67,683,676],{"class":73},[67,685,636],{"class":81},[67,687,688,691,694,696,699,701,703,706,708,710,713],{"class":69,"line":140},[67,689,690],{"class":98},"        vad:",[67,692,693],{"class":81},"     { ",[67,695,606],{"class":98},[67,697,698],{"class":315}," \"stream\"",[67,700,426],{"class":81},[67,702,614],{"class":98},[67,704,705],{"class":315}," \"audio\"",[67,707,426],{"class":81},[67,709,622],{"class":98},[67,711,712],{"class":315}," \"score\"",[67,714,636],{"class":81},[67,716,717],{"class":69,"line":146},[67,718,719],{"class":81},"    },\n",[67,721,722],{"class":69,"line":152},[67,723,724],{"class":81},"})\n",[726,727,728,741],"table",{},[729,730,731],"thead",{},[732,733,734,738],"tr",{},[735,736,737],"th",{},"Field",[735,739,740],{},"Meaning",[742,743,744,754,766,779,789,803,813],"tbody",{},[732,745,746,751],{},[747,748,749],"td",{},[64,750,74],{},[747,752,753],{},"Which handle shape the cognet's code is written against",[732,755,756,763],{},[747,757,758,760,761],{},[64,759,234],{}," \u002F ",[64,762,248],{},[747,764,765],{},"Accepted and produced modalities. A single value is shorthand for one",[732,767,768,773],{},[747,769,770],{},[64,771,772],{},"context",[747,774,775,776],{},"Minimum usable window in tokens. Only meaningful for ",[64,777,778],{},"generate",[732,780,781,786],{},[747,782,783],{},[64,784,785],{},"structured",[747,787,788],{},"The reply must be parseable as structured output",[732,790,791,796],{},[747,792,793],{},[64,794,795],{},"parallel",[747,797,798,799,802],{},"A ",[47,800,801],{},"request"," for more slots, never a threshold",[732,804,805,810],{},[747,806,807],{},[64,808,809],{},"optional",[747,811,812],{},"The brain runs without this. Absent means required",[732,814,815,820],{},[747,816,817],{},[64,818,819],{},"primary",[747,821,822],{},"This role is what the user's model picker edits",[43,824,825],{},"The key is the cognet's private vocabulary and the user never types it — a user who had to\nname a brain's roles would be wiring one specific brain into their setup.",[43,827,828,831,832,835,836,839],{},[47,829,830],{},"Constraints are structural only."," Every field is something that ",[52,833,834],{},"breaks"," the brain when\nunmet, never something that merely makes it worse: a context window too small means the\nrender does not fit; a text-only model handed an image cannot answer at all. There is\ndeliberately no way to demand a ",[52,837,838],{},"good"," model. Quality is the user's tradeoff, and a cognet\nthat could refuse one would be overruling the person whose machine it runs on.",[559,841,843],{"id":842},"required-optional-and-the-degradation-path","Required, optional, and the degradation path",[43,845,846,847,850],{},"A required role with nothing to fill it fails at ",[64,848,849],{},"axon prepare"," — never at the first tick.",[57,852,854],{"className":59,"code":853,"language":61,"meta":62,"style":62},"const summary = kernel.engine.has(\"compress\")\n    ? await kernel.engine(\"compress\").request({ messages })\n    : truncate(messages)      \u002F\u002F the cheaper route\n",[64,855,856,888,921],{"__ignoreMap":62},[67,857,858,861,865,867,870,873,876,878,880,882,885],{"class":69,"line":70},[67,859,860],{"class":73},"const",[67,862,864],{"class":863},"s9McN"," summary",[67,866,160],{"class":81},[67,868,869],{"class":98},"kernel",[67,871,872],{"class":81},".",[67,874,875],{"class":98},"engine",[67,877,872],{"class":81},[67,879,556],{"class":122},[67,881,126],{"class":81},[67,883,884],{"class":315},"\"compress\"",[67,886,887],{"class":81},")\n",[67,889,890,893,896,899,901,903,905,907,910,912,915,918],{"class":69,"line":85},[67,891,892],{"class":81},"    ? ",[67,894,895],{"class":577},"await",[67,897,898],{"class":98}," kernel",[67,900,872],{"class":81},[67,902,875],{"class":122},[67,904,126],{"class":81},[67,906,884],{"class":315},[67,908,909],{"class":81},").",[67,911,801],{"class":122},[67,913,914],{"class":81},"({ ",[67,916,917],{"class":98},"messages",[67,919,920],{"class":81}," })\n",[67,922,923,926,929,931,933,936],{"class":69,"line":92},[67,924,925],{"class":81},"    : ",[67,927,928],{"class":122},"truncate",[67,930,126],{"class":81},[67,932,917],{"class":98},[67,934,935],{"class":81},")      ",[67,937,938],{"class":88},"\u002F\u002F the cheaper route\n",[43,940,941,944],{},[64,942,943],{},"has()"," is the whole degradation story. It is what lets one brain run against a frontier\naccount and against a single local model without knowing which it got.",[43,946,947,948,951],{},"Calling an unbound role ",[47,949,950],{},"throws",", deliberately. A required role that could not be filled\nalready stopped the boot, so reaching there means the cognet called an optional engine\nwithout asking first — a cognet bug, and a null handle would only move the crash one frame\nlater with less to say about it.",[559,953,955,957],{"id":954},"parallel-is-a-request-not-a-threshold",[64,956,795],{}," is a request, not a threshold",[57,959,961],{"className":59,"code":960,"language":61,"meta":62,"style":62},"const engine = kernel.engine(\"percept\")\nconst batch = chunk(frames, engine.slots)   \u002F\u002F branch on what you got\n",[64,962,963,985],{"__ignoreMap":62},[67,964,965,967,970,972,974,976,978,980,983],{"class":69,"line":70},[67,966,860],{"class":73},[67,968,969],{"class":863}," engine",[67,971,160],{"class":81},[67,973,869],{"class":98},[67,975,872],{"class":81},[67,977,875],{"class":122},[67,979,126],{"class":81},[67,981,982],{"class":315},"\"percept\"",[67,984,887],{"class":81},[67,986,987,989,992,994,997,999,1002,1004,1006,1008,1011,1014],{"class":69,"line":85},[67,988,860],{"class":73},[67,990,991],{"class":863}," batch",[67,993,160],{"class":81},[67,995,996],{"class":122},"chunk",[67,998,126],{"class":81},[67,1000,1001],{"class":98},"frames",[67,1003,426],{"class":81},[67,1005,875],{"class":98},[67,1007,872],{"class":81},[67,1009,1010],{"class":98},"slots",[67,1012,1013],{"class":81},")   ",[67,1015,1016],{"class":88},"\u002F\u002F branch on what you got\n",[43,1018,1019],{},"The count a cognet would name is a fact about a machine it cannot see, and asserting one\nturns \"runs slowly\" into \"refuses to install\" for exactly the users who most need it to\ndegrade. One slot is N sequential calls: slower, still correct, never zero.",[43,1021,1022,426,1024,1027,1028,1030,1031,1034],{},[64,1023,772],{},[64,1025,1026],{},"modalities"," and ",[64,1029,1010],{}," report what the role ",[47,1032,1033],{},"actually got",", which is how a\nbrain that declared a floor decides how hard to push against it.",[559,1036,1038,1040],{"id":1037},"generate-autoregressive-over-messages",[64,1039,778],{}," — autoregressive over messages",[57,1042,1044],{"className":59,"code":1043,"language":61,"meta":62,"style":62},"for await (const event of kernel.engine(\"main\").stream({ messages, protocol: \"classic\" })) {\n    if (event.type === \"engine:text\") { \u002F* the agent spoke *\u002F }\n    if (event.type === \"engine:script\") { \u002F* the model ran code *\u002F }\n    if (event.type === \"engine:done\") { \u002F* signals *\u002F }\n}\n",[64,1045,1046,1095,1124,1148,1172],{"__ignoreMap":62},[67,1047,1048,1050,1053,1056,1058,1061,1064,1066,1068,1070,1072,1075,1077,1080,1082,1084,1086,1089,1092],{"class":69,"line":70},[67,1049,54],{"class":577},[67,1051,1052],{"class":577}," await",[67,1054,1055],{"class":81}," (",[67,1057,860],{"class":73},[67,1059,1060],{"class":863}," event",[67,1062,1063],{"class":73}," of",[67,1065,898],{"class":98},[67,1067,872],{"class":81},[67,1069,875],{"class":122},[67,1071,126],{"class":81},[67,1073,1074],{"class":315},"\"main\"",[67,1076,909],{"class":81},[67,1078,1079],{"class":122},"stream",[67,1081,914],{"class":81},[67,1083,917],{"class":98},[67,1085,426],{"class":81},[67,1087,1088],{"class":98},"protocol:",[67,1090,1091],{"class":315}," \"classic\"",[67,1093,1094],{"class":81}," })) {\n",[67,1096,1097,1100,1102,1105,1107,1109,1112,1115,1118,1121],{"class":69,"line":85},[67,1098,1099],{"class":577},"    if",[67,1101,1055],{"class":81},[67,1103,1104],{"class":98},"event",[67,1106,872],{"class":81},[67,1108,74],{"class":98},[67,1110,1111],{"class":81}," === ",[67,1113,1114],{"class":315},"\"engine:text\"",[67,1116,1117],{"class":81},") { ",[67,1119,1120],{"class":88},"\u002F* the agent spoke *\u002F",[67,1122,1123],{"class":81}," }\n",[67,1125,1126,1128,1130,1132,1134,1136,1138,1141,1143,1146],{"class":69,"line":92},[67,1127,1099],{"class":577},[67,1129,1055],{"class":81},[67,1131,1104],{"class":98},[67,1133,872],{"class":81},[67,1135,74],{"class":98},[67,1137,1111],{"class":81},[67,1139,1140],{"class":315},"\"engine:script\"",[67,1142,1117],{"class":81},[67,1144,1145],{"class":88},"\u002F* the model ran code *\u002F",[67,1147,1123],{"class":81},[67,1149,1150,1152,1154,1156,1158,1160,1162,1165,1167,1170],{"class":69,"line":113},[67,1151,1099],{"class":577},[67,1153,1055],{"class":81},[67,1155,1104],{"class":98},[67,1157,872],{"class":81},[67,1159,74],{"class":98},[67,1161,1111],{"class":81},[67,1163,1164],{"class":315},"\"engine:done\"",[67,1166,1117],{"class":81},[67,1168,1169],{"class":88},"\u002F* signals *\u002F",[67,1171,1123],{"class":81},[67,1173,1174],{"class":69,"line":119},[67,1175,143],{"class":81},[57,1177,1179],{"className":59,"code":1178,"language":61,"meta":62,"style":62},"type CognetEngineCall = {\n    messages: AxonEngineMessage[]\n    model?: string\n    maxTokens?: number\n    temperature?: number\n    \u002F** The output grammar to parse the reply with. Must match what you rendered. *\u002F\n    protocol?: \"classic\" | \"raw\"\n    \u002F** Re-render from the session for a retry — see below. *\u002F\n    rerender?(): Promise\u003CAxonEngineMessage[]>\n}\n",[64,1180,1181,1190,1203,1213,1222,1231,1236,1251,1256,1273],{"__ignoreMap":62},[67,1182,1183,1185,1188],{"class":69,"line":70},[67,1184,74],{"class":73},[67,1186,1187],{"class":77}," CognetEngineCall",[67,1189,82],{"class":81},[67,1191,1192,1195,1197,1200],{"class":69,"line":85},[67,1193,1194],{"class":98},"    messages",[67,1196,101],{"class":81},[67,1198,1199],{"class":77},"AxonEngineMessage",[67,1201,1202],{"class":81},"[]\n",[67,1204,1205,1208,1210],{"class":69,"line":92},[67,1206,1207],{"class":98},"    model",[67,1209,432],{"class":81},[67,1211,1212],{"class":77},"string\n",[67,1214,1215,1218,1220],{"class":69,"line":113},[67,1216,1217],{"class":98},"    maxTokens",[67,1219,432],{"class":81},[67,1221,276],{"class":77},[67,1223,1224,1227,1229],{"class":69,"line":119},[67,1225,1226],{"class":98},"    temperature",[67,1228,432],{"class":81},[67,1230,276],{"class":77},[67,1232,1233],{"class":69,"line":140},[67,1234,1235],{"class":88},"    \u002F** The output grammar to parse the reply with. Must match what you rendered. *\u002F\n",[67,1237,1238,1241,1243,1246,1248],{"class":69,"line":146},[67,1239,1240],{"class":98},"    protocol",[67,1242,432],{"class":81},[67,1244,1245],{"class":315},"\"classic\"",[67,1247,166],{"class":81},[67,1249,1250],{"class":315},"\"raw\"\n",[67,1252,1253],{"class":69,"line":152},[67,1254,1255],{"class":88},"    \u002F** Re-render from the session for a retry — see below. *\u002F\n",[67,1257,1258,1261,1264,1266,1268,1270],{"class":69,"line":177},[67,1259,1260],{"class":122},"    rerender",[67,1262,1263],{"class":81},"?(): ",[67,1265,365],{"class":77},[67,1267,340],{"class":81},[67,1269,1199],{"class":77},[67,1271,1272],{"class":81},"[]>\n",[67,1274,1275],{"class":69,"line":182},[67,1276,143],{"class":81},[43,1278,1279,1280,1283,1284,1286,1287,1290,1291,1027,1294,1297,1298,1300],{},"This is ",[64,1281,1282],{},"AxonEngineCall"," minus the fields the ",[47,1285,869],{}," owns. ",[64,1288,1289],{},"signal"," is the wake's\ncancellation, applied unconditionally — a cognet never passes one and so can never omit\none. ",[64,1292,1293],{},"output",[64,1295,1296],{},"retries"," are the caller's structured-output contract; a cognet has no\nbusiness knowing a shape was demanded. ",[64,1299,49],{}," is supplied by the handle you called.",[43,1302,1303,1306],{},[64,1304,1305],{},"protocol"," matters: a cognet rendering one grammar while the kernel parses another would\nsilently discard every block the model emitted. The caller that rendered the context owns\nthis.",[43,1308,1309,1311,1312,1315,1316,1319],{},[64,1310,778],{}," is defined by its ",[47,1313,1314],{},"call shape",", not by whether the model samples\nautoregressively. Text-to-speech is a ",[64,1317,1318],{},"transform"," even though it generates token by token,\nbecause it takes a string rather than a timeline and nothing about the grammar applies.",[1321,1322,1324],"h3",{"id":1323},"the-event-stream","The event stream",[726,1326,1327,1336],{},[729,1328,1329],{},[732,1330,1331,1334],{},[735,1332,1333],{},"Event",[735,1335,740],{},[742,1337,1338,1348,1364,1374,1384],{},[732,1339,1340,1345],{},[747,1341,1342],{},[64,1343,1344],{},"engine:start",[747,1346,1347],{},"The bracket's open half. A consumer showing \"thinking\" starts here",[732,1349,1350,1355],{},[747,1351,1352],{},[64,1353,1354],{},"engine:text",[747,1356,1357,1358,426,1361],{},"The agent spoke — ",[47,1359,1360],{},"already interpolated",[64,1362,1363],{},"lang: \"md\" | \"json\"",[732,1365,1366,1371],{},[747,1367,1368],{},[64,1369,1370],{},"engine:script",[747,1372,1373],{},"The model ran code. Reported for the record; the kernel already executed it",[732,1375,1376,1381],{},[747,1377,1378],{},[64,1379,1380],{},"engine:failure",[747,1382,1383],{},"Terminal. A malformed reply the model failed to correct within its retries",[732,1385,1386,1391],{},[747,1387,1388],{},[64,1389,1390],{},"engine:done",[747,1392,1393],{},"Exactly once per successful call, with the response and billing meta",[43,1395,1396,1397,1400,1401,1404,1405,1408,1409,1412],{},"Raw ",[64,1398,1399],{},"engine:*"," wire events. The kernel does ",[47,1402,1403],{},"not"," pre-label them as the cognet's output:\nwhen a text block arrives, it is the cognet that decides whether to ",[64,1406,1407],{},"output()"," it; when a\ntypescript block arrives, it is the cognet that decides whether to ",[64,1410,1411],{},"run()"," it. That\ndecision belongs to the cognet alone.",[43,1414,1415,1417,1418,1421],{},[64,1416,1354],{}," chunks are chunks of ",[47,1419,1420],{},"rendered"," output, so they no longer correspond 1:1\nto model tokens — one delta can emit nothing (buffered mid-interpolation) or a great deal\n(a large interpolated value).",[1321,1423,1425],{"id":1424},"the-done-signals","The done signals",[57,1427,1429],{"className":59,"code":1428,"language":61,"meta":62,"style":62},"| { type: \"engine:done\"\n    response: AxonEngineResponse\n    spoke: boolean     \u002F\u002F produced user-facing output this call\n    acted: boolean     \u002F\u002F emitted a script it has not yet seen the result of\n    yielded: boolean } \u002F\u002F emitted \u003Cdone\u002F> — its own claim it is handing control back\n",[64,1430,1431,1444,1454,1467,1479],{"__ignoreMap":62},[67,1432,1433,1436,1439,1441],{"class":69,"line":70},[67,1434,1435],{"class":81},"| { ",[67,1437,74],{"class":1438},"sqDPy",[67,1440,101],{"class":81},[67,1442,1443],{"class":315},"\"engine:done\"\n",[67,1445,1446,1449,1451],{"class":69,"line":85},[67,1447,1448],{"class":1438},"    response",[67,1450,101],{"class":81},[67,1452,1453],{"class":98},"AxonEngineResponse\n",[67,1455,1456,1459,1461,1464],{"class":69,"line":92},[67,1457,1458],{"class":1438},"    spoke",[67,1460,101],{"class":81},[67,1462,1463],{"class":98},"boolean",[67,1465,1466],{"class":88},"     \u002F\u002F produced user-facing output this call\n",[67,1468,1469,1472,1474,1476],{"class":69,"line":113},[67,1470,1471],{"class":1438},"    acted",[67,1473,101],{"class":81},[67,1475,1463],{"class":98},[67,1477,1478],{"class":88},"     \u002F\u002F emitted a script it has not yet seen the result of\n",[67,1480,1481,1484,1486,1488,1491],{"class":69,"line":119},[67,1482,1483],{"class":1438},"    yielded",[67,1485,101],{"class":81},[67,1487,1463],{"class":98},[67,1489,1490],{"class":81}," } ",[67,1492,1493],{"class":88},"\u002F\u002F emitted \u003Cdone\u002F> — its own claim it is handing control back\n",[43,1495,1496,1497,1500],{},"These are ",[47,1498,1499],{},"signals, not decisions"," — reductions over what this call produced, from which\na loop derives its own stop condition. The kernel never acts on them and deliberately does\nnot decide whether a turn is over: that is the one thing a loop is for.",[43,1502,1503,1506,1507,1510,1511,1514],{},[64,1504,1505],{},"yielded"," is here under protest. Whether a turn is over is a ",[52,1508,1509],{},"semantic"," question — \"I see\nthe issue\" and \"the fix is deployed\" are structurally identical, same block and no script —\nso no reduction over what a response ",[52,1512,1513],{},"did"," can separate a progress report from a final\nanswer. Deriving it structurally ends a long run the first time the model narrates between\nactions. So the model is asked, which works consistently enough, and it stays a signal a\nloop weighs against the structural facts beside it.",[1321,1516,1518,1520],{"id":1517},"request-the-one-shot-form",[64,1519,801],{}," — the one-shot form",[57,1522,1524],{"className":59,"code":1523,"language":61,"meta":62,"style":62},"const { text, stopReason, meta } = await kernel.engine(\"classify\").request({ messages })\n",[64,1525,1526],{"__ignoreMap":62},[67,1527,1528,1530,1532,1535,1537,1540,1542,1545,1548,1550,1552,1554,1556,1558,1561,1563,1565,1567,1569],{"class":69,"line":70},[67,1529,860],{"class":73},[67,1531,644],{"class":81},[67,1533,1534],{"class":863},"text",[67,1536,426],{"class":81},[67,1538,1539],{"class":863},"stopReason",[67,1541,426],{"class":81},[67,1543,1544],{"class":863},"meta",[67,1546,1547],{"class":81}," } = ",[67,1549,895],{"class":577},[67,1551,898],{"class":98},[67,1553,872],{"class":81},[67,1555,875],{"class":122},[67,1557,126],{"class":81},[67,1559,1560],{"class":315},"\"classify\"",[67,1562,909],{"class":81},[67,1564,801],{"class":122},[67,1566,914],{"class":81},[67,1568,917],{"class":98},[67,1570,920],{"class":81},[43,1572,1573,1574,1577,1578,1580,1581,1584,1585,1588,1589,1592,1593,872],{},"Same response shape the stream's ",[64,1575,1576],{},"done"," event carries. ",[64,1579,1539],{}," is ",[64,1582,1583],{},"\"end\"",",\n",[64,1586,1587],{},"\"length\""," (truncated at ",[64,1590,1591],{},"maxTokens"," — trailing blocks are incomplete) or ",[64,1594,1595],{},"\"abort\"",[43,1597,1598,1027,1601,1604,1605,1608],{},[64,1599,1600],{},"meta.tokens",[64,1602,1603],{},"meta.cost"," are ",[47,1606,1607],{},"absent"," when the provider does not report them, never\nfabricated as zero. Local inference has no price.",[559,1610,1612,1614],{"id":1611},"transform-one-shot-in-one-shot-out",[64,1613,1318],{}," — one shot in, one shot out",[57,1616,1618],{"className":59,"code":1617,"language":61,"meta":62,"style":62},"const transcript = await kernel.engine(\"asr\").transform(pcm)\nconst vector     = await kernel.engine(\"embed\").transform(\"the query\")\n\nawait kernel.engine(\"image\").transform(prompt, {\n    onProgress: ({ fraction, message }) => { \u002F* fraction is 0..1, or absent *\u002F },\n})\n",[64,1619,1620,1653,1687,1691,1717,1749],{"__ignoreMap":62},[67,1621,1622,1624,1627,1629,1631,1633,1635,1637,1639,1642,1644,1646,1648,1651],{"class":69,"line":70},[67,1623,860],{"class":73},[67,1625,1626],{"class":863}," transcript",[67,1628,160],{"class":81},[67,1630,895],{"class":577},[67,1632,898],{"class":98},[67,1634,872],{"class":81},[67,1636,875],{"class":122},[67,1638,126],{"class":81},[67,1640,1641],{"class":315},"\"asr\"",[67,1643,909],{"class":81},[67,1645,1318],{"class":122},[67,1647,126],{"class":81},[67,1649,1650],{"class":98},"pcm",[67,1652,887],{"class":81},[67,1654,1655,1657,1660,1663,1665,1667,1669,1671,1673,1676,1678,1680,1682,1685],{"class":69,"line":85},[67,1656,860],{"class":73},[67,1658,1659],{"class":863}," vector",[67,1661,1662],{"class":81},"     = ",[67,1664,895],{"class":577},[67,1666,898],{"class":98},[67,1668,872],{"class":81},[67,1670,875],{"class":122},[67,1672,126],{"class":81},[67,1674,1675],{"class":315},"\"embed\"",[67,1677,909],{"class":81},[67,1679,1318],{"class":122},[67,1681,126],{"class":81},[67,1683,1684],{"class":315},"\"the query\"",[67,1686,887],{"class":81},[67,1688,1689],{"class":69,"line":92},[67,1690,149],{"emptyLinePlaceholder":10},[67,1692,1693,1695,1697,1699,1701,1703,1705,1707,1709,1711,1714],{"class":69,"line":113},[67,1694,895],{"class":577},[67,1696,898],{"class":98},[67,1698,872],{"class":81},[67,1700,875],{"class":122},[67,1702,126],{"class":81},[67,1704,525],{"class":315},[67,1706,909],{"class":81},[67,1708,1318],{"class":122},[67,1710,126],{"class":81},[67,1712,1713],{"class":98},"prompt",[67,1715,1716],{"class":81},", {\n",[67,1718,1719,1722,1725,1728,1731,1733,1736,1739,1742,1744,1747],{"class":69,"line":119},[67,1720,1721],{"class":122},"    onProgress",[67,1723,1724],{"class":98},":",[67,1726,1727],{"class":81}," ({ ",[67,1729,1730],{"class":98},"fraction",[67,1732,426],{"class":81},[67,1734,1735],{"class":98},"message",[67,1737,1738],{"class":81}," }) ",[67,1740,1741],{"class":73},"=>",[67,1743,644],{"class":81},[67,1745,1746],{"class":88},"\u002F* fraction is 0..1, or absent *\u002F",[67,1748,636],{"class":81},[67,1750,1751],{"class":69,"line":140},[67,1752,724],{"class":81},[43,1754,1755,1756,1759,1760,1763],{},"ASR, embeddings, classifiers, depth, TTS. The kernel does ",[47,1757,1758],{},"not interpret either side",". A\ndepth map is a shaped array, a transcript is text with timings, an embedding is a vector;\nwhat the bytes ",[52,1761,1762],{},"mean"," is the cognet's business. The one thing this contract guarantees is\nthat the call happened and the result came back.",[43,1765,1766,1769,1770,1773,1774,1776],{},[64,1767,1768],{},"onProgress"," exists because \"one shot\" is about ",[47,1771,1772],{},"shape, not duration",": an image\ngeneration is thirty seconds of denoising steps, and a bare promise makes that\nindistinguishable from a hang. ",[64,1775,1730],{}," is present only where the model knows its own\ntotal, so a caller renders a spinner rather than a bar that lies. Absent entirely for the\nmany transforms that finish in milliseconds.",[559,1778,1780,1782],{"id":1779},"stream-a-stateful-sequential-feed",[64,1781,1079],{}," — a stateful sequential feed",[57,1784,1786],{"className":59,"code":1785,"language":61,"meta":62,"style":62},"const session = kernel.engine(\"vad\").open()\n\nfor (const frame of frames) {\n    const speech = await session.push(frame)   \u002F\u002F order is significant\n}\n\nsession.reset()   \u002F\u002F new utterance, same session\nsession.close()   \u002F\u002F release the sequence; the engine stays loaded\n",[64,1787,1788,1816,1820,1839,1868,1872,1876,1892],{"__ignoreMap":62},[67,1789,1790,1792,1795,1797,1799,1801,1803,1805,1808,1810,1813],{"class":69,"line":70},[67,1791,860],{"class":73},[67,1793,1794],{"class":863}," session",[67,1796,160],{"class":81},[67,1798,869],{"class":98},[67,1800,872],{"class":81},[67,1802,875],{"class":122},[67,1804,126],{"class":81},[67,1806,1807],{"class":315},"\"vad\"",[67,1809,909],{"class":81},[67,1811,1812],{"class":122},"open",[67,1814,1815],{"class":81},"()\n",[67,1817,1818],{"class":69,"line":85},[67,1819,149],{"emptyLinePlaceholder":10},[67,1821,1822,1824,1826,1828,1831,1833,1836],{"class":69,"line":92},[67,1823,54],{"class":577},[67,1825,1055],{"class":81},[67,1827,860],{"class":73},[67,1829,1830],{"class":863}," frame",[67,1832,1063],{"class":73},[67,1834,1835],{"class":98}," frames",[67,1837,1838],{"class":81},") {\n",[67,1840,1841,1844,1847,1849,1851,1853,1855,1858,1860,1863,1865],{"class":69,"line":113},[67,1842,1843],{"class":73},"    const",[67,1845,1846],{"class":863}," speech",[67,1848,160],{"class":81},[67,1850,895],{"class":577},[67,1852,1794],{"class":98},[67,1854,872],{"class":81},[67,1856,1857],{"class":122},"push",[67,1859,126],{"class":81},[67,1861,1862],{"class":98},"frame",[67,1864,1013],{"class":81},[67,1866,1867],{"class":88},"\u002F\u002F order is significant\n",[67,1869,1870],{"class":69,"line":119},[67,1871,143],{"class":81},[67,1873,1874],{"class":69,"line":140},[67,1875,149],{"emptyLinePlaceholder":10},[67,1877,1878,1881,1883,1886,1889],{"class":69,"line":146},[67,1879,1880],{"class":98},"session",[67,1882,872],{"class":81},[67,1884,1885],{"class":122},"reset",[67,1887,1888],{"class":81},"()   ",[67,1890,1891],{"class":88},"\u002F\u002F new utterance, same session\n",[67,1893,1894,1896,1898,1901,1903],{"class":69,"line":152},[67,1895,1880],{"class":98},[67,1897,872],{"class":81},[67,1899,1900],{"class":122},"close",[67,1902,1888],{"class":81},[67,1904,1905],{"class":88},"\u002F\u002F release the sequence; the engine stays loaded\n",[57,1907,1909],{"className":59,"code":1908,"language":61,"meta":62,"style":62},"type EngineSession = {\n    push(input: unknown): Promise\u003Cunknown>\n    reset(): void\n    close(): void\n}\n",[64,1910,1911,1920,1943,1953,1962],{"__ignoreMap":62},[67,1912,1913,1915,1918],{"class":69,"line":70},[67,1914,74],{"class":73},[67,1916,1917],{"class":77}," EngineSession",[67,1919,82],{"class":81},[67,1921,1922,1925,1927,1929,1931,1933,1935,1937,1939,1941],{"class":69,"line":85},[67,1923,1924],{"class":122},"    push",[67,1926,126],{"class":81},[67,1928,418],{"class":98},[67,1930,101],{"class":81},[67,1932,423],{"class":77},[67,1934,107],{"class":81},[67,1936,365],{"class":77},[67,1938,340],{"class":81},[67,1940,423],{"class":77},[67,1942,346],{"class":81},[67,1944,1945,1948,1950],{"class":69,"line":92},[67,1946,1947],{"class":122},"    reset",[67,1949,495],{"class":81},[67,1951,1952],{"class":77},"void\n",[67,1954,1955,1958,1960],{"class":69,"line":113},[67,1956,1957],{"class":122},"    close",[67,1959,495],{"class":81},[67,1961,1952],{"class":77},[67,1963,1964],{"class":69,"line":119},[67,1965,143],{"class":81},[43,1967,1968,1969,1971,1972,1975],{},"Distinct from ",[64,1970,1318],{}," because the model carries ",[47,1973,1974],{},"hidden state across calls",". Silero's\nLSTM is what lets it tell a pause mid-sentence from silence, and feeding frames out of\norder or through two sessions destroys exactly that. So a caller opens one session and\npushes into it rather than making N independent calls.",[43,1977,1978,1981,1982,1985],{},[64,1979,1980],{},"open()"," is where the expensive part happens once — building the execution graph. ",[64,1983,1984],{},"reset()","\nforgets the sequence while keeping the session, because every stateful model has some\nversion of \"this is a new utterance\" and reopening would rebuild the graph that a session\nexists to amortise.",[43,1987,1988],{},"The session is the cognet's to hold. It is resident memory of precisely the kind a brain\nkeeps.",[559,1990,1992],{"id":1991},"what-the-kernel-still-owns","What the kernel still owns",[43,1994,1995,1996,1999],{},"Auth, metering, quotas, the retry budget, and the grammar the reply is parsed with. What it\nno longer decides is ",[47,1997,1998],{},"which model"," — and the cognet still never learns.",[2001,2002,2003],"style",{},"html pre.shiki code .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .sNl3T, html code.shiki .sNl3T{--shiki-default:#4EC9B0}html pre.shiki code .sTNBD, html code.shiki .sTNBD{--shiki-default:#D4D4D4}html pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}html pre.shiki code .s3F5K, html code.shiki .s3F5K{--shiki-default:#9CDCFE}html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sYbnZ, html code.shiki .sYbnZ{--shiki-default:#C586C0}html pre.shiki code .sDGX8, html code.shiki .sDGX8{--shiki-default:#B5CEA8}html pre.shiki code .s9McN, html code.shiki .s9McN{--shiki-default:#4FC1FF}html pre.shiki code .sqDPy, html code.shiki .sqDPy{--shiki-default:#C8C8C8}",{"title":62,"searchDepth":85,"depth":85,"links":2005},[2006,2007,2008,2010,2017,2019,2021],{"id":561,"depth":85,"text":562},{"id":842,"depth":85,"text":843},{"id":954,"depth":85,"text":2009},"parallel is a request, not a threshold",{"id":1037,"depth":85,"text":2011,"children":2012},"generate — autoregressive over messages",[2013,2014,2015],{"id":1323,"depth":92,"text":1324},{"id":1424,"depth":92,"text":1425},{"id":1517,"depth":92,"text":2016},"request — the one-shot form",{"id":1611,"depth":85,"text":2018},"transform — one shot in, one shot out",{"id":1779,"depth":85,"text":2020},"stream — a stateful sequential feed",{"id":1991,"depth":85,"text":1992},"kernel.engine provides inference by role. A cognet names what an engine is for, never which model fills it — that is decided at boot.","md",{},"\u002Fdocs\u002Fv2\u002Fcognets\u002Fapi\u002Fengine",{"title":34,"description":2022},"docs\u002Fv2\u002Fcognets\u002Fapi\u002Fengine","ePGztoktlPCwbUVv4BvIYic6So3gqcVA9jTc9sGNKuc",1788121883878]