@prismshadow/penguin-core
v0.2.9
Published
PenguinHarness core SDK: context_engine, OmniMessage protocol, LLM/Environment interfaces.
Downloads
2,283
Readme
@prismshadow/penguin-core
The PenguinHarness SDK and execution engine: the ReAct loop (context_engine), the OmniMessage protocol, the LLM / Environment interface contracts, Agent State and append-only Traces.
The engine speaks only OmniMessage and delegates everything else through two swappable interfaces — LLMInterface (models, via the @prismshadow/agenthub gateway) and EnvironmentInterface (tool execution). The SDK caller is the Human boundary: one entry point, session.run, streams the whole loop.
import { createAgent, isCompleteModelMessage, userText } from "@prismshadow/penguin-core";
const agent = await createAgent({ agentId: "default_agent" });
const session = await agent.createSession({ workspaceDir: process.cwd() });
for await (const output of session.run([userText("Create hello.txt containing hi")], {
approve: async () => "allow", // per-tool-call approval
})) {
if (isCompleteModelMessage(output) && output.payload.type === "text") {
console.log(output.payload.text);
}
}A single run drives a complete Task: streaming output, per-call approvals, concurrent tool execution, interrupt carry-over, automatic reconnect and context compaction. State lives under ~/.penguin/data (PENGUIN_HOME); every Session restores fully from its Trace.
Documentation
Development
pnpm --filter @prismshadow/penguin-core build # tsup → dist/ (exports point at dist)
pnpm --filter @prismshadow/penguin-core typecheck
pnpm --filter @prismshadow/penguin-core test
pnpm test:e2e # live-model e2e (needs DEEPSEEK_API_KEY)Part of PenguinHarness · Apache-2.0
