Kernel
A cognet can't touch anything outside its own world. No files, no network, no clock of its own, no hardware. Everything that crosses the line goes through one object: the kernel.
That restriction is the point. Because a cognet never reaches past the kernel, it never knows — or depends on — what is on the other side. The same mind runs against a chat window, a simulator, or a robot. It runs live or replayed from a recording, and can't tell the difference.
In: stimuli
What the body senses arrives as stimuli: one message per thing sensed, with the time it
was sensed. A system that wants them declares stimuli as a read, and gets every stimulus
since it last ran — so a slow system misses nothing.
export default defineSystem({
reads: ["stimuli"],
writes: ["temperature"],
run({ stimuli }) {
for (const felt of stimuli) {
if (felt.data.channel !== "/temperature") continue
ecs.set({ id: "room", components: { temperature: { celsius: felt.data.values[0]!, sensed: felt.time.ms } } })
}
},
})
Stimuli are never stored in the world. The session already records every one; a mind that wants to remember something writes what it made of it.
Out: the kernel's verbs
Everything else a mind can do is a verb on kernel:
| Verb | Does |
|---|---|
output(type, data) | Tells the body something: text, audio, a picture, a command. |
body() | What the body says it is: its senses, its controls, how its parts sit. |
presence() | Whether the body is the mind's to move right now, or held, or overridden. |
run(code) | Asks for code to run in the agent's sandbox. Checked against policy. |
store, memory, knowledge | Where a mind keeps what outlives a session. |
emit(type, data) | The mind's own telemetry, for the debugger. |
That is the whole surface. There is no escape hatch.
What a mind needs from outside itself — a model, speech, a map — is a second door beside the kernel: Services, asked for by what they do.
Find a sense by what it is
A mind never hard-codes a channel. It asks body() what the body has, and finds what it needs
by what it is — a picture, an inner ear — so the same mind wears a different body without a
change.
const eye = kernel.body()?.senses.find(sense => sense.kind === "visual")
const ear = kernel.body()?.senses.find(sense => sense.profile === "sensor_msgs/Imu")
The full reference is kernel.