@nahisaho/katashiro-generator 0.1.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/citation/citation-generator.d.ts +68 -0
- package/dist/citation/citation-generator.d.ts.map +1 -0
- package/dist/citation/citation-generator.js +134 -0
- package/dist/citation/citation-generator.js.map +1 -0
- package/dist/citation/index.d.ts +6 -0
- package/dist/citation/index.d.ts.map +1 -0
- package/dist/citation/index.js +5 -0
- package/dist/citation/index.js.map +1 -0
- package/dist/export/export-service.d.ts +96 -0
- package/dist/export/export-service.d.ts.map +1 -0
- package/dist/export/export-service.js +278 -0
- package/dist/export/export-service.js.map +1 -0
- package/dist/export/index.d.ts +7 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +7 -0
- package/dist/export/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +28 -0
- package/dist/interfaces.d.ts.map +1 -0
- package/dist/interfaces.js +5 -0
- package/dist/interfaces.js.map +1 -0
- package/dist/presentation/index.d.ts +7 -0
- package/dist/presentation/index.d.ts.map +1 -0
- package/dist/presentation/index.js +7 -0
- package/dist/presentation/index.js.map +1 -0
- package/dist/presentation/presentation-generator.d.ts +106 -0
- package/dist/presentation/presentation-generator.d.ts.map +1 -0
- package/dist/presentation/presentation-generator.js +250 -0
- package/dist/presentation/presentation-generator.js.map +1 -0
- package/dist/report/index.d.ts +6 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/index.js +5 -0
- package/dist/report/index.js.map +1 -0
- package/dist/report/report-generator.d.ts +82 -0
- package/dist/report/report-generator.d.ts.map +1 -0
- package/dist/report/report-generator.js +262 -0
- package/dist/report/report-generator.js.map +1 -0
- package/dist/summary/index.d.ts +6 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/summary/index.js +5 -0
- package/dist/summary/index.js.map +1 -0
- package/dist/summary/summary-generator.d.ts +42 -0
- package/dist/summary/summary-generator.d.ts.map +1 -0
- package/dist/summary/summary-generator.js +140 -0
- package/dist/summary/summary-generator.js.map +1 -0
- package/dist/template/index.d.ts +6 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +5 -0
- package/dist/template/index.js.map +1 -0
- package/dist/template/template-engine.d.ts +76 -0
- package/dist/template/template-engine.d.ts.map +1 -0
- package/dist/template/template-engine.js +165 -0
- package/dist/template/template-engine.js.map +1 -0
- package/dist/types.d.ts +42 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,qBAAqB,EACrB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nahisaho/katashiro-generator
|
|
3
|
+
* コンテンツ生成パッケージ
|
|
4
|
+
*
|
|
5
|
+
* @requirement REQ-GENERATE-001 ~ REQ-GENERATE-010
|
|
6
|
+
* @design DES-KATASHIRO-001 §2.2 Generator Container
|
|
7
|
+
*/
|
|
8
|
+
// 実装
|
|
9
|
+
export { ReportGenerator, } from './report/index.js';
|
|
10
|
+
export { SummaryGenerator, } from './summary/index.js';
|
|
11
|
+
export { CitationGenerator, } from './citation/index.js';
|
|
12
|
+
export { TemplateEngine, } from './template/index.js';
|
|
13
|
+
export { PresentationGenerator, } from './presentation/index.js';
|
|
14
|
+
export { ExportService, } from './export/index.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,KAAK;AACL,OAAO,EACL,eAAe,GAGhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,iBAAiB,GAGlB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,qBAAqB,GAKtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,aAAa,GAId,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generatorインターフェース定義
|
|
3
|
+
*/
|
|
4
|
+
import type { Result, Content, Source } from '@nahisaho/katashiro-core';
|
|
5
|
+
import type { GenerationOptions, Outline, Citation, ChartConfig, PlatformFormat } from './types.js';
|
|
6
|
+
export interface IContentGenerator {
|
|
7
|
+
generate(sources: Source[], options?: GenerationOptions): Promise<Result<Content, Error>>;
|
|
8
|
+
}
|
|
9
|
+
export interface ICitationManager {
|
|
10
|
+
createCitation(source: Source, style?: string): Citation;
|
|
11
|
+
formatReferences(citations: Citation[]): string;
|
|
12
|
+
}
|
|
13
|
+
export interface IOutlineGenerator {
|
|
14
|
+
generate(topic: string, depth?: number): Promise<Result<Outline, Error>>;
|
|
15
|
+
}
|
|
16
|
+
export interface ISummaryGenerator {
|
|
17
|
+
generate(content: Content, maxLength?: number): Promise<Result<string, Error>>;
|
|
18
|
+
}
|
|
19
|
+
export interface ITranslationGenerator {
|
|
20
|
+
translate(content: string, targetLang: string): Promise<Result<string, Error>>;
|
|
21
|
+
}
|
|
22
|
+
export interface IChartGenerator {
|
|
23
|
+
generate(data: unknown, config: ChartConfig): Promise<Result<string, Error>>;
|
|
24
|
+
}
|
|
25
|
+
export interface IPlatformFormatter {
|
|
26
|
+
format(content: Content, platform: PlatformFormat): string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEpG,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CAC3F;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzD,gBAAgB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CAC1E;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;CAChF;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;CAChF;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;CAC9E;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;CAC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,kBAAkB,GACxB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presentation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,GAKtB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PresentationGenerator - Slide deck generation from content
|
|
3
|
+
*
|
|
4
|
+
* Generates presentation slides from analyzed content
|
|
5
|
+
*
|
|
6
|
+
* @module @nahisaho/katashiro-generator
|
|
7
|
+
* @task TSK-032
|
|
8
|
+
*/
|
|
9
|
+
import { type Result, type Content } from '@nahisaho/katashiro-core';
|
|
10
|
+
/**
|
|
11
|
+
* Slide types
|
|
12
|
+
*/
|
|
13
|
+
export type SlideType = 'title' | 'content' | 'section' | 'summary' | 'references' | 'blank';
|
|
14
|
+
/**
|
|
15
|
+
* Slide structure
|
|
16
|
+
*/
|
|
17
|
+
export interface Slide {
|
|
18
|
+
/** Slide number */
|
|
19
|
+
number: number;
|
|
20
|
+
/** Slide type */
|
|
21
|
+
type: SlideType;
|
|
22
|
+
/** Slide title */
|
|
23
|
+
title: string;
|
|
24
|
+
/** Slide subtitle (optional) */
|
|
25
|
+
subtitle?: string;
|
|
26
|
+
/** Bullet points */
|
|
27
|
+
bulletPoints?: string[];
|
|
28
|
+
/** Speaker notes */
|
|
29
|
+
notes?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Presentation structure
|
|
33
|
+
*/
|
|
34
|
+
export interface Presentation {
|
|
35
|
+
/** Presentation title */
|
|
36
|
+
title: string;
|
|
37
|
+
/** Author */
|
|
38
|
+
author?: string;
|
|
39
|
+
/** Creation date */
|
|
40
|
+
date: string;
|
|
41
|
+
/** Slides */
|
|
42
|
+
slides: Slide[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Presentation generation config
|
|
46
|
+
*/
|
|
47
|
+
export interface PresentationConfig {
|
|
48
|
+
/** Maximum bullet points per slide */
|
|
49
|
+
maxBulletPoints?: number;
|
|
50
|
+
/** Include references slide */
|
|
51
|
+
includeReferences?: boolean;
|
|
52
|
+
/** Include summary slide */
|
|
53
|
+
includeSummary?: boolean;
|
|
54
|
+
/** Author name */
|
|
55
|
+
author?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* PresentationGenerator
|
|
59
|
+
*
|
|
60
|
+
* Generates slide presentations from content
|
|
61
|
+
*/
|
|
62
|
+
export declare class PresentationGenerator {
|
|
63
|
+
/**
|
|
64
|
+
* Generate presentation from content
|
|
65
|
+
*
|
|
66
|
+
* @param content - Content to convert
|
|
67
|
+
* @param config - Generation configuration
|
|
68
|
+
* @returns Generated presentation
|
|
69
|
+
*/
|
|
70
|
+
generate(content: Content, config?: PresentationConfig): Promise<Result<Presentation, Error>>;
|
|
71
|
+
/**
|
|
72
|
+
* Convert presentation to Markdown slides format
|
|
73
|
+
*
|
|
74
|
+
* @param presentation - Presentation to convert
|
|
75
|
+
* @returns Markdown string
|
|
76
|
+
*/
|
|
77
|
+
toMarkdownSlides(presentation: Presentation): string;
|
|
78
|
+
/**
|
|
79
|
+
* Get slide count
|
|
80
|
+
*
|
|
81
|
+
* @param presentation - Presentation
|
|
82
|
+
* @returns Number of slides
|
|
83
|
+
*/
|
|
84
|
+
getSlideCount(presentation: Presentation): number;
|
|
85
|
+
/**
|
|
86
|
+
* Estimate presentation duration in minutes
|
|
87
|
+
*
|
|
88
|
+
* @param presentation - Presentation
|
|
89
|
+
* @param minutesPerSlide - Average minutes per slide
|
|
90
|
+
* @returns Estimated duration in minutes
|
|
91
|
+
*/
|
|
92
|
+
estimateDuration(presentation: Presentation, minutesPerSlide?: number): number;
|
|
93
|
+
/**
|
|
94
|
+
* Parse content into sections
|
|
95
|
+
*/
|
|
96
|
+
private parseContent;
|
|
97
|
+
/**
|
|
98
|
+
* Extract bullet points from content
|
|
99
|
+
*/
|
|
100
|
+
private extractBulletPoints;
|
|
101
|
+
/**
|
|
102
|
+
* Generate summary points from sections
|
|
103
|
+
*/
|
|
104
|
+
private generateSummaryPoints;
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=presentation-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-generator.d.ts","sourceRoot":"","sources":["../../src/presentation/presentation-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAW,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,OAAO,GACP,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sCAAsC;IACtC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,4BAA4B;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAYD;;;;GAIG;AACH,qBAAa,qBAAqB;IAChC;;;;;;OAMG;IACG,QAAQ,CACZ,OAAO,EAAE,OAAO,EAChB,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAwFvC;;;;;OAKG;IACH,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM;IA8CpD;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM;IAIjD;;;;;;OAMG;IACH,gBAAgB,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,SAAM,GAAG,MAAM;IAI3E;;OAEG;IACH,OAAO,CAAC,YAAY;IA8CpB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA2B3B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAQ9B"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PresentationGenerator - Slide deck generation from content
|
|
3
|
+
*
|
|
4
|
+
* Generates presentation slides from analyzed content
|
|
5
|
+
*
|
|
6
|
+
* @module @nahisaho/katashiro-generator
|
|
7
|
+
* @task TSK-032
|
|
8
|
+
*/
|
|
9
|
+
import { ok, err } from '@nahisaho/katashiro-core';
|
|
10
|
+
/**
|
|
11
|
+
* Default configuration
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_CONFIG = {
|
|
14
|
+
maxBulletPoints: 5,
|
|
15
|
+
includeReferences: false,
|
|
16
|
+
includeSummary: false,
|
|
17
|
+
author: '',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* PresentationGenerator
|
|
21
|
+
*
|
|
22
|
+
* Generates slide presentations from content
|
|
23
|
+
*/
|
|
24
|
+
export class PresentationGenerator {
|
|
25
|
+
/**
|
|
26
|
+
* Generate presentation from content
|
|
27
|
+
*
|
|
28
|
+
* @param content - Content to convert
|
|
29
|
+
* @param config - Generation configuration
|
|
30
|
+
* @returns Generated presentation
|
|
31
|
+
*/
|
|
32
|
+
async generate(content, config = {}) {
|
|
33
|
+
try {
|
|
34
|
+
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
35
|
+
const slides = [];
|
|
36
|
+
let slideNumber = 1;
|
|
37
|
+
// Title slide
|
|
38
|
+
slides.push({
|
|
39
|
+
number: slideNumber++,
|
|
40
|
+
type: 'title',
|
|
41
|
+
title: content.title,
|
|
42
|
+
subtitle: mergedConfig.author || undefined,
|
|
43
|
+
notes: '発表の開始',
|
|
44
|
+
});
|
|
45
|
+
// Parse content into sections
|
|
46
|
+
const sections = this.parseContent(content.body);
|
|
47
|
+
// Generate content slides
|
|
48
|
+
for (const section of sections) {
|
|
49
|
+
// Section header slide
|
|
50
|
+
if (section.level === 1) {
|
|
51
|
+
slides.push({
|
|
52
|
+
number: slideNumber++,
|
|
53
|
+
type: 'section',
|
|
54
|
+
title: section.title,
|
|
55
|
+
notes: `${section.title}セクションの説明`,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// Content slides
|
|
59
|
+
if (section.content.length > 0) {
|
|
60
|
+
const bulletPoints = this.extractBulletPoints(section.content, mergedConfig.maxBulletPoints);
|
|
61
|
+
if (bulletPoints.length > 0) {
|
|
62
|
+
slides.push({
|
|
63
|
+
number: slideNumber++,
|
|
64
|
+
type: 'content',
|
|
65
|
+
title: section.title,
|
|
66
|
+
bulletPoints,
|
|
67
|
+
notes: section.content.join('\n'),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// Summary slide
|
|
73
|
+
if (mergedConfig.includeSummary) {
|
|
74
|
+
const summaryPoints = this.generateSummaryPoints(sections);
|
|
75
|
+
slides.push({
|
|
76
|
+
number: slideNumber++,
|
|
77
|
+
type: 'summary',
|
|
78
|
+
title: 'まとめ',
|
|
79
|
+
bulletPoints: summaryPoints.slice(0, mergedConfig.maxBulletPoints),
|
|
80
|
+
notes: '本日の発表のまとめ',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// References slide
|
|
84
|
+
if (mergedConfig.includeReferences && content.sources.length > 0) {
|
|
85
|
+
const references = content.sources.map((source) => {
|
|
86
|
+
const title = source.metadata?.title ?? source.url;
|
|
87
|
+
return title;
|
|
88
|
+
});
|
|
89
|
+
slides.push({
|
|
90
|
+
number: slideNumber++,
|
|
91
|
+
type: 'references',
|
|
92
|
+
title: '参考文献',
|
|
93
|
+
bulletPoints: references.slice(0, mergedConfig.maxBulletPoints),
|
|
94
|
+
notes: '参考にした資料一覧',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return ok({
|
|
98
|
+
title: content.title,
|
|
99
|
+
author: mergedConfig.author || undefined,
|
|
100
|
+
date: new Date().toISOString().split('T')[0] ?? '',
|
|
101
|
+
slides,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return err(error instanceof Error ? error : new Error(String(error)));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Convert presentation to Markdown slides format
|
|
110
|
+
*
|
|
111
|
+
* @param presentation - Presentation to convert
|
|
112
|
+
* @returns Markdown string
|
|
113
|
+
*/
|
|
114
|
+
toMarkdownSlides(presentation) {
|
|
115
|
+
const parts = [];
|
|
116
|
+
for (const slide of presentation.slides) {
|
|
117
|
+
parts.push('---');
|
|
118
|
+
parts.push('');
|
|
119
|
+
switch (slide.type) {
|
|
120
|
+
case 'title':
|
|
121
|
+
parts.push(`# ${slide.title}`);
|
|
122
|
+
if (slide.subtitle) {
|
|
123
|
+
parts.push('');
|
|
124
|
+
parts.push(`*${slide.subtitle}*`);
|
|
125
|
+
}
|
|
126
|
+
parts.push('');
|
|
127
|
+
parts.push(`${presentation.date}`);
|
|
128
|
+
break;
|
|
129
|
+
case 'section':
|
|
130
|
+
parts.push(`# ${slide.title}`);
|
|
131
|
+
break;
|
|
132
|
+
case 'content':
|
|
133
|
+
case 'summary':
|
|
134
|
+
case 'references':
|
|
135
|
+
parts.push(`## ${slide.title}`);
|
|
136
|
+
if (slide.bulletPoints) {
|
|
137
|
+
parts.push('');
|
|
138
|
+
slide.bulletPoints.forEach((point) => {
|
|
139
|
+
parts.push(`- ${point}`);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
break;
|
|
143
|
+
case 'blank':
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
parts.push('');
|
|
147
|
+
}
|
|
148
|
+
parts.push('---');
|
|
149
|
+
return parts.join('\n');
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Get slide count
|
|
153
|
+
*
|
|
154
|
+
* @param presentation - Presentation
|
|
155
|
+
* @returns Number of slides
|
|
156
|
+
*/
|
|
157
|
+
getSlideCount(presentation) {
|
|
158
|
+
return presentation.slides.length;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Estimate presentation duration in minutes
|
|
162
|
+
*
|
|
163
|
+
* @param presentation - Presentation
|
|
164
|
+
* @param minutesPerSlide - Average minutes per slide
|
|
165
|
+
* @returns Estimated duration in minutes
|
|
166
|
+
*/
|
|
167
|
+
estimateDuration(presentation, minutesPerSlide = 1.5) {
|
|
168
|
+
return Math.round(presentation.slides.length * minutesPerSlide);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Parse content into sections
|
|
172
|
+
*/
|
|
173
|
+
parseContent(body) {
|
|
174
|
+
const sections = [];
|
|
175
|
+
const lines = body.split('\n');
|
|
176
|
+
let currentSection = {
|
|
177
|
+
level: 0,
|
|
178
|
+
title: '',
|
|
179
|
+
content: [],
|
|
180
|
+
};
|
|
181
|
+
for (const line of lines) {
|
|
182
|
+
// Check for headers
|
|
183
|
+
const h1Match = line.match(/^#\s+(.+)$/);
|
|
184
|
+
const h2Match = line.match(/^##\s+(.+)$/);
|
|
185
|
+
const h3Match = line.match(/^###\s+(.+)$/);
|
|
186
|
+
if (h1Match?.[1]) {
|
|
187
|
+
if (currentSection.title) {
|
|
188
|
+
sections.push(currentSection);
|
|
189
|
+
}
|
|
190
|
+
currentSection = { level: 1, title: h1Match[1], content: [] };
|
|
191
|
+
}
|
|
192
|
+
else if (h2Match?.[1]) {
|
|
193
|
+
if (currentSection.title) {
|
|
194
|
+
sections.push(currentSection);
|
|
195
|
+
}
|
|
196
|
+
currentSection = { level: 2, title: h2Match[1], content: [] };
|
|
197
|
+
}
|
|
198
|
+
else if (h3Match?.[1]) {
|
|
199
|
+
if (currentSection.title) {
|
|
200
|
+
sections.push(currentSection);
|
|
201
|
+
}
|
|
202
|
+
currentSection = { level: 3, title: h3Match[1], content: [] };
|
|
203
|
+
}
|
|
204
|
+
else if (line.trim()) {
|
|
205
|
+
currentSection.content.push(line.trim());
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (currentSection.title) {
|
|
209
|
+
sections.push(currentSection);
|
|
210
|
+
}
|
|
211
|
+
return sections;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Extract bullet points from content
|
|
215
|
+
*/
|
|
216
|
+
extractBulletPoints(content, maxPoints) {
|
|
217
|
+
const points = [];
|
|
218
|
+
for (const line of content) {
|
|
219
|
+
// Check if line is a list item
|
|
220
|
+
const listMatch = line.match(/^[-*]\s+(.+)$/);
|
|
221
|
+
if (listMatch?.[1]) {
|
|
222
|
+
points.push(listMatch[1]);
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
// Convert sentences to points
|
|
226
|
+
const sentences = line.split(/[。.]/);
|
|
227
|
+
for (const sentence of sentences) {
|
|
228
|
+
const trimmed = sentence.trim();
|
|
229
|
+
if (trimmed.length > 5) {
|
|
230
|
+
points.push(trimmed);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (points.length >= maxPoints) {
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return points.slice(0, maxPoints);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Generate summary points from sections
|
|
242
|
+
*/
|
|
243
|
+
generateSummaryPoints(sections) {
|
|
244
|
+
return sections
|
|
245
|
+
.filter((s) => s.level === 1)
|
|
246
|
+
.map((s) => s.title)
|
|
247
|
+
.filter((title) => title && !title.includes('はじめに'));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=presentation-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation-generator.js","sourceRoot":"","sources":["../../src/presentation/presentation-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,EAAE,EAAE,GAAG,EAA6B,MAAM,0BAA0B,CAAC;AA2D9E;;GAEG;AACH,MAAM,cAAc,GAAiC;IACnD,eAAe,EAAE,CAAC;IAClB,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,KAAK;IACrB,MAAM,EAAE,EAAE;CACX,CAAC;AAEF;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAChC;;;;;;OAMG;IACH,KAAK,CAAC,QAAQ,CACZ,OAAgB,EAChB,SAA6B,EAAE;QAE/B,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;YACtD,MAAM,MAAM,GAAY,EAAE,CAAC;YAC3B,IAAI,WAAW,GAAG,CAAC,CAAC;YAEpB,cAAc;YACd,MAAM,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,WAAW,EAAE;gBACrB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ,EAAE,YAAY,CAAC,MAAM,IAAI,SAAS;gBAC1C,KAAK,EAAE,OAAO;aACf,CAAC,CAAC;YAEH,8BAA8B;YAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAA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,CAAC,IAAI,EAAE,CAAC;oBAChC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACvB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACvB,CAAC;gBACH,CAAC;YACH,CAAC;YAED,IAAI,MAAM,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;gBAC/B,MAAM;YACR,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACK,qBAAqB,CAC3B,QAAoE;QAEpE,OAAO,QAAQ;aACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;aAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;aACnB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,YAAY,EACZ,aAAa,GACd,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,eAAe,GAChB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReportGenerator - レポート生成
|
|
3
|
+
*
|
|
4
|
+
* @requirement REQ-GEN-001
|
|
5
|
+
* @design DES-KATASHIRO-001 §2.3 Generator Container
|
|
6
|
+
* @task TSK-030
|
|
7
|
+
*/
|
|
8
|
+
import { type Result, type Content, type Source } from '@nahisaho/katashiro-core';
|
|
9
|
+
/**
|
|
10
|
+
* レポート設定
|
|
11
|
+
*/
|
|
12
|
+
export interface ReportConfig {
|
|
13
|
+
readonly format: 'markdown' | 'html';
|
|
14
|
+
readonly includeTitle?: boolean;
|
|
15
|
+
readonly includeToc?: boolean;
|
|
16
|
+
readonly includeSources?: boolean;
|
|
17
|
+
readonly includeDate?: boolean;
|
|
18
|
+
readonly style?: 'formal' | 'casual' | 'technical';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* レポートセクション
|
|
22
|
+
*/
|
|
23
|
+
export interface ReportSection {
|
|
24
|
+
readonly heading: string;
|
|
25
|
+
readonly level: number;
|
|
26
|
+
readonly content: string;
|
|
27
|
+
readonly subsections?: ReportSection[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* レポート生成実装
|
|
31
|
+
*/
|
|
32
|
+
export declare class ReportGenerator {
|
|
33
|
+
/**
|
|
34
|
+
* レポートを生成
|
|
35
|
+
*/
|
|
36
|
+
generateReport(content: Content, config: ReportConfig): Promise<Result<string, Error>>;
|
|
37
|
+
/**
|
|
38
|
+
* セクションを作成
|
|
39
|
+
*/
|
|
40
|
+
createSection(heading: string, level: number, content: string, subsections?: ReportSection[]): ReportSection;
|
|
41
|
+
/**
|
|
42
|
+
* 目次を生成
|
|
43
|
+
*/
|
|
44
|
+
generateToc(sections: ReportSection[]): string;
|
|
45
|
+
/**
|
|
46
|
+
* ソースをフォーマット
|
|
47
|
+
*/
|
|
48
|
+
formatSources(sources: Source[], format: 'markdown' | 'html'): string;
|
|
49
|
+
/**
|
|
50
|
+
* コンテンツからセクションを抽出
|
|
51
|
+
*/
|
|
52
|
+
private extractSections;
|
|
53
|
+
/**
|
|
54
|
+
* Markdownレポートを生成
|
|
55
|
+
*/
|
|
56
|
+
private generateMarkdown;
|
|
57
|
+
/**
|
|
58
|
+
* HTMLレポートを生成
|
|
59
|
+
*/
|
|
60
|
+
private generateHtml;
|
|
61
|
+
/**
|
|
62
|
+
* Markdownセクションをレンダリング
|
|
63
|
+
*/
|
|
64
|
+
private renderMarkdownSection;
|
|
65
|
+
/**
|
|
66
|
+
* HTMLセクションをレンダリング
|
|
67
|
+
*/
|
|
68
|
+
private renderHtmlSection;
|
|
69
|
+
/**
|
|
70
|
+
* スラグを生成
|
|
71
|
+
*/
|
|
72
|
+
private slugify;
|
|
73
|
+
/**
|
|
74
|
+
* HTMLエスケープ
|
|
75
|
+
*/
|
|
76
|
+
private escapeHtml;
|
|
77
|
+
/**
|
|
78
|
+
* デフォルトスタイル
|
|
79
|
+
*/
|
|
80
|
+
private getDefaultStyles;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=report-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report-generator.d.ts","sourceRoot":"","sources":["../../src/report/report-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAW,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,C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