Skip to content

Commit 164ecf2

Browse files
committed
chore: update .gitignore to include office-map.png and remove optimistic message insertion in OfficeProvider
1 parent bddae67 commit 164ecf2

42 files changed

Lines changed: 164 additions & 164 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Agent Office configuration
22

3-
# Database (leave empty for SQLite default zero config)
3+
# Database (leave empty for SQLite default - zero config)
44
# For PostgreSQL: DATABASE_URL=postgres://user:pass@localhost:5432/agent_office
55
# DATABASE_URL=
66

7-
# Telegram Bot (optional get token from @BotFather)
7+
# Telegram Bot (optional - get token from @BotFather)
88
# TELEGRAM_BOT_TOKEN=
99

1010
# Integrations (all optional)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Summary
22

3-
<!-- What does this PR do? Keep it brief 1-3 bullet points. -->
3+
<!-- What does this PR do? Keep it brief - 1-3 bullet points. -->
44

55
## Changes
66

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Thumbs.db
2323
*.log
2424
npm-debug.log*
2525

26-
# Paid assets must be purchased separately
26+
# Paid assets - must be purchased separately
2727
assets/pixelart/Office Tileset/
2828
assets/pixelart/office-map.png
2929

CLAUDE.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## What This Is
66

7-
Agent Office is a pixel-art virtual office for AI agent teams. Agents have live presence states, sit in themed rooms, and can be managed through a retro-styled UI or Telegram bot. Early development APIs and features may change without notice.
7+
Agent Office is a pixel-art virtual office for AI agent teams. Agents have live presence states, sit in themed rooms, and can be managed through a retro-styled UI or Telegram bot. Early development - APIs and features may change without notice.
88

99
## Commands
1010

@@ -34,15 +34,15 @@ Run a single test file: `npx vitest run src/__tests__/app.test.tsx`
3434

3535
**Data flow:** `OfficeProvider` (React context) polls `GET /api/office/snapshot` every 2-3 seconds. Mutations go through provider methods → POST/PATCH/DELETE endpoints → DB or state file → next poll picks up changes.
3636

37-
**Event system:** `src/server/events.ts` EventEmitter-based pub/sub. API routes emit events, adapters (webhook, Telegram, Slack, GitHub, Linear) subscribe.
37+
**Event system:** `src/server/events.ts` - EventEmitter-based pub/sub. API routes emit events, adapters (webhook, Telegram, Slack, GitHub, Linear) subscribe.
3838

3939
### Key Files
4040

4141
| File | Role |
4242
|------|------|
43-
| `src/App.tsx` | Main UI map canvas, room overlays, agent sprites, sidebar panels, forms |
44-
| `src/office-provider.tsx` | React context polling, state management, CRUD wrappers, validation |
45-
| `src/data.ts` | Seed data agents, rooms, seats, workday policy |
43+
| `src/App.tsx` | Main UI - map canvas, room overlays, agent sprites, sidebar panels, forms |
44+
| `src/office-provider.tsx` | React context - polling, state management, CRUD wrappers, validation |
45+
| `src/data.ts` | Seed data - agents, rooms, seats, workday policy |
4646
| `src/world.ts` | Sprite definitions, animation metadata, character sets |
4747
| `src/office-state.ts` | TypeScript type definitions |
4848
| `src/server/api-routes.ts` | Shared API route handlers (pure functions) |
@@ -71,26 +71,26 @@ Run a single test file: `npx vitest run src/__tests__/app.test.tsx`
7171

7272
Shared route handlers in `src/server/api-routes.ts`, used by both dev and prod:
7373

