Add implementation plan and align spec with it
Claude-Session: https://claude.ai/code/session_01JtuZTCMW9TyogEmBgGf8JT
This commit is contained in:
4238
docs/superpowers/plans/2026-09-06-volcanic-secretary.md
Normal file
4238
docs/superpowers/plans/2026-09-06-volcanic-secretary.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -78,9 +78,9 @@ interface AgentHost {
|
||||
start(): Promise<void>; // resume most recent workspace session, or create one
|
||||
send(input: AgentInput): Promise<void>; // idle: start a run. busy: queue as steer
|
||||
followUp(input: AgentInput): Promise<void>; // idle: start a run. busy: queue as follow-up
|
||||
abort(): Promise<void>;
|
||||
abort(): Promise<boolean>; // true when a run was actually aborted
|
||||
newSession(): Promise<void>;
|
||||
compact(): Promise<void>;
|
||||
compact(): Promise<{ tokensBefore: number; estimatedTokensAfter?: number }>;
|
||||
status(): AgentStatus;
|
||||
subscribe(listener: (event: AgentHostEvent) => void): () => void;
|
||||
dispose(): Promise<void>;
|
||||
@@ -139,8 +139,10 @@ Session creation uses the runtime factory pattern from Pi's docs:
|
||||
|
||||
- `createAgentSessionServices({ cwd: workspace, agentDir, resourceLoaderOptions })`
|
||||
where `resourceLoaderOptions` carries `appendSystemPrompt` with the secretary
|
||||
instructions and `agentsFilesOverride` that appends `MEMORY.md` from the
|
||||
workspace as an extra context file.
|
||||
instructions and an inline extension whose `before_agent_start` handler
|
||||
appends the current contents of `MEMORY.md` to the system prompt on every
|
||||
turn. The resource loader caches context files at load time, so this is the
|
||||
only way edits the agent makes mid-session become visible on the next turn.
|
||||
- `createAgentSessionFromServices({ services, sessionManager, model,
|
||||
thinkingLevel, tools, customTools: [scheduleTool] })`.
|
||||
- `sessionManager` is `SessionManager.continueRecent(workspace)` on start and
|
||||
@@ -329,7 +331,7 @@ The workspace directory is the daemon's `cwd` and the agent's world.
|
||||
```
|
||||
workspace/
|
||||
AGENTS.md persona and standing instructions, loaded by Pi as a context file
|
||||
MEMORY.md durable facts, injected every turn via agentsFilesOverride
|
||||
MEMORY.md durable facts, appended to the system prompt every turn
|
||||
scripts/ scripts the assistant writes for scheduled jobs
|
||||
inbox/ documents received from Telegram
|
||||
.secretary/ jobs.json and other runtime state
|
||||
@@ -359,6 +361,7 @@ Environment variables, loaded from `.env` by Node's `--env-file`.
|
||||
| `PI_MODEL` | no | Pi settings default | `provider/model` or `provider/model:thinking`. |
|
||||
| `PI_CODING_AGENT_DIR` | no | `~/.pi/agent` | Pi's own override for its config directory. Useful in Docker. |
|
||||
| `SECRETARY_TIMEZONE` | no | process timezone | Timezone for cron and `at` display. |
|
||||
| `SECRETARY_SHELL` | no | Git Bash on Windows, else `bash` | Shell used to run scheduled scripts. |
|
||||
| `LOG_LEVEL` | no | `info` | `debug`, `info`, `warn`, `error`. |
|
||||
|
||||
Startup sequence: validate config, create workspace folders and template
|
||||
@@ -399,9 +402,9 @@ Vitest, unit tests colocated as `*.test.ts`.
|
||||
- AgentHost: driven by a fake session object implementing only `prompt`,
|
||||
`steer`, `followUp`, `abort`, `subscribe`, `isStreaming`, verifying the
|
||||
event mapping, final text rules, and busy versus idle routing.
|
||||
- One integration smoke test creates a real in memory Pi session with the
|
||||
default resource loader and sends one prompt. It is skipped when no provider
|
||||
auth is available.
|
||||
- One integration smoke test drives the real Pi backend with one prompt. It
|
||||
runs only when `SECRETARY_SMOKE=1` is set, so the normal test run never
|
||||
spends tokens by accident.
|
||||
|
||||
Manual end to end: run on Windows with a real bot and walk through each command
|
||||
and each media type.
|
||||
@@ -448,8 +451,10 @@ VolcanicSecretary/
|
||||
```
|
||||
|
||||
Runtime dependencies: `@earendil-works/pi-coding-agent`, `grammy`,
|
||||
`@grammyjs/auto-retry`, `croner`, `marked`. Dev dependencies: `typescript`,
|
||||
`tsx`, `vitest`, `@types/node`.
|
||||
`@grammyjs/auto-retry`, `croner`, `typebox` (tool parameter schema). The
|
||||
Markdown converter is hand rolled for Telegram's small HTML subset, so no
|
||||
Markdown library. Dev dependencies: `typescript`, `tsx`, `vitest`,
|
||||
`@types/node`.
|
||||
|
||||
`.gitignore` excludes `node_modules`, `dist`, `.env`, `workspace/inbox/*`,
|
||||
`workspace/scripts/*`, and `workspace/.secretary/`. `MEMORY.md` is committed
|
||||
|
||||
Reference in New Issue
Block a user