@helmlabs/docbot 0.0.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/LICENSE +21 -0
- package/dist/cli.js +1255 -0
- package/package.json +87 -0
- package/readme.md +218 -0
- package/src/config/defaults.ts +41 -0
- package/src/config/index.ts +57 -0
- package/src/config/loader.ts +284 -0
- package/src/config/schema.ts +102 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from "zod"
|
|
2
|
+
|
|
3
|
+
// model identifier (e.g. "openai/gpt-5.2", "anthropic/claude-sonnet-4.5")
|
|
4
|
+
const modelIdSchema = z.string().regex(/^[\w-]+\/[\w.-]+$/, {
|
|
5
|
+
message: "model id must be in format 'provider/model-name'",
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export const docbotConfigSchema = z.object({
|
|
9
|
+
// agent behavior settings
|
|
10
|
+
agents: z
|
|
11
|
+
.object({
|
|
12
|
+
discoveryBudget: z.number().int().positive().optional(),
|
|
13
|
+
})
|
|
14
|
+
.optional(),
|
|
15
|
+
|
|
16
|
+
// model overrides
|
|
17
|
+
models: z
|
|
18
|
+
.object({
|
|
19
|
+
context: modelIdSchema.optional(),
|
|
20
|
+
embedding: modelIdSchema.optional(),
|
|
21
|
+
embeddingLarge: modelIdSchema.optional(),
|
|
22
|
+
fast: modelIdSchema.optional(),
|
|
23
|
+
nano: modelIdSchema.optional(),
|
|
24
|
+
planning: modelIdSchema.optional(),
|
|
25
|
+
planningHeavy: modelIdSchema.optional(),
|
|
26
|
+
prose: modelIdSchema.optional(),
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
|
|
30
|
+
// optional defaults for CLI inputs
|
|
31
|
+
paths: z
|
|
32
|
+
.object({
|
|
33
|
+
codebase: z.union([z.string(), z.array(z.string())]).optional(),
|
|
34
|
+
docs: z.string().optional(),
|
|
35
|
+
})
|
|
36
|
+
.optional(),
|
|
37
|
+
// project identifier used for collection naming
|
|
38
|
+
// defaults to sanitized package.json name
|
|
39
|
+
projectSlug: z.string().optional(),
|
|
40
|
+
|
|
41
|
+
// qdrant configuration
|
|
42
|
+
qdrant: z
|
|
43
|
+
.object({
|
|
44
|
+
collections: z
|
|
45
|
+
.object({
|
|
46
|
+
code: z.string(),
|
|
47
|
+
docs: z.string(),
|
|
48
|
+
})
|
|
49
|
+
.optional(),
|
|
50
|
+
manifestPath: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("custom manifest path (defaults to .docbot/manifest.json)"),
|
|
54
|
+
url: z.string().url().default("http://127.0.0.1:6333"),
|
|
55
|
+
})
|
|
56
|
+
.optional(),
|
|
57
|
+
|
|
58
|
+
// server settings
|
|
59
|
+
server: z
|
|
60
|
+
.object({
|
|
61
|
+
port: z.number().int().min(1).max(65535).optional(),
|
|
62
|
+
})
|
|
63
|
+
.optional(),
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
/** @public */
|
|
67
|
+
export type DocbotConfig = z.infer<typeof docbotConfigSchema>
|
|
68
|
+
|
|
69
|
+
// partial config is what users provide, we merge with defaults
|
|
70
|
+
export type DocbotUserConfig = z.input<typeof docbotConfigSchema>
|
|
71
|
+
|
|
72
|
+
// resolved config has all required fields filled
|
|
73
|
+
export interface ResolvedConfig {
|
|
74
|
+
projectSlug: string
|
|
75
|
+
qdrant: {
|
|
76
|
+
url: string
|
|
77
|
+
manifestPath: string
|
|
78
|
+
collections: { docs: string; code: string }
|
|
79
|
+
}
|
|
80
|
+
models: {
|
|
81
|
+
planning: string
|
|
82
|
+
planningHeavy: string
|
|
83
|
+
prose: string
|
|
84
|
+
fast: string
|
|
85
|
+
nano: string
|
|
86
|
+
context: string
|
|
87
|
+
embedding: string
|
|
88
|
+
embeddingLarge: string
|
|
89
|
+
}
|
|
90
|
+
agents: {
|
|
91
|
+
discoveryBudget: number
|
|
92
|
+
}
|
|
93
|
+
server: {
|
|
94
|
+
port: number
|
|
95
|
+
}
|
|
96
|
+
paths: {
|
|
97
|
+
cacheDir: string
|
|
98
|
+
manifest: string
|
|
99
|
+
docs?: string
|
|
100
|
+
codebase?: string[]
|
|
101
|
+
}
|
|
102
|
+
}
|