Skip to content
Quickstart

Quickstart

Botanical's product Shiitake extensions: goal, loop and Almanac on the generic extension surface

Illustrative: this helper receives an already open Agent with the product roster and reads the goal slot for one Session. A fresh Session has no goal value. The helper requests neither model work nor a goal mutation.

quickstart.ts
import {
bindSessionExtension,
type ShiitakeAgent,
} from "@fungi.computer/shiitake/client";
import { goalContract } from "@fungi.computer/shiitake-extensions/goal";
import { botanicalAgentExtensions } from "@fungi.computer/shiitake-extensions/roster";
export const extensions = botanicalAgentExtensions;
export async function readGoal(agent: ShiitakeAgent) {
const session = agent.session("example-session");
const goal = bindSessionExtension(session, goalContract);
return goal.view(await session.read());
}

The bound view distinguishes unavailable, stopped with a reason, and running with a value or null. Existing goal tests bind that same contract, read observed state, issue commands and close the owner. The helper borrows the Agent. Its owner closes it when the host’s lifetime ends.