@sna-sdk/core 0.0.0 → 0.0.4
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 +65 -0
- package/package.json +16 -8
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @sna-sdk/core
|
|
2
|
+
|
|
3
|
+
Server runtime for [Skills-Native Applications](https://github.com/neuradex/sna) — where Claude Code is the runtime, not an external LLM API.
|
|
4
|
+
|
|
5
|
+
## What's included
|
|
6
|
+
|
|
7
|
+
- **Skill event pipeline** — emit, SSE streaming, and hook scripts
|
|
8
|
+
- **SQLite database** — schema and `getDb()` for `skill_events`
|
|
9
|
+
- **Hono server factory** — `createSnaApp()` with events, emit, agent, and run routes
|
|
10
|
+
- **Lifecycle CLI** — `sna api:up`, `sna api:down`
|
|
11
|
+
- **Agent providers** — Claude Code and Codex process management
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @sna-sdk/core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Emit skill events
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node node_modules/@sna-sdk/core/dist/scripts/emit.js \
|
|
25
|
+
--skill my-skill --type start --message "Starting..."
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Event types: `start` | `progress` | `milestone` | `complete` | `error`
|
|
29
|
+
|
|
30
|
+
### Mount server routes
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createSnaApp } from "@sna-sdk/core/server";
|
|
34
|
+
|
|
35
|
+
const sna = createSnaApp();
|
|
36
|
+
// Provides: GET /events (SSE), POST /emit, GET /health, POST /agent/start
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Access the database
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { getDb } from "@sna-sdk/core/db/schema";
|
|
43
|
+
|
|
44
|
+
const db = getDb(); // SQLite instance (data/sna.db)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Exports
|
|
48
|
+
|
|
49
|
+
| Import path | Contents |
|
|
50
|
+
|-------------|----------|
|
|
51
|
+
| `@sna-sdk/core` | `DEFAULT_SNA_PORT`, `DEFAULT_SNA_URL`, types |
|
|
52
|
+
| `@sna-sdk/core/server` | `createSnaApp()`, route handlers, `SessionManager` |
|
|
53
|
+
| `@sna-sdk/core/db/schema` | `getDb()`, `SkillEvent` type |
|
|
54
|
+
| `@sna-sdk/core/providers` | Agent provider factory, `ClaudeCodeProvider` |
|
|
55
|
+
| `@sna-sdk/core/lib/sna-run` | `snaRun()` helper for spawning Claude Code |
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
- [Architecture](https://github.com/neuradex/sna/blob/main/docs/architecture.md)
|
|
60
|
+
- [Skill Authoring](https://github.com/neuradex/sna/blob/main/docs/skill-authoring.md)
|
|
61
|
+
- [App Setup](https://github.com/neuradex/sna/blob/main/docs/app-setup.md)
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sna-sdk/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Skills-Native Application runtime — server, providers, session management, database, and CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"bin/",
|
|
11
11
|
"dist/",
|
|
12
12
|
"skills/",
|
|
13
|
-
"CLAUDE.md.template"
|
|
13
|
+
"CLAUDE.md.template",
|
|
14
|
+
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
16
17
|
".": {
|
|
@@ -59,9 +60,21 @@
|
|
|
59
60
|
"default": "./dist/lib/sna-run.js"
|
|
60
61
|
}
|
|
61
62
|
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"build": "tsup",
|
|
65
|
+
"dev": "tsx --watch src/server/standalone.ts || true",
|
|
66
|
+
"test": "node --import tsx --test test/**/*.test.ts",
|
|
67
|
+
"prepublishOnly": "pnpm build"
|
|
68
|
+
},
|
|
62
69
|
"engines": {
|
|
63
70
|
"node": ">=18.0.0"
|
|
64
71
|
},
|
|
72
|
+
"repository": {
|
|
73
|
+
"type": "git",
|
|
74
|
+
"url": "https://github.com/neuradex/sna",
|
|
75
|
+
"directory": "packages/core"
|
|
76
|
+
},
|
|
77
|
+
"license": "MIT",
|
|
65
78
|
"keywords": [
|
|
66
79
|
"claude-code",
|
|
67
80
|
"sna",
|
|
@@ -82,10 +95,5 @@
|
|
|
82
95
|
"tsup": "^8.0.0",
|
|
83
96
|
"tsx": "^4.0.0",
|
|
84
97
|
"typescript": "^5.0.0"
|
|
85
|
-
},
|
|
86
|
-
"scripts": {
|
|
87
|
-
"build": "tsup",
|
|
88
|
-
"dev": "tsx --watch src/server/standalone.ts || true",
|
|
89
|
-
"test": "node --import tsx --test test/**/*.test.ts"
|
|
90
98
|
}
|
|
91
|
-
}
|
|
99
|
+
}
|