create-theokit 1.25.2 → 1.25.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-theokit",
3
- "version": "1.25.2",
3
+ "version": "1.25.3",
4
4
  "type": "module",
5
5
  "description": "Scaffold a new TheoKit project",
6
6
  "repository": {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Imports
4
4
 
5
- - Use `theokit/server/define` for defineRoute, defineAction, defineWebSocket
5
+ - Use `theokit/server/define` for `route()`, `action()`, `websocket()`, `tool()`
6
6
  - Use `theokit/client` for theoFetch, createAppClient
7
7
  - Use `theokit/server/auth` for session/auth APIs
8
8
  - NEVER import from `theokit/dist/...` or `theokit/src/...`
@@ -13,12 +13,12 @@
13
13
  - Zod is the single source of truth for types and validation
14
14
  - Define schema ONCE with `z.object(...)`, derive types with `z.infer<>`
15
15
  - NEVER duplicate a Zod schema as a manual TypeScript interface
16
- - NEVER parse request body manually — use `body:` in defineRoute
16
+ - NEVER parse request body manually — use `.body(z.object({ }))` on the `route()` chain
17
17
 
18
18
  ## Routes
19
19
 
20
20
  - File at `server/routes/tasks/[id].ts` maps to `/api/tasks/:id`
21
- - Export HTTP method handlers: `export const GET = defineRoute({...})`
21
+ - Export HTTP method handlers: `export const GET = route().policy('public').handler(…).build()`
22
22
  - Every method declares `policy` — who may call it. `'public'` is a valid answer and an explicit one;
23
23
  omitting it fails the build with the file named
24
24
  - Use `params: z.object({...})` for URL params, `body:` for request body
@@ -20,14 +20,14 @@ Create an `agents/<name>.ts` file at the project root. It is automatically serve
20
20
 
21
21
  ```typescript
22
22
  // agents/chat.ts
23
- import { defineAgent } from '@theokit/agents'
23
+ import { AgentBuilder } from '@theokit/agents'
24
24
  import { z } from 'zod'
25
25
 
26
- export default defineAgent({
27
- input: z.object({ message: z.string() }),
28
- model: 'openrouter/openai/gpt-4o-mini',
29
- system: 'You are a helpful assistant.',
30
- })
26
+ export default AgentBuilder.create()
27
+ .input(z.object({ message: z.string() }))
28
+ .model('openrouter/openai/gpt-4o-mini')
29
+ .system('You are a helpful assistant.')
30
+ .build()
31
31
  ```
32
32
 
33
33
  The endpoint streams the ai-sdk `UIMessageStream` that `useAgent` (client hook) consumes.
@@ -205,7 +205,7 @@ Before writing custom tools, check if they already exist:
205
205
 
206
206
  ## Anti-patterns
207
207
 
208
- - NEVER call OpenAI/Anthropic/OpenRouter APIs directly — use `defineAgent` or `@Agent`
208
+ - NEVER call OpenAI/Anthropic/OpenRouter APIs directly — use `AgentBuilder.create()`
209
209
  - NEVER reimplement tool calling loop — the SDK handles it
210
210
  - NEVER reimplement file/search/shell tools — use `@theokit/sdk-tools` (readFile, writeFile, search, etc.)
211
211
  - NEVER store conversations manually — SDK persistence is automatic (the SDK owns storage)
@@ -135,4 +135,4 @@ Env vars are loaded from `.env` (dev) and `.env.production` (build). NEVER commi
135
135
  - NEVER hardcode secrets in theo.config.ts — use environment variables
136
136
  - NEVER set `security.csrf: false` in production
137
137
  - NEVER use `ssr: true` without understanding hydration (start with `false`)
138
- - NEVER add plugins that don't match `defineTheoPlugin` interface
138
+ - NEVER add plugins that don't match `TheoPlugin` interface