@haven_ai/connect 0.8.1-alpha.0 → 0.9.0-alpha.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/index.d.cts CHANGED
@@ -652,6 +652,14 @@ interface InstalledClientCandidate {
652
652
  * whether that file exists today.
653
653
  */
654
654
  configPath: string | null;
655
+ /**
656
+ * The file the config-file evidence was found in, when this candidate
657
+ * carries that tier. Usually the same file `configPath` names — except for
658
+ * Claude Code, whose evidence lives in `~/.claude.json` while `configPath`
659
+ * stays `null` (the connector would configure it through its own CLI, not
660
+ * by writing a file it owns).
661
+ */
662
+ evidencePath?: string | null;
655
663
  evidence: 'config-file' | 'client-directory';
656
664
  }
657
665
  interface ScanInstalledClientsOptions {
@@ -661,6 +669,8 @@ interface ScanInstalledClientsOptions {
661
669
  env?: NodeJS.ProcessEnv;
662
670
  /** Injectable so the scan is testable without a populated home directory. */
663
671
  exists?: (path: string) => Promise<boolean>;
672
+ /** Injectable so the `mcpServers` evidence check is testable without a real file. */
673
+ readFile?: (path: string) => Promise<string>;
664
674
  }
665
675
  declare function scanInstalledClients(options?: ScanInstalledClientsOptions): Promise<InstalledClientCandidate[]>;
666
676
  /**
@@ -743,7 +753,7 @@ type WiringCollisionResolution = {
743
753
  action: 'abort';
744
754
  };
745
755
 
746
- declare const CONNECTOR_VERSION = "0.8.1-alpha.0";
756
+ declare const CONNECTOR_VERSION = "0.9.0-alpha.0";
747
757
  interface ConnectOptions {
748
758
  setupToken: string;
749
759
  apiBaseUrl: string;
@@ -767,6 +777,19 @@ interface ConnectOptions {
767
777
  environmentLabel?: string;
768
778
  /** #1696: wiring slug for a named MCP pair + slug-keyed credential dir. */
769
779
  serverName?: string;
780
+ /**
781
+ * #3737: derive the wiring slug from the agent's display name and install
782
+ * a NAMED pair (`haven-<slug>` / `haven-signer-<slug>`) instead of the bare
783
+ * one. The CLI passes this by default so that adding an agent never
784
+ * targets the bare pair and therefore never has to ask replace-vs-
785
+ * alongside; the LIBRARY keeps today's bare behaviour when neither
786
+ * `serverName` nor this option is set, so existing programmatic callers
787
+ * are unchanged. An explicit `serverName` always wins over derivation.
788
+ * The derived slug de-collides against EVERY directory name under the
789
+ * credential root, marks non-production backends with a `-dev` suffix
790
+ * (owner decision 4), and is refused nothing — it never displaces anyone.
791
+ */
792
+ deriveServerName?: boolean;
770
793
  /**
771
794
  * #2551: when the bare pair on this machine is already wired to a different
772
795
  * agent with a live key, replace it — re-point `haven` / `haven-signer` at
@@ -927,6 +950,16 @@ interface ConnectOutcome {
927
950
  bound_at: string;
928
951
  backend_changed: boolean;
929
952
  };
953
+ /**
954
+ * #3737, additive within schema_version 1: the hosted MCP server name this
955
+ * run actually wired — `haven-<slug>` for a named run (derived or
956
+ * explicit), bare `haven` for a `--bare` / `--replace` run. The mirror of
957
+ * what `mcpServerName` reported to the backend at register and what the
958
+ * completion text names, carried structurally so a `--json` caller can
959
+ * verify `hermes mcp test <name>` without parsing prose. Always present on
960
+ * a completed run; absent on `failedConnectOutcome`, which wired nothing.
961
+ */
962
+ server_name?: string;
930
963
  /**
931
964
  * #2091, additive within schema_version 1: `message` is the redacted human
932
965
  * refusal (automation used to get code + next_action and nothing to act
@@ -992,6 +1025,14 @@ interface ConnectDeps {
992
1025
  isStdoutTty?: boolean;
993
1026
  /** Overridable so the #1719 installed-client prompt is testable without readline. */
994
1027
  promptRuntime?: () => Promise<RuntimeId>;
1028
+ /**
1029
+ * Overridable so the DEFAULT prompt thunk is observable: the call site in
1030
+ * `runtimeSelectionPrompt` must pass the hint scan's `env` to it (#3732) —
1031
+ * the prompt rung and the `--json` refusal describe ONE machine, so they
1032
+ * must look at the same environment. Takes the full scan options, env
1033
+ * included; defaults to `resolveRuntimeByInstalledClientPrompt`.
1034
+ */
1035
+ promptRuntimeByInstalledClient?: typeof resolveRuntimeByInstalledClientPrompt;
995
1036
  /**
996
1037
  * Overridable so the #2551 replace-vs-alongside prompt is testable without
997
1038
  * readline. Reached only through the same `interactive` + TTY gate as
@@ -1032,6 +1073,8 @@ declare function completionOutcome(input: {
1032
1073
  runtimeInstall: RuntimeInstallResult;
1033
1074
  delegateAddress: string;
1034
1075
  hostedMcpUrl?: string;
1076
+ /** #3737: the resolved wiring slug; absent means the bare pair. */
1077
+ serverName?: string;
1035
1078
  supersededAgentIds?: readonly string[];
1036
1079
  /** #2551: only a replace run sets these; see the outcome fields' doc comments. */
1037
1080
  supersededAgentsRetiredLocally?: boolean;
@@ -1046,6 +1089,11 @@ declare function completionOutcome(input: {
1046
1089
  account_address: string | null;
1047
1090
  }>;
1048
1091
  serverNameReboundFrom?: ConnectOutcome['server_name_rebound_from'];
1092
+ /** #3772: set only when this run re-pointed wiring another agent held. */
1093
+ staleSession?: {
1094
+ agentIds: readonly string[];
1095
+ otherBackendAgentId?: string;
1096
+ };
1049
1097
  }): ConnectOutcome;
