create-principles-disciple 1.109.0 → 1.111.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.
Files changed (79) hide show
  1. package/console/dist/server/config/pd-config-store.d.ts +29 -0
  2. package/console/dist/server/config/pd-config-store.js +55 -0
  3. package/console/dist/server/feedback/channels.d.ts +36 -0
  4. package/console/dist/server/feedback/channels.js +89 -0
  5. package/console/dist/server/feedback/github-adapter.d.ts +44 -0
  6. package/console/dist/server/feedback/github-adapter.js +125 -0
  7. package/console/dist/server/feedback/ingest-adapter.d.ts +45 -0
  8. package/console/dist/server/feedback/ingest-adapter.js +129 -0
  9. package/console/dist/server/feedback/submit-service.d.ts +44 -0
  10. package/console/dist/server/feedback/submit-service.js +177 -0
  11. package/console/dist/server/index.js +23 -7
  12. package/console/dist/server/models/FeedbackReportConsoleModel.d.ts +8 -0
  13. package/console/dist/server/models/FeedbackReportConsoleModel.js +45 -0
  14. package/console/dist/server/routes/feedback-reports.d.ts +24 -0
  15. package/console/dist/server/routes/feedback-reports.js +151 -0
  16. package/console/dist/ui/api.d.ts +11 -3
  17. package/console/dist/ui/api.js +25 -2
  18. package/console/dist/ui/i18n/en.json +48 -2
  19. package/console/dist/ui/i18n/zh-CN.json +48 -2
  20. package/console/dist/ui/pages/ReportProblemValidators.d.ts +30 -0
  21. package/console/dist/ui/pages/ReportProblemValidators.js +66 -0
  22. package/console/dist/ui/pages/activation/ActivationPage.js +14 -3
  23. package/console/dist/ui/pages/pain/PainPage.js +6 -1
  24. package/console/dist/ui/pages/principles/PrincipleDetailPage.js +4 -1
  25. package/console/dist/ui/pages/report-problem/ReportProblemPage.js +263 -70
  26. package/console/dist/ui/utils/validators.d.ts +22 -0
  27. package/console/dist/ui/utils/validators.js +66 -0
  28. package/console/dist/web/assets/app.css +42 -0
  29. package/console/dist/web/assets/app.js +699 -127
  30. package/console/package.json +4 -4
  31. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +4 -0
  32. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  33. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js +1 -1
  34. package/core/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  35. package/core/dist/runtime-v2/feedback/__tests__/fingerprint.test.d.ts +2 -0
  36. package/core/dist/runtime-v2/feedback/__tests__/fingerprint.test.d.ts.map +1 -0
  37. package/core/dist/runtime-v2/feedback/__tests__/fingerprint.test.js +126 -0
  38. package/core/dist/runtime-v2/feedback/__tests__/fingerprint.test.js.map +1 -0
  39. package/core/dist/runtime-v2/feedback/__tests__/slice1-typed-fields.test.d.ts +2 -0
  40. package/core/dist/runtime-v2/feedback/__tests__/slice1-typed-fields.test.d.ts.map +1 -0
  41. package/core/dist/runtime-v2/feedback/__tests__/slice1-typed-fields.test.js +278 -0
  42. package/core/dist/runtime-v2/feedback/__tests__/slice1-typed-fields.test.js.map +1 -0
  43. package/core/dist/runtime-v2/feedback/create-report.d.ts.map +1 -1
  44. package/core/dist/runtime-v2/feedback/create-report.js +38 -1
  45. package/core/dist/runtime-v2/feedback/create-report.js.map +1 -1
  46. package/core/dist/runtime-v2/feedback/feedback-types.d.ts +60 -0
  47. package/core/dist/runtime-v2/feedback/feedback-types.d.ts.map +1 -1
  48. package/core/dist/runtime-v2/feedback/feedback-types.js +58 -0
  49. package/core/dist/runtime-v2/feedback/feedback-types.js.map +1 -1
  50. package/core/dist/runtime-v2/feedback/fingerprint.d.ts +31 -0
  51. package/core/dist/runtime-v2/feedback/fingerprint.d.ts.map +1 -0
  52. package/core/dist/runtime-v2/feedback/fingerprint.js +51 -0
  53. package/core/dist/runtime-v2/feedback/fingerprint.js.map +1 -0
  54. package/core/dist/runtime-v2/feedback/index.d.ts +3 -2
  55. package/core/dist/runtime-v2/feedback/index.d.ts.map +1 -1
  56. package/core/dist/runtime-v2/feedback/index.js +2 -1
  57. package/core/dist/runtime-v2/feedback/index.js.map +1 -1
  58. package/core/dist/runtime-v2/feedback/privacy-preview.d.ts.map +1 -1
  59. package/core/dist/runtime-v2/feedback/privacy-preview.js +43 -0
  60. package/core/dist/runtime-v2/feedback/privacy-preview.js.map +1 -1
  61. package/core/dist/runtime-v2/feedback/render-markdown.d.ts.map +1 -1
  62. package/core/dist/runtime-v2/feedback/render-markdown.js +33 -0
  63. package/core/dist/runtime-v2/feedback/render-markdown.js.map +1 -1
  64. package/core/dist/runtime-v2/index.d.ts +2 -2
  65. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  66. package/core/dist/runtime-v2/index.js +1 -1
  67. package/core/dist/runtime-v2/index.js.map +1 -1
  68. package/dist/installer.d.ts.map +1 -1
  69. package/dist/installer.js.map +1 -1
  70. package/dist/mvp-config.d.ts +22 -1
  71. package/dist/mvp-config.d.ts.map +1 -1
  72. package/dist/mvp-config.js +36 -1
  73. package/dist/mvp-config.js.map +1 -1
  74. package/package.json +1 -1
  75. package/plugin/dist/bundle.js +302 -302
  76. package/plugin/dist/openclaw.plugin.json +1 -18
  77. package/plugin/openclaw.plugin.json +2 -19
  78. package/plugin/package.json +3 -3
  79. package/plugin/scripts/sync-plugin.mjs +34 -33
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
- "description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
4
+ "description": "Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
5
  "version": "1.198.1",
