@adhdev/daemon-standalone 0.9.82-rc.348 → 0.9.82-rc.349
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 +4758 -4534
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +38 -8
- package/vendor/mcp-server/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1245,6 +1245,7 @@ function compactMeshStatusNode(entry) {
|
|
|
1245
1245
|
}
|
|
1246
1246
|
var COMPACT_DETAILED_NODES_BYTE_BUDGET = 9e3;
|
|
1247
1247
|
var COMPACT_NODES_TOTAL_BYTE_BUDGET = 13e3;
|
|
1248
|
+
var COMPACT_MISSIONS_BYTE_BUDGET = 6e3;
|
|
1248
1249
|
function compactNodeSeverity(entry) {
|
|
1249
1250
|
if (!entry || typeof entry !== "object") return 0;
|
|
1250
1251
|
if (entry.error || entry.health && entry.health !== "online" && entry.health !== "dirty") return 5;
|
|
@@ -3105,15 +3106,44 @@ async function meshStatus(ctx, args = {}) {
|
|
|
3105
3106
|
} catch {
|
|
3106
3107
|
}
|
|
3107
3108
|
try {
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3109
|
+
if (compact) {
|
|
3110
|
+
const { live, historyFold } = (0, import_daemon_core.getMeshStatusMissionsCompact)(mesh.id);
|
|
3111
|
+
const ranked = [...live].sort((a, b) => String(b.tasks?.lastActivityAt ?? "").localeCompare(String(a.tasks?.lastActivityAt ?? "")));
|
|
3112
|
+
const kept = [];
|
|
3113
|
+
const overflow = [];
|
|
3114
|
+
let spent = 0;
|
|
3115
|
+
for (const m of ranked) {
|
|
3116
|
+
const cost = JSON.stringify(m).length + 1;
|
|
3117
|
+
if (kept.length === 0 || spent + cost <= COMPACT_MISSIONS_BYTE_BUDGET) {
|
|
3118
|
+
kept.push(m);
|
|
3119
|
+
spent += cost;
|
|
3120
|
+
} else {
|
|
3121
|
+
overflow.push(m);
|
|
3115
3122
|
}
|
|
3116
|
-
}
|
|
3123
|
+
}
|
|
3124
|
+
if (kept.length > 0) response.missions = kept;
|
|
3125
|
+
if (overflow.length > 0) {
|
|
3126
|
+
const byStatus = {};
|
|
3127
|
+
for (const m of overflow) byStatus[String(m.status)] = (byStatus[String(m.status)] ?? 0) + 1;
|
|
3128
|
+
response.foldedMissions = {
|
|
3129
|
+
count: overflow.length,
|
|
3130
|
+
note: "Live-mission byte budget reached: these active/paused missions are listed by id only. Use mesh_mission_list or mesh_status verbose=true for their detail.",
|
|
3131
|
+
byStatus,
|
|
3132
|
+
missionIds: overflow.map((m) => String(m.id))
|
|
3133
|
+
};
|
|
3134
|
+
}
|
|
3135
|
+
if (historyFold) response.missionsHistory = historyFold;
|
|
3136
|
+
} else {
|
|
3137
|
+
const missions = (0, import_daemon_core.getMeshStatusMissionSummaries)(mesh.id, { verbose: true });
|
|
3138
|
+
if (missions.length > 0) {
|
|
3139
|
+
response.missions = missions.map((mission) => {
|
|
3140
|
+
try {
|
|
3141
|
+
return { ...mission, stats: (0, import_daemon_core.computeMeshMissionStats)(mesh.id, mission.id) };
|
|
3142
|
+
} catch {
|
|
3143
|
+
return mission;
|
|
3144
|
+
}
|
|
3145
|
+
});
|
|
3146
|
+
}
|
|
3117
3147
|
}
|
|
3118
3148
|
} catch {
|
|
3119
3149
|
}
|