Skip to content

Commit 7620002

Browse files
authored
Prepare packages for npm publishing (#19)
- Add metadata (description, license, repository, homepage, keywords), files whitelist, and publishConfig to all 4 public package.json files - Fix widget types path (ariontalk.d.ts → index.d.ts) and build script to emit declarations after vite build instead of before - Add per-package README.md files for npm package pages - Add verify-packages.sh script to inspect tarballs for source code leaks, sensitive files, and workspace reference resolution - Add publish-packages.sh script for dependency-ordered publishing with --dry-run support
1 parent 1a15a86 commit 7620002

11 files changed

Lines changed: 459 additions & 4 deletions

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"website-build": "pnpm --filter @ariontalk/website build",
1212
"website-preview": "pnpm --filter @ariontalk/website preview",
1313
"deploy-website": "./scripts/deploy-website.sh",
14-
"deploy-token-server": "./scripts/deploy-token-server.sh"
14+
"deploy-token-server": "./scripts/deploy-token-server.sh",
15+
"verify-packages": "./scripts/verify-packages.sh",
16+
"publish-packages": "./scripts/publish-packages.sh"
1517
},
1618
"devDependencies": {
1719
"@changesets/cli": "^2.27.0"

packages/core/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# @ariontalk/core
2+
3+
Headless voice AI engine with page understanding — services, types, and session logic.
4+
5+
## Install
6+
7+
```bash
8+
npm install @ariontalk/core
9+
```
10+
11+
## Usage
12+
13+
```js
14+
import { VoiceEngine, isVoiceChatSupported } from '@ariontalk/core';
15+
16+
const engine = new VoiceEngine();
17+
18+
if (isVoiceChatSupported(engine)) {
19+
await engine.startSession('en');
20+
}
21+
```
22+
23+
### Key exports
24+
25+
- **`VoiceEngine`** — local browser-based voice engine (Web Speech API)
26+
- **`isVoiceChatSupported(engine)`** — check browser capabilities before starting
27+
- **`EnergyBargeInDetector`** — energy-based barge-in detection plugin
28+
- **`createLogger` / `setLogLevel`** — logging utilities
29+
- **Types**`SupportedLang`, `VoiceEngineState`, `VoiceSettings`, `BargeInDetector`, and more
30+
31+
## License
32+
33+
MIT — see [LICENSE](https://github.com/luixaviles/ariontalk/blob/main/LICENSE)
34+
35+
## Links
36+
37+
- [ariontalk.com](https://ariontalk.com)
38+
- [GitHub](https://github.com/luixaviles/ariontalk)

packages/core/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
22
"name": "@ariontalk/core",
33
"version": "0.1.0",
4+
"description": "Headless voice AI engine with page understanding — services, types, and session logic",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/luixaviles/ariontalk.git",
9+
"directory": "packages/core"
10+
},
11+
"homepage": "https://ariontalk.com",
12+
"keywords": ["voice", "ai", "speech", "page-understanding"],
13+
"files": ["dist"],
14+
"publishConfig": {
15+
"access": "public"
16+
},
417
"type": "module",
518
"exports": {
619
".": {

packages/engine-gemini/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# @ariontalk/engine-gemini
2+
3+
Gemini Live engine add-on for ArionTalk — real-time voice streaming with function calling.
4+
5+
## Install
6+
7+
```bash
8+
npm install @ariontalk/engine-gemini
9+
```
10+
11+
`@ariontalk/core` is a peer dependency.
12+
13+
## Usage
14+
15+
```js
16+
import { GeminiEngine } from '@ariontalk/engine-gemini';
17+
18+
const engine = new GeminiEngine({
19+
tokenServerUrl: 'https://your-server.com/api/token',
20+
voice: 'Kore',
21+
interactiveHighlights: true,
22+
});
23+
24+
await engine.startSession('en');
25+
```
26+
27+
### Key exports
28+
29+
- **`GeminiEngine`** — cloud-based voice engine powered by Gemini Live API
30+
- **`HighlightManager`** — manages interactive scroll-and-highlight during speech
31+
32+
### Supported voices
33+
34+
Kore, Puck, Charon, Aoede, Fenrir, Leda, Orus, Zephyr
35+
36+
## License
37+
38+
MIT — see [LICENSE](https://github.com/luixaviles/ariontalk/blob/main/LICENSE)
39+
40+
## Links
41+
42+
- [ariontalk.com](https://ariontalk.com)
43+
- [GitHub](https://github.com/luixaviles/ariontalk)

packages/engine-gemini/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
22
"name": "@ariontalk/engine-gemini",
33
"version": "0.1.0",
4+
"description": "Gemini Live engine add-on for ArionTalk — real-time voice streaming with function calling",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/luixaviles/ariontalk.git",
9+
"directory": "packages/engine-gemini"
10+
},
11+
"homepage": "https://ariontalk.com",
12+
"keywords": ["voice", "ai", "gemini", "gemini-live", "function-calling", "streaming"],
13+
"files": ["dist"],
14+
"publishConfig": {
15+
"access": "public"
16+
},
417
"type": "module",
518
"exports": {
619
".": {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# @ariontalk/plugin-silero-vad
2+
3+
Silero VAD barge-in plugin for ArionTalk — AI-powered voice activity detection.
4+
5+
## Install
6+
7+
```bash
8+
npm install @ariontalk/plugin-silero-vad
9+
```
10+
11+
`@ariontalk/core` is a peer dependency.
12+
13+
## Usage
14+
15+
```js
16+
import { SileroVadDetector } from '@ariontalk/plugin-silero-vad';
17+
18+
// Use with the widget
19+
widget.bargeInPlugins = [
20+
{
21+
id: 'silero-vad',
22+
label: 'Smart VAD',
23+
create: () => new SileroVadDetector({ onnxWASMBasePath: '/' }),
24+
},
25+
];
26+
```
27+
28+
### Options
29+
30+
| Option | Default | Description |
31+
|--------|---------|-------------|
32+
| `positiveSpeechThreshold` | `0.7` | Detection sensitivity (0–1) |
33+
| `negativeSpeechThreshold` | `0.55` | Silence threshold (0–1) |
34+
| `minSpeechMs` | `500` | Minimum speech duration in ms |
35+
| `redemptionMs` | `1400` | Grace period for pauses in ms |
36+
| `baseAssetPath` | `"./"` | Path to VAD model assets |
37+
| `onnxWASMBasePath` | `"./"` | Path to ONNX WASM runtime files |
38+
39+
## How it works
40+
41+
Silero VAD uses a lightweight ONNX neural network to detect speech with higher accuracy and fewer false positives than energy-based detection. Dependencies are lazy-loaded — the model is only fetched when a session starts.
42+
43+
## License
44+
45+
MIT — see [LICENSE](https://github.com/luixaviles/ariontalk/blob/main/LICENSE)
46+
47+
## Links
48+
49+
- [ariontalk.com](https://ariontalk.com)
50+
- [GitHub](https://github.com/luixaviles/ariontalk)

packages/plugin-silero-vad/package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
{
22
"name": "@ariontalk/plugin-silero-vad",
33
"version": "0.1.0",
4+
"description": "Silero VAD barge-in plugin for ArionTalk — AI-powered voice activity detection",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/luixaviles/ariontalk.git",
9+
"directory": "packages/plugin-silero-vad"
10+
},
11+
"homepage": "https://ariontalk.com",
12+
"keywords": ["voice", "vad", "barge-in", "silero", "voice-activity-detection"],
13+
"files": ["dist"],
14+
"publishConfig": {
15+
"access": "public"
16+
},
417
"type": "module",
518
"exports": {
619
".": {

packages/widget/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# @ariontalk/widget
2+
3+
Drop-in voice AI widget for any website — powered by Gemini Live with interactive highlights.
4+
5+
## CDN (quickest)
6+
7+
```html
8+
<ariontalk-widget lang="en" settings></ariontalk-widget>
9+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ariontalk/widget@latest/dist/ariontalk.js"></script>
10+
```
11+
12+
## Install
13+
14+
```bash
15+
npm install @ariontalk/widget
16+
```
17+
18+
## Usage
19+
20+
```html
21+
<ariontalk-widget
22+
lang="en"
23+
engine="gemini"
24+
token-server="https://your-server.com/api/token"
25+
settings
26+
interactive-highlights
27+
></ariontalk-widget>
28+
29+
<script type="module">
30+
import '@ariontalk/widget';
31+
</script>
32+
```
33+
34+
### Attributes
35+
36+
| Attribute | Default | Description |
37+
|-----------|---------|-------------|
38+
| `lang` | `"en"` | Language code (`auto`, `en`, `es`, `ja`, `fr`, …) |
39+
| `engine` | `"local"` | `"local"` (browser) or `"gemini"` (cloud) |
40+
| `token-server` || Token endpoint URL (required for Gemini) |
41+
| `position` | `"bottom-right"` | `"bottom-right"` or `"bottom-left"` |
42+
| `theme` | `"light"` | `"light"` or `"dark"` |
43+
| `settings` | `false` | Show settings panel |
44+
| `interactive-highlights` | `false` | Scroll-and-highlight during speech (Gemini) |
45+
| `log-level` | `"disabled"` | `"disabled"` \| `"error"` \| `"warning"` \| `"info"` \| `"debug"` |
46+
47+
### Barge-in plugins
48+
49+
```js
50+
import '@ariontalk/widget';
51+
import { SileroVadDetector } from '@ariontalk/plugin-silero-vad';
52+
53+
const widget = document.querySelector('ariontalk-widget');
54+
widget.bargeInPlugins = [
55+
{ id: 'silero-vad', label: 'Smart VAD', create: () => new SileroVadDetector() },
56+
];
57+
```
58+
59+
### Events
60+
61+
- `at-session-start` — fired when a voice session begins
62+
- `at-session-end` — fired when a voice session ends (includes `detail.duration`)
63+
64+
## License
65+
66+
MIT — see [LICENSE](https://github.com/luixaviles/ariontalk/blob/main/LICENSE)
67+
68+
## Links
69+
70+
- [ariontalk.com](https://ariontalk.com)
71+
- [GitHub](https://github.com/luixaviles/ariontalk)

packages/widget/package.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,29 @@
44
"type": "module",
55
"main": "./dist/ariontalk.js",
66
"module": "./dist/ariontalk.js",
7-
"types": "./dist/ariontalk.d.ts",
7+
"description": "Drop-in voice AI widget for any website — powered by Gemini Live with interactive highlights",
8+
"license": "MIT",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/luixaviles/ariontalk.git",
12+
"directory": "packages/widget"
13+
},
14+
"homepage": "https://ariontalk.com",
15+
"keywords": ["voice", "ai", "widget", "web-component", "gemini", "highlights", "lit"],
16+
"files": ["dist"],
17+
"publishConfig": {
18+
"access": "public"
19+
},
20+
"types": "./dist/index.d.ts",
821
"exports": {
922
".": {
10-
"types": "./dist/ariontalk.d.ts",
23+
"types": "./dist/index.d.ts",
1124
"default": "./dist/ariontalk.js"
1225
}
1326
},
1427
"scripts": {
1528
"dev": "vite",
16-
"build": "rm -rf dist && tsc -b && vite build",
29+
"build": "rm -rf dist tsconfig.tsbuildinfo && vite build && tsc --emitDeclarationOnly",
1730
"test": "vitest run"
1831
},
1932
"dependencies": {

scripts/publish-packages.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
5+
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
6+
7+
DRY_RUN=""
8+
NO_GIT_CHECKS=""
9+
10+
while [[ $# -gt 0 ]]; do
11+
case $1 in
12+
--dry-run) DRY_RUN="--dry-run"; shift ;;
13+
--no-git-checks) NO_GIT_CHECKS="--no-git-checks"; shift ;;
14+
*) echo "Unknown option: $1"; exit 1 ;;
15+
esac
16+
done
17+
18+
cd "${ROOT_DIR}"
19+
20+
# Dependency-ordered list — core first, widget last
21+
PACKAGES=(
22+
"@ariontalk/core"
23+
"@ariontalk/engine-gemini"
24+
"@ariontalk/plugin-silero-vad"
25+
"@ariontalk/widget"
26+
)
27+
28+
if [ -n "${DRY_RUN}" ]; then
29+
echo "==> DRY RUN — no packages will be published"
30+
fi
31+
32+
# Verify npm auth
33+
if ! npm whoami &>/dev/null; then
34+
echo "ERROR: Not logged in to npm. Run 'npm login' first."
35+
exit 1
36+
fi
37+
38+
echo "==> Building all packages"
39+
pnpm build
40+
41+
for PKG in "${PACKAGES[@]}"; do
42+
echo ""
43+
echo "==> Publishing ${PKG}"
44+
pnpm --filter "${PKG}" publish --access public ${NO_GIT_CHECKS} ${DRY_RUN}
45+
done
46+
47+
echo ""
48+
if [ -n "${DRY_RUN}" ]; then
49+
echo "DRY RUN COMPLETE. No packages were published."
50+
else
51+
echo "ALL PACKAGES PUBLISHED."
52+
echo ""
53+
echo "==> Post-publish verification"
54+
for PKG in "${PACKAGES[@]}"; do
55+
echo ""
56+
echo "--- ${PKG} ---"
57+
npm view "${PKG}" version 2>/dev/null || echo " WARNING: not yet visible on npm (may take a moment)"
58+
done
59+
echo ""
60+
echo "==> CDN check (may take a few minutes to propagate)"
61+
echo " curl -I https://cdn.jsdelivr.net/npm/@ariontalk/widget@latest/dist/ariontalk.js"
62+
fi

0 commit comments

Comments
 (0)