[{"data":1,"prerenderedAt":2284},["ShallowReactive",2],{"navigation":3,"\u002Fgetting-started\u002Fquick-start":169,"\u002Fgetting-started\u002Fquick-start-surround":2279},[4,28,85,127,157],{"title":5,"path":6,"stem":7,"children":8,"icon":27},"Getting Started","\u002Fgetting-started","1.getting-started\u002F1.index",[9,12,17,22],{"title":10,"path":6,"stem":7,"icon":11},"Introduction","i-lucide-house",{"title":13,"path":14,"stem":15,"icon":16},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation","i-lucide-download",{"title":18,"path":19,"stem":20,"icon":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start","i-lucide-zap",{"title":23,"path":24,"stem":25,"icon":26},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture","i-lucide-layers","i-lucide-rocket",{"title":29,"icon":30,"path":31,"stem":32,"children":33,"page":84},"Concepts","i-lucide-lightbulb","\u002Fconcepts","2.concepts",[34,39,44,49,54,59,64,69,74,79],{"title":35,"path":36,"stem":37,"icon":38},"Durable agents","\u002Fconcepts\u002Fdurable-agents","2.concepts\u002F1.durable-agents","i-lucide-infinity",{"title":40,"path":41,"stem":42,"icon":43},"Glossary","\u002Fconcepts\u002Fglossary","2.concepts\u002F10.glossary","i-lucide-book-a",{"title":45,"path":46,"stem":47,"icon":48},"Restate in five minutes","\u002Fconcepts\u002Frestate-primer","2.concepts\u002F2.restate-primer","i-lucide-cpu",{"title":50,"path":51,"stem":52,"icon":53},"Entities & addressing","\u002Fconcepts\u002Fentities-addressing","2.concepts\u002F3.entities-addressing","i-lucide-at-sign",{"title":55,"path":56,"stem":57,"icon":58},"Timelines & events","\u002Fconcepts\u002Ftimelines-events","2.concepts\u002F4.timelines-events","i-lucide-list-ordered",{"title":60,"path":61,"stem":62,"icon":63},"Projections & the catalog","\u002Fconcepts\u002Fprojections-catalog","2.concepts\u002F5.projections-catalog","i-lucide-database",{"title":65,"path":66,"stem":67,"icon":68},"Workspaces & execution","\u002Fconcepts\u002Fworkspaces","2.concepts\u002F6.workspaces","i-lucide-terminal",{"title":70,"path":71,"stem":72,"icon":73},"Harnesses","\u002Fconcepts\u002Fharnesses","2.concepts\u002F7.harnesses","i-lucide-plug",{"title":75,"path":76,"stem":77,"icon":78},"Multi-agent patterns","\u002Fconcepts\u002Fmulti-agent","2.concepts\u002F8.multi-agent","i-lucide-network",{"title":80,"path":81,"stem":82,"icon":83},"Lifecycle & control","\u002Fconcepts\u002Flifecycle","2.concepts\u002F9.lifecycle","i-lucide-sliders-horizontal",false,{"title":86,"icon":87,"path":88,"stem":89,"children":90,"page":84},"Guides","i-lucide-book-open","\u002Fguides","3.guides",[91,106],{"title":92,"icon":93,"path":94,"stem":95,"children":96,"page":84},"Agents","i-lucide-bot","\u002Fguides\u002Fagents","3.guides\u002F1.agents",[97,101],{"title":98,"path":99,"stem":100,"icon":93},"Building agents","\u002Fguides\u002Fagents\u002Fbuilding-agents","3.guides\u002F1.agents\u002F1.building-agents",{"title":102,"path":103,"stem":104,"icon":105},"Frontend integration","\u002Fguides\u002Fagents\u002Ffrontend-integration","3.guides\u002F1.agents\u002F2.frontend-integration","i-lucide-monitor",{"title":107,"icon":108,"path":109,"stem":110,"children":111,"page":84},"Operations","i-lucide-server-cog","\u002Fguides\u002Foperations","3.guides\u002F2.operations",[112,117,122],{"title":113,"path":114,"stem":115,"icon":116},"Self-hosting","\u002Fguides\u002Foperations\u002Fself-hosting","3.guides\u002F2.operations\u002F1.self-hosting","i-lucide-server",{"title":118,"path":119,"stem":120,"icon":121},"Auth & API keys","\u002Fguides\u002Foperations\u002Fauth-api-keys","3.guides\u002F2.operations\u002F2.auth-api-keys","i-lucide-key-round",{"title":123,"path":124,"stem":125,"icon":126},"Backup & restore","\u002Fguides\u002Foperations\u002Fbackup-restore","3.guides\u002F2.operations\u002F3.backup-restore","i-lucide-database-backup",{"title":128,"icon":129,"path":130,"stem":131,"children":132,"page":84},"Reference","i-lucide-book-marked","\u002Freference","4.reference",[133,138,143,148,153],{"title":134,"path":135,"stem":136,"icon":137},"Event schema","\u002Freference\u002Fevents","4.reference\u002F1.events","i-lucide-list-tree",{"title":139,"path":140,"stem":141,"icon":142},"Addressing","\u002Freference\u002Faddressing","4.reference\u002F2.addressing","i-lucide-map-pin",{"title":144,"path":145,"stem":146,"icon":147},"Gateway HTTP API","\u002Freference\u002Fgateway-api","4.reference\u002F3.gateway-api","i-lucide-webhook",{"title":149,"path":150,"stem":151,"icon":152},"CLI","\u002Freference\u002Fcli","4.reference\u002F4.cli","i-lucide-square-terminal",{"title":154,"path":155,"stem":156,"icon":83},"Configuration","\u002Freference\u002Fconfiguration","4.reference\u002F5.configuration",{"title":158,"path":159,"stem":160,"children":161,"icon":163},"Contributing","\u002Fcontributing","5.contributing\u002F1.index",[162,164],{"title":158,"path":159,"stem":160,"icon":163},"i-lucide-git-pull-request",{"title":165,"path":166,"stem":167,"icon":168},"The package map","\u002Fcontributing\u002Fpackage-map","5.contributing\u002F2.package-map","i-lucide-boxes",{"id":170,"title":18,"body":171,"description":2272,"extension":2273,"links":2274,"meta":2275,"navigation":2276,"path":19,"seo":2277,"stem":20,"__hash__":2278},"docs\u002F1.getting-started\u002F3.quick-start.md",{"type":172,"value":173,"toc":2262},"minimark",[174,191,208,213,216,503,610,619,630,634,641,923,953,957,967,1399,1429,1451,1458,1497,1506,1510,1518,1527,1535,1548,1557,1563,1580,1584,1591,1606,1612,1624,1628,1634,1643,1649,1656,1671,1681,1855,1885,1892,1896,1902,2076,2083,2127,2148,2151,2174,2180,2215,2225,2229,2232,2258],[175,176,177,178,182,183,186,187,190],"p",{},"Let's build your first agent end to end: a ",[179,180,181],"code",{},"researcher"," you can spawn, message, and watch working in real time — and then extend with a ",[179,184,185],{},"summarizer"," sub-agent. Every command below runs against the stack you booted in ",[188,189,13],"a",{"href":14},".",[192,193,194],"note",{},[175,195,196,197,199,200,203,204,207],{},"You'll need the stack from ",[188,198,13],{"href":14}," running, the ",[179,201,202],{},"teaspill"," alias and ",[179,205,206],{},"TEASPILL_API_KEY"," you set while booting it still active in your shell, and an Anthropic API key — the researcher calls a model.",[209,210,212],"h2",{"id":211},"set-up-an-agents-package","Set up an agents package",[175,214,215],{},"Your agents live in an ordinary workspace package. Create one next to the built-in ones:",[217,218,224],"pre",{"className":219,"code":220,"filename":221,"language":222,"meta":223,"style":223},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"name\": \"my-agents\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": { \"build\": \"tsc -p tsconfig.json\" },\n  \"dependencies\": {\n    \"@teaspill\u002Fagents-sdk\": \"workspace:*\",\n    \"@teaspill\u002Fcatalog\": \"workspace:*\",\n    \"@teaspill\u002Fcoordination\": \"workspace:*\",\n    \"zod\": \"4.1.13\"\n  },\n  \"devDependencies\": {\n    \"@types\u002Fnode\": \"26.1.1\",\n    \"typescript\": \"6.0.3\"\n  }\n}\n","packages\u002Fmy-agents\u002Fpackage.json","json","",[179,225,226,235,263,278,299,334,349,371,391,411,431,437,451,472,491,497],{"__ignoreMap":223},[227,228,231],"span",{"class":229,"line":230},"line",1,[227,232,234],{"class":233},"sMK4o","{\n",[227,236,238,241,245,248,251,254,258,260],{"class":229,"line":237},2,[227,239,240],{"class":233},"  \"",[227,242,244],{"class":243},"spNyl","name",[227,246,247],{"class":233},"\"",[227,249,250],{"class":233},":",[227,252,253],{"class":233}," \"",[227,255,257],{"class":256},"sfazB","my-agents",[227,259,247],{"class":233},[227,261,262],{"class":233},",\n",[227,264,266,268,271,273,275],{"class":229,"line":265},3,[227,267,240],{"class":233},[227,269,270],{"class":243},"private",[227,272,247],{"class":233},[227,274,250],{"class":233},[227,276,277],{"class":233}," true,\n",[227,279,281,283,286,288,290,292,295,297],{"class":229,"line":280},4,[227,282,240],{"class":233},[227,284,285],{"class":243},"type",[227,287,247],{"class":233},[227,289,250],{"class":233},[227,291,253],{"class":233},[227,293,294],{"class":256},"module",[227,296,247],{"class":233},[227,298,262],{"class":233},[227,300,302,304,307,309,311,314,316,320,322,324,326,329,331],{"class":229,"line":301},5,[227,303,240],{"class":233},[227,305,306],{"class":243},"scripts",[227,308,247],{"class":233},[227,310,250],{"class":233},[227,312,313],{"class":233}," {",[227,315,253],{"class":233},[227,317,319],{"class":318},"sBMFI","build",[227,321,247],{"class":233},[227,323,250],{"class":233},[227,325,253],{"class":233},[227,327,328],{"class":256},"tsc -p tsconfig.json",[227,330,247],{"class":233},[227,332,333],{"class":233}," },\n",[227,335,337,339,342,344,346],{"class":229,"line":336},6,[227,338,240],{"class":233},[227,340,341],{"class":243},"dependencies",[227,343,247],{"class":233},[227,345,250],{"class":233},[227,347,348],{"class":233}," {\n",[227,350,352,355,358,360,362,364,367,369],{"class":229,"line":351},7,[227,353,354],{"class":233},"    \"",[227,356,357],{"class":318},"@teaspill\u002Fagents-sdk",[227,359,247],{"class":233},[227,361,250],{"class":233},[227,363,253],{"class":233},[227,365,366],{"class":256},"workspace:*",[227,368,247],{"class":233},[227,370,262],{"class":233},[227,372,374,376,379,381,383,385,387,389],{"class":229,"line":373},8,[227,375,354],{"class":233},[227,377,378],{"class":318},"@teaspill\u002Fcatalog",[227,380,247],{"class":233},[227,382,250],{"class":233},[227,384,253],{"class":233},[227,386,366],{"class":256},[227,388,247],{"class":233},[227,390,262],{"class":233},[227,392,394,396,399,401,403,405,407,409],{"class":229,"line":393},9,[227,395,354],{"class":233},[227,397,398],{"class":318},"@teaspill\u002Fcoordination",[227,400,247],{"class":233},[227,402,250],{"class":233},[227,404,253],{"class":233},[227,406,366],{"class":256},[227,408,247],{"class":233},[227,410,262],{"class":233},[227,412,414,416,419,421,423,425,428],{"class":229,"line":413},10,[227,415,354],{"class":233},[227,417,418],{"class":318},"zod",[227,420,247],{"class":233},[227,422,250],{"class":233},[227,424,253],{"class":233},[227,426,427],{"class":256},"4.1.13",[227,429,430],{"class":233},"\"\n",[227,432,434],{"class":229,"line":433},11,[227,435,436],{"class":233},"  },\n",[227,438,440,442,445,447,449],{"class":229,"line":439},12,[227,441,240],{"class":233},[227,443,444],{"class":243},"devDependencies",[227,446,247],{"class":233},[227,448,250],{"class":233},[227,450,348],{"class":233},[227,452,454,456,459,461,463,465,468,470],{"class":229,"line":453},13,[227,455,354],{"class":233},[227,457,458],{"class":318},"@types\u002Fnode",[227,460,247],{"class":233},[227,462,250],{"class":233},[227,464,253],{"class":233},[227,466,467],{"class":256},"26.1.1",[227,469,247],{"class":233},[227,471,262],{"class":233},[227,473,475,477,480,482,484,486,489],{"class":229,"line":474},14,[227,476,354],{"class":233},[227,478,479],{"class":318},"typescript",[227,481,247],{"class":233},[227,483,250],{"class":233},[227,485,253],{"class":233},[227,487,488],{"class":256},"6.0.3",[227,490,430],{"class":233},[227,492,494],{"class":229,"line":493},15,[227,495,496],{"class":233},"  }\n",[227,498,500],{"class":229,"line":499},16,[227,501,502],{"class":233},"}\n",[217,504,507],{"className":219,"code":505,"filename":506,"language":222,"meta":223,"style":223},"{\n  \"extends\": \"..\u002F..\u002Ftsconfig.base.json\",\n  \"compilerOptions\": { \"outDir\": \"dist\", \"rootDir\": \"src\" },\n  \"include\": [\"src\"]\n}\n","packages\u002Fmy-agents\u002Ftsconfig.json",[179,508,509,513,533,583,606],{"__ignoreMap":223},[227,510,511],{"class":229,"line":230},[227,512,234],{"class":233},[227,514,515,517,520,522,524,526,529,531],{"class":229,"line":237},[227,516,240],{"class":233},[227,518,519],{"class":243},"extends",[227,521,247],{"class":233},[227,523,250],{"class":233},[227,525,253],{"class":233},[227,527,528],{"class":256},"..\u002F..\u002Ftsconfig.base.json",[227,530,247],{"class":233},[227,532,262],{"class":233},[227,534,535,537,540,542,544,546,548,551,553,555,557,560,562,565,567,570,572,574,576,579,581],{"class":229,"line":265},[227,536,240],{"class":233},[227,538,539],{"class":243},"compilerOptions",[227,541,247],{"class":233},[227,543,250],{"class":233},[227,545,313],{"class":233},[227,547,253],{"class":233},[227,549,550],{"class":318},"outDir",[227,552,247],{"class":233},[227,554,250],{"class":233},[227,556,253],{"class":233},[227,558,559],{"class":256},"dist",[227,561,247],{"class":233},[227,563,564],{"class":233},",",[227,566,253],{"class":233},[227,568,569],{"class":318},"rootDir",[227,571,247],{"class":233},[227,573,250],{"class":233},[227,575,253],{"class":233},[227,577,578],{"class":256},"src",[227,580,247],{"class":233},[227,582,333],{"class":233},[227,584,585,587,590,592,594,597,599,601,603],{"class":229,"line":280},[227,586,240],{"class":233},[227,588,589],{"class":243},"include",[227,591,247],{"class":233},[227,593,250],{"class":233},[227,595,596],{"class":233}," [",[227,598,247],{"class":233},[227,600,578],{"class":256},[227,602,247],{"class":233},[227,604,605],{"class":233},"]\n",[227,607,608],{"class":229,"line":301},[227,609,502],{"class":233},[175,611,612,613,615,616,618],{},"Pin ",[179,614,418],{}," to the same version ",[179,617,357],{}," uses — your schemas flow through the SDK's types, and mixing two zod copies breaks that. Then link it into the workspace:",[217,620,624],{"className":621,"code":622,"language":623,"meta":223,"style":223},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm install\n","sh",[179,625,626],{"__ignoreMap":223},[227,627,628],{"class":229,"line":230},[227,629,622],{},[209,631,633],{"id":632},"define-the-researcher","Define the researcher",[175,635,636,637,640],{},"An agent type is one ",[179,638,639],{},"defineAgent"," call: what it's spawned with, what state it keeps, and the engine that runs its model loop.",[217,642,647],{"className":643,"code":644,"filename":645,"language":646,"meta":223,"style":223},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineAgent, native } from \"@teaspill\u002Fagents-sdk\";\nimport { z } from \"zod\";\n\nconst researcher = defineAgent({\n  type: \"researcher\",\n  spawnSchema: z.object({ topic: z.string() }),\n  state: z.object({ summary: z.string().optional() }),\n  harness: native({\n    model: \"claude-sonnet-4-5\",\n    systemPrompt:\n      \"Research the topic you were spawned with from your own knowledge, \" +\n      \"then call `finish` with a short summary.\",\n    ingressUrl: \"http:\u002F\u002Flocalhost:8080\",\n  }),\n});\n","packages\u002Fmy-agents\u002Fsrc\u002Fagents.ts","ts",[179,648,649,681,702,708,727,743,785,829,842,858,866,879,890,906,915],{"__ignoreMap":223},[227,650,651,655,657,661,663,666,669,672,674,676,678],{"class":229,"line":230},[227,652,654],{"class":653},"s7zQu","import",[227,656,313],{"class":233},[227,658,660],{"class":659},"sTEyZ"," defineAgent",[227,662,564],{"class":233},[227,664,665],{"class":659}," native",[227,667,668],{"class":233}," }",[227,670,671],{"class":653}," from",[227,673,253],{"class":233},[227,675,357],{"class":256},[227,677,247],{"class":233},[227,679,680],{"class":233},";\n",[227,682,683,685,687,690,692,694,696,698,700],{"class":229,"line":237},[227,684,654],{"class":653},[227,686,313],{"class":233},[227,688,689],{"class":659}," z",[227,691,668],{"class":233},[227,693,671],{"class":653},[227,695,253],{"class":233},[227,697,418],{"class":256},[227,699,247],{"class":233},[227,701,680],{"class":233},[227,703,704],{"class":229,"line":265},[227,705,707],{"emptyLinePlaceholder":706},true,"\n",[227,709,710,713,716,719,722,725],{"class":229,"line":280},[227,711,712],{"class":243},"const",[227,714,715],{"class":659}," researcher ",[227,717,718],{"class":233},"=",[227,720,660],{"class":721},"s2Zo4",[227,723,724],{"class":659},"(",[227,726,234],{"class":233},[227,728,729,733,735,737,739,741],{"class":229,"line":301},[227,730,732],{"class":731},"swJcz","  type",[227,734,250],{"class":233},[227,736,253],{"class":233},[227,738,181],{"class":256},[227,740,247],{"class":233},[227,742,262],{"class":233},[227,744,745,748,750,752,754,757,759,762,765,767,769,771,774,777,780,783],{"class":229,"line":336},[227,746,747],{"class":731},"  spawnSchema",[227,749,250],{"class":233},[227,751,689],{"class":659},[227,753,190],{"class":233},[227,755,756],{"class":721},"object",[227,758,724],{"class":659},[227,760,761],{"class":233},"{",[227,763,764],{"class":731}," topic",[227,766,250],{"class":233},[227,768,689],{"class":659},[227,770,190],{"class":233},[227,772,773],{"class":721},"string",[227,775,776],{"class":659},"() ",[227,778,779],{"class":233},"}",[227,781,782],{"class":659},")",[227,784,262],{"class":233},[227,786,787,790,792,794,796,798,800,802,805,807,809,811,813,816,818,821,823,825,827],{"class":229,"line":351},[227,788,789],{"class":731},"  state",[227,791,250],{"class":233},[227,793,689],{"class":659},[227,795,190],{"class":233},[227,797,756],{"class":721},[227,799,724],{"class":659},[227,801,761],{"class":233},[227,803,804],{"class":731}," summary",[227,806,250],{"class":233},[227,808,689],{"class":659},[227,810,190],{"class":233},[227,812,773],{"class":721},[227,814,815],{"class":659},"()",[227,817,190],{"class":233},[227,819,820],{"class":721},"optional",[227,822,776],{"class":659},[227,824,779],{"class":233},[227,826,782],{"class":659},[227,828,262],{"class":233},[227,830,831,834,836,838,840],{"class":229,"line":373},[227,832,833],{"class":731},"  harness",[227,835,250],{"class":233},[227,837,665],{"class":721},[227,839,724],{"class":659},[227,841,234],{"class":233},[227,843,844,847,849,851,854,856],{"class":229,"line":393},[227,845,846],{"class":731},"    model",[227,848,250],{"class":233},[227,850,253],{"class":233},[227,852,853],{"class":256},"claude-sonnet-4-5",[227,855,247],{"class":233},[227,857,262],{"class":233},[227,859,860,863],{"class":229,"line":413},[227,861,862],{"class":731},"    systemPrompt",[227,864,865],{"class":233},":\n",[227,867,868,871,874,876],{"class":229,"line":433},[227,869,870],{"class":233},"      \"",[227,872,873],{"class":256},"Research the topic you were spawned with from your own knowledge, ",[227,875,247],{"class":233},[227,877,878],{"class":233}," +\n",[227,880,881,883,886,888],{"class":229,"line":439},[227,882,870],{"class":233},[227,884,885],{"class":256},"then call `finish` with a short summary.",[227,887,247],{"class":233},[227,889,262],{"class":233},[227,891,892,895,897,899,902,904],{"class":229,"line":453},[227,893,894],{"class":731},"    ingressUrl",[227,896,250],{"class":233},[227,898,253],{"class":233},[227,900,901],{"class":256},"http:\u002F\u002Flocalhost:8080",[227,903,247],{"class":233},[227,905,262],{"class":233},[227,907,908,911,913],{"class":229,"line":474},[227,909,910],{"class":233},"  }",[227,912,782],{"class":659},[227,914,262],{"class":233},[227,916,917,919,921],{"class":229,"line":493},[227,918,779],{"class":233},[227,920,782],{"class":659},[227,922,680],{"class":233},[175,924,925,926,929,930,933,934,937,938,941,942,944,945,948,949,952],{},"Three fields do the work. ",[179,927,928],{},"spawnSchema"," types and validates the arguments an instance is born with — a bad spawn is rejected cleanly, before any model call. ",[179,931,932],{},"state"," is the agent's durable memory, also schema-checked. ",[179,935,936],{},"harness"," picks the engine for the model loop: ",[179,939,940],{},"native(...)"," is the default and works with any provider (",[188,943,70],{"href":71}," covers the alternative). The ",[179,946,947],{},"ingressUrl"," is how the agent's built-in tools reach the rest of the platform — ",[179,950,951],{},"localhost:8080"," is Restate's ingress port published on your host, since this process will run on the host.",[209,954,956],{"id":955},"serve-and-register","Serve and register",[175,958,959,962,963,966],{},[179,960,961],{},"serve()"," turns definitions into a running service and registers it through the gateway. Its ",[179,964,965],{},"deps"," are deployment wiring — the connections into the stack that every deployment supplies, not agent logic you write per type:",[217,968,970],{"className":643,"code":969,"filename":645,"language":646,"meta":223,"style":223},"\u002F\u002F …add below the definitions, with the imports at the top of the file:\nimport { serve } from \"@teaspill\u002Fagents-sdk\";\nimport {\n  createAgentNotifier,\n  createDrizzleArchiveCatalog,\n  createDrizzleEntityDirectory,\n  createDrizzleOutboxCatalog,\n  DurableStreamsProjectionOutbox,\n  HttpTimelineStreamTransport,\n} from \"@teaspill\u002Fcoordination\";\nimport { createCatalogClient } from \"@teaspill\u002Fcatalog\";\n\nconst { db } = createCatalogClient(); \u002F\u002F reads DATABASE_URL\n\nawait serve({\n  agents: [researcher],\n  deps: {\n    outbox: new DurableStreamsProjectionOutbox({\n      transport: new HttpTimelineStreamTransport({ baseUrl: \"http:\u002F\u002Flocalhost:4437\" }),\n      catalog: createDrizzleOutboxCatalog(db),\n    }),\n    notifier: createAgentNotifier(),\n    directory: createDrizzleEntityDirectory(db),\n    archiveCatalog: createDrizzleArchiveCatalog(db),\n  },\n  port: 9082,\n  registration: {\n    gatewayUrl: \"http:\u002F\u002Flocalhost:8787\",\n    deploymentUrl: \"http:\u002F\u002Fhost.docker.internal:9082\",\n    apiKey: process.env.TEASPILL_API_KEY,\n  },\n});\n\nconsole.log(\"researcher deployment up on 9082\");\n",[179,971,972,978,999,1005,1012,1019,1026,1033,1040,1047,1061,1082,1086,1110,1114,1125,1137,1147,1165,1200,1216,1226,1241,1256,1271,1276,1290,1300,1317,1334,1356,1361,1370,1375],{"__ignoreMap":223},[227,973,974],{"class":229,"line":230},[227,975,977],{"class":976},"sHwdD","\u002F\u002F …add below the definitions, with the imports at the top of the file:\n",[227,979,980,982,984,987,989,991,993,995,997],{"class":229,"line":237},[227,981,654],{"class":653},[227,983,313],{"class":233},[227,985,986],{"class":659}," serve",[227,988,668],{"class":233},[227,990,671],{"class":653},[227,992,253],{"class":233},[227,994,357],{"class":256},[227,996,247],{"class":233},[227,998,680],{"class":233},[227,1000,1001,1003],{"class":229,"line":265},[227,1002,654],{"class":653},[227,1004,348],{"class":233},[227,1006,1007,1010],{"class":229,"line":280},[227,1008,1009],{"class":659},"  createAgentNotifier",[227,1011,262],{"class":233},[227,1013,1014,1017],{"class":229,"line":301},[227,1015,1016],{"class":659},"  createDrizzleArchiveCatalog",[227,1018,262],{"class":233},[227,1020,1021,1024],{"class":229,"line":336},[227,1022,1023],{"class":659},"  createDrizzleEntityDirectory",[227,1025,262],{"class":233},[227,1027,1028,1031],{"class":229,"line":351},[227,1029,1030],{"class":659},"  createDrizzleOutboxCatalog",[227,1032,262],{"class":233},[227,1034,1035,1038],{"class":229,"line":373},[227,1036,1037],{"class":659},"  DurableStreamsProjectionOutbox",[227,1039,262],{"class":233},[227,1041,1042,1045],{"class":229,"line":393},[227,1043,1044],{"class":659},"  HttpTimelineStreamTransport",[227,1046,262],{"class":233},[227,1048,1049,1051,1053,1055,1057,1059],{"class":229,"line":413},[227,1050,779],{"class":233},[227,1052,671],{"class":653},[227,1054,253],{"class":233},[227,1056,398],{"class":256},[227,1058,247],{"class":233},[227,1060,680],{"class":233},[227,1062,1063,1065,1067,1070,1072,1074,1076,1078,1080],{"class":229,"line":433},[227,1064,654],{"class":653},[227,1066,313],{"class":233},[227,1068,1069],{"class":659}," createCatalogClient",[227,1071,668],{"class":233},[227,1073,671],{"class":653},[227,1075,253],{"class":233},[227,1077,378],{"class":256},[227,1079,247],{"class":233},[227,1081,680],{"class":233},[227,1083,1084],{"class":229,"line":439},[227,1085,707],{"emptyLinePlaceholder":706},[227,1087,1088,1090,1092,1095,1097,1100,1102,1104,1107],{"class":229,"line":453},[227,1089,712],{"class":243},[227,1091,313],{"class":233},[227,1093,1094],{"class":659}," db ",[227,1096,779],{"class":233},[227,1098,1099],{"class":233}," =",[227,1101,1069],{"class":721},[227,1103,815],{"class":659},[227,1105,1106],{"class":233},";",[227,1108,1109],{"class":976}," \u002F\u002F reads DATABASE_URL\n",[227,1111,1112],{"class":229,"line":474},[227,1113,707],{"emptyLinePlaceholder":706},[227,1115,1116,1119,1121,1123],{"class":229,"line":493},[227,1117,1118],{"class":653},"await",[227,1120,986],{"class":721},[227,1122,724],{"class":659},[227,1124,234],{"class":233},[227,1126,1127,1130,1132,1135],{"class":229,"line":499},[227,1128,1129],{"class":731},"  agents",[227,1131,250],{"class":233},[227,1133,1134],{"class":659}," [researcher]",[227,1136,262],{"class":233},[227,1138,1140,1143,1145],{"class":229,"line":1139},17,[227,1141,1142],{"class":731},"  deps",[227,1144,250],{"class":233},[227,1146,348],{"class":233},[227,1148,1150,1153,1155,1158,1161,1163],{"class":229,"line":1149},18,[227,1151,1152],{"class":731},"    outbox",[227,1154,250],{"class":233},[227,1156,1157],{"class":233}," new",[227,1159,1160],{"class":721}," DurableStreamsProjectionOutbox",[227,1162,724],{"class":659},[227,1164,234],{"class":233},[227,1166,1168,1171,1173,1175,1178,1180,1182,1185,1187,1189,1192,1194,1196,1198],{"class":229,"line":1167},19,[227,1169,1170],{"class":731},"      transport",[227,1172,250],{"class":233},[227,1174,1157],{"class":233},[227,1176,1177],{"class":721}," HttpTimelineStreamTransport",[227,1179,724],{"class":659},[227,1181,761],{"class":233},[227,1183,1184],{"class":731}," baseUrl",[227,1186,250],{"class":233},[227,1188,253],{"class":233},[227,1190,1191],{"class":256},"http:\u002F\u002Flocalhost:4437",[227,1193,247],{"class":233},[227,1195,668],{"class":233},[227,1197,782],{"class":659},[227,1199,262],{"class":233},[227,1201,1203,1206,1208,1211,1214],{"class":229,"line":1202},20,[227,1204,1205],{"class":731},"      catalog",[227,1207,250],{"class":233},[227,1209,1210],{"class":721}," createDrizzleOutboxCatalog",[227,1212,1213],{"class":659},"(db)",[227,1215,262],{"class":233},[227,1217,1219,1222,1224],{"class":229,"line":1218},21,[227,1220,1221],{"class":233},"    }",[227,1223,782],{"class":659},[227,1225,262],{"class":233},[227,1227,1229,1232,1234,1237,1239],{"class":229,"line":1228},22,[227,1230,1231],{"class":731},"    notifier",[227,1233,250],{"class":233},[227,1235,1236],{"class":721}," createAgentNotifier",[227,1238,815],{"class":659},[227,1240,262],{"class":233},[227,1242,1244,1247,1249,1252,1254],{"class":229,"line":1243},23,[227,1245,1246],{"class":731},"    directory",[227,1248,250],{"class":233},[227,1250,1251],{"class":721}," createDrizzleEntityDirectory",[227,1253,1213],{"class":659},[227,1255,262],{"class":233},[227,1257,1259,1262,1264,1267,1269],{"class":229,"line":1258},24,[227,1260,1261],{"class":731},"    archiveCatalog",[227,1263,250],{"class":233},[227,1265,1266],{"class":721}," createDrizzleArchiveCatalog",[227,1268,1213],{"class":659},[227,1270,262],{"class":233},[227,1272,1274],{"class":229,"line":1273},25,[227,1275,436],{"class":233},[227,1277,1279,1282,1284,1288],{"class":229,"line":1278},26,[227,1280,1281],{"class":731},"  port",[227,1283,250],{"class":233},[227,1285,1287],{"class":1286},"sbssI"," 9082",[227,1289,262],{"class":233},[227,1291,1293,1296,1298],{"class":229,"line":1292},27,[227,1294,1295],{"class":731},"  registration",[227,1297,250],{"class":233},[227,1299,348],{"class":233},[227,1301,1303,1306,1308,1310,1313,1315],{"class":229,"line":1302},28,[227,1304,1305],{"class":731},"    gatewayUrl",[227,1307,250],{"class":233},[227,1309,253],{"class":233},[227,1311,1312],{"class":256},"http:\u002F\u002Flocalhost:8787",[227,1314,247],{"class":233},[227,1316,262],{"class":233},[227,1318,1320,1323,1325,1327,1330,1332],{"class":229,"line":1319},29,[227,1321,1322],{"class":731},"    deploymentUrl",[227,1324,250],{"class":233},[227,1326,253],{"class":233},[227,1328,1329],{"class":256},"http:\u002F\u002Fhost.docker.internal:9082",[227,1331,247],{"class":233},[227,1333,262],{"class":233},[227,1335,1337,1340,1342,1345,1347,1350,1352,1354],{"class":229,"line":1336},30,[227,1338,1339],{"class":731},"    apiKey",[227,1341,250],{"class":233},[227,1343,1344],{"class":659}," process",[227,1346,190],{"class":233},[227,1348,1349],{"class":659},"env",[227,1351,190],{"class":233},[227,1353,206],{"class":659},[227,1355,262],{"class":233},[227,1357,1359],{"class":229,"line":1358},31,[227,1360,436],{"class":233},[227,1362,1364,1366,1368],{"class":229,"line":1363},32,[227,1365,779],{"class":233},[227,1367,782],{"class":659},[227,1369,680],{"class":233},[227,1371,1373],{"class":229,"line":1372},33,[227,1374,707],{"emptyLinePlaceholder":706},[227,1376,1378,1381,1383,1386,1388,1390,1393,1395,1397],{"class":229,"line":1377},34,[227,1379,1380],{"class":659},"console",[227,1382,190],{"class":233},[227,1384,1385],{"class":721},"log",[227,1387,724],{"class":659},[227,1389,247],{"class":233},[227,1391,1392],{"class":256},"researcher deployment up on 9082",[227,1394,247],{"class":233},[227,1396,782],{"class":659},[227,1398,680],{"class":233},[175,1400,1401,1402,1404,1405,1408,1409,1412,1413,1416,1417,1420,1421,1424,1425,1428],{},"Each ",[179,1403,965],{}," entry is one of those connections: ",[179,1406,1407],{},"outbox"," writes every agent's ",[188,1410,1411],{"href":56},"timeline"," to the history store and its row to the catalog, ",[179,1414,1415],{},"notifier"," carries messages and wakes between agents, ",[179,1418,1419],{},"directory"," tracks entities so deliveries find them, and ",[179,1422,1423],{},"archiveCatalog"," is what lets an idle agent archive and later come back — without it, an archived agent cannot be resurrected. You rarely assemble these by hand: the reference deployment under ",[179,1426,1427],{},"packages\u002Freference-deployment"," wires the same pieces from public APIs, and copying it is the intended starting point once you outgrow one file.",[1430,1431,1432],"warning",{},[175,1433,1434,1435,1438,1439,1443,1444,1446,1447,1450],{},"The ",[179,1436,1437],{},"deploymentUrl"," is the address ",[1440,1441,1442],"strong",{},"Restate dials from inside its container"," — for a host-run process that's ",[179,1445,1329],{},", never ",[179,1448,1449],{},"localhost"," (which would register fine and then fail on every invocation).",[175,1452,1453,1454,1457],{},"Build and run it, with ",[179,1455,1456],{},"DATABASE_URL"," pointing at the stack's Postgres on your host:",[217,1459,1461],{"className":621,"code":1460,"language":623,"meta":223,"style":223},"pnpm --filter my-agents build\n\nDATABASE_URL=\"postgresql:\u002F\u002Fteaspill:teaspill@localhost:5432\u002Fteaspill?sslmode=disable\" \\\nANTHROPIC_API_KEY=\"sk-ant-...\" \\\nTEASPILL_API_KEY=tsp_local_dev_only \\\n  node packages\u002Fmy-agents\u002Fdist\u002Fagents.js\n# serving … registered … researcher deployment up on 9082\n",[179,1462,1463,1468,1472,1477,1482,1487,1492],{"__ignoreMap":223},[227,1464,1465],{"class":229,"line":230},[227,1466,1467],{},"pnpm --filter my-agents build\n",[227,1469,1470],{"class":229,"line":237},[227,1471,707],{"emptyLinePlaceholder":706},[227,1473,1474],{"class":229,"line":265},[227,1475,1476],{},"DATABASE_URL=\"postgresql:\u002F\u002Fteaspill:teaspill@localhost:5432\u002Fteaspill?sslmode=disable\" \\\n",[227,1478,1479],{"class":229,"line":280},[227,1480,1481],{},"ANTHROPIC_API_KEY=\"sk-ant-...\" \\\n",[227,1483,1484],{"class":229,"line":301},[227,1485,1486],{},"TEASPILL_API_KEY=tsp_local_dev_only \\\n",[227,1488,1489],{"class":229,"line":336},[227,1490,1491],{},"  node packages\u002Fmy-agents\u002Fdist\u002Fagents.js\n",[227,1493,1494],{"class":229,"line":351},[227,1495,1496],{},"# serving … registered … researcher deployment up on 9082\n",[175,1498,1499,1501,1502,1505],{},[179,1500,961],{}," registers once and throws if the gateway isn't reachable — fine here, since the stack is already up. For day-to-day iteration, ",[179,1503,1504],{},"teaspill dev"," wraps the same registration with a health wait, retries, and re-registration on rebuild.",[209,1507,1509],{"id":1508},"spawn-your-researcher","Spawn your researcher",[175,1511,1512,1513,203,1515,1517],{},"From a second terminal (with the ",[179,1514,202],{},[179,1516,206],{}," set):",[217,1519,1521],{"className":621,"code":1520,"language":623,"meta":223,"style":223},"teaspill spawn researcher '{\"topic\":\"the history of tea\"}'\n",[179,1522,1523],{"__ignoreMap":223},[227,1524,1525],{"class":229,"line":230},[227,1526,1520],{},[217,1528,1533],{"className":1529,"code":1531,"language":1532},[1530],"language-text","spawned \u002Ft\u002Fdefault\u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\n  logs: teaspill logs \u002Ft\u002Fdefault\u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\n","text",[179,1534,1531],{"__ignoreMap":223},[175,1536,1537,1538,1541,1542,1544,1545,250],{},"That path is the instance's ",[1440,1539,1540],{},"entity URL"," — its stable identity everywhere in teaspill: in the catalog, in events, in the API (",[188,1543,50],{"href":51},"). It also now shows up in the ",[188,1546,1547],{"href":61},"catalog",[217,1549,1551],{"className":621,"code":1550,"language":623,"meta":223,"style":223},"teaspill agents ls --type researcher\n",[179,1552,1553],{"__ignoreMap":223},[227,1554,1555],{"class":229,"line":230},[227,1556,1550],{},[217,1558,1561],{"className":1559,"code":1560,"language":1532},[1530],"active   \u002Ft\u002Fdefault\u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c  (researcher) head=5\n",[179,1562,1560],{"__ignoreMap":223},[175,1564,1565,1566,1569,1570,1572,1573,1576,1577,1579],{},"That ",[179,1567,1568],{},"head=5"," is how far the agent's ",[188,1571,1411],{"href":56}," has advanced — it climbs as the agent works. By default each spawn mints a fresh, sortable id. Pass ",[179,1574,1575],{},"--id my-researcher"," to supply your own — re-running the same spawn then reattaches instead of duplicating, which is what makes scripted spawns safe to retry. ",[188,1578,75],{"href":76}," builds on that trick.",[209,1581,1583],{"id":1582},"send-it-a-message","Send it a message",[175,1585,1586,1587,1590],{},"Commands accept the short form ",[179,1588,1589],{},"\u002Fa\u002F\u003Ctype>\u002F\u003Cid>"," too. Message bodies carry structured content blocks — the same shape the timeline records:",[217,1592,1594],{"className":621,"code":1593,"language":623,"meta":223,"style":223},"teaspill send \u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c \\\n  '{\"kind\":\"message\",\"content\":[{\"type\":\"text\",\"text\":\"one more angle: green vs black tea\"}]}'\n",[179,1595,1596,1601],{"__ignoreMap":223},[227,1597,1598],{"class":229,"line":230},[227,1599,1600],{},"teaspill send \u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c \\\n",[227,1602,1603],{"class":229,"line":237},[227,1604,1605],{},"  '{\"kind\":\"message\",\"content\":[{\"type\":\"text\",\"text\":\"one more angle: green vs black tea\"}]}'\n",[217,1607,1610],{"className":1608,"code":1609,"language":1532},[1530],"sent → \u002Ft\u002Fdefault\u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\n",[179,1611,1609],{"__ignoreMap":223},[175,1613,1614,1615,1618,1619,1623],{},"The platform delivers your body to the agent as-is. If you'd rather accept shorthand like ",[179,1616,1617],{},"{\"text\":\"...\"}",", normalize it at your deployment — the ",[188,1620,1622],{"href":1621},"\u002Fguides\u002Fagents\u002Fbuilding-agents#inboxschemas","Building agents guide"," shows the pattern.",[209,1625,1627],{"id":1626},"watch-the-timeline-in-a-browser","Watch the timeline in a browser",[175,1629,1630,1633],{},[179,1631,1632],{},"teaspill logs"," follows an entity's timeline right in your terminal, rendering each event as it lands:",[217,1635,1637],{"className":621,"code":1636,"language":623,"meta":223,"style":223},"teaspill logs \u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\n",[179,1638,1639],{"__ignoreMap":223},[227,1640,1641],{"class":229,"line":230},[227,1642,1636],{},[217,1644,1647],{"className":1645,"code":1646,"language":1532},[1530],"# output illustrative — your researcher's answers will differ\nfollowing \u002Ft\u002Fdefault\u002Fa\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\n12:04:11  #0  ● spawned researcher\n12:04:11  #1  user: {\"topic\":\"the history of tea\"}\n12:04:11  #2  ▶ run inv_1eyJ… started (native claude-sonnet-4-5) wake=spawn\n12:04:18  #3  ⚙ tool finish({\"result\":\"Tea originated in southwest China…\"})\n12:04:18  #4  → ok finish: Run complete.\n12:04:18  #5  ■ run inv_1eyJ… success tokens=734 7311ms\n12:06:03  #6  user: one more angle: green vs black tea\n12:06:03  #7  ▶ run inv_1fZk… started (native claude-sonnet-4-5) wake=message\n12:06:09  #8  ⚙ tool finish({\"result\":\"Green and black tea differ…\"})\n12:06:09  #9  → ok finish: Run complete.\n12:06:09  #10 ■ run inv_1fZk… success tokens=402 5871ms\n",[179,1648,1646],{"__ignoreMap":223},[175,1650,1651,1652,1655],{},"The same numbered events are one HTTP request away — this is the raw stream your UI reads (the ",[188,1653,1654],{"href":145},"Gateway API reference"," documents the stream routes):",[217,1657,1659],{"className":621,"code":1658,"language":623,"meta":223,"style":223},"curl -H \"Authorization: Bearer $TEASPILL_API_KEY\" \\\n  \"http:\u002F\u002Flocalhost:8787\u002Fstreams\u002Ft\u002Fdefault\u002Fagents\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\u002Ftimeline?offset=-1\"\n",[179,1660,1661,1666],{"__ignoreMap":223},[227,1662,1663],{"class":229,"line":230},[227,1664,1665],{},"curl -H \"Authorization: Bearer $TEASPILL_API_KEY\" \\\n",[227,1667,1668],{"class":229,"line":237},[227,1669,1670],{},"  \"http:\u002F\u002Flocalhost:8787\u002Fstreams\u002Ft\u002Fdefault\u002Fagents\u002Fresearcher\u002F01kxw5gkeqax7e518tz5ctqz0c\u002Ftimeline?offset=-1\"\n",[175,1672,1673,1674,1677,1678,250],{},"And ",[179,1675,1676],{},"@teaspill\u002Ffrontend-sdk"," folds that stream into live, render-ready state — messages plus in-flight ",[188,1679,1680],{"href":56},"token deltas",[217,1682,1685],{"className":643,"code":1683,"filename":1684,"language":646,"meta":223,"style":223},"import { createAgentTimeline } from \"@teaspill\u002Ffrontend-sdk\";\n\nconst timeline = createAgentTimeline(\n  \"http:\u002F\u002Flocalhost:8787\u002Fstreams\u002Ft\u002Fdefault\u002Fagents\u002Fresearcher\u002F\u003Cid>\u002Ftimeline\",\n  { auth: { apiKey: \"tsp_local_dev_only\" }, deltas: true }, \u002F\u002F API key in a browser: dev only\n);\n\ntimeline.subscribe((state) => {\n  render(state.timeline.messages, state.timeline.liveDeltas);\n});\n","ui.ts",[179,1686,1687,1708,1712,1726,1737,1778,1784,1788,1811,1847],{"__ignoreMap":223},[227,1688,1689,1691,1693,1696,1698,1700,1702,1704,1706],{"class":229,"line":230},[227,1690,654],{"class":653},[227,1692,313],{"class":233},[227,1694,1695],{"class":659}," createAgentTimeline",[227,1697,668],{"class":233},[227,1699,671],{"class":653},[227,1701,253],{"class":233},[227,1703,1676],{"class":256},[227,1705,247],{"class":233},[227,1707,680],{"class":233},[227,1709,1710],{"class":229,"line":237},[227,1711,707],{"emptyLinePlaceholder":706},[227,1713,1714,1716,1719,1721,1723],{"class":229,"line":265},[227,1715,712],{"class":243},[227,1717,1718],{"class":659}," timeline ",[227,1720,718],{"class":233},[227,1722,1695],{"class":721},[227,1724,1725],{"class":659},"(\n",[227,1727,1728,1730,1733,1735],{"class":229,"line":280},[227,1729,240],{"class":233},[227,1731,1732],{"class":256},"http:\u002F\u002Flocalhost:8787\u002Fstreams\u002Ft\u002Fdefault\u002Fagents\u002Fresearcher\u002F\u003Cid>\u002Ftimeline",[227,1734,247],{"class":233},[227,1736,262],{"class":233},[227,1738,1739,1742,1745,1747,1749,1752,1754,1756,1759,1761,1764,1767,1769,1773,1775],{"class":229,"line":301},[227,1740,1741],{"class":233},"  {",[227,1743,1744],{"class":731}," auth",[227,1746,250],{"class":233},[227,1748,313],{"class":233},[227,1750,1751],{"class":731}," apiKey",[227,1753,250],{"class":233},[227,1755,253],{"class":233},[227,1757,1758],{"class":256},"tsp_local_dev_only",[227,1760,247],{"class":233},[227,1762,1763],{"class":233}," },",[227,1765,1766],{"class":731}," deltas",[227,1768,250],{"class":233},[227,1770,1772],{"class":1771},"sfNiH"," true",[227,1774,1763],{"class":233},[227,1776,1777],{"class":976}," \u002F\u002F API key in a browser: dev only\n",[227,1779,1780,1782],{"class":229,"line":336},[227,1781,782],{"class":659},[227,1783,680],{"class":233},[227,1785,1786],{"class":229,"line":351},[227,1787,707],{"emptyLinePlaceholder":706},[227,1789,1790,1792,1794,1797,1799,1801,1804,1806,1809],{"class":229,"line":373},[227,1791,1411],{"class":659},[227,1793,190],{"class":233},[227,1795,1796],{"class":721},"subscribe",[227,1798,724],{"class":659},[227,1800,724],{"class":233},[227,1802,932],{"class":1803},"sHdIc",[227,1805,782],{"class":233},[227,1807,1808],{"class":243}," =>",[227,1810,348],{"class":233},[227,1812,1813,1816,1818,1820,1822,1824,1826,1829,1831,1834,1836,1838,1840,1843,1845],{"class":229,"line":393},[227,1814,1815],{"class":721},"  render",[227,1817,724],{"class":731},[227,1819,932],{"class":659},[227,1821,190],{"class":233},[227,1823,1411],{"class":659},[227,1825,190],{"class":233},[227,1827,1828],{"class":659},"messages",[227,1830,564],{"class":233},[227,1832,1833],{"class":659}," state",[227,1835,190],{"class":233},[227,1837,1411],{"class":659},[227,1839,190],{"class":233},[227,1841,1842],{"class":659},"liveDeltas",[227,1844,782],{"class":731},[227,1846,680],{"class":233},[227,1848,1849,1851,1853],{"class":229,"line":413},[227,1850,779],{"class":233},[227,1852,782],{"class":659},[227,1854,680],{"class":233},[192,1856,1857],{},[175,1858,1859,1860,1863,1864,1867,1868,1871,1872,1874,1875,1878,1879,1881,1882,1884],{},"Live token deltas (",[179,1861,1862],{},"state.timeline.liveDeltas",") stream out of the box against the ",[188,1865,1866],{"href":114},"reference deployment"," — it emits them on every agent's sibling ",[179,1869,1870],{},"\u002Fdeltas"," stream. The stripped-down ",[179,1873,961],{}," above skips delta wiring to stay minimal, so here ",[179,1876,1877],{},"deltas: true"," connects but stays quiet and you still see every finalized message. A hand-rolled deployment turns deltas on by wiring the delta-emitter seam the way the reference deployment does; ",[188,1880,98],{"href":99}," covers the ",[179,1883,965],{}," it rides on.",[175,1886,1887,1888,1891],{},"Real apps never ship an API key to the browser — they mint short-lived read tokens server-side instead. The ",[188,1889,1890],{"href":103},"Frontend integration guide"," covers tokens, React bindings, and joining long timelines efficiently.",[209,1893,1895],{"id":1894},"make-it-multi-agent","Make it multi-agent",[175,1897,1898,1899,1901],{},"Now the payoff. Add a ",[179,1900,185],{},", and tell the researcher to delegate to it:",[217,1903,1905],{"className":643,"code":1904,"filename":645,"language":646,"meta":223,"style":223},"const summarizer = defineAgent({\n  type: \"summarizer\",\n  spawnSchema: z.object({ text: z.string() }),\n  state: z.object({}),\n  harness: native({\n    model: \"claude-sonnet-4-5\",\n    systemPrompt:\n      \"Summarize the text you were spawned with in three sentences, \" +\n      \"then call `finish` with the summary.\",\n    ingressUrl: \"http:\u002F\u002Flocalhost:8080\",\n  }),\n});\n",[179,1906,1907,1922,1936,1971,1992,2004,2018,2024,2035,2046,2060,2068],{"__ignoreMap":223},[227,1908,1909,1911,1914,1916,1918,1920],{"class":229,"line":230},[227,1910,712],{"class":243},[227,1912,1913],{"class":659}," summarizer ",[227,1915,718],{"class":233},[227,1917,660],{"class":721},[227,1919,724],{"class":659},[227,1921,234],{"class":233},[227,1923,1924,1926,1928,1930,1932,1934],{"class":229,"line":237},[227,1925,732],{"class":731},[227,1927,250],{"class":233},[227,1929,253],{"class":233},[227,1931,185],{"class":256},[227,1933,247],{"class":233},[227,1935,262],{"class":233},[227,1937,1938,1940,1942,1944,1946,1948,1950,1952,1955,1957,1959,1961,1963,1965,1967,1969],{"class":229,"line":265},[227,1939,747],{"class":731},[227,1941,250],{"class":233},[227,1943,689],{"class":659},[227,1945,190],{"class":233},[227,1947,756],{"class":721},[227,1949,724],{"class":659},[227,1951,761],{"class":233},[227,1953,1954],{"class":731}," text",[227,1956,250],{"class":233},[227,1958,689],{"class":659},[227,1960,190],{"class":233},[227,1962,773],{"class":721},[227,1964,776],{"class":659},[227,1966,779],{"class":233},[227,1968,782],{"class":659},[227,1970,262],{"class":233},[227,1972,1973,1975,1977,1979,1981,1983,1985,1988,1990],{"class":229,"line":280},[227,1974,789],{"class":731},[227,1976,250],{"class":233},[227,1978,689],{"class":659},[227,1980,190],{"class":233},[227,1982,756],{"class":721},[227,1984,724],{"class":659},[227,1986,1987],{"class":233},"{}",[227,1989,782],{"class":659},[227,1991,262],{"class":233},[227,1993,1994,1996,1998,2000,2002],{"class":229,"line":301},[227,1995,833],{"class":731},[227,1997,250],{"class":233},[227,1999,665],{"class":721},[227,2001,724],{"class":659},[227,2003,234],{"class":233},[227,2005,2006,2008,2010,2012,2014,2016],{"class":229,"line":336},[227,2007,846],{"class":731},[227,2009,250],{"class":233},[227,2011,253],{"class":233},[227,2013,853],{"class":256},[227,2015,247],{"class":233},[227,2017,262],{"class":233},[227,2019,2020,2022],{"class":229,"line":351},[227,2021,862],{"class":731},[227,2023,865],{"class":233},[227,2025,2026,2028,2031,2033],{"class":229,"line":373},[227,2027,870],{"class":233},[227,2029,2030],{"class":256},"Summarize the text you were spawned with in three sentences, ",[227,2032,247],{"class":233},[227,2034,878],{"class":233},[227,2036,2037,2039,2042,2044],{"class":229,"line":393},[227,2038,870],{"class":233},[227,2040,2041],{"class":256},"then call `finish` with the summary.",[227,2043,247],{"class":233},[227,2045,262],{"class":233},[227,2047,2048,2050,2052,2054,2056,2058],{"class":229,"line":413},[227,2049,894],{"class":731},[227,2051,250],{"class":233},[227,2053,253],{"class":233},[227,2055,901],{"class":256},[227,2057,247],{"class":233},[227,2059,262],{"class":233},[227,2061,2062,2064,2066],{"class":229,"line":433},[227,2063,910],{"class":233},[227,2065,782],{"class":659},[227,2067,262],{"class":233},[227,2069,2070,2072,2074],{"class":229,"line":439},[227,2071,779],{"class":233},[227,2073,782],{"class":659},[227,2075,680],{"class":233},[175,2077,2078,2079,2082],{},"Update the researcher's ",[179,2080,2081],{},"systemPrompt"," and the served list:",[217,2084,2086],{"className":643,"code":2085,"filename":645,"language":646,"meta":223,"style":223},"    systemPrompt:\n      \"Research the topic you were spawned with. Spawn a `summarizer` \" +\n      \"with your notes, then call `wait`. When its child_finished \" +\n      \"message arrives, call `finish` with the summary.\",\n",[179,2087,2088,2094,2105,2116],{"__ignoreMap":223},[227,2089,2090,2092],{"class":229,"line":230},[227,2091,862],{"class":318},[227,2093,865],{"class":233},[227,2095,2096,2098,2101,2103],{"class":229,"line":237},[227,2097,870],{"class":233},[227,2099,2100],{"class":256},"Research the topic you were spawned with. Spawn a `summarizer` ",[227,2102,247],{"class":233},[227,2104,878],{"class":233},[227,2106,2107,2109,2112,2114],{"class":229,"line":265},[227,2108,870],{"class":233},[227,2110,2111],{"class":256},"with your notes, then call `wait`. When its child_finished ",[227,2113,247],{"class":233},[227,2115,878],{"class":233},[227,2117,2118,2120,2123,2125],{"class":229,"line":280},[227,2119,870],{"class":233},[227,2121,2122],{"class":256},"message arrives, call `finish` with the summary.",[227,2124,247],{"class":233},[227,2126,262],{"class":233},[217,2128,2130],{"className":643,"code":2129,"language":646,"meta":223,"style":223},"  agents: [researcher, summarizer],\n",[179,2131,2132],{"__ignoreMap":223},[227,2133,2134,2136,2138,2141,2143,2146],{"class":229,"line":230},[227,2135,1129],{"class":318},[227,2137,250],{"class":233},[227,2139,2140],{"class":659}," [researcher",[227,2142,564],{"class":233},[227,2144,2145],{"class":659}," summarizer]",[227,2147,262],{"class":233},[175,2149,2150],{},"Stop the process, rebuild, and start it again — re-registration overwrites the previous one, so nothing else changes. Spawn a fresh researcher and follow its logs:",[217,2152,2154],{"className":621,"code":2153,"language":623,"meta":223,"style":223},"pnpm --filter my-agents build\n# restart the deployment process, then:\nteaspill spawn researcher '{\"topic\":\"the history of tea\"}'\nteaspill logs \u002Fa\u002Fresearcher\u002F\u003Cid>\n",[179,2155,2156,2160,2165,2169],{"__ignoreMap":223},[227,2157,2158],{"class":229,"line":230},[227,2159,1467],{},[227,2161,2162],{"class":229,"line":237},[227,2163,2164],{},"# restart the deployment process, then:\n",[227,2166,2167],{"class":229,"line":265},[227,2168,1520],{},[227,2170,2171],{"class":229,"line":280},[227,2172,2173],{},"teaspill logs \u002Fa\u002Fresearcher\u002F\u003Cid>\n",[217,2175,2178],{"className":2176,"code":2177,"language":1532},[1530],"# output illustrative\n13:12:04  #0   ● spawned researcher\n13:12:04  #1   user: {\"topic\":\"the history of tea\"}\n13:12:04  #2   ▶ run inv_1kPa… started (native claude-sonnet-4-5) wake=spawn\n13:12:11  #3   ⚙ tool spawn_agent({\"type\":\"summarizer\",\"args\":{\"text\":\"…notes…\"}})\n13:12:11  #4   → ok spawn_agent: Spawned summarizer as \u002Ft\u002Fdefault\u002Fa\u002Fsummarizer\u002F01kxw7…\n13:12:11  #5   ↳ spawned child summarizer\u002F01kxw7…\n13:12:11  #6   ⚙ tool wait({})\n13:12:11  #7   → ok wait: Turn yielded.\n13:12:12  #8   ■ run inv_1kPa… success tokens=978 8102ms\n13:12:26  #9   ↳ child 01kxw7… success: {\"summary\":\"Tea spread from China…\"}\n13:12:26  #10  ▶ run inv_1mQb… started (native claude-sonnet-4-5) wake=child_finished\n13:12:30  #11  ⚙ tool finish({\"result\":\"Tea spread from China along…\"})\n13:12:30  #12  → ok finish: Run complete.\n13:12:31  #13  ■ run inv_1mQb… success tokens=411 4210ms\n",[179,2179,2177],{"__ignoreMap":223},[175,2181,2182,2183,2186,2187,2190,2191,2194,2195,2198,2199,2202,2203,2206,2207,2210,2211,2214],{},"Look at seq ",[179,2184,2185],{},"#8",": the researcher's first run ",[1440,2188,2189],{},"ends"," right after spawning — ",[179,2192,2193],{},"spawn_agent"," returned the child's id immediately, never its result, and ",[179,2196,2197],{},"wait"," yielded the turn instead of blocking. The summary arrives fourteen seconds later as a ",[179,2200,2201],{},"child_finished"," message that starts a brand-new ",[1440,2204,2205],{},"wake"," (",[179,2208,2209],{},"#10","). Nothing in teaspill ever blocks or polls — that's the model that makes agents cheap to suspend and safe to crash, and ",[188,2212,2213],{"href":36},"Durable agents & the wake model"," makes it stick.",[175,2216,2217,2218,2220,2221,2224],{},"You could kill the deployment process between ",[179,2219,2185],{}," and ",[179,2222,2223],{},"#9"," and restart it: the researcher is asleep, the wake is durable, and the summary still arrives.",[209,2226,2228],{"id":2227},"next-steps","Next steps",[175,2230,2231],{},"You've run the whole loop: define → serve → spawn → message → watch → delegate. Three directions from here:",[2233,2234,2235,2241,2253],"ul",{},[2236,2237,2238,2240],"li",{},[188,2239,29],{"href":36}," — the ideas under everything you just did, in reading order.",[2236,2242,2243,2245,2246,2248,2249,2252],{},[188,2244,98],{"href":99}," — the full ",[179,2247,639],{}," surface: tools, ",[179,2250,2251],{},"onWake",", state revisions, testing.",[2236,2254,2255,2257],{},[188,2256,102],{"href":103}," — production timelines in your UI: read tokens, React, fast-join.",[2259,2260,2261],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":223,"searchDepth":230,"depth":237,"links":2263},[2264,2265,2266,2267,2268,2269,2270,2271],{"id":211,"depth":237,"text":212},{"id":632,"depth":237,"text":633},{"id":955,"depth":237,"text":956},{"id":1508,"depth":237,"text":1509},{"id":1582,"depth":237,"text":1583},{"id":1626,"depth":237,"text":1627},{"id":1894,"depth":237,"text":1895},{"id":2227,"depth":237,"text":2228},"Define a researcher agent, deploy it against the running stack, talk to it from the CLI, and watch its timeline live — then make it multi-agent.","md",null,{},{"icon":21},{"title":18,"description":2272},"HmjyQOksGT3zvyrtUNqdeeb3YokvTPGOLkY0wqBU37o",[2280,2282],{"title":13,"path":14,"stem":15,"description":2281,"icon":16,"children":-1},"Clone the repository, boot the five-service stack with Docker Compose, and confirm the platform is healthy.",{"title":23,"path":24,"stem":25,"description":2283,"icon":26,"children":-1},"The gateway, the coordination core, the two planes you deploy, and the one-way flow that keeps every store honest.",1784473421260]