@campfire-interactive/ai-chat 0.0.0-stage → 0.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.
@@ -0,0 +1,29 @@
1
+ import { A as AssistantEvent } from './client-Dy-v51FG.js';
2
+ export { a as AiBlock, b as AiLink, c as AiPageContext, d as AiTableColumnType, e as AiValueFormat, f as AssistantAction, g as AssistantAttachment, h as AssistantChatRequest, i as AssistantClient, j as AssistantClientOptions, k as AssistantHttpError, C as ConfirmWriteRequest, l as ConfirmWriteResponse, L as ListActionsQuery, P as PendingWrite, m as createAssistantClient } from './client-Dy-v51FG.js';
3
+
4
+ /**
5
+ * Turns the chat stream's bytes into events, one per `data:` line.
6
+ *
7
+ * The contract puts exactly one JSON object on each `data:` line, so each line
8
+ * is parsed on its own rather than joined with its neighbors the way generic
9
+ * SSE does — a hub that omits the blank separator line still parses. Network
10
+ * chunks split anywhere, including inside a UTF-8 sequence and between `\r`
11
+ * and `\n`, so the parser keeps the unfinished tail until the next chunk.
12
+ *
13
+ * Comments (`:`), `event:`, `id:` and `retry:` lines carry nothing the panel
14
+ * uses and are skipped. A line that is not JSON, or not a known event, is
15
+ * dropped rather than thrown: one bad line should not end an answer that is
16
+ * otherwise arriving.
17
+ */
18
+ declare class SseParser {
19
+ private buffer;
20
+ private readonly decoder;
21
+ /** Feed a chunk; returns every event completed by it. */
22
+ push(chunk: Uint8Array | string): AssistantEvent[];
23
+ /** The stream ended: parse whatever is left as a last line. */
24
+ flush(): AssistantEvent[];
25
+ }
26
+ /** Reads a response body to the end as assistant events. */
27
+ declare function readEvents(body: ReadableStream<Uint8Array>): AsyncGenerator<AssistantEvent>;
28
+
29
+ export { AssistantEvent, SseParser, readEvents };
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import {
2
+ AssistantHttpError,
3
+ SseParser,
4
+ createAssistantClient,
5
+ readEvents
6
+ } from "./chunk-SI3LIN2H.js";
7
+ export {
8
+ AssistantHttpError,
9
+ SseParser,
10
+ createAssistantClient,
11
+ readEvents
12
+ };
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@campfire-interactive/ai-chat",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "The platform AI chat panel for Campfire Suite apps: a docked, page-aware assistant opened from the header, answering from every app the user is granted, with typed answer blocks and confirm-to-write cards.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ },
13
+ "./host": {
14
+ "types": "./dist/host/index.d.ts",
15
+ "import": "./dist/host/index.js"
16
+ },
17
+ "./package.json": "./package.json"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsup",
24
+ "dev": "tsup --watch",
25
+ "test": "vitest run",
26
+ "typecheck": "tsc --noEmit"
27
+ },
28
+ "peerDependencies": {
29
+ "lucide-react": ">=0.460.0 <2.0.0",
30
+ "react": "^18.0.0 || ^19.0.0",
31
+ "react-dom": "^18.0.0 || ^19.0.0",
32
+ "recharts": "^2.15.0 || ^3.0.0"
33
+ },
34
+ "dependencies": {
35
+ "@campfire-interactive/design-tokens": "*",
36
+ "react-markdown": "^9.0.0",
37
+ "remark-gfm": "^4.0.0"
38
+ },
39
+ "devDependencies": {
40
+ "@testing-library/react": "^16.0.0",
41
+ "@types/react": "^19.0.0",
42
+ "@types/react-dom": "^19.0.0",
43
+ "jsdom": "^25.0.0",
44
+ "lucide-react": "^0.460.0",
45
+ "react": "^19.0.0",
46
+ "react-dom": "^19.0.0",
47
+ "recharts": "^3.10.0",
48
+ "tsup": "^8.0.0",
49
+ "typescript": "^5.0.0",
50
+ "vitest": "^2.0.0"
51
+ },
52
+ "publishConfig": {
53
+ "registry": "https://registry.npmjs.org",
54
+ "access": "public"
55
+ }
56
+ }