This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Levi Neely 43dff26415 doc: move usage content to monorepo; README is now server reference only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-18 12:25:39 +02:00
internal/p9 9p: move job script to b/; remove job from s/ sessionStoreFiles 2026-04-18 12:14:09 +02:00
LICENSE Initial commit: olliesrv 9P server for ollie agent sessions 2026-04-10 01:46:48 +02:00
README.md doc: move usage content to monorepo; README is now server reference only 2026-04-18 12:25:39 +02:00
go.mod 9p: remove file and reasoning server registrations; session tmpdir init 2026-04-14 15:26:23 +02:00
go.sum 9p: remove file and reasoning server registrations; session tmpdir init 2026-04-14 15:26:23 +02:00
main.go s/ls, ollie-tmp-path 2026-04-17 13:05:23 +02:00
mkfile tools: remove discover_skill.sh and load_skill.sh helper scripts 2026-04-11 16:23:53 +02:00

README.md

olliesrv

A 9P server that exposes ollie agent sessions as a virtual filesystem. Mount it with 9pfuse and interact with AI sessions using ordinary shell tools.

The goal is integration, not self-sufficiency. Rather than providing orchestration, scheduling, or workflow primitives, olliesrv exposes a stable surface — sessions as directories, conversation as files — and defers everything else to the surrounding environment. Scripting, chaining, monitoring, and automation come from composing olliesrv with tools that already exist, not from building those capabilities into the server.

For usage examples, see doc/USAGE.md in the monorepo.

Filesystem layout

ollie/
  a/                    dir:   agent configs (r/w, backed by ~/.config/ollie/agents/)
    <name>.json         r/w:   agent config; supports mv, cp, rm
  backends              read:  list of ollie-provided backends
  help                  read:  help file (backed by ~/.config/ollie/help.md)
  p/                    dir:   prompt templates (read, backed by ~/.config/ollie/prompts/)
    00_base.md          read:  tone, accuracy, task execution, environment
    01_ollie.md         read:  session identity, filesystem layout, session lifecycle
    02_reasoning.md     read:  reasoning instructions
    03_memory.md        read:  memory instructions
    04_task.md          read:  task planning instructions
    05_edit-text.md     read:  text editing instructions
    06_skills.md        read:  skill discovery and loading
    07_tools.md         read:  tool script usage

  Prompt files are assembled in lexical order and rendered as Go templates at session
  start. Changes take effect the next time the system prompt is rebuilt: on new session
  creation, `/cwd` change, or `/agent` switch.

  b/                    dir:   batch jobs and job scripts
    new                 r/w:   read: KV template; write: submit a job spec
    idx                 read:  job index (id, status, cwd, agent — one per line)
    job                 exec:  core batch job runner (submit, wait, print result)
    q                   exec:  foreground one-shot query; thin wrapper around job
    sched               exec:  submit background job; prints b/ path; wrapper around job
    <job-id>/                  rm -r to cancel and remove
      spec              read:  original job spec as submitted
      status            read:  running | done | failed: <reason>
      result            read:  assistant reply (populated when done)
      usage             read:  token counts
      ctxsz             read:  context size
  pl/                   dir:   plans
  s/                    dir:   sessions and session management scripts
    new                 r/w:   read: KV template; write: create session
    idx                 read:  session index (id, state, cwd, backend, model — one per line)
    sh                  exec:  interactive chat shell
    ls                  exec:  list active sessions
    kill                exec:  kill a session by ID
    <session-id>/               rm -r to kill session; mv to rename
      agent             r/w:   active agent name
      backend           r/w:   active backend name
      chat              read:  cumulative conversation history
      ctl               write: stop | <command>
      ctxsz             read:  estimated context size vs context window
      dequeue           read:  pop the next queued prompt
      enqueue           write: queue a prompt for later execution
      mcp               read:  MCP server list
      model             r/w:   active model name
      models            read:  available models from the backend
      prompt            write: submit a prompt to the agent
      state             read:  current agent state (idle, thinking, calling: <tool>)
      systemprompt      read:  fully rendered system prompt for this session
      usage             read:  token counts (input, output, requests; [estimated] if not reported by backend)
      cwd               r/w:   working directory for tool execution and system prompt
  sk/                   dir:   skills (r/w, from OLLIE_SKILLS_PATH or ~/.config/ollie/skills/)
    <name>.md           r/w:   skill SKILL.md content
  t/                    dir:   tool scripts (r/w, backed by ~/.config/ollie/tools/)
    <script>            r/w:   tool script content
  u/                    dir:   utility scripts (read, backed by ~/.config/ollie/scripts/u/)
    <script>            exec:  utility script; compositions of b/ primitives

Session IDs are Unix nanosecond timestamps with a random suffix (e.g. 1744276689123456789-2b986c), so ls s/ sorted lexicographically gives creation order.

Backing stores

Each 9P directory endpoint is backed by a named store implementing one of the store interfaces (ReadableStore, ReadWriteStore, BlobStore, or Store). The server routes all filesystem operations through the store — it has no direct knowledge of what underlies it.

Path Default backing Interface
/a FlatDirStore Store
/b BatchStore Store
/m FlatDirStore Store
/p FlatDirStore ReadableStore
/pl FlatDirStore Store
/sk SkillStore Store
/t ToolStore Store
/u UtilStore Store
/s SessionStore Store

To swap a backing store (e.g. replace /pl with a vector database or /m with an object store), implement the appropriate interface and wire it in New(). The store interface requires only Stat, List, Get, Put, Delete, Create, and Rename — authentication, connection management, and credential rotation are internal concerns of the implementation.

SessionStore is the exception: it holds live session state and is tightly coupled to the server's session lifecycle. Replacing it is possible in principle but requires understanding the session management internals.

Building

mk

Installs olliesrv to $HOME/bin.

Usage

olliesrv start       # start daemon (backgrounds itself)
olliesrv fgstart     # start in foreground
olliesrv stop        # stop daemon
olliesrv status      # check if running

The server listens on a Unix socket in the Plan 9 namespace ($NAMESPACE/ollie) and optionally mounts via 9pfuse to $HOME/mnt/ollie (or $OLLIE).