claude-presentation-master 4.4.1 → 5.0.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.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +17 -7
- package/dist/index.mjs +17 -7
- package/package.json +12 -20
package/dist/index.d.mts
CHANGED
|
@@ -478,6 +478,10 @@ declare class SlideFactory {
|
|
|
478
478
|
* Initialize slide templates with constraints.
|
|
479
479
|
*/
|
|
480
480
|
private initializeTemplates;
|
|
481
|
+
/**
|
|
482
|
+
* Clean text by removing all content markers.
|
|
483
|
+
*/
|
|
484
|
+
private cleanText;
|
|
481
485
|
/**
|
|
482
486
|
* Truncate text to max length at word boundary.
|
|
483
487
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -478,6 +478,10 @@ declare class SlideFactory {
|
|
|
478
478
|
* Initialize slide templates with constraints.
|
|
479
479
|
*/
|
|
480
480
|
private initializeTemplates;
|
|
481
|
+
/**
|
|
482
|
+
* Clean text by removing all content markers.
|
|
483
|
+
*/
|
|
484
|
+
private cleanText;
|
|
481
485
|
/**
|
|
482
486
|
* Truncate text to max length at word boundary.
|
|
483
487
|
*/
|
package/dist/index.js
CHANGED
|
@@ -866,14 +866,22 @@ var SlideFactory = class {
|
|
|
866
866
|
return templates;
|
|
867
867
|
}
|
|
868
868
|
// === Helper Methods ===
|
|
869
|
+
/**
|
|
870
|
+
* Clean text by removing all content markers.
|
|
871
|
+
*/
|
|
872
|
+
cleanText(text) {
|
|
873
|
+
if (!text) return "";
|
|
874
|
+
return text.replace(/\[HEADER\]\s*/g, "").replace(/\[BULLET\]\s*/g, "").replace(/\[NUMBERED\]\s*/g, "").replace(/\[EMPHASIS\]/g, "").replace(/\[\/EMPHASIS\]/g, "").replace(/\[CODE BLOCK\]/g, "").replace(/\[IMAGE\]/g, "").replace(/\s+/g, " ").trim();
|
|
875
|
+
}
|
|
869
876
|
/**
|
|
870
877
|
* Truncate text to max length at word boundary.
|
|
871
878
|
*/
|
|
872
879
|
truncate(text, maxLength) {
|
|
873
|
-
|
|
874
|
-
|
|
880
|
+
const cleanedText = this.cleanText(text);
|
|
881
|
+
if (!cleanedText || cleanedText.length <= maxLength) {
|
|
882
|
+
return cleanedText;
|
|
875
883
|
}
|
|
876
|
-
const truncated =
|
|
884
|
+
const truncated = cleanedText.slice(0, maxLength);
|
|
877
885
|
const lastSpace = truncated.lastIndexOf(" ");
|
|
878
886
|
if (lastSpace > maxLength * 0.7) {
|
|
879
887
|
return truncated.slice(0, lastSpace) + "...";
|
|
@@ -884,11 +892,12 @@ var SlideFactory = class {
|
|
|
884
892
|
* Extract an action title from a message.
|
|
885
893
|
*/
|
|
886
894
|
extractActionTitle(message) {
|
|
887
|
-
const
|
|
895
|
+
const cleanedMessage = this.cleanText(message);
|
|
896
|
+
const firstSentence = cleanedMessage.split(/[.!?]/)[0];
|
|
888
897
|
if (firstSentence && firstSentence.length <= 50) {
|
|
889
898
|
return firstSentence;
|
|
890
899
|
}
|
|
891
|
-
const words =
|
|
900
|
+
const words = cleanedMessage.split(/\s+/).slice(0, 6);
|
|
892
901
|
return words.join(" ");
|
|
893
902
|
}
|
|
894
903
|
/**
|
|
@@ -898,9 +907,10 @@ var SlideFactory = class {
|
|
|
898
907
|
if (!text) return [];
|
|
899
908
|
const bulletMatches = text.match(/\[BULLET\]\s*(.+)/g);
|
|
900
909
|
if (bulletMatches && bulletMatches.length > 0) {
|
|
901
|
-
return bulletMatches.map((b) =>
|
|
910
|
+
return bulletMatches.map((b) => this.cleanText(b)).slice(0, 5);
|
|
902
911
|
}
|
|
903
|
-
const
|
|
912
|
+
const cleanedText = this.cleanText(text);
|
|
913
|
+
const sentences = cleanedText.split(/[.!?]+/).filter((s) => s.trim().length > 10);
|
|
904
914
|
return sentences.slice(0, 5).map((s) => s.trim());
|
|
905
915
|
}
|
|
906
916
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -804,14 +804,22 @@ var SlideFactory = class {
|
|
|
804
804
|
return templates;
|
|
805
805
|
}
|
|
806
806
|
// === Helper Methods ===
|
|
807
|
+
/**
|
|
808
|
+
* Clean text by removing all content markers.
|
|
809
|
+
*/
|
|
810
|
+
cleanText(text) {
|
|
811
|
+
if (!text) return "";
|
|
812
|
+
return text.replace(/\[HEADER\]\s*/g, "").replace(/\[BULLET\]\s*/g, "").replace(/\[NUMBERED\]\s*/g, "").replace(/\[EMPHASIS\]/g, "").replace(/\[\/EMPHASIS\]/g, "").replace(/\[CODE BLOCK\]/g, "").replace(/\[IMAGE\]/g, "").replace(/\s+/g, " ").trim();
|
|
813
|
+
}
|
|
807
814
|
/**
|
|
808
815
|
* Truncate text to max length at word boundary.
|
|
809
816
|
*/
|
|
810
817
|
truncate(text, maxLength) {
|
|
811
|
-
|
|
812
|
-
|
|
818
|
+
const cleanedText = this.cleanText(text);
|
|
819
|
+
if (!cleanedText || cleanedText.length <= maxLength) {
|
|
820
|
+
return cleanedText;
|
|
813
821
|
}
|
|
814
|
-
const truncated =
|
|
822
|
+
const truncated = cleanedText.slice(0, maxLength);
|
|
815
823
|
const lastSpace = truncated.lastIndexOf(" ");
|
|
816
824
|
if (lastSpace > maxLength * 0.7) {
|
|
817
825
|
return truncated.slice(0, lastSpace) + "...";
|
|
@@ -822,11 +830,12 @@ var SlideFactory = class {
|
|
|
822
830
|
* Extract an action title from a message.
|
|
823
831
|
*/
|
|
824
832
|
extractActionTitle(message) {
|
|
825
|
-
const
|
|
833
|
+
const cleanedMessage = this.cleanText(message);
|
|
834
|
+
const firstSentence = cleanedMessage.split(/[.!?]/)[0];
|
|
826
835
|
if (firstSentence && firstSentence.length <= 50) {
|
|
827
836
|
return firstSentence;
|
|
828
837
|
}
|
|
829
|
-
const words =
|
|
838
|
+
const words = cleanedMessage.split(/\s+/).slice(0, 6);
|
|
830
839
|
return words.join(" ");
|
|
831
840
|
}
|
|
832
841
|
/**
|
|
@@ -836,9 +845,10 @@ var SlideFactory = class {
|
|
|
836
845
|
if (!text) return [];
|
|
837
846
|
const bulletMatches = text.match(/\[BULLET\]\s*(.+)/g);
|
|
838
847
|
if (bulletMatches && bulletMatches.length > 0) {
|
|
839
|
-
return bulletMatches.map((b) =>
|
|
848
|
+
return bulletMatches.map((b) => this.cleanText(b)).slice(0, 5);
|
|
840
849
|
}
|
|
841
|
-
const
|
|
850
|
+
const cleanedText = this.cleanText(text);
|
|
851
|
+
const sentences = cleanedText.split(/[.!?]+/).filter((s) => s.trim().length > 10);
|
|
842
852
|
return sentences.slice(0, 5).map((s) => s.trim());
|
|
843
853
|
}
|
|
844
854
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-presentation-master",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Generate world-class presentations using expert methodologies from Duarte, Reynolds, Gallo, and Anderson. Enforces rigorous quality standards through real visual validation.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -12,19 +12,16 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
14
14
|
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
15
|
-
"test": "
|
|
16
|
-
"test:watch": "
|
|
17
|
-
"test:visual": "
|
|
18
|
-
"test:coverage": "
|
|
19
|
-
"test:qa": "vitest run src/__tests__/PPTXValidator.test.ts",
|
|
15
|
+
"test": "jest --passWithNoTests",
|
|
16
|
+
"test:watch": "jest --watch",
|
|
17
|
+
"test:visual": "jest tests/visual",
|
|
18
|
+
"test:coverage": "jest --coverage",
|
|
20
19
|
"lint": "eslint src/**/*.ts",
|
|
21
20
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
22
21
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
23
22
|
"typecheck": "tsc --noEmit",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"qa": "node bin/cli.js validate",
|
|
27
|
-
"qa:strict": "node bin/cli.js validate --threshold 95"
|
|
23
|
+
"prepublishOnly": "npm run build",
|
|
24
|
+
"qa": "node bin/cli.js validate"
|
|
28
25
|
},
|
|
29
26
|
"keywords": [
|
|
30
27
|
"presentation",
|
|
@@ -63,9 +60,7 @@
|
|
|
63
60
|
"node": ">=18.0.0"
|
|
64
61
|
},
|
|
65
62
|
"dependencies": {
|
|
66
|
-
"@ruvector/ruvllm": "^0.2.3",
|
|
67
63
|
"chalk": "^5.3.0",
|
|
68
|
-
"claude-flow": "^2.7.47",
|
|
69
64
|
"color": "^4.2.3",
|
|
70
65
|
"handlebars": "^4.7.8",
|
|
71
66
|
"lodash": "^4.17.21",
|
|
@@ -73,28 +68,25 @@
|
|
|
73
68
|
"natural": "^6.10.0",
|
|
74
69
|
"playwright": "^1.40.0",
|
|
75
70
|
"pptxgenjs": "^3.12.0",
|
|
76
|
-
"ruvector": "^0.1.35",
|
|
77
|
-
"sharp": "^0.34.5",
|
|
78
71
|
"wcag-contrast": "^3.0.0",
|
|
79
72
|
"yaml": "^2.3.4"
|
|
80
73
|
},
|
|
81
74
|
"devDependencies": {
|
|
82
75
|
"@types/color": "^3.0.6",
|
|
83
76
|
"@types/fs-extra": "^11.0.4",
|
|
77
|
+
"@types/jest": "^29.5.11",
|
|
84
78
|
"@types/js-yaml": "^4.0.9",
|
|
85
79
|
"@types/lodash": "^4.14.202",
|
|
86
80
|
"@types/node": "^20.10.0",
|
|
87
|
-
"@types/sharp": "^0.31.1",
|
|
88
81
|
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
89
82
|
"@typescript-eslint/parser": "^6.15.0",
|
|
90
|
-
"@vitest/coverage-v8": "^1.0.0",
|
|
91
|
-
"agentic-flow": "^2.0.1-alpha.5",
|
|
92
83
|
"eslint": "^8.56.0",
|
|
84
|
+
"jest": "^29.7.0",
|
|
85
|
+
"jest-image-snapshot": "^6.4.0",
|
|
93
86
|
"prettier": "^3.1.1",
|
|
94
|
-
"
|
|
87
|
+
"ts-jest": "^29.1.1",
|
|
95
88
|
"tsup": "^8.0.1",
|
|
96
|
-
"typescript": "^5.3.3"
|
|
97
|
-
"vitest": "^1.0.0"
|
|
89
|
+
"typescript": "^5.3.3"
|
|
98
90
|
},
|
|
99
91
|
"peerDependencies": {
|
|
100
92
|
"typescript": ">=5.0.0"
|