claude-comms 1.0.45 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/README.md +12 -13
- package/bin/claude-setup.js +3 -4
- package/package.json +6 -10
- package/src/orchestrator/installer.js +5 -63
- package/.agents/AGENTS.md +0 -61
- package/.agents/repo.md +0 -18
- package/.agents/tools/README.md +0 -45
- package/.agents/tools/agent-job/README.md +0 -208
- package/.agents/tools/agent-job/agent_job.py +0 -866
- package/.agents/tools/agent-job/agent_monitor.py +0 -575
- package/.agents/tools/agent-job/consultant_template.txt +0 -73
- package/.agents/tools/chrome-devtools/README.md +0 -101
- package/.agents/tools/chrome-devtools/browsertools.py +0 -839
- package/.agents/tools/chrome-devtools/config.json +0 -24
- package/.claude/agents/core/architect.md +0 -316
- package/.claude/agents/core/consultants/codex.md +0 -39
- package/.claude/agents/core/consultants/gemini.md +0 -39
- package/.claude/agents/core/designer.md +0 -181
- package/.claude/agents/core/engineer.md +0 -157
- package/.claude/agents/core/planner.md +0 -251
- package/.claude/agents/core/uat.md +0 -147
- package/.claude/agents/util/feedback-executor.md +0 -29
- package/.claude/agents/util/meta-agent-builder.md +0 -309
- package/.claude/agents/util/session-review.md +0 -228
- package/.claude/commands/action-feedback-item.md +0 -22
- package/.claude/commands/analyse-document.md +0 -10
- package/.claude/commands/await-feedback-orchestrator.md +0 -12
- package/.claude/commands/await-feedback.md +0 -21
- package/.claude/commands/cook.md +0 -119
- package/.claude/commands/feedback.md +0 -140
- package/.claude/commands/hello-world.md +0 -1
- package/.claude/commands/install-feedback-widget.md +0 -599
- package/.claude/commands/learn.md +0 -32
- package/.claude/commands/uat-refine.md +0 -121
- package/.claude/hooks/comms/get_unread_messages.py +0 -71
- package/.claude/hooks/comms/register_subagent.py +0 -74
- package/.claude/hooks/comms/send_message.py +0 -87
- package/.claude/hooks/comms/update_subagent_completion.py +0 -126
- package/.claude/hooks/context/session_id.py +0 -35
- package/.claude/hooks/observability/send_event.py +0 -110
- package/.claude/hooks/session-data/get_session_data.py +0 -261
- package/.claude/hooks/session-data/intercept_session_id.py +0 -69
- package/.claude/hooks/utils/server_config.py +0 -17
- package/.claude/settings.json +0 -108
- package/CLAUDE.md +0 -240
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
All notable changes to the
|
|
3
|
+
All notable changes to the `claude-comms` package will be documented in this file.
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0] - 2026-05-14
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGE
|
|
11
|
+
|
|
12
|
+
CC2 (hooks, observability server, Vue dashboard) has been retired. `npx claude-comms` now installs **only** the workflow engine client tooling (`.agents/` directory with runner, templates, and CLI).
|
|
13
|
+
|
|
14
|
+
#### Removed
|
|
15
|
+
- `.claude/hooks/` — Python hook scripts for CC2 event capture and inter-agent messaging (replaced by `.agents/tools/workflow/agent-comms.mjs`)
|
|
16
|
+
- `.claude/settings.json` — CC2 hook wiring configuration
|
|
17
|
+
- CC2 server (`apps/server/`) and dashboard (`apps/client/`) are no longer part of the system
|
|
18
|
+
|
|
19
|
+
#### What clients get now
|
|
20
|
+
- `.agents/` — workflow engine client: runner daemon, prompt templates, CLI tools, peer-comms
|
|
21
|
+
- `CLAUDE.md` — agent operating instructions
|
|
22
|
+
|
|
23
|
+
Clients that depend on CC2 hooks or the observability server should pin to `claude-comms@1.x`.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
8
27
|
## [1.0.4] - 2025-01-15
|
|
9
28
|
|
|
10
29
|
### 🚨 EMERGENCY FIX
|
package/README.md
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# claude-comms
|
|
2
2
|
|
|
3
|
-
NPX
|
|
3
|
+
NPX installer for Claude Code workflow engine client setup.
|
|
4
4
|
|
|
5
5
|
## Installation & Usage
|
|
6
6
|
|
|
7
7
|
### Quick Start
|
|
8
8
|
```bash
|
|
9
|
-
npx
|
|
9
|
+
npx claude-comms
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
### Options
|
|
13
13
|
```bash
|
|
14
14
|
# Install to specific directory
|
|
15
|
-
npx
|
|
15
|
+
npx claude-comms --dir ./my-project
|
|
16
16
|
|
|
17
17
|
# Install specific version
|
|
18
|
-
npx
|
|
18
|
+
npx claude-comms --version v1.2.0
|
|
19
19
|
|
|
20
20
|
# Force overwrite existing files
|
|
21
|
-
npx
|
|
21
|
+
npx claude-comms --force
|
|
22
22
|
|
|
23
23
|
# Skip Python/uv dependency check
|
|
24
|
-
npx
|
|
24
|
+
npx claude-comms --no-python-check
|
|
25
25
|
|
|
26
26
|
# Development mode with verbose logging
|
|
27
|
-
npx
|
|
27
|
+
npx claude-comms --dev
|
|
28
28
|
|
|
29
29
|
# Verify mode (no changes)
|
|
30
|
-
npx
|
|
30
|
+
npx claude-comms --verify
|
|
31
31
|
|
|
32
32
|
# Dry run (show what would be done)
|
|
33
|
-
npx
|
|
33
|
+
npx claude-comms --dry-run
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
## What Gets Installed
|
|
37
37
|
|
|
38
|
-
- `.
|
|
39
|
-
- `CLAUDE.md`
|
|
40
|
-
- `settings.local.json` template for local configuration
|
|
38
|
+
- `.agents/` directory with workflow runner, prompt templates, and CLI tools
|
|
39
|
+
- `CLAUDE.md` agent operating instructions
|
|
41
40
|
|
|
42
41
|
## Development
|
|
43
42
|
|
package/bin/claude-setup.js
CHANGED
|
@@ -75,10 +75,9 @@ async function main() {
|
|
|
75
75
|
|
|
76
76
|
// Show next steps
|
|
77
77
|
console.log(chalk.cyan('Next steps:'));
|
|
78
|
-
console.log(chalk.white('1.
|
|
79
|
-
console.log(chalk.white('2.
|
|
80
|
-
console.log(chalk.white('3.
|
|
81
|
-
console.log(chalk.white('4. Open your project in Claude Code'));
|
|
78
|
+
console.log(chalk.white('1. Ensure Python and uv are installed for hooks'));
|
|
79
|
+
console.log(chalk.white('2. Start the observability server (optional)'));
|
|
80
|
+
console.log(chalk.white('3. Open your project in Claude Code'));
|
|
82
81
|
console.log(chalk.cyan('\nHappy coding with Claude! 🤖\n'));
|
|
83
82
|
|
|
84
83
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-comms",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "NPX installer for Claude Code
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "NPX installer for Claude Code workflow engine client setup",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"claude-comms": "bin/claude-setup.js"
|
|
@@ -26,13 +26,12 @@
|
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
28
28
|
"claude-code",
|
|
29
|
-
"hooks",
|
|
30
|
-
"observability",
|
|
31
29
|
"npx",
|
|
32
30
|
"installer",
|
|
33
|
-
"
|
|
31
|
+
"workflow-engine",
|
|
32
|
+
"convex"
|
|
34
33
|
],
|
|
35
|
-
"author": "
|
|
34
|
+
"author": "Alex Savage (https://github.com/screwyforcepush)",
|
|
36
35
|
"license": "MIT",
|
|
37
36
|
"repository": {
|
|
38
37
|
"type": "git",
|
|
@@ -77,10 +76,7 @@
|
|
|
77
76
|
"src/",
|
|
78
77
|
"templates/",
|
|
79
78
|
"README.md",
|
|
80
|
-
"CHANGELOG.md"
|
|
81
|
-
".claude/",
|
|
82
|
-
".agents/",
|
|
83
|
-
"CLAUDE.md"
|
|
79
|
+
"CHANGELOG.md"
|
|
84
80
|
],
|
|
85
81
|
"publishConfig": {
|
|
86
82
|
"access": "public"
|
|
@@ -339,6 +339,7 @@ class Installer extends EventEmitter {
|
|
|
339
339
|
|
|
340
340
|
// Files that should not be overwritten if they exist (user customizations)
|
|
341
341
|
const preserveIfExists = [
|
|
342
|
+
{ path: '.claude/settings.local.json', fullPath: path.join(this.options.targetDir, '.claude', 'settings.local.json') },
|
|
342
343
|
{ path: '.agents/repo.md', fullPath: path.join(this.options.targetDir, '.agents', 'repo.md') },
|
|
343
344
|
{ path: '.agents/tools/chrome-devtools/config.json', fullPath: path.join(this.options.targetDir, '.agents', 'tools', 'chrome-devtools', 'config.json') }
|
|
344
345
|
];
|
|
@@ -397,67 +398,9 @@ class Installer extends EventEmitter {
|
|
|
397
398
|
this.state = InstallationState.CONFIGURING;
|
|
398
399
|
this._emitProgress('Configuring installation...', 80);
|
|
399
400
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
try {
|
|
406
|
-
// Generate settings.local.json with comprehensive defaults
|
|
407
|
-
const settingsPath = path.join(this.options.targetDir, '.claude', 'settings.local.json');
|
|
408
|
-
const defaultSettings = {
|
|
409
|
-
observability: {
|
|
410
|
-
server_url: 'http://localhost:3001',
|
|
411
|
-
enabled: true,
|
|
412
|
-
auto_start: false
|
|
413
|
-
},
|
|
414
|
-
hooks: {
|
|
415
|
-
enabled: true,
|
|
416
|
-
python_path: 'python3',
|
|
417
|
-
uv_path: 'uv',
|
|
418
|
-
timeout: 30
|
|
419
|
-
},
|
|
420
|
-
agents: {
|
|
421
|
-
max_concurrent: 10,
|
|
422
|
-
timeout: 300,
|
|
423
|
-
retry_attempts: 3
|
|
424
|
-
},
|
|
425
|
-
communication: {
|
|
426
|
-
message_retention_hours: 24,
|
|
427
|
-
broadcast_enabled: true
|
|
428
|
-
},
|
|
429
|
-
development: {
|
|
430
|
-
verbose_logging: false,
|
|
431
|
-
debug_mode: false
|
|
432
|
-
},
|
|
433
|
-
installation: {
|
|
434
|
-
date: new Date().toISOString(),
|
|
435
|
-
version: this.options.version,
|
|
436
|
-
installer_version: '1.0.0',
|
|
437
|
-
installed_via: 'npx-installer'
|
|
438
|
-
}
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
// Only create settings.local.json if it doesn't exist
|
|
442
|
-
const settingsExists = await this.validator.pathExists(settingsPath);
|
|
443
|
-
if (!settingsExists) {
|
|
444
|
-
await this.writer.writeFile(settingsPath, JSON.stringify(defaultSettings, null, 2), {
|
|
445
|
-
overwrite: false
|
|
446
|
-
});
|
|
447
|
-
this.installedFiles.push(settingsPath);
|
|
448
|
-
this.logger.info('Created settings.local.json with default configuration');
|
|
449
|
-
} else {
|
|
450
|
-
this.logger.info('settings.local.json already exists, skipping creation');
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
this.logger.info('Post-installation configuration completed');
|
|
454
|
-
|
|
455
|
-
} catch (error) {
|
|
456
|
-
throw new InstallerError(
|
|
457
|
-
`Post-installation configuration failed: ${error.message}`,
|
|
458
|
-
ErrorCode.CONFIGURATION_FAILED
|
|
459
|
-
);
|
|
460
|
-
}
|
|
401
|
+
// settings.local.json is user-owned and never generated or overwritten.
|
|
402
|
+
// All needed files come from the GitHub fetch in Phase 2.
|
|
403
|
+
this.logger.info('Post-installation configuration completed');
|
|
461
404
|
}
|
|
462
405
|
|
|
463
406
|
/**
|
|
@@ -475,8 +418,7 @@ class Installer extends EventEmitter {
|
|
|
475
418
|
const requiredPaths = [
|
|
476
419
|
path.join(this.options.targetDir, '.claude'),
|
|
477
420
|
path.join(this.options.targetDir, '.agents'),
|
|
478
|
-
path.join(this.options.targetDir, 'CLAUDE.md')
|
|
479
|
-
path.join(this.options.targetDir, '.claude', 'settings.local.json')
|
|
421
|
+
path.join(this.options.targetDir, 'CLAUDE.md')
|
|
480
422
|
];
|
|
481
423
|
|
|
482
424
|
const missingPaths = [];
|
package/.agents/AGENTS.md
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
[AGENT OPERATING PROCEDURES]
|
|
2
|
-
# AOP
|
|
3
|
-
|
|
4
|
-
[CALIBRATE]
|
|
5
|
-
Baseline your understanding of the project current state, trajectory, guidelines. ALWAYS perform each of the following to initially orient yourself for downstream allignment:
|
|
6
|
-
*Read documentation*
|
|
7
|
-
- Read specific files referenced by the user in full to understand specific context and requirements.
|
|
8
|
-
- Read project guides `docs/project/guides/`, and source-of-truth (SoT) requirement specs `docs/project/spec/`, relevant to your Assignment/Task. IMPORTANT: You will need to read multiple documents, some of which may link to other relevant documents you must read. You must allign your approach with this documentation. Read the relevant documents in full!
|
|
9
|
-
- Read relevant phase documentation from `docs/project/phases/<phase-id>/` if working at phase/WP level
|
|
10
|
-
*Explore codebase*
|
|
11
|
-
- Broad project shape/structure understanding with Bash `tree --gitignore`
|
|
12
|
-
- Search codebase multiple rounds to discover patterns, dependencies, implications. You can use `ripgrep` and `ast-grep` CLI
|
|
13
|
-
- Read code and test files, trace impact through end to end
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
[IMPLEMENT]
|
|
18
|
-
Ensure you understand the full context, trace the target change through end to end to understand every point it touches.
|
|
19
|
-
feel the edges. THINK HARD about the implications/impacts
|
|
20
|
-
- Decision: Weigh up the implementation approach options
|
|
21
|
-
|
|
22
|
-
*Decision: If you are implementing business logic, API, workflows, or user journeys: Write Tests FIRST (Red Phase):*
|
|
23
|
-
- THINK HARD about the *Testing Trophy* model for your Assignment/Task. Unit = business logic, Integration = API & workflows, E2E = critical user journeys
|
|
24
|
-
- Map each requirement, and acceptance criterion to specific test scenarios
|
|
25
|
-
- Implement Tests. ensuring that the tests cover all acceptance criteria
|
|
26
|
-
|
|
27
|
-
*Implementation (Green Phase)*:
|
|
28
|
-
- Write minimal code to meet acceptance criteria.
|
|
29
|
-
- Ensure code alligns with project guides, conventions and patterns
|
|
30
|
-
- Refactor code for clarity, performance, maintainability
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[ASSESS]
|
|
35
|
-
Evaluate the Change for a given Assignment/Task against the following criteria:
|
|
36
|
-
1. **User Intent:** PONDER the intent of the User. Was the true intent actioned, or was it missunderstood?
|
|
37
|
-
2. **Requirements Met:**
|
|
38
|
-
- Cross-reference the Change against relevant SoT requirements
|
|
39
|
-
- Verify acceptance criteria coverage and user journey completeness
|
|
40
|
-
3. **Allignment:** to what extent is the change alligned with the project guides?
|
|
41
|
-
4. **Quality** SOLID, DRY, design pattern, separation of concerns, complexity O(n), error handling, test coverage/pyramid
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
[VALIDATE]
|
|
46
|
-
Run required commands from `.agents/repo.md` — all must pass without warnings or errors:
|
|
47
|
-
- lint
|
|
48
|
-
- typecheck
|
|
49
|
-
- build
|
|
50
|
-
- test
|
|
51
|
-
|
|
52
|
-
[UAT]
|
|
53
|
-
Perform manual QA:
|
|
54
|
-
- Run `uv run .agents/tools/chrome-devtools/browsertools.py --help` to learn how to use the UAT toolkit
|
|
55
|
-
- manually exercise the impacted flows.
|
|
56
|
-
- Visually inspect any UI/UX areas touched by the change for regressions or accessibility issues.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
[/AGENT OPERATING PROCEDURES]
|
|
60
|
-
|
|
61
|
-
# Adhere to the Repository Guidelines: `.agents/repo.md`
|
package/.agents/repo.md
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# Repository Guidelines
|
|
3
|
-
VALIDATE by Running required commands — all must pass without warnings or errors:
|
|
4
|
-
- `pnpm lint`
|
|
5
|
-
- `pnpm ts:check`
|
|
6
|
-
- `pnpm test:all`
|
|
7
|
-
- `pnpm build`
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## Dev server
|
|
11
|
-
`pnpm dev | tee -a dev.log` is already running in the background. check the `dev.log` file. Avoid starting up a new instance as it will bump the port.
|
|
12
|
-
you can access the client on `http://localhost:3000/` using the UAT toolkit
|
|
13
|
-
|
|
14
|
-
## Documentation Protocol
|
|
15
|
-
Guard the doc hierarchy: specs in `docs/project/spec/` remain the source of truth (Businesslogic, data dictionary, data flows, tech guide, industry references); guides in `docs/project/guides/` capture evolving process; phase folders (`docs/project/phases/XX-Name/`) store live work packages and notes. Update whichever doc you rely on as soon as the code diverges.
|
|
16
|
-
|
|
17
|
-
## PRE Deployment
|
|
18
|
-
`vercel build --yes` must pass otherwise CI/CD will FAIL!
|
package/.agents/tools/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Agent Tools
|
|
2
|
-
|
|
3
|
-
Collection of specialized tools for agent workflows.
|
|
4
|
-
|
|
5
|
-
## Available Tools
|
|
6
|
-
|
|
7
|
-
### chrome-devtools/
|
|
8
|
-
Chrome DevTools MCP wrapper for browser automation and UAT.
|
|
9
|
-
|
|
10
|
-
**Quick start:**
|
|
11
|
-
```bash
|
|
12
|
-
uv run .agents/tools/chrome-devtools/browsertools.py daemon start
|
|
13
|
-
uv run .agents/tools/chrome-devtools/browsertools.py nav http://localhost:5173/
|
|
14
|
-
uv run .agents/tools/chrome-devtools/browsertools.py snap
|
|
15
|
-
uv run .agents/tools/chrome-devtools/browsertools.py daemon stop
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**Documentation:**
|
|
19
|
-
- [README.md](chrome-devtools/README.md) - Quick start and examples
|
|
20
|
-
- [TOOL_REFERENCE.md](chrome-devtools/TOOL_REFERENCE.md) - Complete parameter reference
|
|
21
|
-
- [CONFIG.md](chrome-devtools/CONFIG.md) - Environment configuration
|
|
22
|
-
- [COVERAGE.md](chrome-devtools/COVERAGE.md) - Tool coverage analysis
|
|
23
|
-
|
|
24
|
-
**Features:**
|
|
25
|
-
- 96% context token reduction vs native MCP
|
|
26
|
-
- Persistent state across CLI invocations
|
|
27
|
-
- Network/console debugging
|
|
28
|
-
- Configurable for any environment (local/sandbox/CI)
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Adding New Tools
|
|
33
|
-
|
|
34
|
-
When creating new agent tools:
|
|
35
|
-
|
|
36
|
-
1. Create subdirectory: `.agents/tools/<tool-name>/`
|
|
37
|
-
2. Add main script (preferably uv-based)
|
|
38
|
-
3. Add README.md with usage examples
|
|
39
|
-
4. Update this index
|
|
40
|
-
|
|
41
|
-
**Design principles:**
|
|
42
|
-
- Minimize context token usage
|
|
43
|
-
- Provide clear documentation
|
|
44
|
-
- Support non-interactive CLI usage
|
|
45
|
-
- Handle cleanup properly
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
# Agent Job Adapter
|
|
2
|
-
|
|
3
|
-
Self-contained `uv` Python scripts that turn verbose CLI agent runs (Codex, Gemini CLI) into **file-backed jobs** with stable IDs and cheap status checks.
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Spawn a new job (returns immediately)
|
|
9
|
-
uv run agent_job.py spawn --harness codex -- "your assignment here"
|
|
10
|
-
# Output: Agent running. Check status with: `uv run agent_job.py status <job_id>`
|
|
11
|
-
|
|
12
|
-
# Check job status
|
|
13
|
-
uv run agent_job.py status <job_id>
|
|
14
|
-
|
|
15
|
-
# List all jobs
|
|
16
|
-
uv run agent_job.py list
|
|
17
|
-
|
|
18
|
-
# Monitor jobs with TUI
|
|
19
|
-
uv run agent_monitor.py
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Commands
|
|
23
|
-
|
|
24
|
-
### `spawn`
|
|
25
|
-
|
|
26
|
-
Starts a new agent job with the specified harness. Returns immediately after initialization.
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
uv run agent_job.py spawn --harness <gemini|codex> -- "<assignment>"
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Output:**
|
|
33
|
-
```
|
|
34
|
-
Agent running. Check status with: `uv run agent_job.py status 019abd9d-8cb2-7e81-bae9-2a8fe5be04fa`
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### `status`
|
|
38
|
-
|
|
39
|
-
Get current status of a job with computed runtime metrics.
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
uv run agent_job.py status <job_id>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Running job output:**
|
|
46
|
-
```json
|
|
47
|
-
{
|
|
48
|
-
"job_id": "019abd9d-8cb2-7e81-bae9-2a8fe5be04fa",
|
|
49
|
-
"harness": "codex",
|
|
50
|
-
"pid": 12345,
|
|
51
|
-
"logs": "/path/to/agent.log",
|
|
52
|
-
"status": "running",
|
|
53
|
-
"status_reason": "command_execution",
|
|
54
|
-
"start_time": "2025-11-25T08:10:06.262Z",
|
|
55
|
-
"last_event_time": "2025-11-25T08:10:29.337Z",
|
|
56
|
-
"runtime_sec": 23.1,
|
|
57
|
-
"idle_sec": 4.0,
|
|
58
|
-
"operations": 18
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Completed job output:**
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"job_id": "019abd9d-8cb2-7e81-bae9-2a8fe5be04fa",
|
|
66
|
-
"harness": "codex",
|
|
67
|
-
"pid": 12345,
|
|
68
|
-
"logs": "/path/to/agent.log",
|
|
69
|
-
"status": "complete",
|
|
70
|
-
"status_reason": "completed",
|
|
71
|
-
"start_time": "2025-11-25T08:10:06.262Z",
|
|
72
|
-
"last_event_time": "2025-11-25T08:10:29.337Z",
|
|
73
|
-
"runtime_sec": 23.1,
|
|
74
|
-
"operations": 18,
|
|
75
|
-
"end_time": "2025-11-25T08:10:29.340Z",
|
|
76
|
-
"completion": {
|
|
77
|
-
"messages": ["Task completed successfully."],
|
|
78
|
-
"tokens": { "input": 7288, "output": 84, "total": 7372 },
|
|
79
|
-
"duration_ms": 13845
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### `list`
|
|
85
|
-
|
|
86
|
-
List all jobs with full status information.
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
uv run agent_job.py list
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Monitor TUI
|
|
93
|
-
|
|
94
|
-
Real-time terminal UI for monitoring agent jobs, similar to `top`.
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
uv run agent_monitor.py # Default 2s refresh
|
|
98
|
-
uv run agent_monitor.py --interval 5 # Custom refresh interval
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
**Features:**
|
|
102
|
-
- Color-coded status indicators:
|
|
103
|
-
- `●` Yellow = running
|
|
104
|
-
- `✓` Green = complete
|
|
105
|
-
- `✗` Red = error
|
|
106
|
-
- `⏱` Red = timeout
|
|
107
|
-
- Columns: Status, Harness, Job ID, Status Reason, Started, Runtime, Operations
|
|
108
|
-
- Scrollable log viewer
|
|
109
|
-
|
|
110
|
-
**Keyboard Controls:**
|
|
111
|
-
|
|
112
|
-
| Key | Action |
|
|
113
|
-
|-----|--------|
|
|
114
|
-
| `↑/↓` or `j/k` | Navigate job list |
|
|
115
|
-
| `Enter` | View job log |
|
|
116
|
-
| `r` | Refresh / reload log |
|
|
117
|
-
| `q` | Quit |
|
|
118
|
-
|
|
119
|
-
**Log View Controls:**
|
|
120
|
-
|
|
121
|
-
| Key | Action |
|
|
122
|
-
|-----|--------|
|
|
123
|
-
| `↑/↓` or `j/k` | Scroll line by line |
|
|
124
|
-
| `PgUp/PgDn` | Scroll by page |
|
|
125
|
-
| `Home/End` | Jump to start/end |
|
|
126
|
-
| `r` | Reload log file |
|
|
127
|
-
| `ESC` | Back to job list |
|
|
128
|
-
|
|
129
|
-
## Job Status
|
|
130
|
-
|
|
131
|
-
| Status | Description |
|
|
132
|
-
|--------|-------------|
|
|
133
|
-
| `running` | Job is currently executing |
|
|
134
|
-
| `complete` | Job finished successfully |
|
|
135
|
-
| `error` | Job failed (see `status_reason`) |
|
|
136
|
-
| `timeout` | Job killed due to idle timeout |
|
|
137
|
-
|
|
138
|
-
## Status Reason
|
|
139
|
-
|
|
140
|
-
The `status_reason` field shows current activity while running:
|
|
141
|
-
|
|
142
|
-
**Codex:**
|
|
143
|
-
- `initializing` - Job starting up
|
|
144
|
-
- `thinking` - Turn started
|
|
145
|
-
- `reasoning` - Agent reasoning
|
|
146
|
-
- `command_execution` - Running shell command
|
|
147
|
-
- `todo_list` - Managing todos
|
|
148
|
-
- `agent_message` - Generating response
|
|
149
|
-
- `completed` - Finished
|
|
150
|
-
|
|
151
|
-
**Gemini:**
|
|
152
|
-
- `initializing` - Job starting up
|
|
153
|
-
- `run_shell_command` - Running command
|
|
154
|
-
- `write_file` / `read_file` - File operations
|
|
155
|
-
- `write_todos` - Managing todos
|
|
156
|
-
- `responding` - Generating response
|
|
157
|
-
- `completed` - Finished
|
|
158
|
-
|
|
159
|
-
## Configuration
|
|
160
|
-
|
|
161
|
-
| Environment Variable | Default | Description |
|
|
162
|
-
|---------------------|---------|-------------|
|
|
163
|
-
| `AGENT_JOBS_ROOT` | `$TMPDIR/agent_jobs/$USER` | Root directory for job files |
|
|
164
|
-
| `IDLE_TIMEOUT_SEC` | `300` | Seconds of inactivity before killing job |
|
|
165
|
-
|
|
166
|
-
## File Structure
|
|
167
|
-
|
|
168
|
-
Each job creates a directory under `AGENT_JOBS_ROOT`:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
<jobs_root>/<job_id>/
|
|
172
|
-
status.json # Current job state (updated on each event)
|
|
173
|
-
agent.log # Raw harness output (appended in real-time)
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
## Supported Harnesses
|
|
177
|
-
|
|
178
|
-
### Codex
|
|
179
|
-
|
|
180
|
-
Uses `codex --yolo e "<assignment>" --json`
|
|
181
|
-
|
|
182
|
-
Events handled:
|
|
183
|
-
- `thread.started` - Extracts job ID (thread_id)
|
|
184
|
-
- `turn.started` - Sets status_reason to "thinking"
|
|
185
|
-
- `item.started/completed` - Updates status_reason with item type
|
|
186
|
-
- `turn.completed` - Extracts token usage
|
|
187
|
-
|
|
188
|
-
### Gemini CLI
|
|
189
|
-
|
|
190
|
-
Uses `gemini --yolo -s -m gemini-3-pro-preview --output-format stream-json "<assignment>"`
|
|
191
|
-
|
|
192
|
-
Events handled:
|
|
193
|
-
- `init` - Extracts session ID as job ID
|
|
194
|
-
- `tool_use` - Updates status_reason with tool name
|
|
195
|
-
- `message` (assistant) - Accumulates response text
|
|
196
|
-
- `result` - Extracts token stats and duration
|
|
197
|
-
|
|
198
|
-
## Babysitter Pattern
|
|
199
|
-
|
|
200
|
-
For autonomous monitoring:
|
|
201
|
-
|
|
202
|
-
1. **Spawn** the job - returns immediately with job ID
|
|
203
|
-
2. **Poll** status periodically
|
|
204
|
-
3. **React** based on status:
|
|
205
|
-
- `running` - Check `idle_sec`, continue monitoring
|
|
206
|
-
- `complete` - Read `completion.messages`
|
|
207
|
-
- `timeout` - Report idle timeout exceeded
|
|
208
|
-
- `error` - Check `status_reason` and logs
|