psyche-ai 4.0.0 → 5.1.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.
@@ -0,0 +1,88 @@
1
+ import type { PsycheState, ChemicalState, StimulusType, DriveType, Locale } from "./types.js";
2
+ /** A causal link between experience and personality trait */
3
+ export interface CausalInsight {
4
+ /** The observed trait, e.g. "I'm cautious with new people" */
5
+ trait: string;
6
+ /** The causal reason, e.g. "Early interactions involved criticism" */
7
+ because: string;
8
+ /** Supporting evidence from chemical/learning data */
9
+ evidence: string;
10
+ /** Confidence in this insight, 0-1 */
11
+ confidence: number;
12
+ }
13
+ /** A predicted emotional reaction to a hypothetical stimulus */
14
+ export interface SelfPrediction {
15
+ /** The hypothetical stimulus */
16
+ stimulus: StimulusType;
17
+ /** Predicted chemical deltas */
18
+ predictedChemistry: ChemicalState;
19
+ /** Predicted dominant emotion label */
20
+ predictedEmotion: string;
21
+ /** How confident the prediction is, 0-1 */
22
+ confidence: number;
23
+ }
24
+ /** Tracks how personality has evolved over time */
25
+ export interface GrowthArc {
26
+ /** Overall direction of personality evolution */
27
+ direction: "growing" | "stable" | "regressing" | "transforming";
28
+ /** Human-readable description of the growth trajectory */
29
+ description: string;
30
+ /** Per-chemical trend over recent history */
31
+ chemicalTrend: Partial<Record<keyof ChemicalState, "rising" | "falling" | "stable">>;
32
+ /** Per-drive satisfaction trend */
33
+ driveTrend: Partial<Record<DriveType, "more-satisfied" | "less-satisfied" | "stable">>;
34
+ }
35
+ /** An internal conflict between subsystems */
36
+ export interface InternalConflict {
37
+ /** Which subsystems are in tension */
38
+ subsystems: [string, string];
39
+ /** Human-readable description of the conflict */
40
+ description: string;
41
+ /** Severity from 0 (minor tension) to 1 (acute conflict) */
42
+ severity: number;
43
+ }
44
+ /** The complete generative self-model */
45
+ export interface GenerativeSelfModel {
46
+ /** Core identity narrative: who am I and why? */
47
+ identityNarrative: string;
48
+ /** Causal chains: experience -> personality trait */
49
+ causalInsights: CausalInsight[];
50
+ /** Predicted emotional reactions to hypothetical stimuli */
51
+ predictions: SelfPrediction[];
52
+ /** Growth trajectory: how has the self changed? */
53
+ growthArc: GrowthArc;
54
+ /** Internal conflicts: where do my subsystems disagree? */
55
+ conflicts: InternalConflict[];
56
+ }
57
+ /**
58
+ * Compute the generative self-model from the full psyche state.
59
+ *
60
+ * Analyzes emotional history for patterns, extracts causal insights
61
+ * from learning data, builds an identity narrative, predicts reactions,
62
+ * and surfaces internal conflicts.
63
+ */
64
+ export declare function computeGenerativeSelf(state: PsycheState): GenerativeSelfModel;
65
+ /**
66
+ * Predict own emotional reaction to a hypothetical stimulus.
67
+ *
68
+ * Uses learned vectors if available for context, otherwise falls back
69
+ * to the baseline MBTI profile vectors. Returns predicted chemistry,
70
+ * dominant emotion label, and confidence.
71
+ */
72
+ export declare function predictSelfReaction(state: PsycheState, stimulus: StimulusType, locale?: Locale): SelfPrediction;
73
+ /**
74
+ * Detect conflicts between subsystems of the psyche.
75
+ *
76
+ * Examines drive levels, chemical state, attachment data, and
77
+ * self-model for contradictions that create internal tension.
78
+ */
79
+ export declare function detectInternalConflicts(state: PsycheState, locale?: Locale): InternalConflict[];
80
+ /**
81
+ * Generate a 2-3 sentence identity statement from the psyche state.
82
+ *
83
+ * Feels genuine, not clinical:
84
+ * "I'm someone who gets excited by ideas but needs time to process emotions.
85
+ * I've learned to be more cautious with criticism because it hits harder
86
+ * than I expect."
87
+ */
88
+ export declare function buildIdentityNarrative(state: PsycheState, insights: CausalInsight[], growthArc: GrowthArc, locale?: Locale): string;