@karmaniverous/jeeves-watcher 0.17.8 → 0.17.9

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/dist/index.d.ts CHANGED
@@ -1,264 +1,13 @@
1
1
  import { JeevesComponentDescriptor } from '@karmaniverous/jeeves';
2
2
  import { FastifyInstance } from 'fastify';
3
3
  import pino from 'pino';
4
- import * as _karmaniverous_jsonmap from '@karmaniverous/jsonmap';
5
- import { JsonMapMap } from '@karmaniverous/jsonmap';
4
+ import { EmbeddingConfig, InferenceRule, SchemaEntry, VectorStoreConfig, WatchConfig, JeevesWatcherConfig, LoggingConfig } from '@karmaniverous/jeeves-watcher-core';
5
+ export { ApiConfig, ConfigWatchConfig, EmbeddingConfig, InferenceRule, JeevesWatcherConfig, JeevesWatcherConfigInput, LoggingConfig, VectorStoreConfig, WatchConfig, apiConfigSchema, configWatchConfigSchema, embeddingConfigSchema, inferenceRuleSchema, jeevesWatcherConfigSchema, loggingConfigSchema, vectorStoreConfigSchema, watchConfigSchema } from '@karmaniverous/jeeves-watcher-core';
6
6
  import { z } from 'zod';
7
7
  import Handlebars from 'handlebars';
8
+ import { JsonMapMap } from '@karmaniverous/jsonmap';
8
9
  import { Stats } from 'node:fs';
9
10
 
