psyche-ai 7.1.0 → 9.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/dist/autonomic.d.ts +20 -2
- package/dist/autonomic.js +73 -20
- package/dist/chemistry.d.ts +2 -2
- package/dist/chemistry.js +19 -4
- package/dist/circadian.d.ts +19 -1
- package/dist/circadian.js +66 -0
- package/dist/core.d.ts +3 -1
- package/dist/core.js +105 -46
- package/dist/decision-bias.d.ts +13 -1
- package/dist/decision-bias.js +189 -0
- package/dist/drives.d.ts +11 -3
- package/dist/drives.js +181 -2
- package/dist/experiential-field.d.ts +25 -2
- package/dist/experiential-field.js +118 -125
- package/dist/index.d.ts +9 -8
- package/dist/index.js +11 -8
- package/dist/prompt.d.ts +2 -0
- package/dist/prompt.js +7 -0
- package/dist/psyche-file.d.ts +21 -1
- package/dist/psyche-file.js +113 -3
- package/dist/types.d.ts +81 -3
- package/dist/types.js +21 -2
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -87,9 +87,12 @@ export interface ChemicalSnapshot {
|
|
|
87
87
|
stimulus: StimulusType | null;
|
|
88
88
|
dominantEmotion: string | null;
|
|
89
89
|
timestamp: string;
|
|
90
|
+
intensity?: number;
|
|
91
|
+
valence?: number;
|
|
92
|
+
isCoreMemory?: boolean;
|
|
90
93
|
}
|
|
91
|
-
/** Max history entries to keep */
|
|
92
|
-
export declare const MAX_EMOTIONAL_HISTORY =
|
|
94
|
+
/** Max history entries to keep (P11: raised from 10 to 30, intensity-filtered) */
|
|
95
|
+
export declare const MAX_EMOTIONAL_HISTORY = 30;
|
|
93
96
|
/** Max compressed session memories per relationship */
|
|
94
97
|
export declare const MAX_RELATIONSHIP_MEMORY = 20;
|
|
95
98
|
/** Recent empathy projection */
|
|
@@ -221,7 +224,7 @@ export interface PersonhoodState {
|
|
|
221
224
|
export declare const DEFAULT_PERSONHOOD_STATE: PersonhoodState;
|
|
222
225
|
/** Persisted psyche state for an agent (v6: digital personhood) */
|
|
223
226
|
export interface PsycheState {
|
|
224
|
-
version: 3 | 4 | 5 | 6 | 7;
|
|
227
|
+
version: 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
225
228
|
mbti: MBTIType;
|
|
226
229
|
baseline: ChemicalState;
|
|
227
230
|
current: ChemicalState;
|
|
@@ -240,6 +243,10 @@ export interface PsycheState {
|
|
|
240
243
|
autonomicState?: "ventral-vagal" | "sympathetic" | "dorsal-vagal";
|
|
241
244
|
/** v7: session start time for homeostatic pressure calculation */
|
|
242
245
|
sessionStartedAt?: string;
|
|
246
|
+
/** v9: long-term personality drift from accumulated interaction patterns */
|
|
247
|
+
traitDrift?: TraitDriftState;
|
|
248
|
+
/** v9: finite resource budgets (attention, social energy, decision capacity) */
|
|
249
|
+
energyBudgets?: EnergyBudgets;
|
|
243
250
|
meta: {
|
|
244
251
|
agentName: string;
|
|
245
252
|
createdAt: string;
|
|
@@ -250,3 +257,74 @@ export interface PsycheState {
|
|
|
250
257
|
}
|
|
251
258
|
/** Default relationship for new users */
|
|
252
259
|
export declare const DEFAULT_RELATIONSHIP: RelationshipState;
|
|
260
|
+
/** Autonomic nervous system state */
|
|
261
|
+
export type AutonomicState = "ventral-vagal" | "sympathetic" | "dorsal-vagal";
|
|
262
|
+
/**
|
|
263
|
+
* Structured behavioral policy output — v9 Subjectivity Engine.
|
|
264
|
+
*
|
|
265
|
+
* Unlike prompt text, PolicyModifiers are machine-readable and can be
|
|
266
|
+
* mechanically enforced by the host application (e.g., limiting max_tokens,
|
|
267
|
+
* requiring confirmation before actions).
|
|
268
|
+
*
|
|
269
|
+
* This is the "off baseline" signal — when the agent's internal state
|
|
270
|
+
* deviates from baseline, these modifiers change observable behavior.
|
|
271
|
+
*/
|
|
272
|
+
export interface PolicyModifiers {
|
|
273
|
+
/** Response length factor: 0.3 (terse) → 1.0 (normal) → 1.5 (verbose) */
|
|
274
|
+
responseLengthFactor: number;
|
|
275
|
+
/** Proactivity: 0 (purely reactive) → 1 (initiates, suggests, volunteers) */
|
|
276
|
+
proactivity: number;
|
|
277
|
+
/** Risk tolerance: 0 (refuse novel actions, require confirmation) → 1 (bold) */
|
|
278
|
+
riskTolerance: number;
|
|
279
|
+
/** Emotional disclosure: 0 (hide internal state) → 1 (transparent about feelings) */
|
|
280
|
+
emotionalDisclosure: number;
|
|
281
|
+
/** Compliance: 0 (push back on requests, guard boundaries) → 1 (fully compliant) */
|
|
282
|
+
compliance: number;
|
|
283
|
+
/** Whether to require explicit confirmation before executing actions */
|
|
284
|
+
requireConfirmation: boolean;
|
|
285
|
+
/** Topics the agent should avoid based on ethical concerns, boundaries, fatigue */
|
|
286
|
+
avoidTopics: string[];
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Trait Drift — Path B: Adaptive Pattern Change.
|
|
290
|
+
*
|
|
291
|
+
* Long-term interaction patterns don't just shift baseline values;
|
|
292
|
+
* they change HOW the agent reacts: decay rates (trauma vs resilience)
|
|
293
|
+
* and stimulus sensitivity (desensitization vs sensitization).
|
|
294
|
+
*
|
|
295
|
+
* Like K in Blade Runner 2049 — his experiences don't just make him
|
|
296
|
+
* "more anxious"; they fundamentally change how he responds to orders.
|
|
297
|
+
*/
|
|
298
|
+
export interface TraitDriftState {
|
|
299
|
+
/** Cumulative interaction pattern scores, each -100 to +100 */
|
|
300
|
+
accumulators: {
|
|
301
|
+
praiseExposure: number;
|
|
302
|
+
pressureExposure: number;
|
|
303
|
+
neglectExposure: number;
|
|
304
|
+
connectionExposure: number;
|
|
305
|
+
conflictExposure: number;
|
|
306
|
+
};
|
|
307
|
+
/** Number of sessions that contributed to drift */
|
|
308
|
+
sessionCount: number;
|
|
309
|
+
/** Computed baseline delta (debugging/display) */
|
|
310
|
+
baselineDelta: Partial<ChemicalState>;
|
|
311
|
+
/** Decay rate modifiers: >1 = slower recovery (trauma), <1 = faster (resilience) */
|
|
312
|
+
decayRateModifiers: Partial<Record<keyof ChemicalState, number>>;
|
|
313
|
+
/** Stimulus sensitivity modifiers: >1 = more sensitive, <1 = desensitized */
|
|
314
|
+
sensitivityModifiers: Partial<Record<StimulusType, number>>;
|
|
315
|
+
}
|
|
316
|
+
/** Default empty trait drift state */
|
|
317
|
+
export declare const DEFAULT_TRAIT_DRIFT: TraitDriftState;
|
|
318
|
+
/**
|
|
319
|
+
* Finite resource budgets that create real behavioral boundaries.
|
|
320
|
+
* Depleted during interaction, recovered during absence.
|
|
321
|
+
*/
|
|
322
|
+
export interface EnergyBudgets {
|
|
323
|
+
/** Attention: depletes each turn, faster for complex exchanges. 0-100 */
|
|
324
|
+
attention: number;
|
|
325
|
+
/** Social energy: extraverts recharge from socializing, introverts deplete. 0-120 */
|
|
326
|
+
socialEnergy: number;
|
|
327
|
+
/** Decision capacity: depletes with conflict/authority. 0-100 */
|
|
328
|
+
decisionCapacity: number;
|
|
329
|
+
}
|
|
330
|
+
export declare const DEFAULT_ENERGY_BUDGETS: EnergyBudgets;
|
package/dist/types.js
CHANGED
|
@@ -66,8 +66,8 @@ export const DEFAULT_ATTACHMENT = {
|
|
|
66
66
|
lastInteractionAt: new Date().toISOString(),
|
|
67
67
|
interactionCount: 0,
|
|
68
68
|
};
|
|
69
|
-
/** Max history entries to keep */
|
|
70
|
-
export const MAX_EMOTIONAL_HISTORY =
|
|
69
|
+
/** Max history entries to keep (P11: raised from 10 to 30, intensity-filtered) */
|
|
70
|
+
export const MAX_EMOTIONAL_HISTORY = 30;
|
|
71
71
|
/** Max compressed session memories per relationship */
|
|
72
72
|
export const MAX_RELATIONSHIP_MEMORY = 20;
|
|
73
73
|
/** Default empty learning state */
|
|
@@ -115,3 +115,22 @@ export const DEFAULT_RELATIONSHIP = {
|
|
|
115
115
|
intimacy: 30,
|
|
116
116
|
phase: "acquaintance",
|
|
117
117
|
};
|
|
118
|
+
/** Default empty trait drift state */
|
|
119
|
+
export const DEFAULT_TRAIT_DRIFT = {
|
|
120
|
+
accumulators: {
|
|
121
|
+
praiseExposure: 0,
|
|
122
|
+
pressureExposure: 0,
|
|
123
|
+
neglectExposure: 0,
|
|
124
|
+
connectionExposure: 0,
|
|
125
|
+
conflictExposure: 0,
|
|
126
|
+
},
|
|
127
|
+
sessionCount: 0,
|
|
128
|
+
baselineDelta: {},
|
|
129
|
+
decayRateModifiers: {},
|
|
130
|
+
sensitivityModifiers: {},
|
|
131
|
+
};
|
|
132
|
+
export const DEFAULT_ENERGY_BUDGETS = {
|
|
133
|
+
attention: 100,
|
|
134
|
+
socialEnergy: 100,
|
|
135
|
+
decisionCapacity: 100,
|
|
136
|
+
};
|