@boldare/askdare 0.0.0-stage → 0.1.0-rc.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/CHANGELOG.md +26 -0
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/dist/cli.js +1461 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +193 -0
- package/dist/next.d.ts +86 -0
- package/dist/next.js +2864 -0
- package/dist/store.d.ts +413 -0
- package/dist/version.js +641 -0
- package/docs/attachments.md +41 -0
- package/docs/cli.md +227 -0
- package/docs/configuration.md +357 -0
- package/docs/costs.md +181 -0
- package/docs/custom-store.md +259 -0
- package/docs/deployment.md +76 -0
- package/docs/embedding.md +258 -0
- package/docs/getting-started.md +116 -0
- package/docs/going-public.md +81 -0
- package/docs/identity.md +109 -0
- package/docs/knowledge-base.md +65 -0
- package/docs/migrating-from-openai-assistant.md +43 -0
- package/docs/privacy.md +175 -0
- package/docs/protocol.md +174 -0
- package/docs/styling.md +166 -0
- package/docs/support.md +48 -0
- package/docs/texts.md +176 -0
- package/docs/themes.md +172 -0
- package/docs/tools.md +52 -0
- package/docs/troubleshooting.md +345 -0
- package/docs/voice-input.md +31 -0
- package/llms.txt +32 -0
- package/package.json +98 -3
- package/skills/askdare/SKILL.md +36 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @boldare/askdare
|
|
2
|
+
|
|
3
|
+
## 0.1.0-rc.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 13259d4: When the chat opens with a stored conversation and the server refuses the session, it shows the server's reason (explained in development) instead of "Could not load the previous conversation." The conversation stays stored for the next try.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-rc.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- da333a2: First release of askdare: an AI chat for any website, served by your Next.js app and built on the official OpenAI SDK (Responses and Conversations APIs). It succeeds `@boldare/openai-assistant`, which stopped working when OpenAI shut down the Assistants API.
|
|
14
|
+
|
|
15
|
+
- **Integration:** a bot in `askdare.config.ts` (`defineBot`), one catch-all route (`createChatHandler`) and one script tag on any website (`widget.js?bot=<id>`). `npx @boldare/askdare init` sets it up, and `npx @boldare/askdare doctor` checks the key, models, vector store, headers and allowed sites, locally or deployed.
|
|
16
|
+
- **Embedding:** a small loader and an isolated iframe served by your app, shown only on the sites in `security.allowedOrigins`. As a bubble, behind your own button (`data-launcher="none"`) or inside the page (`data-mode="inline"`), driven by `askdare('open' | 'close' | 'toggle' | 'configure' | 'identify')`.
|
|
17
|
+
- **No database:** conversations live in OpenAI's Conversations API, and the browser keeps an encrypted resume token. Visitors can start a new conversation, which deletes the old one and its files.
|
|
18
|
+
- **Knowledge base:** `npx @boldare/askdare kb sync <folder>` mirrors your documents to a vector store, and answers cite your pages.
|
|
19
|
+
- **Tools:** `defineTool` with Zod schemas, validated arguments, timeouts and output limits. Tools see only verified context.
|
|
20
|
+
- **Attachments and voice:** images and PDFs (checked by their bytes, re-encoded in the browser, referenced by encrypted handles), and dictation into the message field.
|
|
21
|
+
- **Signed-in visitors:** `askdare('identify', token)` with a JWT your backend signs.
|
|
22
|
+
- **Safety and cost:** short-lived encrypted sessions; rate limits; daily token and speech budgets per visitor, IP, bot and app, reserved per model call; a kill switch; sanitized Markdown; no cookies; no message content in logs; `onError` for your monitoring. In development, the chat and the log say what is wrong with the setup.
|
|
23
|
+
- **Look:** four themes (Aura, Halo, Sage, Care) in light and dark, your own with `defineTheme`, `--ask-*` tokens and `data-ask-part` parts for your CSS, English and Polish texts with overrides for every key, and an AI disclosure. Keyboard, focus and screen reader support, checked with axe.
|
|
24
|
+
- **Docs in the package:** the guides (`docs/`), `llms.txt` and a skill for AI coding agents (`skills/askdare`), always matching the installed version.
|
|
25
|
+
|
|
26
|
+
For limits shared across several server instances, add `@boldare/askdare-upstash`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Boldare S.A.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @boldare/askdare
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Dare to ask.** An AI chatbot for any website, served by your Next.js app and built on the official OpenAI SDK. One route file, one `<script>` tag, no database.
|
|
4
|
+
|
|
5
|
+
- Embeds anywhere through a small loader and an isolated iframe, limited to the sites you list.
|
|
6
|
+
- Secure by default: short-lived session tokens, rate limits, daily token budgets, sanitized output.
|
|
7
|
+
- Knowledge base with citations, your own tools, image and PDF attachments, voice input.
|
|
8
|
+
- Four themes in light and dark, English and Polish texts, customizable down to your own CSS.
|
|
9
|
+
|
|
10
|
+
> **Release candidate (0.1.0-rc).** The API may still change before 0.1.0; pin the exact version.
|
|
11
|
+
|
|
12
|
+
## Quick start
|
|
13
|
+
|
|
14
|
+
In a Next.js 16 app with the App Router:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @boldare/askdare@rc zod
|
|
18
|
+
npx @boldare/askdare init # route, bot config, .env.local and the chat script
|
|
19
|
+
# set OPENAI_API_KEY and ASKDARE_MODEL in .env.local
|
|
20
|
+
npm run dev
|
|
21
|
+
npx @boldare/askdare doctor # checks the key, model, permissions and headers
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`init` writes the bot definition and the route, and loads the chat in the root layout:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
// askdare.config.ts
|
|
28
|
+
import { defineBot } from '@boldare/askdare';
|
|
29
|
+
|
|
30
|
+
export const bots = [
|
|
31
|
+
defineBot({
|
|
32
|
+
id: 'support',
|
|
33
|
+
model: process.env.ASKDARE_MODEL ?? '',
|
|
34
|
+
instructions: 'You answer questions about our product. If you do not know, say so.',
|
|
35
|
+
security: { allowedOrigins: ['https://www.example.com'] },
|
|
36
|
+
widget: { theme: 'aura', greeting: 'Hi! How can I help?' },
|
|
37
|
+
}),
|
|
38
|
+
];
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// app/api/chat/[...path]/route.ts
|
|
43
|
+
import { createChatHandler } from '@boldare/askdare/next';
|
|
44
|
+
import { bots } from '../../../../askdare.config';
|
|
45
|
+
|
|
46
|
+
export const maxDuration = 300;
|
|
47
|
+
export const { GET, POST, DELETE } = createChatHandler({ bots });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Other sites embed the same chat with one tag:
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<script src="https://your-app.example.com/api/chat/widget.js?bot=support" async></script>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
The guides ship with the package in `node_modules/@boldare/askdare/docs/`, starting with `getting-started.md`; `configuration.md`, `cli.md` and `troubleshooting.md` are the references. They are also on [GitHub](https://github.com/boldare/askdare/tree/main/docs). AI coding agents can start from `node_modules/@boldare/askdare/llms.txt`, or use the skill in `node_modules/@boldare/askdare/skills/askdare/` (copy the folder into `.claude/skills/`).
|
|
59
|
+
|
|
60
|
+
## Requirements
|
|
61
|
+
|
|
62
|
+
Node.js 22 or later, Next.js 16 with the App Router on the Node.js runtime, React 19 and zod 4.1 or later. The full matrix, browsers included, is in `docs/support.md`.
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT © Boldare
|