forgesmith 0.6.0 → 0.7.0
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.cjs +2919 -402
- package/dist/index.d.cts +438 -48
- package/dist/index.d.ts +438 -48
- package/dist/index.mjs +2912 -389
- package/dist/server.cjs +6524 -0
- package/dist/server.d.cts +1387 -0
- package/dist/server.d.ts +1387 -0
- package/dist/server.mjs +6393 -0
- package/package.json +7 -2
|
@@ -0,0 +1,1387 @@
|
|
|
1
|
+
interface PrismSession {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
summary?: string;
|
|
5
|
+
conclusion?: string;
|
|
6
|
+
createdAt?: string;
|
|
7
|
+
}
|
|
8
|
+
interface PrismRecommendation {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
severity?: "low" | "medium" | "high" | "critical";
|
|
12
|
+
accepted?: boolean;
|
|
13
|
+
description?: string;
|
|
14
|
+
}
|
|
15
|
+
interface PrismInsight {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
body?: string;
|
|
19
|
+
}
|
|
20
|
+
interface PrismData {
|
|
21
|
+
sessions?: PrismSession[];
|
|
22
|
+
recommendations?: PrismRecommendation[];
|
|
23
|
+
insights?: PrismInsight[];
|
|
24
|
+
fromDate?: string;
|
|
25
|
+
toDate?: string;
|
|
26
|
+
}
|
|
27
|
+
interface ReleaseNotesOpts {
|
|
28
|
+
tone?: "professional" | "casual" | "technical" | "executive";
|
|
29
|
+
length?: "short" | "medium" | "long";
|
|
30
|
+
format?: "markdown" | "plain";
|
|
31
|
+
}
|
|
32
|
+
interface BlueprintFile {
|
|
33
|
+
path: string;
|
|
34
|
+
category?: "app" | "component" | "lib" | "hook" | string;
|
|
35
|
+
importCount?: number;
|
|
36
|
+
importedByCount?: number;
|
|
37
|
+
lineCount?: number;
|
|
38
|
+
}
|
|
39
|
+
interface BlueprintEdge {
|
|
40
|
+
from: string;
|
|
41
|
+
to: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
}
|
|
44
|
+
interface BlueprintData {
|
|
45
|
+
targetPath: string;
|
|
46
|
+
scanTimestamp: number;
|
|
47
|
+
stats: {
|
|
48
|
+
totalFiles: number;
|
|
49
|
+
runtimeEdges: number;
|
|
50
|
+
[key: string]: number;
|
|
51
|
+
};
|
|
52
|
+
files: BlueprintFile[];
|
|
53
|
+
edges: BlueprintEdge[];
|
|
54
|
+
categories: {
|
|
55
|
+
app: number;
|
|
56
|
+
component: number;
|
|
57
|
+
lib: number;
|
|
58
|
+
hook: number;
|
|
59
|
+
[key: string]: number;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
interface ArchitectureWalkthroughOpts {
|
|
63
|
+
tone?: "professional" | "casual" | "technical" | "executive";
|
|
64
|
+
length?: "short" | "medium" | "long";
|
|
65
|
+
format?: "markdown" | "plain";
|
|
66
|
+
}
|
|
67
|
+
interface ChangesSinceOpts {
|
|
68
|
+
tone?: "professional" | "casual" | "technical";
|
|
69
|
+
length?: "short" | "medium" | "long";
|
|
70
|
+
format?: "markdown" | "plain";
|
|
71
|
+
}
|
|
72
|
+
interface OnboardingDocOpts {
|
|
73
|
+
tone?: "professional" | "casual" | "technical" | "executive";
|
|
74
|
+
length?: "short" | "medium" | "long";
|
|
75
|
+
format?: "markdown" | "plain";
|
|
76
|
+
}
|
|
77
|
+
interface RefactoringReportOpts {
|
|
78
|
+
tone?: "professional" | "casual" | "technical" | "executive";
|
|
79
|
+
length?: "short" | "medium" | "long";
|
|
80
|
+
format?: "markdown" | "plain";
|
|
81
|
+
}
|
|
82
|
+
type AskDrivenAssetFormat = "markdown" | "blog" | "social" | "email" | "slack" | "slide";
|
|
83
|
+
interface AskDrivenAssetOpts {
|
|
84
|
+
format?: AskDrivenAssetFormat;
|
|
85
|
+
tone?: "professional" | "casual" | "technical" | "executive";
|
|
86
|
+
length?: "short" | "medium" | "long";
|
|
87
|
+
}
|
|
88
|
+
interface GenerationResult {
|
|
89
|
+
text: string;
|
|
90
|
+
metadata: {
|
|
91
|
+
generatedAt: string;
|
|
92
|
+
usedTokens: number;
|
|
93
|
+
generator: "forgesmith";
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare function readPrismDirectory(prismPath: string): Promise<PrismData>;
|
|
98
|
+
declare function readBlueprintData(targetPath: string): Promise<BlueprintData | null>;
|
|
99
|
+
|
|
100
|
+
interface AmberCapabilityContext {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
criticality: "critical" | "high" | "medium" | "low";
|
|
104
|
+
lifecycle: "active" | "experimental" | "deprecated" | "sunset";
|
|
105
|
+
description?: string;
|
|
106
|
+
/** Files tagged with this capability in state.json */
|
|
107
|
+
files: string[];
|
|
108
|
+
/** Files tagged with this capability that have no doc_hash (outdated @amber-doc) */
|
|
109
|
+
driftCount: number;
|
|
110
|
+
/** Whether any file in this capability's set has a doc_hash (proxy for test coverage) */
|
|
111
|
+
hasTests: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface AmberLayerContext {
|
|
114
|
+
capabilities: AmberCapabilityContext[];
|
|
115
|
+
totalFiles: number;
|
|
116
|
+
taggedFiles: number;
|
|
117
|
+
taggedPercent: number;
|
|
118
|
+
driftedCapabilities: number;
|
|
119
|
+
orphanedFiles: string[];
|
|
120
|
+
/** Human-readable summary for prompt injection */
|
|
121
|
+
summary: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Read the AMBER layer from a target project's .amber/ directory.
|
|
125
|
+
* Returns null when no .amber/ directory exists — callers degrade cleanly.
|
|
126
|
+
*/
|
|
127
|
+
declare function readAmberLayer(targetPath: string): Promise<AmberLayerContext | null>;
|
|
128
|
+
|
|
129
|
+
interface GreenInsightContext {
|
|
130
|
+
id: string;
|
|
131
|
+
title: string;
|
|
132
|
+
body: string;
|
|
133
|
+
category: string;
|
|
134
|
+
severity?: string;
|
|
135
|
+
}
|
|
136
|
+
interface GreenLayerContext {
|
|
137
|
+
insights: GreenInsightContext[];
|
|
138
|
+
coherenceScore: number | null;
|
|
139
|
+
coherenceGrade: string | null;
|
|
140
|
+
topRisks: Array<{
|
|
141
|
+
capabilityId: string;
|
|
142
|
+
name: string;
|
|
143
|
+
reason: string;
|
|
144
|
+
impact: number;
|
|
145
|
+
}>;
|
|
146
|
+
/** Human-readable summary for prompt injection */
|
|
147
|
+
summary: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Read the GREEN layer from a target project's .prism/green/ directory.
|
|
151
|
+
* Returns null when the directory does not exist — callers degrade cleanly.
|
|
152
|
+
*/
|
|
153
|
+
declare function readGreenLayer(targetPath: string): Promise<GreenLayerContext | null>;
|
|
154
|
+
|
|
155
|
+
type ScopeKind = "framework" | "app" | "tenant";
|
|
156
|
+
type SignalKind = "brief" | "knowledge_ref" | "git_range" | "app_feature_ref" | "business_capability_ref" | "amber_capability_ref" | "platform_walkthrough" | "green_insight_ref";
|
|
157
|
+
type Channel = "heise" | "connect" | "linkedin" | "instagram" | "landing" | "onepager" | "internal" | "email" | "deck" | "x" | "product_hunt" | "presentation";
|
|
158
|
+
type AudienceId = string & {
|
|
159
|
+
readonly __brand: "AudienceId";
|
|
160
|
+
};
|
|
161
|
+
declare const asAudienceId: (id: string) => AudienceId;
|
|
162
|
+
type Intent = "inform" | "pitch" | "announce" | "convince" | "educate" | "explain_to_layperson" | "recruit" | "celebrate_release";
|
|
163
|
+
type Format = "long_article" | "short_post" | "carousel_sequence" | "story_sequence" | "pitch_paragraphs" | "landing_block" | "one_pager_section" | "quote_card" | "screenshot_narrative" | "visual_brief" | "video_brief" | "shotlist" | "hook_sequence";
|
|
164
|
+
type Modality = "text" | "text_with_visual_brief" | "interactive_visual" | "image" | "video" | "mixed";
|
|
165
|
+
type AssetKind = "image_brief" | "screenshot_request" | "video_brief" | "shotlist" | "quote_card_spec";
|
|
166
|
+
type OutputStatus = "draft" | "generating" | "ready" | "failed";
|
|
167
|
+
type Tonality = "sachlich-tief" | "sachlich-zugänglich" | "ambitioniert-glaubwürdig" | "warm-zugänglich" | "nüchtern-direkt";
|
|
168
|
+
type ReadingLevel = "expert" | "professional" | "general" | "lay";
|
|
169
|
+
interface ForgeAudience {
|
|
170
|
+
id: AudienceId;
|
|
171
|
+
label: string;
|
|
172
|
+
tonality: Tonality;
|
|
173
|
+
reading_level: ReadingLevel;
|
|
174
|
+
channel_hints: Channel[];
|
|
175
|
+
description: string;
|
|
176
|
+
}
|
|
177
|
+
interface ForgeSignal {
|
|
178
|
+
id: string;
|
|
179
|
+
scope_kind: ScopeKind;
|
|
180
|
+
app_id?: string | null;
|
|
181
|
+
env?: string | null;
|
|
182
|
+
kind: SignalKind;
|
|
183
|
+
payload: Record<string, unknown>;
|
|
184
|
+
source_refs: Record<string, unknown>;
|
|
185
|
+
created_by?: string | null;
|
|
186
|
+
created_at: string;
|
|
187
|
+
}
|
|
188
|
+
interface ForgeTemplate {
|
|
189
|
+
id: string;
|
|
190
|
+
channel: Channel;
|
|
191
|
+
audience_id: AudienceId;
|
|
192
|
+
intent: Intent;
|
|
193
|
+
format: Format;
|
|
194
|
+
modality: Modality;
|
|
195
|
+
tonality?: Tonality;
|
|
196
|
+
schema_json: Record<string, unknown>;
|
|
197
|
+
asset_slots: Array<Record<string, unknown>>;
|
|
198
|
+
created_at?: string;
|
|
199
|
+
}
|
|
200
|
+
interface ForgeOutput {
|
|
201
|
+
id: string;
|
|
202
|
+
signal_id?: string | null;
|
|
203
|
+
template_id?: string | null;
|
|
204
|
+
status: OutputStatus;
|
|
205
|
+
scope_kind: ScopeKind;
|
|
206
|
+
app_id?: string | null;
|
|
207
|
+
env?: string | null;
|
|
208
|
+
channel: Channel;
|
|
209
|
+
audience_id: AudienceId;
|
|
210
|
+
intent: Intent;
|
|
211
|
+
format: Format;
|
|
212
|
+
modality: Modality;
|
|
213
|
+
result_json?: Record<string, unknown> | null;
|
|
214
|
+
revision_of?: string | null;
|
|
215
|
+
created_at: string;
|
|
216
|
+
}
|
|
217
|
+
interface ForgeAsset {
|
|
218
|
+
id: string;
|
|
219
|
+
output_id: string;
|
|
220
|
+
kind: AssetKind;
|
|
221
|
+
modality: Modality;
|
|
222
|
+
props_json: Record<string, unknown>;
|
|
223
|
+
source_refs: Record<string, unknown>;
|
|
224
|
+
widget_def_id?: string | null;
|
|
225
|
+
widget_runtime?: string | null;
|
|
226
|
+
widget_def_history?: Array<{
|
|
227
|
+
widget_def_id: string;
|
|
228
|
+
replaced_at: string;
|
|
229
|
+
reason?: string;
|
|
230
|
+
}>;
|
|
231
|
+
created_at: string;
|
|
232
|
+
}
|
|
233
|
+
interface ForgeScope {
|
|
234
|
+
kind: ScopeKind;
|
|
235
|
+
app_id?: string | null;
|
|
236
|
+
env?: string | null;
|
|
237
|
+
}
|
|
238
|
+
type ForgeSubview = "signals" | "templates" | "audiences" | "outputs" | "walkthroughs";
|
|
239
|
+
interface Zone {
|
|
240
|
+
id: string;
|
|
241
|
+
name: string;
|
|
242
|
+
files: string[];
|
|
243
|
+
fileCount: number;
|
|
244
|
+
heat: number;
|
|
245
|
+
}
|
|
246
|
+
interface FileEntry {
|
|
247
|
+
path: string;
|
|
248
|
+
importCount: number;
|
|
249
|
+
importedByCount: number;
|
|
250
|
+
lineCount: number;
|
|
251
|
+
zone: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/** Defence-in-depth: scan derived text for secret patterns before sending to LLM. */
|
|
255
|
+
declare function scanForSecrets(text: string): boolean;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Converts a prismlens `blueprint.json` (prism0x2A on-disk format) into the
|
|
259
|
+
* canonical `BlueprintData` shape used by forgesmith's generators and UI.
|
|
260
|
+
*
|
|
261
|
+
* Mapping:
|
|
262
|
+
* prismlens.nodes[] → BlueprintData.files[]
|
|
263
|
+
* prismlens.edges[] → BlueprintData.edges[] (source/target → from/to)
|
|
264
|
+
* prismlens.summary.fileCount → BlueprintData.stats.totalFiles
|
|
265
|
+
* prismlens.summary.runtimeInternalDependencyCount → BlueprintData.stats.runtimeEdges
|
|
266
|
+
* prismlens.summary.*Count → BlueprintData.categories
|
|
267
|
+
* prismlens.heatmap / mostImportedFiles → importedByCount approximation on files
|
|
268
|
+
*/
|
|
269
|
+
declare function normalizePrismlensBlueprint(raw: unknown, targetPath?: string): BlueprintData;
|
|
270
|
+
/**
|
|
271
|
+
* Reads a blueprint from the target project and returns a canonical BlueprintData.
|
|
272
|
+
*
|
|
273
|
+
* Resolution order:
|
|
274
|
+
* 1. {targetPath}/.prism/blueprint/snapshot.json — native BlueprintData shape; no conversion needed
|
|
275
|
+
* 2. {targetPath}/.prism/blueprint.json — prismlens shape; normalized via normalizePrismlensBlueprint()
|
|
276
|
+
*
|
|
277
|
+
* Returns null if neither file exists, if the path is unsafe, or if JSON is malformed.
|
|
278
|
+
*/
|
|
279
|
+
declare function readBlueprintFromTarget(targetPath: string): BlueprintData | null;
|
|
280
|
+
|
|
281
|
+
/** Groups files into zones (top-level directory segments). Sorted by heat desc. */
|
|
282
|
+
declare function extractZones(blueprint: BlueprintData): Zone[];
|
|
283
|
+
/** Files with highest importedByCount — proxy for "most-changed / hottest" files. */
|
|
284
|
+
declare function extractTopChurnFiles(blueprint: BlueprintData, n?: number): FileEntry[];
|
|
285
|
+
/** Files with highest importCount — most dependency-heavy, highest coupling. */
|
|
286
|
+
declare function extractDependencyHotspots(blueprint: BlueprintData, n?: number): FileEntry[];
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Produces a compact LLM-ready summary of the blueprint.
|
|
290
|
+
* Contains ONLY metrics, file paths, and category names — never raw file contents.
|
|
291
|
+
* Scanned for secrets before return; throws if any found (should never happen).
|
|
292
|
+
*/
|
|
293
|
+
declare function deriveContextSummary(blueprint: BlueprintData): string;
|
|
294
|
+
|
|
295
|
+
interface BrandKitPalette {
|
|
296
|
+
primary: string;
|
|
297
|
+
secondary: string;
|
|
298
|
+
accent: string;
|
|
299
|
+
surface: string;
|
|
300
|
+
text: string;
|
|
301
|
+
muted: string;
|
|
302
|
+
}
|
|
303
|
+
interface BrandKitFonts {
|
|
304
|
+
heading: string;
|
|
305
|
+
body: string;
|
|
306
|
+
mono: string;
|
|
307
|
+
}
|
|
308
|
+
interface BrandKitVoice {
|
|
309
|
+
tone: string;
|
|
310
|
+
audience: string;
|
|
311
|
+
vocabulary: string[];
|
|
312
|
+
avoid: string[];
|
|
313
|
+
formality: number;
|
|
314
|
+
technicality: number;
|
|
315
|
+
}
|
|
316
|
+
interface BrandKitLogo {
|
|
317
|
+
url?: string;
|
|
318
|
+
svg?: string;
|
|
319
|
+
}
|
|
320
|
+
interface BrandKitSnapshot {
|
|
321
|
+
version: number;
|
|
322
|
+
saved_at: string;
|
|
323
|
+
palette: BrandKitPalette;
|
|
324
|
+
voice: BrandKitVoice;
|
|
325
|
+
}
|
|
326
|
+
interface BrandKit {
|
|
327
|
+
id: string;
|
|
328
|
+
name: string;
|
|
329
|
+
source: "manual" | "url" | "prism";
|
|
330
|
+
source_url?: string;
|
|
331
|
+
palette: BrandKitPalette;
|
|
332
|
+
fonts: BrandKitFonts;
|
|
333
|
+
voice: BrandKitVoice;
|
|
334
|
+
logo: BrandKitLogo;
|
|
335
|
+
prism_detected?: boolean;
|
|
336
|
+
version: number;
|
|
337
|
+
versions: BrandKitSnapshot[];
|
|
338
|
+
created_at: string;
|
|
339
|
+
updated_at: string;
|
|
340
|
+
}
|
|
341
|
+
declare const DEFAULT_BRAND_KIT_PALETTE: BrandKitPalette;
|
|
342
|
+
declare const DEFAULT_BRAND_KIT_FONTS: BrandKitFonts;
|
|
343
|
+
declare const DEFAULT_BRAND_KIT_VOICE: BrandKitVoice;
|
|
344
|
+
declare function defaultBrandKit(partial?: Partial<BrandKit>): Omit<BrandKit, "id" | "created_at" | "updated_at">;
|
|
345
|
+
interface UrlBrandHints {
|
|
346
|
+
url: string;
|
|
347
|
+
pageTitle?: string;
|
|
348
|
+
metaDescription?: string;
|
|
349
|
+
themeColor?: string;
|
|
350
|
+
ogImage?: string;
|
|
351
|
+
cssColorHints?: string[];
|
|
352
|
+
fontHints?: string[];
|
|
353
|
+
}
|
|
354
|
+
declare function assembleBrandUrlExtractionPrompt(hints: UrlBrandHints): string;
|
|
355
|
+
declare function parseBrandKitFromLlmResponse(text: string, hints: UrlBrandHints): Omit<BrandKit, "id" | "created_at" | "updated_at" | "version" | "versions">;
|
|
356
|
+
interface PrismBrandDraft {
|
|
357
|
+
suggestedName: string;
|
|
358
|
+
voice: BrandKitVoice;
|
|
359
|
+
prism_detected: true;
|
|
360
|
+
blueprint_path: string;
|
|
361
|
+
stats: {
|
|
362
|
+
totalFiles: number;
|
|
363
|
+
categories: Record<string, number>;
|
|
364
|
+
technicalScore: number;
|
|
365
|
+
audienceMix: string;
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
declare function extractBrandFromPrismBlueprint(targetPath: string): Promise<PrismBrandDraft>;
|
|
370
|
+
|
|
371
|
+
type PrismFocus = "release" | "changelog" | "deepdive" | "summary" | `zone:${string}` | `module:${string}`;
|
|
372
|
+
interface PrismContextPrompt {
|
|
373
|
+
systemFragment: string;
|
|
374
|
+
contextBlock: string;
|
|
375
|
+
suggestedAsk: string;
|
|
376
|
+
}
|
|
377
|
+
interface PrismTemplate {
|
|
378
|
+
id: string;
|
|
379
|
+
name: string;
|
|
380
|
+
description: string;
|
|
381
|
+
defaultFocus: PrismFocus;
|
|
382
|
+
suggestedAsk: string;
|
|
383
|
+
suggestedChannels: string[];
|
|
384
|
+
requiresZone?: boolean;
|
|
385
|
+
}
|
|
386
|
+
declare const PRISM_TEMPLATE_RELEASE_ANNOUNCEMENT: PrismTemplate;
|
|
387
|
+
declare const PRISM_TEMPLATE_SHIPPING_DIGEST: PrismTemplate;
|
|
388
|
+
declare const PRISM_TEMPLATE_ZONE_DEEPDIVE: PrismTemplate;
|
|
389
|
+
declare const PRISM_TEMPLATE_ARCHITECTURE_OVERVIEW: PrismTemplate;
|
|
390
|
+
declare const PRISM_TEMPLATE_REFACTOR_RATIONALE: PrismTemplate;
|
|
391
|
+
declare const PRISM_TEMPLATES: PrismTemplate[];
|
|
392
|
+
declare function getPrismTemplate(id: string): PrismTemplate | undefined;
|
|
393
|
+
|
|
394
|
+
declare function buildPrismContextPrompt(blueprint: BlueprintData, focus?: PrismFocus, highlight?: string): PrismContextPrompt;
|
|
395
|
+
|
|
396
|
+
interface LlmMessage {
|
|
397
|
+
role: "user" | "assistant";
|
|
398
|
+
content: string;
|
|
399
|
+
}
|
|
400
|
+
interface LlmRequest {
|
|
401
|
+
model?: string;
|
|
402
|
+
messages: LlmMessage[];
|
|
403
|
+
maxTokens?: number;
|
|
404
|
+
systemPrompt?: string;
|
|
405
|
+
}
|
|
406
|
+
interface LlmResponse {
|
|
407
|
+
content: string;
|
|
408
|
+
usedTokens: number;
|
|
409
|
+
}
|
|
410
|
+
interface LlmProvider {
|
|
411
|
+
complete(request: LlmRequest): Promise<LlmResponse>;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
declare function generateReleaseNotes(data: PrismData, opts: ReleaseNotesOpts, provider: LlmProvider, amberContext?: AmberLayerContext, greenContext?: GreenLayerContext): Promise<GenerationResult>;
|
|
415
|
+
|
|
416
|
+
declare function generateArchitectureWalkthrough(blueprint: BlueprintData | null, opts: ArchitectureWalkthroughOpts, provider: LlmProvider, amberContext?: AmberLayerContext): Promise<GenerationResult>;
|
|
417
|
+
|
|
418
|
+
declare function generateChangesSince(current: BlueprintData | null, previous: BlueprintData | null, opts: ChangesSinceOpts, provider: LlmProvider): Promise<GenerationResult>;
|
|
419
|
+
|
|
420
|
+
declare function generateOnboardingDoc(blueprint: BlueprintData | null, opts: OnboardingDocOpts, provider: LlmProvider): Promise<GenerationResult>;
|
|
421
|
+
|
|
422
|
+
declare function generateRefactoringReport(blueprint: BlueprintData | null, opts: RefactoringReportOpts, provider: LlmProvider, amberContext?: AmberLayerContext, greenContext?: GreenLayerContext): Promise<GenerationResult>;
|
|
423
|
+
|
|
424
|
+
declare function generateAskDrivenAsset(blueprint: BlueprintData | null, question: string, opts: AskDrivenAssetOpts, provider: LlmProvider): Promise<GenerationResult>;
|
|
425
|
+
|
|
426
|
+
type PresentationSlideType = "title" | "executive" | "architecture" | "capabilities" | "health" | "risks" | "recommendations" | "metrics" | "closing";
|
|
427
|
+
interface PresentationSlide {
|
|
428
|
+
type: PresentationSlideType;
|
|
429
|
+
title: string;
|
|
430
|
+
subtitle?: string;
|
|
431
|
+
bullets?: string[];
|
|
432
|
+
highlight?: string;
|
|
433
|
+
highlightLabel?: string;
|
|
434
|
+
speakerNotes?: string;
|
|
435
|
+
visualHint?: string;
|
|
436
|
+
}
|
|
437
|
+
interface PresentationOutput {
|
|
438
|
+
title: string;
|
|
439
|
+
subtitle: string;
|
|
440
|
+
slideCount: number;
|
|
441
|
+
slides: PresentationSlide[];
|
|
442
|
+
theme: "dark" | "light" | "corporate";
|
|
443
|
+
generatedAt: string;
|
|
444
|
+
}
|
|
445
|
+
interface GeneratePresentationOpts {
|
|
446
|
+
blueprint: BlueprintData;
|
|
447
|
+
audience: "technical" | "executive" | "mixed";
|
|
448
|
+
slideCount: 5 | 8 | 10 | 12;
|
|
449
|
+
theme: "dark" | "light" | "corporate";
|
|
450
|
+
focusArea?: "architecture" | "health" | "risks" | "all";
|
|
451
|
+
tone: "professional" | "casual" | "executive";
|
|
452
|
+
projectName?: string;
|
|
453
|
+
llm: LlmProvider;
|
|
454
|
+
}
|
|
455
|
+
declare function generatePresentation(opts: GeneratePresentationOpts): Promise<PresentationOutput>;
|
|
456
|
+
|
|
457
|
+
type ComplianceFramework = "SOX" | "ISO27001" | "GDPR" | "SOC2" | "CUSTOM";
|
|
458
|
+
interface ComplianceCapabilityRecord {
|
|
459
|
+
id: string;
|
|
460
|
+
name: string;
|
|
461
|
+
criticality: "critical" | "high" | "medium" | "low";
|
|
462
|
+
lifecycle: "active" | "experimental" | "deprecated" | "sunset";
|
|
463
|
+
files: string[];
|
|
464
|
+
testCoverage: boolean;
|
|
465
|
+
driftCount: number;
|
|
466
|
+
description?: string;
|
|
467
|
+
dataProcessing?: boolean;
|
|
468
|
+
accessControl?: boolean;
|
|
469
|
+
auditTrail?: boolean;
|
|
470
|
+
}
|
|
471
|
+
interface ComplianceContext {
|
|
472
|
+
framework: string;
|
|
473
|
+
projectName: string;
|
|
474
|
+
generatedAt: string;
|
|
475
|
+
totalCapabilities: number;
|
|
476
|
+
criticalCapabilities: ComplianceCapabilityRecord[];
|
|
477
|
+
riskSummary: {
|
|
478
|
+
high: number;
|
|
479
|
+
medium: number;
|
|
480
|
+
low: number;
|
|
481
|
+
};
|
|
482
|
+
sox?: {
|
|
483
|
+
financialCapabilities: string[];
|
|
484
|
+
accessControlled: string[];
|
|
485
|
+
};
|
|
486
|
+
gdpr?: {
|
|
487
|
+
dataProcessingCapabilities: string[];
|
|
488
|
+
retentionCapabilities: string[];
|
|
489
|
+
};
|
|
490
|
+
iso27001?: {
|
|
491
|
+
informationAssets: string[];
|
|
492
|
+
securityControls: string[];
|
|
493
|
+
};
|
|
494
|
+
soc2?: {
|
|
495
|
+
securityCapabilities: string[];
|
|
496
|
+
availabilityCapabilities: string[];
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
interface GenerateComplianceDocOpts {
|
|
500
|
+
blueprint: BlueprintData;
|
|
501
|
+
amberContext?: AmberLayerContext;
|
|
502
|
+
complianceContext?: ComplianceContext;
|
|
503
|
+
framework: ComplianceFramework;
|
|
504
|
+
customFramework?: string;
|
|
505
|
+
projectName: string;
|
|
506
|
+
organizationName?: string;
|
|
507
|
+
tone: "formal" | "technical" | "executive";
|
|
508
|
+
includeRecommendations: boolean;
|
|
509
|
+
llm: LlmProvider;
|
|
510
|
+
}
|
|
511
|
+
interface ComplianceSection {
|
|
512
|
+
title: string;
|
|
513
|
+
content: string;
|
|
514
|
+
capabilities: string[];
|
|
515
|
+
riskLevel?: "high" | "medium" | "low";
|
|
516
|
+
status?: "compliant" | "partial" | "gap";
|
|
517
|
+
}
|
|
518
|
+
interface ComplianceDocOutput {
|
|
519
|
+
framework: ComplianceFramework;
|
|
520
|
+
documentTitle: string;
|
|
521
|
+
sections: ComplianceSection[];
|
|
522
|
+
executiveSummary: string;
|
|
523
|
+
complianceGaps: string[];
|
|
524
|
+
recommendations: string[];
|
|
525
|
+
generatedAt: string;
|
|
526
|
+
confidentiality: "INTERNAL" | "CONFIDENTIAL" | "PUBLIC";
|
|
527
|
+
}
|
|
528
|
+
declare function generateComplianceDoc(opts: GenerateComplianceDocOpts): Promise<ComplianceDocOutput>;
|
|
529
|
+
|
|
530
|
+
interface AdrContext {
|
|
531
|
+
importCycles: Array<{
|
|
532
|
+
files: string[];
|
|
533
|
+
severity: "tight" | "chain" | "web";
|
|
534
|
+
}>;
|
|
535
|
+
capabilityBoundaries: Array<{
|
|
536
|
+
from: string;
|
|
537
|
+
to: string;
|
|
538
|
+
edgeCount: number;
|
|
539
|
+
}>;
|
|
540
|
+
highChurnFiles: Array<{
|
|
541
|
+
path: string;
|
|
542
|
+
commits: number;
|
|
543
|
+
capabilities: string[];
|
|
544
|
+
}>;
|
|
545
|
+
orphanedFiles: string[];
|
|
546
|
+
coherenceScore: number | null;
|
|
547
|
+
topRisks: Array<{
|
|
548
|
+
capabilityId: string;
|
|
549
|
+
name: string;
|
|
550
|
+
reason: string;
|
|
551
|
+
}>;
|
|
552
|
+
architecturalPatterns: string[];
|
|
553
|
+
}
|
|
554
|
+
interface GenerateADROpts {
|
|
555
|
+
blueprint: BlueprintData;
|
|
556
|
+
amberContext?: AmberLayerContext;
|
|
557
|
+
adrContext?: AdrContext;
|
|
558
|
+
focus: "cycles" | "capabilities" | "dependencies" | "overall";
|
|
559
|
+
selectedCycle?: string[];
|
|
560
|
+
selectedCapability?: string;
|
|
561
|
+
projectName: string;
|
|
562
|
+
llm: LlmProvider;
|
|
563
|
+
}
|
|
564
|
+
interface ADRDocument {
|
|
565
|
+
id: string;
|
|
566
|
+
title: string;
|
|
567
|
+
date: string;
|
|
568
|
+
status: "Proposed" | "Accepted" | "Deprecated" | "Superseded";
|
|
569
|
+
context: string;
|
|
570
|
+
decision: string;
|
|
571
|
+
consequences: {
|
|
572
|
+
positive: string[];
|
|
573
|
+
negative: string[];
|
|
574
|
+
neutral: string[];
|
|
575
|
+
};
|
|
576
|
+
alternatives: string[];
|
|
577
|
+
relatedCapabilities: string[];
|
|
578
|
+
relatedFiles: string[];
|
|
579
|
+
}
|
|
580
|
+
interface ADROutput {
|
|
581
|
+
adrs: ADRDocument[];
|
|
582
|
+
summary: string;
|
|
583
|
+
technicalDebt: string;
|
|
584
|
+
}
|
|
585
|
+
declare function generateADR(opts: GenerateADROpts): Promise<ADROutput>;
|
|
586
|
+
|
|
587
|
+
interface GitRangeContext {
|
|
588
|
+
commits: Array<{
|
|
589
|
+
hash: string;
|
|
590
|
+
subject: string;
|
|
591
|
+
author?: string;
|
|
592
|
+
date?: string;
|
|
593
|
+
files?: string[];
|
|
594
|
+
}>;
|
|
595
|
+
fromRef: string;
|
|
596
|
+
toRef: string;
|
|
597
|
+
filesChanged: number;
|
|
598
|
+
}
|
|
599
|
+
interface GenerateSprintRetroOpts {
|
|
600
|
+
gitContext?: GitRangeContext;
|
|
601
|
+
amberContext?: AmberLayerContext;
|
|
602
|
+
greenContext?: GreenLayerContext;
|
|
603
|
+
scoreBefore?: number;
|
|
604
|
+
scoreAfter?: number;
|
|
605
|
+
sprintName?: string;
|
|
606
|
+
teamSize?: number;
|
|
607
|
+
projectName: string;
|
|
608
|
+
tone: "professional" | "casual" | "team-friendly";
|
|
609
|
+
llm: LlmProvider;
|
|
610
|
+
}
|
|
611
|
+
interface SprintRetroOutput {
|
|
612
|
+
sprintName: string;
|
|
613
|
+
period: string;
|
|
614
|
+
summary: string;
|
|
615
|
+
delivered: Array<{
|
|
616
|
+
item: string;
|
|
617
|
+
capability?: string;
|
|
618
|
+
type: "feature" | "fix" | "refactor" | "chore";
|
|
619
|
+
}>;
|
|
620
|
+
healthDelta: {
|
|
621
|
+
scoreBefore: number | null;
|
|
622
|
+
scoreAfter: number | null;
|
|
623
|
+
delta: number | null;
|
|
624
|
+
verdict: "improved" | "stable" | "degraded";
|
|
625
|
+
degradedCapabilities: string[];
|
|
626
|
+
};
|
|
627
|
+
wentWell: string[];
|
|
628
|
+
improvements: string[];
|
|
629
|
+
puzzles: string[];
|
|
630
|
+
actions: string[];
|
|
631
|
+
debtIncurred: string[];
|
|
632
|
+
slideTitle: string;
|
|
633
|
+
slidePoints: string[];
|
|
634
|
+
}
|
|
635
|
+
declare function generateSprintRetro(opts: GenerateSprintRetroOpts): Promise<SprintRetroOutput>;
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* WeeklyDigestContext — shared type for the 7-day engineering digest.
|
|
639
|
+
*
|
|
640
|
+
* Produced by PRISM's /api/green/weekly-digest route and consumed by the
|
|
641
|
+
* generateNewsletter generator. Kept here as a pure type module so that
|
|
642
|
+
* both the generator and the dashboard API route can import it without
|
|
643
|
+
* a circular dependency.
|
|
644
|
+
*/
|
|
645
|
+
interface WeeklyDigestContext {
|
|
646
|
+
/** Human-readable period, e.g. "May 13–20, 2026" */
|
|
647
|
+
period: string;
|
|
648
|
+
/** Total commits in the window */
|
|
649
|
+
commitCount: number;
|
|
650
|
+
/** Total files touched (from git diff) */
|
|
651
|
+
filesChanged: number;
|
|
652
|
+
/** Coherence score at the start of the window */
|
|
653
|
+
scoreStart: number | null;
|
|
654
|
+
/** Coherence score at the end of the window */
|
|
655
|
+
scoreEnd: number | null;
|
|
656
|
+
/** scoreEnd - scoreStart (null if either is missing) */
|
|
657
|
+
scoreDelta: number | null;
|
|
658
|
+
/** Architecture grade letter, e.g. "A", "B+" */
|
|
659
|
+
grade: string | null;
|
|
660
|
+
/** Capabilities that newly drifted (doc hash mismatch) */
|
|
661
|
+
newDrifts: string[];
|
|
662
|
+
/** Capabilities where drift was resolved */
|
|
663
|
+
resolvedDrifts: string[];
|
|
664
|
+
/** New critical-severity risks from GREEN predictions */
|
|
665
|
+
newRisks: string[];
|
|
666
|
+
/** Top 5 commit subjects (non-technical filter applied) */
|
|
667
|
+
topCommits: string[];
|
|
668
|
+
/** Short human-readable health summary sentence */
|
|
669
|
+
healthSummary: string;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
interface GenerateNewsletterOpts {
|
|
673
|
+
digestContext: WeeklyDigestContext;
|
|
674
|
+
amberContext?: AmberLayerContext;
|
|
675
|
+
targetAudience: "product-team" | "management" | "stakeholders" | "all-hands";
|
|
676
|
+
tone: "professional" | "casual" | "accessible";
|
|
677
|
+
includeMetrics: boolean;
|
|
678
|
+
projectName: string;
|
|
679
|
+
teamName?: string;
|
|
680
|
+
llm: LlmProvider;
|
|
681
|
+
}
|
|
682
|
+
interface NewsletterSection {
|
|
683
|
+
heading: string;
|
|
684
|
+
body: string;
|
|
685
|
+
type: "highlight" | "metrics" | "risk" | "shoutout" | "upcoming";
|
|
686
|
+
}
|
|
687
|
+
interface NewsletterMetric {
|
|
688
|
+
label: string;
|
|
689
|
+
value: string;
|
|
690
|
+
trend: "up" | "down" | "stable";
|
|
691
|
+
}
|
|
692
|
+
interface NewsletterOutput {
|
|
693
|
+
subject: string;
|
|
694
|
+
preview: string;
|
|
695
|
+
greeting: string;
|
|
696
|
+
headline: string;
|
|
697
|
+
sections: NewsletterSection[];
|
|
698
|
+
metrics: NewsletterMetric[];
|
|
699
|
+
closing: string;
|
|
700
|
+
unsubscribeNote: string;
|
|
701
|
+
slackVersion: string;
|
|
702
|
+
teamsVersion: string;
|
|
703
|
+
htmlVersion: string;
|
|
704
|
+
}
|
|
705
|
+
declare function generateNewsletter(opts: GenerateNewsletterOpts): Promise<NewsletterOutput>;
|
|
706
|
+
|
|
707
|
+
interface RadioOptions {
|
|
708
|
+
digestContext: WeeklyDigestContext;
|
|
709
|
+
amberContext?: AmberLayerContext;
|
|
710
|
+
audience: "technical" | "executive";
|
|
711
|
+
projectName: string;
|
|
712
|
+
llm: LlmProvider;
|
|
713
|
+
}
|
|
714
|
+
interface RadioResult {
|
|
715
|
+
headline: string;
|
|
716
|
+
slackVersion: string;
|
|
717
|
+
emailVersion: string;
|
|
718
|
+
twitterVersion: string;
|
|
719
|
+
}
|
|
720
|
+
declare function generateRadio(options: RadioOptions): Promise<RadioResult>;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* arc42 Documentation Generator
|
|
724
|
+
*
|
|
725
|
+
* Generates complete arc42 architecture documentation.
|
|
726
|
+
*
|
|
727
|
+
* arc42 is published under Creative Commons Attribution 4.0 International.
|
|
728
|
+
* Required attribution: arc42 template © arc42.org, CC-BY 4.0
|
|
729
|
+
* See: https://arc42.org/license
|
|
730
|
+
*
|
|
731
|
+
* This module generates content for all 12 arc42 sections using a mix of:
|
|
732
|
+
* - PRISM data (no LLM needed) → sections 5, 9, 10, 11, 12
|
|
733
|
+
* - LLM generation → sections 1, 3, 4, 8
|
|
734
|
+
* - Template with placeholders → sections 2, 6, 7
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
interface Arc42Options {
|
|
738
|
+
digestContext: WeeklyDigestContext;
|
|
739
|
+
amberContext?: AmberLayerContext;
|
|
740
|
+
projectName: string;
|
|
741
|
+
projectDescription?: string;
|
|
742
|
+
teamSize?: number;
|
|
743
|
+
techStack?: string[];
|
|
744
|
+
llm: LlmProvider;
|
|
745
|
+
}
|
|
746
|
+
interface Arc42Section {
|
|
747
|
+
number: number;
|
|
748
|
+
title: string;
|
|
749
|
+
content: string;
|
|
750
|
+
dataSource: "prism" | "llm" | "template";
|
|
751
|
+
}
|
|
752
|
+
interface Arc42Document {
|
|
753
|
+
sections: Arc42Section[];
|
|
754
|
+
fullMarkdown: string;
|
|
755
|
+
attribution: string;
|
|
756
|
+
generatedAt: string;
|
|
757
|
+
}
|
|
758
|
+
declare function generateArc42(opts: Arc42Options): Promise<Arc42Document>;
|
|
759
|
+
|
|
760
|
+
interface KnowledgeCaptureOptions {
|
|
761
|
+
departingDeveloper?: string;
|
|
762
|
+
focusCapabilities?: string[];
|
|
763
|
+
digestContext: WeeklyDigestContext;
|
|
764
|
+
amberContext?: AmberLayerContext;
|
|
765
|
+
projectName: string;
|
|
766
|
+
llm: LlmProvider;
|
|
767
|
+
}
|
|
768
|
+
interface KnowledgeCaptureSection {
|
|
769
|
+
title: string;
|
|
770
|
+
content: string;
|
|
771
|
+
}
|
|
772
|
+
interface KnowledgeCaptureResult {
|
|
773
|
+
markdownDoc: string;
|
|
774
|
+
sections: KnowledgeCaptureSection[];
|
|
775
|
+
criticalKnowledge: string[];
|
|
776
|
+
onboardingChecklist: string[];
|
|
777
|
+
}
|
|
778
|
+
declare function generateKnowledgeCapture(options: KnowledgeCaptureOptions): Promise<KnowledgeCaptureResult>;
|
|
779
|
+
|
|
780
|
+
type WidgetKind = "stat-card" | "feature-grid" | "testimonial" | "cta-banner" | "metric-badge" | "pricing-tier" | "changelog-row" | "social-proof" | "animated-stat" | "release-card" | "chart-bars" | "architecture-badge";
|
|
781
|
+
type WidgetSlotType = "text" | "number" | "color" | "url" | "image-url" | "multiline" | "select";
|
|
782
|
+
/** "html" = embeddable fragment (no CDN scripts).
|
|
783
|
+
* "standalone" = full <!DOCTYPE html> document with Tailwind + Anime.js + Chart.js + Lucide CDN.
|
|
784
|
+
* "markdown" = plain text/markdown.
|
|
785
|
+
* "react" = standalone TSX component string.
|
|
786
|
+
*/
|
|
787
|
+
type WidgetExportFormat = "html" | "standalone" | "markdown" | "react";
|
|
788
|
+
interface WidgetSlotDef {
|
|
789
|
+
id: string;
|
|
790
|
+
label: string;
|
|
791
|
+
type: WidgetSlotType;
|
|
792
|
+
default?: string | number;
|
|
793
|
+
required?: boolean;
|
|
794
|
+
placeholder?: string;
|
|
795
|
+
options?: string[];
|
|
796
|
+
}
|
|
797
|
+
interface WidgetTemplate {
|
|
798
|
+
id: WidgetKind;
|
|
799
|
+
name: string;
|
|
800
|
+
description: string;
|
|
801
|
+
slots: WidgetSlotDef[];
|
|
802
|
+
exportFormats: WidgetExportFormat[];
|
|
803
|
+
free_tier: boolean;
|
|
804
|
+
/** Widget plays JS animations in standalone mode */
|
|
805
|
+
animated?: boolean;
|
|
806
|
+
/** Total animation settle time in ms (for video capture timing) */
|
|
807
|
+
animDurationMs?: number;
|
|
808
|
+
/** Recommended total video duration in ms (anim + hold) */
|
|
809
|
+
videoDurationMs?: number;
|
|
810
|
+
/** Recommended render viewport width in px */
|
|
811
|
+
defaultWidth?: number;
|
|
812
|
+
/** Recommended render viewport height in px */
|
|
813
|
+
defaultHeight?: number;
|
|
814
|
+
}
|
|
815
|
+
interface WidgetInstanceSnapshot {
|
|
816
|
+
version: number;
|
|
817
|
+
saved_at: string;
|
|
818
|
+
slots: Record<string, string | number>;
|
|
819
|
+
style_id?: string;
|
|
820
|
+
}
|
|
821
|
+
interface WidgetInstance {
|
|
822
|
+
id: string;
|
|
823
|
+
template_id: WidgetKind;
|
|
824
|
+
name: string;
|
|
825
|
+
slots: Record<string, string | number>;
|
|
826
|
+
brand_kit_id?: string;
|
|
827
|
+
style_id?: string;
|
|
828
|
+
version: number;
|
|
829
|
+
versions: WidgetInstanceSnapshot[];
|
|
830
|
+
created_at: string;
|
|
831
|
+
updated_at: string;
|
|
832
|
+
}
|
|
833
|
+
declare function getSlotValue(slots: Record<string, string | number>, template: WidgetTemplate, slotId: string): string;
|
|
834
|
+
|
|
835
|
+
interface StyleTokens {
|
|
836
|
+
radius: {
|
|
837
|
+
sm: string;
|
|
838
|
+
md: string;
|
|
839
|
+
lg: string;
|
|
840
|
+
full: string;
|
|
841
|
+
};
|
|
842
|
+
shadow: {
|
|
843
|
+
sm: string;
|
|
844
|
+
md: string;
|
|
845
|
+
lg: string;
|
|
846
|
+
};
|
|
847
|
+
spacing: {
|
|
848
|
+
xs: string;
|
|
849
|
+
sm: string;
|
|
850
|
+
md: string;
|
|
851
|
+
lg: string;
|
|
852
|
+
xl: string;
|
|
853
|
+
};
|
|
854
|
+
borderWidth: string;
|
|
855
|
+
borderStyle: "solid" | "dashed" | "none";
|
|
856
|
+
animation: {
|
|
857
|
+
entry: "fade" | "slide" | "scale" | "none";
|
|
858
|
+
durationMs: number;
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
interface WidgetStyleSnapshot {
|
|
862
|
+
version: number;
|
|
863
|
+
saved_at: string;
|
|
864
|
+
tokens: StyleTokens;
|
|
865
|
+
}
|
|
866
|
+
interface WidgetStyle {
|
|
867
|
+
id: string;
|
|
868
|
+
name: string;
|
|
869
|
+
preset: boolean;
|
|
870
|
+
tokens: StyleTokens;
|
|
871
|
+
customCss?: string;
|
|
872
|
+
templateOverrides?: Record<string, {
|
|
873
|
+
html?: string;
|
|
874
|
+
jsx?: string;
|
|
875
|
+
}>;
|
|
876
|
+
version: number;
|
|
877
|
+
versions: WidgetStyleSnapshot[];
|
|
878
|
+
created_at: string;
|
|
879
|
+
updated_at: string;
|
|
880
|
+
}
|
|
881
|
+
declare const STYLE_PRESET_DEFAULT: WidgetStyle;
|
|
882
|
+
declare const STYLE_PRESET_MINIMAL: WidgetStyle;
|
|
883
|
+
declare const STYLE_PRESET_GLASSY: WidgetStyle;
|
|
884
|
+
declare const STYLE_PRESET_BRUTALIST: WidgetStyle;
|
|
885
|
+
declare const BUNDLED_STYLE_PRESETS: WidgetStyle[];
|
|
886
|
+
declare function getStyleById(id: string): WidgetStyle;
|
|
887
|
+
declare function parseStyleFromTokensJson(json: unknown): Partial<StyleTokens>;
|
|
888
|
+
declare function parseStyleFromTailwindConfig(jsSource: string): Partial<StyleTokens>;
|
|
889
|
+
declare function parseStyleFromCss(css: string): {
|
|
890
|
+
tokens: Partial<StyleTokens>;
|
|
891
|
+
customCss: string;
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
type ChannelKind = "tweet" | "linkedin" | "blog" | "newsletter" | "hn" | "instagram" | "reddit" | "email" | "slack";
|
|
895
|
+
interface DispatchChannel {
|
|
896
|
+
id: string;
|
|
897
|
+
name: string;
|
|
898
|
+
kind: ChannelKind;
|
|
899
|
+
/** Hard character cap — orchestrateDispatch truncates to this. */
|
|
900
|
+
maxLength: number;
|
|
901
|
+
/** Injected into the channel-specific system prompt. */
|
|
902
|
+
promptHints: string;
|
|
903
|
+
}
|
|
904
|
+
declare const DISPATCH_CHANNEL_TWEET: DispatchChannel;
|
|
905
|
+
declare const DISPATCH_CHANNEL_LINKEDIN: DispatchChannel;
|
|
906
|
+
declare const DISPATCH_CHANNEL_BLOG: DispatchChannel;
|
|
907
|
+
declare const DISPATCH_CHANNEL_NEWSLETTER: DispatchChannel;
|
|
908
|
+
declare const DISPATCH_CHANNEL_HN: DispatchChannel;
|
|
909
|
+
declare const DISPATCH_CHANNEL_INSTAGRAM: DispatchChannel;
|
|
910
|
+
declare const DISPATCH_CHANNEL_REDDIT: DispatchChannel;
|
|
911
|
+
declare const DISPATCH_CHANNEL_EMAIL: DispatchChannel;
|
|
912
|
+
declare const DISPATCH_CHANNEL_SLACK: DispatchChannel;
|
|
913
|
+
declare const BUNDLED_DISPATCH_CHANNELS: DispatchChannel[];
|
|
914
|
+
declare function getDispatchChannel(id: string): DispatchChannel | undefined;
|
|
915
|
+
|
|
916
|
+
interface ChannelOutput {
|
|
917
|
+
channel_id: string;
|
|
918
|
+
channel_name: string;
|
|
919
|
+
kind: string;
|
|
920
|
+
content: string;
|
|
921
|
+
char_count: number;
|
|
922
|
+
truncated: boolean;
|
|
923
|
+
generated_at: string;
|
|
924
|
+
error?: string;
|
|
925
|
+
}
|
|
926
|
+
interface DispatchRun {
|
|
927
|
+
id: string;
|
|
928
|
+
ask: string;
|
|
929
|
+
audience_label?: string;
|
|
930
|
+
brand_name?: string;
|
|
931
|
+
blueprint_grounded: boolean;
|
|
932
|
+
outputs: ChannelOutput[];
|
|
933
|
+
created_at: string;
|
|
934
|
+
}
|
|
935
|
+
interface DispatchBrandContext {
|
|
936
|
+
name: string;
|
|
937
|
+
voice: {
|
|
938
|
+
tone: string;
|
|
939
|
+
formality: number;
|
|
940
|
+
vocabulary?: string[];
|
|
941
|
+
avoid?: string[];
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
interface DispatchAudienceContext {
|
|
945
|
+
label: string;
|
|
946
|
+
tonality: string;
|
|
947
|
+
reading_level: string;
|
|
948
|
+
}
|
|
949
|
+
interface OrchestrationInput {
|
|
950
|
+
ask: string;
|
|
951
|
+
channels: DispatchChannel[];
|
|
952
|
+
audience?: DispatchAudienceContext;
|
|
953
|
+
brand?: DispatchBrandContext;
|
|
954
|
+
blueprintContext?: string;
|
|
955
|
+
toneOverrides?: Record<string, number>;
|
|
956
|
+
}
|
|
957
|
+
interface TokenUsage {
|
|
958
|
+
total_input: number;
|
|
959
|
+
total_output: number;
|
|
960
|
+
channel_count: number;
|
|
961
|
+
}
|
|
962
|
+
interface OrchestrationResult {
|
|
963
|
+
outputs: ChannelOutput[];
|
|
964
|
+
usage: TokenUsage;
|
|
965
|
+
}
|
|
966
|
+
declare function orchestrateDispatch(input: OrchestrationInput, provider: LlmProvider): Promise<OrchestrationResult>;
|
|
967
|
+
|
|
968
|
+
interface AssetVersion {
|
|
969
|
+
id: string;
|
|
970
|
+
assetId: string;
|
|
971
|
+
versionNumber: number;
|
|
972
|
+
content: string;
|
|
973
|
+
message: string;
|
|
974
|
+
createdAt: string;
|
|
975
|
+
usedTokens?: number;
|
|
976
|
+
brandKitId?: string;
|
|
977
|
+
styleId?: string;
|
|
978
|
+
blueprintFocus?: string;
|
|
979
|
+
fromPrism?: boolean;
|
|
980
|
+
revertedFrom?: number;
|
|
981
|
+
}
|
|
982
|
+
interface DiffEntry {
|
|
983
|
+
type: "unchanged" | "added" | "removed";
|
|
984
|
+
line: string;
|
|
985
|
+
lineNo?: number;
|
|
986
|
+
}
|
|
987
|
+
interface DiffResult {
|
|
988
|
+
entries: DiffEntry[];
|
|
989
|
+
addedCount: number;
|
|
990
|
+
removedCount: number;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Deterministic line-level diff using a simple LCS approach.
|
|
994
|
+
* Returns DiffEntry[] suitable for a two-column diff display.
|
|
995
|
+
*/
|
|
996
|
+
declare function computeDiff(contentA: string, contentB: string): DiffResult;
|
|
997
|
+
declare function buildVersion(assetId: string, versionNumber: number, content: string, message: string, meta?: Partial<Omit<AssetVersion, "id" | "assetId" | "versionNumber" | "content" | "message" | "createdAt">>): AssetVersion;
|
|
998
|
+
declare function buildRevertVersion(assetId: string, versionNumber: number, source: AssetVersion): AssetVersion;
|
|
999
|
+
declare function nextVersionNumber(versions: AssetVersion[]): number;
|
|
1000
|
+
|
|
1001
|
+
type ScheduledStatus = "draft" | "queued" | "exported" | "cancelled";
|
|
1002
|
+
interface ScheduledEntryMetadata {
|
|
1003
|
+
exportedTo?: "buffer" | "hypefury" | "icalendar";
|
|
1004
|
+
exportedAt?: string;
|
|
1005
|
+
exportRef?: string;
|
|
1006
|
+
dispatchRunId?: string;
|
|
1007
|
+
brandKitId?: string;
|
|
1008
|
+
assetType?: string;
|
|
1009
|
+
}
|
|
1010
|
+
interface ScheduledEntry {
|
|
1011
|
+
id: string;
|
|
1012
|
+
assetId: string;
|
|
1013
|
+
channelId: string;
|
|
1014
|
+
scheduledFor: string;
|
|
1015
|
+
status: ScheduledStatus;
|
|
1016
|
+
contentPreview: string;
|
|
1017
|
+
metadata: ScheduledEntryMetadata;
|
|
1018
|
+
createdAt: string;
|
|
1019
|
+
updatedAt: string;
|
|
1020
|
+
}
|
|
1021
|
+
interface ScheduleRange {
|
|
1022
|
+
from: string;
|
|
1023
|
+
to: string;
|
|
1024
|
+
}
|
|
1025
|
+
declare function buildScheduledEntry(assetId: string, channelId: string, scheduledFor: string, contentPreview: string, metadata?: ScheduledEntryMetadata): ScheduledEntry;
|
|
1026
|
+
declare function applyEntryPatch(entry: ScheduledEntry, patch: Partial<Pick<ScheduledEntry, "scheduledFor" | "status" | "channelId" | "contentPreview" | "metadata">>): ScheduledEntry;
|
|
1027
|
+
declare function entryInRange(entry: ScheduledEntry, range: ScheduleRange): boolean;
|
|
1028
|
+
declare function next7DaysRange(): ScheduleRange;
|
|
1029
|
+
/** Cascading cadence for "Schedule all dispatch outputs". */
|
|
1030
|
+
declare function cascadingScheduledFor(channelIds: string[], startFrom?: Date): Record<string, string>;
|
|
1031
|
+
|
|
1032
|
+
interface ListOutputsOpts {
|
|
1033
|
+
signalId?: string;
|
|
1034
|
+
templateId?: string;
|
|
1035
|
+
limit?: number;
|
|
1036
|
+
}
|
|
1037
|
+
interface ForgeStorage {
|
|
1038
|
+
getSignal(id: string): Promise<ForgeSignal | null>;
|
|
1039
|
+
getTemplate(id: string): Promise<ForgeTemplate | null>;
|
|
1040
|
+
getAudience(id: string): Promise<ForgeAudience | null>;
|
|
1041
|
+
listTemplates(): Promise<ForgeTemplate[]>;
|
|
1042
|
+
listAudiences(): Promise<ForgeAudience[]>;
|
|
1043
|
+
listOutputs(opts?: ListOutputsOpts): Promise<ForgeOutput[]>;
|
|
1044
|
+
saveSignal(signal: Omit<ForgeSignal, "id" | "created_at">): Promise<ForgeSignal>;
|
|
1045
|
+
saveTemplate(template: Omit<ForgeTemplate, "created_at">): Promise<ForgeTemplate>;
|
|
1046
|
+
saveAudience(audience: ForgeAudience): Promise<ForgeAudience>;
|
|
1047
|
+
saveOutput(output: Omit<ForgeOutput, "id" | "created_at">): Promise<ForgeOutput>;
|
|
1048
|
+
saveAsset(asset: Omit<ForgeAsset, "id" | "created_at">): Promise<ForgeAsset>;
|
|
1049
|
+
deleteTemplate(id: string): Promise<void>;
|
|
1050
|
+
deleteAudience(id: string): Promise<void>;
|
|
1051
|
+
deleteOutput(id: string): Promise<void>;
|
|
1052
|
+
saveBrandKit(kit: Omit<BrandKit, "id" | "created_at" | "updated_at"> & {
|
|
1053
|
+
id?: string;
|
|
1054
|
+
}): Promise<BrandKit>;
|
|
1055
|
+
getBrandKit(id: string): Promise<BrandKit | null>;
|
|
1056
|
+
listBrandKits(): Promise<BrandKit[]>;
|
|
1057
|
+
deleteBrandKit(id: string): Promise<void>;
|
|
1058
|
+
saveWidget(widget: Omit<WidgetInstance, "id" | "created_at" | "updated_at"> & {
|
|
1059
|
+
id?: string;
|
|
1060
|
+
}): Promise<WidgetInstance>;
|
|
1061
|
+
getWidget(id: string): Promise<WidgetInstance | null>;
|
|
1062
|
+
listWidgets(templateId?: string): Promise<WidgetInstance[]>;
|
|
1063
|
+
deleteWidget(id: string): Promise<void>;
|
|
1064
|
+
saveStyle(style: Omit<WidgetStyle, "id" | "created_at" | "updated_at"> & {
|
|
1065
|
+
id?: string;
|
|
1066
|
+
}): Promise<WidgetStyle>;
|
|
1067
|
+
getStyle(id: string): Promise<WidgetStyle | null>;
|
|
1068
|
+
listStyles(): Promise<WidgetStyle[]>;
|
|
1069
|
+
deleteStyle(id: string): Promise<void>;
|
|
1070
|
+
saveDispatch(run: Omit<DispatchRun, "id" | "created_at"> & {
|
|
1071
|
+
id?: string;
|
|
1072
|
+
}): Promise<DispatchRun>;
|
|
1073
|
+
getDispatch(id: string): Promise<DispatchRun | null>;
|
|
1074
|
+
listDispatches(limit?: number): Promise<DispatchRun[]>;
|
|
1075
|
+
deleteDispatch(id: string): Promise<void>;
|
|
1076
|
+
saveAssetVersion(assetId: string, version: AssetVersion): Promise<AssetVersion>;
|
|
1077
|
+
listAssetVersions(assetId: string): Promise<AssetVersion[]>;
|
|
1078
|
+
revertAsset(assetId: string, versionId: string): Promise<AssetVersion>;
|
|
1079
|
+
saveScheduledEntry(entry: ScheduledEntry): Promise<ScheduledEntry>;
|
|
1080
|
+
listScheduledEntries(range?: ScheduleRange): Promise<ScheduledEntry[]>;
|
|
1081
|
+
updateScheduledEntry(id: string, patch: Partial<Pick<ScheduledEntry, "scheduledFor" | "status" | "channelId" | "contentPreview" | "metadata">>): Promise<ScheduledEntry>;
|
|
1082
|
+
deleteScheduledEntry(id: string): Promise<void>;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
interface ProductTruthClaim {
|
|
1086
|
+
id: string;
|
|
1087
|
+
statement: string;
|
|
1088
|
+
source_ref: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface ProductTruth {
|
|
1091
|
+
signal_id: string;
|
|
1092
|
+
audience_id: string;
|
|
1093
|
+
audience_label: string;
|
|
1094
|
+
tonality: string;
|
|
1095
|
+
reading_level: string;
|
|
1096
|
+
claims: ProductTruthClaim[];
|
|
1097
|
+
raw_source_refs: Record<string, unknown>;
|
|
1098
|
+
}
|
|
1099
|
+
declare function distill(input: {
|
|
1100
|
+
signal: ForgeSignal;
|
|
1101
|
+
audience: ForgeAudience;
|
|
1102
|
+
}): ProductTruth;
|
|
1103
|
+
|
|
1104
|
+
interface ResolvedTuple {
|
|
1105
|
+
channel: Channel;
|
|
1106
|
+
audience_id: string;
|
|
1107
|
+
intent: Intent;
|
|
1108
|
+
format: Format;
|
|
1109
|
+
modality: Modality;
|
|
1110
|
+
}
|
|
1111
|
+
interface ForgePrompt {
|
|
1112
|
+
system: string;
|
|
1113
|
+
user: string;
|
|
1114
|
+
schema_name: string;
|
|
1115
|
+
schema: unknown;
|
|
1116
|
+
}
|
|
1117
|
+
declare function assembleForgePrompt(input: {
|
|
1118
|
+
template: ForgeTemplate;
|
|
1119
|
+
audience: ForgeAudience;
|
|
1120
|
+
productTruth: ProductTruth;
|
|
1121
|
+
resolved: ResolvedTuple;
|
|
1122
|
+
contextBlocks?: string[];
|
|
1123
|
+
}): ForgePrompt;
|
|
1124
|
+
|
|
1125
|
+
interface ValidationOk<T> {
|
|
1126
|
+
ok: true;
|
|
1127
|
+
value: T;
|
|
1128
|
+
}
|
|
1129
|
+
interface ValidationErr {
|
|
1130
|
+
ok: false;
|
|
1131
|
+
errors: string[];
|
|
1132
|
+
unsupported?: string[];
|
|
1133
|
+
}
|
|
1134
|
+
type ValidationResult<T = Record<string, unknown>> = ValidationOk<T> | ValidationErr;
|
|
1135
|
+
declare function validateAgainstTemplateSchema(schema: unknown, candidate: unknown): ValidationResult;
|
|
1136
|
+
declare function tryParseJsonObject(raw: string): unknown;
|
|
1137
|
+
|
|
1138
|
+
interface SchemaDefinitionOk {
|
|
1139
|
+
valid: true;
|
|
1140
|
+
}
|
|
1141
|
+
interface SchemaDefinitionErr {
|
|
1142
|
+
valid: false;
|
|
1143
|
+
errors: string[];
|
|
1144
|
+
}
|
|
1145
|
+
type SchemaDefinitionResult = SchemaDefinitionOk | SchemaDefinitionErr;
|
|
1146
|
+
declare function validateSchemaDefinition(input: unknown): SchemaDefinitionResult;
|
|
1147
|
+
declare function parseAndValidateSchemaDefinition(jsonText: string): {
|
|
1148
|
+
valid: true;
|
|
1149
|
+
parsed: Record<string, unknown>;
|
|
1150
|
+
} | {
|
|
1151
|
+
valid: false;
|
|
1152
|
+
errors: string[];
|
|
1153
|
+
};
|
|
1154
|
+
|
|
1155
|
+
interface AssetSlotsValidationOk {
|
|
1156
|
+
valid: true;
|
|
1157
|
+
}
|
|
1158
|
+
interface AssetSlotsValidationErr {
|
|
1159
|
+
valid: false;
|
|
1160
|
+
errors: string[];
|
|
1161
|
+
}
|
|
1162
|
+
type AssetSlotsValidationResult = AssetSlotsValidationOk | AssetSlotsValidationErr;
|
|
1163
|
+
declare function validateAssetSlots(input: unknown): AssetSlotsValidationResult;
|
|
1164
|
+
|
|
1165
|
+
declare function templateAnimatedDefault(assetSlots: unknown): boolean;
|
|
1166
|
+
declare function resolveAnimatedChoice(templateDefault: boolean, override: boolean | undefined): boolean;
|
|
1167
|
+
|
|
1168
|
+
declare const DEFAULT_ANIMATION_DURATION_SECONDS = 10;
|
|
1169
|
+
declare const ANIMATION_DURATION_PRESETS: readonly [5, 10, 20, 30];
|
|
1170
|
+
declare const MIN_ANIMATION_DURATION_SECONDS = 1;
|
|
1171
|
+
declare const MAX_ANIMATION_DURATION_SECONDS = 120;
|
|
1172
|
+
declare function clampAnimationDuration(seconds: number): number;
|
|
1173
|
+
declare function resolveAnimationDuration(override: number | undefined, persisted: number | undefined, fallback?: number): number;
|
|
1174
|
+
|
|
1175
|
+
declare const REFINE_SESSION_SOFT_CAP = 100;
|
|
1176
|
+
declare const REFINE_COUNTDOWN_THRESHOLD = 90;
|
|
1177
|
+
interface RefineLimitState {
|
|
1178
|
+
used: number;
|
|
1179
|
+
capped: boolean;
|
|
1180
|
+
remaining: number;
|
|
1181
|
+
showCountdown: boolean;
|
|
1182
|
+
}
|
|
1183
|
+
declare function refineLimitState(usedRefines: number, softCap?: number): RefineLimitState;
|
|
1184
|
+
|
|
1185
|
+
interface BrandPalette {
|
|
1186
|
+
primary: string;
|
|
1187
|
+
accent: string;
|
|
1188
|
+
background: string;
|
|
1189
|
+
card: string;
|
|
1190
|
+
text: string;
|
|
1191
|
+
}
|
|
1192
|
+
interface ForgeThemeEntry {
|
|
1193
|
+
id?: string;
|
|
1194
|
+
label?: string;
|
|
1195
|
+
primary?: string;
|
|
1196
|
+
accent?: string;
|
|
1197
|
+
bg?: string;
|
|
1198
|
+
card?: string;
|
|
1199
|
+
text?: string;
|
|
1200
|
+
[key: string]: unknown;
|
|
1201
|
+
}
|
|
1202
|
+
declare function themeEntryToPalette(entry: ForgeThemeEntry | null | undefined): BrandPalette | null;
|
|
1203
|
+
declare function parseThemeConfigContent(content: unknown): ForgeThemeEntry[];
|
|
1204
|
+
declare const FORGE_BRAND_THEME_ID = "__forge_brand__";
|
|
1205
|
+
declare const BRAND_CONTENT_SLOT_KEYS: {
|
|
1206
|
+
readonly primary: "content-primary";
|
|
1207
|
+
readonly accent: "content-accent";
|
|
1208
|
+
readonly bg: "content-bg";
|
|
1209
|
+
readonly card: "content-card";
|
|
1210
|
+
readonly text: "content-text";
|
|
1211
|
+
};
|
|
1212
|
+
interface BrandThemeConfig {
|
|
1213
|
+
id?: string;
|
|
1214
|
+
name?: string;
|
|
1215
|
+
values?: Record<string, string>;
|
|
1216
|
+
[key: string]: unknown;
|
|
1217
|
+
}
|
|
1218
|
+
declare function parseBrandThemeContent(content: unknown): BrandThemeConfig[];
|
|
1219
|
+
declare function brandThemeConfigToEntry(config: BrandThemeConfig | null | undefined): ForgeThemeEntry | null;
|
|
1220
|
+
interface ResolveBrandPaletteInput {
|
|
1221
|
+
scope: ScopeKind;
|
|
1222
|
+
themes: ForgeThemeEntry[];
|
|
1223
|
+
selectedThemeId?: string | null;
|
|
1224
|
+
frameworkDefault: BrandPalette | null;
|
|
1225
|
+
appDefault: BrandPalette | null;
|
|
1226
|
+
}
|
|
1227
|
+
declare function resolveBrandPalette(input: ResolveBrandPaletteInput): BrandPalette | null;
|
|
1228
|
+
|
|
1229
|
+
interface BaseField {
|
|
1230
|
+
name: string;
|
|
1231
|
+
label: string;
|
|
1232
|
+
required: boolean;
|
|
1233
|
+
description?: string;
|
|
1234
|
+
}
|
|
1235
|
+
interface StringField extends BaseField {
|
|
1236
|
+
kind: "string";
|
|
1237
|
+
multiline: boolean;
|
|
1238
|
+
enum?: string[];
|
|
1239
|
+
maxLength?: number;
|
|
1240
|
+
minLength?: number;
|
|
1241
|
+
}
|
|
1242
|
+
interface NumberField extends BaseField {
|
|
1243
|
+
kind: "number";
|
|
1244
|
+
integer: boolean;
|
|
1245
|
+
minimum?: number;
|
|
1246
|
+
maximum?: number;
|
|
1247
|
+
}
|
|
1248
|
+
interface BooleanField extends BaseField {
|
|
1249
|
+
kind: "boolean";
|
|
1250
|
+
}
|
|
1251
|
+
interface ArrayField extends BaseField {
|
|
1252
|
+
kind: "array";
|
|
1253
|
+
itemField: FormField | null;
|
|
1254
|
+
minItems?: number;
|
|
1255
|
+
maxItems?: number;
|
|
1256
|
+
}
|
|
1257
|
+
interface ObjectField extends BaseField {
|
|
1258
|
+
kind: "object";
|
|
1259
|
+
fields: FormField[];
|
|
1260
|
+
}
|
|
1261
|
+
type FormField = StringField | NumberField | BooleanField | ArrayField | ObjectField;
|
|
1262
|
+
interface FormSpecOk {
|
|
1263
|
+
kind: "form";
|
|
1264
|
+
fields: FormField[];
|
|
1265
|
+
}
|
|
1266
|
+
interface FormSpecRaw {
|
|
1267
|
+
kind: "raw";
|
|
1268
|
+
reason: string;
|
|
1269
|
+
}
|
|
1270
|
+
type FormSpec = FormSpecOk | FormSpecRaw;
|
|
1271
|
+
declare function schemaToForm(schema: unknown): FormSpec;
|
|
1272
|
+
declare function defaultValueForField(field: FormField): unknown;
|
|
1273
|
+
declare function initialFormValues(fields: FormField[], source: Record<string, unknown>): Record<string, unknown>;
|
|
1274
|
+
type FormErrors = Record<string, string>;
|
|
1275
|
+
declare function validateFormValues(fields: FormField[], values: Record<string, unknown>): FormErrors;
|
|
1276
|
+
declare const TEMPLATE_SCHEMA_EXAMPLES: Partial<Record<Format, Record<string, unknown>>>;
|
|
1277
|
+
declare const TEMPLATE_SCHEMA_GENERIC: Record<string, unknown>;
|
|
1278
|
+
declare function schemaExampleFor(format: Format): Record<string, unknown>;
|
|
1279
|
+
|
|
1280
|
+
interface ForgeGenerationInput {
|
|
1281
|
+
/** Storage adapter the engine reads/writes through. */
|
|
1282
|
+
storage: ForgeStorage;
|
|
1283
|
+
/** LLM provider that handles the model call. */
|
|
1284
|
+
provider: LlmProvider;
|
|
1285
|
+
/** Signal id to generate from. */
|
|
1286
|
+
signalId: string;
|
|
1287
|
+
/** Template id that shapes the generation. */
|
|
1288
|
+
templateId: string;
|
|
1289
|
+
/** Per-generation tuple overrides — each replaces the template default. */
|
|
1290
|
+
audienceOverride?: string;
|
|
1291
|
+
intentOverride?: Intent;
|
|
1292
|
+
formatOverride?: Format;
|
|
1293
|
+
modalityOverride?: Modality;
|
|
1294
|
+
/** Honest dry-run: assemble + validate inputs, never call the model, never persist. */
|
|
1295
|
+
dryRun?: boolean;
|
|
1296
|
+
/** Max tokens for the LLM call (default: 4096). */
|
|
1297
|
+
maxTokens?: number;
|
|
1298
|
+
}
|
|
1299
|
+
interface ForgeGenerationError {
|
|
1300
|
+
kind: "error";
|
|
1301
|
+
status: number;
|
|
1302
|
+
error: string;
|
|
1303
|
+
field?: string;
|
|
1304
|
+
}
|
|
1305
|
+
interface ForgeGenerationDryRun {
|
|
1306
|
+
kind: "dry_run";
|
|
1307
|
+
payload: {
|
|
1308
|
+
dryRun: true;
|
|
1309
|
+
resolved: ResolvedTuple;
|
|
1310
|
+
product_truth: unknown;
|
|
1311
|
+
prompt: {
|
|
1312
|
+
system: string;
|
|
1313
|
+
user: string;
|
|
1314
|
+
schema_name: string;
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
interface ForgeGenerationGenerated {
|
|
1319
|
+
kind: "generated";
|
|
1320
|
+
status: 200 | 201;
|
|
1321
|
+
payload: {
|
|
1322
|
+
output: unknown;
|
|
1323
|
+
validation: ReturnType<typeof validateAgainstTemplateSchema> | null;
|
|
1324
|
+
failure_reason: string | null;
|
|
1325
|
+
};
|
|
1326
|
+
}
|
|
1327
|
+
type ForgeGenerationResult = ForgeGenerationError | ForgeGenerationDryRun | ForgeGenerationGenerated;
|
|
1328
|
+
declare function runForgeGeneration(input: ForgeGenerationInput): Promise<ForgeGenerationResult>;
|
|
1329
|
+
|
|
1330
|
+
declare const WIDGET_TEMPLATE_STAT_CARD: WidgetTemplate;
|
|
1331
|
+
declare const WIDGET_TEMPLATE_FEATURE_GRID: WidgetTemplate;
|
|
1332
|
+
declare const WIDGET_TEMPLATE_TESTIMONIAL: WidgetTemplate;
|
|
1333
|
+
declare const WIDGET_TEMPLATE_CTA_BANNER: WidgetTemplate;
|
|
1334
|
+
declare const WIDGET_TEMPLATE_METRIC_BADGE: WidgetTemplate;
|
|
1335
|
+
declare const WIDGET_TEMPLATE_PRICING_TIER: WidgetTemplate;
|
|
1336
|
+
declare const WIDGET_TEMPLATE_CHANGELOG_ROW: WidgetTemplate;
|
|
1337
|
+
declare const WIDGET_TEMPLATE_SOCIAL_PROOF: WidgetTemplate;
|
|
1338
|
+
declare const BUNDLED_WIDGET_TEMPLATES: WidgetTemplate[];
|
|
1339
|
+
declare const FREE_TIER_WIDGET_IDS: string[];
|
|
1340
|
+
declare function getWidgetTemplate(id: string): WidgetTemplate | undefined;
|
|
1341
|
+
|
|
1342
|
+
interface RenderWidgetInput {
|
|
1343
|
+
template: WidgetTemplate;
|
|
1344
|
+
slots: Record<string, string | number>;
|
|
1345
|
+
brandKit?: BrandKit | null;
|
|
1346
|
+
style?: WidgetStyle | string | null;
|
|
1347
|
+
format: WidgetExportFormat;
|
|
1348
|
+
}
|
|
1349
|
+
declare function renderWidget(input: RenderWidgetInput): string;
|
|
1350
|
+
|
|
1351
|
+
declare const FORGE_AUDIENCES: ForgeAudience[];
|
|
1352
|
+
|
|
1353
|
+
declare const FORGE_TEMPLATES: ForgeTemplate[];
|
|
1354
|
+
|
|
1355
|
+
interface RefineAssetInput {
|
|
1356
|
+
assetId: string;
|
|
1357
|
+
assetType: string;
|
|
1358
|
+
currentContent: string;
|
|
1359
|
+
userMessage: string;
|
|
1360
|
+
brandName?: string;
|
|
1361
|
+
brandVoice?: string;
|
|
1362
|
+
styleHint?: string;
|
|
1363
|
+
blueprintContext?: string;
|
|
1364
|
+
}
|
|
1365
|
+
interface RefineAssetResult {
|
|
1366
|
+
newContent: string;
|
|
1367
|
+
llmReply: string;
|
|
1368
|
+
usedTokens: number;
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Sends the current asset content + user message to an LLM and returns
|
|
1372
|
+
* the refined content and a brief explanation of changes.
|
|
1373
|
+
*
|
|
1374
|
+
* Applies scanForSecrets() to both the system prompt and the current content
|
|
1375
|
+
* before sending — throws if secrets are detected (defence-in-depth).
|
|
1376
|
+
*/
|
|
1377
|
+
declare function refineAsset(input: RefineAssetInput, provider: LlmProvider): Promise<RefineAssetResult>;
|
|
1378
|
+
declare const REFINE_SUGGESTIONS: readonly ["Make it more concise", "Add more technical detail", "Make the tone more formal", "Make the tone more casual and conversational", "Add a strong opening hook", "Strengthen the call to action", "Break into shorter paragraphs", "Focus more on developer impact"];
|
|
1379
|
+
type RefineSuggestion = (typeof REFINE_SUGGESTIONS)[number];
|
|
1380
|
+
|
|
1381
|
+
declare function exportToBufferCsv(entries: ScheduledEntry[]): string;
|
|
1382
|
+
declare function exportToHypefuryCsv(entries: ScheduledEntry[]): string;
|
|
1383
|
+
declare function exportToICalendar(entries: ScheduledEntry[]): string;
|
|
1384
|
+
type ExportFormat = "buffer" | "hypefury" | "icalendar";
|
|
1385
|
+
declare function previewExport(entries: ScheduledEntry[], format: ExportFormat): string;
|
|
1386
|
+
|
|
1387
|
+
export { type ADRDocument, type ADROutput, ANIMATION_DURATION_PRESETS, type AdrContext, type AmberCapabilityContext, type AmberLayerContext, type Arc42Document, type Arc42Options, type Arc42Section, type ArchitectureWalkthroughOpts, type ArrayField, type AskDrivenAssetFormat, type AskDrivenAssetOpts, type AssetKind, type AssetSlotsValidationErr, type AssetSlotsValidationOk, type AssetSlotsValidationResult, type AssetVersion, type AudienceId, BRAND_CONTENT_SLOT_KEYS, BUNDLED_DISPATCH_CHANNELS, BUNDLED_STYLE_PRESETS, BUNDLED_WIDGET_TEMPLATES, type BlueprintData, type BlueprintEdge, type BlueprintFile, type BooleanField, type BrandKit, type BrandKitFonts, type BrandKitLogo, type BrandKitPalette, type BrandKitSnapshot, type BrandKitVoice, type BrandPalette, type BrandThemeConfig, type ChangesSinceOpts, type Channel, type ChannelKind, type ChannelOutput, type ComplianceCapabilityRecord, type ComplianceContext, type ComplianceDocOutput, type ComplianceFramework, type ComplianceSection, DEFAULT_ANIMATION_DURATION_SECONDS, DEFAULT_BRAND_KIT_FONTS, DEFAULT_BRAND_KIT_PALETTE, DEFAULT_BRAND_KIT_VOICE, DISPATCH_CHANNEL_BLOG, DISPATCH_CHANNEL_EMAIL, DISPATCH_CHANNEL_HN, DISPATCH_CHANNEL_INSTAGRAM, DISPATCH_CHANNEL_LINKEDIN, DISPATCH_CHANNEL_NEWSLETTER, DISPATCH_CHANNEL_REDDIT, DISPATCH_CHANNEL_SLACK, DISPATCH_CHANNEL_TWEET, type DiffEntry, type DiffResult, type DispatchAudienceContext, type DispatchBrandContext, type DispatchChannel, type DispatchRun, type ExportFormat, FORGE_AUDIENCES, FORGE_BRAND_THEME_ID, FORGE_TEMPLATES, FREE_TIER_WIDGET_IDS, type FileEntry, type ForgeAsset, type ForgeAudience, type ForgeGenerationDryRun, type ForgeGenerationError, type ForgeGenerationGenerated, type ForgeGenerationInput, type ForgeGenerationResult, type ForgeOutput, type ForgePrompt, type ForgeScope, type ForgeSignal, type ForgeStorage, type ForgeSubview, type ForgeTemplate, type ForgeThemeEntry, type FormErrors, type FormField, type FormSpec, type FormSpecOk, type FormSpecRaw, type Format, type GenerateADROpts, type GenerateComplianceDocOpts, type GenerateNewsletterOpts, type GeneratePresentationOpts, type GenerateSprintRetroOpts, type GenerationResult, type GitRangeContext, type GreenInsightContext, type GreenLayerContext, type Intent, type KnowledgeCaptureOptions, type KnowledgeCaptureResult, type KnowledgeCaptureSection, type ListOutputsOpts, type LlmMessage, type LlmProvider, type LlmRequest, type LlmResponse, MAX_ANIMATION_DURATION_SECONDS, MIN_ANIMATION_DURATION_SECONDS, type Modality, type NewsletterOutput, type NumberField, type ObjectField, type OnboardingDocOpts, type OrchestrationInput, type OrchestrationResult, type OutputStatus, PRISM_TEMPLATES, PRISM_TEMPLATE_ARCHITECTURE_OVERVIEW, PRISM_TEMPLATE_REFACTOR_RATIONALE, PRISM_TEMPLATE_RELEASE_ANNOUNCEMENT, PRISM_TEMPLATE_SHIPPING_DIGEST, PRISM_TEMPLATE_ZONE_DEEPDIVE, type PresentationOutput, type PresentationSlide, type PresentationSlideType, type PrismBrandDraft, type PrismContextPrompt, type PrismData, type PrismFocus, type PrismInsight, type PrismRecommendation, type PrismSession, type PrismTemplate, type ProductTruth, type ProductTruthClaim, REFINE_COUNTDOWN_THRESHOLD, REFINE_SESSION_SOFT_CAP, REFINE_SUGGESTIONS, type RadioOptions, type RadioResult, type ReadingLevel, type RefactoringReportOpts, type RefineAssetInput, type RefineAssetResult, type RefineLimitState, type RefineSuggestion, type ReleaseNotesOpts, type RenderWidgetInput, type ResolveBrandPaletteInput, type ResolvedTuple, STYLE_PRESET_BRUTALIST, STYLE_PRESET_DEFAULT, STYLE_PRESET_GLASSY, STYLE_PRESET_MINIMAL, type ScheduleRange, type ScheduledEntry, type ScheduledEntryMetadata, type ScheduledStatus, type SchemaDefinitionErr, type SchemaDefinitionOk, type SchemaDefinitionResult, type ScopeKind, type SignalKind, type SprintRetroOutput, type StringField, type StyleTokens, TEMPLATE_SCHEMA_EXAMPLES, TEMPLATE_SCHEMA_GENERIC, type TokenUsage, type Tonality, type UrlBrandHints, type ValidationErr, type ValidationOk, type ValidationResult, WIDGET_TEMPLATE_CHANGELOG_ROW, WIDGET_TEMPLATE_CTA_BANNER, WIDGET_TEMPLATE_FEATURE_GRID, WIDGET_TEMPLATE_METRIC_BADGE, WIDGET_TEMPLATE_PRICING_TIER, WIDGET_TEMPLATE_SOCIAL_PROOF, WIDGET_TEMPLATE_STAT_CARD, WIDGET_TEMPLATE_TESTIMONIAL, type WeeklyDigestContext, type WidgetExportFormat, type WidgetInstance, type WidgetInstanceSnapshot, type WidgetKind, type WidgetSlotDef, type WidgetSlotType, type WidgetStyle, type WidgetStyleSnapshot, type WidgetTemplate, type Zone, applyEntryPatch, asAudienceId, assembleBrandUrlExtractionPrompt, assembleForgePrompt, brandThemeConfigToEntry, buildPrismContextPrompt, buildRevertVersion, buildScheduledEntry, buildVersion, cascadingScheduledFor, clampAnimationDuration, computeDiff, defaultBrandKit, defaultValueForField, deriveContextSummary, distill, entryInRange, exportToBufferCsv, exportToHypefuryCsv, exportToICalendar, extractBrandFromPrismBlueprint, extractDependencyHotspots, extractTopChurnFiles, extractZones, generateADR, generateArc42, generateArchitectureWalkthrough, generateAskDrivenAsset, generateChangesSince, generateComplianceDoc, generateKnowledgeCapture, generateNewsletter, generateOnboardingDoc, generatePresentation, generateRadio, generateRefactoringReport, generateReleaseNotes, generateSprintRetro, getDispatchChannel, getPrismTemplate, getSlotValue, getStyleById, getWidgetTemplate, initialFormValues, next7DaysRange, nextVersionNumber, normalizePrismlensBlueprint, orchestrateDispatch, parseAndValidateSchemaDefinition, parseBrandKitFromLlmResponse, parseBrandThemeContent, parseStyleFromCss, parseStyleFromTailwindConfig, parseStyleFromTokensJson, parseThemeConfigContent, previewExport, readAmberLayer, readBlueprintData, readBlueprintFromTarget, readGreenLayer, readPrismDirectory, refineAsset, refineLimitState, renderWidget, resolveAnimatedChoice, resolveAnimationDuration, resolveBrandPalette, runForgeGeneration, scanForSecrets, schemaExampleFor, schemaToForm, templateAnimatedDefault, themeEntryToPalette, tryParseJsonObject, validateAgainstTemplateSchema, validateAssetSlots, validateFormValues, validateSchemaDefinition };
|