create-agentuity 0.0.67 → 0.0.69

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.
Files changed (2) hide show
  1. package/README.md +15 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -76,34 +76,34 @@ Runs TypeScript type checking
76
76
 
77
77
  After creating your project:
78
78
 
79
- 1. **Customize the example agent** - Edit `src/agents/hello/agent.ts`
80
- 2. **Add new agents** - Create new folders in `src/agents/`
81
- 3. **Add API routes** - Create new routes in `src/apis/`
79
+ 1. **Customize the example agent** - Edit `src/agent/hello/agent.ts`
80
+ 2. **Add new agents** - Create new folders in `src/agent/`
81
+ 3. **Add API routes** - Create new routes in `src/web/`
82
82
  4. **Customize the UI** - Edit `src/web/app.tsx`
83
83
  5. **Configure your app** - Modify `app.ts` to add middleware, configure services, etc.
84
84
 
85
85
  ## Creating Custom Agents
86
86
 
87
- Create a new agent by adding a folder in `src/agents/`:
87
+ Create a new agent by adding a folder in `src/agent/`:
88
88
 
89
89
  ```typescript
90
- // src/agents/my-agent/agent.ts
91
- import { type AgentContext, createAgent } from '@agentuity/runtime';
92
- import { z } from 'zod';
90
+ // src/agent/my-agent/agent.ts
91
+ import { createAgent } from '@agentuity/runtime';
92
+ import { s } from '@agentuity/schema';
93
93
 
94
94
  const agent = createAgent({
95
95
  metadata: {
96
96
  description: 'My amazing agent',
97
97
  },
98
98
  schema: {
99
- input: z.object({
100
- message: z.string(),
99
+ input: s.object({
100
+ message: s.string(),
101
101
  }),
102
- output: z.object({
103
- response: z.string(),
102
+ output: s.object({
103
+ response: s.string(),
104
104
  }),
105
105
  },
106
- handler: async (ctx: AgentContext, input) => {
106
+ handler: async (ctx, input) => {
107
107
  return { response: `Processed: ${input.message}` };
108
108
  },
109
109
  });
@@ -113,12 +113,11 @@ export default agent;
113
113
 
114
114
  ## Adding API Routes
115
115
 
116
- Create custom routes in `src/apis/` or add routes to an agent folder:
116
+ Create custom routes in `src/web/` or add routes to an agent folder:
117
117
 
118
118
  ```typescript
119
- // src/agents/my-agent/route.ts
119
+ // src/agent/my-agent/route.ts
120
120
  import { createRouter } from '@agentuity/runtime';
121
- import { zValidator } from '@hono/zod-validator';
122
121
  import agent from './agent';
123
122
 
124
123
  const router = createRouter();
@@ -128,7 +127,7 @@ router.get('/', async (c) => {
128
127
  return c.json(result);
129
128
  });
130
129
 
131
- router.post('/', zValidator('json', agent.inputSchema!), async (c) => {
130
+ router.post('/', agent.validator(), async (c) => {
132
131
  const data = c.req.valid('json');
133
132
  const result = await c.agent.myAgent.run(data);
134
133
  return c.json(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agentuity",
3
- "version": "0.0.67",
3
+ "version": "0.0.69",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Agentuity employees and contributors",
6
6
  "description": "Create a new Agentuity project",