@taskcast/server 0.1.0 → 0.1.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/LICENSE +21 -0
- package/README.md +61 -0
- package/package.json +26 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WEIGHTWAVE INC.
|
|
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
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @taskcast/server
|
|
2
|
+
|
|
3
|
+
Hono HTTP server for [Taskcast](https://github.com/weightwave/taskcast) — REST API, SSE streaming, JWT auth, and webhook delivery.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @taskcast/server @taskcast/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { TaskEngine, MemoryBroadcastProvider, MemoryShortTermStore } from '@taskcast/core'
|
|
15
|
+
import { createTaskcastApp } from '@taskcast/server'
|
|
16
|
+
|
|
17
|
+
const engine = new TaskEngine({
|
|
18
|
+
broadcast: new MemoryBroadcastProvider(),
|
|
19
|
+
shortTermStore: new MemoryShortTermStore(),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const app = createTaskcastApp({ engine })
|
|
23
|
+
|
|
24
|
+
// Mount to your existing Hono app or serve directly
|
|
25
|
+
export default app
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With JWT Auth
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
const app = createTaskcastApp({
|
|
32
|
+
engine,
|
|
33
|
+
auth: {
|
|
34
|
+
mode: 'jwt',
|
|
35
|
+
jwt: {
|
|
36
|
+
algorithm: 'HS256',
|
|
37
|
+
secret: process.env.JWT_SECRET,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## API Endpoints
|
|
44
|
+
|
|
45
|
+
| Method | Path | Description |
|
|
46
|
+
|--------|------|-------------|
|
|
47
|
+
| `POST` | `/tasks` | Create a task |
|
|
48
|
+
| `GET` | `/tasks/:taskId` | Get task status and metadata |
|
|
49
|
+
| `PATCH` | `/tasks/:taskId/status` | Transition task status |
|
|
50
|
+
| `DELETE` | `/tasks/:taskId` | Delete a task |
|
|
51
|
+
| `POST` | `/tasks/:taskId/events` | Publish event(s) |
|
|
52
|
+
| `GET` | `/tasks/:taskId/events` | Subscribe via SSE |
|
|
53
|
+
| `GET` | `/tasks/:taskId/events/history` | Query event history |
|
|
54
|
+
|
|
55
|
+
## Part of Taskcast
|
|
56
|
+
|
|
57
|
+
This is the HTTP server package. See the [Taskcast monorepo](https://github.com/weightwave/taskcast) for the full project.
|
|
58
|
+
|
|
59
|
+
## License
|
|
60
|
+
|
|
61
|
+
[MIT](https://github.com/weightwave/taskcast/blob/main/LICENSE)
|
package/package.json
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taskcast/server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Hono HTTP server — REST + SSE + auth + webhooks for Taskcast.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/weightwave/taskcast.git",
|
|
8
|
+
"directory": "packages/server"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/weightwave/taskcast/tree/main/packages/server#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/weightwave/taskcast/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
4
15
|
"files": [
|
|
5
16
|
"dist",
|
|
6
|
-
"LICENSE"
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"README.md"
|
|
7
19
|
],
|
|
8
20
|
"type": "module",
|
|
9
21
|
"exports": {
|
|
@@ -12,24 +24,27 @@
|
|
|
12
24
|
"import": "./dist/index.js"
|
|
13
25
|
}
|
|
14
26
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"test": "vitest run",
|
|
18
|
-
"test:watch": "vitest"
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"provenance": true
|
|
19
29
|
},
|
|
20
30
|
"dependencies": {
|
|
21
|
-
"@taskcast/core": "workspace:*",
|
|
22
31
|
"hono": "^4.6.0",
|
|
23
32
|
"jose": "^5.9.0",
|
|
24
|
-
"zod": "^3.23.0"
|
|
33
|
+
"zod": "^3.23.0",
|
|
34
|
+
"@taskcast/core": "0.1.2"
|
|
25
35
|
},
|
|
26
36
|
"devDependencies": {
|
|
27
37
|
"@hono/node-server": "^1.19.9",
|
|
28
|
-
"@taskcast/redis": "workspace:*",
|
|
29
38
|
"@vitest/coverage-v8": "^2.1.0",
|
|
30
39
|
"ioredis": "^5.4.0",
|
|
31
40
|
"testcontainers": "^10.13.0",
|
|
32
41
|
"typescript": "^5.7.0",
|
|
33
|
-
"vitest": "^2.1.0"
|
|
42
|
+
"vitest": "^2.1.0",
|
|
43
|
+
"@taskcast/redis": "0.1.2"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsc",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:watch": "vitest"
|
|
34
49
|
}
|
|
35
|
-
}
|
|
50
|
+
}
|