@byok-sdk/core 0.4.2 → 0.6.0
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/README.md +7 -0
- package/dist/device-assertion.d.ts +57 -0
- package/dist/in-memory/device-assertion-replay.d.ts +8 -0
- package/dist/in-memory/index.d.ts +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +104 -1
- package/dist/index.js.map +1 -1
- package/dist/presence.d.ts +47 -0
- package/package.json +1 -1
package/dist/presence.d.ts
CHANGED
|
@@ -17,6 +17,41 @@ import type { TenantId } from './tenant';
|
|
|
17
17
|
/** The five presence levels. */
|
|
18
18
|
export declare const PRESENCE_LEVELS: readonly ['online', 'thinking', 'working', 'error', 'offline'];
|
|
19
19
|
export type PresenceLevel = (typeof PRESENCE_LEVELS)[number];
|
|
20
|
+
/** Runtime facts observed by a daemon's real local probe. Omitted fields are unknown. */
|
|
21
|
+
export interface PresenceRuntimeFact {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly version?: string;
|
|
24
|
+
readonly authPresent?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Unexpired presence facts nested in the tenant aggregate. */
|
|
27
|
+
export interface TenantReadinessPresence {
|
|
28
|
+
readonly level: PresenceLevel;
|
|
29
|
+
readonly detail?: string;
|
|
30
|
+
readonly configuredToolsets?: readonly string[];
|
|
31
|
+
readonly clientVersion?: string;
|
|
32
|
+
readonly protocolVersions?: readonly number[];
|
|
33
|
+
readonly runtimes?: readonly PresenceRuntimeFact[];
|
|
34
|
+
readonly observedAt: string;
|
|
35
|
+
readonly expiresAt: string;
|
|
36
|
+
}
|
|
37
|
+
/** Durable device state plus its optional live observation, scoped to one tenant. */
|
|
38
|
+
export interface TenantReadinessDevice {
|
|
39
|
+
readonly deviceId: string;
|
|
40
|
+
readonly productId: string;
|
|
41
|
+
readonly deviceName: string;
|
|
42
|
+
readonly revoked: boolean;
|
|
43
|
+
/** Omitted when absent/expired or when the durable device is revoked. */
|
|
44
|
+
readonly presence?: TenantReadinessPresence;
|
|
45
|
+
}
|
|
46
|
+
/** SDK-owned tenant read model; this is observation, never an execution gate. */
|
|
47
|
+
export interface TenantReadiness {
|
|
48
|
+
readonly tenantId: TenantId;
|
|
49
|
+
readonly activePairedDeviceCount: number;
|
|
50
|
+
readonly revokedDeviceCount: number;
|
|
51
|
+
readonly observedPresenceCount: number;
|
|
52
|
+
readonly observedPresenceByLevel: Readonly<Record<PresenceLevel, number>>;
|
|
53
|
+
readonly devices: readonly TenantReadinessDevice[];
|
|
54
|
+
}
|
|
20
55
|
/** A device-level hint. `expiresAt` is authoritative: past it, the hint does not exist. */
|
|
21
56
|
export interface PresenceHint {
|
|
22
57
|
readonly tenantId: TenantId;
|
|
@@ -30,6 +65,12 @@ export interface PresenceHint {
|
|
|
30
65
|
* means legacy/unknown; an empty array means known-none.
|
|
31
66
|
*/
|
|
32
67
|
readonly configuredToolsets?: readonly string[];
|
|
68
|
+
/** The U4a Local Agent release version, when the daemon supplied it. */
|
|
69
|
+
readonly clientVersion?: string;
|
|
70
|
+
/** Protocol versions actually advertised by this daemon. */
|
|
71
|
+
readonly protocolVersions?: readonly number[];
|
|
72
|
+
/** Runtime/auth facts from a real local probe; unknown facts are omitted. */
|
|
73
|
+
readonly runtimes?: readonly PresenceRuntimeFact[];
|
|
33
74
|
readonly observedAt: string;
|
|
34
75
|
readonly expiresAt: string;
|
|
35
76
|
}
|
|
@@ -39,6 +80,12 @@ export interface PresenceHintInput {
|
|
|
39
80
|
readonly detail?: string;
|
|
40
81
|
/** Validated logical IDs only; executable connector definitions never belong here. */
|
|
41
82
|
readonly configuredToolsets?: readonly string[];
|
|
83
|
+
/** The U4a Local Agent release version, when available. */
|
|
84
|
+
readonly clientVersion?: string;
|
|
85
|
+
/** Protocol versions actually advertised by this daemon. */
|
|
86
|
+
readonly protocolVersions?: readonly number[];
|
|
87
|
+
/** Runtime/auth facts from a real local probe; unknown facts are omitted. */
|
|
88
|
+
readonly runtimes?: readonly PresenceRuntimeFact[];
|
|
42
89
|
/** Hint lifetime. §12.7.5 suggests 60-120s for presence. */
|
|
43
90
|
readonly ttlMs: number;
|
|
44
91
|
/** Minimum time between accepted publications for this device. `0` explicitly disables throttling. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byok-sdk/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "BYOK SDK platform contracts: branded tenant identity, tenant-first store ports, device proof canonicalization, and the composition conformance reference",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|