create-theokit 0.2.1 → 0.2.2

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": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "Scaffold a new TheoKit project",
6
6
  "license": "Apache-2.0",
@@ -10,7 +10,7 @@
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "theokit": "^0.2.0",
13
+ "theokit": "^0.2.1",
14
14
  "react": "^19.0.0",
15
15
  "react-dom": "^19.0.0"
16
16
  },
@@ -10,7 +10,7 @@
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "theokit": "^0.2.0",
13
+ "theokit": "^0.2.1",
14
14
  "react": "^19.0.0",
15
15
  "react-dom": "^19.0.0"
16
16
  },
@@ -1,5 +1,6 @@
1
1
  import { defineCron } from 'theokit/server/cron'
2
2
  import { readdir, stat, rm } from 'node:fs/promises'
3
+ import type { Dirent } from 'node:fs'
3
4
  import { join, resolve } from 'node:path'
4
5
 
5
6
  /**
@@ -15,21 +16,21 @@ const AGENTS_DIR = '.theokit/agents'
15
16
 
16
17
  export default defineCron('cleanup-conversations', {
17
18
  schedule: '0 4 * * *', // Daily 04:00 UTC
18
- handler: async ({ log }) => {
19
+ handler: async ({ traceId }) => {
19
20
  const root = resolve(process.cwd(), AGENTS_DIR)
20
21
  const cutoff = Date.now() - MAX_AGE_DAYS * 24 * 60 * 60 * 1000
21
22
  let removed = 0
22
23
  let kept = 0
23
- let entries: Awaited<ReturnType<typeof readdir>>
24
+ let entries: Dirent[]
24
25
  try {
25
- entries = await readdir(root, { withFileTypes: true })
26
+ entries = (await readdir(root, { withFileTypes: true })) as unknown as Dirent[]
26
27
  } catch {
27
- log.info({ msg: 'No agents dir yet — first run', dir: root })
28
+ console.info(JSON.stringify({ msg: 'No agents dir yet — first run', dir: root, traceId }))
28
29
  return
29
30
  }
30
31
  for (const entry of entries) {
31
32
  if (!entry.isDirectory()) continue
32
- const agentDir = join(root, entry.name)
33
+ const agentDir = join(root, String(entry.name))
33
34
  const messagesFile = join(agentDir, 'messages.jsonl')
34
35
  try {
35
36
  const s = await stat(messagesFile)
@@ -45,6 +46,14 @@ export default defineCron('cleanup-conversations', {
45
46
  removed++
46
47
  }
47
48
  }
48
- log.info({ msg: 'cleanup-conversations complete', removed, kept, maxAgeDays: MAX_AGE_DAYS })
49
+ console.info(
50
+ JSON.stringify({
51
+ msg: 'cleanup-conversations complete',
52
+ removed,
53
+ kept,
54
+ maxAgeDays: MAX_AGE_DAYS,
55
+ traceId,
56
+ }),
57
+ )
49
58
  },
50
59
  })
@@ -10,9 +10,9 @@
10
10
  "typecheck": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "theokit": "^0.2.0",
14
- "@usetheo/sdk": "^1.3.0",
15
- "@usetheo/ui": "^0.12.0",
13
+ "theokit": "^0.2.1",
14
+ "@usetheo/sdk": "^1.4.1",
15
+ "@usetheo/ui": "^0.13.0",
16
16
  "lucide-react": "^0.469.0",
17
17
  "react": "^19.0.0",
18
18
  "react-dom": "^19.0.0",
@@ -14,7 +14,7 @@
14
14
  "db:studio": "drizzle-kit studio"
15
15
  },
16
16
  "dependencies": {
17
- "theokit": "^0.2.0",
17
+ "theokit": "^0.2.1",
18
18
  "react": "^19.0.0",
19
19
  "react-dom": "^19.0.0",
20
20
  "drizzle-orm": "^0.45.0",
@@ -14,8 +14,8 @@
14
14
  "db:studio": "drizzle-kit studio"
15
15
  },
16
16
  "dependencies": {
17
- "theokit": "^0.2.0",
18
- "@usetheo/ui": "^0.12.0",
17
+ "theokit": "^0.2.1",
18
+ "@usetheo/ui": "^0.13.0",
19
19
  "react": "^19.0.0",
20
20
  "react-dom": "^19.0.0",
21
21
  "react-router": "^7.0.0",
@@ -26,7 +26,7 @@ pnpm dev
26
26
 
27
27
  ## What is wired
28
28
 
29
- - Native fetch handler via Hono (works on Vercel, CF Workers Node-compat, TheoCloud, local)
29
+ - Native fetch handler via Hono (works on TheoCloud and local)
30
30
  - JSON-line stdout logs
31
31
  - W3C `traceparent` propagation from incoming headers
32
32
  - TheoKit injects `THEOKIT_SERVICE_NAME` + `THEOKIT_SERVICE_PORT` env vars
@@ -26,7 +26,7 @@ uv run uvicorn main:app --reload --port 8001
26
26
 
27
27
  ## What is wired
28
28
 
29
- - ASGI fetch-handler (works on Vercel Python runtime, TheoCloud K8s, local uvicorn)
29
+ - ASGI fetch-handler (works on TheoCloud K8s and local uvicorn)
30
30
  - JSON-line stdout logs
31
31
  - W3C `traceparent` propagation from incoming headers
32
32
  - TheoKit injects `THEOKIT_SERVICE_NAME` + `THEOKIT_SERVICE_PORT` env vars