pi-arc-caffeine0.1.0
pi extension for Arc workspaces: stable skill paths, guidance on waiting for long-running work, and a guard against long sleeps
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-arc-caffeine
A small pi extension for Arc workspaces that tells pi to sleep less. Add npm:pi-arc-caffeine to the workspace's pi packages;
there is nothing to configure. It does three things:
- Stable skill paths. Arc copies
/workspace/.piinto a new.pi/resources/snapshot-<random>/for every pi launch, so skills loaded from there get a new<location>in the system prompt on every message, and nothing after it can be read from the prompt cache. Each such skill is listed at the same file under$ARC_WORKSPACE_ROOT/.pi/skillsinstead (default/workspace), if it exists there. If an earlier extension already replaced the prompt, the same rewrite is applied to its text. - Waiting guidance. The main session's system prompt gets a short section on waiting for long-running work: Arc's bash hands anything slower than 60 seconds to the background, and its result starts the agent's next turn, so the agent should end its turn rather than poll. Subagents and workflow agents, whose turn can't resume, don't get it.
- Sleep guard. A
bashcall whose command starts withsleep(after anycd … &&orcd …;) for longer than 5 seconds is refused. The model is told to end its turn to wait for a command it started (subagents and workflow agents aren't), or to run one bounded loop that exits on a condition, such astimeout 900 sh -c 'until <check>; do sleep 5; done'; a sleep inside a loop like that is allowed.
This is a subset of pi-arc-lifecycle, which
does all of the above and much more. Don't load both.
Development
pnpm i
pnpm test # vitest; never calls a model
pnpm type-check
pnpm format
To release, bump version in package.json in your PR. When it merges to master,
.github/workflows/publish-arc-caffeine.yaml stages it on npm with trusted publishing (OIDC,
GitHub environment npmjs-pi-arc-caffeine); a maintainer then approves it on npmjs.com (or
npm stage approve <id>) with 2FA. ./publish.sh is the manual fallback.