@camstack/server 1.2.690 → 1.2.691
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/CHANGELOG.md +6 -0
- package/dist/agent/agent-status-metrics.js +15 -0
- package/dist/agent/main.js +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.691] - 2026-10-29
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- An unpaired agent now shows its real memory on its own page instead of unknown.
|
|
15
|
+
|
|
10
16
|
## [1.2.690] - 2026-10-29
|
|
11
17
|
|
|
12
18
|
### Changed
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveStatusMetrics = resolveStatusMetrics;
|
|
4
|
+
/**
|
|
5
|
+
* The metrics source `$agent.status` reads (and so the agent's own local page).
|
|
6
|
+
*
|
|
7
|
+
* A PAIRED agent boots the `metrics-provider` addon, so the registry answers. An
|
|
8
|
+
* UNPAIRED agent boots no addon at all (agent-boot-mode.ts), the registry has no
|
|
9
|
+
* provider, and the page read memory as unknown although the host reader works. The
|
|
10
|
+
* fallback is the SAME native reader the addon registers - never a second formula -
|
|
11
|
+
* and it is asked only when the registry has nothing.
|
|
12
|
+
*/
|
|
13
|
+
function resolveStatusMetrics(fromRegistry, fallback) {
|
|
14
|
+
return () => fromRegistry() ?? fallback();
|
|
15
|
+
}
|
package/dist/agent/main.js
CHANGED
|
@@ -59,6 +59,7 @@ const agent_node_certificates_js_1 = require("./agent-node-certificates.js");
|
|
|
59
59
|
const agent_reconnect_js_1 = require("./agent-reconnect.js");
|
|
60
60
|
const serial_queue_js_1 = require("./serial-queue.js");
|
|
61
61
|
const agent_boot_mode_js_1 = require("./agent-boot-mode.js");
|
|
62
|
+
const agent_status_metrics_js_1 = require("./agent-status-metrics.js");
|
|
62
63
|
const agent_self_update_js_1 = require("./agent-self-update.js");
|
|
63
64
|
const update_check_scheduler_js_1 = require("../core/updates/update-check-scheduler.js");
|
|
64
65
|
const agent_infra_capabilities_js_1 = require("./agent-infra-capabilities.js");
|
|
@@ -437,6 +438,7 @@ async function startAgent(configPath) {
|
|
|
437
438
|
withTags: () => consoleLogger,
|
|
438
439
|
};
|
|
439
440
|
const capabilityRegistry = new system_1.CapabilityRegistry(consoleLogger);
|
|
441
|
+
let unpairedMetrics = null;
|
|
440
442
|
// Declare all capabilities the agent uses — required before registerProvider()
|
|
441
443
|
const agentCapabilities = [
|
|
442
444
|
types_2.storageCapability,
|
|
@@ -553,7 +555,17 @@ async function startAgent(configPath) {
|
|
|
553
555
|
// Resolve the current metrics-provider cap lazily from the registry.
|
|
554
556
|
// The cap is registered during bootCoreAddons but may not exist in test
|
|
555
557
|
// scenarios — `null` is a documented fallback for both.
|
|
556
|
-
|
|
558
|
+
// An UNPAIRED agent boots no addon, so the registry has no provider: its own page
|
|
559
|
+
// reads the same native reader the addon would register (see agent-status-metrics.ts).
|
|
560
|
+
getMetricsProvider: (0, agent_status_metrics_js_1.resolveStatusMetrics)(() => capabilityRegistry.getSingleton('metrics-provider'), () => {
|
|
561
|
+
if ((0, agent_boot_mode_js_1.decideAgentBootMode)({ paired: (0, agent_pairing_store_js_1.isAgentPaired)(config.configPath) }) === 'full')
|
|
562
|
+
return null;
|
|
563
|
+
if (unpairedMetrics === null) {
|
|
564
|
+
unpairedMetrics = new system_1.NativeMetricsProvider();
|
|
565
|
+
unpairedMetrics.startSampling(5000);
|
|
566
|
+
}
|
|
567
|
+
return unpairedMetrics;
|
|
568
|
+
}),
|
|
557
569
|
agentVersion: readAgentVersion(),
|
|
558
570
|
// Drives `$agent.reload` — re-runs the same discovery pass the bootstrap
|
|
559
571
|
// does at startup, picking up tarballs just landed via `$agent.deploy`.
|