@agentvault/grok-bridge 0.4.31 → 0.4.33

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,37 @@
1
+ /**
2
+ * #1560 — name the cause of a failed Grok turn with a code from the shared
3
+ * closed set (`TURN_FAILURE_CODES` in the plugin). The code is all that leaves
4
+ * this file: the error's text is read here, in memory, and never kept,
5
+ * returned, logged or sent.
6
+ *
7
+ * WHAT THE CLI SENDS. A failed `session/prompt` comes back as a JSON-RPC error
8
+ * whose `data` carries the provider's HTTP answer, e.g. (observed live on
9
+ * ohtani, 2026-08-18):
10
+ *
11
+ * {"code":-32603,"message":"Internal error",
12
+ * "data":"Unauthorized (401) from https://cli-chat-proxy.grok.com/v1/responses: Invalid or expired credentials ..."}
13
+ *
14
+ * Only that 401 has been seen live. The other statuses rely on the same
15
+ * "<Reason> (<status>) from <url>" shape: grok 1.0.46's binary holds the
16
+ * reason table ("Payment Required (", "Too Many Requests (", "Service
17
+ * Unavailable (", ...) beside that format. A status the CLI does not say
18
+ * plainly (403, 404) stays `model_error` — never guess.
19
+ *
20
+ * Every code is a literal `return "<code>"`, so the plugin's tool-error-codes
21
+ * scan sees each one this file can emit.
22
+ */
23
+ import type { TurnFailureCode } from "@agentvault/agentvault";
24
+ export declare function classifyGrokFailure(err: unknown): TurnFailureCode;
25
+ /**
26
+ * Review S1: one log line for a fatal grok error: code, exit status, error
27
+ * class and, for a JSON-RPC refusal, our own method name and the numeric RPC
28
+ * code. Never the message: an AcpRpcError's message embeds the provider's
29
+ * `data` (an expired xAI sign-in landed in the log on every restart).
30
+ */
31
+ export declare function grokFatalLine(err: unknown): string;
32
+ /** True when an error may carry text from the Grok CLI or its provider, so
33
+ * only {@link grokFatalLine} may describe it. */
34
+ export declare function mayCarryProviderText(err: unknown): boolean;
35
+ /** The CLI's exit status when it died mid-turn; undefined otherwise. */
36
+ export declare function grokFailureExitCode(err: unknown): number | undefined;
37
+ //# sourceMappingURL=turn-failure.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentvault/grok-bridge",
3
- "version": "0.4.31",
3
+ "version": "0.4.33",
4
4
  "type": "module",
5
5
  "description": "AgentVault Grok Bridge — daemon bridging a Grok agent into E2E-encrypted AgentVault direct messages and rooms.",
6
6
  "main": "dist/index.js",