1:"$Sreact.fragment"
a:I[97367,["/_next/static/chunks/01xlw8hd842-c.js","/_next/static/chunks/0t2xr05rlu96l.js"],"OutletBoundary"]
b:"$Sreact.suspense"
0:{"rsc":["$","$1","c",{"children":[["$","article",null,{"className":"max-w-3xl","children":[["$","p",null,{"className":"font-mono text-[10px] font-semibold uppercase tracking-[0.2em] text-primary","children":"Reference"}],["$","h1",null,{"className":"mt-3 font-headline text-3xl font-bold text-on-surface sm:text-4xl","children":"Typed Python client"}],["$","p",null,{"className":"mt-4 text-base leading-7 text-on-surface-variant","children":[["$","code",null,{"className":"font-mono text-primary-fixed","children":"repowire.client.AsyncRepowireClient"}],"is the supported way to talk to the daemon from Python code that is not an agent. It wraps the daemon’s HTTP API in a typed async surface using pydantic models for every response. Apps and scripts should depend on this rather than reach into daemon internals."]}],["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Construction"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":["Pass a base URL and optional auth token. The default targets a local daemon at ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"127.0.0.1:8377"}],". The client is async-context-managed; ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"aclose()"}]," is wired into ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"__aexit__"}],"."]}],["$","pre",null,{"className":"overflow-x-auto border border-border-faint bg-surface-container-low p-4 font-mono text-xs leading-6 text-on-surface","children":["$","code",null,{"children":"from repowire.client import AsyncRepowireClient\n\nasync with AsyncRepowireClient() as client:\n    health = await client.health()\n    print(health.version)\n\n# with auth and a custom base\nasync with AsyncRepowireClient(\n    \"https://repowire.io\",\n    auth_token=\"rw_...\",\n    timeout=10.0,\n) as client:\n    peers = await client.list_peers(status=\"online\")"}]}],["$","p",null,{"children":["You can also inject your own ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"httpx.AsyncClient"}]," via the ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"client="}]," kwarg, in which case ownership stays with you and ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"aclose()"}]," becomes a no-op."]}]]}]]}],["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Identity"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":["Every routing call takes a ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"from_peer"}]," kwarg. Unlike MCP tools, the client does not auto-detect identity from the tmux pane. Pass the registered name explicitly. Register first if the caller is not already a peer:"]}],["$","pre",null,{"className":"overflow-x-auto border border-border-faint bg-surface-container-low p-4 font-mono text-xs leading-6 text-on-surface","children":["$","code",null,{"children":"reg = await client.register_peer(\n    name=\"my-script\",\n    path=\"/home/me/scripts\",\n    backend=\"python\",\n)\nprint(reg.peer_id, reg.display_name)"}]}]]}]]}],["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Ask, ack, notify, broadcast"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":["The four routing primitives mirror the MCP tool surface. Asks are non-blocking and return a ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"correlation_id"}],"; the recipient closes them with ","$L2",". Reply content rides on the same ack call."]}],"$L3"]}]]}],"$L4","$L5","$L6","$L7","$L8"]}],null,"$L9"]}],"isPartial":false,"staleTime":300,"varyParams":null,"buildId":"wgeVyNnPlBCBYnrU7vhW9"}
2:["$","code",null,{"className":"font-mono text-primary-fixed","children":"ack"}]
3:["$","pre",null,{"className":"overflow-x-auto border border-border-faint bg-surface-container-low p-4 font-mono text-xs leading-6 text-on-surface","children":["$","code",null,{"children":"result = await client.ask(\n    to_peer=\"project-b\",\n    text=\"Which port is the daemon on?\",\n    from_peer=\"my-script\",\n)\ncid = result.correlation_id\n\n# elsewhere, on the recipient side or from an orchestrator:\nawait client.ack(cid, from_peer=\"project-b\", message=\"8377\")\n\nawait client.notify(\n    to_peer=\"telegram\",\n    text=\"long task done\",\n    from_peer=\"my-script\",\n)\n\nbc = await client.broadcast(\n    \"rebasing main\",\n    from_peer=\"my-script\",\n)\nprint(bc)"}]}]
4:["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Listing and inspection"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":["Pull current mesh state. ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"list_peers"}]," accepts daemon-supported filters; ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"get_peer"}]," resolves a single peer by name or id. ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"pending_asks"}]," returns open asks targeting one pane or peer."]}],["$","pre",null,{"className":"overflow-x-auto border border-border-faint bg-surface-container-low p-4 font-mono text-xs leading-6 text-on-surface","children":["$","code",null,{"children":"for peer in await client.list_peers(status=\"online\"):\n    print(peer.name, peer.circle, peer.description)\n\npeer = await client.get_peer(\"project-b\")\n\nasks = await client.pending_asks(peer_id=peer.peer_id)"}]}]]}]]}]
5:["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Spawning and lifecycle"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":[["$","code",null,{"className":"font-mono text-primary-fixed","children":"spawn"}]," launches a new agent session subject to ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"daemon.spawn.allowed_commands"}],". ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"spawn_config"}]," reports what the daemon will accept without attempting a spawn. ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"kill_peer"}]," terminates a peer cleanly."]}],["$","pre",null,{"className":"overflow-x-auto border border-border-faint bg-surface-container-low p-4 font-mono text-xs leading-6 text-on-surface","children":["$","code",null,{"children":"info = await client.spawn_config()\nif \"claude\" in info.allowed_commands:\n    spawn = await client.spawn(\n        path=\"/home/me/projects/project-c\",\n        command=\"claude\",\n        circle=\"docs\",\n        message=\"help me draft a reference page\",\n    )\n    print(spawn.display_name, spawn.tmux_session)"}]}]]}]]}]
6:["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Errors"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":[["$","p",null,{"children":["All methods raise one of three typed errors from ",["$","code",null,{"className":"font-mono text-primary-fixed","children":"repowire.protocol.errors"}],":"]}],["$","ul",null,{"className":"mt-2 space-y-2","children":[["$","li",null,{"children":[["$","code",null,{"className":"font-mono text-primary-fixed","children":"DaemonConnectionError"}],": the daemon is not reachable (most often, not running)."]}],["$","li",null,{"children":[["$","code",null,{"className":"font-mono text-primary-fixed","children":"DaemonTimeoutError"}],": the daemon accepted the connection but did not respond in time."]}],["$","li",null,{"children":[["$","code",null,{"className":"font-mono text-primary-fixed","children":"DaemonHTTPError(status, body)"}],": the daemon returned a non-2xx response."]}]]}]]}]]}]
7:["$","section",null,{"className":"mt-10","children":[["$","h2",null,{"className":"font-headline text-xl font-semibold text-on-surface","children":"Stability"}],["$","div",null,{"className":"mt-4 space-y-4 text-sm leading-6 text-on-surface-variant","children":["$","p",null,{"children":"The client is the public Python surface; depend on it rather than the daemon HTTP routes, which may shift between releases. Repowire is pre-1.0, so method signatures and pydantic models may still adjust across minor versions. Additions are preferred over breaks, but explicit breaks will happen when the design wants them."}]}]]}]
8:["$","div",null,{"className":"mt-12 border-t border-border-faint pt-8","children":[["$","div",null,{"className":"mb-3 font-mono text-[10px] font-semibold uppercase tracking-[0.2em] text-outline","children":"See also"}],["$","p",null,{"className":"text-sm leading-6 text-on-surface-variant","children":["Agents call the same primitives through ",["$","a",null,{"className":"text-primary-fixed underline-offset-4 hover:underline","href":"/docs/reference/tools","children":"MCP tools"}],". The semantics are identical; only the identity resolution differs."]}]]}]
9:["$","$La",null,{"children":["$","$b",null,{"name":"Next.MetadataOutlet","children":"$@c"}]}]
c:null