1050
1098
  /**
1051
1099
  * The failure record for the `--json` contract.
@@ -1194,11 +1242,11 @@ declare function isConnectError(err: unknown): err is ConnectError;
1194
1242
 
1195
1243
  declare const MCP_RUNTIME_MANIFEST: {
1196
1244
  readonly mcpPackage: "@haven_ai/mcp";
1197
- readonly mcpVersion: "0.8.1-alpha.0";
1245
+ readonly mcpVersion: "0.9.0-alpha.0";
1198
1246
  readonly sdkPackage: "@haven_ai/sdk";
1199
- readonly sdkVersion: "0.8.1-alpha.0";
1247
+ readonly sdkVersion: "0.9.0-alpha.0";
1200
1248
  readonly signerPackage: "@haven_ai/signer";
1201
- readonly signerVersion: "0.8.1-alpha.0";
1249
+ readonly signerVersion: "0.9.0-alpha.0";
1202
1250
  readonly minimumNodeVersion: "22.0.0";
1203
1251
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
1204
1252
  readonly requiredTools: readonly string[];
package/dist/index.d.ts CHANGED
@@ -652,6 +652,14 @@ interface InstalledClientCandidate {
652
652
  * whether that file exists today.
653
653
  */
654
654
  configPath: string | null;
655
+ /**
656
+ * The file the config-file evidence was found in, when this candidate
657
+ * carries that tier. Usually the same file `configPath` names — except for
658
+ * Claude Code, whose evidence lives in `~/.claude.json` while `configPath`
659
+ * stays `null` (the connector would configure it through its own CLI, not
660
+ * by writing a file it owns).
661
+ */
662
+ evidencePath?: string | null;
655
663
  evidence: 'config-file' | 'client-directory';
656
664
  }
