Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .antigravityignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Antigravity indexer ignore — keep agent/indexer off build junk & media dumps
# (mirrors common .gitignore; safe for monorepos)

# Dependencies
node_modules/
.pnpm-store/
.yarn/cache/
.yarn/install-state.gz
.bun/
vendor/
.bundle/
Pods/

# Build / caches
dist/
build/
out/
target/
.next/
.nuxt/
.turbo/
.vite/
.cache/
.parcel-cache/
.svelte-kit/
.astro/
.vercel/
.expo/
.output/
coverage/
playwright-report/
test-results/
blob-report/
*.tsbuildinfo
graphify-out/
.reports/
.board_snapshot.*
.coord-log/

# Native / mobile
DerivedData/
.gradle/
.cxx/
**/android/.cxx/
**/android/app/build/
**/ios/build/
**/ios/Pods/
*.xcuserdata/
*.xcuserstate
.swiftpm/

# Python
.venv/
venv/
__pycache__/
*.py[cod]
.pytest_cache/
.mypy_cache/
.ruff_cache/

# Large media / binaries (agent doesn't need these for code)
*.mp4
*.mov
*.mkv
*.webm
*.psd
*.sketch
*.fig
*.zip
*.7z
*.rar
*.dmg
*.iso
*.onnx
*.gguf
*.safetensors
*.bin
*.wasm
*.cbz
*.cbr
*.epub

# Env / secrets / OS
.env
.env.*
!.env.example
.DS_Store
Thumbs.db

# VCS / tooling noise
.git/
.svn/
.hg/
.claude/
.cursor/
.codex/
22 changes: 21 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,24 @@ dist/
*.tgz

# Auth tokens (generated at runtime)
pixel-office-auth.json
pixel-office-auth.json

# --- added for Antigravity/indexer parity (auto) ---
build/
out/
target/
.next/
.turbo/
.vercel/
coverage/
playwright-report/
test-results/
graphify-out/
.reports/
__pycache__/
.venv/
venv/
DerivedData/
.gradle/
.expo/
!.env.example
13 changes: 7 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ export class PixelOfficeBridge {
}

private setupEventHandlers(): void {
this.watcher.on('session', ({ sessionId, agentId, project }) => {
this.sessionManager.registerSession(sessionId, project, agentId);
this.watcher.on('session', ({ sessionId, agentId, project, source }) => {
this.sessionManager.registerSession(sessionId, project, agentId, source || 'claude-code');

if (agentId) {
this.sessionManager.correlateAgentFile(sessionId, agentId);
}
});

this.watcher.on('line', ({ line, sessionId, agentId, filePath }) => {
this.handleNewLine(line, sessionId, agentId, filePath);
this.watcher.on('line', ({ line, sessionId, agentId, filePath, source }) => {
this.handleNewLine(line, sessionId, agentId, filePath, source || 'claude-code');
});

this.watcher.on('error', (error) => {
Expand All @@ -119,10 +119,11 @@ export class PixelOfficeBridge {
sessionId: string,
agentId: string | null,
filePath: string,
source: string = 'claude-code',
): void {
if (!this.sessionManager.sessions.has(sessionId)) {
const { project } = this.watcher.parseFilePath(filePath);
this.sessionManager.registerSession(sessionId, project, agentId);
this.sessionManager.registerSession(sessionId, project, agentId, source);
}

const resolvedAgentId = agentId
Expand All @@ -131,7 +132,7 @@ export class PixelOfficeBridge {
const raw = parseJsonlLine(line, sessionId, resolvedAgentId);
if (!raw) return;

const events = transformToPixelEvents(raw);
const events = transformToPixelEvents(raw, source);

this.sessionManager.recordActivity(sessionId);

Expand Down
3 changes: 3 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,22 @@ export interface WatcherSessionEvent {
project: string;
filePath: string;
action: 'discovered';
source?: string;
}

export interface WatcherLineEvent {
line: string;
sessionId: string;
agentId: string | null;
filePath: string;
source?: string;
}

export interface ParsedFilePath {
sessionId: string;
agentId: string | null;
project: string;
source: string;
}

// ---------------------------------------------------------------------------
Expand Down
12 changes: 8 additions & 4 deletions src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {
return;
}

const { sessionId, agentId, project } = this.parseFilePath(filePath);
const { sessionId, agentId, project, source } = this.parseFilePath(filePath);
const minutesAgo = Math.round(modifiedAgo / 60000);

logger.verbose('Watcher', `Tracking recent session: ${sessionId.slice(0, 8)}... (${minutesAgo}m ago)`);
logger.verbose('Watcher', `Tracking recent session (${source}): ${sessionId.slice(0, 8)}... (${minutesAgo}m ago)`);

this.filePositions.set(filePath, stats.size);
this.trackedSessions.add(sessionId);
Expand All @@ -90,14 +90,15 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {
project,
filePath,
action: 'discovered',
source,
});
} catch (err) {
logger.error('Watcher', `Error reading file stats: ${(err as Error).message}`);
}
}

async handleFileChange(filePath: string): Promise<void> {
const { sessionId, agentId } = this.parseFilePath(filePath);
const { sessionId, agentId, source } = this.parseFilePath(filePath);
const previousPosition = this.filePositions.get(filePath) || 0;

try {
Expand All @@ -110,7 +111,7 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {

if (!this.trackedSessions.has(sessionId)) {
const { project } = this.parseFilePath(filePath);
logger.verbose('Watcher', `Session became active: ${sessionId.slice(0, 8)}...`);
logger.verbose('Watcher', `Session became active (${source}): ${sessionId.slice(0, 8)}...`);
this.trackedSessions.add(sessionId);

this.emit('session', {
Expand All @@ -119,6 +120,7 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {
project,
filePath,
action: 'discovered',
source,
});
}

Expand All @@ -132,6 +134,7 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {
sessionId,
agentId,
filePath,
source,
});
}
}
Expand Down Expand Up @@ -185,6 +188,7 @@ export class SessionWatcher extends TypedEmitter<WatcherEvents> {
sessionId,
agentId,
project: projectPath,
source: 'claude-code',
};
}
}