@taskcast/client 0.1.1 → 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.
- package/README.md +50 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @taskcast/client
|
|
2
|
+
|
|
3
|
+
Browser SSE subscription client for [Taskcast](https://github.com/weightwave/taskcast). Subscribe to task event streams with automatic reconnection and cursor-based resumption.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @taskcast/client
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TaskcastClient } from '@taskcast/client'
|
|
15
|
+
|
|
16
|
+
const client = new TaskcastClient({
|
|
17
|
+
baseUrl: 'http://localhost:3721',
|
|
18
|
+
token: 'your-jwt-token', // optional
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const taskId = 'task-123' // replace with your actual task ID
|
|
22
|
+
|
|
23
|
+
await client.subscribe(taskId, {
|
|
24
|
+
filter: {
|
|
25
|
+
types: ['llm.*'],
|
|
26
|
+
since: { index: 0 },
|
|
27
|
+
},
|
|
28
|
+
onEvent: (envelope) => {
|
|
29
|
+
console.log(envelope.data) // { text: "Once upon a time..." }
|
|
30
|
+
},
|
|
31
|
+
onDone: (reason) => {
|
|
32
|
+
console.log(`Task ${reason}`) // "Task completed"
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- SSE-based real-time event streaming
|
|
40
|
+
- Wildcard type filtering (`llm.*`, `tool.call`)
|
|
41
|
+
- Cursor-based resumption (by event ID, index, or timestamp)
|
|
42
|
+
- Automatic reconnection on disconnect
|
|
43
|
+
|
|
44
|
+
## Part of Taskcast
|
|
45
|
+
|
|
46
|
+
This is the browser client package. See the [Taskcast monorepo](https://github.com/weightwave/taskcast) for the full project. For React integration, see [`@taskcast/react`](https://www.npmjs.com/package/@taskcast/react).
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
[MIT](https://github.com/weightwave/taskcast/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taskcast/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Browser SSE subscription client for Taskcast.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"eventsource-parser": "^2.0.1",
|
|
32
|
-
"@taskcast/core": "0.
|
|
32
|
+
"@taskcast/core": "0.2.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^5.7.0",
|