@statelyai/agent 0.1.0 → 0.1.1
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/examples/todo.ts +6 -3
- package/package.json +13 -12
package/examples/todo.ts
CHANGED
|
@@ -9,7 +9,8 @@ const agent = createAgent({
|
|
|
9
9
|
model: openai('gpt-4o'),
|
|
10
10
|
events: {
|
|
11
11
|
addTodo: z.object({
|
|
12
|
-
|
|
12
|
+
title: z.string().min(1).max(100).describe('The title of the todo'),
|
|
13
|
+
content: z.string().min(1).max(100).describe('The content of the todo'),
|
|
13
14
|
}),
|
|
14
15
|
deleteTodo: z.object({
|
|
15
16
|
index: z.number().describe('The index of the todo to delete'),
|
|
@@ -24,7 +25,8 @@ const agent = createAgent({
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
interface Todo {
|
|
27
|
-
|
|
28
|
+
title: string;
|
|
29
|
+
content: string;
|
|
28
30
|
done: boolean;
|
|
29
31
|
}
|
|
30
32
|
|
|
@@ -48,7 +50,8 @@ const machine = setup({
|
|
|
48
50
|
todos: ({ context, event }) => [
|
|
49
51
|
...context.todos,
|
|
50
52
|
{
|
|
51
|
-
|
|
53
|
+
title: event.title,
|
|
54
|
+
content: event.content,
|
|
52
55
|
done: false,
|
|
53
56
|
},
|
|
54
57
|
],
|
package/package.json
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statelyai/agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
10
|
+
"lint": "tsc --noEmit",
|
|
11
|
+
"test": "vitest",
|
|
12
|
+
"example": "ts-node examples/helpers/runner.ts",
|
|
13
|
+
"prepublishOnly": "tsup src/index.ts --dts",
|
|
14
|
+
"changeset": "changeset",
|
|
15
|
+
"release": "changeset publish",
|
|
16
|
+
"version": "changeset version"
|
|
17
|
+
},
|
|
8
18
|
"keywords": [],
|
|
9
19
|
"author": "",
|
|
10
20
|
"license": "MIT",
|
|
@@ -33,14 +43,5 @@
|
|
|
33
43
|
"ai": "^3.1.32",
|
|
34
44
|
"xstate": "^5.13.2"
|
|
35
45
|
},
|
|
36
|
-
"packageManager": "pnpm@8.11.0"
|
|
37
|
-
|
|
38
|
-
"build": "tsup src/index.ts --format cjs,esm --dts",
|
|
39
|
-
"lint": "tsc --noEmit",
|
|
40
|
-
"test": "vitest",
|
|
41
|
-
"example": "ts-node examples/helpers/runner.ts",
|
|
42
|
-
"changeset": "changeset",
|
|
43
|
-
"release": "changeset publish",
|
|
44
|
-
"version": "changeset version"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
46
|
+
"packageManager": "pnpm@8.11.0"
|
|
47
|
+
}
|