# humaedihume/kantor-agent architecture

> Architecture diagram of the GitHub repository humaedihume/kantor-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/humaedihume/kantor-agent
- Repository: https://github.com/humaedihume/kantor-agent

## Overview

Kantor Agent is a local Claude Code activity viewer: its server reads real project transcripts, summarizes main-session and subagent activity, assigns subagents to team members or freelancers, and serves a 3D office and status panel to a browser. Node and PHP are alternative server implementations. README describes the launcher, polling, transcript privacy, UI capabilities, and optional tunnel; several implementation details—especially browser rendering and Node server routing—were not excerpted, so those links are documented rather than inferred from names.

Main entry points: [`skills/kantor-agent/runtime/bin/serve-node.mjs`](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/bin/serve-node.mjs) (Node HTTP server), [`skills/kantor-agent/runtime/public/index.php`](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/public/index.php) (PHP HTTP entry), [`skills/kantor-agent/runtime/lib/node/transcripts.mjs`](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/transcripts.mjs) (Transcript scanner), [`skills/kantor-agent/runtime/lib/php/Transcripts.php`](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Transcripts.php) (PHP transcript scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and configuration"]
  node_launcher["Command launcher<br/>[kantor.sh]"]
  node_skill["Agent skill<br/>[SKILL.md]"]
  node_defaults["Default settings<br/>[defaults.json]"]
  node_nodeconfig["Node configuration<br/>[config.mjs]"]
  node_phpconfig["PHP configuration<br/>[Config.php]"]
end

subgraph group_ingest["Transcript processing"]
  node_transcripts["Transcript scanner<br/>[transcripts.mjs]"]
  node_phptranscripts["PHP transcript scanner<br/>[Transcripts.php]"]
  node_transcriptfiles["Claude transcripts"]
  node_cache[("Summary cache")]
  node_nodeutil["Node text utilities<br/>[util.mjs]"]
  node_phputil["PHP text utilities<br/>[Util.php]"]
end

subgraph group_domain["Activity and assignment"]
  node_nodeoffice["Node activity model<br/>[office.mjs]"]
  node_phpoffice["PHP activity model<br/>[Office.php]"]
end

subgraph group_serve["HTTP and presentation"]
  node_nodeapi["Node HTTP server<br/>[serve-node.mjs]"]
  node_phpapi["PHP HTTP entry<br/>[index.php]"]
  node_httpsecurity["PHP HTTP safeguards<br/>[Http.php]"]
  node_page["Office page<br/>[page.html]"]
  node_browserjs["3D office and panel<br/>[kantor.js]"]
end

node_user(("Claude Code user"))
node_browser(("User browser"))
node_tunnel["Cloudflared tunnel"]

node_user -->|"invokes command"| node_skill
node_skill -->|"starts runtime"| node_launcher
node_launcher -->|"selects Node"| node_nodeapi
node_launcher -->|"selects PHP"| node_phpapi
node_nodeconfig -->|"loads defaults"| node_defaults
node_phpconfig -->|"loads defaults"| node_defaults
node_nodeconfig -->|"uses helpers"| node_nodeutil
node_phpconfig -->|"uses helpers"| node_phputil
node_transcripts -->|"reads summaries"| node_transcriptfiles
node_phptranscripts -->|"reads summaries"| node_transcriptfiles
node_transcripts -->|"stores incremental state"| node_cache
node_phptranscripts -->|"stores incremental state"| node_cache
node_transcripts -->|"uses helpers"| node_nodeutil
node_phptranscripts -->|"uses helpers"| node_phputil
node_nodeoffice -->|"scans activity"| node_transcripts
node_phpoffice -->|"scans activity"| node_phptranscripts
node_nodeoffice -->|"uses helpers"| node_nodeutil
node_phpoffice -->|"uses helpers"| node_phputil
node_nodeapi -->|"builds state"| node_nodeoffice
node_nodeapi -.->|"loads settings"| node_nodeconfig
node_phpapi -->|"builds state"| node_phpoffice
node_phpapi -->|"loads settings"| node_phpconfig
node_phpapi -->|"checks host"| node_httpsecurity
node_nodeapi -->|"serves page"| node_page
node_phpapi -->|"serves page"| node_page
node_browser -->|"polls state"| node_nodeapi
node_browser -->|"polls state"| node_phpapi
node_page -.->|"loads interface"| node_browserjs
node_nodeapi -.->|"exposes optionally"| node_tunnel

click node_launcher "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/bin/kantor.sh"
click node_skill "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/SKILL.md"
click node_defaults "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/defaults.json"
click node_nodeconfig "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/config.mjs"
click node_phpconfig "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Config.php"
click node_transcripts "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/transcripts.mjs"
click node_phptranscripts "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Transcripts.php"
click node_nodeutil "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/util.mjs"
click node_phputil "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Util.php"
click node_nodeoffice "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/office.mjs"
click node_phpoffice "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Office.php"
click node_nodeapi "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/bin/serve-node.mjs"
click node_phpapi "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/public/index.php"
click node_httpsecurity "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Http.php"
click node_page "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/views/page.html"
click node_browserjs "https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/public/assets/kantor.js"

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_launcher,node_skill,node_defaults,node_nodeconfig,node_phpconfig,node_user,node_browser toneBlue
class node_transcripts,node_phptranscripts,node_transcriptfiles,node_cache,node_nodeutil,node_phputil toneAmber
class node_nodeoffice,node_phpoffice toneMint
class node_nodeapi,node_phpapi,node_httpsecurity,node_page,node_browserjs toneRose
class node_tunnel toneIndigo
```

## Components

### Launch and configuration

- [Command launcher](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/bin/kantor.sh): `skills/kantor-agent/runtime/bin/kantor.sh`
- [Agent skill](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/SKILL.md): `skills/kantor-agent/SKILL.md`
- [Default settings](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/defaults.json): `skills/kantor-agent/runtime/defaults.json`
- [Node configuration](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/config.mjs): `skills/kantor-agent/runtime/lib/node/config.mjs`
- [PHP configuration](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Config.php): `skills/kantor-agent/runtime/lib/php/Config.php`

### Transcript processing

- [Transcript scanner](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/transcripts.mjs): `skills/kantor-agent/runtime/lib/node/transcripts.mjs`
- [PHP transcript scanner](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Transcripts.php): `skills/kantor-agent/runtime/lib/php/Transcripts.php`
- **Claude transcripts**
- **Summary cache**
- [Node text utilities](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/util.mjs): `skills/kantor-agent/runtime/lib/node/util.mjs`
- [PHP text utilities](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Util.php): `skills/kantor-agent/runtime/lib/php/Util.php`

### Activity and assignment

- [Node activity model](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/node/office.mjs): `skills/kantor-agent/runtime/lib/node/office.mjs`
- [PHP activity model](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Office.php): `skills/kantor-agent/runtime/lib/php/Office.php`

### HTTP and presentation

- [Node HTTP server](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/bin/serve-node.mjs): `skills/kantor-agent/runtime/bin/serve-node.mjs`
- [PHP HTTP entry](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/public/index.php): `skills/kantor-agent/runtime/public/index.php`
- [PHP HTTP safeguards](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/lib/php/Http.php): `skills/kantor-agent/runtime/lib/php/Http.php`
- [Office page](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/views/page.html): `skills/kantor-agent/runtime/views/page.html`
- [3D office and panel](https://github.com/humaedihume/kantor-agent/blob/main/skills/kantor-agent/runtime/public/assets/kantor.js): `skills/kantor-agent/runtime/public/assets/kantor.js`

### Other components

- **Claude Code user**
- **User browser**
- **Cloudflared tunnel**

## Connections

- Claude Code user → Agent skill: invokes command (evidence: `README.md`)
- Agent skill → Command launcher: starts runtime (evidence: `README.md`)
- Command launcher → Node HTTP server: selects Node (evidence: `README.md`)
- Command launcher → PHP HTTP entry: selects PHP (evidence: `README.md`)
- Node configuration → Default settings: loads defaults (evidence: `skills/kantor-agent/runtime/lib/node/config.mjs`)
- PHP configuration → Default settings: loads defaults (evidence: `skills/kantor-agent/runtime/lib/php/Config.php`)
- Node configuration → Node text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/node/config.mjs`)
- PHP configuration → PHP text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/php/Config.php`)
- Transcript scanner → Claude transcripts: reads summaries (evidence: `README.md`)
- PHP transcript scanner → Claude transcripts: reads summaries (evidence: `README.md`)
- Transcript scanner → Summary cache: stores incremental state (evidence: `skills/kantor-agent/runtime/lib/node/transcripts.mjs`)
- PHP transcript scanner → Summary cache: stores incremental state (evidence: `skills/kantor-agent/runtime/lib/php/Transcripts.php`)
- Transcript scanner → Node text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/node/transcripts.mjs`)
- PHP transcript scanner → PHP text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/php/Transcripts.php`)
- Node activity model → Transcript scanner: scans activity (evidence: `skills/kantor-agent/runtime/lib/node/office.mjs`)
- PHP activity model → PHP transcript scanner: scans activity (evidence: `skills/kantor-agent/runtime/lib/php/Office.php`)
- Node activity model → Node text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/node/office.mjs`)
- PHP activity model → PHP text utilities: uses helpers (evidence: `skills/kantor-agent/runtime/lib/php/Office.php`)
- Node HTTP server → Node activity model: builds state (evidence: `README.md`)
- Node HTTP server → Node configuration: loads settings
- PHP HTTP entry → PHP activity model: builds state (evidence: `skills/kantor-agent/runtime/public/index.php`)
- PHP HTTP entry → PHP configuration: loads settings (evidence: `skills/kantor-agent/runtime/public/index.php`)
- PHP HTTP entry → PHP HTTP safeguards: checks host (evidence: `skills/kantor-agent/runtime/public/index.php`)
- Node HTTP server → Office page: serves page (evidence: `README.md`)
- PHP HTTP entry → Office page: serves page (evidence: `README.md`)
- User browser → Node HTTP server: polls state (evidence: `README.md`)
- User browser → PHP HTTP entry: polls state (evidence: `README.md`)
- Office page → 3D office and panel: loads interface
- Node HTTP server → Cloudflared tunnel: exposes optionally (evidence: `README.md`)
