@volter/supercode-teams 0.2.53 → 0.2.54
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/fleet.mjs +9 -2
- package/package.json +1 -1
package/fleet.mjs
CHANGED
|
@@ -57,6 +57,9 @@ export async function fleetDiscover({ context = null, machines = null, params =
|
|
|
57
57
|
: listed;
|
|
58
58
|
const results = await Promise.all(targets.map(async (machine) => {
|
|
59
59
|
if (!machine.id) return { name: machine.name, error: 'not an accessible machine of this team' };
|
|
60
|
+
// A machine the server reports offline is not asked (asking only waits for a link that is not coming); it is
|
|
61
|
+
// named as offline, not as a failure, and only when it was named or seen in the last day.
|
|
62
|
+
if (machine.connection === 'offline') return { name: machine.name, offline: true, lastSeenAt: machine.last_seen_at ?? null };
|
|
60
63
|
let channel = null;
|
|
61
64
|
try {
|
|
62
65
|
channel = await openRemoteMachine({ origin: selected.origin, teamId: selected.team_id, machineId: machine.id, token });
|
|
@@ -70,9 +73,13 @@ export async function fleetDiscover({ context = null, machines = null, params =
|
|
|
70
73
|
}));
|
|
71
74
|
const sessions = [];
|
|
72
75
|
const unreachable = [];
|
|
76
|
+
const offline = [];
|
|
77
|
+
const named = new Set(machines ?? []);
|
|
73
78
|
for (const result of results) {
|
|
74
|
-
if (result.
|
|
79
|
+
if (result.offline) {
|
|
80
|
+
if (named.has(result.name) || (result.lastSeenAt && Date.now() - result.lastSeenAt < 86_400_000)) offline.push({ machine: result.name, last_seen_at: result.lastSeenAt });
|
|
81
|
+
} else if (result.error) unreachable.push({ machine: result.name, error: result.error });
|
|
75
82
|
else for (const session of result.sessions) sessions.push({ machine: result.name, ...session });
|
|
76
83
|
}
|
|
77
|
-
return { sessions, unreachable };
|
|
84
|
+
return { sessions, unreachable, ...(offline.length ? { offline } : {}) };
|
|
78
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.54",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
|
|
6
6
|
"license": "MIT",
|