@shashu-ai/sdk 1.1.1 → 1.2.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +56 -42
  2. package/NOTICE +1 -1
  3. package/README.md +7 -4
  4. package/dist/{_joiner-DGi8GsY7.d.cts → _joiner-D_FGAaoc.d.cts} +1 -1
  5. package/dist/{_joiner-DGi8GsY7.d.ts → _joiner-D_FGAaoc.d.ts} +1 -1
  6. package/dist/{chunk-TGD6KDWT.js → chunk-CWC6GQTL.js} +2 -2
  7. package/dist/{chunk-3JZXUKNA.js → chunk-K4ZIXS2U.js} +1 -1
  8. package/dist/{chunk-3GAMCQ6R.js → chunk-MLFWJAEH.js} +2 -2
  9. package/dist/{chunk-M7EMWSNS.js → chunk-MZGHCDWX.js} +2 -2
  10. package/dist/{chunk-3X5IUBIA.js → chunk-TI45NK2R.js} +2 -2
  11. package/dist/{chunk-F4CXDZQB.js → chunk-YSAQRZFP.js} +19 -6
  12. package/dist/index.cjs +26 -13
  13. package/dist/index.d.cts +17 -17
  14. package/dist/index.d.ts +17 -17
  15. package/dist/index.js +13 -13
  16. package/dist/{langchain-DKyrUjk4.d.cts → langchain-CoNoZ_vQ.d.cts} +4 -4
  17. package/dist/{langchain-QCATTIR4.d.ts → langchain-D9Xo9IMm.d.ts} +4 -4
  18. package/dist/middleware/anthropic.cjs +2 -2
  19. package/dist/middleware/anthropic.d.cts +3 -3
  20. package/dist/middleware/anthropic.d.ts +3 -3
  21. package/dist/middleware/anthropic.js +3 -3
  22. package/dist/middleware/google.cjs +1 -1
  23. package/dist/middleware/google.d.cts +2 -2
  24. package/dist/middleware/google.d.ts +2 -2
  25. package/dist/middleware/google.js +2 -2
  26. package/dist/middleware/langchain.cjs +18 -5
  27. package/dist/middleware/langchain.d.cts +3 -3
  28. package/dist/middleware/langchain.d.ts +3 -3
  29. package/dist/middleware/langchain.js +3 -3
  30. package/dist/middleware/vercel-ai.cjs +2 -2
  31. package/dist/middleware/vercel-ai.d.cts +3 -3
  32. package/dist/middleware/vercel-ai.d.ts +3 -3
  33. package/dist/middleware/vercel-ai.js +3 -3
  34. package/dist/{types-BLs_TMFv.d.cts → types-BQVfxZJP.d.cts} +7 -3
  35. package/dist/{types-BLs_TMFv.d.ts → types-BQVfxZJP.d.ts} +7 -3
  36. package/package.json +3 -4
@@ -29,9 +29,13 @@
29
29
  * has already spent its own three attempts on it.
30
30
  *
31
31
  * By default the SDK retries:
32
- * - connection-level failures reaching the gateway (the request never landed), and
32
+ * - transport failures before any request byte is sent (ECONNREFUSED, DNS,
33
+ * connect timeout), and
33
34
  * - HTTP 429 **that carries a retry time**, honoring it.
34
35
  *
36
+ * A dropped connection after the request has left is raised, not retried —
37
+ * the gateway may already have run the call.
38
+ *
35
39
  * 401/400/403/404, a 429 with no retry time, and 200-`content_filter` are never
36
40
  * retried — they are decisions, not transient failures.
37
41
  */
@@ -42,7 +46,7 @@ interface RetryPolicy {
42
46
  backoffBaseSeconds: number;
43
47
  /** Cap on any single backoff (seconds). Default 30. */
44
48
  backoffMaxSeconds: number;
45
- /** Retry connection-level failures (fetch TypeError). Default true. */
49
+ /** Retry transport failures that happen before any request byte is sent. Default true. */
46
50
  retryOnConnectionErrors: boolean;
47
51
  /** Retry HTTP 429. Default true. */
48
52
  retryOn429: boolean;
@@ -369,7 +373,7 @@ interface ShashuConfig {
369
373
  * ShashuConfigError, never a vendor host. See ./config.ts.
370
374
  */
371
375
  baseUrl?: string;
372
- /** API key (e.g. tg_sk_...). Sent as Authorization: Bearer <apiKey>; gateway handles provider routing. */
376
+ /** API key (e.g. shashu_sk_...). Sent as Authorization: Bearer <apiKey>; gateway handles provider routing. */
373
377
  apiKey?: string;
374
378
  /**
375
379
  * Callable returning the current cloud pass (string or Promise). Mutually
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@shashu-ai/sdk",
3
3
  "type": "module",
4
- "version": "1.1.1",
5
- "description": "Node.js client for SHASHU by Trustgate AI, a self-hosted AI security gateway. Point it at your own gateway; there is no default endpoint.",
4
+ "version": "1.2.0",
5
+ "description": "Node.js client for SHASHU, a self-hosted AI security gateway. Point it at your own gateway; there is no default endpoint.",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -51,7 +51,6 @@
51
51
  },
52
52
  "keywords": [
53
53
  "shashu",
54
- "trustgate",
55
54
  "self-hosted",
56
55
  "ai-gateway",
57
56
  "security",
@@ -65,7 +64,7 @@
65
64
  "homepage": "https://shashu.ai",
66
65
  "repository": {
67
66
  "type": "git",
68
- "url": "https://github.com/trustgateai-io/shashu-node.git"
67
+ "url": "https://github.com/shashu-sec/shashu-node.git"
69
68
  },
70
69
  "devDependencies": {
71
70
  "@ai-sdk/openai": "2.0.66",