@agentvault/claude-bridge 0.7.16 → 0.8.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/dist/bridge.d.ts CHANGED
@@ -167,6 +167,15 @@ export declare function attachLifecycle(channel: LifecycleChannel, opts?: {
167
167
  onTerminal?: (reason: string, o: {
168
168
  restart: boolean;
169
169
  }) => void;
170
+ /** #913 item 2 — remove this agent's supervised service when its device is
171
+ * gone for good. Injected for tests; defaults to the real remover, because
172
+ * an opt-in default is a feature nobody gets.
173
+ *
174
+ * Every terminal reason is offered to it and IT decides. Filtering here as
175
+ * well would put the same rule in two files, and the two would eventually
176
+ * disagree — which is how `session_replaced` (device still alive) would end
177
+ * up removing a healthy install. */
178
+ selfUninstall?: (reason: string, env: NodeJS.ProcessEnv) => boolean;
170
179
  }): void;
171
180
  /**
172
181
  * Slice 2 Plan C (Task 11) — one drain of the local-approval marker dir.
package/dist/config.d.ts CHANGED
@@ -1,9 +1,51 @@
1
+ /**
2
+ * Package-manager scratch caches. `service/subcommand.ts` bakes `process.argv[1]`
3
+ * into the launcher script, so a service installed from one of these points at a
4
+ * directory the package manager later prunes — it works today and dies weeks later
5
+ * with nothing naming the cause.
6
+ *
7
+ * A DENYLIST, not proof of durability: it covers npm's npx cache, pnpm/yarn `dlx`,
8
+ * `bunx`, and anything under the OS temp dir. Other ephemeral runners are knowingly
9
+ * unhandled.
10
+ *
11
+ * Ported from the grok fork (#909, #921). This bridge had no such guard at all,
12
+ * while running the same bake-argv[1]-into-the-launcher install.
13
+ */
14
+ export declare function isEphemeralEntrypoint(entrypoint: string): boolean;
15
+ /** Throw unless `entrypoint` is durable enough to bake into a supervised service. */
16
+ export declare function assertInstallableEntrypoint(entrypoint: string): void;
17
+ /**
18
+ * #913 item 3 — the device id inside this data dir's credentials, or null.
19
+ *
20
+ * Lives HERE, beside CRED_FILES and BACKUP_FILE, because this module already
21
+ * owns the knowledge of which files hold credentials. `doctor` reading those
22
+ * names itself would make a second copy of the list, and the copy that is not
23
+ * next to the constant is the one that goes stale.
24
+ *
25
+ * Checks the same files in the same order as hasPersistedCreds, INCLUDING the
26
+ * .bak: a device_revoked wipe deletes agentvault.json and leaves the backup, so
27
+ * the .bak is exactly where the id lives for the machine most likely to be
28
+ * running doctor.
29
+ *
30
+ * Returns null rather than throwing on missing/unreadable/malformed input — a
31
+ * doctor that dies on one bad file reports nothing about the others.
32
+ */
33
+ export declare function readPersistedDeviceId(dataDir: string): string | null;
1
34
  export declare function hasPersistedCreds(dataDir: string): boolean;
2
35
  export declare function slugify(name: string): string;
3
36
  export type DataDirSource = "explicit" | "per-agent" | "legacy";
37
+ /** Where the agent name came from.
38
+ *
39
+ * #927's test for a safe default is: can a reader of the output tell the input
40
+ * was MISSING? A bare `agentName` cannot answer that — "Claude" reads the same
41
+ * whether the customer typed it or the bridge chose it. This field is what
42
+ * makes the two distinguishable, so callers can SAY which one happened. */
43
+ export type AgentNameSource = "supplied" | "defaulted";
4
44
  export declare function resolveDataDir(env: NodeJS.ProcessEnv): {
5
45
  dataDir: string;
6
46
  source: DataDirSource;
47
+ agentName: string;
48
+ agentNameSource: AgentNameSource;
7
49
  };
8
50
  export interface BridgeConfig {
9
51
  inviteToken: string;
@@ -11,6 +53,8 @@ export interface BridgeConfig {
11
53
  dataDirSource: DataDirSource;
12
54
  apiUrl: string;
13
55
  agentName: string;
56
+ /** Whether AV_AGENT_NAME was given, or the package default was used (#927). */
57
+ agentNameSource: AgentNameSource;
14
58
  roomFilter?: string;
15
59
  model?: string;
16
60
  systemPrompt?: string;