6
6
  "activation": {
7
7
  "onCapabilities": [
@@ -43,22 +43,5 @@
43
43
  "description": "自定义高危目录(例如 .git/, prod_db/)。AI 试图修改这些目录前,将被强制拦截并要求出具安全计划。"
44
44
  }
45
45
  }
46
- },
47
- "uiHints": {
48
- "language": {
49
- "label": "交互语言"
50
- },
51
- "auditLevel": {
52
- "label": "防爆拦截级别",
53
- "placeholder": "medium"
54
- },
55
- "riskPaths": {
56
- "label": "⚠️ 绝对高危目录 (空表示不设限)"
57
- }
58
- },
59
- "buildFingerprint": {
60
- "gitSha": "f9dc8b9f7aec",
61
- "bundleMd5": "5e78aea084b9afac6f064b13f4137ebb",
62
- "builtAt": "2026-07-04T22:43:12.642Z"
63
46
  }
64
47
  }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
- "description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
5
- "version": "1.208.0",
4
+ "description": "Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
+ "version": "1.209.0",
6
6
  "activation": {
7
7
  "onCapabilities": [
8
8
  "hook"
@@ -43,22 +43,5 @@
43
43
  "description": "自定义高危目录(例如 .git/, prod_db/)。AI 试图修改这些目录前,将被强制拦截并要求出具安全计划。"
44
44
  }
45
45
  }
46
- },
47
- "uiHints": {
48
- "language": {
49
- "label": "交互语言"
50
- },
51
- "auditLevel": {
52
- "label": "防爆拦截级别",
53
- "placeholder": "medium"
54
- },
55
- "riskPaths": {
56
- "label": "⚠️ 绝对高危目录 (空表示不设限)"
57
- }
58
- },
59
- "buildFingerprint": {
60
- "gitSha": "f9dc8b9f7aec",
61
- "bundleMd5": "5e78aea084b9afac6f064b13f4137ebb",
62
- "builtAt": "2026-07-04T22:43:12.642Z"
63
46
  }
64
47
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "1.208.0",
4
- "description": "Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles. Stop correcting the same AI behavior across sessions.",
3
+ "version": "1.209.0",
4
+ "description": "Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -80,7 +80,7 @@
80
80
  "@typescript-eslint/parser": "^8.58.0",
81
81
  "@vitest/coverage-v8": "^4.1.9",
82
82
  "esbuild": "^0.28.1",
83
- "eslint": "^10.5.0",
83
+ "eslint": "^10.8.1",
84
84
  "jsdom": "^30.0.1",
85
85
  "typescript": "^7.0.2",
86
86
  "vite": "^8.0.16",
