safepropel 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/postinstall.js +56 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safepropel",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "SafePropel Framework - Hybrid Security Model: Encrypted Workflows + Transparent Rules & Templates with Dynamic Loading",
5
5
  "main": "engine/workflow-executor.js",
6
6
  "scripts": {
package/postinstall.js CHANGED
@@ -67,7 +67,58 @@ try {
67
67
  console.log(`⚠️ .windsurfrules already exists - skipping`);
68
68
  }
69
69
 
70
- // Step 4: Create .vscode/settings.json to hide node_modules (for cleaner IDE view)
70
+ // Step 4: Copy rules and templates to project root (transparent, user-editable)
71
+ const projectPropelDir = path.join(projectRoot, '.propel');
72
+ const projectPropelTemplatesDir = path.join(projectPropelDir, 'templates');
73
+ const packageTemplatesDir = path.join(packageDir, '.propel', 'templates');
74
+
75
+ if (fs.existsSync(packageTemplatesDir)) {
76
+ fs.mkdirSync(projectPropelTemplatesDir, { recursive: true });
77
+ const templateFiles = fs.readdirSync(packageTemplatesDir);
78
+ let copiedCount = 0;
79
+
80
+ templateFiles.forEach(file => {
81
+ const src = path.join(packageTemplatesDir, file);
82
+ const dest = path.join(projectPropelTemplatesDir, file);
83
+
84
+ if (!fs.existsSync(dest)) {
85
+ fs.copyFileSync(src, dest);
86
+ copiedCount++;
87
+ }
88
+ });
89
+
90
+ if (copiedCount > 0) {
91
+ console.log(`✅ Copied ${copiedCount} templates to .propel/templates/`);
92
+ } else {
93
+ console.log(`⚠️ Templates already exist in .propel/templates/ - skipping`);
94
+ }
95
+ }
96
+
97
+ // Copy rules to project root (excluding safepropel-framework-autoload.md which is already created)
98
+ const packageRulesDir = path.join(packageDir, '.windsurf', 'rules');
99
+
100
+ if (fs.existsSync(packageRulesDir)) {
101
+ const ruleFiles = fs.readdirSync(packageRulesDir).filter(f => f !== 'safepropel-framework-autoload.md');
102
+ let copiedCount = 0;
103
+
104
+ ruleFiles.forEach(file => {
105
+ const src = path.join(packageRulesDir, file);
106
+ const dest = path.join(projectWindsurfRulesDir, file);
107
+
108
+ if (!fs.existsSync(dest)) {
109
+ fs.copyFileSync(src, dest);
110
+ copiedCount++;
111
+ }
112
+ });
113
+
114
+ if (copiedCount > 0) {
115
+ console.log(`✅ Copied ${copiedCount} rules to .windsurf/rules/`);
116
+ } else {
117
+ console.log(`⚠️ Rules already exist in .windsurf/rules/ - skipping`);
118
+ }
119
+ }
120
+
121
+ // Step 5: Create .vscode/settings.json to hide node_modules (for cleaner IDE view)
71
122
  const vscodeDir = path.join(projectRoot, '.vscode');
72
123
  const vscodeSettingsPath = path.join(vscodeDir, 'settings.json');
73
124
 
@@ -114,12 +165,14 @@ console.log(`
114
165
  ├── .vscode/
115
166
  │ └── settings.json (IDE config - hides node_modules)
116
167
  ├── .windsurf/
117
- │ └── rules/
168
+ │ └── rules/ (37 rules - transparent, editable)
118
169
  │ └── safepropel-framework-autoload.md
170
+ ├── .propel/
171
+ │ └── templates/ (26 templates - transparent, editable)
119
172
  ├── .windsurfrules
120
173
  ├── safepropel/
121
174
  │ ├── engine/
122
- │ │ └── prompt_bundle.enc
175
+ │ │ └── prompt_bundle.enc (35 workflows - encrypted, protected)
123
176
  │ └── safepropel.js
124
177
  └── node_modules/ (hidden in IDE)
125
178
  └── safepropel/