# dream-num/univer-workspace architecture

> Architecture diagram of the GitHub repository dream-num/univer-workspace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dream-num/univer-workspace
- Repository: https://github.com/dream-num/univer-workspace

## Overview

Univer Workspace is a shared Office workspace with Browser, Agent, and CLI entry points backed by a server that owns workspace data and permissions. The central workflow is creating or editing content, optionally in an isolated Worktree, then reviewing and merging changes. The graph preserves documented editing, collaboration, identity, blobs, issues, and automation capabilities. Relationships are limited to README statements and the sampled server composition; several feature internals were not sampled.

Main entry points: [`apps/workspace/server/src/app.ts`](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/app.ts) (Workspace Server), [`apps/workspace/web/src/app/entry.tsx`](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/app/entry.tsx) (Workspace Browser), [`apps/agent/src/client/index.tsx`](https://github.com/dream-num/univer-workspace/blob/main/apps/agent/src/client/index.tsx) (Workspace Agent), [`apps/cli/src/program.ts`](https://github.com/dream-num/univer-workspace/blob/main/apps/cli/src/program.ts) (Workspace CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User surfaces"]
  node_browser["Workspace Browser<br/>[entry.tsx]"]
  node_agent["Workspace Agent<br/>[index.tsx]"]
  node_cli["Workspace CLI<br/>[program.ts]"]
end

subgraph group_workspace["Workspace workflows"]
  node_editing["Office editing"]
  node_navigation["Spaces and content<br/>[node-browser.tsx]"]
  node_worktrees["Worktree drafts"]
  node_review["Change review"]
  node_issues["Issues<br/>[issues.service.ts]"]
end

subgraph group_server["Server services"]
  node_identity["Identity and access"]
  node_server_app["Workspace Server<br/>[app.ts]"]
  node_database[("Product data<br/>[database.ts]")]
  node_collaboration["Collaboration gateway"]
  node_blob_store[("Blob storage<br/>[blob-store.ts]")]
end

subgraph group_runtime["Content runtime"]
  node_content_api["Client content core<br/>[content-worker.ts]"]
  node_agent_plugin["Agent workspace plugin"]
  node_viewer["Embedded viewer<br/>[viewer-engine.ts]"]
end

node_human(("Human"))
node_agent_actor(("AI agent"))

node_human -->|"uses"| node_browser
node_human -->|"uses"| node_agent
node_agent_actor -->|"automates with"| node_cli
node_browser -->|"connects to"| node_server_app
node_agent -->|"connects to"| node_server_app
node_cli -->|"connects to"| node_server_app
node_browser -->|"edits through"| node_editing
node_browser -->|"organizes"| node_navigation
node_agent -->|"edits isolated drafts"| node_worktrees
node_cli -->|"supports workflows"| node_worktrees
node_worktrees -->|"presents changes for"| node_review
node_human -->|"reviews and decides"| node_review
node_server_app -->|"configures"| node_identity
node_server_app -->|"initializes"| node_database
node_server_app -->|"configures"| node_collaboration
node_server_app -->|"configures"| node_blob_store
node_server_app -->|"configures"| node_issues
node_cli -->|"loads and renders content"| node_content_api
node_agent_plugin -->|"calls workspace APIs"| node_server_app
node_agent_plugin -.->|"provides agent runtime"| node_content_api
node_agent -.->|"previews documents"| node_viewer

click node_browser "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/app/entry.tsx"
click node_agent "https://github.com/dream-num/univer-workspace/blob/main/apps/agent/src/client/index.tsx"
click node_cli "https://github.com/dream-num/univer-workspace/blob/main/apps/cli/src/program.ts"
click node_editing "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/editor/resource-editor.tsx"
click node_navigation "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/nodes/node-browser.tsx"
click node_worktrees "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/worktrees/worktrees.service.ts"
click node_review "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/worktrees/worktree-review-panel.tsx"
click node_issues "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/issues/issues.service.ts"
click node_identity "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/identity/identity.service.ts"
click node_server_app "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/app.ts"
click node_database "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/db/database.ts"
click node_collaboration "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/integrations/univer/collaboration-gateway.ts"
click node_blob_store "https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/integrations/blob/blob-store.ts"
click node_content_api "https://github.com/dream-num/univer-workspace/blob/main/packages/client-core/src/content-worker.ts"
click node_agent_plugin "https://github.com/dream-num/univer-workspace/blob/main/packages/dsh-univer-workspace-plugin/src/provider/service-provider.ts"
click node_viewer "https://github.com/dream-num/univer-workspace/blob/main/packages/dsh-univer-workspace-plugin/src/client/viewer-engine.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser,node_agent,node_cli toneBlue
class node_editing,node_navigation,node_worktrees,node_review,node_issues toneAmber
class node_identity,node_server_app,node_database,node_collaboration,node_blob_store toneMint
class node_content_api,node_agent_plugin,node_viewer toneRose
class node_human,node_agent_actor toneIndigo
```

## Components

### User surfaces

- [Workspace Browser](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/app/entry.tsx): `apps/workspace/web/src/app/entry.tsx`
- [Workspace Agent](https://github.com/dream-num/univer-workspace/blob/main/apps/agent/src/client/index.tsx): `apps/agent/src/client/index.tsx`
- [Workspace CLI](https://github.com/dream-num/univer-workspace/blob/main/apps/cli/src/program.ts): `apps/cli/src/program.ts`

### Workspace workflows

- [Office editing](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/editor/resource-editor.tsx): `apps/workspace/web/src/features/editor/resource-editor.tsx`
- [Spaces and content](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/nodes/node-browser.tsx): `apps/workspace/web/src/features/nodes/node-browser.tsx`
- [Worktree drafts](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/worktrees/worktrees.service.ts): `apps/workspace/server/src/modules/worktrees/worktrees.service.ts`
- [Change review](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/web/src/features/worktrees/worktree-review-panel.tsx): `apps/workspace/web/src/features/worktrees/worktree-review-panel.tsx`
- [Issues](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/issues/issues.service.ts): `apps/workspace/server/src/modules/issues/issues.service.ts`

### Server services

- [Identity and access](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/modules/identity/identity.service.ts): `apps/workspace/server/src/modules/identity/identity.service.ts`
- [Workspace Server](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/app.ts): `apps/workspace/server/src/app.ts`
- [Product data](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/db/database.ts): `apps/workspace/server/src/db/database.ts`
- [Collaboration gateway](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/integrations/univer/collaboration-gateway.ts): `apps/workspace/server/src/integrations/univer/collaboration-gateway.ts`
- [Blob storage](https://github.com/dream-num/univer-workspace/blob/main/apps/workspace/server/src/integrations/blob/blob-store.ts): `apps/workspace/server/src/integrations/blob/blob-store.ts`

### Content runtime

- [Client content core](https://github.com/dream-num/univer-workspace/blob/main/packages/client-core/src/content-worker.ts): `packages/client-core/src/content-worker.ts`
- [Agent workspace plugin](https://github.com/dream-num/univer-workspace/blob/main/packages/dsh-univer-workspace-plugin/src/provider/service-provider.ts): `packages/dsh-univer-workspace-plugin/src/provider/service-provider.ts`
- [Embedded viewer](https://github.com/dream-num/univer-workspace/blob/main/packages/dsh-univer-workspace-plugin/src/client/viewer-engine.ts): `packages/dsh-univer-workspace-plugin/src/client/viewer-engine.ts`

### Other components

- **Human**
- **AI agent**

## Connections

- Human → Workspace Browser: uses
- Human → Workspace Agent: uses
- AI agent → Workspace CLI: automates with
- Workspace Browser → Workspace Server: connects to
- Workspace Agent → Workspace Server: connects to
- Workspace CLI → Workspace Server: connects to
- Workspace Browser → Office editing: edits through
- Workspace Browser → Spaces and content: organizes
- Workspace Agent → Worktree drafts: edits isolated drafts
- Workspace CLI → Worktree drafts: supports workflows
- Worktree drafts → Change review: presents changes for
- Human → Change review: reviews and decides
- Workspace Server → Identity and access: configures (evidence: `apps/workspace/server/src/app.ts`)
- Workspace Server → Product data: initializes (evidence: `apps/workspace/server/src/app.ts`)
- Workspace Server → Collaboration gateway: configures (evidence: `apps/workspace/server/src/app.ts`)
- Workspace Server → Blob storage: configures (evidence: `apps/workspace/server/src/app.ts`)
- Workspace Server → Issues: configures (evidence: `apps/workspace/server/src/app.ts`)
- Workspace CLI → Client content core: loads and renders content (evidence: `apps/cli/src/program.ts`)
- Agent workspace plugin → Workspace Server: calls workspace APIs (evidence: `packages/dsh-univer-workspace-plugin/src/provider/service-provider.ts`)
- Agent workspace plugin → Client content core: provides agent runtime
- Workspace Agent → Embedded viewer: previews documents
