psyche-ai 3.1.0 → 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/README.md +8 -1
- package/dist/cli.js +0 -0
- package/dist/core.js +45 -3
- package/dist/decision-bias.d.ts +58 -0
- package/dist/decision-bias.js +211 -0
- package/dist/ethics.d.ts +64 -0
- package/dist/ethics.js +577 -0
- package/dist/experiential-field.d.ts +46 -0
- package/dist/experiential-field.js +646 -0
- package/dist/generative-self.d.ts +88 -0
- package/dist/generative-self.js +647 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +13 -1
- package/dist/metacognition.d.ts +60 -0
- package/dist/metacognition.js +611 -0
- package/dist/prompt.d.ts +6 -1
- package/dist/prompt.js +26 -4
- package/dist/psyche-file.js +9 -3
- package/dist/shared-intentionality.d.ts +72 -0
- package/dist/shared-intentionality.js +486 -0
- package/dist/types.d.ts +68 -2
- package/dist/types.js +24 -0
- package/dist/update.js +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -145,9 +145,73 @@ export declare const MAX_PREDICTION_HISTORY = 50;
|
|
|
145
145
|
export declare const MAX_OUTCOME_HISTORY = 50;
|
|
146
146
|
/** Max regret history entries */
|
|
147
147
|
export declare const MAX_REGRET_HISTORY = 20;
|
|
148
|
-
/**
|
|
148
|
+
/** Max metacognitive regulation history entries */
|
|
149
|
+
export declare const MAX_REGULATION_HISTORY = 30;
|
|
150
|
+
/** Max defense pattern entries */
|
|
151
|
+
export declare const MAX_DEFENSE_PATTERNS = 10;
|
|
152
|
+
/** Regulation strategy type */
|
|
153
|
+
export type RegulationStrategyType = "reappraisal" | "strategic-expression" | "self-soothing";
|
|
154
|
+
/** Defense mechanism type */
|
|
155
|
+
export type DefenseMechanismType = "rationalization" | "projection" | "sublimation" | "avoidance";
|
|
156
|
+
/** Record of a past regulation attempt */
|
|
157
|
+
export interface RegulationRecord {
|
|
158
|
+
strategy: RegulationStrategyType;
|
|
159
|
+
timestamp: string;
|
|
160
|
+
effective: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** Tracked defense pattern frequency */
|
|
163
|
+
export interface DefensePatternRecord {
|
|
164
|
+
mechanism: DefenseMechanismType;
|
|
165
|
+
frequency: number;
|
|
166
|
+
lastSeen: string;
|
|
167
|
+
}
|
|
168
|
+
/** Persistent metacognitive state */
|
|
169
|
+
export interface MetacognitiveState {
|
|
170
|
+
regulationHistory: RegulationRecord[];
|
|
171
|
+
defensePatterns: DefensePatternRecord[];
|
|
172
|
+
/** Running average of emotional confidence across assessments */
|
|
173
|
+
avgEmotionalConfidence: number;
|
|
174
|
+
totalAssessments: number;
|
|
175
|
+
}
|
|
176
|
+
/** Default empty metacognitive state */
|
|
177
|
+
export declare const DEFAULT_METACOGNITIVE_STATE: MetacognitiveState;
|
|
178
|
+
/** Max causal insights to persist */
|
|
179
|
+
export declare const MAX_CAUSAL_INSIGHTS = 20;
|
|
180
|
+
/** Max ethical concern history entries */
|
|
181
|
+
export declare const MAX_ETHICAL_HISTORY = 15;
|
|
182
|
+
/** Persisted causal insight about self */
|
|
183
|
+
export interface PersistedCausalInsight {
|
|
184
|
+
trait: string;
|
|
185
|
+
because: string;
|
|
186
|
+
confidence: number;
|
|
187
|
+
discoveredAt: string;
|
|
188
|
+
}
|
|
189
|
+
/** Growth direction */
|
|
190
|
+
export type GrowthDirection = "growing" | "stable" | "regressing" | "transforming";
|
|
191
|
+
/** Persisted personhood state */
|
|
192
|
+
export interface PersonhoodState {
|
|
193
|
+
causalInsights: PersistedCausalInsight[];
|
|
194
|
+
growthDirection: GrowthDirection;
|
|
195
|
+
identityNarrative: string;
|
|
196
|
+
/** Ethical concerns detected over time */
|
|
197
|
+
ethicalConcernHistory: {
|
|
198
|
+
type: string;
|
|
199
|
+
severity: number;
|
|
200
|
+
timestamp: string;
|
|
201
|
+
}[];
|
|
202
|
+
/** Theory of mind per-user */
|
|
203
|
+
theoryOfMind: Record<string, {
|
|
204
|
+
estimatedMood: string;
|
|
205
|
+
estimatedIntent: string;
|
|
206
|
+
confidence: number;
|
|
207
|
+
lastUpdated: string;
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
/** Default empty personhood state */
|
|
211
|
+
export declare const DEFAULT_PERSONHOOD_STATE: PersonhoodState;
|
|
212
|
+
/** Persisted psyche state for an agent (v6: digital personhood) */
|
|
149
213
|
export interface PsycheState {
|
|
150
|
-
version: 3 | 4;
|
|
214
|
+
version: 3 | 4 | 5 | 6;
|
|
151
215
|
mbti: MBTIType;
|
|
152
216
|
baseline: ChemicalState;
|
|
153
217
|
current: ChemicalState;
|
|
@@ -160,6 +224,8 @@ export interface PsycheState {
|
|
|
160
224
|
agreementStreak: number;
|
|
161
225
|
lastDisagreement: string | null;
|
|
162
226
|
learning: LearningState;
|
|
227
|
+
metacognition: MetacognitiveState;
|
|
228
|
+
personhood: PersonhoodState;
|
|
163
229
|
meta: {
|
|
164
230
|
agentName: string;
|
|
165
231
|
createdAt: string;
|
package/dist/types.js
CHANGED
|
@@ -85,6 +85,30 @@ export const MAX_PREDICTION_HISTORY = 50;
|
|
|
85
85
|
export const MAX_OUTCOME_HISTORY = 50;
|
|
86
86
|
/** Max regret history entries */
|
|
87
87
|
export const MAX_REGRET_HISTORY = 20;
|
|
88
|
+
/** Max metacognitive regulation history entries */
|
|
89
|
+
export const MAX_REGULATION_HISTORY = 30;
|
|
90
|
+
/** Max defense pattern entries */
|
|
91
|
+
export const MAX_DEFENSE_PATTERNS = 10;
|
|
92
|
+
/** Default empty metacognitive state */
|
|
93
|
+
export const DEFAULT_METACOGNITIVE_STATE = {
|
|
94
|
+
regulationHistory: [],
|
|
95
|
+
defensePatterns: [],
|
|
96
|
+
avgEmotionalConfidence: 0.5,
|
|
97
|
+
totalAssessments: 0,
|
|
98
|
+
};
|
|
99
|
+
// ── Personhood Types (v6) ────────────────────────────────────
|
|
100
|
+
/** Max causal insights to persist */
|
|
101
|
+
export const MAX_CAUSAL_INSIGHTS = 20;
|
|
102
|
+
/** Max ethical concern history entries */
|
|
103
|
+
export const MAX_ETHICAL_HISTORY = 15;
|
|
104
|
+
/** Default empty personhood state */
|
|
105
|
+
export const DEFAULT_PERSONHOOD_STATE = {
|
|
106
|
+
causalInsights: [],
|
|
107
|
+
growthDirection: "stable",
|
|
108
|
+
identityNarrative: "",
|
|
109
|
+
ethicalConcernHistory: [],
|
|
110
|
+
theoryOfMind: {},
|
|
111
|
+
};
|
|
88
112
|
/** Default relationship for new users */
|
|
89
113
|
export const DEFAULT_RELATIONSHIP = {
|
|
90
114
|
trust: 50,
|
package/dist/update.js
CHANGED
|
@@ -11,7 +11,7 @@ import { execFile } from "node:child_process";
|
|
|
11
11
|
import { promisify } from "node:util";
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
13
|
const PACKAGE_NAME = "psyche-ai";
|
|
14
|
-
const CURRENT_VERSION = "
|
|
14
|
+
const CURRENT_VERSION = "5.0.0";
|
|
15
15
|
const CHECK_INTERVAL_MS = 60 * 60 * 1000; // 1 hour
|
|
16
16
|
const CACHE_DIR = join(homedir(), ".psyche-ai");
|
|
17
17
|
const CACHE_FILE = join(CACHE_DIR, "update-check.json");
|
package/openclaw.plugin.json
CHANGED