principles-disciple 1.50.0 → 1.51.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.
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
5
- "version": "1.50.0",
5
+ "version": "1.51.0",
6
6
  "skills": [
7
7
  "./skills"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "1.50.0",
3
+ "version": "1.51.0",
4
4
  "description": "Native OpenClaw plugin for Principles Disciple",
5
5
  "type": "module",
6
6
  "main": "./dist/bundle.js",
package/src/core/init.ts CHANGED
@@ -6,6 +6,7 @@ import { PD_DIRS } from './paths.js';
6
6
  import { defaultContextConfig } from '../types.js';
7
7
  import { loadStore, setPrincipleState, type PrincipleTrainingState } from './principle-training-state.js';
8
8
  import { atomicWriteFileSync } from '../utils/io.js';
9
+ import { createDefaultKeywordStore, saveKeywordStore } from './empathy-keyword-matcher.js';
9
10
 
10
11
  /**
11
12
  * Default PROFILE.json content
@@ -245,6 +246,17 @@ export function ensureStateTemplates(ctx: { logger: PluginLogger }, stateDir: st
245
246
  fs.copyFileSync(dictTemplate, dictDest);
246
247
  ctx.logger.info(`[PD] Initialized pain dictionary in stateDir: ${dictDest} (Lang: ${language})`);
247
248
  }
249
+
250
+ // 3. Initialize empathy keyword store for new users
251
+ // loadKeywordStore() creates the file if missing, but we call it explicitly
252
+ // here so the file exists before any agent/workflow tries to read it
253
+ const empathyFile = path.join(stateDir, 'empathy_keywords.json');
254
+ if (!fs.existsSync(empathyFile)) {
255
+ const lang = language === 'zh' || language === 'en' ? language : 'en';
256
+ const store = createDefaultKeywordStore(lang);
257
+ saveKeywordStore(stateDir, store);
258
+ ctx.logger.info(`[PD] Initialized empathy keyword store in stateDir: ${empathyFile}`);
259
+ }
248
260
  } catch (err) {
249
261
  ctx.logger.error(`[PD] Failed to initialize state templates: ${String(err)}`);
250
262
  }