@@ -464,11 +464,15 @@ function verifyBundleContents() {
464
464
 
465
465
  /**
466
466
  * Write a build fingerprint.
467
+ *
468
+ * The fingerprint is PD-internal metadata and lives in
469
+ * dist/build-fingerprint.json — NOT inside openclaw.plugin.json. Unknown
470
+ * top-level manifest fields are rejected by ClawHub / OpenClaw manifest
471
+ * validation (manifest-unknown-fields warning).
467
472
  */
468
473
  function writeBuildFingerprint() {
469
474
  const bundleJs = join(SOURCE_DIR, 'dist', 'bundle.js');
470
- const manifestSrc = join(SOURCE_DIR, 'openclaw.plugin.json');
471
- const manifestDist = join(SOURCE_DIR, 'dist', 'openclaw.plugin.json');
475
+ const fingerprintPath = join(SOURCE_DIR, 'dist', 'build-fingerprint.json');
472
476
 
473
477
  let gitSha = 'unknown';
474
478
  try {
@@ -489,19 +493,8 @@ function writeBuildFingerprint() {
489
493
  console.warn('⚠️ Could not compute bundle MD5');
490
494
  }
491
495
 
492
- let manifest;
493
- try {
494
- manifest = JSON.parse(readFileSync(manifestDist, 'utf-8'));
495
- } catch {
496
- try {
497
- manifest = JSON.parse(readFileSync(manifestSrc, 'utf-8'));
498
- } catch {
499
- console.warn('⚠️ Could not read openclaw.plugin.json');
500
- return;
501
- }
502
- }
503
-
504
- manifest.buildFingerprint = {
496
+ const fingerprint = {
497
+ pluginId: 'principles-disciple',
505
498
  gitSha,
506
499
  bundleMd5,
507
500
  builtAt: new Date().toISOString(),
@@ -509,7 +502,7 @@ function writeBuildFingerprint() {
509
502
 
510
503
  try {
511
504
  mkdirSync(join(SOURCE_DIR, 'dist'), { recursive: true });
512
- writeFileAtomic(manifestDist, JSON.stringify(manifest, null, 2) + '\n');
505
+ writeFileAtomic(fingerprintPath, JSON.stringify(fingerprint, null, 2) + '\n');
513
506
  console.log(`✅ Build fingerprint: git=${gitSha} bundleMd5=${bundleMd5}`);
514
507
  } catch (err) {
515
508
  console.warn(`⚠️ Could not write fingerprint: ${err.message}`);
@@ -530,33 +523,41 @@ function writeFileAtomic(filePath, content) {
530
523
 
531
524
  /**
532
525
  * Verify installed fingerprint.
526
+ *
527
+ * Compares the PD-internal sidecars dist/build-fingerprint.json in source
528
+ * and install dirs. The sidecar travels with the dist/ sync item, so after
529
+ * a full sync both sides exist and must match; a mismatch means the
530
+ * installed copy is stale.
533
531
  */
534
532
  function verifyInstalledFingerprint() {
535
- const sourceManifest = join(SOURCE_DIR, 'dist', 'openclaw.plugin.json');
536
- const installedManifest = join(INSTALL_DIR, 'dist', 'openclaw.plugin.json');
533
+ const sourceFpPath = join(SOURCE_DIR, 'dist', 'build-fingerprint.json');
534
+ const installedFpPath = join(INSTALL_DIR, 'dist', 'build-fingerprint.json');
537
535
 
538
- if (!existsSync(installedManifest)) {
539
- console.error('\n❌ Installed manifest not found.');
536
+ if (!existsSync(installedFpPath)) {
537
+ console.error('\n❌ Installed fingerprint not found — dist sync incomplete.');
540
538
  process.exit(1);
541
539
  }
542
540
 
541
+ if (!existsSync(sourceFpPath)) {
542
+ console.warn('⚠️ Source build fingerprint missing — staleness check skipped.');
543
+ console.warn(' Run a full build (drop --skip-build) to regenerate dist/build-fingerprint.json.');
544
+ return;
545
+ }
546
+
543
547
  try {
544
- const sm = JSON.parse(readFileSync(sourceManifest, 'utf-8'));
545
- const im = JSON.parse(readFileSync(installedManifest, 'utf-8'));
546
- const sourceFp = sm.buildFingerprint;
547
- const installedFp = im.buildFingerprint;
548
+ const sourceFp = JSON.parse(readFileSync(sourceFpPath, 'utf-8'));
549
+ const installedFp = JSON.parse(readFileSync(installedFpPath, 'utf-8'));
548
550
 
549
- if (sourceFp && installedFp) {
550
- const gitMismatch = sourceFp.gitSha !== installedFp.gitSha;
551
- const md5Mismatch = sourceFp.bundleMd5 !== installedFp.bundleMd5;
551
+ const gitMismatch = sourceFp.gitSha !== installedFp.gitSha;
552
+ const md5Mismatch = sourceFp.bundleMd5 !== installedFp.bundleMd5;
552
553
 
553
- if (gitMismatch || md5Mismatch) {
554
- console.error('\n❌ INSTALLED PLUGIN IS STALE — FINGERPRINT MISMATCH');
555
- process.exit(1);
556
- }
554
+ if (gitMismatch || md5Mismatch) {
555
+ console.error('\n❌ INSTALLED PLUGIN IS STALE — FINGERPRINT MISMATCH');
556
+ process.exit(1);
557
557
  }
558
- } catch {
559
- console.warn('⚠️ Fingerprint verification skipped');
558
+ } catch (err) {
559
+ console.warn(`⚠️ Fingerprint verification skipped: ${err.message}`);
560
+ return;
560
561
  }
561
562
 
562
563
  console.log('✅ Installed fingerprint verified');