How apriliawanadidarso-netizen/zcode-panel works
ZCode is a VS Code sidebar chat extension for the GLM Coding Plan. A user sends a message in the webview; the extension-host panel obtains settings and an API key, adds conversation and optional file context, then calls the streaming client. Streamed output and errors return to the panel for display. Commands also open or clear the panel, attach the active file, and export chat as Markdown. The excerpts show the host-side request flow; webview messaging and file attachment are included based on documented capabilities, not fully sampled implementation.
Main entry points: panel.ts Chat panel provider · glm.ts SSE streaming client · extension.ts Extension activation · types.ts Message and chat types
Components 10
Extension host
- Extension activation
src/extension.ts
Chat experience
- Chat panel provider
src/panel.ts - Chat webview
src/panel.ts - Message and chat types
src/types.ts
Configuration and API
- Settings and API key
src/config.ts - SSE streaming client
src/glm.ts
Other components
- VS Code user
- Z.ai GLM endpoint
- VS Code editor services
- Markdown export file
Connections 12
- VS Code user → Chat webview: sends messages
README.md - Chat webview → Chat panel provider: posts events
README.md - Extension activation → Chat panel provider: registers provider
src/extension.ts - Extension activation → Chat panel provider: routes commands
src/extension.ts - Chat panel provider → Settings and API key: gets key and settings
src/panel.ts - Chat panel provider → SSE streaming client: requests completion
src/panel.ts - SSE streaming client → Z.ai GLM endpoint: streams SSE
src/glm.ts - SSE streaming client → Chat panel provider: forwards deltas
src/panel.ts - Chat panel provider → Chat webview: posts updates
src/panel.ts - Chat panel provider → VS Code editor services: reads active file
README.md - Chat panel provider → Markdown export file: writes export
src/panel.ts - Chat panel provider → Message and chat types: uses message types
src/panel.ts