overlapdev 0.0.1 → 1.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/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,143 @@
1
- # overlapdev
2
- See https://overlap.dev
1
+ # Overlap Tracer
2
+
3
+ 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.
4
+
5
+ ## What It Does
6
+
7
+ ```
8
+ Developer uses Claude Code → writes JSONL session logs
9
+
10
+ Overlap tracer watches files
11
+
12
+ Parses signals (session lifecycle,
13
+ file ops, prompts, costs)
14
+
15
+ Batches & sends to your team's
16
+ Overlap dashboard
17
+ ```
18
+
19
+ The tracer extracts **signals, not code**. File contents, assistant responses, and thinking blocks never leave your machine. See [Privacy](#privacy) for the full breakdown.
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ curl -fsSL https://overlap.dev/install.sh | sh
25
+ ```
26
+
27
+ Or download the binary for your platform from [GitHub Releases](https://github.com/overlapcode/overlap-tracer/releases/latest).
28
+
29
+ ### Supported Platforms
30
+
31
+ | Platform | Architecture | Binary |
32
+ |----------|-------------|--------|
33
+ | macOS | Apple Silicon (arm64) | `overlap-darwin-arm64` |
34
+ | macOS | Intel (x64) | `overlap-darwin-x64` |
35
+ | Linux | x64 | `overlap-linux-x64` |
36
+ | Linux | arm64 | `overlap-linux-arm64` |
37
+ | Windows | x64 | `overlap-windows-x64.exe` |
38
+
39
+ ## Quick Start
40
+
41
+ ```bash
42
+ # Join your team (your admin gives you the URL + token)
43
+ overlap join
44
+
45
+ # Check status
46
+ overlap status
47
+
48
+ # That's it — sessions are tracked automatically
49
+ ```
50
+
51
+ ## Commands
52
+
53
+ ```bash
54
+ overlap join # Join a team (prompts for instance URL + token)
55
+ overlap status # Show tracer status, teams, and tracked repos
56
+ overlap leave # Leave a team
57
+ overlap start # Start the tracer daemon
58
+ overlap stop # Stop the tracer daemon
59
+ overlap restart # Restart the tracer daemon
60
+ overlap debug # Print parsed events to stdout (no sending)
61
+ overlap uninstall # Stop daemon, remove service, remove all config
62
+ overlap version # Show version
63
+ ```
64
+
65
+ ## How It Works
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ 3. **Events are extracted and batched** — session starts, file operations, 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`.
72
+
73
+ 4. **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.
74
+
75
+ ## Multi-Team Support
76
+
77
+ You can join multiple teams. The daemon matches sessions against all teams' repo lists and routes events accordingly.
78
+
79
+ ```bash
80
+ overlap join # Join first team
81
+ overlap join # Join second team — daemon reloads automatically
82
+ overlap status # Shows both teams and their repos
83
+ ```
84
+
85
+ ## Agent Support
86
+
87
+ | Agent | Status | `agent_type` |
88
+ |-------|--------|-------------|
89
+ | Claude Code | Supported | `claude_code` |
90
+ | Codex CLI | Planned | `codex` |
91
+ | Gemini CLI | Planned | `gemini_cli` |
92
+
93
+ 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.
94
+
95
+ ## Privacy
96
+
97
+ | Sent to your team's Overlap instance | Stays on your machine |
98
+ |--------------------------------------|----------------------|
99
+ | Session ID, timestamps | Assistant response text |
100
+ | Agent type, version | File contents |
101
+ | File paths (relative, stripped of home dir) | Tool outputs / results |
102
+ | Tool names (Write, Edit, Bash, etc.) | Thinking blocks |
103
+ | User prompts | Full absolute paths |
104
+ | Git branch name | API keys, env vars |
105
+ | Cost, tokens, duration | System environment variables |
106
+ | Model name | |
107
+ | Bash commands | |
108
+ | Hostname | |
109
+
110
+ ## Configuration
111
+
112
+ All tracer data lives in `~/.overlap/`:
113
+
114
+ ```
115
+ ~/.overlap/
116
+ ├── config.json # Teams, tokens, tracer settings
117
+ ├── state.json # Byte offsets per session file
118
+ ├── cache.json # Cached repo lists + git remote lookups
119
+ ├── logs/
120
+ │ ├── tracer.log
121
+ │ └── tracer.error.log
122
+ └── tracer.pid # PID of running daemon
123
+ ```
124
+
125
+ ## Building from Source
126
+
127
+ ```bash
128
+ # Install dependencies
129
+ bun install
130
+
131
+ # Run in dev mode
132
+ bun run dev
133
+
134
+ # Run tests
135
+ bun test
136
+
137
+ # Build binaries for all platforms
138
+ bash scripts/build-all.sh
139
+ ```
140
+
141
+ ## License
142
+
143
+ 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
- {"name":"overlapdev","version":"0.0.1","description":"Reserved for overlap.dev","license":"MIT"}
1
+ {
2
+ "name": "overlapdev",
3
+ "version": "1.0.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();