10
- /**
11
- * @module config/schemas/base
12
- * Base configuration schemas: watch, logging, API.
13
- */
14
-
15
- /**
16
- * Watch configuration for file system monitoring.
17
- */
18
- declare const watchConfigSchema: z.ZodObject<{
19
- paths: z.ZodArray<z.ZodString>;
20
- ignored: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
- pollIntervalMs: z.ZodOptional<z.ZodNumber>;
22
- usePolling: z.ZodOptional<z.ZodBoolean>;
23
- debounceMs: z.ZodOptional<z.ZodNumber>;
24
- stabilityThresholdMs: z.ZodOptional<z.ZodNumber>;
25
- respectGitignore: z.ZodOptional<z.ZodBoolean>;
26
- moveDetection: z.ZodOptional<z.ZodObject<{
27
- enabled: z.ZodDefault<z.ZodBoolean>;
28
- bufferMs: z.ZodDefault<z.ZodNumber>;
29
- }, z.core.$strip>>;
30
- }, z.core.$strip>;
31
- /** Watch configuration for file system monitoring paths, ignore patterns, and debounce/stability settings. */
32
- type WatchConfig = z.infer<typeof watchConfigSchema>;
33
- /**
34
- * Configuration watch settings.
35
- */
36
- declare const configWatchConfigSchema: z.ZodObject<{
37
- enabled: z.ZodOptional<z.ZodBoolean>;
38
- debounceMs: z.ZodOptional<z.ZodNumber>;
39
- reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">, z.ZodLiteral<"rules">]>>;
40
- }, z.core.$strip>;
41
- /** Configuration file watch settings controlling auto-reload behavior on config changes. */
42
- type ConfigWatchConfig = z.infer<typeof configWatchConfigSchema>;
43
- /**
44
- * API server configuration.
45
- */
46
- declare const apiConfigSchema: z.ZodObject<{
47
- host: z.ZodOptional<z.ZodString>;
48
- port: z.ZodOptional<z.ZodNumber>;
49
- cacheTtlMs: z.ZodOptional<z.ZodNumber>;
50
- }, z.core.$strip>;
51
- /** API server configuration: host binding and port. */
52
- type ApiConfig = z.infer<typeof apiConfigSchema>;
53
- /**
54
- * Logging configuration.
55
- */
56
- declare const loggingConfigSchema: z.ZodObject<{
57
- level: z.ZodOptional<z.ZodString>;
58
- file: z.ZodOptional<z.ZodString>;
59
- }, z.core.$strip>;
60
- /** Logging configuration: level and optional file output path. */
61
- type LoggingConfig = z.infer<typeof loggingConfigSchema>;
62
-
63
- /**
64
- * Global schema entry: inline object or file path.
65
- */
66
- declare const schemaEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
67
- type: z.ZodOptional<z.ZodLiteral<"object">>;
68
- properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
69
- }, z.core.$strip>, z.ZodString]>;
70
- /** Global schema entry. */
71
- type SchemaEntry = z.infer<typeof schemaEntrySchema>;
72
- /**
73
- * An inference rule that enriches document metadata.
74
- */
75
- declare const inferenceRuleSchema: z.ZodObject<{
76
- name: z.ZodString;
77
- description: z.ZodString;
78
- match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
79
- schema: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
80
- type: z.ZodOptional<z.ZodLiteral<"object">>;
81
- properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
82
- }, z.core.$strip>]>>>;
83
- map: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<_karmaniverous_jsonmap.JsonMapMap, unknown, z.core.$ZodTypeInternals<_karmaniverous_jsonmap.JsonMapMap, unknown>>, z.ZodString]>>;
84
- template: z.ZodOptional<z.ZodString>;
85
- render: z.ZodOptional<z.ZodObject<{
86
- frontmatter: z.ZodArray<z.ZodString>;
87
- body: z.ZodArray<z.ZodObject<{
88
- path: z.ZodString;
89
- heading: z.ZodNumber;
90
- label: z.ZodOptional<z.ZodString>;
91
- format: z.ZodOptional<z.ZodString>;
92
- formatArgs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
93
- each: z.ZodOptional<z.ZodBoolean>;
94
- headingTemplate: z.ZodOptional<z.ZodString>;
95
- contentPath: z.ZodOptional<z.ZodString>;
96
- sort: z.ZodOptional<z.ZodString>;
97
- }, z.core.$strip>>;
98
- }, z.core.$strip>>;
99
- renderAs: z.ZodOptional<z.ZodString>;
100
- }, z.core.$strip>;
101
- /** An inference rule: JSON Schema match condition, schema array, and optional JsonMap transformation. */
102
- type InferenceRule = z.infer<typeof inferenceRuleSchema>;
103
-
104
- /**
105
- * Top-level configuration for jeeves-watcher.
106
- */
107
- declare const jeevesWatcherConfigSchema: z.ZodObject<{
108
- description: z.ZodOptional<z.ZodString>;
109
- schemas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
110
- type: z.ZodOptional<z.ZodLiteral<"object">>;
111
- properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
112
- }, z.core.$strip>, z.ZodString]>>>;
113
- watch: z.ZodObject<{
114
- paths: z.ZodArray<z.ZodString>;
115
- ignored: z.ZodDefault<z.ZodArray<z.ZodString>>;
116
- pollIntervalMs: z.ZodOptional<z.ZodNumber>;
117
- usePolling: z.ZodOptional<z.ZodBoolean>;
118
- debounceMs: z.ZodOptional<z.ZodNumber>;
119
- stabilityThresholdMs: z.ZodOptional<z.ZodNumber>;
120
- respectGitignore: z.ZodOptional<z.ZodBoolean>;
121
- moveDetection: z.ZodOptional<z.ZodObject<{
122
- enabled: z.ZodDefault<z.ZodBoolean>;
123
- bufferMs: z.ZodDefault<z.ZodNumber>;
124
- }, z.core.$strip>>;
125
- }, z.core.$strip>;
126
- configWatch: z.ZodOptional<z.ZodObject<{
127
- enabled: z.ZodOptional<z.ZodBoolean>;
128
- debounceMs: z.ZodOptional<z.ZodNumber>;
129
- reindex: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"issues">, z.ZodLiteral<"full">, z.ZodLiteral<"rules">]>>;
130
- }, z.core.$strip>>;
131
- embedding: z.ZodObject<{
132
- provider: z.ZodDefault<z.ZodString>;
133
- model: z.ZodDefault<z.ZodString>;
134
- chunkSize: z.ZodOptional<z.ZodNumber>;
135
- chunkOverlap: z.ZodOptional<z.ZodNumber>;
136
- dimensions: z.ZodOptional<z.ZodNumber>;
137
- apiKey: z.ZodOptional<z.ZodString>;
138
- rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
139
- concurrency: z.ZodOptional<z.ZodNumber>;
140
- }, z.core.$strip>;
141
- vectorStore: z.ZodObject<{
142
- url: z.ZodString;
143
- collectionName: z.ZodString;
144
- apiKey: z.ZodOptional<z.ZodString>;
145
- }, z.core.$strip>;
146
- api: z.ZodOptional<z.ZodObject<{
147
- host: z.ZodOptional<z.ZodString>;
148
- port: z.ZodOptional<z.ZodNumber>;
149
- cacheTtlMs: z.ZodOptional<z.ZodNumber>;
150
- }, z.core.$strip>>;
151
- stateDir: z.ZodOptional<z.ZodString>;
152
- inferenceRules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
153
- name: z.ZodString;
154
- description: z.ZodString;
155
- match: z.ZodRecord<z.ZodString, z.ZodUnknown>;
156
- schema: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
157
- type: z.ZodOptional<z.ZodLiteral<"object">>;
158
- properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
159
- }, z.core.$strip>]>>>;
160
- map: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<_karmaniverous_jsonmap.JsonMapMap, unknown, z.core.$ZodTypeInternals<_karmaniverous_jsonmap.JsonMapMap, unknown>>, z.ZodString]>>;
161
- template: z.ZodOptional<z.ZodString>;
162
- render: z.ZodOptional<z.ZodObject<{
163
- frontmatter: z.ZodArray<z.ZodString>;
164
- body: z.ZodArray<z.ZodObject<{
165
- path: z.ZodString;
166
- heading: z.ZodNumber;
167
- label: z.ZodOptional<z.ZodString>;
168
- format: z.ZodOptional<z.ZodString>;
169
- formatArgs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
170
- each: z.ZodOptional<z.ZodBoolean>;
171
- headingTemplate: z.ZodOptional<z.ZodString>;
172
- contentPath: z.ZodOptional<z.ZodString>;
173
- sort: z.ZodOptional<z.ZodString>;
174
- }, z.core.$strip>>;
175
- }, z.core.$strip>>;
176
- renderAs: z.ZodOptional<z.ZodString>;
177
- }, z.core.$strip>, z.ZodString]>>>;
178
- maps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodType<_karmaniverous_jsonmap.JsonMapMap, unknown, z.core.$ZodTypeInternals<_karmaniverous_jsonmap.JsonMapMap, unknown>>, z.ZodString, z.ZodObject<{
179
- map: z.ZodUnion<[z.ZodType<_karmaniverous_jsonmap.JsonMapMap, unknown, z.core.$ZodTypeInternals<_karmaniverous_jsonmap.JsonMapMap, unknown>>, z.ZodString]>;
180
- description: z.ZodOptional<z.ZodString>;
181
- }, z.core.$strip>]>>>;
182
- templates: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
183
- template: z.ZodString;
184
- description: z.ZodOptional<z.ZodString>;
185
- }, z.core.$strip>]>>>;
186
- templateHelpers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
187
- path: z.ZodString;
188
- description: z.ZodOptional<z.ZodString>;
189
- }, z.core.$strip>>>;
190
- mapHelpers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
191
- path: z.ZodString;
192
- description: z.ZodOptional<z.ZodString>;
193
- }, z.core.$strip>>>;
194
- reindex: z.ZodOptional<z.ZodObject<{
195
- callbackUrl: z.ZodOptional<z.ZodURL>;
196
- concurrency: z.ZodDefault<z.ZodNumber>;
197
- }, z.core.$strip>>;
198
- search: z.ZodOptional<z.ZodObject<{
199
- scoreThresholds: z.ZodOptional<z.ZodObject<{
200
- strong: z.ZodNumber;
201
- relevant: z.ZodNumber;
202
- noise: z.ZodNumber;
203
- }, z.core.$strip>>;
204
- hybrid: z.ZodOptional<z.ZodObject<{
205
- enabled: z.ZodDefault<z.ZodBoolean>;
206
- textWeight: z.ZodDefault<z.ZodNumber>;
207
- }, z.core.$strip>>;
208
- }, z.core.$strip>>;
209
- logging: z.ZodOptional<z.ZodObject<{
210
- level: z.ZodOptional<z.ZodString>;
211
- file: z.ZodOptional<z.ZodString>;
212
- }, z.core.$strip>>;
213
- shutdownTimeoutMs: z.ZodOptional<z.ZodNumber>;
214
- maxRetries: z.ZodOptional<z.ZodNumber>;
215
- maxBackoffMs: z.ZodOptional<z.ZodNumber>;
216
- }, z.core.$strip>;
217
- /**
218
- * Raw configuration as parsed from the Zod schema.
219
- * May contain string file paths in `inferenceRules` that need resolution.
220
- */
221
- type JeevesWatcherConfigInput = z.infer<typeof jeevesWatcherConfigSchema>;
222
- /**
223
- * Resolved configuration with all file references loaded.
224
- * After `loadConfig`, all string rule entries have been resolved to `InferenceRule` objects.
225
- */
226
- type JeevesWatcherConfig = Omit<JeevesWatcherConfigInput, 'inferenceRules'> & {
227
- /** Resolved inference rules (string file paths have been loaded as InferenceRule objects). */
228
- inferenceRules?: InferenceRule[];
229
- };
230
-
231
- /**
232
- * @module config/schemas/services
233
- * Service configuration schemas: embedding and vector store.
234
- */
235
-
236
- /**
237
- * Embedding model configuration.
238
- */
239
- declare const embeddingConfigSchema: z.ZodObject<{
240
- provider: z.ZodDefault<z.ZodString>;
241
- model: z.ZodDefault<z.ZodString>;
242
- chunkSize: z.ZodOptional<z.ZodNumber>;
243
- chunkOverlap: z.ZodOptional<z.ZodNumber>;
244
- dimensions: z.ZodOptional<z.ZodNumber>;
245
- apiKey: z.ZodOptional<z.ZodString>;
246
- rateLimitPerMinute: z.ZodOptional<z.ZodNumber>;
247
- concurrency: z.ZodOptional<z.ZodNumber>;
248
- }, z.core.$strip>;
249
- /** Embedding model configuration: provider, model, chunking, dimensions, rate limits, and API key. */
250
- type EmbeddingConfig = z.infer<typeof embeddingConfigSchema>;
251
- /**
252
- * Vector store configuration for Qdrant.
253
- */
254
- declare const vectorStoreConfigSchema: z.ZodObject<{
255
- url: z.ZodString;
256
- collectionName: z.ZodString;
257
- apiKey: z.ZodOptional<z.ZodString>;
258
- }, z.core.$strip>;
259
- /** Qdrant vector store connection configuration: server URL, collection name, and optional API key. */
260
- type VectorStoreConfig = z.infer<typeof vectorStoreConfigSchema>;
261
-
262
11
  /**
263
12
  * @module embedding/types
264
13
  * Embedding provider type definitions.
@@ -1934,5 +1683,5 @@ declare function contentHash(text: string): string;
1934
1683
  */
