@riotprompt/riotprompt 0.0.2 → 0.0.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/README.md +54 -470
- package/dist/builder.d.ts +3 -3
- package/dist/builder.js +7 -2
- package/dist/builder.js.map +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/formatter.js.map +1 -1
- package/dist/items/content.js.map +1 -1
- package/dist/items/context.js.map +1 -1
- package/dist/items/instruction.js.map +1 -1
- package/dist/items/parameters.js.map +1 -1
- package/dist/items/section.js.map +1 -1
- package/dist/items/trait.js.map +1 -1
- package/dist/items/weighted.js.map +1 -1
- package/dist/loader.js +1 -0
- package/dist/loader.js.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/override.d.ts +5 -5
- package/dist/override.js +47 -30
- package/dist/override.js.map +1 -1
- package/dist/parse/markdown.js.map +1 -1
- package/dist/parse/text.js.map +1 -1
- package/dist/parser.js.map +1 -1
- package/dist/prompt.js.map +1 -1
- package/dist/recipes.d.ts +405 -0
- package/dist/recipes.js +424 -0
- package/dist/recipes.js.map +1 -0
- package/dist/riotprompt.cjs +484 -32
- package/dist/riotprompt.cjs.map +1 -1
- package/dist/riotprompt.d.ts +3 -0
- package/dist/riotprompt.js +3 -0
- package/dist/riotprompt.js.map +1 -1
- package/dist/util/general.js.map +1 -1
- package/dist/util/markdown.js.map +1 -1
- package/dist/util/storage.js.map +1 -1
- package/dist/util/text.js.map +1 -1
- package/package.json +29 -24
- package/.gitcarve/config.yaml +0 -10
- package/.gitcarve/context/content.md +0 -11
- package/.markdown-doctest-setup.mjs +0 -23
- package/.nvmrc +0 -1
- package/docs/loader.md +0 -237
- package/docs/override.md +0 -323
- package/docs/parser.md +0 -130
- package/eslint.config.mjs +0 -82
- package/nodemon.json +0 -14
- package/vite.config.ts +0 -114
- package/vitest.config.ts +0 -25
package/dist/recipes.js
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import path__default from 'path';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ParametersSchema } from './items/parameters.js';
|
|
4
|
+
import { DEFAULT_LOGGER, wrapLogger } from './logger.js';
|
|
5
|
+
import './items/weighted.js';
|
|
6
|
+
import { create as create$3 } from './items/section.js';
|
|
7
|
+
import { create as create$4 } from './prompt.js';
|
|
8
|
+
import './formatter.js';
|
|
9
|
+
import { create } from './parser.js';
|
|
10
|
+
import { create as create$2 } from './loader.js';
|
|
11
|
+
import { create as create$1 } from './override.js';
|
|
12
|
+
import './builder.js';
|
|
13
|
+
|
|
14
|
+
// ===== CONFIGURATION SCHEMAS =====
|
|
15
|
+
const ContentItemSchema = z.union([
|
|
16
|
+
z.string(),
|
|
17
|
+
z.object({
|
|
18
|
+
content: z.string(),
|
|
19
|
+
title: z.string().optional(),
|
|
20
|
+
weight: z.number().optional()
|
|
21
|
+
}),
|
|
22
|
+
z.object({
|
|
23
|
+
path: z.string(),
|
|
24
|
+
title: z.string().optional(),
|
|
25
|
+
weight: z.number().optional()
|
|
26
|
+
}),
|
|
27
|
+
z.object({
|
|
28
|
+
directories: z.array(z.string()),
|
|
29
|
+
title: z.string().optional(),
|
|
30
|
+
weight: z.number().optional()
|
|
31
|
+
})
|
|
32
|
+
]);
|
|
33
|
+
const RecipeConfigSchema = z.object({
|
|
34
|
+
// Core settings
|
|
35
|
+
basePath: z.string(),
|
|
36
|
+
logger: z.any().optional().default(DEFAULT_LOGGER),
|
|
37
|
+
overridePaths: z.array(z.string()).optional().default([
|
|
38
|
+
"./"
|
|
39
|
+
]),
|
|
40
|
+
overrides: z.boolean().optional().default(false),
|
|
41
|
+
parameters: ParametersSchema.optional().default({}),
|
|
42
|
+
// Content sections - smart inference based on naming
|
|
43
|
+
persona: ContentItemSchema.optional(),
|
|
44
|
+
instructions: z.array(ContentItemSchema).optional().default([]),
|
|
45
|
+
content: z.array(ContentItemSchema).optional().default([]),
|
|
46
|
+
context: z.array(ContentItemSchema).optional().default([]),
|
|
47
|
+
// Templates and inheritance
|
|
48
|
+
extends: z.string().optional(),
|
|
49
|
+
template: z.enum([
|
|
50
|
+
'commit',
|
|
51
|
+
'release',
|
|
52
|
+
'documentation',
|
|
53
|
+
'review',
|
|
54
|
+
'custom'
|
|
55
|
+
]).optional()
|
|
56
|
+
});
|
|
57
|
+
// Built-in template configurations matching common patterns
|
|
58
|
+
const DEFAULT_TEMPLATES = {
|
|
59
|
+
commit: {
|
|
60
|
+
persona: {
|
|
61
|
+
path: "personas/developer.md",
|
|
62
|
+
title: "Developer Persona"
|
|
63
|
+
},
|
|
64
|
+
instructions: [
|
|
65
|
+
{
|
|
66
|
+
path: "instructions/commit.md",
|
|
67
|
+
title: "Commit Instructions"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
release: {
|
|
72
|
+
persona: {
|
|
73
|
+
path: "personas/releaser.md",
|
|
74
|
+
title: "Release Manager Persona"
|
|
75
|
+
},
|
|
76
|
+
instructions: [
|
|
77
|
+
{
|
|
78
|
+
path: "instructions/release.md",
|
|
79
|
+
title: "Release Instructions"
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
documentation: {
|
|
84
|
+
persona: {
|
|
85
|
+
path: "personas/technical-writer.md",
|
|
86
|
+
title: "Technical Writer Persona"
|
|
87
|
+
},
|
|
88
|
+
instructions: [
|
|
89
|
+
{
|
|
90
|
+
path: "instructions/documentation.md",
|
|
91
|
+
title: "Documentation Instructions"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
review: {
|
|
96
|
+
persona: {
|
|
97
|
+
path: "personas/reviewer.md",
|
|
98
|
+
title: "Code Reviewer Persona"
|
|
99
|
+
},
|
|
100
|
+
instructions: [
|
|
101
|
+
{
|
|
102
|
+
path: "instructions/review.md",
|
|
103
|
+
title: "Review Instructions"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
// User-customizable template registry
|
|
109
|
+
let TEMPLATES = {
|
|
110
|
+
...DEFAULT_TEMPLATES
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Configure custom template paths (perfect for KodrDriv constants!)
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* // Configure using your KodrDriv constants
|
|
118
|
+
* configureTemplates({
|
|
119
|
+
* commit: {
|
|
120
|
+
* persona: { path: DEFAULT_PERSONA_YOU_FILE },
|
|
121
|
+
* instructions: [{ path: DEFAULT_INSTRUCTIONS_COMMIT_FILE }]
|
|
122
|
+
* },
|
|
123
|
+
* release: {
|
|
124
|
+
* persona: { path: DEFAULT_PERSONA_RELEASER_FILE },
|
|
125
|
+
* instructions: [{ path: DEFAULT_INSTRUCTIONS_RELEASE_FILE }]
|
|
126
|
+
* }
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*/ const configureTemplates = (customTemplates)=>{
|
|
130
|
+
TEMPLATES = {
|
|
131
|
+
...DEFAULT_TEMPLATES,
|
|
132
|
+
...customTemplates
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Get current template configuration
|
|
137
|
+
*/ const getTemplates = ()=>({
|
|
138
|
+
...TEMPLATES
|
|
139
|
+
});
|
|
140
|
+
// ===== CORE RECIPE ENGINE =====
|
|
141
|
+
const cook = async (config)=>{
|
|
142
|
+
// Parse and validate configuration with defaults
|
|
143
|
+
const validatedConfig = RecipeConfigSchema.parse({
|
|
144
|
+
overridePaths: [
|
|
145
|
+
"./"
|
|
146
|
+
],
|
|
147
|
+
overrides: false,
|
|
148
|
+
parameters: {},
|
|
149
|
+
instructions: [],
|
|
150
|
+
content: [],
|
|
151
|
+
context: [],
|
|
152
|
+
...config
|
|
153
|
+
});
|
|
154
|
+
// Handle template inheritance
|
|
155
|
+
let finalConfig = {
|
|
156
|
+
...validatedConfig
|
|
157
|
+
};
|
|
158
|
+
if (validatedConfig.template) {
|
|
159
|
+
const template = TEMPLATES[validatedConfig.template];
|
|
160
|
+
if (template) {
|
|
161
|
+
finalConfig = {
|
|
162
|
+
...template,
|
|
163
|
+
...validatedConfig
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// Setup internal services
|
|
168
|
+
const logger = wrapLogger(finalConfig.logger, 'Recipe');
|
|
169
|
+
const parser$1 = create({
|
|
170
|
+
logger
|
|
171
|
+
});
|
|
172
|
+
const override$1 = create$1({
|
|
173
|
+
logger,
|
|
174
|
+
configDirs: finalConfig.overridePaths || [
|
|
175
|
+
"./"
|
|
176
|
+
],
|
|
177
|
+
overrides: finalConfig.overrides || false
|
|
178
|
+
});
|
|
179
|
+
const loader$1 = create$2({
|
|
180
|
+
logger
|
|
181
|
+
});
|
|
182
|
+
// Create sections
|
|
183
|
+
const personaSection = create$3({
|
|
184
|
+
title: "Persona"
|
|
185
|
+
});
|
|
186
|
+
const instructionSection = create$3({
|
|
187
|
+
title: "Instruction"
|
|
188
|
+
});
|
|
189
|
+
const contentSection = create$3({
|
|
190
|
+
title: "Content"
|
|
191
|
+
});
|
|
192
|
+
const contextSection = create$3({
|
|
193
|
+
title: "Context"
|
|
194
|
+
});
|
|
195
|
+
// Process persona
|
|
196
|
+
if (finalConfig.persona) {
|
|
197
|
+
await processContentItem(finalConfig.persona, personaSection, 'persona', {
|
|
198
|
+
basePath: finalConfig.basePath,
|
|
199
|
+
parser: parser$1,
|
|
200
|
+
override: override$1,
|
|
201
|
+
loader: loader$1,
|
|
202
|
+
parameters: finalConfig.parameters});
|
|
203
|
+
}
|
|
204
|
+
// Process instructions
|
|
205
|
+
for (const item of finalConfig.instructions || []){
|
|
206
|
+
await processContentItem(item, instructionSection, 'instruction', {
|
|
207
|
+
basePath: finalConfig.basePath,
|
|
208
|
+
parser: parser$1,
|
|
209
|
+
override: override$1,
|
|
210
|
+
loader: loader$1,
|
|
211
|
+
parameters: finalConfig.parameters});
|
|
212
|
+
}
|
|
213
|
+
// Process content
|
|
214
|
+
for (const item of finalConfig.content || []){
|
|
215
|
+
await processContentItem(item, contentSection, 'content', {
|
|
216
|
+
basePath: finalConfig.basePath,
|
|
217
|
+
parser: parser$1,
|
|
218
|
+
override: override$1,
|
|
219
|
+
loader: loader$1,
|
|
220
|
+
parameters: finalConfig.parameters});
|
|
221
|
+
}
|
|
222
|
+
// Process context
|
|
223
|
+
for (const item of finalConfig.context || []){
|
|
224
|
+
await processContentItem(item, contextSection, 'context', {
|
|
225
|
+
basePath: finalConfig.basePath,
|
|
226
|
+
parser: parser$1,
|
|
227
|
+
override: override$1,
|
|
228
|
+
loader: loader$1,
|
|
229
|
+
parameters: finalConfig.parameters});
|
|
230
|
+
}
|
|
231
|
+
// Build and return prompt
|
|
232
|
+
return create$4({
|
|
233
|
+
persona: personaSection,
|
|
234
|
+
instructions: instructionSection,
|
|
235
|
+
contents: contentSection,
|
|
236
|
+
contexts: contextSection
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
const processContentItem = async (item, section, type, ctx)=>{
|
|
240
|
+
const sectionOptions = {
|
|
241
|
+
parameters: ctx.parameters
|
|
242
|
+
};
|
|
243
|
+
if (typeof item === 'string') {
|
|
244
|
+
// Simple string content
|
|
245
|
+
const parsedSection = ctx.parser.parse(item, sectionOptions);
|
|
246
|
+
section.add(parsedSection);
|
|
247
|
+
} else if ('content' in item) {
|
|
248
|
+
// Inline content with options
|
|
249
|
+
const parsedSection = ctx.parser.parse(item.content, {
|
|
250
|
+
...sectionOptions,
|
|
251
|
+
title: item.title,
|
|
252
|
+
weight: item.weight
|
|
253
|
+
});
|
|
254
|
+
section.add(parsedSection);
|
|
255
|
+
} else if ('path' in item) {
|
|
256
|
+
// File path
|
|
257
|
+
const fullPath = path__default.join(ctx.basePath, item.path);
|
|
258
|
+
const parsedSection = await ctx.parser.parseFile(fullPath, {
|
|
259
|
+
...sectionOptions,
|
|
260
|
+
title: item.title,
|
|
261
|
+
weight: item.weight
|
|
262
|
+
});
|
|
263
|
+
const overrideSection = await ctx.override.customize(item.path, parsedSection, sectionOptions);
|
|
264
|
+
section.add(overrideSection);
|
|
265
|
+
} else if ('directories' in item) {
|
|
266
|
+
// Directory loading
|
|
267
|
+
const sections = await ctx.loader.load(item.directories, {
|
|
268
|
+
...sectionOptions,
|
|
269
|
+
title: item.title,
|
|
270
|
+
weight: item.weight
|
|
271
|
+
});
|
|
272
|
+
section.add(sections);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
// ===== CONVENIENCE FUNCTIONS =====
|
|
276
|
+
const commit = (config)=>cook({
|
|
277
|
+
...config,
|
|
278
|
+
template: 'commit'
|
|
279
|
+
});
|
|
280
|
+
const release = (config)=>cook({
|
|
281
|
+
...config,
|
|
282
|
+
template: 'release'
|
|
283
|
+
});
|
|
284
|
+
const documentation = (config)=>cook({
|
|
285
|
+
...config,
|
|
286
|
+
template: 'documentation'
|
|
287
|
+
});
|
|
288
|
+
const review = (config)=>cook({
|
|
289
|
+
...config,
|
|
290
|
+
template: 'review'
|
|
291
|
+
});
|
|
292
|
+
// ===== QUICK BUILDERS =====
|
|
293
|
+
const quick = {
|
|
294
|
+
/**
|
|
295
|
+
* Create a commit prompt with minimal configuration
|
|
296
|
+
*/ commit: async (diffContent, options)=>{
|
|
297
|
+
return cook({
|
|
298
|
+
basePath: options.basePath,
|
|
299
|
+
overridePaths: options.overridePaths,
|
|
300
|
+
overrides: options.overrides,
|
|
301
|
+
template: 'commit',
|
|
302
|
+
content: [
|
|
303
|
+
...options.userDirection ? [
|
|
304
|
+
{
|
|
305
|
+
content: options.userDirection,
|
|
306
|
+
title: 'User Direction',
|
|
307
|
+
weight: 1.0
|
|
308
|
+
}
|
|
309
|
+
] : [],
|
|
310
|
+
{
|
|
311
|
+
content: diffContent,
|
|
312
|
+
title: 'Diff',
|
|
313
|
+
weight: 0.5
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
context: [
|
|
317
|
+
...options.context ? [
|
|
318
|
+
{
|
|
319
|
+
content: options.context,
|
|
320
|
+
title: 'User Context',
|
|
321
|
+
weight: 1.0
|
|
322
|
+
}
|
|
323
|
+
] : [],
|
|
324
|
+
...options.directories ? [
|
|
325
|
+
{
|
|
326
|
+
directories: options.directories,
|
|
327
|
+
weight: 0.5
|
|
328
|
+
}
|
|
329
|
+
] : []
|
|
330
|
+
]
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
/**
|
|
334
|
+
* Create a release prompt with minimal configuration
|
|
335
|
+
*/ release: async (logContent, diffContent, options)=>{
|
|
336
|
+
return cook({
|
|
337
|
+
basePath: options.basePath,
|
|
338
|
+
overridePaths: options.overridePaths,
|
|
339
|
+
overrides: options.overrides,
|
|
340
|
+
template: 'release',
|
|
341
|
+
content: [
|
|
342
|
+
...options.releaseFocus ? [
|
|
343
|
+
{
|
|
344
|
+
content: options.releaseFocus,
|
|
345
|
+
title: 'Release Focus',
|
|
346
|
+
weight: 1.0
|
|
347
|
+
}
|
|
348
|
+
] : [],
|
|
349
|
+
{
|
|
350
|
+
content: logContent,
|
|
351
|
+
title: 'Log',
|
|
352
|
+
weight: 0.5
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
content: diffContent,
|
|
356
|
+
title: 'Diff',
|
|
357
|
+
weight: 0.5
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
context: [
|
|
361
|
+
...options.context ? [
|
|
362
|
+
{
|
|
363
|
+
content: options.context,
|
|
364
|
+
title: 'User Context',
|
|
365
|
+
weight: 1.0
|
|
366
|
+
}
|
|
367
|
+
] : [],
|
|
368
|
+
...options.directories ? [
|
|
369
|
+
{
|
|
370
|
+
directories: options.directories,
|
|
371
|
+
weight: 0.5
|
|
372
|
+
}
|
|
373
|
+
] : []
|
|
374
|
+
]
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
// ===== FLUENT RECIPE BUILDER =====
|
|
379
|
+
const recipe = (basePath)=>({
|
|
380
|
+
template: (name)=>({
|
|
381
|
+
with: (config)=>cook({
|
|
382
|
+
basePath,
|
|
383
|
+
template: name,
|
|
384
|
+
...config
|
|
385
|
+
})
|
|
386
|
+
}),
|
|
387
|
+
persona: (persona)=>({
|
|
388
|
+
instructions: (...instructions)=>({
|
|
389
|
+
content: (...content)=>({
|
|
390
|
+
context: (...context)=>({
|
|
391
|
+
cook: ()=>cook({
|
|
392
|
+
basePath,
|
|
393
|
+
persona,
|
|
394
|
+
instructions,
|
|
395
|
+
content,
|
|
396
|
+
context
|
|
397
|
+
})
|
|
398
|
+
}),
|
|
399
|
+
cook: ()=>cook({
|
|
400
|
+
basePath,
|
|
401
|
+
persona,
|
|
402
|
+
instructions,
|
|
403
|
+
content
|
|
404
|
+
})
|
|
405
|
+
}),
|
|
406
|
+
cook: ()=>cook({
|
|
407
|
+
basePath,
|
|
408
|
+
persona,
|
|
409
|
+
instructions
|
|
410
|
+
})
|
|
411
|
+
}),
|
|
412
|
+
cook: ()=>cook({
|
|
413
|
+
basePath,
|
|
414
|
+
persona
|
|
415
|
+
})
|
|
416
|
+
}),
|
|
417
|
+
cook: (config)=>cook({
|
|
418
|
+
basePath,
|
|
419
|
+
...config
|
|
420
|
+
})
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
export { commit, configureTemplates, cook, documentation, getTemplates, quick, recipe, release, review };
|
|
424
|
+
//# sourceMappingURL=recipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.js","sources":["../src/recipes.ts"],"sourcesContent":["import path from \"path\";\nimport { z } from \"zod\";\nimport { ParametersSchema } from \"./items/parameters\";\nimport { SectionOptions } from \"./items/section\";\nimport { DEFAULT_LOGGER, wrapLogger } from \"./logger\";\nimport { Content, Context, createPrompt, createSection, Instruction, Loader, Override, Parser, Prompt, Section, Weighted } from \"./riotprompt\";\n\n// ===== CONFIGURATION SCHEMAS =====\n\nconst ContentItemSchema = z.union([\n z.string(), // Simple string content\n z.object({\n content: z.string(),\n title: z.string().optional(),\n weight: z.number().optional(),\n }),\n z.object({\n path: z.string(),\n title: z.string().optional(),\n weight: z.number().optional(),\n }),\n z.object({\n directories: z.array(z.string()),\n title: z.string().optional(),\n weight: z.number().optional(),\n })\n]);\n\nconst RecipeConfigSchema = z.object({\n // Core settings\n basePath: z.string(),\n logger: z.any().optional().default(DEFAULT_LOGGER),\n overridePaths: z.array(z.string()).optional().default([\"./\"]),\n overrides: z.boolean().optional().default(false),\n parameters: ParametersSchema.optional().default({}),\n\n // Content sections - smart inference based on naming\n persona: ContentItemSchema.optional(),\n instructions: z.array(ContentItemSchema).optional().default([]),\n content: z.array(ContentItemSchema).optional().default([]),\n context: z.array(ContentItemSchema).optional().default([]),\n\n // Templates and inheritance\n extends: z.string().optional(), // Extend another recipe\n template: z.enum(['commit', 'release', 'documentation', 'review', 'custom']).optional(),\n});\n\ntype RecipeConfig = z.infer<typeof RecipeConfigSchema>;\ntype ContentItem = z.infer<typeof ContentItemSchema>;\n\n// ===== CONFIGURABLE TEMPLATE PATHS =====\n\n// Default template configurations - can be overridden by user\nexport interface TemplateConfig {\n persona?: ContentItem;\n instructions?: ContentItem[];\n content?: ContentItem[];\n context?: ContentItem[];\n}\n\n// Built-in template configurations matching common patterns\nconst DEFAULT_TEMPLATES: Record<string, TemplateConfig> = {\n commit: {\n persona: { path: \"personas/developer.md\", title: \"Developer Persona\" },\n instructions: [\n { path: \"instructions/commit.md\", title: \"Commit Instructions\" },\n ],\n },\n release: {\n persona: { path: \"personas/releaser.md\", title: \"Release Manager Persona\" },\n instructions: [\n { path: \"instructions/release.md\", title: \"Release Instructions\" },\n ],\n },\n documentation: {\n persona: { path: \"personas/technical-writer.md\", title: \"Technical Writer Persona\" },\n instructions: [\n { path: \"instructions/documentation.md\", title: \"Documentation Instructions\" },\n ],\n },\n review: {\n persona: { path: \"personas/reviewer.md\", title: \"Code Reviewer Persona\" },\n instructions: [\n { path: \"instructions/review.md\", title: \"Review Instructions\" },\n ],\n },\n};\n\n// User-customizable template registry\nlet TEMPLATES = { ...DEFAULT_TEMPLATES };\n\n/**\n * Configure custom template paths (perfect for KodrDriv constants!)\n * \n * @example\n * ```typescript\n * // Configure using your KodrDriv constants\n * configureTemplates({\n * commit: {\n * persona: { path: DEFAULT_PERSONA_YOU_FILE },\n * instructions: [{ path: DEFAULT_INSTRUCTIONS_COMMIT_FILE }]\n * },\n * release: {\n * persona: { path: DEFAULT_PERSONA_RELEASER_FILE },\n * instructions: [{ path: DEFAULT_INSTRUCTIONS_RELEASE_FILE }]\n * }\n * });\n * ```\n */\nexport const configureTemplates = (customTemplates: Record<string, TemplateConfig>): void => {\n TEMPLATES = { ...DEFAULT_TEMPLATES, ...customTemplates };\n};\n\n/**\n * Get current template configuration\n */\nexport const getTemplates = (): Record<string, TemplateConfig> => ({ ...TEMPLATES });\n\n// ===== CORE RECIPE ENGINE =====\n\nexport const cook = async (config: Partial<RecipeConfig> & { basePath: string }): Promise<Prompt> => {\n // Parse and validate configuration with defaults\n const validatedConfig = RecipeConfigSchema.parse({\n overridePaths: [\"./\"\n ],\n overrides: false,\n parameters: {},\n instructions: [],\n content: [],\n context: [],\n ...config\n });\n\n // Handle template inheritance\n let finalConfig = { ...validatedConfig };\n if (validatedConfig.template) {\n const template = TEMPLATES[validatedConfig.template];\n if (template) {\n finalConfig = { ...template, ...validatedConfig };\n }\n }\n\n // Setup internal services\n const logger = wrapLogger(finalConfig.logger, 'Recipe');\n const parser = Parser.create({ logger });\n const override = Override.create({\n logger,\n configDirs: finalConfig.overridePaths || [\"./\"],\n overrides: finalConfig.overrides || false\n });\n const loader = Loader.create({ logger });\n\n // Create sections\n const personaSection: Section<Instruction> = createSection({ title: \"Persona\" });\n const instructionSection: Section<Instruction> = createSection({ title: \"Instruction\" });\n const contentSection: Section<Content> = createSection({ title: \"Content\" });\n const contextSection: Section<Context> = createSection({ title: \"Context\" });\n\n // Process persona\n if (finalConfig.persona) {\n await processContentItem(finalConfig.persona, personaSection, 'persona', {\n basePath: finalConfig.basePath,\n parser,\n override,\n loader,\n parameters: finalConfig.parameters,\n logger\n });\n }\n\n // Process instructions\n for (const item of finalConfig.instructions || []) {\n await processContentItem(item, instructionSection, 'instruction', {\n basePath: finalConfig.basePath,\n parser,\n override,\n loader,\n parameters: finalConfig.parameters,\n logger\n });\n }\n\n // Process content\n for (const item of finalConfig.content || []) {\n await processContentItem(item, contentSection, 'content', {\n basePath: finalConfig.basePath,\n parser,\n override,\n loader,\n parameters: finalConfig.parameters,\n logger\n });\n }\n\n // Process context\n for (const item of finalConfig.context || []) {\n await processContentItem(item, contextSection, 'context', {\n basePath: finalConfig.basePath,\n parser,\n override,\n loader,\n parameters: finalConfig.parameters,\n logger\n });\n }\n\n // Build and return prompt\n return createPrompt({\n persona: personaSection,\n instructions: instructionSection,\n contents: contentSection,\n contexts: contextSection\n });\n};\n\n// ===== CONTENT PROCESSING =====\n\ninterface ProcessingContext {\n basePath: string;\n parser: any;\n override: any;\n loader: any;\n parameters: any;\n logger: any;\n}\n\nconst processContentItem = async <T extends Weighted>(\n item: ContentItem,\n section: Section<T>,\n type: 'persona' | 'instruction' | 'content' | 'context',\n ctx: ProcessingContext\n): Promise<void> => {\n const sectionOptions: SectionOptions = {\n parameters: ctx.parameters,\n };\n\n if (typeof item === 'string') {\n // Simple string content\n const parsedSection = ctx.parser.parse(item, sectionOptions);\n section.add(parsedSection);\n } else if ('content' in item) {\n // Inline content with options\n const parsedSection = ctx.parser.parse(item.content, {\n ...sectionOptions,\n title: item.title,\n weight: item.weight,\n });\n section.add(parsedSection);\n } else if ('path' in item) {\n // File path\n const fullPath = path.join(ctx.basePath, item.path);\n const parsedSection = await ctx.parser.parseFile(fullPath, {\n ...sectionOptions,\n title: item.title,\n weight: item.weight,\n });\n const overrideSection = await ctx.override.customize(item.path, parsedSection, sectionOptions);\n section.add(overrideSection);\n } else if ('directories' in item) {\n // Directory loading\n const sections = await ctx.loader.load(item.directories, {\n ...sectionOptions,\n title: item.title,\n weight: item.weight,\n });\n section.add(sections);\n }\n};\n\n// ===== CONVENIENCE FUNCTIONS =====\n\nexport const commit = (config: Partial<RecipeConfig> & { basePath: string }): Promise<Prompt> =>\n cook({ ...config, template: 'commit' });\n\nexport const release = (config: Partial<RecipeConfig> & { basePath: string }): Promise<Prompt> =>\n cook({ ...config, template: 'release' });\n\nexport const documentation = (config: Partial<RecipeConfig> & { basePath: string }): Promise<Prompt> =>\n cook({ ...config, template: 'documentation' });\n\nexport const review = (config: Partial<RecipeConfig> & { basePath: string }): Promise<Prompt> =>\n cook({ ...config, template: 'review' });\n\n// ===== QUICK BUILDERS =====\n\nexport const quick = {\n /**\n * Create a commit prompt with minimal configuration\n */\n commit: async (diffContent: string, options: {\n basePath: string;\n overridePaths?: string[];\n overrides?: boolean;\n userDirection?: string;\n context?: string;\n directories?: string[];\n }): Promise<Prompt> => {\n return cook({\n basePath: options.basePath,\n overridePaths: options.overridePaths,\n overrides: options.overrides,\n template: 'commit',\n content: [\n ...(options.userDirection ? [{ content: options.userDirection, title: 'User Direction', weight: 1.0 }] : []),\n { content: diffContent, title: 'Diff', weight: 0.5 },\n ],\n context: [\n ...(options.context ? [{ content: options.context, title: 'User Context', weight: 1.0 }] : []),\n ...(options.directories ? [{ directories: options.directories, weight: 0.5 }] : []),\n ],\n });\n },\n\n /**\n * Create a release prompt with minimal configuration\n */\n release: async (logContent: string, diffContent: string, options: {\n basePath: string;\n overridePaths?: string[];\n overrides?: boolean;\n releaseFocus?: string;\n context?: string;\n directories?: string[];\n }): Promise<Prompt> => {\n return cook({\n basePath: options.basePath,\n overridePaths: options.overridePaths,\n overrides: options.overrides,\n template: 'release',\n content: [\n ...(options.releaseFocus ? [{ content: options.releaseFocus, title: 'Release Focus', weight: 1.0 }] : []),\n { content: logContent, title: 'Log', weight: 0.5 },\n { content: diffContent, title: 'Diff', weight: 0.5 },\n ],\n context: [\n ...(options.context ? [{ content: options.context, title: 'User Context', weight: 1.0 }] : []),\n ...(options.directories ? [{ directories: options.directories, weight: 0.5 }] : []),\n ],\n });\n },\n};\n\n// ===== FLUENT RECIPE BUILDER =====\n\nexport const recipe = (basePath: string) => ({\n template: (name: 'commit' | 'release' | 'documentation' | 'review') => ({\n with: (config: Partial<RecipeConfig>) =>\n cook({ basePath, template: name, ...config }),\n }),\n\n persona: (persona: ContentItem) => ({\n instructions: (...instructions: ContentItem[]) => ({\n content: (...content: ContentItem[]) => ({\n context: (...context: ContentItem[]) => ({\n cook: () => cook({ basePath, persona, instructions, content, context }),\n }),\n cook: () => cook({ basePath, persona, instructions, content }),\n }),\n cook: () => cook({ basePath, persona, instructions }),\n }),\n cook: () => cook({ basePath, persona }),\n }),\n\n cook: (config: Partial<RecipeConfig>) => cook({ basePath, ...config }),\n});\n\n// Export types for external use\nexport type { RecipeConfig, ContentItem }; "],"names":["ContentItemSchema","z","union","string","object","content","title","optional","weight","number","path","directories","array","RecipeConfigSchema","basePath","logger","any","default","DEFAULT_LOGGER","overridePaths","overrides","boolean","parameters","ParametersSchema","persona","instructions","context","extends","template","enum","DEFAULT_TEMPLATES","commit","release","documentation","review","TEMPLATES","configureTemplates","customTemplates","getTemplates","cook","config","validatedConfig","parse","finalConfig","wrapLogger","parser","Parser","override","Override","configDirs","loader","Loader","personaSection","createSection","instructionSection","contentSection","contextSection","processContentItem","item","createPrompt","contents","contexts","section","type","ctx","sectionOptions","parsedSection","add","fullPath","join","parseFile","overrideSection","customize","sections","load","quick","diffContent","options","userDirection","logContent","releaseFocus","recipe","name","with"],"mappings":";;;;;;;;;;;;;AAOA;AAEA,MAAMA,iBAAAA,GAAoBC,CAAAA,CAAEC,KAAK,CAAC;AAC9BD,IAAAA,CAAAA,CAAEE,MAAM,EAAA;AACRF,IAAAA,CAAAA,CAAEG,MAAM,CAAC;AACLC,QAAAA,OAAAA,EAASJ,EAAEE,MAAM,EAAA;QACjBG,KAAAA,EAAOL,CAAAA,CAAEE,MAAM,EAAA,CAAGI,QAAQ,EAAA;QAC1BC,MAAAA,E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