@diegoaltoworks/chatter 0.16.0 → 0.18.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.
- package/README.md +1 -0
- package/dist/auth/apikeys.d.ts +0 -1
- package/dist/auth/apikeys.d.ts.map +1 -1
- package/dist/bin/create-apikey.js +1 -3
- package/dist/client/__tests__/markdown.test.d.ts +5 -0
- package/dist/client/__tests__/markdown.test.d.ts.map +1 -0
- package/dist/client/src/Chat.d.ts +1 -0
- package/dist/client/src/Chat.d.ts.map +1 -1
- package/dist/client/src/markdown.d.ts +20 -0
- package/dist/client/src/markdown.d.ts.map +1 -0
- package/dist/core/retrieval.d.ts.map +1 -1
- package/dist/index.js +337 -65
- package/dist/index.mjs +337 -65
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/static/chatter.css +121 -0
- package/dist/static/chatter.js +8 -2
- package/package.json +19 -12
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
- 🤖 **RAG-Powered**: Retrieval-Augmented Generation using OpenAI embeddings and Turso vector database
|
|
19
19
|
- 🎨 **Customizable Widgets**: Pre-built chat components (ChatBot, Chat, ChatButton) with full styling control
|
|
20
|
+
- 📝 **Markdown Rendering**: Assistant replies render Markdown (headings, lists, code blocks, links) safely with HTML escaping
|
|
20
21
|
- 🔐 **Built-in API Key Management**: JWT-based API keys with CLI tool for easy creation
|
|
21
22
|
- 🔑 **Authentication Ready**: Built-in support for JWT, Clerk, and custom auth providers
|
|
22
23
|
- 📱 **Mobile Optimized**: Responsive design with iOS/Android-specific fixes
|
package/dist/auth/apikeys.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apikeys.d.ts","sourceRoot":"","sources":["../../src/auth/apikeys.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,IAAI,CAA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E,MAAM,CAAC;IACZ,+BAA+B;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,OAAO,CAAC;IACf,+BAA+B;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAa;gBAEpB,MAAM,EAAE,MAAM;IAO1B;;;;;OAKG;IACG,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwB1D;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAwBlD;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA6BvB;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;CAY5C"}
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
var import_node_crypto = require("node:crypto");
|
|
6
6
|
var import_jose = require("jose");
|
|
7
7
|
var ApiKeyManager = class {
|
|
8
|
+
secretBytes;
|
|
8
9
|
constructor(secret) {
|
|
9
|
-
this.secret = secret;
|
|
10
10
|
if (!secret) {
|
|
11
11
|
throw new Error("API key secret is required");
|
|
12
12
|
}
|
|
13
13
|
this.secretBytes = new TextEncoder().encode(secret);
|
|
14
14
|
}
|
|
15
|
-
secret;
|
|
16
|
-
secretBytes;
|
|
17
15
|
/**
|
|
18
16
|
* Create a new API key
|
|
19
17
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.test.d.ts","sourceRoot":"","sources":["../../../src/client/__tests__/markdown.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/client/src/Chat.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/client/src/Chat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,IAAI;IACf,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAC,CAAa;IAE7B,OAAO,CAAC,iBAAiB,CAAe;IACxC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,UAAU,CAAqB;gBAE3B,MAAM,EAAE,UAAU;IA8B9B,OAAO,CAAC,MAAM;IAqBd,OAAO,CAAC,oBAAoB;YA+Cd,UAAU;IAkExB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,WAAW,IAAI,WAAW,EAAE;IAI5B;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,OAAO,CAAC,QAAQ;CAGjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight, dependency-free Markdown renderer for chat messages.
|
|
3
|
+
*
|
|
4
|
+
* Designed to be safe: every piece of user/assistant text is HTML-escaped
|
|
5
|
+
* before any markdown transformation produces tags, and URLs in links are
|
|
6
|
+
* restricted to a safe scheme allowlist (http, https, mailto).
|
|
7
|
+
*
|
|
8
|
+
* Supports a pragmatic subset of GFM that's useful in chat:
|
|
9
|
+
* - ATX headings (# .. ######)
|
|
10
|
+
* - Bold (**x**, __x__) and italic (*x*, _x_)
|
|
11
|
+
* - Inline code (`code`) and fenced code blocks (```lang ... ```)
|
|
12
|
+
* - Links [text](url)
|
|
13
|
+
* - Unordered lists (-, *, +) and ordered lists (1.)
|
|
14
|
+
* - Blockquotes (> text)
|
|
15
|
+
* - Horizontal rules (---, ***, ___)
|
|
16
|
+
* - Paragraphs and hard line breaks
|
|
17
|
+
*/
|
|
18
|
+
export declare function escapeHtml(input: string): string;
|
|
19
|
+
export declare function renderMarkdown(source: string): string;
|
|
20
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/client/src/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOhD;AAgED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiGrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieval.d.ts","sourceRoot":"","sources":["../../src/core/retrieval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"retrieval.d.ts","sourceRoot":"","sources":["../../src/core/retrieval.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,KAAK,MAAM,EAAiB,MAAM,WAAW,CAAC;AAyBvD,qBAAa,WAAW;IAKpB,OAAO,CAAC,MAAM;IAJhB,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,YAAY,CAAS;gBAGnB,MAAM,EAAE,MAAM,EACtB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;IAUG,KAAK;YA6FG,kBAAkB;IA8BhC,OAAO,CAAC,MAAM,CAAC,MAAM;IAaf,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,SAAI,EAAE,OAAO,GAAE,MAAM,EAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAuB/E"}
|