Core 0.2.4
2026-09-05 · Tag steamharness/v0.2.4 · npm
New Features
- Agent capability layer: built on the pi agent SDK, adding
workflow.createAgent(...),createAgentNode(...), and a conversation executor. - Cross-turn conversation recovery: the pi
AgentMessage[]is stored underagent.transcript.<sessionKey>and seeded back intoinitialState.messageson the next turn. - Related project knowledge and entrypoint calls:
relatedProjects.get(alias)opens the target's knowledge base and entrypoints, authorized per key.
Added
- Added
contentType: "video"to the output protocol, preserving video descriptors and streamed output-item types. - Added
workflow.createAgent(...), a programmatically driven agent runtime. - Added
workflow.createAgentNode(...), an agent node for any workflow. - Added
workflow.defineAgentConversationExecutor(...), which produces a complete conversation executor in one call. - Added conversation configuration, token usage, tools, params, and OpenAI gateway wiring inside that executor.
- Added the
createAgentConversationProject(...)andcreateAgentProjectParams(...)split form for projects that must pass structure validation. - Added agent input fields
prompt,images,workdir,provider,model, andbaseUrl. - Added agent input fields
effort,agent,permissionPolicy,contextWindow,compact, and the approval resume payloads. - Added
effortlevels fromofftomax, withultrameaningmax, converging to what the model supports. - Added
agentasbuildorplan, where a plan turn's text renders as a single Plan row and asks for approval at the end of the turn. - Added plan approval reusing the
decisionradio plus optionalinstructions, continuing in the same session as a build agent once approved. - Added
permissionPolicyasread-only,workspace, orauto, none of which prompts for a built-in tool. - Added a neutral
metadata.kindfamily for output items:agent-part,agent-notice,agent-error, andagent-answer. - Added
contextUsage: { used, total }to the output payload, which hosts render as the composer's used and total row plus a compaction entry point. - Added
--context-windowto override the context-usage denominator. - Added tool approval through
context.toolPermissionsand plan approval throughcontext.userInput. - Added token usage reported once through
context.tokenUsage.report(...), with nothing left for the project to implement. - Added the
@earendil-works/pi-agent-coreand@earendil-works/pi-aidependencies, shipped with the host'ssteamharnessinstall. - Added
AgentNodeOptions.createToolsreturning{ tools, close?() }, wherecloseruns when the turn ends. - Added
AgentNodeOptions.createTools(context)assembling tools beyond the seven built-ins, with programmatic runtimes usingAgentRuntimeOptions.extraTools. - Added
AgentInput.systemPromptsupplying the system prompt per run andAgentInput.imagestraveling to the model with the prompt. - Added
workflow.connectMcpServer(...)to start and handshake a stdio MCP server and list the tools it exposes. - Added
workflow.createMcpTools(...)turning MCP tools into agent tools, keeping the<serverId>_<toolName>names. - Added
workflow.normalizeMcpServers(...)validating server definitions before anything is spawned. - Added capability-bearing variables inheritable only by name, with
allowedInheritedEnvKeyslisting them andinheritEnvironmentrequesting them. - Added
workflow.createProjectCapabilityTools({ context })rendering a capability as native agent tools. - Added
workflow.createProjectCapabilityServer(toolId, { context })rendering the same capability as an MCP server. - Added
workflow.runProjectCapabilityAction(toolId, context, args)running one action by tool id for approval resumes. - Added
workflow.listProjectCapabilityToolIds({ globalMemory? })listing what a run will offer. - Added
workflow.isProjectCapabilityAvailable(toolId)reporting whether a capability can serve in this process. - Added four built-in workflow capability tools — knowledge documents, KV, cross-session memory, and host configuration — keeping the tool ids of the built-in OpenCode project.
- Added
workflow.createSkillTools({ directories, approve? })offering skills as a tool the model reads on demand. - Added
workflow.runSkillAction(directories, args)rerunning the same action by name for an approval resume. - Added
deleteValue(key)to the KV and PersistentValue namespaces, reporting whether an existing entry was actually removed. - Added the
ask_userbuilt-in tool for plan-mode agents, letting the model ask mid-turn with choices, multi-select, and free text. - Added
stepon a parameter definition, splitting a multi-question request into steps that keep one question's fields together. - Added knowledge helpers on
relatedProjects.get(alias), reading and writing the target project's documents. - Added
listEntrypoints()andrunEntrypoint(id, args)to list and invoke the target project's granted entrypoints. - Added the
knowledge: { read, write }andentrypointsgrant fields, where declaring neither grants neither. - Added
modelAttributesletting a custom provider declarecontextWindow,maxTokens,cost, andthinkingLevelMap. - Added static
group: { id, title, order? }display metadata on Workflow entrypoints, preserved in structure reports. - Added
type: "file", control: "audio"to parameter contracts, with duration and byte limits. - Added video attachments and common video MIME inference to the Conversation default input contract.
Changed
- Changed an agent conversation to write its text where it was spoken, each run of text becoming its own
agent-partrow. - Changed host-driven runs to stay unchanged, with the
conversation.openai.outputItemIditem produced only in them. - Changed a turn's output items to order by where each one finished, putting tools and reasoning first and the answer where it was written.
- Changed tool approval to pause a run only in plan mode, since a build turn executes an already approved plan without asking again.
- Changed run report errors to carry an excerpt of the upstream HTTP response body, so a status phrase no longer hides the real reason.
Fixed
- Fixed the agent conversation context having never been implemented: every user message was a new process and the model only saw that one sentence.
- Fixed a restored transcript past the model window failing the whole request, by compacting on demand before the model is called.
- Fixed cancelled or interrupted turns leaving unanswered tool calls that providers refuse, trimming the unsettled tail before it is stored.
- Fixed a failed read or write of
agent.transcript.<sessionKey>failing the whole turn, now reported as a row instead. - Fixed the OpenAI / Responses adapter for agent projects always ending with "did not produce output item".
- Fixed
createAgentConversationProject({ outputItemId })deriving the answer item id from the session instead of the declared one. - Fixed a symlink inside the workspace letting
read,write,edit,grep, andfindreach outside it. - Fixed a
bashtimeout or abort ending only the shell, now ending the whole process tree it started. - Fixed cancelling a run not really stopping the turn, with
context.abortSignalnow calling pi'sagent.abort(). - Fixed
readloading a whole file into memory, now streaming the requested line range past 8 MiB. - Fixed
editexpanding$&and$'as replacement patterns, now replacing literally. - Fixed the compaction split point able to hand the whole transcript, current task included, to the summarizer.
- Fixed
/compactflashing a compaction row when there was nothing to compact. - Fixed an empty
effortstring being treated as a level, which leftreasoningEffortunset on OpenAI-style endpoints. - Fixed context usage estimated at one token per four characters, which undercounted Chinese by about three times.
- Fixed
kv_storewriting the runtime's owntokenUsage.*,conversation.state, andagent.*keys. - Fixed the declared capability length limits (knowledge and memory
markdown,title,query,cursor, KVkey) not being enforced in the implementation. - Fixed the memory
cursormeaning different things tolistandsearchwithout returned values carrying alist:/search:prefix. - Fixed an unusable host bridge URL throwing through the other capabilities, with
isAvailablenow returningfalse. - Fixed a server-published MCP tool schema that was not an object, too deep, or over 256 KiB taking the process down at registration.
- Fixed the MCP per-server tool cap being checked after a page is merged instead of before.
- Fixed MCP tool listing paging forever against a server that repeats its cursor, now reporting an error instead.
- Fixed host configuration
valueslosing its key and value checks, so out-of-range arguments travelled to the host bridge. - Fixed a skill file listing cut short by the 60-path cap reading as the whole of it.
- Fixed a node's
workdir,provider,model,effort, andagentcoming from the runtime options rather than the run's own input. - Fixed
createAgentInputFromArgsfolding an unrecognised--flagand its value into the prompt. - Fixed a turn that only called tools appending an empty assistant message to the conversation.
- Fixed a run carrying
hostInputwriting the workflow conversation, leaving the host's own record written twice. - Fixed
AgentInput.workdironly affecting the output payload while the built-in tools stayed inside the runtime's workdir. - Fixed image attachments disappearing before the model, with the host's
imageFilesnow read into base64. - Fixed an image-only turn ending with
Prompt is required.. - Fixed
--imagesbeing swallowed fordefineAgentConversationExecutor/createAgentProjectInputprojects. - Fixed agent model calls carrying no retry budget, so the first 502 or mid-stream drop ended the whole run.
- Fixed a model stream cut off mid-answer failing the turn on
terminated, now continuing and keeping what was produced. - Fixed a turn cut off by the model's output limit being finalized as a finished answer, now continuing on a separate 2-attempt budget.
- Fixed a message announcing a tool call but carrying none being finalized as a successful text-only answer.
- Fixed a model stream ending without a verdict leaving the turn hanging forever, now synthesized into a recoverable error.
- Fixed reasoning buffered until the turn ended, leaving high-effort models with nothing to show while they thought.
- Fixed related project knowledge writes bypassing the per-key grant on the mutation route, where the index and documents were written directly.
- Fixed
readEntrypointOutput(...)returning a failed entrypoint's result as a payload. - Fixed an unreachable related project knowledge base reporting only "relation unconfirmed" instead of the missing persistent-value handle.