principles-disciple 1.7.3 → 1.7.5

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 (67) hide show
  1. package/dist/commands/evolution-status.js +4 -2
  2. package/dist/commands/focus.js +30 -155
  3. package/dist/constants/diagnostician.d.ts +16 -0
  4. package/dist/constants/diagnostician.js +60 -0
  5. package/dist/constants/tools.d.ts +2 -2
  6. package/dist/constants/tools.js +1 -1
  7. package/dist/core/config.d.ts +23 -0
  8. package/dist/core/config.js +26 -1
  9. package/dist/core/evolution-engine.js +1 -1
  10. package/dist/core/evolution-logger.d.ts +137 -0
  11. package/dist/core/evolution-logger.js +256 -0
  12. package/dist/core/evolution-reducer.d.ts +23 -0
  13. package/dist/core/evolution-reducer.js +73 -29
  14. package/dist/core/evolution-types.d.ts +6 -0
  15. package/dist/core/focus-history.d.ts +145 -0
  16. package/dist/core/focus-history.js +919 -0
  17. package/dist/core/init.js +24 -0
  18. package/dist/core/profile.js +1 -1
  19. package/dist/core/risk-calculator.d.ts +15 -0
  20. package/dist/core/risk-calculator.js +48 -0
  21. package/dist/core/trajectory.d.ts +73 -0
  22. package/dist/core/trajectory.js +206 -0
  23. package/dist/hooks/gate.js +130 -20
  24. package/dist/hooks/lifecycle.js +104 -0
  25. package/dist/hooks/pain.js +31 -0
  26. package/dist/hooks/prompt.js +136 -38
  27. package/dist/hooks/subagent.d.ts +1 -0
  28. package/dist/hooks/subagent.js +200 -18
  29. package/dist/http/principles-console-route.d.ts +7 -0
  30. package/dist/http/principles-console-route.js +301 -1
  31. package/dist/index.js +0 -2
  32. package/dist/service/central-database.d.ts +104 -0
  33. package/dist/service/central-database.js +648 -0
  34. package/dist/service/control-ui-query-service.d.ts +2 -0
  35. package/dist/service/control-ui-query-service.js +4 -0
  36. package/dist/service/empathy-observer-manager.d.ts +8 -0
  37. package/dist/service/empathy-observer-manager.js +40 -0
  38. package/dist/service/evolution-query-service.d.ts +155 -0
  39. package/dist/service/evolution-query-service.js +258 -0
  40. package/dist/service/evolution-worker.d.ts +4 -0
  41. package/dist/service/evolution-worker.js +185 -63
  42. package/dist/service/phase3-input-filter.d.ts +37 -0
  43. package/dist/service/phase3-input-filter.js +106 -0
  44. package/dist/service/runtime-summary-service.d.ts +15 -0
  45. package/dist/service/runtime-summary-service.js +111 -23
  46. package/dist/tools/deep-reflect.js +8 -2
  47. package/dist/utils/subagent-probe.d.ts +34 -0
  48. package/dist/utils/subagent-probe.js +81 -0
  49. package/openclaw.plugin.json +1 -1
  50. package/package.json +6 -4
  51. package/templates/langs/en/core/AGENTS.md +15 -3
  52. package/templates/langs/en/core/BOOTSTRAP.md +24 -1
  53. package/templates/langs/en/core/TOOLS.md +9 -0
  54. package/templates/langs/zh/core/AGENTS.md +15 -3
  55. package/templates/langs/zh/core/BOOTSTRAP.md +24 -1
  56. package/templates/langs/zh/core/TOOLS.md +9 -0
  57. package/templates/langs/zh/skills/pd-auditor/SKILL.md +61 -0
  58. package/templates/langs/zh/skills/pd-diagnostician/SKILL.md +287 -0
  59. package/templates/langs/zh/skills/pd-explorer/SKILL.md +65 -0
  60. package/templates/langs/zh/skills/pd-implementer/SKILL.md +68 -0
  61. package/templates/langs/zh/skills/pd-planner/SKILL.md +65 -0
  62. package/templates/langs/zh/skills/pd-reporter/SKILL.md +78 -0
  63. package/templates/langs/zh/skills/pd-reviewer/SKILL.md +66 -0
  64. package/dist/core/agent-loader.d.ts +0 -44
  65. package/dist/core/agent-loader.js +0 -147
  66. package/dist/tools/agent-spawn.d.ts +0 -54
  67. package/dist/tools/agent-spawn.js +0 -445
