diff --git a/9p b/9p index 4ec6707..3a96284 160000 --- a/9p +++ b/9p @@ -1 +1 @@ -Subproject commit 4ec6707bf942c39c222608fcc76138cf9fa6e86e +Subproject commit 3a96284d986478fbac63d3b25edcbbe3b16cfdc8 diff --git a/README.md b/README.md index 1071baa..9304967 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ What happens if agent primitives are exposed as an ordinary filesystem? How much - `tui/`: - `9p/`: - `el/`: +- `scripts/`: shell scripts installed to `~/.config/ollie/scripts/` and exposed via `s/sh` and `s/job` ## Getting Started diff --git a/doc/help.md b/doc/help.md index e9d5bf9..6c4499f 100644 --- a/doc/help.md +++ b/doc/help.md @@ -36,6 +36,8 @@ ollie/ s/ sessions ls idx session index (ro) cat: id state cwd backend model, one per line new create session (r/w) cat: KV template; echo "cwd=/path" > + sh interactive shell (x) exec s/sh [-new|-resume] [-backend B] [-model M] + job batch job (x) exec s/job [-bg] [-parallel N] [-keep] [prompt...] / session directory rm -r to kill; mv to rename agent active agent (r/w) backend active backend (r/w) diff --git a/mkfile b/mkfile index e884f9d..94fe12d 100755 --- a/mkfile +++ b/mkfile @@ -38,8 +38,13 @@ data:V: scripts:V: echo === Installing scripts === - mkdir -p $HOME/bin - cp -f scripts/osh scripts/oq $HOME/bin/ + mkdir -p $HOME/.config/ollie/scripts + cp -f scripts/osh $HOME/.config/ollie/scripts/sh + cp -f scripts/oq $HOME/.config/ollie/scripts/job + cp -f scripts/oq-q $HOME/.config/ollie/scripts/q + cp -f scripts/oq-schedule $HOME/.config/ollie/scripts/sched + cp -f scripts/ls $HOME/.config/ollie/scripts/ls + cp -f scripts/kill $HOME/.config/ollie/scripts/kill help:V: echo 'Ollie monorepo build targets:' @@ -48,7 +53,7 @@ help:V: echo ' tui - Build terminal UI' echo ' 9p - Build 9p filesystem server' echo ' data - Install agents, prompts, skills, and tools to ~/.config/ollie/' - echo ' scripts - Install shell scripts to ~/bin/' + echo ' scripts - Install shell scripts to ~/.config/ollie/scripts/' echo '' echo 'Submodules must be initialized first:' echo ' git submodule update --init --recursive' diff --git a/scripts/README.md b/scripts/README.md index 41223e0..5bb9610 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,7 +1,16 @@ # scripts Shell scripts for interacting with the ollie 9P filesystem. -All scripts read `OLLIE_9MOUNT` (default: `$HOME/mnt/ollie`) for the mount path. +All scripts read `OLLIE` (default: `$HOME/mnt/ollie`) for the mount path. + +`mk scripts` installs them to `~/.config/ollie/scripts/` and they are exposed via the +mounted filesystem as `s/sh` (osh) and `s/job` (oq), so they are available without +any `$PATH` changes: + +```sh +exec $OLLIE/s/sh # start interactive shell +$OLLIE/s/job "my prompt" # run a batch job +``` --- diff --git a/scripts/kill b/scripts/kill new file mode 100644 index 0000000..8db0ca4 --- /dev/null +++ b/scripts/kill @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +rm -r ${OLLIE}/s/$1 diff --git a/scripts/ls b/scripts/ls new file mode 100644 index 0000000..e32391d --- /dev/null +++ b/scripts/ls @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +cat ${OLLIE}/s/idx diff --git a/scripts/oq b/scripts/oq index 4845ad6..4b10517 100755 --- a/scripts/oq +++ b/scripts/oq @@ -17,7 +17,7 @@ set -euo pipefail -MOUNT=${OLLIE_9MOUNT:-$HOME/mnt/ollie} +MOUNT=${OLLIE:-$HOME/mnt/ollie} die() { printf 'oq: %s\n' "$*" >&2; exit 1; } trap 'printf "\n"' EXIT diff --git a/scripts/oq-q b/scripts/oq-q new file mode 100644 index 0000000..32f6bd1 --- /dev/null +++ b/scripts/oq-q @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# s/q: foreground one-shot query; output goes to stdout. +exec "${0%/*}/job" "$@" diff --git a/scripts/oq-schedule b/scripts/oq-schedule new file mode 100644 index 0000000..787a661 --- /dev/null +++ b/scripts/oq-schedule @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# s/sched: submit a background job; prints the b/ path for each job. +OLLIE=${OLLIE:-$HOME/mnt/ollie} +"${0%/*}/job" -bg "$@" | while IFS= read -r id; do + [ -n "$id" ] && printf '%s/b/%s\n' "$OLLIE" "$id" +done diff --git a/scripts/osh b/scripts/osh index 67f1c25..e7ab65a 100755 --- a/scripts/osh +++ b/scripts/osh @@ -2,7 +2,7 @@ # osh: interactive chat interface for ollie AI agents. set -o history -MOUNT=${OLLIE_9MOUNT:-$HOME/mnt/ollie} +MOUNT=${OLLIE:-$HOME/mnt/ollie} LAST=$HOME/.config/ollie/last-session # load_session → prints session ID for that dir, or nothing