@tienne/gestalt 0.16.0 → 0.18.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/package.json +1 -4
- package/dist/role-agents/presentation-designer/AGENT.md +211 -0
- package/dist/role-agents/presentation-designer/templates/broadside.html +292 -0
- package/dist/role-agents/presentation-designer/templates/editorial-forest.html +264 -0
- package/dist/role-agents/presentation-designer/templates/emerald-editorial.html +273 -0
- package/dist/role-agents/presentation-designer/templates/neo-grid.html +407 -0
- package/dist/role-agents/presentation-designer/templates/pin-and-paper.html +225 -0
- package/dist/role-agents/presentation-designer/templates/pink-script.html +241 -0
- package/dist/role-agents/presentation-designer/templates/sakura-chroma.html +293 -0
- package/dist/role-agents/presentation-designer/templates/signal.html +403 -0
- package/dist/role-agents/presentation-designer/templates/stencil-tablet.html +211 -0
- package/dist/role-agents/presentation-designer/templates/studio.html +379 -0
- package/dist/skills/agent/SKILL.md +2 -0
- package/dist/skills/seed/SKILL.md +92 -0
- package/dist/src/cli/commands/seed.d.ts +4 -0
- package/dist/src/cli/commands/seed.d.ts.map +1 -0
- package/dist/src/cli/commands/seed.js +34 -0
- package/dist/src/cli/commands/seed.js.map +1 -0
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +0 -7
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/interview/ambiguity.d.ts +8 -0
- package/dist/src/interview/ambiguity.d.ts.map +1 -0
- package/dist/src/interview/ambiguity.js +69 -0
- package/dist/src/interview/ambiguity.js.map +1 -0
- package/dist/src/mcp/tools/seed-passthrough.d.ts +5 -0
- package/dist/src/mcp/tools/seed-passthrough.d.ts.map +1 -0
- package/dist/src/mcp/tools/seed-passthrough.js +29 -0
- package/dist/src/mcp/tools/seed-passthrough.js.map +1 -0
- package/dist/src/mcp/tools/seed.d.ts +5 -0
- package/dist/src/mcp/tools/seed.d.ts.map +1 -0
- package/dist/src/mcp/tools/seed.js +19 -0
- package/dist/src/mcp/tools/seed.js.map +1 -0
- package/dist/src/recording/agg-converter.d.ts +25 -0
- package/dist/src/recording/agg-converter.d.ts.map +1 -0
- package/dist/src/recording/agg-converter.js +80 -0
- package/dist/src/recording/agg-converter.js.map +1 -0
- package/dist/src/recording/agg-installer.d.ts +6 -0
- package/dist/src/recording/agg-installer.d.ts.map +1 -0
- package/dist/src/recording/agg-installer.js +50 -0
- package/dist/src/recording/agg-installer.js.map +1 -0
- package/dist/src/recording/asciinema-installer.d.ts +6 -0
- package/dist/src/recording/asciinema-installer.d.ts.map +1 -0
- package/dist/src/recording/asciinema-installer.js +50 -0
- package/dist/src/recording/asciinema-installer.js.map +1 -0
- package/dist/src/recording/asciinema-recorder.d.ts +26 -0
- package/dist/src/recording/asciinema-recorder.d.ts.map +1 -0
- package/dist/src/recording/asciinema-recorder.js +52 -0
- package/dist/src/recording/asciinema-recorder.js.map +1 -0
- package/dist/src/recording/cast-generator.d.ts +7 -0
- package/dist/src/recording/cast-generator.d.ts.map +1 -0
- package/dist/src/recording/cast-generator.js +97 -0
- package/dist/src/recording/cast-generator.js.map +1 -0
- package/dist/src/recording/filename-generator.d.ts +19 -0
- package/dist/src/recording/filename-generator.d.ts.map +1 -0
- package/dist/src/recording/filename-generator.js +67 -0
- package/dist/src/recording/filename-generator.js.map +1 -0
- package/dist/src/recording/gif-generator.d.ts +21 -0
- package/dist/src/recording/gif-generator.d.ts.map +1 -0
- package/dist/src/recording/gif-generator.js +121 -0
- package/dist/src/recording/gif-generator.js.map +1 -0
- package/dist/src/recording/recording-dir.d.ts +5 -0
- package/dist/src/recording/recording-dir.d.ts.map +1 -0
- package/dist/src/recording/recording-dir.js +13 -0
- package/dist/src/recording/recording-dir.js.map +1 -0
- package/dist/src/recording/recording-orchestrator.d.ts +50 -0
- package/dist/src/recording/recording-orchestrator.d.ts.map +1 -0
- package/dist/src/recording/recording-orchestrator.js +98 -0
- package/dist/src/recording/recording-orchestrator.js.map +1 -0
- package/dist/src/recording/resume-detector.d.ts +10 -0
- package/dist/src/recording/resume-detector.d.ts.map +1 -0
- package/dist/src/recording/resume-detector.js +14 -0
- package/dist/src/recording/resume-detector.js.map +1 -0
- package/dist/src/recording/segment-merger.d.ts +27 -0
- package/dist/src/recording/segment-merger.d.ts.map +1 -0
- package/dist/src/recording/segment-merger.js +65 -0
- package/dist/src/recording/segment-merger.js.map +1 -0
- package/dist/src/recording/terminal-recorder.d.ts +31 -0
- package/dist/src/recording/terminal-recorder.d.ts.map +1 -0
- package/dist/src/recording/terminal-recorder.js +111 -0
- package/dist/src/recording/terminal-recorder.js.map +1 -0
- package/dist/src/scripts/postinstall.d.ts +2 -0
- package/dist/src/scripts/postinstall.d.ts.map +1 -0
- package/dist/src/scripts/postinstall.js +29 -0
- package/dist/src/scripts/postinstall.js.map +1 -0
- package/dist/src/seed/extractor.d.ts +15 -0
- package/dist/src/seed/extractor.d.ts.map +1 -0
- package/dist/src/seed/extractor.js +88 -0
- package/dist/src/seed/extractor.js.map +1 -0
- package/dist/src/seed/generator.d.ts +12 -0
- package/dist/src/seed/generator.d.ts.map +1 -0
- package/dist/src/seed/generator.js +66 -0
- package/dist/src/seed/generator.js.map +1 -0
- package/dist/src/seed/passthrough-generator.d.ts +31 -0
- package/dist/src/seed/passthrough-generator.d.ts.map +1 -0
- package/dist/src/seed/passthrough-generator.js +80 -0
- package/dist/src/seed/passthrough-generator.js.map +1 -0
- package/dist/src/seed/schema.d.ts +145 -0
- package/dist/src/seed/schema.d.ts.map +1 -0
- package/dist/src/seed/schema.js +37 -0
- package/dist/src/seed/schema.js.map +1 -0
- package/package.json +1 -4
- package/role-agents/presentation-designer/AGENT.md +211 -0
- package/role-agents/presentation-designer/templates/broadside.html +292 -0
- package/role-agents/presentation-designer/templates/editorial-forest.html +264 -0
- package/role-agents/presentation-designer/templates/emerald-editorial.html +273 -0
- package/role-agents/presentation-designer/templates/neo-grid.html +407 -0
- package/role-agents/presentation-designer/templates/pin-and-paper.html +225 -0
- package/role-agents/presentation-designer/templates/pink-script.html +241 -0
- package/role-agents/presentation-designer/templates/sakura-chroma.html +293 -0
- package/role-agents/presentation-designer/templates/signal.html +403 -0
- package/role-agents/presentation-designer/templates/stencil-tablet.html +211 -0
- package/role-agents/presentation-designer/templates/studio.html +379 -0
- package/skills/agent/SKILL.md +2 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { appendFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { ensureRecordingsDir, getFramesPath } from './recording-dir.js';
|
|
3
|
+
/**
|
|
4
|
+
* TerminalRecorder: process.stdout.write를 인터셉트하여
|
|
5
|
+
* TerminalFrame을 .frames NDJSON 파일에 실시간 append한다.
|
|
6
|
+
*
|
|
7
|
+
* node-pty 없이도 동작하지만, PTY 기반 캡처가 필요한 경우
|
|
8
|
+
* 향후 node-pty 통합으로 확장 가능하도록 설계한다.
|
|
9
|
+
*/
|
|
10
|
+
export class TerminalRecorder {
|
|
11
|
+
sessionId;
|
|
12
|
+
framesPath;
|
|
13
|
+
segment = null;
|
|
14
|
+
isRecording = false;
|
|
15
|
+
frameBuffer = [];
|
|
16
|
+
// 원본 stdout.write 저장
|
|
17
|
+
originalStdoutWrite;
|
|
18
|
+
constructor(sessionId) {
|
|
19
|
+
this.sessionId = sessionId;
|
|
20
|
+
ensureRecordingsDir();
|
|
21
|
+
this.framesPath = getFramesPath(sessionId);
|
|
22
|
+
}
|
|
23
|
+
/** 녹화 시작. 기존 .frames 파일이 있으면 이어서 append (resume) */
|
|
24
|
+
start() {
|
|
25
|
+
if (this.isRecording)
|
|
26
|
+
return this.segment;
|
|
27
|
+
const isResuming = existsSync(this.framesPath);
|
|
28
|
+
this.segment = {
|
|
29
|
+
sessionId: this.sessionId,
|
|
30
|
+
framesPath: this.framesPath,
|
|
31
|
+
startedAt: Date.now(),
|
|
32
|
+
};
|
|
33
|
+
this.isRecording = true;
|
|
34
|
+
this.interceptStdout();
|
|
35
|
+
if (!isResuming) {
|
|
36
|
+
// 새 녹화: 빈 파일로 시작
|
|
37
|
+
}
|
|
38
|
+
return this.segment;
|
|
39
|
+
}
|
|
40
|
+
/** 녹화 일시 중지 (세션 중단 시) */
|
|
41
|
+
pause() {
|
|
42
|
+
if (!this.isRecording)
|
|
43
|
+
return;
|
|
44
|
+
this.restoreStdout();
|
|
45
|
+
this.flushBuffer();
|
|
46
|
+
if (this.segment) {
|
|
47
|
+
this.segment.endedAt = Date.now();
|
|
48
|
+
}
|
|
49
|
+
this.isRecording = false;
|
|
50
|
+
}
|
|
51
|
+
/** 녹화 완전 종료 */
|
|
52
|
+
stop() {
|
|
53
|
+
if (this.isRecording) {
|
|
54
|
+
this.pause();
|
|
55
|
+
}
|
|
56
|
+
return this.segment;
|
|
57
|
+
}
|
|
58
|
+
get recording() {
|
|
59
|
+
return this.isRecording;
|
|
60
|
+
}
|
|
61
|
+
get framesFilePath() {
|
|
62
|
+
return this.framesPath;
|
|
63
|
+
}
|
|
64
|
+
/** stdout.write 인터셉트 */
|
|
65
|
+
interceptStdout() {
|
|
66
|
+
const self = this;
|
|
67
|
+
this.originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
68
|
+
// overwrite with interceptor
|
|
69
|
+
const intercepted = function (chunk, encodingOrCallback, callback) {
|
|
70
|
+
const data = typeof chunk === 'string' ? chunk : Buffer.from(chunk).toString('utf8');
|
|
71
|
+
self.captureFrame(data);
|
|
72
|
+
// 원본 write 호출
|
|
73
|
+
if (typeof encodingOrCallback === 'function') {
|
|
74
|
+
return self.originalStdoutWrite(chunk, encodingOrCallback);
|
|
75
|
+
}
|
|
76
|
+
if (typeof encodingOrCallback === 'string') {
|
|
77
|
+
return self.originalStdoutWrite(chunk, encodingOrCallback, callback);
|
|
78
|
+
}
|
|
79
|
+
return self.originalStdoutWrite(chunk);
|
|
80
|
+
};
|
|
81
|
+
process.stdout.write = intercepted;
|
|
82
|
+
}
|
|
83
|
+
restoreStdout() {
|
|
84
|
+
if (this.originalStdoutWrite) {
|
|
85
|
+
process.stdout.write = this.originalStdoutWrite;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
captureFrame(data) {
|
|
89
|
+
if (!data || !this.isRecording)
|
|
90
|
+
return;
|
|
91
|
+
const frame = {
|
|
92
|
+
timestamp: Date.now(),
|
|
93
|
+
data,
|
|
94
|
+
cols: process.stdout.columns ?? 80,
|
|
95
|
+
rows: process.stdout.rows ?? 24,
|
|
96
|
+
};
|
|
97
|
+
this.frameBuffer.push(frame);
|
|
98
|
+
// 버퍼가 10개 이상 쌓이면 즉시 flush
|
|
99
|
+
if (this.frameBuffer.length >= 10) {
|
|
100
|
+
this.flushBuffer();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
flushBuffer() {
|
|
104
|
+
if (this.frameBuffer.length === 0)
|
|
105
|
+
return;
|
|
106
|
+
const lines = this.frameBuffer.map((f) => JSON.stringify(f)).join('\n') + '\n';
|
|
107
|
+
appendFileSync(this.framesPath, lines, 'utf8');
|
|
108
|
+
this.frameBuffer = [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=terminal-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-recorder.js","sourceRoot":"","sources":["../../../src/recording/terminal-recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxE;;;;;;GAMG;AACH,MAAM,OAAO,gBAAgB;IASE;IARZ,UAAU,CAAS;IAC5B,OAAO,GAA4B,IAAI,CAAC;IACxC,WAAW,GAAG,KAAK,CAAC;IACpB,WAAW,GAAoB,EAAE,CAAC;IAE1C,qBAAqB;IACb,mBAAmB,CAA+B;IAE1D,YAA6B,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QAC5C,mBAAmB,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG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AAE,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;SAChC,CAAC;QAEF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE7B,0BAA0B;QAC1B,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;YAClC,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC/E,cAAc,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.d.ts","sourceRoot":"","sources":["../../../src/scripts/postinstall.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Postinstall script: auto-setup agg for GIF recording support.
|
|
3
|
+
* Runs after: npm install @tienne/gestalt
|
|
4
|
+
*
|
|
5
|
+
* - Silently skips in CI or if GESTALT_SKIP_DEPS=1
|
|
6
|
+
* - Always exits 0 (never fails the install)
|
|
7
|
+
*/
|
|
8
|
+
import { AggInstaller } from '../recording/agg-installer.js';
|
|
9
|
+
async function main() {
|
|
10
|
+
if (process.env['CI'] || process.env['GESTALT_SKIP_DEPS'] === '1') {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const installer = new AggInstaller();
|
|
14
|
+
if (installer.isInstalled())
|
|
15
|
+
return;
|
|
16
|
+
process.stdout.write('\n[gestalt] agg not found — setting up GIF recording support...\n');
|
|
17
|
+
try {
|
|
18
|
+
await installer.ensureInstalled();
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
22
|
+
process.stdout.write(`[gestalt] Skipping agg setup: ${msg}\n`);
|
|
23
|
+
process.stdout.write('[gestalt] Install manually later: https://github.com/asciinema/agg\n\n');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
main()
|
|
27
|
+
.then(() => process.exit(0))
|
|
28
|
+
.catch(() => process.exit(0));
|
|
29
|
+
//# sourceMappingURL=postinstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../../src/scripts/postinstall.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,KAAK,UAAU,IAAI;IACjB,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,GAAG,EAAE,CAAC;QAClE,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;IACrC,IAAI,SAAS,CAAC,WAAW,EAAE;QAAE,OAAO;IAEpC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;IAE1F,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,eAAe,EAAE,CAAC;IACpC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,GAAG,IAAI,CAAC,CAAC;QAC/D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wEAAwE,CAAC,CAAC;IACjG,CAAC;AACH,CAAC;AAED,IAAI,EAAE;KACH,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAC3B,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { InterviewSession, GestaltAnalysis, OntologySchema } from '../core/types.js';
|
|
2
|
+
import type { LLMAdapter } from '../llm/types.js';
|
|
3
|
+
export interface ExtractedData {
|
|
4
|
+
goal: string;
|
|
5
|
+
constraints: string[];
|
|
6
|
+
acceptanceCriteria: string[];
|
|
7
|
+
ontologySchema: OntologySchema;
|
|
8
|
+
gestaltAnalysis: GestaltAnalysis[];
|
|
9
|
+
}
|
|
10
|
+
export declare class SeedExtractor {
|
|
11
|
+
private llm;
|
|
12
|
+
constructor(llm: LLMAdapter);
|
|
13
|
+
extract(session: InterviewSession): Promise<ExtractedData>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../src/seed/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,eAAe,EAAE,CAAC;CACpC;AAED,qBAAa,aAAa;IACZ,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,UAAU;IAE7B,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;CAsBjE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { buildSeedPrompt, INTERVIEW_SYSTEM_PROMPT } from '../llm/prompts.js';
|
|
2
|
+
import { SeedGenerationError } from '../core/errors.js';
|
|
3
|
+
export class SeedExtractor {
|
|
4
|
+
llm;
|
|
5
|
+
constructor(llm) {
|
|
6
|
+
this.llm = llm;
|
|
7
|
+
}
|
|
8
|
+
async extract(session) {
|
|
9
|
+
const completedRounds = session.rounds
|
|
10
|
+
.filter((r) => r.userResponse)
|
|
11
|
+
.map((r) => ({
|
|
12
|
+
question: r.question,
|
|
13
|
+
response: r.userResponse,
|
|
14
|
+
}));
|
|
15
|
+
if (completedRounds.length === 0) {
|
|
16
|
+
throw new SeedGenerationError('No completed interview rounds to extract from');
|
|
17
|
+
}
|
|
18
|
+
const prompt = buildSeedPrompt(session.topic, completedRounds, session.projectType);
|
|
19
|
+
const response = await this.llm.chat({
|
|
20
|
+
system: INTERVIEW_SYSTEM_PROMPT,
|
|
21
|
+
messages: [{ role: 'user', content: prompt }],
|
|
22
|
+
temperature: 0.3,
|
|
23
|
+
});
|
|
24
|
+
return parseSeedResponse(response.content);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function parseSeedResponse(content) {
|
|
28
|
+
const jsonMatch = content.match(/\{[\s\S]*\}/);
|
|
29
|
+
if (!jsonMatch) {
|
|
30
|
+
throw new SeedGenerationError('Failed to parse LLM response as JSON');
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
34
|
+
return {
|
|
35
|
+
goal: asString(parsed['goal'], 'Undefined goal'),
|
|
36
|
+
constraints: asStringArray(parsed['constraints']),
|
|
37
|
+
acceptanceCriteria: asStringArray(parsed['acceptanceCriteria']),
|
|
38
|
+
ontologySchema: parseOntology(parsed['ontologySchema']),
|
|
39
|
+
gestaltAnalysis: parseGestaltAnalysis(parsed['gestaltAnalysis']),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
if (e instanceof SeedGenerationError)
|
|
44
|
+
throw e;
|
|
45
|
+
throw new SeedGenerationError(`Failed to parse seed data: ${e instanceof Error ? e.message : String(e)}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function asString(value, fallback) {
|
|
49
|
+
return typeof value === 'string' && value.length > 0 ? value : fallback;
|
|
50
|
+
}
|
|
51
|
+
function asStringArray(value) {
|
|
52
|
+
if (!Array.isArray(value))
|
|
53
|
+
return [];
|
|
54
|
+
return value.filter((v) => typeof v === 'string');
|
|
55
|
+
}
|
|
56
|
+
function parseOntology(value) {
|
|
57
|
+
if (!value || typeof value !== 'object') {
|
|
58
|
+
return { entities: [], relations: [] };
|
|
59
|
+
}
|
|
60
|
+
const obj = value;
|
|
61
|
+
const entities = Array.isArray(obj['entities'])
|
|
62
|
+
? obj['entities'].map((e) => ({
|
|
63
|
+
name: asString(e['name'], 'Unknown'),
|
|
64
|
+
description: asString(e['description'], ''),
|
|
65
|
+
attributes: asStringArray(e['attributes']),
|
|
66
|
+
}))
|
|
67
|
+
: [];
|
|
68
|
+
const relations = Array.isArray(obj['relations'])
|
|
69
|
+
? obj['relations'].map((r) => ({
|
|
70
|
+
from: asString(r['from'], ''),
|
|
71
|
+
to: asString(r['to'], ''),
|
|
72
|
+
type: asString(r['type'], ''),
|
|
73
|
+
}))
|
|
74
|
+
: [];
|
|
75
|
+
return { entities, relations };
|
|
76
|
+
}
|
|
77
|
+
function parseGestaltAnalysis(value) {
|
|
78
|
+
if (!Array.isArray(value))
|
|
79
|
+
return [];
|
|
80
|
+
return value
|
|
81
|
+
.filter((v) => typeof v === 'object' && v !== null)
|
|
82
|
+
.map((v) => ({
|
|
83
|
+
principle: asString(v['principle'], 'closure'),
|
|
84
|
+
finding: asString(v['finding'], ''),
|
|
85
|
+
confidence: typeof v['confidence'] === 'number' ? v['confidence'] : 0.5,
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/seed/extractor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAWxD,MAAM,OAAO,aAAa;IACJ;IAApB,YAAoB,GAAe;QAAf,QAAG,GAAH,GAAG,CAAY;IAAG,CAAC;IAEvC,KAAK,CAAC,OAAO,CAAC,OAAyB;QACrC,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM;aACnC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,CAAC,CAAC,YAAa;SAC1B,CAAC,CAAC,CAAC;QAEN,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,mBAAmB,CAAC,+CAA+C,CAAC,CAAC;QACjF,CAAC;QAED,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QAEpF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YACnC,MAAM,EAAE,uBAAuB;YAC/B,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YAC7C,WAAW,EAAE,GAAG;SACjB,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC7C,C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EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACrC,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,CAAC,EAAgC,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,CAAC;SAChF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACX,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,SAAS,CAAiC;QAC9E,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC;QACnC,UAAU,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;KACxE,CAAC,CAAC,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InterviewSession, Seed } from '../core/types.js';
|
|
2
|
+
import { AmbiguityThresholdError, SeedGenerationError } from '../core/errors.js';
|
|
3
|
+
import { type Result } from '../core/result.js';
|
|
4
|
+
import type { LLMAdapter } from '../llm/types.js';
|
|
5
|
+
import { EventStore } from '../events/store.js';
|
|
6
|
+
export declare class SeedGenerator {
|
|
7
|
+
private eventStore;
|
|
8
|
+
private extractor;
|
|
9
|
+
constructor(llm: LLMAdapter, eventStore: EventStore);
|
|
10
|
+
generate(session: InterviewSession, force?: boolean): Promise<Result<Seed, SeedGenerationError | AmbiguityThresholdError>>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/seed/generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,qBAAa,aAAa;IAKtB,OAAO,CAAC,UAAU;IAJpB,OAAO,CAAC,SAAS,CAAgB;gBAG/B,GAAG,EAAE,UAAU,EACP,UAAU,EAAE,UAAU;IAK1B,QAAQ,CACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,UAAQ,GACZ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,CAAC,CAAC;CAmExE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { AmbiguityThresholdError, SeedGenerationError } from '../core/errors.js';
|
|
3
|
+
import { AMBIGUITY_THRESHOLD, MAX_SEED_RETRIES } from '../core/constants.js';
|
|
4
|
+
import { ok, err } from '../core/result.js';
|
|
5
|
+
import { seedSchema } from './schema.js';
|
|
6
|
+
import { SeedExtractor } from './extractor.js';
|
|
7
|
+
import { EventType } from '../events/types.js';
|
|
8
|
+
export class SeedGenerator {
|
|
9
|
+
eventStore;
|
|
10
|
+
extractor;
|
|
11
|
+
constructor(llm, eventStore) {
|
|
12
|
+
this.eventStore = eventStore;
|
|
13
|
+
this.extractor = new SeedExtractor(llm);
|
|
14
|
+
}
|
|
15
|
+
async generate(session, force = false) {
|
|
16
|
+
// Validate ambiguity threshold
|
|
17
|
+
if (!force) {
|
|
18
|
+
const ambiguity = session.ambiguityScore?.overall ?? 1.0;
|
|
19
|
+
if (ambiguity > AMBIGUITY_THRESHOLD) {
|
|
20
|
+
return err(new AmbiguityThresholdError(ambiguity, AMBIGUITY_THRESHOLD));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (session.status !== 'completed') {
|
|
24
|
+
return err(new SeedGenerationError('Interview session must be completed before generating a seed'));
|
|
25
|
+
}
|
|
26
|
+
// Retry up to MAX_SEED_RETRIES
|
|
27
|
+
let lastError = null;
|
|
28
|
+
for (let attempt = 0; attempt < MAX_SEED_RETRIES; attempt++) {
|
|
29
|
+
try {
|
|
30
|
+
const extracted = await this.extractor.extract(session);
|
|
31
|
+
const seed = {
|
|
32
|
+
version: '1.0.0',
|
|
33
|
+
goal: extracted.goal,
|
|
34
|
+
constraints: extracted.constraints,
|
|
35
|
+
acceptanceCriteria: extracted.acceptanceCriteria,
|
|
36
|
+
ontologySchema: extracted.ontologySchema,
|
|
37
|
+
gestaltAnalysis: extracted.gestaltAnalysis,
|
|
38
|
+
metadata: {
|
|
39
|
+
seedId: randomUUID(),
|
|
40
|
+
interviewSessionId: session.sessionId,
|
|
41
|
+
ambiguityScore: session.ambiguityScore?.overall ?? 1.0,
|
|
42
|
+
generatedAt: new Date().toISOString(),
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
// Validate against schema
|
|
46
|
+
const validation = seedSchema.safeParse(seed);
|
|
47
|
+
if (!validation.success) {
|
|
48
|
+
lastError = new SeedGenerationError(`Seed validation failed: ${validation.error.message}`);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
this.eventStore.append('seed', seed.metadata.seedId, EventType.SEED_SPEC_GENERATED, {
|
|
52
|
+
sessionId: session.sessionId,
|
|
53
|
+
goal: seed.goal,
|
|
54
|
+
constraintCount: seed.constraints.length,
|
|
55
|
+
criteriaCount: seed.acceptanceCriteria.length,
|
|
56
|
+
});
|
|
57
|
+
return ok(seed);
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
lastError = e instanceof Error ? e : new Error(String(e));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return err(new SeedGenerationError(`Failed after ${MAX_SEED_RETRIES} attempts: ${lastError?.message ?? 'unknown error'}`));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/seed/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAe,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,aAAa;IAKd;IAJF,SAAS,CAAgB;IAEjC,YACE,GAAe,EACP,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAE9B,IAAI,CAAC,SAAS,GAAG,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,OAAyB,EACzB,KAAK,GAAG,KAAK;QAEb,+BAA+B;QAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,SAAS,GAAG,OAAO,CAAC,cAAc,EAAE,OAAO,IAAI,GAAG,CAAC;YACzD,IAAI,SAAS,GAAG,mBAAmB,EAAE,CAAC;gBACpC,OAAO,GAAG,CAAC,IAAI,uBAAuB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACnC,OAAO,GAAG,CAAC,I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e,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM;oBACxC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM;iBAC9C,CACF,CAAC;gBAEF,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,SAAS,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CACR,IAAI,mBAAmB,CACrB,gBAAgB,gBAAgB,cAAc,SAAS,EAAE,OAAO,IAAI,eAAe,EAAE,CACtF,CACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { InterviewSession, Seed } from '../core/types.js';
|
|
2
|
+
import { AmbiguityThresholdError, SeedGenerationError } from '../core/errors.js';
|
|
3
|
+
import { type Result } from '../core/result.js';
|
|
4
|
+
import { EventStore } from '../events/store.js';
|
|
5
|
+
export interface SeedContext {
|
|
6
|
+
systemPrompt: string;
|
|
7
|
+
seedPrompt: string;
|
|
8
|
+
allRounds: {
|
|
9
|
+
roundNumber: number;
|
|
10
|
+
question: string;
|
|
11
|
+
response: string;
|
|
12
|
+
gestaltFocus: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export interface ExternalSeed {
|
|
16
|
+
goal: string;
|
|
17
|
+
constraints: string[];
|
|
18
|
+
acceptanceCriteria: string[];
|
|
19
|
+
ontologySchema: {
|
|
20
|
+
entities: unknown[];
|
|
21
|
+
relations: unknown[];
|
|
22
|
+
};
|
|
23
|
+
gestaltAnalysis: unknown[];
|
|
24
|
+
}
|
|
25
|
+
export declare class PassthroughSeedGenerator {
|
|
26
|
+
private eventStore;
|
|
27
|
+
constructor(eventStore: EventStore);
|
|
28
|
+
buildSeedContext(session: InterviewSession): SeedContext;
|
|
29
|
+
validateAndStore(session: InterviewSession, externalSeed: ExternalSeed, force?: boolean): Result<Seed, SeedGenerationError | AmbiguityThresholdError>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=passthrough-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passthrough-generator.d.ts","sourceRoot":"","sources":["../../../src/seed/passthrough-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEjF,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMhD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAChG;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,cAAc,EAAE;QAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;QAAC,SAAS,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;IAC9D,eAAe,EAAE,OAAO,EAAE,CAAC;CAC5B;AAID,qBAAa,wBAAwB;IACvB,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,UAAU;IAE1C,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAwBxD,gBAAgB,CACd,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,YAAY,EAC1B,KAAK,UAAQ,GACZ,MAAM,CAAC,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,CAAC;CA6D/D"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { AmbiguityThresholdError, SeedGenerationError } from '../core/errors.js';
|
|
3
|
+
import { AMBIGUITY_THRESHOLD } from '../core/constants.js';
|
|
4
|
+
import { ok, err } from '../core/result.js';
|
|
5
|
+
import { seedSchema } from './schema.js';
|
|
6
|
+
import { EventType } from '../events/types.js';
|
|
7
|
+
import { INTERVIEW_SYSTEM_PROMPT, buildSeedPrompt } from '../llm/prompts.js';
|
|
8
|
+
// ─── Generator ──────────────────────────────────────────────────
|
|
9
|
+
export class PassthroughSeedGenerator {
|
|
10
|
+
eventStore;
|
|
11
|
+
constructor(eventStore) {
|
|
12
|
+
this.eventStore = eventStore;
|
|
13
|
+
}
|
|
14
|
+
buildSeedContext(session) {
|
|
15
|
+
const answeredRounds = session.rounds
|
|
16
|
+
.filter((r) => r.userResponse !== null)
|
|
17
|
+
.map((r) => ({
|
|
18
|
+
question: r.question,
|
|
19
|
+
response: r.userResponse,
|
|
20
|
+
}));
|
|
21
|
+
const seedPrompt = buildSeedPrompt(session.topic, answeredRounds, session.projectType);
|
|
22
|
+
return {
|
|
23
|
+
systemPrompt: INTERVIEW_SYSTEM_PROMPT,
|
|
24
|
+
seedPrompt,
|
|
25
|
+
allRounds: session.rounds
|
|
26
|
+
.filter((r) => r.userResponse !== null)
|
|
27
|
+
.map((r) => ({
|
|
28
|
+
roundNumber: r.roundNumber,
|
|
29
|
+
question: r.question,
|
|
30
|
+
response: r.userResponse,
|
|
31
|
+
gestaltFocus: r.gestaltFocus,
|
|
32
|
+
})),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
validateAndStore(session, externalSeed, force = false) {
|
|
36
|
+
// Validate ambiguity threshold
|
|
37
|
+
if (!force) {
|
|
38
|
+
const ambiguity = session.ambiguityScore?.overall ?? 1.0;
|
|
39
|
+
if (ambiguity > AMBIGUITY_THRESHOLD) {
|
|
40
|
+
return err(new AmbiguityThresholdError(ambiguity, AMBIGUITY_THRESHOLD));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (session.status !== 'completed') {
|
|
44
|
+
return err(new SeedGenerationError('Interview session must be completed before generating a seed'));
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const seed = {
|
|
48
|
+
version: '1.0.0',
|
|
49
|
+
goal: externalSeed.goal,
|
|
50
|
+
constraints: externalSeed.constraints,
|
|
51
|
+
acceptanceCriteria: externalSeed.acceptanceCriteria,
|
|
52
|
+
ontologySchema: externalSeed.ontologySchema,
|
|
53
|
+
gestaltAnalysis: externalSeed.gestaltAnalysis,
|
|
54
|
+
metadata: {
|
|
55
|
+
seedId: randomUUID(),
|
|
56
|
+
interviewSessionId: session.sessionId,
|
|
57
|
+
ambiguityScore: session.ambiguityScore?.overall ?? 1.0,
|
|
58
|
+
generatedAt: new Date().toISOString(),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
// Validate against schema
|
|
62
|
+
const validation = seedSchema.safeParse(seed);
|
|
63
|
+
if (!validation.success) {
|
|
64
|
+
return err(new SeedGenerationError(`Seed validation failed: ${validation.error.message}`));
|
|
65
|
+
}
|
|
66
|
+
this.eventStore.append('seed', seed.metadata.seedId, EventType.SEED_SPEC_GENERATED, {
|
|
67
|
+
sessionId: session.sessionId,
|
|
68
|
+
goal: seed.goal,
|
|
69
|
+
constraintCount: seed.constraints.length,
|
|
70
|
+
criteriaCount: seed.acceptanceCriteria.length,
|
|
71
|
+
source: 'passthrough',
|
|
72
|
+
});
|
|
73
|
+
return ok(seed);
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
return err(new SeedGenerationError(`Failed to validate seed: ${e instanceof Error ? e.message : String(e)}`));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=passthrough-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"passthrough-generator.js","sourceRoot":"","sources":["../../../src/seed/passthrough-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAe,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAkB7E,mEAAmE;AAEnE,MAAM,OAAO,wBAAwB;IACf;IAApB,YAAoB,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAE9C,gBAAgB,CAAC,OAAyB;QACxC,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM;aAClC,MAAM,CAAC,CAAC,CAAC,EAAkD,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,IAAI,CAAC;aACtF,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,CAAC,CAAC,YAAY;SACzB,CAAC,CAAC,CAAC;QAEN,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;QAEvF,OAAO;YACL,YAAY,EAAE,uBAAuB;YACrC,UAAU;YACV,SAAS,EAAE,OAAO,CAAC,MAAM;iBACtB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,IAAI,CAAC;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AAM,UAAU,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC9C,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;gBACxB,OAAO,GAAG,CACR,IAAI,mBAAmB,CACrB,2BAA2B,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,CACtD,CACF,CAAC;YACJ,CAAC;YAED,IAAI,CAAC,UAAU,CAAC,MAAM,CACpB,MAAM,EACN,IAAI,CAAC,QAAQ,CAAC,MAAM,EACpB,SAAS,CAAC,mBAAmB,EAC7B;gBACE,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,eAAe,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM;gBACxC,aAAa,EAAE,IAAI,CAAC,kBAAkB,CAAC,MAAM;gBAC7C,MAAM,EAAE,aAAa;aACtB,CACF,CAAC;YAEF,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,GAAG,CACR,IAAI,mBAAmB,CACrB,4BAA4B,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACzE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GestaltPrinciple } from '../core/types.js';
|
|
3
|
+
export declare const seedSchema: z.ZodObject<{
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
goal: z.ZodString;
|
|
6
|
+
constraints: z.ZodArray<z.ZodString, "many">;
|
|
7
|
+
acceptanceCriteria: z.ZodArray<z.ZodString, "many">;
|
|
8
|
+
ontologySchema: z.ZodObject<{
|
|
9
|
+
entities: z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
attributes: z.ZodArray<z.ZodString, "many">;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
attributes: string[];
|
|
17
|
+
}, {
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
attributes: string[];
|
|
21
|
+
}>, "many">;
|
|
22
|
+
relations: z.ZodArray<z.ZodObject<{
|
|
23
|
+
from: z.ZodString;
|
|
24
|
+
to: z.ZodString;
|
|
25
|
+
type: z.ZodString;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
type: string;
|
|
28
|
+
from: string;
|
|
29
|
+
to: string;
|
|
30
|
+
}, {
|
|
31
|
+
type: string;
|
|
32
|
+
from: string;
|
|
33
|
+
to: string;
|
|
34
|
+
}>, "many">;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
entities: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
attributes: string[];
|
|
40
|
+
}[];
|
|
41
|
+
relations: {
|
|
42
|
+
type: string;
|
|
43
|
+
from: string;
|
|
44
|
+
to: string;
|
|
45
|
+
}[];
|
|
46
|
+
}, {
|
|
47
|
+
entities: {
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
attributes: string[];
|
|
51
|
+
}[];
|
|
52
|
+
relations: {
|
|
53
|
+
type: string;
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
}[];
|
|
57
|
+
}>;
|
|
58
|
+
gestaltAnalysis: z.ZodArray<z.ZodObject<{
|
|
59
|
+
principle: z.ZodNativeEnum<typeof GestaltPrinciple>;
|
|
60
|
+
finding: z.ZodString;
|
|
61
|
+
confidence: z.ZodNumber;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
principle: GestaltPrinciple;
|
|
64
|
+
finding: string;
|
|
65
|
+
confidence: number;
|
|
66
|
+
}, {
|
|
67
|
+
principle: GestaltPrinciple;
|
|
68
|
+
finding: string;
|
|
69
|
+
confidence: number;
|
|
70
|
+
}>, "many">;
|
|
71
|
+
metadata: z.ZodObject<{
|
|
72
|
+
seedId: z.ZodString;
|
|
73
|
+
interviewSessionId: z.ZodString;
|
|
74
|
+
ambiguityScore: z.ZodNumber;
|
|
75
|
+
generatedAt: z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
seedId: string;
|
|
78
|
+
interviewSessionId: string;
|
|
79
|
+
ambiguityScore: number;
|
|
80
|
+
generatedAt: string;
|
|
81
|
+
}, {
|
|
82
|
+
seedId: string;
|
|
83
|
+
interviewSessionId: string;
|
|
84
|
+
ambiguityScore: number;
|
|
85
|
+
generatedAt: string;
|
|
86
|
+
}>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
goal: string;
|
|
89
|
+
version: string;
|
|
90
|
+
constraints: string[];
|
|
91
|
+
acceptanceCriteria: string[];
|
|
92
|
+
ontologySchema: {
|
|
93
|
+
entities: {
|
|
94
|
+
name: string;
|
|
95
|
+
description: string;
|
|
96
|
+
attributes: string[];
|
|
97
|
+
}[];
|
|
98
|
+
relations: {
|
|
99
|
+
type: string;
|
|
100
|
+
from: string;
|
|
101
|
+
to: string;
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
104
|
+
gestaltAnalysis: {
|
|
105
|
+
principle: GestaltPrinciple;
|
|
106
|
+
finding: string;
|
|
107
|
+
confidence: number;
|
|
108
|
+
}[];
|
|
109
|
+
metadata: {
|
|
110
|
+
seedId: string;
|
|
111
|
+
interviewSessionId: string;
|
|
112
|
+
ambiguityScore: number;
|
|
113
|
+
generatedAt: string;
|
|
114
|
+
};
|
|
115
|
+
}, {
|
|
116
|
+
goal: string;
|
|
117
|
+
version: string;
|
|
118
|
+
constraints: string[];
|
|
119
|
+
acceptanceCriteria: string[];
|
|
120
|
+
ontologySchema: {
|
|
121
|
+
entities: {
|
|
122
|
+
name: string;
|
|
123
|
+
description: string;
|
|
124
|
+
attributes: string[];
|
|
125
|
+
}[];
|
|
126
|
+
relations: {
|
|
127
|
+
type: string;
|
|
128
|
+
from: string;
|
|
129
|
+
to: string;
|
|
130
|
+
}[];
|
|
131
|
+
};
|
|
132
|
+
gestaltAnalysis: {
|
|
133
|
+
principle: GestaltPrinciple;
|
|
134
|
+
finding: string;
|
|
135
|
+
confidence: number;
|
|
136
|
+
}[];
|
|
137
|
+
metadata: {
|
|
138
|
+
seedId: string;
|
|
139
|
+
interviewSessionId: string;
|
|
140
|
+
ambiguityScore: number;
|
|
141
|
+
generatedAt: string;
|
|
142
|
+
};
|
|
143
|
+
}>;
|
|
144
|
+
export type ValidatedSeed = z.infer<typeof seedSchema>;
|
|
145
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/seed/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAgCpD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|