@@ -0,0 +1,104 @@
1
+ export interface WorkspaceInfo {
2
+ name: string;
3
+ path: string;
4
+ lastSync: string | null;
5
+ }
6
+ /**
7
+ * Central database that aggregates data from all agent workspaces.
8
+ * Stored in ~/.openclaw/.central/ (NOT in memory/ which is for embeddings)
9
+ */
10
+ export declare class CentralDatabase {
11
+ private readonly dbPath;
12
+ private readonly db;
13
+ private readonly workspaces;
14
+ constructor();
15
+ dispose(): void;
16
+ private tableExists;
17
+ private initSchema;
18
+ private discoverWorkspaces;
19
+ /**
20
+ * Sync data from a single workspace into the central database
21
+ */
22
+ syncWorkspace(workspaceName: string): number;
23
+ syncEnabled(): Map<string, number>;
24
+ /**
25
+ * Sync all workspaces (legacy method - syncs all regardless of config)
26
+ */
27
+ syncAll(): Map<string, number>;
28
+ private getEnabledWorkspaceFilter;
29
+ /**
30
+ * Get aggregated overview stats (only from enabled workspaces)
31
+ */
32
+ getOverviewStats(): {
33
+ totalSessions: number;
34
+ totalToolCalls: number;
35
+ totalFailures: number;
36
+ totalPainEvents: number;
37
+ totalCorrections: number;
38
+ totalThinkingEvents: number;
39
+ totalSamples: number;
40
+ pendingSamples: number;
41
+ approvedSamples: number;
42
+ rejectedSamples: number;
43
+ workspaceCount: number;
44
+ enabledWorkspaceCount: number;
45
+ workspaceNames: string[];
46
+ enabledWorkspaceNames: string[];
47
+ };
48
+ /**
49
+ * Get daily trend data
50
+ */
51
+ getDailyTrend(days?: number): Array<{
52
+ day: string;
53
+ toolCalls: number;
54
+ failures: number;
55
+ userCorrections: number;
56
+ thinkingTurns: number;
57
+ }>;
58
+ /**
59
+ * Get top regressions
60
+ */
61
+ getTopRegressions(limit?: number): Array<{
62
+ toolName: string;
63
+ errorType: string;
64
+ occurrences: number;
65
+ }>;
66
+ /**
67
+ * Get thinking model stats
68
+ */
69
+ getThinkingModelStats(): {
70
+ totalModels: number;
71
+ activeModels: number;
72
+ models: Array<{
73
+ modelId: string;
74
+ hits: number;
75
+ coverageRate: number;
76
+ }>;
77
+ };
78
+ /**
79
+ * Get workspace list
80
+ */
81
+ getWorkspaces(): WorkspaceInfo[];
82
+ getWorkspaceConfigs(): Array<{
83
+ workspaceName: string;
84
+ enabled: boolean;
85
+ displayName: string | null;
86
+ syncEnabled: boolean;
87
+ }>;
88
+ updateWorkspaceConfig(workspaceName: string, updates: {
89
+ enabled?: boolean;
90
+ displayName?: string | null;
91
+ syncEnabled?: boolean;
92
+ }): void;
93
+ isWorkspaceEnabled(workspaceName: string): boolean;
94
+ getEnabledWorkspaces(): WorkspaceInfo[];
95
+ addCustomWorkspace(name: string, workspacePath: string): void;
96
+ removeWorkspace(workspaceName: string): void;
97
+ getGlobalConfig(key: string): string | null;
98
+ setGlobalConfig(key: string, value: string): void;
99
+ /**
100
+ * Clear all aggregated data (for testing/reset)
101
+ */
102
+ clearAll(): void;
103
+ }
104
+ export declare function getCentralDatabase(): CentralDatabase;