@anuma/sdk 1.0.0 → 1.1.1

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 (87) hide show
  1. package/README.md +54 -53
  2. package/dist/api/spec.cjs +30 -0
  3. package/dist/api/spec.d.mts +3 -0
  4. package/dist/api/spec.d.ts +3 -0
  5. package/dist/api/spec.mjs +12 -0
  6. package/dist/chunk-4ETHWSXJ.mjs +25 -0
  7. package/dist/client/index.cjs +2344 -0
  8. package/dist/client/index.d.mts +10368 -0
  9. package/dist/client/index.d.ts +10368 -0
  10. package/dist/client/index.mjs +2168 -0
  11. package/dist/clientConfig-WITO4T6L.mjs +12 -0
  12. package/dist/constants/index.cjs +30 -0
  13. package/dist/constants/index.d.mts +20 -0
  14. package/dist/constants/index.d.ts +20 -0
  15. package/dist/constants/index.mjs +5 -0
  16. package/dist/design/index.cjs +1523 -0
  17. package/dist/design/index.d.mts +561 -0
  18. package/dist/design/index.d.ts +561 -0
  19. package/dist/design/index.mjs +1468 -0
  20. package/dist/expo/chunk-3HZFU3PV.mjs +5283 -0
  21. package/dist/expo/chunk-DFVCS3QQ.mjs +246 -0
  22. package/dist/{react/chunk-MJJIYFAX.mjs → expo/chunk-GYKJOWEO.mjs} +13 -1
  23. package/dist/expo/chunk-Y7XT2VNQ.mjs +646 -0
  24. package/dist/expo/clientConfig-VPOGQRNP.mjs +12 -0
  25. package/dist/expo/consolidate-HEMQGOUD.mjs +131 -0
  26. package/dist/expo/index.cjs +16904 -6750
  27. package/dist/expo/index.d.mts +5755 -1474
  28. package/dist/expo/index.d.ts +5755 -1474
  29. package/dist/expo/index.mjs +9718 -6182
  30. package/dist/expo/recall-MCB3TVBW.mjs +8 -0
  31. package/dist/index.cjs +2992 -42
  32. package/dist/index.d.mts +7719 -1835
  33. package/dist/index.d.ts +7719 -1835
  34. package/dist/index.mjs +2859 -39
  35. package/dist/next/index.cjs +6 -2
  36. package/dist/next/index.d.mts +24 -1
  37. package/dist/next/index.d.ts +24 -1
  38. package/dist/next/index.mjs +6 -2
  39. package/dist/pii/transformers.cjs +126 -0
  40. package/dist/pii/transformers.d.mts +103 -0
  41. package/dist/pii/transformers.d.ts +103 -0
  42. package/dist/pii/transformers.mjs +90 -0
  43. package/dist/react/chunk-DFVCS3QQ.mjs +246 -0
  44. package/dist/react/chunk-ELDXIXRE.mjs +5656 -0
  45. package/dist/{expo/chunk-MJJIYFAX.mjs → react/chunk-GYKJOWEO.mjs} +13 -1
  46. package/dist/react/chunk-TP6CJZ25.mjs +645 -0
  47. package/dist/react/clientConfig-VPOGQRNP.mjs +12 -0
  48. package/dist/react/consolidate-IJH7LD2T.mjs +131 -0
  49. package/dist/react/index.cjs +25683 -11143
  50. package/dist/react/index.d.mts +7399 -1393
  51. package/dist/react/index.d.ts +7399 -1393
  52. package/dist/react/index.mjs +16709 -9196
  53. package/dist/react/recall-CSOMIT4H.mjs +8 -0
  54. package/dist/server/chunk-FMGZTVXQ.mjs +62 -0
  55. package/dist/server/chunk-G3DC7QBH.mjs +19457 -0
  56. package/dist/server/chunk-PXN5Q3MD.mjs +643 -0
  57. package/dist/server/chunk-RCCKRTBI.mjs +230 -0
  58. package/dist/server/clientConfig-GMADOBPK.mjs +12 -0
  59. package/dist/server/consolidate-A2ZIX5WF.mjs +131 -0
  60. package/dist/server/index.cjs +32161 -0
  61. package/dist/server/index.d.mts +7319 -0
  62. package/dist/server/index.d.ts +7319 -0
  63. package/dist/server/index.mjs +11217 -0
  64. package/dist/server/recall-LFYTTIIY.mjs +8 -0
  65. package/dist/tools/index.cjs +12682 -34
  66. package/dist/tools/index.d.mts +2733 -18
  67. package/dist/tools/index.d.ts +2733 -18
  68. package/dist/tools/index.mjs +12565 -33
  69. package/dist/utils/index.cjs +165 -0
  70. package/dist/utils/index.d.mts +14 -0
  71. package/dist/utils/index.d.ts +14 -0
  72. package/dist/utils/index.mjs +145 -0
  73. package/dist/vercel/index.d.mts +0 -3
  74. package/dist/vercel/index.d.ts +0 -3
  75. package/package.json +127 -16
  76. package/dist/expo/chunk-LJYAMK62.mjs +0 -25
  77. package/dist/expo/chunk-PJCZO4BQ.mjs +0 -25
  78. package/dist/expo/clientConfig-2MI4KULF.mjs +0 -10
  79. package/dist/expo/clientConfig-QDAXFL3W.mjs +0 -10
  80. package/dist/expo/clientConfig-R4IOW7I2.mjs +0 -10
  81. package/dist/react/chunk-LJYAMK62.mjs +0 -25
  82. package/dist/react/chunk-PJCZO4BQ.mjs +0 -25
  83. package/dist/react/clientConfig-2MI4KULF.mjs +0 -10
  84. package/dist/react/clientConfig-QDAXFL3W.mjs +0 -10
  85. package/dist/react/clientConfig-R4IOW7I2.mjs +0 -10
  86. package/dist/tools/chunk-KDFGY4SK.mjs +0 -13
  87. package/dist/tools/clientConfig-RMDOT5YM.mjs +0 -10
package/README.md CHANGED
@@ -1,98 +1,99 @@
1
- # @anuma/sdk
1
+ # Anuma SDK
2
2
 
3
- A TypeScript SDK that empowers developers to build AI-powered applications. It
4
- enables you to send prompts to LLMs with streaming support, manage long-term
5
- memories, and encrypt sensitive data, all without needing your own LLM API key.
3
+ A TypeScript SDK for building AI-powered applications with streaming chat
4
+ completions, long-term memory, tool calling, and end-to-end encryption.
5
+
6
+ To learn more, check out the [Documentation](https://docs.anuma.ai/).
6
7
 
7
8
  ## Installation
8
9
 
9
10
  ```bash
10
- pnpm install @anuma/sdk@next
11
+ npm install @anuma/sdk
11
12
  ```
12
13
 
13
- > **Note:** Currently, the SDK is pre-release so all new versions are released
14
- > under the `next` tag (released on every merge to the `main` branch). Check out
15
- > npm to see the latest version.
16
-
17
- ## Configuration
14
+ ### Testing prereleases
18
15
 
19
- To use the SDK, you'll need to configure your Privy provider and API URL.
16
+ Stable releases go to the default `latest` tag (the command above). Prerelease
17
+ builds for trying out unreleased changes are published to the `next` tag —
18
+ install them explicitly:
20
19
 
21
- ```env
22
- PRIVY_APP_ID=cmhwlx82v000xle0cde4rjy5y
23
- API_URL=https://portal.anuma-dev.ai
20
+ ```bash
21
+ npm install @anuma/sdk@next
24
22
  ```
25
23
 
26
- ## Authentication
24
+ These carry a `X.Y.Z-next.<timestamp>` version and never affect `latest`.
25
+ Maintainers publish them on demand via the **Publish Next (prerelease)** GitHub
26
+ Actions workflow.
27
27
 
28
- The SDK currently only supports authentication via [Privy](https://privy.io) and
29
- expects a Privy identity token.
28
+ ## Getting Started
30
29
 
31
- ```typescript
32
- import { useIdentityToken } from "@privy-io/react-auth";
33
-
34
- const { identityToken } = useIdentityToken();
35
- ```
30
+ Create an app on the [Anuma Dashboard](https://dashboard.anuma.ai/) to get your
31
+ API key or configure Privy authentication.
36
32
 
37
- ## Quick Start
33
+ ## Usage
38
34
 
39
- For React applications, use the hooks from `@anuma/sdk/react`:
35
+ ### React Hooks
40
36
 
41
- ```typescript
37
+ ```tsx
42
38
  import { useChat } from "@anuma/sdk/react";
43
39
 
44
40
  const { sendMessage, isLoading, stop } = useChat({
45
- getToken: async () => identityToken || null,
46
- onFinish: (response) => console.log("Chat finished:", response),
47
- onError: (error) => console.error("Chat error:", error),
48
- onData: (chunk) => console.log("Received chunk:", chunk),
41
+ getToken: async () => token,
42
+ onData: (chunk) => console.log(chunk),
49
43
  });
50
44
 
51
45
  await sendMessage({
52
46
  messages: [{ role: "user", content: [{ type: "text", text: "Hello!" }] }],
53
- model: "gpt-4o-mini",
47
+ model: "fireworks/accounts/fireworks/models/kimi-k2p5",
54
48
  });
55
49
  ```
56
50
 
57
- For React Native/Expo, use `@anuma/sdk/expo` instead.
51
+ ### API Functions
58
52
 
59
- For direct API access without React hooks, use the functions from this package:
60
-
61
- ```typescript
62
- import { postApiV1Responses } from "@anuma/sdk";
53
+ ```ts
54
+ import { postApiV1Responses } from "@anuma/sdk/client";
63
55
 
64
56
  const response = await postApiV1Responses({
65
57
  body: {
66
58
  messages: [
67
- { role: "user", content: [{ type: "text", text: "Tell me a joke" }] },
59
+ { role: "user", content: [{ type: "text", text: "Hello!" }] },
68
60
  ],
69
- model: "gpt-4o-mini",
61
+ model: "fireworks/accounts/fireworks/models/kimi-k2p5",
70
62
  },
71
63
  headers: {
72
- Authorization: `Bearer ${identityToken}`,
64
+ Authorization: `Bearer ${apiKey}`,
73
65
  },
74
66
  });
75
67
  ```
76
68
 
77
- ## What's Included
69
+ ### Platforms
78
70
 
79
- The SDK provides everything you need to integrate AI capabilities into your
80
- applications:
71
+ The SDK provides entry points for different platforms:
81
72
 
82
- - **Chat completions** with streaming support and tool calling
83
- - **Image generation** from text prompts
84
- - **Text embeddings** for semantic search
85
- - **Web search** integration
86
- - **PDF and image text extraction** (OCR)
87
- - **Memory and context management** for conversational AI
88
- - **Wallet-based encryption** for secure data storage
73
+ - `@anuma/sdk/react` — React hooks
74
+ - `@anuma/sdk/expo` — React Native / Expo
75
+ - `@anuma/sdk/client` — Generated API client and types
89
76
 
90
- ## Documentation
77
+ ## Features
78
+
79
+ The SDK gives you access to a unified API across multiple LLM providers through
80
+ a single integration. Key capabilities include:
91
81
 
92
- https://ai-docs.zetachain.app
82
+ - Streaming chat completions with tool calling and auto-execution
83
+ - Extended thinking and reasoning support
84
+ - Long-term memory with semantic search and encrypted storage
85
+ - Best-effort client-side PII redaction (see [PII_REDACTION.md](PII_REDACTION.md))
86
+ - Voice recording and transcription via Whisper
87
+ - PDF and image text extraction (OCR)
88
+ - Phone call integration
89
+ - End-to-end encryption with wallet-based key management
90
+ - Credit and subscription management
91
+
92
+ ## Documentation
93
93
 
94
- ## Example Usage
94
+ https://docs.anuma.ai/
95
95
 
96
- For a complete example of how to use this SDK, check out [the example
97
- repo](https://github.com/zeta-chain/ai-examples).
96
+ ## Contributing
98
97
 
98
+ Contributions are welcome. Please open an issue or pull request on
99
+ [GitHub](https://github.com/anuma-ai/sdk).
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/api/spec.ts
21
+ var spec_exports = {};
22
+ __export(spec_exports, {
23
+ spec: () => spec
24
+ });
25
+ module.exports = __toCommonJS(spec_exports);
26
+ var spec = require("@anuma/portal/swagger.json");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ spec
30
+ });
@@ -0,0 +1,3 @@
1
+ declare const spec: any;
2
+
3
+ export { spec };
@@ -0,0 +1,3 @@
1
+ declare const spec: any;
2
+
3
+ export { spec };
@@ -0,0 +1,12 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/api/spec.ts
9
+ var spec = __require("@anuma/portal/swagger.json");
10
+ export {
11
+ spec
12
+ };
@@ -0,0 +1,25 @@
1
+ // src/clientConfig.ts
2
+ var DEFAULT_BASE_URL = "https://portal.anuma-dev.ai";
3
+ function readGlobal(key) {
4
+ if (typeof globalThis === "undefined") return void 0;
5
+ const value = globalThis[key];
6
+ return typeof value === "string" && value.length > 0 ? value : void 0;
7
+ }
8
+ function resolveBaseUrl() {
9
+ const fromProcess = typeof process !== "undefined" ? process.env.API_URL || process.env.NEXT_PUBLIC_API_URL || process.env.EXPO_PUBLIC_API_URL : void 0;
10
+ const fromGlobal = readGlobal("API_URL") ?? readGlobal("NEXT_PUBLIC_API_URL") ?? readGlobal("EXPO_PUBLIC_API_URL");
11
+ return (fromProcess || fromGlobal || DEFAULT_BASE_URL).replace(/\/+$/, "");
12
+ }
13
+ var BASE_URL = resolveBaseUrl();
14
+ var MCP_R2_DOMAIN = "4cf0e0ea50b97e72386fcf2f92a2d4e8.r2.cloudflarestorage.com";
15
+ var createClientConfig = (config) => ({
16
+ ...config,
17
+ baseUrl: BASE_URL
18
+ });
19
+
20
+ export {
21
+ resolveBaseUrl,
22
+ BASE_URL,
23
+ MCP_R2_DOMAIN,
24
+ createClientConfig
25
+ };