@adhdev/daemon-standalone 0.9.77-rc.60 → 0.9.77-rc.61

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/dist/index.js CHANGED
@@ -32102,7 +32102,7 @@ ${lastSnapshot}`;
32102
32102
  const transcriptVisibility = readTranscriptVisibilityField(message, meta3);
32103
32103
  const audience = readStringField(readRecordField(message, meta3, "audience"));
32104
32104
  const source = readStringField(readRecordField(message, meta3, "source"));
32105
- const explicitHidden = EXPLICIT_HIDDEN_VISIBILITIES.has(visibility) || EXPLICIT_HIDDEN_VISIBILITIES.has(transcriptVisibility) || HIDDEN_AUDIENCES.has(audience) || hasBooleanMarker(message, meta3, ["internal", "isInternal", "debug", "statusOnly", "controlOnly"]);
32105
+ const explicitHidden = EXPLICIT_HIDDEN_VISIBILITIES.has(visibility) || EXPLICIT_HIDDEN_VISIBILITIES.has(transcriptVisibility) || HIDDEN_AUDIENCES.has(audience) || hasBooleanMarker(message, meta3, ["hidden", "internal", "isInternal", "debug", "statusOnly", "controlOnly"]);
32106
32106
  const explicitUserFacing = EXPLICIT_VISIBLE_VISIBILITIES.has(visibility) || EXPLICIT_VISIBLE_VISIBILITIES.has(transcriptVisibility) || audience === "chat" || hasBooleanMarker(message, meta3, ["userFacing"]);
32107
32107
  if (explicitHidden) {
32108
32108
  const activityLike = isActivityKind(kind) || ACTIVITY_SOURCE_SET.has(source);
@@ -47952,31 +47952,75 @@ ${block}`);
47952
47952
  for (const node of mesh.nodes || []) {
47953
47953
  const status = {
47954
47954
  nodeId: node.id || node.nodeId,
47955
+ machineLabel: node.machineLabel || node.id || node.nodeId,
47955
47956
  workspace: node.workspace,
47956
47957
  repoRoot: node.repoRoot,
47957
47958
  isLocalWorktree: node.isLocalWorktree,
47958
47959
  worktreeBranch: node.worktreeBranch,
47959
47960
  daemonId: node.daemonId,
47960
47961
  machineId: node.machineId,
47961
- health: "unknown"
47962
+ health: "unknown",
47963
+ providers: node.providers || [],
47964
+ activeSessions: []
47962
47965
  };
47963
47966
  if (node.workspace && typeof node.workspace === "string") {
47964
47967
  try {
47965
47968
  const { execFile: execFile3 } = await import("child_process");
47966
47969
  const { promisify: promisify3 } = await import("util");
47967
47970
  const execFileAsync3 = promisify3(execFile3);
47968
- const branch = await execFileAsync3("git", ["-C", node.workspace, "branch", "--show-current"], {
47969
- encoding: "utf8",
47970
- timeout: 1e4
47971
- }).then((r) => r.stdout.trim()).catch(() => "");
47972
- const porc = await execFileAsync3("git", ["-C", node.workspace, "status", "--porcelain"], {
47973
- encoding: "utf8",
47974
- timeout: 1e4
47975
- }).then((r) => r.stdout.trim()).catch(() => "");
47971
+ const runGit2 = async (args2) => {
47972
+ const result = await execFileAsync3("git", ["-C", node.workspace, ...args2], {
47973
+ encoding: "utf8",
47974
+ timeout: 1e4
47975
+ });
47976
+ return result.stdout.trim();
47977
+ };
47978
+ const branch = await runGit2(["branch", "--show-current"]).catch(() => "");
47979
+ const porc = await runGit2(["status", "--porcelain"]).catch(() => "");
47980
+ const headCommit = await runGit2(["rev-parse", "--short", "HEAD"]).catch(() => null);
47981
+ const headMessage = await runGit2(["log", "-1", "--format=%s"]).catch(() => null);
47982
+ const upstream = await runGit2(["rev-parse", "--abbrev-ref", "@{upstream}"]).catch(() => null);
47983
+ const aheadBehind = await runGit2(["rev-list", "--left-right", "--count", "@{upstream}...HEAD"]).catch(() => "");
47984
+ const stashCount = await runGit2(["stash", "list"]).catch(() => "");
47985
+ let ahead = 0, behind = 0;
47986
+ if (aheadBehind) {
47987
+ const parts = aheadBehind.split(/\s+/);
47988
+ if (parts.length >= 2) {
47989
+ behind = parseInt(parts[0], 10) || 0;
47990
+ ahead = parseInt(parts[1], 10) || 0;
47991
+ }
47992
+ }
47976
47993
  const dirty = porc.length > 0;
47977
- status.branch = branch;
47978
- status.isDirty = dirty;
47979
- status.uncommittedChanges = porc ? porc.split("\n").filter(Boolean).length : 0;
47994
+ const lines = porc ? porc.split("\n").filter(Boolean) : [];
47995
+ let staged = 0, modified = 0, untracked = 0, deleted = 0, renamed = 0;
47996
+ for (const line of lines) {
47997
+ const xy = line.slice(0, 2);
47998
+ if (xy[0] !== " " && xy[0] !== "?") staged++;
47999
+ if (xy[1] === "M") modified++;
48000
+ if (xy[1] === "D") deleted++;
48001
+ if (xy[0] === "R" || xy[1] === "R") renamed++;
48002
+ if (xy === "??") untracked++;
48003
+ }
48004
+ status.git = {
48005
+ workspace: node.workspace,
48006
+ repoRoot: node.workspace,
48007
+ isGitRepo: true,
48008
+ branch: branch || null,
48009
+ headCommit,
48010
+ headMessage,
48011
+ upstream,
48012
+ ahead,
48013
+ behind,
48014
+ staged,
48015
+ modified,
48016
+ untracked,
48017
+ deleted,
48018
+ renamed,
48019
+ hasConflicts: false,
48020
+ conflictFiles: [],
48021
+ stashCount: stashCount ? stashCount.split("\n").filter(Boolean).length : 0,
48022
+ lastCheckedAt: Date.now()
48023
+ };
47980
48024
  status.health = branch ? dirty ? "dirty" : "online" : "degraded";
47981
48025
  } catch {
47982
48026
  status.health = "degraded";