1935
1684
  declare function pointId(filePath: string, chunkIndex?: number): string;
1936
1685
 
1937
- export { ContentHashCache, DocumentProcessor, EnrichmentStore, EventQueue, FileSystemWatcher, GitignoreFilter, InitialScanTracker, IssuesManager, JeevesWatcher, ReindexTracker, SystemHealth, TemplateEngine, ValuesManager, VectorStoreClient, VirtualRuleStore, apiConfigSchema, applyRules, buildAttributes, buildTemplateEngine, compileRules, configWatchConfigSchema, contentHash, createApiServer, createEmbeddingProvider, createHandlebarsInstance, createLogger, embeddingConfigSchema, extractText, inferenceRuleSchema, issueRecordSchema, jeevesWatcherConfigSchema, loadConfig, loadCustomHelpers, loggingConfigSchema, mergeEnrichment, pointId, registerBuiltinHelpers, resolveTemplateSource, startFromConfig, vectorStoreConfigSchema, watchConfigSchema, watcherDescriptor };
1938
- export type { AllHelpersIntrospection, ApiConfig, ApiServerOptions, ApplyRulesOptions, ApplyRulesResult, CollectionInfo, CompiledRule, CompiledTemplate, ConfigWatchConfig, DocumentProcessorDeps, DocumentProcessorInterface, EmbeddingConfig, EmbeddingProvider, EnrichmentStoreInterface, EventQueueOptions, ExtractedText, Extractor, FileAttributes, FileSystemWatcherOptions, HelperModuleIntrospection, InferenceRule, InitialScanStatus, IssueRecord, IssuesFile, JeevesWatcherConfig, JeevesWatcherConfigInput, JeevesWatcherFactories, JeevesWatcherRuntimeOptions, LoggingConfig, PayloadFieldSchema, ProcessFn, ProcessorConfig, ProviderFactory, ReindexStatus, RenderResult, RuleLogger, ScrollPageResult, ScrolledPoint, SearchResult, SystemHealthOptions, ValuesIndex, VectorPoint, VectorStore, VectorStoreConfig, WatchConfig, WatchEvent };
1686
+ export { ContentHashCache, DocumentProcessor, EnrichmentStore, EventQueue, FileSystemWatcher, GitignoreFilter, InitialScanTracker, IssuesManager, JeevesWatcher, ReindexTracker, SystemHealth, TemplateEngine, ValuesManager, VectorStoreClient, VirtualRuleStore, applyRules, buildAttributes, buildTemplateEngine, compileRules, contentHash, createApiServer, createEmbeddingProvider, createHandlebarsInstance, createLogger, extractText, issueRecordSchema, loadConfig, loadCustomHelpers, mergeEnrichment, pointId, registerBuiltinHelpers, resolveTemplateSource, startFromConfig, watcherDescriptor };
1687
+ export type { AllHelpersIntrospection, ApiServerOptions, ApplyRulesOptions, ApplyRulesResult, CollectionInfo, CompiledRule, CompiledTemplate, DocumentProcessorDeps, DocumentProcessorInterface, EmbeddingProvider, EnrichmentStoreInterface, EventQueueOptions, ExtractedText, Extractor, FileAttributes, FileSystemWatcherOptions, HelperModuleIntrospection, InitialScanStatus, IssueRecord, IssuesFile, JeevesWatcherFactories, JeevesWatcherRuntimeOptions, PayloadFieldSchema, ProcessFn, ProcessorConfig, ProviderFactory, ReindexStatus, RenderResult, RuleLogger, ScrollPageResult, ScrolledPoint, SearchResult, SystemHealthOptions, ValuesIndex, VectorPoint, VectorStore, WatchEvent };