@hasna/mcps 0.0.14 → 0.0.16

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.
@@ -0,0 +1,18 @@
1
+ import type { CredentialReference, CredentialReferenceMap, McpServerEntry } from "../types.js";
2
+ export declare class CredentialReferenceError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ export declare const REDACTED_CREDENTIAL_VALUE = "<redacted>";
6
+ export declare function isSecretLikeEnvKey(key: string): boolean;
7
+ export declare function isSecretLikeValue(value: string): boolean;
8
+ export declare function normalizeCredentialRef(ref: CredentialReference): CredentialReference;
9
+ export declare function normalizeCredentialRefs(refs: CredentialReferenceMap | undefined): CredentialReferenceMap;
10
+ export declare function parseCredentialRefs(value: unknown): CredentialReferenceMap;
11
+ export declare function normalizeLiteralEnv(env: Record<string, string> | undefined): Record<string, string>;
12
+ export declare function redactEnv(env: Record<string, string>): Record<string, string>;
13
+ export declare function redactServerCredentials<T extends {
14
+ env: Record<string, string>;
15
+ credentialRefs?: CredentialReferenceMap;
16
+ }>(server: T): T;
17
+ export declare function resolveServerEnv(server: McpServerEntry): Record<string, string>;
18
+ export declare function credentialRefPlaceholders(refs: CredentialReferenceMap | undefined): Record<string, string>;
@@ -1,4 +1,5 @@
1
1
  import type { McpServerEntry } from "../types.js";
2
+ import { type LocalCommandConsent } from "./local-command-consent.js";
2
3
  export interface DoctorCheck {
3
4
  name: string;
4
5
  pass: boolean;
@@ -11,4 +12,6 @@ export interface DoctorReport {
11
12
  checks: DoctorCheck[];
12
13
  healthy: boolean;
13
14
  }
14
- export declare function diagnoseServer(server: McpServerEntry): Promise<DoctorReport>;
15
+ export declare function diagnoseServer(server: McpServerEntry, options?: {
16
+ localCommandConsent?: LocalCommandConsent;
17
+ }): Promise<DoctorReport>;
@@ -1,8 +1,12 @@
1
1
  import type { McpServerEntry } from "../types.js";
2
+ import { type LocalCommandConsent } from "./local-command-consent.js";
2
3
  export type AgentTarget = "claude" | "codex" | "gemini";
3
4
  export interface InstallResult {
4
5
  agent: AgentTarget;
5
6
  success: boolean;
6
7
  error?: string;
7
8
  }
8
- export declare function installToAgents(entry: McpServerEntry, targets?: AgentTarget[]): InstallResult[];
9
+ export interface InstallToAgentsOptions {
10
+ localCommandConsent?: LocalCommandConsent;
11
+ }
12
+ export declare function installToAgents(entry: McpServerEntry, targets?: AgentTarget[], options?: InstallToAgentsOptions): InstallResult[];
@@ -0,0 +1,38 @@
1
+ import type { McpServerEntry } from "../types.js";
2
+ export type LocalCommandOperation = "register" | "install" | "launch" | "diagnose";
3
+ export type LocalCommandRiskSeverity = "warning" | "danger";
4
+ export interface LocalCommandInput {
5
+ command: string;
6
+ args?: string[];
7
+ env?: Record<string, string>;
8
+ transport?: McpServerEntry["transport"];
9
+ operation?: LocalCommandOperation;
10
+ }
11
+ export interface LocalCommandConsent {
12
+ approved?: boolean;
13
+ allowRisky?: boolean;
14
+ source?: string;
15
+ }
16
+ export interface LocalCommandRisk {
17
+ code: string;
18
+ severity: LocalCommandRiskSeverity;
19
+ message: string;
20
+ evidence?: string;
21
+ }
22
+ export interface LocalCommandReview {
23
+ requiresConsent: boolean;
24
+ operation: LocalCommandOperation;
25
+ command: string;
26
+ args: string[];
27
+ displayCommand: string;
28
+ envKeys: string[];
29
+ risks: LocalCommandRisk[];
30
+ hasDangerousRisk: boolean;
31
+ }
32
+ export declare class LocalCommandConsentError extends Error {
33
+ readonly review: LocalCommandReview;
34
+ constructor(message: string, review: LocalCommandReview);
35
+ }
36
+ export declare function inspectLocalCommand(input: LocalCommandInput): LocalCommandReview;
37
+ export declare function formatLocalCommandReview(review: LocalCommandReview): string;
38
+ export declare function assertLocalCommandConsent(input: LocalCommandInput, consent?: LocalCommandConsent): LocalCommandReview;
@@ -1,5 +1,9 @@
1
+ import { type LocalCommandConsent } from "./local-command-consent.js";
1
2
  import type { McpServerEntry, McpTool, ConnectedServer } from "../types.js";
2
- export declare function connectToServer(entry: McpServerEntry): Promise<ConnectedServer>;
3
+ export interface ConnectOptions {
4
+ localCommandConsent?: LocalCommandConsent;
5
+ }
6
+ export declare function connectToServer(entry: McpServerEntry, options?: ConnectOptions): Promise<ConnectedServer>;
3
7
  export declare function disconnectServer(id: string): Promise<void>;
4
8
  export declare function disconnectAll(): Promise<void>;
5
9
  export declare function listAllTools(): McpTool[];
@@ -10,4 +14,4 @@ export declare function callTool(prefixedName: string, args: Record<string, unkn
10
14
  }>;
11
15
  }>;
