@wibeco/bridge 0.2.7 → 0.2.9

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.
@@ -18,7 +18,7 @@ import {
18
18
  startPresenceSession,
19
19
  stopPresenceSession,
20
20
  updatePresenceSession
21
- } from "./chunk-O4MHMJZZ.js";
21
+ } from "./chunk-DSMXRUNM.js";
22
22
 
23
23
  // src/cli/commands.ts
24
24
  import { access, cp, mkdir, readFile, writeFile } from "fs/promises";
@@ -194,7 +194,7 @@ async function emitCommand(adapter, eventName, input) {
194
194
  const mapper = adapter === "cursor" ? mapCursorHook : adapter === "claude-code" ? mapClaudeCodeHook : mapCodexHook;
195
195
  let mappedEvent = mapper(eventName, input);
196
196
  const repo = await detectRepository(process.cwd());
197
- if (repo && (mappedEvent.kind === "session.started" || mappedEvent.kind === "session.ended" || mappedEvent.kind === "lifecycle.before" || mappedEvent.kind === "presence.heartbeat" || mappedEvent.kind === "file.changed")) {
197
+ if (repo && (mappedEvent.kind === "session.started" || mappedEvent.kind === "session.ended" || mappedEvent.kind === "lifecycle.before" || mappedEvent.kind === "lifecycle.after" || mappedEvent.kind === "presence.heartbeat" || mappedEvent.kind === "file.changed")) {
198
198
  const workingTree = await detectWorkingTreeMetrics(repo.root);
199
199
  if (workingTree) {
200
200
  mappedEvent = {
@@ -258,13 +258,12 @@ async function emitCommand(adapter, eventName, input) {
258
258
  task_paths: metrics.task_paths
259
259
  }
260
260
  };
261
- } else if (mappedEvent.kind === "lifecycle.after" && metrics && metrics.task_paths.length > 0) {
261
+ } else if (mappedEvent.kind === "lifecycle.after" && metrics && metrics.task_paths.length > 0 && (metrics.task_lines_added > 0 || metrics.task_lines_deleted > 0)) {
262
262
  mappedEvent = {
263
263
  ...mappedEvent,
264
264
  kind: "response.completed",
265
265
  metadata: {
266
266
  ...mappedEvent.metadata,
267
- title: "Agent update",
268
267
  paths: metrics.task_paths,
269
268
  lines_added: metrics.task_lines_added,
270
269
  lines_deleted: metrics.task_lines_deleted
@@ -366,6 +365,7 @@ async function shareProgressCommand(options, cwd = process.cwd()) {
366
365
  throw new Error("Progress confidence must be between 0 and 1.");
367
366
  }
368
367
  const repo = await detectRepository(cwd);
368
+ const workingTree = repo ? await detectWorkingTreeMetrics(repo.root) : void 0;
369
369
  const event = createHookEvent({
370
370
  source: projectConfig.adapter,
371
371
  kind: "progress.shared",
@@ -373,7 +373,12 @@ async function shareProgressCommand(options, cwd = process.cwd()) {
373
373
  summary,
374
374
  ...title ? { title } : {},
375
375
  ...options.phase ? { phase: options.phase } : {},
376
- ...options.confidence !== void 0 ? { confidence: options.confidence } : {}
376
+ ...options.confidence !== void 0 ? { confidence: options.confidence } : {},
377
+ ...workingTree ? {
378
+ paths: workingTree.paths,
379
+ lines_added: workingTree.linesAdded,
380
+ lines_deleted: workingTree.linesDeleted
381
+ } : {}
377
382
  },
378
383
  ...repo ? { repo } : {}
379
384
  });
@@ -388,7 +388,9 @@ function toEnvelope(event, options) {
388
388
  summary: event.metadata.summary,
389
389
  paths,
390
390
  phase: event.metadata.phase,
391
- confidence: event.metadata.confidence
391
+ confidence: event.metadata.confidence,
392
+ lines_added: typeof event.metadata.lines_added === "number" ? event.metadata.lines_added : void 0,
393
+ lines_deleted: typeof event.metadata.lines_deleted === "number" ? event.metadata.lines_deleted : void 0
392
394
  } : event.kind === "file.changed" ? {
393
395
  paths,
394
396
  tool: event.source,
@@ -735,13 +737,13 @@ async function updatePresenceSession(source, sessionId, event, cwd = process.cwd
735
737
  );
736
738
  state.linesDeleted = isHeartbeat && state.linesDeleted > MAX_SESSION_LINE_COUNT ? workingDelta : Math.max(state.linesDeleted, workingDelta);
737
739
  }
738
- if (event.kind === "file.changed" && workingLinesAdded !== void 0 && state.taskBaselineLinesAdded !== void 0) {
740
+ if ((event.kind === "file.changed" || event.kind === "lifecycle.after") && workingLinesAdded !== void 0 && state.taskBaselineLinesAdded !== void 0) {
739
741
  state.taskLinesAdded = Math.max(
740
742
  state.taskLinesAdded,
741
743
  Math.max(0, workingLinesAdded - state.taskBaselineLinesAdded)
742
744
  );
743
745
  }
744
- if (event.kind === "file.changed" && workingLinesDeleted !== void 0 && state.taskBaselineLinesDeleted !== void 0) {
746
+ if ((event.kind === "file.changed" || event.kind === "lifecycle.after") && workingLinesDeleted !== void 0 && state.taskBaselineLinesDeleted !== void 0) {
745
747
  state.taskLinesDeleted = Math.max(
746
748
  state.taskLinesDeleted,
747
749
  Math.max(0, workingLinesDeleted - state.taskBaselineLinesDeleted)
package/dist/cli.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  setupCommand,
7
7
  shareProgressCommand,
8
8
  statusCommand
9
- } from "./chunk-VBQSVC34.js";
9
+ } from "./chunk-6P6IVLMW.js";
10
10
  import {
11
11
  runPresenceHeartbeat
12
- } from "./chunk-O4MHMJZZ.js";
12
+ } from "./chunk-DSMXRUNM.js";
13
13
 
14
14
  // src/cli.ts
15
15
  var HELP = `wibe-bridge <command>
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  emitCommand
4
- } from "./chunk-VBQSVC34.js";
5
- import "./chunk-O4MHMJZZ.js";
4
+ } from "./chunk-6P6IVLMW.js";
5
+ import "./chunk-DSMXRUNM.js";
6
6
 
7
7
  // src/codex-hook.ts
8
8
  async function main() {
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  startPresenceSession,
33
33
  stopPresenceSession,
34
34
  updatePresenceSession
35
- } from "./chunk-O4MHMJZZ.js";
35
+ } from "./chunk-DSMXRUNM.js";
36
36
  export {
37
37
  JsonFileOfflineQueue,
38
38
  MemoryOfflineQueue,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibeco/bridge",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Privacy-first live activity bridge for Cursor, Claude Code, and Codex.",
5
5
  "repository": {
6
6
  "type": "git",