@cognidesk/voice-websocket 0.0.1 → 0.0.2
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 +107 -0
- package/package.json +8 -3
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Cognidesk
|
|
4
|
+
|
|
5
|
+
**TypeScript runtime SDK for building customer support agents as code.**
|
|
6
|
+
|
|
7
|
+
[](LICENSES/Apache-2.0.txt)
|
|
8
|
+
[](LICENSES/Cognidesk-Studio-Source-Available-License.txt)
|
|
9
|
+
[](https://www.typescriptlang.org/)
|
|
10
|
+
[](https://nodejs.org/)
|
|
11
|
+
|
|
12
|
+
[Documentation](https://cognidesk.cognilabz.com) · [Quick Start](https://cognidesk.cognilabz.com/getting-started/quick-start/) · [Examples](https://cognidesk.cognilabz.com/examples/) · [API Reference](https://cognidesk.cognilabz.com/api-reference/)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What is Cognidesk?
|
|
19
|
+
|
|
20
|
+
Cognidesk gives you full control over AI-powered customer support conversations — state machine journeys, typed tools, knowledge retrieval, and UI — without vendor lock-in. Core is transport-neutral: no HTTP, no framework, no runtime dependency baked in.
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { createAgent, createRuntime, tool } from "@cognidesk/core";
|
|
24
|
+
import { createSqliteStorage } from "@cognidesk/storage-sqlite";
|
|
25
|
+
import { z } from "zod";
|
|
26
|
+
|
|
27
|
+
const findTicket = tool("findTicket", {
|
|
28
|
+
input: z.object({ bookingReference: z.string() }),
|
|
29
|
+
output: z.object({ status: z.string() }),
|
|
30
|
+
execute: async ({ input }) => ({
|
|
31
|
+
status: `Ticket ${input.bookingReference} is confirmed.`,
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const agent = createAgent("support", {
|
|
36
|
+
instructions: "You are a helpful support agent.",
|
|
37
|
+
})
|
|
38
|
+
.tools.add(findTicket)
|
|
39
|
+
.compile();
|
|
40
|
+
|
|
41
|
+
const runtime = createRuntime({
|
|
42
|
+
storage: createSqliteStorage({ filename: "data.sqlite" }),
|
|
43
|
+
agent,
|
|
44
|
+
models,
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- **State Machine Journeys** — deterministic conversation flows with typed context, guards, and alternate entries
|
|
51
|
+
- **Typed Tools & Knowledge** — Zod-validated inputs/outputs with source attribution
|
|
52
|
+
- **Transport Neutral** — core has zero HTTP dependencies; ship anywhere
|
|
53
|
+
- **React UI Kit** — drop-in chat widget with appearance configuration and custom widgets
|
|
54
|
+
- **Voice** — real-time voice via OpenAI Realtime with server-mediated connections
|
|
55
|
+
- **OpenTelemetry** — native spans, metrics, and pre-built Grafana dashboards
|
|
56
|
+
- **SSE Streaming** — real-time token streaming with synthetic deltas
|
|
57
|
+
|
|
58
|
+
## Packages
|
|
59
|
+
|
|
60
|
+
| Package | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| `@cognidesk/core` | Runtime, agents, journeys, tools, knowledge, events |
|
|
63
|
+
| `@cognidesk/http` | HTTP + SSE transport adapter |
|
|
64
|
+
| `@cognidesk/model` | Model provider adapters (OpenAI, OpenRouter) |
|
|
65
|
+
| `@cognidesk/react` | React hooks and chat widget |
|
|
66
|
+
| `@cognidesk/ui` | Prebuilt UI components |
|
|
67
|
+
| `@cognidesk/storage-sqlite` | SQLite storage adapter |
|
|
68
|
+
| `@cognidesk/otel` | OpenTelemetry instrumentation |
|
|
69
|
+
| `@cognidesk/voice-openai` | OpenAI Realtime voice adapter |
|
|
70
|
+
| `@cognidesk/voice-websocket` | Voice WebSocket adapter |
|
|
71
|
+
| `@cognidesk/journey-index-json` | JSON-based journey index |
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pnpm add @cognidesk/core @cognidesk/http @cognidesk/storage-sqlite
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Read the full [Quick Start guide →](https://cognidesk.cognilabz.com/getting-started/quick-start/)
|
|
80
|
+
|
|
81
|
+
## Demo
|
|
82
|
+
|
|
83
|
+
Run the flight support demo:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
docker compose up --build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Open `http://localhost:5173` for the frontend, `http://localhost:8787/api` for the API.
|
|
90
|
+
|
|
91
|
+
## Development
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm install
|
|
95
|
+
pnpm check
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
|
|
100
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, architecture decisions, and pull request guidelines.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
The Cognidesk SDK packages are licensed under [Apache-2.0](LICENSES/Apache-2.0.txt).
|
|
105
|
+
Cognidesk Studio is source-available under the [Cognidesk Studio Source Available License](LICENSES/Cognidesk-Studio-Source-Available-License.txt).
|
|
106
|
+
|
|
107
|
+
See [LICENSE](LICENSE) for the repository license map.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cognidesk/voice-websocket",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"lint": "tsc -p tsconfig.json --noEmit"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@cognidesk/core": "0.0.
|
|
21
|
+
"@cognidesk/core": "0.0.2",
|
|
22
22
|
"ws": "^8.21.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -33,5 +33,10 @@
|
|
|
33
33
|
},
|
|
34
34
|
"files": [
|
|
35
35
|
"dist"
|
|
36
|
-
]
|
|
36
|
+
],
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/cognilabz/cognidesk",
|
|
40
|
+
"directory": "packages/voice-websocket"
|
|
41
|
+
}
|
|
37
42
|
}
|