Skip to content

feat(devtools): clean dead Dev tabs + per-tool example inputs in the Tools console#256

Merged
luokerenx4 merged 4 commits into
masterfrom
feat/dev-toolkit
Jun 3, 2026
Merged

feat(devtools): clean dead Dev tabs + per-tool example inputs in the Tools console#256
luokerenx4 merged 4 commits into
masterfrom
feat/dev-toolkit

Conversation

@luokerenx4
Copy link
Copy Markdown
Contributor

Summary

Health-check pass on the Dev console ahead of the tool-layer work, plus a small mechanism that makes the Tools tab actually usable for debugging.

  • Remove two dead Dev tabsConnectors and Sessions both called /api/dev/{registry,send,sessions}, a backend that was never implemented or mounted (no dev.ts route), so they 404'd into a silent .catch(()=>{}). Leftover UI from the retired AgentCenter/connector stack. Drops the tabs, ui/src/api/dev.ts, the demo MSW handlers, the sidebar entries, the tab-type union, and the URL redirect. The Dev console now has only real pages: Tools / Snapshots / Logs / Simulator. No backend change (/api/dev/* never existed).

  • Per-tool example inputs. Tools declare a runnable sample via .meta({ examples: [...] }) on their inputSchema. z.toJSONSchema surfaces it as a top-level examples, and both the /api/tools/:name detail route and the /cli/:wsId/manifest already return z.toJSONSchema(inputSchema) — so the example reaches both the Tools tab (form pre-fill) and alice <group> <verb> --help with zero new plumbing. Pure metadata; never affects runtime (unlike .default()).

    • ToolExecutePanel now seeds its form from examples[0] instead of blank.
    • Coverage: every data tool (thinking, analysis, equity, economy, news, market) and 18/19 trading tools. listUTAs (zero-field schema) is skipped; inbox_push is a workspace-only tool and isn't in the Tools console.
    • Trading mutation tools use conservative placeholder values (per a boundary call in the thread). They stage operations — real execution still needs commit + push + manual approval — so a stray Execute on a pre-filled form does not place an order. source uses an alpaca-paper placeholder.

Test plan

  • npx tsc --noEmit clean
  • cd ui && npx tsc -b clean
  • pnpm test — 1728 passing
  • Verified end-to-end that .meta({ examples }) flows through z.toJSONSchema for real tools (equity ratios → [{"symbol":"AAPL",...}], market search → [{"query":"apple"}])
  • Grep-swept for residual connectors/sessions/api/dev references after the tab removal

Boundary touch

Touches the tool layer (.meta on src/tool/* inputSchema, including trading — descriptions/examples only, no execution-logic change) and the UI (Dev console). No trading-execution, auth, broker-credential, or migration changes. Trading mutation examples are staging-only placeholders.

Known gap (deferred)

ToolExecutePanel can't pre-fill array/object params (simulatePriceChange.priceChanges, placeOrder.takeProfit/stopLoss) — they'd JSON.stringify into a text box and fail server validation on execute. The example renders correctly in the detail/CLI view; only the form's complex-input handling is the gap. Good candidate for the next devtools pass.

🤖 Generated with Claude Code

Ame and others added 4 commits June 2, 2026 16:40
Both tabs called `/api/dev/{registry,send,sessions}` — a backend that was
never implemented or mounted (there is no dev.ts route), so they 404'd into a
silent `.catch(() => {})`. Leftover UI from the retired AgentCenter / connector
stack that the cleanup never removed.

- DevPage: drop ConnectorsTab + SessionsTab (and the now-unused Section import).
- DevCategoryList / dev tab union / UrlAdopter: drop the two tabs; the default
  /dev redirect now lands on `tools`.
- Delete ui/src/api/dev.ts (devApi) and its `api.dev` namespace wiring.
- demo: drop the 3 dead /api/dev MSW handlers (version/topology/media kept).

No backend change — `/api/dev/*` never existed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Tools declare a runnable sample via `.meta({ examples: [...] })` on their
inputSchema. z.toJSONSchema surfaces it as a top-level `examples`, which both
the /api/tools detail route and the /cli manifest already return — so the
example reaches the Tools tab AND `alice <group> <verb> --help` with zero new
plumbing. The Tools tab now seeds its form from examples[0] instead of blank.

Pure metadata — examples never affect runtime (unlike .default(), which would
change execute behavior for optional fields).

Wired on two tools (equity ratios, market search) to prove the path end-to-end;
the rest get examples next.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Each data tool now declares a runnable sample via `.meta({ examples: [...] })`
on its inputSchema, so the Tools tab pre-fills and `alice <group> <verb> --help`
shows a sample. Covers thinking (calculate), analysis (calculateIndicator),
equity (profile/financials/earnings/insiders/discover), economy (all 7 FRED/BLS/
EIA), and news (glob/grep/read). (ratios + market search landed with the
mechanism commit.)

trading tools are intentionally NOT covered here — pre-filling a runnable
sample on broker mutations (placeOrder/closePosition/cancel/commit/push/sync)
is a boundary call, pending review.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ive)

18 of 19 trading tools now declare `.meta({ examples: [...] })` (listUTAs has a
zero-field schema, so it's skipped). `source` uses an 'alpaca-paper' placeholder.

Read-only tools get representative samples. Mutation tools (placeOrder /
modifyOrder / closePosition / cancelOrder / tradingCommit / tradingPush /
tradingSync) use conservative placeholder values, per the agreed boundary call
— note these stage operations; real execution still requires commit + push +
manual approval, so a stray Execute on a pre-filled form does not place an order.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openalice-demo Ready Ready Preview, Comment Jun 3, 2026 4:33am

Request Review

@luokerenx4 luokerenx4 merged commit 209437a into master Jun 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant