Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: add /do:replan button to App dashboard Agent Operations
Adam Eivy2e5b45b5dcd8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex ce2fd636b9..d333aff7f7 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -2,6 +2,7 @@## Added+- **`/do:replan` button under each app's Agent Operations section.** Adds a sixth slashdo button to the Agent Operations row on every app's Overview tab (and to the server-side allowlist that gates `POST /api/cos/tasks/slashdo`) so the user can queue an automated PLAN.md audit/triage agent for any managed app the same way they queue `/do:push`, `/do:review`, etc. Clicking the cyan `/do:replan` button creates a CoS task pre-loaded with the upstream `lib/slashdo/commands/do/replan.md` content (which archives done items to DONE.md, prunes stale entries, and suggests new work), then routes the user to `/cos/agents` to watch it run. Files: `client/src/components/apps/SlashDoPanel.jsx`, `server/routes/cosTaskRoutes.js`.- **Ask Yourself — slice (b) closes: voice tool + ⌘K palette action.** The text-chat half of "Ask Yourself" shipped on 2026-04-24, and per-turn promotions shipped on 2026-04-28; the remaining slice-(b) item — voice integration — is now done. New `ui_ask` voice tool in `server/services/voice/tools.js` consumes `askService.runAsk`'s async iterable (`sources`/`delta`/`done`/`error` events), accumulates the answer, and returns `{ ok, content, sourceCount, sources, providerId, model, summary }`. The tool's description tells the voice LLM to speak `content` verbatim, so the existing sentence-boundary TTS path in `pipeline.js` reads it aloud — no new client-side wiring required. Tool is gated by a new `ask` intent group with a tight regex (`ask my ?self|advise me|coach me|draft (a|an|my|me|something)|what.* on my plate|what (did|do|should) i (decide|think|believe|say|want|do)|why did i|when did i|recall (my|that|when)`) so small tool-use models (qwen3-4b, granite, etc.) only see it on RAG-style turns and don't get tempted to call it on plain UI/capture phrasings. `pipeline.js` now propagates the voice turn's `AbortSignal` through `ctx.signal` so barge-in tears down the upstream askService stream instead of silently leaking tokens into a closed connection. The palette half: `ui_ask` added to `PALETTE_ACTIONS` in `server/routes/palette.js` under section `Ask`, label `Ask Yourself` — `⌘K` exposes it with description/parameters auto-hydrated from the voice tool registry, and `POST /api/palette/action/ui_ask { args: { question, mode? } }` returns the answer + source kinds/titles synchronously so non-voice callers (palette, scripts) get the same RAG pipeline. 17 new tests (7 ui_ask tool, 5 ask-intent classifier, 3 ui_ask spec gating, 2 palette manifest + dispatch) — full server suite green at 2785/2785. Closes the last item in the PLAN.md "Ask Yourself — slice (b)" backlog. Files: `server/services/voice/tools.js`, `server/services/voice/tools.test.js`, `server/services/voice/pipeline.js`, `server/routes/palette.js`, `server/routes/palette.test.js`, `PLAN.md`.- **Ask Yourself: one-click promote each assistant turn into a Brain note, CoS task, or Goal progress entry.** Closes the second half of "Ask Yourself — slice (b)" — the Ask page's twin-flavored answers were trapped in the conversation. Each assistant turn now shows three buttons below its source chips: **Save to Brain** (calls `brainService.captureThought` with the answer text), **Create task** (creates a CoS task with the answer as the description, capped at 280 chars and tagged with a "Promoted from Ask Yourself <id>" context note), and **Attach to goal…** (inline goal picker → `identityService.addProgressEntry` writes the answer as a `progressLog` note dated today). After a successful promotion the button mutates to a green "Saved to Brain"/"Task created"/"Attached: <goal title>" chip that deep-links to the saved record (`/brain/inbox`, `/cos`, `/digital-twin/goals?id=…`). Server-side, every promotion also pins the conversation (`promoted = true`) so anything saved elsewhere survives the 30-day expiry sweep — without that, a saved brain note could outlive the conversation it cites. New endpoint `POST /api/ask/:id/turns/:turnId/promote` validates a discriminated zod union — `{ target: 'brain' }`, `{ target: 'task', priority? }`, `{ target: 'goal', goalId }` — fails fast with 400/404/409 on missing turns, user turns, empty content, missing goals, or duplicate tasks. 13 new route tests; the full server suite remains green at 2746/2746. The remaining slice-(b) item — the `ui_ask` voice tool + palette whitelist — is still pending. Files: `server/routes/ask.js`, `server/routes/ask.test.js`, `client/src/services/apiAsk.js`, `client/src/pages/Ask.jsx`, `PLAN.md`.- **Voice agent: `feeds_mark_read` tool.** Pairs with the existing `feeds_digest` so the user can say "mark that one read" / "mark them all read" / "mark all of Hacker News as read" without leaving the conversation. Two ways to call: `query` fuzzy-matches a single unread item by title (exact → substring → all-tokens fallback) using titles the LLM just spoke from `feeds_digest`; `all: true` marks every unread item read, optionally scoped to one feed via `feedQuery` (fuzzy-matched against feed title). The `feeds` intent regex was loosened to also match phrasings like "mark that one read" / "mark them all as read" / "headlines" so the tool is offered to the LLM on the right turns; the bare word "read" alone is intentionally NOT a feeds trigger (it collides with "read my log"). 11 new tests in `server/services/voice/tools.test.js` cover ok/error paths, feed scoping, fuzzy matching, and the new regex behavior. Files: `server/services/voice/tools.js`, `server/services/voice/tools.test.js`.diff --git a/client/src/components/apps/SlashDoPanel.jsx b/client/src/components/apps/SlashDoPanel.jsxindex bb19214f47..d1ca07756c 100644--- a/client/src/components/apps/SlashDoPanel.jsx+++ b/client/src/components/apps/SlashDoPanel.jsx@@ -8,6 +8,7 @@ import * as api from '../../services/api';const SLASHDO_COMMANDS = [{ id: 'push', label: '/do:push', description: 'Commit and push all work', classes: 'bg-port-success/20 text-port-success hover:bg-port-success/30 border-port-success/30' },{ id: 'review', label: '/do:review', description: 'Deep code review', classes: 'bg-port-accent/20 text-port-accent hover:bg-port-accent/30 border-port-accent/30' },+ { id: 'replan', label: '/do:replan', description: 'Audit and prune PLAN.md, archive done items to DONE.md', classes: 'bg-cyan-500/20 text-cyan-400 hover:bg-cyan-500/30 border-cyan-500/30' },{ id: 'release', label: '/do:release', description: 'Create a release PR', classes: 'bg-purple-500/20 text-purple-400 hover:bg-purple-500/30 border-purple-500/30' },{ id: 'better', label: '/do:better', description: 'DevSecOps audit', classes: 'bg-port-warning/20 text-port-warning hover:bg-port-warning/30 border-port-warning/30', hideForSwift: true },{ id: 'better-swift', label: '/do:better-swift', description: 'SwiftUI DevSecOps audit', classes: 'bg-port-warning/20 text-port-warning hover:bg-port-warning/30 border-port-warning/30', swiftOnly: true }diff --git a/server/routes/cosTaskRoutes.js b/server/routes/cosTaskRoutes.jsindex c4f8198a35..3de5c656a7 100644--- a/server/routes/cosTaskRoutes.js+++ b/server/routes/cosTaskRoutes.js@@ -12,6 +12,7 @@ import { asyncHandler, ServerError } from '../lib/errorHandler.js';const SLASHDO_COMMANDS = {push: { label: 'Push', description: 'Commit and push all work with changelog' },review: { label: 'Review', description: 'Deep code review of changed files' },+ replan: { label: 'Replan', description: 'Audit PLAN.md, archive completed items, prune stale work' },release: { label: 'Release', description: 'Create a release PR' },better: { label: 'Better', description: 'Unified DevSecOps audit and remediation' },'better-swift': { label: 'Better Swift', description: 'SwiftUI DevSecOps audit and remediation' }