12
16
  export declare function refreshTools(id: string): Promise<McpTool[]>;
13
- export declare function connectAllEnabled(): Promise<ConnectedServer[]>;
17
+ export declare function connectAllEnabled(options?: ConnectOptions): Promise<ConnectedServer[]>;
@@ -1,13 +1,15 @@
1
- import type { McpServerEntry, AddServerOptions } from "../types.js";
1
+ import type { CredentialReference, McpServerEntry, AddServerOptions } from "../types.js";
2
2
  export declare function addServer(opts: AddServerOptions): McpServerEntry;
3
3
  export declare function removeServer(id: string): void;
4
4
  export declare function listServers(): McpServerEntry[];
5
5
  export declare function getServer(id: string): McpServerEntry | null;
6
- export declare function updateServer(id: string, updates: Partial<Pick<McpServerEntry, "name" | "description" | "command" | "args" | "env" | "transport" | "url" | "enabled">>): McpServerEntry;
6
+ export declare function updateServer(id: string, updates: Partial<Pick<McpServerEntry, "name" | "description" | "command" | "args" | "env" | "credentialRefs" | "transport" | "url" | "enabled">>): McpServerEntry;
7
7
  export declare function enableServer(id: string): McpServerEntry;
8
8
  export declare function disableServer(id: string): McpServerEntry;
9
9
  export declare function setServerEnv(id: string, key: string, value: string): void;
10
10
  export declare function unsetServerEnv(id: string, key: string): void;
11
+ export declare function setServerCredentialRef(id: string, key: string, ref: CredentialReference): void;
12
+ export declare function unsetServerCredentialRef(id: string, key: string): void;
11
13
  export declare function cacheTools(serverId: string, tools: Array<{
12
14
  name: string;
13
15
  description: string;
@@ -1,4 +1,7 @@
1
+ import { type LocalCommandConsent } from "./local-command-consent.js";
1
2
  import type { RegistryServer, McpServerEntry } from "../types.js";
2
3
  export declare function searchRegistry(query: string): Promise<RegistryServer[]>;
3
4
  export declare function getRegistryServer(id: string): Promise<RegistryServer | null>;
4
- export declare function installFromRegistry(id: string): Promise<McpServerEntry>;
5
+ export declare function installFromRegistry(id: string, options?: {
6
+ localCommandConsent?: LocalCommandConsent;
7
+ }): Promise<McpServerEntry>;