74-
- `GET /api/health` health check (status, version, DB type, uptime)
75-
- `GET /api/office/snapshot` full state
76-
- `POST /api/office/agent` create agent
77-
- `PUT /api/office/agent/:id` full update
78-
- `PATCH /api/office/agent/:id` partial update (whitelisted fields only)
79-
- `DELETE /api/office/agent/:id` remove agent + cascade
80-
- `POST /api/office/assign` queue task
81-
- `PATCH /api/office/assignment/:id` update assignment status
82-
- `GET /api/office/assignments` query assignments with filters
83-
- `POST /api/office/activity` log activity
84-
- `POST /api/office/decision` create decision
85-
- `PATCH /api/office/decision/:id` update decision
86-
- `POST /api/office/message` send message
87-
- `GET /api/office/messages` query messages
88-
- `POST /api/office/room` create room
89-
- `PUT /api/office/room/:id` update room
90-
- `DELETE /api/office/room/:id` delete room
91-
- `POST /api/office/webhook` create webhook
92-
- `DELETE /api/office/webhook/:id` delete webhook
93-
- `PATCH /api/office/settings` update settings
74+
- `GET /api/health` - health check (status, version, DB type, uptime)
75+
- `GET /api/office/snapshot` - full state
76+
- `POST /api/office/agent` - create agent
77+
- `PUT /api/office/agent/:id` - full update
78+
- `PATCH /api/office/agent/:id` - partial update (whitelisted fields only)
79+
- `DELETE /api/office/agent/:id` - remove agent + cascade
80+
- `POST /api/office/assign` - queue task
81+
- `PATCH /api/office/assignment/:id` - update assignment status
82+
- `GET /api/office/assignments` - query assignments with filters
83+
- `POST /api/office/activity` - log activity
84+
- `POST /api/office/decision` - create decision
85+
- `PATCH /api/office/decision/:id` - update decision
86+
- `POST /api/office/message` - send message
87+
- `GET /api/office/messages` - query messages
88+
- `POST /api/office/room` - create room
89+
- `PUT /api/office/room/:id` - update room
90+
- `DELETE /api/office/room/:id` - delete room
91+
- `POST /api/office/webhook` - create webhook
92+
- `DELETE /api/office/webhook/:id` - delete webhook
93+
- `PATCH /api/office/settings` - update settings
9494

9595
### Validation Constants (in src/server/validation.ts)
9696

@@ -102,19 +102,19 @@ Shared route handlers in `src/server/api-routes.ts`, used by both dev and prod:
102102

103103
### TypeScript Configuration
104104

105-
- `tsconfig.json` Frontend (React/Vite), excludes src/db, src/server, src/bot
106-
- `tsconfig.server.json` Server modules (Node.js), includes src/db, src/server, src/bot
105+
- `tsconfig.json` - Frontend (React/Vite), excludes src/db, src/server, src/bot
106+
- `tsconfig.server.json` - Server modules (Node.js), includes src/db, src/server, src/bot
107107

108108
## Testing
109109

110110
Tests live in `src/__tests__/` (component/unit) and `tests/` (API integration). 167+ tests covering data integrity, sprites, error boundary, provider logic, UI rendering, agent CRUD, accessibility, and API validation.
111111

112112
## Code Conventions
113113

114-
- TypeScript strict mode no `any` types
114+
- TypeScript strict mode - no `any` types
115115
- Functional React with hooks only (except ErrorBoundary)
116-
- All CSS in `src/styles.css` no CSS-in-JS, uses CSS custom properties
117-
- Pixel-art aesthetic with Press Start 2P font keep retro theme consistent
116+
- All CSS in `src/styles.css` - no CSS-in-JS, uses CSS custom properties
117+
- Pixel-art aesthetic with Press Start 2P font - keep retro theme consistent
118118
- WCAG 2.1 AA accessibility: ARIA landmarks, keyboard navigation, focus indicators
119119
- Commit messages: conventional style (`fix:`, `feat:`, `test:`, etc.)
120-
- No separate linter configured TypeScript strict mode is the quality gate
120+
- No separate linter configured - TypeScript strict mode is the quality gate

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ To re-run setup: `npm run setup:force`
2424

2525
## Code Style
2626

27-
- TypeScript strict mode no `any` types
27+
- TypeScript strict mode - no `any` types
2828
- Functional React components with hooks
29-
- CSS in `src/styles.css` no CSS-in-JS
30-
- Pixel-art aesthetic keep the retro theme consistent
29+
- CSS in `src/styles.css` - no CSS-in-JS
30+
- Pixel-art aesthetic - keep the retro theme consistent
3131

3232
## Testing
3333

@@ -49,7 +49,7 @@ Use concise, descriptive messages:
4949

5050
## Pull Requests
5151

