keyring-agent-core 0.2.47 → 0.2.48

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.ts CHANGED
@@ -2090,6 +2090,16 @@ interface WebsiteTrustKeyringAgentConfig {
2090
2090
  llm?: LLMProviderConfig;
2091
2091
  /** Bring your own LLM provider (e.g. a shared instance). Overrides `llm`. */
2092
2092
  provider?: LLMProvider;
2093
+ /**
2094
+ * License key gating use of the Keyring-hosted Gemini proxy, exactly as in
2095
+ * {@link AgentCore.secretKey}. Validated lazily on the first
2096
+ * {@link WebsiteTrustKeyringAgent.chat} call, never in the constructor.
2097
+ *
2098
+ * Optional ONLY in bring-your-own-key mode — when {@link LLMProviderConfig.apiKey}
2099
+ * is set, calls go straight to Google, consume none of our proxy, and the gate is
2100
+ * waived. Without an `llm.apiKey`, this is required.
2101
+ */
2102
+ secretKey?: string;
2093
2103
  /**
2094
2104
  * The ecosystem the input URLs belong to. Every URL handed to this agent is a
2095
2105
  * site that integrates WalletConnect — i.e. a blockchain / Web3 dApp — so the
@@ -2201,7 +2211,29 @@ declare class WebsiteTrustKeyringAgent {
2201
2211
  private readonly debug;
2202
2212
  /** Ecosystem prior scoping every search-grounded call (see {@link DEFAULT_ECOSYSTEM_CONTEXT}). */
2203
2213
  private readonly ecosystem;
2214
+ /** Caller-supplied license key; validated lazily on first chat() via assertLicense(). */
2215
+ private readonly secretKey;
2216
+ /**
2217
+ * True when the caller supplied their own Gemini API key (`llm.apiKey`), so
2218
+ * every LLM call goes straight to Google and the licence gate does not apply.
2219
+ */
2220
+ private readonly ownGeminiKey;
2221
+ /** True once the license has passed, so we only hash-check once. */
2222
+ private licenseChecked;
2204
2223
  constructor(config?: WebsiteTrustKeyringAgentConfig);
2224
+ /**
2225
+ * Validate the license key against the hash baked into this bundle at build
2226
+ * time (`__AGENT_LICENSE_HASH__`, set by tsup from `SECRET_KEY_HASH`). The
2227
+ * app passes the raw key; we hash it here and compare hash-to-hash, so
2228
+ * neither the bundle nor the repo ever holds the key itself. When no hash was
2229
+ * baked in (local dev build with no `SECRET_KEY_HASH`) the gate is a no-op.
2230
+ * Cached after the first pass so we only hash once.
2231
+ *
2232
+ * The gate exists to protect the Keyring-hosted Gemini proxy. A caller that
2233
+ * brings their own Gemini API key (`llm.apiKey`) talks to Google directly and
2234
+ * consumes nothing of ours, so no secretKey is required in that mode.
2235
+ */
2236
+ private assertLicense;
2205
2237
  chat(input: WebsiteTrustInput): Promise<WebsiteTrustResult>;
2206
2238
  /**
2207
2239
  * Derive the phishing verdict + raw (English) evidence reasons from the