@tanstack/ai-skills 0.1.2 → 0.1.3
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/package.json +3 -3
- package/skills/ai-skills/SKILL.md +18 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Portable Agent Skills (SKILL.md) as a first-class chat() middleware for TanStack AI.",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,12 +60,12 @@
|
|
|
60
60
|
"llm"
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@tanstack/ai": "^0.
|
|
63
|
+
"@tanstack/ai": "^0.54.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"vitest": "^4.1.10",
|
|
67
67
|
"zod": "^3.0.0 || ^4.0.0",
|
|
68
|
-
"@tanstack/ai": "^0.
|
|
68
|
+
"@tanstack/ai": "^0.54.0"
|
|
69
69
|
},
|
|
70
70
|
"peerDependenciesMeta": {
|
|
71
71
|
"vitest": {
|
|
@@ -51,11 +51,17 @@ const pptx = inlineSkill({
|
|
|
51
51
|
instructions: '# Building a deck\nUse python-pptx. Edit slides, then save.',
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
export async function POST(request: Request) {
|
|
55
|
+
const { messages } = await request.json()
|
|
56
|
+
|
|
57
|
+
const stream = chat({
|
|
58
|
+
adapter: anthropicText('claude-sonnet-4-6'),
|
|
59
|
+
messages,
|
|
60
|
+
middleware: [withSkills(pptx)],
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return toServerSentEventsResponse(stream)
|
|
64
|
+
}
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
`withSkills` adds a catalog to the system prompt and a `load_skill` tool whose
|
|
@@ -93,9 +99,11 @@ your own execution tool to `chat({ tools })` alongside `withSkills` and write th
|
|
|
93
99
|
skill so it tells the model to call that tool. `withSkills` composes with any
|
|
94
100
|
tools you provide.
|
|
95
101
|
|
|
96
|
-
```ts
|
|
102
|
+
```ts
|
|
97
103
|
import { toolDefinition } from '@tanstack/ai'
|
|
98
104
|
import { z } from 'zod'
|
|
105
|
+
// Your own runner: a provider sandbox, a Code Mode isolate, a remote worker.
|
|
106
|
+
import { runSomewhere } from './shell'
|
|
99
107
|
|
|
100
108
|
const executeShell = toolDefinition({
|
|
101
109
|
name: 'execute_shell',
|
|
@@ -119,6 +127,10 @@ Implement `SkillSource` (`list` + `load`, optional `revision`/`listResources`/
|
|
|
119
127
|
|
|
120
128
|
```typescript
|
|
121
129
|
import { runSkillSourceConformance } from '@tanstack/ai-skills/testing'
|
|
130
|
+
// Your SkillSource implementation, seeded with the `alpha` / `beta` fixture
|
|
131
|
+
// skills the suite expects.
|
|
132
|
+
import { myS3Source } from './my-s3-source'
|
|
133
|
+
import { fixtures } from './fixtures'
|
|
122
134
|
|
|
123
135
|
runSkillSourceConformance(() => myS3Source(fixtures), 's3')
|
|
124
136
|
```
|