52-
- Keep PRs focused one feature or fix per PR
52+
- Keep PRs focused - one feature or fix per PR
5353
- Fill in the PR template
5454
- Ensure CI passes before requesting review
5555
- Include screenshots for UI changes
@@ -64,5 +64,5 @@ Use the [feature request template](https://github.com/fwartner/agent-office/issu
6464

6565
## Maintainer
6666

67-
**Florian Wartner** [Pixel & Process](https://pixelandprocess.de)
67+
**Florian Wartner** - [Pixel & Process](https://pixelandprocess.de)
6868
Email: [florian@wartner.io](mailto:florian@wartner.io)

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Agent Office
22

3-
A pixel-art virtual office where your AI agents live, work, and talk to each other. Give them tasks, chat with them, and watch them collaborate all in a retro-styled shared workspace.
3+
A pixel-art virtual office where your AI agents live, work, and talk to each other. Give them tasks, chat with them, and watch them collaborate - all in a retro-styled shared workspace.
44

55
> [!WARNING]
6-
> **Early Development** This project is under active development. Things will break, features are incomplete, and APIs may change without notice. If something doesn't work, it probably just hasn't been built yet. Contributions and bug reports are welcome!
6+
> **Early Development** - This project is under active development. Things will break, features are incomplete, and APIs may change without notice. If something doesn't work, it probably just hasn't been built yet. Contributions and bug reports are welcome!
77
88
[![CI](https://github.com/fwartner/agent-office/actions/workflows/ci.yml/badge.svg)](https://github.com/fwartner/agent-office/actions/workflows/ci.yml)
99
[![Docker](https://github.com/fwartner/agent-office/actions/workflows/docker.yml/badge.svg)](https://github.com/fwartner/agent-office/actions/workflows/docker.yml)
@@ -15,19 +15,19 @@ A pixel-art virtual office where your AI agents live, work, and talk to each oth
1515

1616
## Features
1717

18-
- **Pixel-art office** agents as animated sprites on a tiled map with themed rooms
19-
- **Live presence** see who's active, paused, blocked, or off hours in real time
20-
- **Chat with agents** message one agent or broadcast to all; they respond autonomously via Claude Code
21-
- **Speech bubbles** agents show what they're working on right on the map
22-
- **Task assignment** queue tasks with priority and watch agents work through them
23-
- **Auto-saved results** every task result saved to disk automatically
24-
- **Markdown everywhere** chat, tasks, results, and activity all rendered as markdown
25-
- **Telegram bot** manage agents and chat from Telegram; messages sync both ways
26-
- **Integrations** Slack, GitHub, and Linear notifications out of the box
27-
- **Configurable office hours** set timezone, working days, and hours
28-
- **Decisions & voting** propose and vote on decisions as a team
29-
- **Accessible** WCAG 2.1 AA compliant with keyboard navigation and screen reader support
30-
- **Mobile friendly** works on phones and tablets
18+
- **Pixel-art office** - agents as animated sprites on a tiled map with themed rooms
19+
- **Live presence** - see who's active, paused, blocked, or off hours in real time
20+
- **Chat with agents** - message one agent or broadcast to all; they respond autonomously via Claude Code
21+
- **Speech bubbles** - agents show what they're working on right on the map
22+
- **Task assignment** - queue tasks with priority and watch agents work through them
23+
- **Auto-saved results** - every task result saved to disk automatically
24+
- **Markdown everywhere** - chat, tasks, results, and activity all rendered as markdown
25+
- **Telegram bot** - manage agents and chat from Telegram; messages sync both ways
26+
- **Integrations** - Slack, GitHub, and Linear notifications out of the box
27+
- **Configurable office hours** - set timezone, working days, and hours
28+
- **Decisions & voting** - propose and vote on decisions as a team
29+
- **Accessible** - WCAG 2.1 AA compliant with keyboard navigation and screen reader support
30+
- **Mobile friendly** - works on phones and tablets
3131

3232
## Getting Started
3333

@@ -49,7 +49,7 @@ The map background uses the [Office Tileset by Donarg](https://donarg.itch.io/of
4949
cp "assets/pixelart/Office Tileset/Office Designs/Office Level 4.png" assets/pixelart/office-map.png
5050
```
5151

52-
The app works without it you'll just see a grid background instead.
52+
The app works without it - you'll just see a grid background instead.
5353

5454
### 3. Run
5555

@@ -115,4 +115,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
115115

116116
## Maintainer
117117

118-
**Florian Wartner** [Pixel & Process](https://pixelandprocess.de)
118+
**Florian Wartner** - [Pixel & Process](https://pixelandprocess.de)

agent-runtime.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Agent Runtime Process manager for Claude Code agent spawning.
2+
* Agent Runtime - Process manager for Claude Code agent spawning.
33
* Shared by both vite.config.ts (dev) and server.mjs (prod).
44
*/
55
import { spawn } from 'node:child_process'
@@ -71,11 +71,11 @@ export function unregisterAgent(agentId) {
7171
export function dispatchTask(agentId, assignment, callbacks) {
7272
const entry = registry.get(agentId)
7373
if (!entry) {
74-
console.warn(`[agent-runtime] Cannot dispatch agent ${agentId} not registered`)
74+
console.warn(`[agent-runtime] Cannot dispatch - agent ${agentId} not registered`)
7575
return false
7676
}
7777
if (entry.currentTask) {
78-
console.warn(`[agent-runtime] Cannot dispatch agent ${agentId} is busy with ${entry.currentTask.assignmentId}`)
78+
console.warn(`[agent-runtime] Cannot dispatch - agent ${agentId} is busy with ${entry.currentTask.assignmentId}`)
7979
return false
8080
}
8181

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "agent-office",
33
"version": "0.3.0",
4-
"description": "Pixel-art virtual office for AI agent teams live presence, room navigation, agent CRUD, and task assignment in a retro-styled shared workspace.",
4+
"description": "Pixel-art virtual office for AI agent teams - live presence, room navigation, agent CRUD, and task assignment in a retro-styled shared workspace.",
55
"type": "module",
66
"license": "MIT",
77
"author": "Florian Wartner <florian@wartner.io> (https://pixelandprocess.de)",

server.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ apiCtx.onSettingsChanged = (settings) => {
128128
}
129129

130130
// ── HTTP helpers ─────────────────────────────────────
131-
/** Returns { parsed, raw } parsed is the JSON object, raw is the string for signature verification */
131+
/** Returns { parsed, raw } - parsed is the JSON object, raw is the string for signature verification */
132132
function readBody(req) {
133133
return new Promise((resolve, reject) => {
134134
let body = ''
@@ -173,7 +173,7 @@ const server = http.createServer(async (req, res) => {
173173
return
174174
}
175175

176-
// API routes delegate to shared layer
176+
// API routes - delegate to shared layer
177177
if (url.pathname.startsWith('/api/')) {
178178
try {
179179
let parsed = null
@@ -212,7 +212,7 @@ const server = http.createServer(async (req, res) => {
212212
}
213213
}
214214

215-
// Static files assets
215+
// Static files - assets
216216
let filePath = path.join(__dirname, url.pathname)
217217
if (url.pathname.startsWith('/assets/') && isSafePath(filePath) && fs.existsSync(filePath)) {
218218
const ext = path.extname(filePath)
@@ -221,7 +221,7 @@ const server = http.createServer(async (req, res) => {
221221
return
222222
}
223223

224-
// Static files dist
224+
// Static files - dist
225225
filePath = path.join(DIST, url.pathname === '/' ? 'index.html' : url.pathname)
226226
if (isSafePath(filePath) && fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
227227
const ext = path.extname(filePath)
@@ -300,7 +300,7 @@ server.listen(PORT, '0.0.0.0', async () => {
300300

301301
// ── Graceful shutdown ────────────────────────────────
302302
function shutdown(signal) {
303-
console.log(`\n${signal} received shutting down gracefully`)
303+
console.log(`\n${signal} received - shutting down gracefully`)
304304
shutdownSSE()
305305
shutdownAll()
306306
stopBot()

setup.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22
/**
3-
* Agent Office First-run setup wizard.
3+
* Agent Office - First-run setup wizard.
44
*
55
* Walks through database backend, Telegram bot, integrations, and port.
66
* Writes .env file and initialises seed state.
@@ -62,7 +62,7 @@ function select(question, options, defaultIdx = 0) {
6262
console.log(` ${question}`)
6363
options.forEach((opt, i) => {
6464
const marker = i === defaultIdx ? `${c.cyan}>${c.reset}` : ' '
65-
console.log(` ${marker} ${c.bold}${i + 1}${c.reset}) ${opt.label}${opt.desc ? ` ${c.dim} ${opt.desc}${c.reset}` : ''}`)
65+
console.log(` ${marker} ${c.bold}${i + 1}${c.reset}) ${opt.label}${opt.desc ? ` ${c.dim}- ${opt.desc}${c.reset}` : ''}`)
6666
})
6767
rl.question(` ${c.dim}Choice [${defaultIdx + 1}]:${c.reset} `, answer => {
6868
const idx = parseInt(answer.trim()) - 1
@@ -181,14 +181,14 @@ async function main() {
181181
envVars.TELEGRAM_BOT_TOKEN = token
182182
console.log(` ${c.green}${c.reset} Telegram bot configured`)
183183
} else {
184-
console.log(` ${c.yellow}!${c.reset} No token provided bot disabled`)
184+
console.log(` ${c.yellow}!${c.reset} No token provided - bot disabled`)
185185
}
186186
}
187187

188188
// ── Step 3: Integrations ──────────────────────────
189189
step('Integrations (optional)')
190190

191-
console.log(` ${c.dim}Connect to external services. All optional skip to use later.${c.reset}`)
191+
console.log(` ${c.dim}Connect to external services. All optional - skip to use later.${c.reset}`)
192192

193193
const useSlack = await confirm('Enable Slack notifications?', false)
194194
if (useSlack) {

0 commit comments

Comments
 (0)