Skip to content

feat: Provide an ocap -> cli compiler. #826

Description

@grypez

In one line

Add a compile command to the kernel cli that exports any kernel-held capability as an executable file fit for bash agents.

Description

This is a proposal for integrating the ocap kernel with existing agentic workflows like claude code cli. We've looked at other approaches like writing an ocap kernel CLI and then providing a bridge via an ocap kernel MCP. The key driver behind the approach in this proposal is that the ocap kernel remains invisible to the agent using it. The agent is constrained to working within ocap principles at the call site of its capabilities, but those capabilities appear simply to be executable binaries (and indeed, are simply executable binaries). The ocap kernel populates the agents path with opaque file system capabilities which proxy the running ocap kernel daemon to realize their effects. The opacity is in the implementation, but the tools themselves are discoverable and responsive via the typical --help directives that accompany CLI tools.

Example flow

The user or their agent orchestrator call ok compile ko5 wallet produces an x-only wallet binary, and put that binary in the workspace of the agent by whatever means.

The agent is informed (exact approach agnostic) that it has the wallet command available to it, and can run it with bash, e.g.

wallet --help returns some view of the data from ok inspect ko5

wallet <cmd> [...args] returns the equivalent of ok invoke ko5 <cmd> [...args]

Passing the wallet to other agents or subagents is as performable by symlinking to the wallet; or, for recursive, narrowing construction, the agent can be passed a facet of its own agent orchestrator.

Why

This provides a terminal-native feel. The agent lingua franca is bash, and long context agents are already trained to explore their environments and identify affordances. We will have more success meeting agents in their corpus than attempting to provide a phrase book in the prompt.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions