@chipmobilesdk/rn-ai 0.1.0 → 0.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.
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@chipmobilesdk/rn-ai",
3
- "version": "0.1.0",
4
- "private": false,
5
- "license": "UNLICENSED",
6
- "main": "src/index.ts",
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "license": "UNLICENSED",
6
+ "main": "src/index.ts",
7
7
  "types": "src/index.ts",
8
8
  "exports": {
9
9
  ".": {
@@ -19,6 +19,7 @@
19
19
  "src/core",
20
20
  "src/react",
21
21
  "src/diagnostics",
22
+ "skills",
22
23
  "README.md",
23
24
  "CHANGELOG.md"
24
25
  ],
@@ -35,8 +36,8 @@
35
36
  "engines": {
36
37
  "node": ">=22.11.0"
37
38
  },
38
- "publishConfig": {
39
- "access": "public",
40
- "registry": "https://registry.npmjs.org/"
41
- }
42
- }
39
+ "publishConfig": {
40
+ "access": "public",
41
+ "registry": "https://registry.npmjs.org/"
42
+ }
43
+ }
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: sdk-rn-ai
3
+ description: "AI chat and quota via @chipmobilesdk/rn-ai: createAiClient, useAiChat, useAiQuota, streaming status, AI error codes. Use when adding an AI chat feature, showing quota, or handling AI request failures and cancellation."
4
+ metadata:
5
+ package: "@chipmobilesdk/rn-ai"
6
+ packageVersion: "0.1.0"
7
+ user-invocable: true
8
+ disable-model-invocation: false
9
+ ---
10
+
11
+ # @chipmobilesdk/rn-ai
12
+
13
+ Client and React hooks for AI chat backed by the gateway, including quota reporting
14
+ and a typed error model.
15
+
16
+ ## Use this when
17
+
18
+ - Adding an AI chat screen or message composer
19
+ - Displaying remaining quota
20
+ - Handling AI request failure, cancellation, or streaming state
21
+ - Localising AI-related user messages
22
+
23
+ ## The app owns more than you expect
24
+
25
+ This package deliberately does not handle everything. The README has an
26
+ `## App responsibilities` section listing what the consuming app must implement —
27
+ read it before assuming a behaviour is built in.
28
+
29
+ ## Cancellation is required, not optional
30
+
31
+ `useAiChat` exposes streaming status. An in-flight request MUST be cancelled when the
32
+ screen unmounts, otherwise the response resolves against a dead component. Verify
33
+ teardown on every screen that uses it.
34
+
35
+ ## Public API (v0.1.0)
36
+
37
+ Runtime:
38
+
39
+ - `createAiClient(...)` — transport-level client
40
+ - `useAiChat(...)` → `UseAiChatResult`, with `AiChatStatus` for state
41
+ - `useAiQuota(...)` → `UseAiQuotaResult`
42
+ - `AiError`, `isAiError` — narrow before reading `AiErrorCode`
43
+ - `aiMessages`, `aiMessage` — user-facing strings keyed by `AiMessageKey`
44
+
45
+ Use `aiMessage` for anything shown to the user. Never render `AiError.message` directly.
46
+
47
+ ## Where the detail lives
48
+
49
+ Read one section of `node_modules/@chipmobilesdk/rn-ai/README.md`:
50
+
51
+ | Need | Section |
52
+ |---|---|
53
+ | First integration | `## Install`, `## Setup` |
54
+ | Streaming, retries, timeouts | `## Runtime behavior` |
55
+ | Full export list | `## Public API` |
56
+ | What the app must implement | `## App responsibilities` |
57
+ | Version/peer constraints | `## Compatibility` |