@adhdev/daemon-core 0.9.77-rc.60 → 0.9.77-rc.62
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.d.ts +1 -0
- package/dist/index.js +57 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +60 -11
- package/src/index.ts +1 -0
- package/src/providers/chat-message-normalization.ts +1 -1
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -2734,6 +2734,7 @@ export class DaemonCommandRouter {
|
|
|
2734
2734
|
for (const node of mesh.nodes || []) {
|
|
2735
2735
|
const status: Record<string, unknown> = {
|
|
2736
2736
|
nodeId: node.id || node.nodeId,
|
|
2737
|
+
machineLabel: node.machineLabel || node.id || node.nodeId,
|
|
2737
2738
|
workspace: node.workspace,
|
|
2738
2739
|
repoRoot: node.repoRoot,
|
|
2739
2740
|
isLocalWorktree: node.isLocalWorktree,
|
|
@@ -2741,24 +2742,72 @@ export class DaemonCommandRouter {
|
|
|
2741
2742
|
daemonId: node.daemonId,
|
|
2742
2743
|
machineId: node.machineId,
|
|
2743
2744
|
health: 'unknown',
|
|
2745
|
+
providers: node.providers || [],
|
|
2746
|
+
activeSessions: [],
|
|
2744
2747
|
};
|
|
2745
2748
|
if (node.workspace && typeof node.workspace === 'string') {
|
|
2746
2749
|
try {
|
|
2747
2750
|
const { execFile } = await import('node:child_process');
|
|
2748
2751
|
const { promisify } = await import('node:util');
|
|
2749
2752
|
const execFileAsync = promisify(execFile);
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
}
|
|
2753
|
+
|
|
2754
|
+
const runGit = async (args: string[]): Promise<string> => {
|
|
2755
|
+
const result = await execFileAsync('git', ['-C', node.workspace as string, ...args], {
|
|
2756
|
+
encoding: 'utf8',
|
|
2757
|
+
timeout: 10_000,
|
|
2758
|
+
});
|
|
2759
|
+
return result.stdout.trim();
|
|
2760
|
+
};
|
|
2761
|
+
|
|
2762
|
+
const branch = await runGit(['branch', '--show-current']).catch(() => '');
|
|
2763
|
+
const porc = await runGit(['status', '--porcelain']).catch(() => '');
|
|
2764
|
+
const headCommit = await runGit(['rev-parse', '--short', 'HEAD']).catch(() => null);
|
|
2765
|
+
const headMessage = await runGit(['log', '-1', '--format=%s']).catch(() => null);
|
|
2766
|
+
const upstream = await runGit(['rev-parse', '--abbrev-ref', '@{upstream}']).catch(() => null);
|
|
2767
|
+
const aheadBehind = await runGit(['rev-list', '--left-right', '--count', '@{upstream}...HEAD']).catch(() => '');
|
|
2768
|
+
const stashCount = await runGit(['stash', 'list']).catch(() => '');
|
|
2769
|
+
|
|
2770
|
+
let ahead = 0, behind = 0;
|
|
2771
|
+
if (aheadBehind) {
|
|
2772
|
+
const parts = aheadBehind.split(/\s+/);
|
|
2773
|
+
if (parts.length >= 2) {
|
|
2774
|
+
behind = parseInt(parts[0], 10) || 0;
|
|
2775
|
+
ahead = parseInt(parts[1], 10) || 0;
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2758
2779
|
const dirty = porc.length > 0;
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2780
|
+
const lines = porc ? porc.split('\n').filter(Boolean) : [];
|
|
2781
|
+
let staged = 0, modified = 0, untracked = 0, deleted = 0, renamed = 0;
|
|
2782
|
+
for (const line of lines) {
|
|
2783
|
+
const xy = line.slice(0, 2);
|
|
2784
|
+
if (xy[0] !== ' ' && xy[0] !== '?') staged++;
|
|
2785
|
+
if (xy[1] === 'M') modified++;
|
|
2786
|
+
if (xy[1] === 'D') deleted++;
|
|
2787
|
+
if (xy[0] === 'R' || xy[1] === 'R') renamed++;
|
|
2788
|
+
if (xy === '??') untracked++;
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
status.git = {
|
|
2792
|
+
workspace: node.workspace,
|
|
2793
|
+
repoRoot: node.workspace,
|
|
2794
|
+
isGitRepo: true,
|
|
2795
|
+
branch: branch || null,
|
|
2796
|
+
headCommit,
|
|
2797
|
+
headMessage,
|
|
2798
|
+
upstream,
|
|
2799
|
+
ahead,
|
|
2800
|
+
behind,
|
|
2801
|
+
staged,
|
|
2802
|
+
modified,
|
|
2803
|
+
untracked,
|
|
2804
|
+
deleted,
|
|
2805
|
+
renamed,
|
|
2806
|
+
hasConflicts: false,
|
|
2807
|
+
conflictFiles: [],
|
|
2808
|
+
stashCount: stashCount ? stashCount.split('\n').filter(Boolean).length : 0,
|
|
2809
|
+
lastCheckedAt: Date.now(),
|
|
2810
|
+
};
|
|
2762
2811
|
status.health = branch ? (dirty ? 'dirty' : 'online') : 'degraded';
|
|
2763
2812
|
} catch {
|
|
2764
2813
|
status.health = 'degraded';
|
package/src/index.ts
CHANGED
|
@@ -119,6 +119,7 @@ export type RuntimeWriteOwner = _RuntimeWriteOwner;
|
|
|
119
119
|
export type RuntimeAttachedClient = _RuntimeAttachedClient;
|
|
120
120
|
export type RecentLaunchEntry = _RecentLaunchEntry;
|
|
121
121
|
export type TerminalBackendStatus = _TerminalBackendStatus;
|
|
122
|
+
export type { SessionHostEndpoint } from '@adhdev/session-host-core';
|
|
122
123
|
|
|
123
124
|
// Type aliases — rollup-dts cannot bundle re-exported type aliases at all.
|
|
124
125
|
// Canonical definition lives in shared-types-extra.ts — keep these in sync.
|
|
@@ -322,7 +322,7 @@ export function classifyChatMessageVisibility(message: ChatMessage | null | unde
|
|
|
322
322
|
const explicitHidden = EXPLICIT_HIDDEN_VISIBILITIES.has(visibility)
|
|
323
323
|
|| EXPLICIT_HIDDEN_VISIBILITIES.has(transcriptVisibility)
|
|
324
324
|
|| HIDDEN_AUDIENCES.has(audience)
|
|
325
|
-
|| hasBooleanMarker(message, meta, ['internal', 'isInternal', 'debug', 'statusOnly', 'controlOnly']);
|
|
325
|
+
|| hasBooleanMarker(message, meta, ['hidden', 'internal', 'isInternal', 'debug', 'statusOnly', 'controlOnly']);
|
|
326
326
|
const explicitUserFacing = EXPLICIT_VISIBLE_VISIBILITIES.has(visibility)
|
|
327
327
|
|| EXPLICIT_VISIBLE_VISIBILITIES.has(transcriptVisibility)
|
|
328
328
|
|| audience === 'chat'
|