Debug Architecture Image Preview

The Code Mode tool catalog has changed. This catalog supersedes the previous Code Mode tool catalog.
Code Mode
The tools listed below cannot be called directly: they only work as JavaScript inside the execute tool. Every other tool you have is a normal tool call: call it directly, never inside execute.
The catalog is complete. Do not guess tool names.
Code Mode tools (call only inside execute)
- opencode (8 tools) // Tools for managing OpenCode itself, such as working with sessions and worktrees, searching the available models, and reading MCP resources.
- tools.opencode.list_mcp_resources({ /** MCP server name as configured. Omit to list every server. */ server?: string, }): Promise<{ resources: Array<{ server: string, name: string, uri: string, description?: string, mimeType?: string, }>, templates: Array<{ server: string, name: string, uriTemplate: string, description?: string, mimeType?: string, }>, }> // List documents, records, and other data exposed by MCP servers. Use this when the user refers to something that is no...
- tools.opencode.models({ /** Text to search for in model names and IDs. / query?: string, /* Provider ID or name to filter by. Try your own provider first. / provider?: string, /*
- Which kind of model to list. Defaults to "chat".
- "chat": a language model (LLM). Powers sessions, agents and subagents, and can call tools.
- "image": generates or edits images from a prompt. It can't chat or call tools. / type?: "chat" | "image", /* Include older versions of each model family. By default only the newest version is listed. / all?: boolean, /* Maximum number of models to return. Defaults to 20. @integer @minimum 1 @maximum 100 / limit?: number, /* Number of models to skip, for paging through results. @integer @minimum 0 / offset?: number, }): Promise<{ /* Matching models grouped by provider. Your own provider comes first. / providers: Array<{ id: string, name: string, /* Newest first. / models: Array<{ /* providerID/modelID / id: string, name: string, /* Release date as a Unix timestamp in milliseconds, or 0 when unknown. / released: number, variants: Array<string>, /* Pricing in USD per million tokens. / cost: Array<{ tier?: { type: "context", /* @integer / size: number, }, input: number, output: number, cache: { read: number, write: number, }, }>, status: "alpha" | "beta" | "deprecated" | "active", }>, }>, /* Number of matching models across all pages. @integer / total: number, /* Offset of the next page, or null on the last page. */ next: number | null, }> // Search the models available to use. Use this to turn a model name the user mentions into an exact reference for a too...
- tools.opencode.read_mcp_resource({ /** The server field of the discovered resource. / server: string, /* Exact resource URI from discovery, an expanded uriTemplate, or the user. */ uri: string, }): Promise<{ server: string, uri: string, contents: Array<{ type: "text", uri: string, text: string, mimeType?: string, } | { type: "blob", uri: string, blob: string, mimeType?: string, }>, }> // Read one MCP resource by server and URI. Not for local files. Always return the full contents rather than slicing or ...
- tools.opencode.session_move({ /** Omit to move the current session. @pattern ^ses / sessionID?: string, /* Destination directory, relative to the target session's directory or absolute. Supports ~. @minLength 1 / directory: string, }): Promise<{ /* @pattern ^ses */ sessionID: string, directory: string, }> // Move a session to another directory, or omit sessionID to move the current session. The current session moves at the ...
- tools.opencode.session_rename({ /** Omit to rename the current session. @pattern ^ses / sessionID?: string, /* New session title. @minLength 1 / title: string, }): Promise<{ /* @pattern ^ses */ sessionID: string, title: string, }> // Rename a session, or omit sessionID to rename the current session. Use a short, specific title that summarizes the wo...
- tools.opencode.worktree_create({ name: string, }): Promise<{ directory: string, }> // Create a named worktree. Returns its directory.
- tools.opencode.worktree_list(): Promise<{ worktrees: Array<{ directory: string, strategy?: string, }>, }> // List a repository's worktrees.
- tools.opencode.worktree_remove({ /** Absolute path of the worktree to remove. @minLength 1 / directory: string, /* Discard modified and untracked files. Only set this when the user has confirmed forced removal. */ force?: boolean, }): Promise<{ directory: string, removed: boolean, }> // Remove a worktree. The repository location selects configuration; directory identifies the worktree to remove.
The following skill IDs are no longer available and must not be used: browser.
Done.
Root cause: DEV.to’s image proxy does not transcode SVG — it labels the SVG bytes as image/webp, so the browser shows a broken image. The repository already had a rasterizer (npm run assets:architecture) for exactly this; the PNG was regenerated from the latest SVG and the write-up now links to it.
Changes made:
docs/WRITEUP.md: switched the architecture image from.svgto.pngand improved the alt text to match the README/technical docs.- Regenerated
docs/assets/architecture.pngfrom the updateddocs/assets/architecture.svg. - Added safe image support to the shared Markdown renderer (
src/shared/markdown.ts+src/web/components/Markdown.tsx) soimages render as<img>while raw HTML<img>stays escaped and unsafe protocols are stripped.
Validation: npm run typecheck, npm test (218 pass), and npm run build all pass.