log-llm-config 1.3.75 → 1.3.77
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.
|
@@ -76,15 +76,25 @@ function buildRequestBody(hardwareUuid, timestamp) {
|
|
|
76
76
|
}
|
|
77
77
|
return requestBody;
|
|
78
78
|
}
|
|
79
|
-
const maybeSendToEndpoint = async (hardwareUuid, timestamp) => {
|
|
79
|
+
const maybeSendToEndpoint = async (hardwareUuid, timestamp, options = {}) => {
|
|
80
80
|
const startupEndpointUrl = buildStartupEndpointUrl(loadEndpointBase());
|
|
81
81
|
const requestBody = buildRequestBody(hardwareUuid, timestamp);
|
|
82
82
|
try {
|
|
83
83
|
const response = await postStartupPayload(startupEndpointUrl, requestBody);
|
|
84
84
|
const result = classifyEndpointResponse(response);
|
|
85
85
|
console.log(result.message);
|
|
86
|
-
if (result.branch === 'key_issued' && result.key)
|
|
86
|
+
if (result.branch === 'key_issued' && result.key) {
|
|
87
87
|
writeAuthKey(result.key, result.keyId, hardwareUuid);
|
|
88
|
+
// First startup on a machine is unsigned; hook_manifest is only persisted for valid signatures.
|
|
89
|
+
// Re-post immediately so unthrottled init records all hook hashes without a tool call.
|
|
90
|
+
const manifest = parseHookManifest();
|
|
91
|
+
if (options.allowKeyIssuedRetry !== false &&
|
|
92
|
+
Object.keys(manifest).length > 0) {
|
|
93
|
+
await maybeSendToEndpoint(hardwareUuid, new Date().toISOString(), {
|
|
94
|
+
allowKeyIssuedRetry: false,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
88
98
|
}
|
|
89
99
|
catch (error) {
|
|
90
100
|
console.error(`Failed to contact endpoint: ${error.message}`);
|