657
665
  interface ScanInstalledClientsOptions {
@@ -661,6 +669,8 @@ interface ScanInstalledClientsOptions {
661
669
  env?: NodeJS.ProcessEnv;
662
670
  /** Injectable so the scan is testable without a populated home directory. */
663
671
  exists?: (path: string) => Promise<boolean>;
672
+ /** Injectable so the `mcpServers` evidence check is testable without a real file. */
673
+ readFile?: (path: string) => Promise<string>;
664
674
  }
665
675
  declare function scanInstalledClients(options?: ScanInstalledClientsOptions): Promise<InstalledClientCandidate[]>;
666
676
  /**
@@ -743,7 +753,7 @@ type WiringCollisionResolution = {
743
753
  action: 'abort';
744
754
  };
745
755
 
746
- declare const CONNECTOR_VERSION = "0.8.1-alpha.0";
756
+ declare const CONNECTOR_VERSION = "0.9.0-alpha.0";
747
757
  interface ConnectOptions {
748
758
  setupToken: string;
749
759
  apiBaseUrl: string;
@@ -767,6 +777,19 @@ interface ConnectOptions {
767
777
  environmentLabel?: string;
768
778
  /** #1696: wiring slug for a named MCP pair + slug-keyed credential dir. */
769
779
  serverName?: string;
780
+ /**
781
+ * #3737: derive the wiring slug from the agent's display name and install
782
+ * a NAMED pair (`haven-<slug>` / `haven-signer-<slug>`) instead of the bare
783
+ * one. The CLI passes this by default so that adding an agent never
784
+ * targets the bare pair and therefore never has to ask replace-vs-
785
+ * alongside; the LIBRARY keeps today's bare behaviour when neither
786
+ * `serverName` nor this option is set, so existing programmatic callers
787
+ * are unchanged. An explicit `serverName` always wins over derivation.
788
+ * The derived slug de-collides against EVERY directory name under the
789
+ * credential root, marks non-production backends with a `-dev` suffix
790
+ * (owner decision 4), and is refused nothing — it never displaces anyone.
791
+ */
792
+ deriveServerName?: boolean;
770
793
  /**
771
794
  * #2551: when the bare pair on this machine is already wired to a different
772
795
  * agent with a live key, replace it — re-point `haven` / `haven-signer` at
@@ -927,6 +950,16 @@ interface ConnectOutcome {
927
950
  bound_at: string;
928
951
  backend_changed: boolean;
929
952
  };
953
+ /**
954
+ * #3737, additive within schema_version 1: the hosted MCP server name this
955
+ * run actually wired — `haven-<slug>` for a named run (derived or
956
+ * explicit), bare `haven` for a `--bare` / `--replace` run. The mirror of
957
+ * what `mcpServerName` reported to the backend at register and what the
958
+ * completion text names, carried structurally so a `--json` caller can
959
+ * verify `hermes mcp test <name>` without parsing prose. Always present on
960
+ * a completed run; absent on `failedConnectOutcome`, which wired nothing.
961
+ */
962
+ server_name?: string;
930
963
  /**
931
964
  * #2091, additive within schema_version 1: `message` is the redacted human
932
965
  * refusal (automation used to get code + next_action and nothing to act
@@ -992,6 +1025,14 @@ interface ConnectDeps {
992
1025
  isStdoutTty?: boolean;
993
1026
  /** Overridable so the #1719 installed-client prompt is testable without readline. */
994
1027
  promptRuntime?: () => Promise<RuntimeId>;
1028
+ /**
1029
+ * Overridable so the DEFAULT prompt thunk is observable: the call site in
1030
+ * `runtimeSelectionPrompt` must pass the hint scan's `env` to it (#3732) —
1031
+ * the prompt rung and the `--json` refusal describe ONE machine, so they
1032
+ * must look at the same environment. Takes the full scan options, env
1033
+ * included; defaults to `resolveRuntimeByInstalledClientPrompt`.
1034
+ */
1035
+ promptRuntimeByInstalledClient?: typeof resolveRuntimeByInstalledClientPrompt;
995
1036
  /**
996
1037
  * Overridable so the #2551 replace-vs-alongside prompt is testable without
997
1038
  * readline. Reached only through the same `interactive` + TTY gate as
@@ -1032,6 +1073,8 @@ declare function completionOutcome(input: {
1032
1073
  runtimeInstall: RuntimeInstallResult;
1033
1074
  delegateAddress: string;
1034
1075
  hostedMcpUrl?: string;
1076
+ /** #3737: the resolved wiring slug; absent means the bare pair. */
1077
+ serverName?: string;
1035
1078
  supersededAgentIds?: readonly string[];
1036
1079
  /** #2551: only a replace run sets these; see the outcome fields' doc comments. */
1037
1080
  supersededAgentsRetiredLocally?: boolean;
@@ -1046,6 +1089,11 @@ declare function completionOutcome(input: {
1046
1089
  account_address: string | null;
1047
1090
  }>;
1048
1091
  serverNameReboundFrom?: ConnectOutcome['server_name_rebound_from'];
1092
+ /** #3772: set only when this run re-pointed wiring another agent held. */
1093
+ staleSession?: {
1094
+ agentIds: readonly string[];
1095
+ otherBackendAgentId?: string;
1096
+ };
1049
1097
  }): ConnectOutcome;
1050
1098
  /**
1051
1099
  * The failure record for the `--json` contract.
@@ -1194,11 +1242,11 @@ declare function isConnectError(err: unknown): err is ConnectError;
1194
1242
 
1195
1243
  declare const MCP_RUNTIME_MANIFEST: {
1196
1244
  readonly mcpPackage: "@haven_ai/mcp";
1197
- readonly mcpVersion: "0.8.1-alpha.0";
1245
+ readonly mcpVersion: "0.9.0-alpha.0";
1198
1246
  readonly sdkPackage: "@haven_ai/sdk";
1199
- readonly sdkVersion: "0.8.1-alpha.0";
1247
+ readonly sdkVersion: "0.9.0-alpha.0";
1200
1248
  readonly signerPackage: "@haven_ai/signer";
1201
- readonly signerVersion: "0.8.1-alpha.0";
1249
+ readonly signerVersion: "0.9.0-alpha.0";
1202
1250
  readonly minimumNodeVersion: "22.0.0";
1203
1251
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
1204
1252
  readonly requiredTools: readonly string[];