overlapdev 0.0.1 → 1.1.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/LICENSE +21 -0
- package/README.md +169 -2
- package/bin/run.js +26 -0
- package/package.json +30 -1
- package/scripts/postinstall.js +112 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Overlap Code
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,2 +1,169 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# Overlap Tracer
|
|
2
|
+
|
|
3
|
+
[](https://github.com/overlapcode/overlap-tracer/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/overlapcode/overlap-tracer/actions/workflows/release.yml)
|
|
5
|
+
[](https://www.npmjs.com/package/overlapdev)
|
|
6
|
+
[](https://github.com/overlapcode/overlap-tracer/releases/latest)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
A lightweight background daemon that watches coding agent sessions (Claude Code, with more agents coming) and forwards activity signals to your team's [Overlap](https://overlap.dev) instance.
|
|
10
|
+
|
|
11
|
+
## What It Does
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
Developer uses Claude Code → writes JSONL session logs
|
|
15
|
+
↓
|
|
16
|
+
Overlap tracer watches files
|
|
17
|
+
↓
|
|
18
|
+
Parses signals (session lifecycle,
|
|
19
|
+
file ops, prompts, costs)
|
|
20
|
+
↓
|
|
21
|
+
Batches & sends to your team's
|
|
22
|
+
Overlap dashboard
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The tracer extracts **signals, not code**. File contents, assistant responses, and thinking blocks never leave your machine. See [Privacy](#privacy) for the full breakdown.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Recommended — downloads the right binary for your OS
|
|
31
|
+
curl -fsSL https://overlap.dev/install.sh | sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or via npm:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g overlapdev
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or download the binary directly from [GitHub Releases](https://github.com/overlapcode/overlap-tracer/releases/latest).
|
|
41
|
+
|
|
42
|
+
### Supported Platforms
|
|
43
|
+
|
|
44
|
+
| Platform | Architecture | Binary |
|
|
45
|
+
|----------|-------------|--------|
|
|
46
|
+
| macOS | Apple Silicon (arm64) | `overlap-darwin-arm64` |
|
|
47
|
+
| macOS | Intel (x64) | `overlap-darwin-x64` |
|
|
48
|
+
| Linux | x64 | `overlap-linux-x64` |
|
|
49
|
+
| Linux | arm64 | `overlap-linux-arm64` |
|
|
50
|
+
| Windows | x64 | `overlap-windows-x64.exe` |
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Join your team (your admin gives you the URL + token)
|
|
56
|
+
overlap join
|
|
57
|
+
|
|
58
|
+
# Check status
|
|
59
|
+
overlap status
|
|
60
|
+
|
|
61
|
+
# That's it — sessions are tracked automatically
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
overlap join # Join a team (prompts for instance URL + token)
|
|
68
|
+
overlap check # Check for team overlaps (used by Claude Code hook)
|
|
69
|
+
overlap status # Show tracer status, teams, and tracked repos
|
|
70
|
+
overlap leave # Leave a team
|
|
71
|
+
overlap start # Start the tracer daemon
|
|
72
|
+
overlap stop # Stop the tracer daemon
|
|
73
|
+
overlap restart # Restart the tracer daemon
|
|
74
|
+
overlap debug # Print parsed events to stdout (no sending)
|
|
75
|
+
overlap uninstall # Stop daemon, remove service, remove all config
|
|
76
|
+
overlap version # Show version
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## How It Works
|
|
80
|
+
|
|
81
|
+
1. **You run `overlap join`** — enter your team's Overlap instance URL and the token your admin gave you. The tracer verifies the token, fetches your team's repo list, starts the background daemon, and registers it as a startup service.
|
|
82
|
+
|
|
83
|
+
2. **The daemon watches `~/.claude/projects/`** for JSONL session files. When you start a Claude Code session in a repo that matches your team's registered repos, the tracer starts tailing the session file.
|
|
84
|
+
|
|
85
|
+
3. **Events are extracted, enriched, and batched** — session starts, file operations (with line ranges and function names), prompts, and session ends are parsed from JSONL lines, batched (every 2s or 50 events), and sent to your team's Overlap instance via `POST /api/v1/ingest`.
|
|
86
|
+
|
|
87
|
+
4. **The daemon polls for team state** — every 30 seconds, the daemon fetches active sessions from your team's instance and caches them locally at `~/.overlap/team-state.json`. This powers the real-time coordination hook.
|
|
88
|
+
|
|
89
|
+
5. **The daemon survives restarts** — byte offsets are persisted to `~/.overlap/state.json`. If the daemon crashes or your machine reboots, it picks up exactly where it left off. No data lost, no duplicates.
|
|
90
|
+
|
|
91
|
+
## Real-Time Coordination
|
|
92
|
+
|
|
93
|
+
When you run `overlap join` in a project directory, the tracer sets up Claude Code hooks and commands:
|
|
94
|
+
|
|
95
|
+
- **PreToolUse hook** — before Claude Code edits a file, `overlap check` reads the local team-state cache and warns if a teammate is working on the same region. The warning includes the teammate's name, a link to their session, and their session summary.
|
|
96
|
+
- **`/project:overlap-check`** — a slash command to manually check for overlaps at any point during a session.
|
|
97
|
+
- **`/project:overlap-context`** — loads what your team is currently working on as context for the session.
|
|
98
|
+
|
|
99
|
+
The hook is non-blocking: if overlap isn't installed or the cache is stale, it silently exits. Safe to commit `.claude/` to your repo — teammates without overlap installed are unaffected.
|
|
100
|
+
|
|
101
|
+
## Multi-Team Support
|
|
102
|
+
|
|
103
|
+
You can join multiple teams. The daemon matches sessions against all teams' repo lists and routes events accordingly.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
overlap join # Join first team
|
|
107
|
+
overlap join # Join second team — daemon reloads automatically
|
|
108
|
+
overlap status # Shows both teams and their repos
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Agent Support
|
|
112
|
+
|
|
113
|
+
| Agent | Status | `agent_type` |
|
|
114
|
+
|-------|--------|-------------|
|
|
115
|
+
| Claude Code | Supported | `claude_code` |
|
|
116
|
+
| Codex CLI | Planned | `codex` |
|
|
117
|
+
| Gemini CLI | Planned | `gemini_cli` |
|
|
118
|
+
|
|
119
|
+
The tracer is built on an agent adapter system — each agent gets its own parser. Adding a new agent means implementing one interface, no changes to the server or existing code.
|
|
120
|
+
|
|
121
|
+
## Privacy
|
|
122
|
+
|
|
123
|
+
| Sent to your team's Overlap instance | Stays on your machine |
|
|
124
|
+
|--------------------------------------|----------------------|
|
|
125
|
+
| Session ID, timestamps | Assistant response text |
|
|
126
|
+
| Agent type, version | File contents |
|
|
127
|
+
| File paths (relative, stripped of home dir) | Tool outputs / results |
|
|
128
|
+
| Tool names (Write, Edit, Bash, etc.) | Thinking blocks |
|
|
129
|
+
| User prompts | Full absolute paths |
|
|
130
|
+
| Git branch name | API keys, env vars |
|
|
131
|
+
| Cost, tokens, duration | System environment variables |
|
|
132
|
+
| Model name | |
|
|
133
|
+
| Bash commands | |
|
|
134
|
+
| Hostname | |
|
|
135
|
+
|
|
136
|
+
## Configuration
|
|
137
|
+
|
|
138
|
+
All tracer data lives in `~/.overlap/`:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
~/.overlap/
|
|
142
|
+
├── config.json # Teams, tokens, tracer settings
|
|
143
|
+
├── state.json # Byte offsets per session file
|
|
144
|
+
├── cache.json # Cached repo lists + git remote lookups
|
|
145
|
+
├── logs/
|
|
146
|
+
│ ├── tracer.log
|
|
147
|
+
│ └── tracer.error.log
|
|
148
|
+
└── tracer.pid # PID of running daemon
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Building from Source
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Install dependencies
|
|
155
|
+
bun install
|
|
156
|
+
|
|
157
|
+
# Run in dev mode
|
|
158
|
+
bun run dev
|
|
159
|
+
|
|
160
|
+
# Run tests
|
|
161
|
+
bun test
|
|
162
|
+
|
|
163
|
+
# Build binaries for all platforms
|
|
164
|
+
bash scripts/build-all.sh
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT
|
package/bin/run.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* npm wrapper — runs the pre-compiled overlap binary.
|
|
4
|
+
* The binary is downloaded during postinstall.
|
|
5
|
+
*/
|
|
6
|
+
import { execFileSync } from "child_process";
|
|
7
|
+
import { join, dirname } from "path";
|
|
8
|
+
import { existsSync } from "fs";
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
13
|
+
const binaryPath = join(__dirname, `overlap${ext}`);
|
|
14
|
+
|
|
15
|
+
if (!existsSync(binaryPath)) {
|
|
16
|
+
console.error("Error: Overlap binary not found.");
|
|
17
|
+
console.error("Try reinstalling: npm install -g overlapdev");
|
|
18
|
+
console.error("Or download directly: curl -fsSL https://overlap.dev/install.sh | sh");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
execFileSync(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
24
|
+
} catch (err) {
|
|
25
|
+
process.exit(err.status ?? 1);
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "overlapdev",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Overlap - See what your team is building with coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"overlap": "./bin/run.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node scripts/postinstall.js",
|
|
11
|
+
"build": "bun build src/index.ts --outdir dist --target node",
|
|
12
|
+
"build:binary": "bash scripts/build-all.sh",
|
|
13
|
+
"dev": "bun run src/index.ts",
|
|
14
|
+
"test": "bun test"
|
|
15
|
+
},
|
|
16
|
+
"keywords": ["coding-agents", "claude-code", "team", "collaboration", "activity", "overlap"],
|
|
17
|
+
"author": "overlapcode",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/overlapcode/overlap-tracer"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin/",
|
|
25
|
+
"scripts/postinstall.js"
|
|
26
|
+
],
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"bun-types": "^1.3.9"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Postinstall script for the overlapdev npm package.
|
|
4
|
+
* Downloads the correct pre-compiled binary for the user's platform.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, mkdirSync, chmodSync, createWriteStream } from "fs";
|
|
7
|
+
import { join, dirname } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import https from "https";
|
|
10
|
+
|
|
11
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const REPO = "overlapcode/overlap-tracer";
|
|
13
|
+
const BIN_DIR = join(__dirname, "..", "bin");
|
|
14
|
+
const BINARY_PATH = join(BIN_DIR, process.platform === "win32" ? "overlap.exe" : "overlap");
|
|
15
|
+
|
|
16
|
+
function getPlatformTarget() {
|
|
17
|
+
const platform = process.platform;
|
|
18
|
+
const arch = process.arch;
|
|
19
|
+
|
|
20
|
+
const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
21
|
+
const archMap = { x64: "x64", arm64: "arm64" };
|
|
22
|
+
|
|
23
|
+
const p = platformMap[platform];
|
|
24
|
+
const a = archMap[arch];
|
|
25
|
+
|
|
26
|
+
if (!p || !a) {
|
|
27
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
32
|
+
return `overlap-${p}-${a}${ext}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function httpsGet(url) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
https.get(url, (res) => {
|
|
38
|
+
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
39
|
+
// Follow redirect
|
|
40
|
+
return httpsGet(res.headers.location).then(resolve, reject);
|
|
41
|
+
}
|
|
42
|
+
if (res.statusCode !== 200) {
|
|
43
|
+
reject(new Error(`HTTP ${res.statusCode} for ${url}`));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
resolve(res);
|
|
47
|
+
}).on("error", reject);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function getLatestVersion() {
|
|
52
|
+
const res = await httpsGet(`https://api.github.com/repos/${REPO}/releases/latest`);
|
|
53
|
+
return new Promise((resolve, reject) => {
|
|
54
|
+
let data = "";
|
|
55
|
+
res.on("data", (chunk) => (data += chunk));
|
|
56
|
+
res.on("end", () => {
|
|
57
|
+
try {
|
|
58
|
+
const json = JSON.parse(data);
|
|
59
|
+
resolve(json.tag_name);
|
|
60
|
+
} catch (e) {
|
|
61
|
+
reject(e);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
res.on("error", reject);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function download(url, dest) {
|
|
69
|
+
const res = await httpsGet(url);
|
|
70
|
+
return new Promise((resolve, reject) => {
|
|
71
|
+
const file = createWriteStream(dest);
|
|
72
|
+
res.pipe(file);
|
|
73
|
+
file.on("finish", () => { file.close(); resolve(); });
|
|
74
|
+
file.on("error", reject);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function main() {
|
|
79
|
+
// Skip if binary already exists (e.g., CI or manual install)
|
|
80
|
+
if (existsSync(BINARY_PATH)) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const target = getPlatformTarget();
|
|
85
|
+
console.log(`[overlap] Downloading binary for ${process.platform}-${process.arch}...`);
|
|
86
|
+
|
|
87
|
+
let version;
|
|
88
|
+
try {
|
|
89
|
+
version = await getLatestVersion();
|
|
90
|
+
} catch {
|
|
91
|
+
console.warn("[overlap] Could not determine latest version. Skipping binary download.");
|
|
92
|
+
console.warn("[overlap] You can download manually from: https://github.com/overlapcode/overlap-tracer/releases");
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const url = `https://github.com/${REPO}/releases/download/${version}/${target}`;
|
|
97
|
+
|
|
98
|
+
mkdirSync(BIN_DIR, { recursive: true });
|
|
99
|
+
|
|
100
|
+
try {
|
|
101
|
+
await download(url, BINARY_PATH);
|
|
102
|
+
if (process.platform !== "win32") {
|
|
103
|
+
chmodSync(BINARY_PATH, 0o755);
|
|
104
|
+
}
|
|
105
|
+
console.log(`[overlap] ✓ Installed ${target} (${version})`);
|
|
106
|
+
} catch (err) {
|
|
107
|
+
console.warn(`[overlap] Binary download failed: ${err.message}`);
|
|
108
|
+
console.warn(`[overlap] Download manually from: https://github.com/${REPO}/releases/tag/${version}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
main();
|