fullcourtdefense-cli 1.36.2 → 1.36.3
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/actionPolicyEngine.js +10 -1
- package/dist/askHeader.d.ts +6 -0
- package/dist/askHeader.js +49 -10
- package/dist/commandNarrative.d.ts +5 -0
- package/dist/commandNarrative.js +27 -0
- package/dist/commands/daemon.js +23 -3
- package/dist/commands/demoActions.js +2 -2
- package/dist/commands/deterministicGuard.d.ts +5 -0
- package/dist/commands/deterministicGuard.js +45 -7
- package/dist/commands/doctor.js +1 -0
- package/dist/commands/login.js +4 -0
- package/dist/identityRecovery.d.ts +50 -0
- package/dist/identityRecovery.js +99 -0
- package/dist/machineIdentity.d.ts +90 -1
- package/dist/machineIdentity.js +457 -94
- package/dist/telemetry.d.ts +9 -0
- package/dist/telemetry.js +29 -7
- package/dist/version.json +1 -1
- package/package.json +2 -1
|
@@ -11,14 +11,102 @@ export interface MachineIdentity {
|
|
|
11
11
|
platform: NodeJS.Platform;
|
|
12
12
|
/** Friendly OS label, e.g. `Windows 11`, `macOS 14`, `Ubuntu 22.04`. */
|
|
13
13
|
osFriendly: string;
|
|
14
|
+
/** Where `machineId` came from (`ci` = FCD_MACHINE_ID override). */
|
|
15
|
+
idSource?: IdentitySource | 'ci';
|
|
16
|
+
/** True when the backend has accepted this id (enrollment / heartbeat / recovery). */
|
|
17
|
+
idConfirmed?: boolean;
|
|
14
18
|
}
|
|
19
|
+
/** Origin of a pinned id. `enrollment` and `recovered` are backend-confirmed by definition. */
|
|
20
|
+
export type IdentitySource = 'native' | 'fallback' | 'enrollment' | 'recovered';
|
|
21
|
+
export interface PinnedIdentity {
|
|
22
|
+
schema: 1;
|
|
23
|
+
machineId: string;
|
|
24
|
+
source: IdentitySource;
|
|
25
|
+
firstSeen: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
/** Set once the backend accepted this id. */
|
|
28
|
+
confirmedAt?: string;
|
|
29
|
+
/** Normalized hostname at pin time; a change allows one native re-check (clone / rename). */
|
|
30
|
+
hostname?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* How far resolution may go to read the OS id:
|
|
34
|
+
* - `unpinned` (every process): only when there is no pin, throttled;
|
|
35
|
+
* - `heal` (daemon boot): also re-check an unconfirmed fallback pin, throttled;
|
|
36
|
+
* - `force` (enrollment): re-check an unconfirmed pin regardless of the throttle.
|
|
37
|
+
*/
|
|
38
|
+
export type NativeReadMode = 'unpinned' | 'heal' | 'force';
|
|
39
|
+
export interface IdentityReconcileReport {
|
|
40
|
+
machineId: string;
|
|
41
|
+
source: IdentitySource;
|
|
42
|
+
confirmed: boolean;
|
|
43
|
+
/** A native read was attempted by this call. */
|
|
44
|
+
probed: boolean;
|
|
45
|
+
probeError?: string;
|
|
46
|
+
/** The pin moved from an unconfirmed fallback id to the native one. */
|
|
47
|
+
healed?: {
|
|
48
|
+
from: string;
|
|
49
|
+
to: string;
|
|
50
|
+
};
|
|
51
|
+
/** Native disagrees with a backend-confirmed pin (kept). */
|
|
52
|
+
conflict?: {
|
|
53
|
+
pinned: string;
|
|
54
|
+
native: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
interface IdentityDeps {
|
|
58
|
+
execFileSync: (file: string, args: string[], options: {
|
|
59
|
+
encoding: 'utf8';
|
|
60
|
+
windowsHide: boolean;
|
|
61
|
+
timeout: number;
|
|
62
|
+
}) => string;
|
|
63
|
+
platform: () => NodeJS.Platform;
|
|
64
|
+
now: () => number;
|
|
65
|
+
uptimeSeconds: () => number;
|
|
66
|
+
hostname: () => string;
|
|
67
|
+
/** Linux: /etc/machine-id, else /var/lib/dbus/machine-id (a file read, no spawn). */
|
|
68
|
+
linuxMachineId: () => string | undefined;
|
|
69
|
+
}
|
|
70
|
+
/** Test seam: replace the spawn / clock / platform, and forget the cached identity. */
|
|
71
|
+
export declare function __setMachineIdentityDepsForTest(overrides?: Partial<IdentityDeps>): void;
|
|
72
|
+
/** Forget the in-process identity (the pin changed). */
|
|
73
|
+
export declare function resetMachineIdentityCache(): void;
|
|
15
74
|
/** Normalize a hostname: strip `.local`/domain suffix, lowercase. */
|
|
16
75
|
export declare function normalizeHostname(raw: string): string;
|
|
76
|
+
/** First 8 hex chars — how ids appear in logs, distress details and recovery requests. */
|
|
77
|
+
export declare function shortMachineId(machineId: string): string;
|
|
17
78
|
/**
|
|
18
|
-
*
|
|
79
|
+
* CLI commands that inspect or remove the installation: `uninstall-*`,
|
|
80
|
+
* `*-status`, the removal commands, and `--uninstall` / `--unschedule` /
|
|
81
|
+
* `--status` runs of the daemon, auto-protect and discover.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isIdentityReadOnlyCommand(command: string, flags?: Record<string, string | undefined>): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Inspect / remove commands (verify-removed, uninstall, doctor, …): resolve
|
|
86
|
+
* from what is on disk, write nothing and never spawn the native read.
|
|
87
|
+
*/
|
|
88
|
+
export declare function setMachineIdentityReadOnly(on: boolean): void;
|
|
89
|
+
export declare function isPinConfirmed(pin: PinnedIdentity): boolean;
|
|
90
|
+
export declare function readPinnedIdentity(): PinnedIdentity | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* The stable machine identity (cached per process). The raw OS id is hashed
|
|
19
93
|
* (SHA-256, 32 hex chars) so we never transmit the raw hardware UUID.
|
|
20
94
|
*/
|
|
21
95
|
export declare function getMachineIdentity(): MachineIdentity;
|
|
96
|
+
/**
|
|
97
|
+
* Re-resolve with a wider native-read allowance: the daemon at boot (`heal`)
|
|
98
|
+
* and enrollment (`force`). Replaces the cached identity.
|
|
99
|
+
*/
|
|
100
|
+
export declare function reconcileMachineIdentity(mode: Exclude<NativeReadMode, 'unpinned'>): IdentityReconcileReport;
|
|
101
|
+
export type ConfirmOutcome = 'pinned' | 'already' | 'conflict' | 'skipped';
|
|
102
|
+
/**
|
|
103
|
+
* Record that the backend accepted `machineId` for this machine:
|
|
104
|
+
* - `enrollment`: the enroll call succeeded — authoritative, always pinned;
|
|
105
|
+
* - `heartbeat`: events:batch returned 200 for the id this process uses;
|
|
106
|
+
* - `recovered`: the backend named the machine bound to this shield. Never
|
|
107
|
+
* replaces a different confirmed id (records `machine_id_conflict`).
|
|
108
|
+
*/
|
|
109
|
+
export declare function confirmMachineIdentity(machineId: string, how: 'enrollment' | 'heartbeat' | 'recovered'): ConfirmOutcome;
|
|
22
110
|
export type LocalMachineKind = 'workstation' | 'ci' | 'workload';
|
|
23
111
|
/**
|
|
24
112
|
* Which KIND of fleet machine this process belongs to — the value the policy
|
|
@@ -53,3 +141,4 @@ export declare function stampRuntimeIdentityContext<T extends Record<string, str
|
|
|
53
141
|
}): T;
|
|
54
142
|
/** Suggested per-machine Shield name, e.g. `boazl@boaz-pc · Windows 11`. */
|
|
55
143
|
export declare function suggestedShieldName(identity?: MachineIdentity): string;
|
|
144
|
+
export {};
|