@twinsearth/w2m-dsh-plugin 0.8.8 → 0.8.10
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/package.json +1 -1
- package/src/chatops/account.mjs +18 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twinsearth/w2m-dsh-plugin",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.10",
|
|
4
4
|
"description": "DSH: Windows2MacOS — drive the same project on online Windows and macOS machines from one DeepSeek account, across networks and regions. P2P hole punching is the default path (relay + shared server as rendezvous, ledger and fallback), with a bundled STUN responder, Tailscale/public-VPS/tunnel shapes, Rabbit relay + per-machine Localside + eight DSH tools (replicate / split), nine aggregate verdicts and signed requests.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
package/src/chatops/account.mjs
CHANGED
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
* reason rather than an omission.
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
import { createHash } from 'node:crypto';
|
|
40
|
-
// v0.8.1: the account-derived fleet key, so a machine joins its account's fleet with no human step.
|
|
39
|
+
import { createHash } from 'node:crypto';
|
|
40
|
+
// v0.8.1: the account-derived fleet key, so a machine joins its account's fleet with no human step.
|
|
41
41
|
import { deriveAccountFleetKey, encodeFleetKey } from './fleet-join.mjs';
|
|
42
42
|
import { execFile } from 'node:child_process';
|
|
43
43
|
import { readFile } from 'node:fs/promises';
|
|
@@ -356,16 +356,27 @@ export function createAccountIdentity(options = {}) {
|
|
|
356
356
|
* error.
|
|
357
357
|
*/
|
|
358
358
|
const account = await identify();
|
|
359
|
-
let accountFields = { accountCode: null, fleetKey: null };
|
|
359
|
+
let accountFields = { accountCode: null, fleetKey: null, fleetKeyReason: null };
|
|
360
360
|
if (account.ok) {
|
|
361
361
|
try {
|
|
362
362
|
// The KEY travels; the raw `userId` does not.
|
|
363
363
|
accountFields = { accountCode: account.accountCode, fleetKey: encodeFleetKey(deriveAccountFleetKey(account.userId)) };
|
|
364
364
|
} catch (error) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
/**
|
|
366
|
+
* v0.8.10: **carry the reason out, do not just log it.**
|
|
367
|
+
*
|
|
368
|
+
* This catch used to set `fleetKey: null` and nothing else, which made a derivation
|
|
369
|
+
* failure *indistinguishable from being signed out* at the call site: both arrive as
|
|
370
|
+
* "ok: true (or false) with no key". The caller could not say which had happened, so the
|
|
371
|
+
* one branch that was actually failing had no voice -- the same silent-no-op class fixed
|
|
372
|
+
* in v0.8.5 and v0.8.9, in a third place.
|
|
373
|
+
*
|
|
374
|
+
* `audit` was already called here, but audit output is not somewhere an operator looks.
|
|
375
|
+
* The reason now travels with the result so whoever receives it can name it.
|
|
376
|
+
*/
|
|
377
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
378
|
+
audit('account/fleet-key-failed', { detail });
|
|
379
|
+
accountFields = { accountCode: account.accountCode, fleetKey: null, fleetKeyReason: `fleet_key_derivation_failed: ${detail}` };
|
|
369
380
|
}
|
|
370
381
|
}
|
|
371
382
|
|