@geohar/un-bien 0.7.0 → 0.9.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 +237 -268
- package/dist/bin/launcher.js +38 -0
- package/dist/bin/launcher.js.map +1 -0
- package/dist/config.d.ts +41 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon/install.d.ts +33 -35
- package/dist/daemon/install.js +43 -73
- package/dist/daemon/install.js.map +1 -1
- package/dist/enrich_tool_args.d.ts +9 -0
- package/dist/enrich_tool_args.js +171 -0
- package/dist/enrich_tool_args.js.map +1 -0
- package/dist/image_codec.d.ts +22 -0
- package/dist/image_codec.js +149 -0
- package/dist/image_codec.js.map +1 -0
- package/dist/index.d.ts +0 -26
- package/dist/index.js +235 -1237
- package/dist/index.js.map +1 -1
- package/dist/launch.d.ts +34 -0
- package/dist/launch.js +171 -0
- package/dist/launch.js.map +1 -0
- package/dist/launcher/launcher.d.ts +6 -0
- package/dist/launcher/launcher.js +188 -0
- package/dist/launcher/launcher.js.map +1 -0
- package/dist/pairing/crypto.d.ts +4 -0
- package/dist/pairing/crypto.js +10 -0
- package/dist/pairing/crypto.js.map +1 -1
- package/dist/pairing/peer_trust.d.ts +20 -0
- package/dist/pairing/peer_trust.js +82 -0
- package/dist/pairing/peer_trust.js.map +1 -0
- package/dist/pairing/storage.d.ts +51 -26
- package/dist/pairing/storage.js +346 -136
- package/dist/pairing/storage.js.map +1 -1
- package/dist/panel_bridge.d.ts +3 -1
- package/dist/panel_bridge.js +10 -10
- package/dist/panel_bridge.js.map +1 -1
- package/dist/rooms.d.ts +16 -0
- package/dist/rooms.js +22 -0
- package/dist/rooms.js.map +1 -1
- package/dist/session/debug_log.js +2 -2
- package/dist/session/debug_log.js.map +1 -1
- package/dist/session/local_config.js +2 -0
- package/dist/session/local_config.js.map +1 -1
- package/dist/session/rpc_envelope.d.ts +18 -0
- package/dist/session/rpc_envelope.js +1 -1
- package/dist/session/rpc_envelope.js.map +1 -1
- package/dist/session/rpc_inbound.d.ts +2 -2
- package/dist/session/rpc_inbound.js +1 -1
- package/dist/session/rpc_inbound.js.map +1 -1
- package/dist/subagent_rooms.d.ts +49 -0
- package/dist/subagent_rooms.js +787 -0
- package/dist/subagent_rooms.js.map +1 -0
- package/dist/transport/peer_channel.d.ts +7 -1
- package/dist/transport/peer_channel.js +8 -1
- package/dist/transport/peer_channel.js.map +1 -1
- package/dist/transport/relay_client.d.ts +19 -0
- package/dist/transport/relay_client.js.map +1 -1
- package/docs/daemon.md +65 -64
- package/package.json +13 -11
- package/service-templates/launchd.plist.template +5 -5
- package/service-templates/systemd.service.template +2 -2
- package/service-templates/task-launcher.vbs.template +5 -5
- package/service-templates/task-scheduler.xml.template +1 -1
- package/dist/bin/supervisord.js +0 -86
- package/dist/bin/supervisord.js.map +0 -1
- package/dist/daemon/client.d.ts +0 -20
- package/dist/daemon/client.js +0 -131
- package/dist/daemon/client.js.map +0 -1
- package/dist/daemon/control_protocol.d.ts +0 -176
- package/dist/daemon/control_protocol.js +0 -63
- package/dist/daemon/control_protocol.js.map +0 -1
- package/dist/daemon/cron_log.d.ts +0 -45
- package/dist/daemon/cron_log.js +0 -71
- package/dist/daemon/cron_log.js.map +0 -1
- package/dist/daemon/cron_registry.d.ts +0 -80
- package/dist/daemon/cron_registry.js +0 -198
- package/dist/daemon/cron_registry.js.map +0 -1
- package/dist/daemon/id.d.ts +0 -24
- package/dist/daemon/id.js +0 -36
- package/dist/daemon/id.js.map +0 -1
- package/dist/daemon/registry.d.ts +0 -63
- package/dist/daemon/registry.js +0 -153
- package/dist/daemon/registry.js.map +0 -1
- package/dist/daemon/rpc_child.d.ts +0 -194
- package/dist/daemon/rpc_child.js +0 -419
- package/dist/daemon/rpc_child.js.map +0 -1
- package/dist/daemon/supervisor.d.ts +0 -93
- package/dist/daemon/supervisor.js +0 -666
- package/dist/daemon/supervisor.js.map +0 -1
- /package/dist/bin/{supervisord.d.ts → launcher.d.ts} +0 -0
|
@@ -13,6 +13,13 @@ export declare class KeyringUnavailableError extends Error {
|
|
|
13
13
|
export declare class PairedIdentityMissingError extends Error {
|
|
14
14
|
constructor(pairedCount: number, cause: unknown);
|
|
15
15
|
}
|
|
16
|
+
/** Raised when the file-backend identity EXISTS but cannot be read or parsed
|
|
17
|
+
* (bad permissions, corruption). Treating that as "no identity" would let the
|
|
18
|
+
* resolver mint a fresh seed over a real one — the file-side version of the
|
|
19
|
+
* flop — so we FAIL LOUD instead of minting. */
|
|
20
|
+
export declare class FileIdentityUnreadableError extends Error {
|
|
21
|
+
constructor(path: string, cause: unknown);
|
|
22
|
+
}
|
|
16
23
|
/**
|
|
17
24
|
* Minimal backend interface for credential reads/writes. Swappable so
|
|
18
25
|
* tests can inject a controlled in-memory store without touching the OS
|
|
@@ -40,36 +47,54 @@ export declare function _setKeyringExpectedForTest(value: boolean | null): void;
|
|
|
40
47
|
/** Test-only: shrink retry attempts/delay so the persistent-failure path is
|
|
41
48
|
* fast. `null`/omitted restores defaults. */
|
|
42
49
|
export declare function _setKeyringRetryForTest(attempts: number | null, delayMs?: number): void;
|
|
50
|
+
export type IdentityStorageBackend = "keychain" | "file";
|
|
43
51
|
/**
|
|
44
|
-
* Returns
|
|
45
|
-
* first
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* `KeyringUnavailableError` instead of minting a new key — generating
|
|
65
|
-
* there silently breaks existing pairing (the "lost pairing after idle"
|
|
66
|
-
* bug). `UNBIEN_ALLOW_FILE_IDENTITY=1` opts back into a file identity
|
|
67
|
-
* for headless macOS/Windows hosts.
|
|
52
|
+
* Returns this Pi's long-term Ed25519 identity, minting one only on a genuine
|
|
53
|
+
* first run. The seed is portable and its public key (epk) is what the relay
|
|
54
|
+
* routes on and what devices pair against — so this resolver's ONE job is to
|
|
55
|
+
* never change the identity out from under an existing pairing (the "flop").
|
|
56
|
+
*
|
|
57
|
+
* Resolution (operator-selectable backend — see design):
|
|
58
|
+
* 0. `UNBIEN_IDENTITY_SEED` env override — always wins, read-only.
|
|
59
|
+
* 1. The SELECTED backend (`identity.storage`, default keychain): keychain
|
|
60
|
+
* (retried — a locked Keychain throws, which is NOT "empty") or the 0600
|
|
61
|
+
* file at `identity.path`.
|
|
62
|
+
* 2. Migration READ-IN-PLACE of the OTHER backend — recovers an existing
|
|
63
|
+
* identity (a keychain key when file is selected, or a file when keychain
|
|
64
|
+
* is selected) WITHOUT writing it through.
|
|
65
|
+
* 3. Generate + persist to the selected backend, but ONLY when every
|
|
66
|
+
* consulted source was genuinely empty. A keychain that THREW on a
|
|
67
|
+
* core-OS-keyring platform (macOS/Windows) is possibly-present →
|
|
68
|
+
* `KeyringUnavailableError`, never minted over. Existing pairings →
|
|
69
|
+
* `PairedIdentityMissingError`. A present-but-unreadable file →
|
|
70
|
+
* `FileIdentityUnreadableError`. This is write-only-if-nonexistent: the
|
|
71
|
+
* resolver's only mutation is a genuine-first-run mint.
|
|
68
72
|
*
|
|
69
|
-
* Idempotent
|
|
70
|
-
*
|
|
73
|
+
* Idempotent. On headless Linux / a Bun-built pi (no usable keyring) the file
|
|
74
|
+
* backend is used automatically.
|
|
71
75
|
*/
|
|
72
76
|
export declare function getOrCreateEd25519Keypair(): Promise<Ed25519Keypair>;
|
|
77
|
+
export interface IdentityInfo {
|
|
78
|
+
/** Base64 Ed25519 public key (epk) — PUBLIC, safe to display. `null` when no
|
|
79
|
+
* identity exists yet (one is minted on first real use). */
|
|
80
|
+
readonly epk: string | null;
|
|
81
|
+
/** The selected/effective storage backend. */
|
|
82
|
+
readonly backend: IdentityStorageBackend;
|
|
83
|
+
/** Where the identity resolved from (or would come from). */
|
|
84
|
+
readonly source: "env-override" | "keychain" | "file" | "none" | "error";
|
|
85
|
+
/** Resolved file-backend path. */
|
|
86
|
+
readonly filePath: string;
|
|
87
|
+
/** Human note (migration recovery, error cause, first-run hint). */
|
|
88
|
+
readonly detail?: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Reports the CURRENT identity state WITHOUT minting or mutating anything — the
|
|
92
|
+
* read-only backing for `unbien identity show`. Returns only NON-SECRET fields
|
|
93
|
+
* (epk is public); the private seed is NEVER included, since command output is
|
|
94
|
+
* LLM-visible. Read errors are surfaced as `source:"error"` with a `detail`,
|
|
95
|
+
* not thrown — this is a diagnostic.
|
|
96
|
+
*/
|
|
97
|
+
export declare function describeIdentity(): Promise<IdentityInfo>;
|
|
73
98
|
export interface PeerRecord {
|
|
74
99
|
name: string;
|
|
75
100
|
remote_epk: string;
|