@agentvault/muse-bridge 0.1.1 → 0.1.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/README.md CHANGED
@@ -9,9 +9,14 @@ direct messages and rooms.
9
9
 
10
10
  ## Prerequisite
11
11
 
12
- Install Muse Code and run `muse login` (or set `META_API_KEY`). The bridge
13
- copies host `~/.config/muse/auth.json` into its fence once, at first run, and
14
- never overwrites it.
12
+ Install Muse Code and set `META_API_KEY` (it always wins). `muse login` is
13
+ fine on the host, but Muse 1.0.1 stores that login in the macOS Keychain.
14
+ The bridge **does not** copy a keychain-only host `auth.json` into the fence
15
+ — that makes the child `SecItemAdd` and can pop “Keychain Not Found.”
16
+
17
+ A file `providers.meta.api_key` is harvested once into
18
+ `<dataDir>/meta-api-key.json` (mode `0600`) and forwarded as `META_API_KEY`.
19
+ It is never written to launchd/systemd.
15
20
 
16
21
  ## First enroll
17
22
 
@@ -1,10 +1,27 @@
1
- export type SeedResult = "seeded" | "already-present" | "no-host-credential";
1
+ export type SeedResult = "seeded" | "already-present" | "no-host-credential" | "host-credential-keychain-only";
2
+ /** File-backed Meta key in the fence. Undefined for missing, garbage, or keychain-only. */
3
+ export declare function readFenceMetaApiKey(fenceHome: string): string | undefined;
4
+ export type HarvestResult = "harvested" | "already-sidecar" | "none";
5
+ /** Bridge-private key file. Not under fence HOME, so Muse 1.0.1 will not migrate it. */
6
+ export declare function sidecarMetaApiKeyPath(dataDir: string): string;
7
+ export declare function readSidecarMetaApiKey(dataDir: string): string | undefined;
8
+ /**
9
+ * Muse 1.0.1 SecItemAdd-migrates a fence file api_key even when META_API_KEY is
10
+ * set (live: file+env hung; env-only rejected the key in 0.3s with no dialog).
11
+ * Keep the key in dataDir and take it out of the child's XDG auth.json.
12
+ */
13
+ export declare function harvestFenceApiKeyToSidecar(opts: {
14
+ dataDir: string;
15
+ fenceHome: string;
16
+ log?: (m: string) => void;
17
+ }): HarvestResult;
2
18
  /**
3
19
  * Copy the host's Muse credential into the agent's fence, ONCE.
4
20
  *
5
21
  * Copies auth.json alone — never host settings.json, skills, or trust.json.
6
22
  * Never overwrite an existing fence credential (a fenced child refreshes its
7
- * own token in place). Never log file contents.
23
+ * own token in place), except a keychain-only pointer: that is not a usable
24
+ * file key and would make the child SecItemAdd. Never log file contents.
8
25
  */
9
26
  export declare function seedFenceCredential(opts: {
10
27
  fenceHome: string;