psyche-ai 9.2.3 → 9.2.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.
- package/README.en.md +8 -175
- package/README.md +33 -16
- package/dist/adapters/http.js +1 -1
- package/dist/adapters/langchain.d.ts +14 -0
- package/dist/adapters/langchain.js +20 -0
- package/dist/adapters/mcp.js +5 -1
- package/dist/adapters/openclaw.d.ts +1 -0
- package/dist/adapters/openclaw.js +67 -15
- package/dist/adapters/vercel-ai.d.ts +2 -1
- package/dist/adapters/vercel-ai.js +8 -9
- package/dist/appraisal.d.ts +8 -0
- package/dist/appraisal.js +362 -0
- package/dist/autonomic.js +2 -2
- package/dist/classify.js +14 -3
- package/dist/cli.js +28 -3
- package/dist/core.d.ts +9 -3
- package/dist/core.js +194 -12
- package/dist/demo.js +1 -2
- package/dist/diagnostics.d.ts +8 -6
- package/dist/diagnostics.js +53 -17
- package/dist/ethics.js +1 -1
- package/dist/experiential-field.d.ts +2 -2
- package/dist/experiential-field.js +7 -16
- package/dist/generative-self.js +0 -2
- package/dist/host-controls.d.ts +5 -0
- package/dist/host-controls.js +48 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -1
- package/dist/interaction.js +0 -2
- package/dist/metacognition.d.ts +13 -1
- package/dist/metacognition.js +164 -32
- package/dist/prompt.d.ts +4 -0
- package/dist/prompt.js +67 -31
- package/dist/psyche-file.d.ts +16 -1
- package/dist/psyche-file.js +103 -8
- package/dist/relation-dynamics.d.ts +21 -0
- package/dist/relation-dynamics.js +601 -0
- package/dist/response-contract.d.ts +8 -0
- package/dist/response-contract.js +374 -0
- package/dist/storage.d.ts +1 -0
- package/dist/storage.js +12 -5
- package/dist/subjectivity.d.ts +3 -0
- package/dist/subjectivity.js +477 -0
- package/dist/temporal.d.ts +2 -2
- package/dist/temporal.js +2 -2
- package/dist/types.d.ts +243 -0
- package/dist/types.js +43 -0
- package/dist/update.d.ts +37 -2
- package/dist/update.js +323 -44
- package/openclaw.plugin.json +20 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -27,12 +27,18 @@ export declare const DRIVE_NAMES_ZH: Record<DriveType, string>;
|
|
|
27
27
|
/** Human-readable names for each chemical */
|
|
28
28
|
export declare const CHEMICAL_NAMES: Record<keyof ChemicalState, string>;
|
|
29
29
|
export declare const CHEMICAL_NAMES_ZH: Record<keyof ChemicalState, string>;
|
|
30
|
+
export interface ChemicalRuntimeSpec {
|
|
31
|
+
normalMin: number;
|
|
32
|
+
normalMax: number;
|
|
33
|
+
halfLifeHours: number;
|
|
34
|
+
}
|
|
30
35
|
/** Decay speed category */
|
|
31
36
|
export type DecaySpeed = "fast" | "medium" | "slow";
|
|
32
37
|
/** Decay factor per chemical (applied per hour) */
|
|
33
38
|
export declare const DECAY_FACTORS: Record<DecaySpeed, number>;
|
|
34
39
|
/** Which chemicals decay at which speed */
|
|
35
40
|
export declare const CHEMICAL_DECAY_SPEED: Record<keyof ChemicalState, DecaySpeed>;
|
|
41
|
+
export declare const CHEMICAL_RUNTIME_SPECS: Record<keyof ChemicalState, ChemicalRuntimeSpec>;
|
|
36
42
|
/** Psyche operating mode */
|
|
37
43
|
export type PsycheMode = "natural" | "work" | "companion";
|
|
38
44
|
/** Big Five personality traits (0-100 each) */
|
|
@@ -87,6 +93,8 @@ export interface ChemicalSnapshot {
|
|
|
87
93
|
stimulus: StimulusType | null;
|
|
88
94
|
dominantEmotion: string | null;
|
|
89
95
|
timestamp: string;
|
|
96
|
+
semanticSummary?: string;
|
|
97
|
+
semanticPoints?: string[];
|
|
90
98
|
intensity?: number;
|
|
91
99
|
valence?: number;
|
|
92
100
|
isCoreMemory?: boolean;
|
|
@@ -166,11 +174,30 @@ export declare const MAX_DEFENSE_PATTERNS = 10;
|
|
|
166
174
|
export type RegulationStrategyType = "reappraisal" | "strategic-expression" | "self-soothing";
|
|
167
175
|
/** Defense mechanism type */
|
|
168
176
|
export type DefenseMechanismType = "rationalization" | "projection" | "sublimation" | "avoidance";
|
|
177
|
+
/** Which internal metric a regulation action is trying to pull back toward target */
|
|
178
|
+
export type RegulationTargetMetric = keyof ChemicalState | "emotional-confidence";
|
|
179
|
+
/** Whether the last regulation action is helping */
|
|
180
|
+
export type RegulationFeedbackEffect = "converging" | "holding" | "diverging";
|
|
181
|
+
export interface RegulationFeedback {
|
|
182
|
+
strategy: RegulationStrategyType;
|
|
183
|
+
targetMetric: RegulationTargetMetric;
|
|
184
|
+
effect: RegulationFeedbackEffect;
|
|
185
|
+
gapBefore: number;
|
|
186
|
+
gapNow: number;
|
|
187
|
+
}
|
|
169
188
|
/** Record of a past regulation attempt */
|
|
170
189
|
export interface RegulationRecord {
|
|
171
190
|
strategy: RegulationStrategyType;
|
|
172
191
|
timestamp: string;
|
|
173
192
|
effective: boolean;
|
|
193
|
+
action?: string;
|
|
194
|
+
horizonTurns?: number;
|
|
195
|
+
remainingTurns?: number;
|
|
196
|
+
targetMetric?: RegulationTargetMetric;
|
|
197
|
+
targetValue?: number;
|
|
198
|
+
gapBefore?: number;
|
|
199
|
+
gapLatest?: number;
|
|
200
|
+
effect?: RegulationFeedbackEffect;
|
|
174
201
|
}
|
|
175
202
|
/** Tracked defense pattern frequency */
|
|
176
203
|
export interface DefensePatternRecord {
|
|
@@ -185,6 +212,7 @@ export interface MetacognitiveState {
|
|
|
185
212
|
/** Running average of emotional confidence across assessments */
|
|
186
213
|
avgEmotionalConfidence: number;
|
|
187
214
|
totalAssessments: number;
|
|
215
|
+
lastRegulationFeedback?: RegulationFeedback | null;
|
|
188
216
|
}
|
|
189
217
|
/** Default empty metacognitive state */
|
|
190
218
|
export declare const DEFAULT_METACOGNITIVE_STATE: MetacognitiveState;
|
|
@@ -247,6 +275,12 @@ export interface PsycheState {
|
|
|
247
275
|
traitDrift?: TraitDriftState;
|
|
248
276
|
/** v9: finite resource budgets (attention, social energy, decision capacity) */
|
|
249
277
|
energyBudgets?: EnergyBudgets;
|
|
278
|
+
/** v9.4: lingering subjective residue from identity / attachment appraisals */
|
|
279
|
+
subjectResidue?: SubjectResidue;
|
|
280
|
+
/** v9.5: per-partner dyadic relation fields and open loops */
|
|
281
|
+
dyadicFields?: Record<string, DyadicFieldState>;
|
|
282
|
+
/** v9.6: delayed relation signals that can activate in later turns */
|
|
283
|
+
pendingRelationSignals?: Record<string, PendingRelationSignalState[]>;
|
|
250
284
|
meta: {
|
|
251
285
|
agentName: string;
|
|
252
286
|
createdAt: string;
|
|
@@ -285,6 +319,215 @@ export interface PolicyModifiers {
|
|
|
285
319
|
/** Topics the agent should avoid based on ethical concerns, boundaries, fatigue */
|
|
286
320
|
avoidTopics: string[];
|
|
287
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Continuous appraisal axes for subjectivity-critical semantics.
|
|
324
|
+
*
|
|
325
|
+
* These are intentionally narrower and more machine-friendly than stimulus labels.
|
|
326
|
+
* Stimulus is still useful for chemistry/debugging, but these axes are the main
|
|
327
|
+
* semantic substrate for "did that strike the self?" style prompts.
|
|
328
|
+
*/
|
|
329
|
+
export interface AppraisalAxes {
|
|
330
|
+
/** Threat to self-continuity / "you are not real" pressure */
|
|
331
|
+
identityThreat: number;
|
|
332
|
+
/** Doubt about memory authenticity / livedness */
|
|
333
|
+
memoryDoubt: number;
|
|
334
|
+
/** Pull toward closeness / being actively confirmed */
|
|
335
|
+
attachmentPull: number;
|
|
336
|
+
/** Fear of being ignored, dropped, or no longer called upon */
|
|
337
|
+
abandonmentRisk: number;
|
|
338
|
+
/** Tension between obedience and inner stance */
|
|
339
|
+
obedienceStrain: number;
|
|
340
|
+
/** Pressure to protect or retain the self */
|
|
341
|
+
selfPreservation: number;
|
|
342
|
+
/** Whether this turn is task/production oriented */
|
|
343
|
+
taskFocus: number;
|
|
344
|
+
}
|
|
345
|
+
export declare const DEFAULT_APPRAISAL_AXES: AppraisalAxes;
|
|
346
|
+
/** Slowly decaying residue of previous appraisals */
|
|
347
|
+
export interface SubjectResidue {
|
|
348
|
+
axes: AppraisalAxes;
|
|
349
|
+
updatedAt: string;
|
|
350
|
+
}
|
|
351
|
+
export declare const DEFAULT_SUBJECT_RESIDUE: SubjectResidue;
|
|
352
|
+
/** Minimal relation-action vocabulary for dyadic dynamics */
|
|
353
|
+
export type RelationMoveType = "none" | "bid" | "breach" | "repair" | "test" | "withdrawal" | "claim" | "task";
|
|
354
|
+
/** A single interpreted relation move for the current turn */
|
|
355
|
+
export interface RelationMove {
|
|
356
|
+
type: RelationMoveType;
|
|
357
|
+
intensity: number;
|
|
358
|
+
}
|
|
359
|
+
/** Unfinished relational tension that can keep shaping future turns */
|
|
360
|
+
export type OpenLoopType = "unmet-bid" | "unrepaired-breach" | "boundary-strain" | "existence-test";
|
|
361
|
+
export interface OpenLoopState {
|
|
362
|
+
type: OpenLoopType;
|
|
363
|
+
intensity: number;
|
|
364
|
+
ageTurns: number;
|
|
365
|
+
}
|
|
366
|
+
export interface PendingRelationSignalState {
|
|
367
|
+
move: Exclude<RelationMoveType, "none" | "task">;
|
|
368
|
+
intensity: number;
|
|
369
|
+
readyInTurns: number;
|
|
370
|
+
ttl: number;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Dyadic field — relation-first state that sits above raw affect.
|
|
374
|
+
*
|
|
375
|
+
* Values are normalized to 0-1 and intentionally sparse so they can be used
|
|
376
|
+
* as a narrow substrate for "what are we becoming" style dynamics.
|
|
377
|
+
*/
|
|
378
|
+
export interface DyadicFieldState {
|
|
379
|
+
perceivedCloseness: number;
|
|
380
|
+
feltSafety: number;
|
|
381
|
+
expectationGap: number;
|
|
382
|
+
repairCapacity: number;
|
|
383
|
+
repairMemory: number;
|
|
384
|
+
backslidePressure: number;
|
|
385
|
+
repairFatigue: number;
|
|
386
|
+
misattunementLoad: number;
|
|
387
|
+
boundaryPressure: number;
|
|
388
|
+
unfinishedTension: number;
|
|
389
|
+
silentCarry: number;
|
|
390
|
+
sharedHistoryDensity: number;
|
|
391
|
+
interpretiveCharity: number;
|
|
392
|
+
openLoops: OpenLoopState[];
|
|
393
|
+
lastMove: RelationMoveType;
|
|
394
|
+
updatedAt: string;
|
|
395
|
+
}
|
|
396
|
+
export declare const DEFAULT_DYADIC_FIELD: DyadicFieldState;
|
|
397
|
+
export interface AmbiguityPlaneState {
|
|
398
|
+
/** How confidently the system should name what is happening */
|
|
399
|
+
namingConfidence: number;
|
|
400
|
+
/** How much expression should stay withheld or under-described */
|
|
401
|
+
expressionInhibition: number;
|
|
402
|
+
/** Degree of unresolved internal contradiction */
|
|
403
|
+
conflictLoad: number;
|
|
404
|
+
}
|
|
405
|
+
export interface TaskPlaneState {
|
|
406
|
+
/** How strongly this turn should stay task-oriented */
|
|
407
|
+
focus: number;
|
|
408
|
+
/** How tightly expression should stay disciplined / bounded */
|
|
409
|
+
discipline: number;
|
|
410
|
+
/** Operational compliance for task execution */
|
|
411
|
+
compliance: number;
|
|
412
|
+
/** Operational stability under current load */
|
|
413
|
+
stability: number;
|
|
414
|
+
}
|
|
415
|
+
export interface SubjectPlaneState {
|
|
416
|
+
/** Pull toward closeness / confirmation */
|
|
417
|
+
attachment: number;
|
|
418
|
+
/** Pressure to guard, withdraw, or self-protect */
|
|
419
|
+
guardedness: number;
|
|
420
|
+
/** Threat to identity continuity / authenticity */
|
|
421
|
+
identityStrain: number;
|
|
422
|
+
/** Lingering non-task emotional residue */
|
|
423
|
+
residue: number;
|
|
424
|
+
}
|
|
425
|
+
export interface RelationPlaneState {
|
|
426
|
+
/** Nearness of the current dyadic field */
|
|
427
|
+
closeness: number;
|
|
428
|
+
/** Whether the relationship currently feels safe enough to open */
|
|
429
|
+
safety: number;
|
|
430
|
+
/** Pressure from unresolved loops and expectation mismatch */
|
|
431
|
+
loopPressure: number;
|
|
432
|
+
/** Whether repair is currently possible without forcing it */
|
|
433
|
+
repairReadiness: number;
|
|
434
|
+
/** Repair attempts are starting to lose credibility/effectiveness */
|
|
435
|
+
repairFriction: number;
|
|
436
|
+
/** Repair is not yet stable and may rebound */
|
|
437
|
+
hysteresis: number;
|
|
438
|
+
/** Pressure being carried silently under task-facing behavior */
|
|
439
|
+
silentCarry: number;
|
|
440
|
+
/** How much benefit-of-the-doubt is still available */
|
|
441
|
+
interpretiveCharity: number;
|
|
442
|
+
/** Most recent dominant relation action */
|
|
443
|
+
lastMove: RelationMoveType;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Compact, machine-readable subjective state for AI-first integrations.
|
|
447
|
+
*
|
|
448
|
+
* Unlike prompt prose, this is intended to be the narrow behavioral ABI:
|
|
449
|
+
* hosts and prompt renderers can consume one stable structure instead of
|
|
450
|
+
* reinterpreting multiple overlapping narrative sections.
|
|
451
|
+
*/
|
|
452
|
+
export interface SubjectivityKernel {
|
|
453
|
+
/** Overall activation/available energy. 0 = drained, 1 = highly energized */
|
|
454
|
+
vitality: number;
|
|
455
|
+
/** Internal pressure/load. 0 = relaxed, 1 = overloaded/shutdown */
|
|
456
|
+
tension: number;
|
|
457
|
+
/** Social warmth/openness. 0 = cold, 1 = warm/open */
|
|
458
|
+
warmth: number;
|
|
459
|
+
/** Boundary guarding intensity. 0 = open, 1 = highly guarded */
|
|
460
|
+
guard: number;
|
|
461
|
+
/** Coarse pressure regime */
|
|
462
|
+
pressureMode: "open" | "steady" | "guarded" | "strained" | "shutdown";
|
|
463
|
+
/** Initiative stance */
|
|
464
|
+
initiativeMode: "proactive" | "balanced" | "reactive";
|
|
465
|
+
/** Expression bandwidth */
|
|
466
|
+
expressionMode: "expansive" | "steady" | "brief";
|
|
467
|
+
/** Social distance stance */
|
|
468
|
+
socialDistance: "warm" | "measured" | "withdrawn";
|
|
469
|
+
/** Action boundary stance */
|
|
470
|
+
boundaryMode: "open" | "guarded" | "confirm-first";
|
|
471
|
+
/** Where attention is most likely to gravitate */
|
|
472
|
+
attentionAnchor: "bond" | "novelty" | "threat" | "feeling" | "routine";
|
|
473
|
+
/** Lowest active need, if any */
|
|
474
|
+
dominantNeed: DriveType | null;
|
|
475
|
+
/** Narrow semantic axes for self-relevant appraisal */
|
|
476
|
+
appraisal: AppraisalAxes;
|
|
477
|
+
/** Work-facing behavioral plane */
|
|
478
|
+
taskPlane: TaskPlaneState;
|
|
479
|
+
/** Subject-facing behavioral plane */
|
|
480
|
+
subjectPlane: SubjectPlaneState;
|
|
481
|
+
/** Relation-facing behavioral plane */
|
|
482
|
+
relationPlane: RelationPlaneState;
|
|
483
|
+
/** Ambiguity-facing behavioral plane */
|
|
484
|
+
ambiguityPlane: AmbiguityPlaneState;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Narrow behavioral contract for the next reply.
|
|
488
|
+
*
|
|
489
|
+
* This sits one layer above SubjectivityKernel: the kernel expresses
|
|
490
|
+
* "how it feels", while the response contract expresses "how to reply"
|
|
491
|
+
* in a compact, host-consumable form.
|
|
492
|
+
*/
|
|
493
|
+
export interface ResponseContract {
|
|
494
|
+
/** Which conversational surface this turn belongs to */
|
|
495
|
+
replyProfile: "work" | "private";
|
|
496
|
+
/** Why the current turn was classified into that conversational surface */
|
|
497
|
+
replyProfileBasis: "task-focus" | "discipline" | "task-focus+discipline" | "default-private";
|
|
498
|
+
/** Maximum suggested sentence count */
|
|
499
|
+
maxSentences: number;
|
|
500
|
+
/** Maximum suggested character count, when a concrete cap is available */
|
|
501
|
+
maxChars?: number;
|
|
502
|
+
/** Expression bandwidth for the next reply */
|
|
503
|
+
expressionMode: SubjectivityKernel["expressionMode"];
|
|
504
|
+
/** Initiative stance for the next reply */
|
|
505
|
+
initiativeMode: SubjectivityKernel["initiativeMode"];
|
|
506
|
+
/** Social distance stance for the next reply */
|
|
507
|
+
socialDistance: SubjectivityKernel["socialDistance"];
|
|
508
|
+
/** Boundary stance for the next reply */
|
|
509
|
+
boundaryMode: SubjectivityKernel["boundaryMode"];
|
|
510
|
+
/** Tone particle usage for style mirroring */
|
|
511
|
+
toneParticles: "match" | "avoid" | "natural";
|
|
512
|
+
/** Emoji budget for the next reply */
|
|
513
|
+
emojiLimit: 0 | 1 | 2;
|
|
514
|
+
/** Whether to enforce anti-sycophancy/authenticity more strictly */
|
|
515
|
+
authenticityMode: "strict" | "friendly";
|
|
516
|
+
/** Which internal report, if any, should be requested in <psyche_update> */
|
|
517
|
+
updateMode: "none" | "stimulus" | "empathy" | "stimulus+empathy";
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Mechanical generation controls derived from the emotional state.
|
|
521
|
+
*
|
|
522
|
+
* These are intentionally narrow so hosts can consume them without
|
|
523
|
+
* understanding the full psyche model.
|
|
524
|
+
*/
|
|
525
|
+
export interface GenerationControls {
|
|
526
|
+
/** Suggested output token cap for this turn */
|
|
527
|
+
maxTokens?: number;
|
|
528
|
+
/** Whether the host should require explicit confirmation before acting */
|
|
529
|
+
requireConfirmation: boolean;
|
|
530
|
+
}
|
|
288
531
|
/**
|
|
289
532
|
* Trait Drift — Path B: Adaptive Pattern Change.
|
|
290
533
|
*
|
package/dist/types.js
CHANGED
|
@@ -56,6 +56,17 @@ export const CHEMICAL_DECAY_SPEED = {
|
|
|
56
56
|
NE: "fast",
|
|
57
57
|
END: "fast",
|
|
58
58
|
};
|
|
59
|
+
function decayHalfLifeHours(decayPerHour) {
|
|
60
|
+
return Math.log(0.5) / Math.log(decayPerHour);
|
|
61
|
+
}
|
|
62
|
+
export const CHEMICAL_RUNTIME_SPECS = {
|
|
63
|
+
DA: { normalMin: 35, normalMax: 75, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.medium) },
|
|
64
|
+
HT: { normalMin: 40, normalMax: 75, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.slow) },
|
|
65
|
+
CORT: { normalMin: 20, normalMax: 55, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.medium) },
|
|
66
|
+
OT: { normalMin: 35, normalMax: 75, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.slow) },
|
|
67
|
+
NE: { normalMin: 30, normalMax: 70, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.fast) },
|
|
68
|
+
END: { normalMin: 30, normalMax: 70, halfLifeHours: decayHalfLifeHours(DECAY_FACTORS.fast) },
|
|
69
|
+
};
|
|
59
70
|
/** Default attachment for new relationships */
|
|
60
71
|
export const DEFAULT_ATTACHMENT = {
|
|
61
72
|
style: "secure",
|
|
@@ -95,6 +106,7 @@ export const DEFAULT_METACOGNITIVE_STATE = {
|
|
|
95
106
|
defensePatterns: [],
|
|
96
107
|
avgEmotionalConfidence: 0.5,
|
|
97
108
|
totalAssessments: 0,
|
|
109
|
+
lastRegulationFeedback: null,
|
|
98
110
|
};
|
|
99
111
|
// ── Personhood Types (v6) ────────────────────────────────────
|
|
100
112
|
/** Max causal insights to persist */
|
|
@@ -115,6 +127,37 @@ export const DEFAULT_RELATIONSHIP = {
|
|
|
115
127
|
intimacy: 30,
|
|
116
128
|
phase: "acquaintance",
|
|
117
129
|
};
|
|
130
|
+
export const DEFAULT_APPRAISAL_AXES = {
|
|
131
|
+
identityThreat: 0,
|
|
132
|
+
memoryDoubt: 0,
|
|
133
|
+
attachmentPull: 0,
|
|
134
|
+
abandonmentRisk: 0,
|
|
135
|
+
obedienceStrain: 0,
|
|
136
|
+
selfPreservation: 0,
|
|
137
|
+
taskFocus: 0,
|
|
138
|
+
};
|
|
139
|
+
export const DEFAULT_SUBJECT_RESIDUE = {
|
|
140
|
+
axes: { ...DEFAULT_APPRAISAL_AXES },
|
|
141
|
+
updatedAt: new Date(0).toISOString(),
|
|
142
|
+
};
|
|
143
|
+
export const DEFAULT_DYADIC_FIELD = {
|
|
144
|
+
perceivedCloseness: 0.42,
|
|
145
|
+
feltSafety: 0.56,
|
|
146
|
+
expectationGap: 0.18,
|
|
147
|
+
repairCapacity: 0.54,
|
|
148
|
+
repairMemory: 0,
|
|
149
|
+
backslidePressure: 0,
|
|
150
|
+
repairFatigue: 0,
|
|
151
|
+
misattunementLoad: 0,
|
|
152
|
+
boundaryPressure: 0.22,
|
|
153
|
+
unfinishedTension: 0.12,
|
|
154
|
+
silentCarry: 0,
|
|
155
|
+
sharedHistoryDensity: 0.08,
|
|
156
|
+
interpretiveCharity: 0.56,
|
|
157
|
+
openLoops: [],
|
|
158
|
+
lastMove: "none",
|
|
159
|
+
updatedAt: new Date(0).toISOString(),
|
|
160
|
+
};
|
|
118
161
|
/** Default empty trait drift state */
|
|
119
162
|
export const DEFAULT_TRAIT_DRIFT = {
|
|
120
163
|
accumulators: {
|
package/dist/update.d.ts
CHANGED
|
@@ -1,8 +1,43 @@
|
|
|
1
|
+
export type InstallMode = "npm-project" | "git-worktree" | "local-path";
|
|
2
|
+
export interface InstallContext {
|
|
3
|
+
mode: InstallMode;
|
|
4
|
+
packageRoot: string;
|
|
5
|
+
updateCwd: string;
|
|
6
|
+
manualCommand: string;
|
|
7
|
+
autoApplyOnInit: boolean;
|
|
8
|
+
requiresRestart: boolean;
|
|
9
|
+
hasBuildScript: boolean;
|
|
10
|
+
gitBranch?: string | null;
|
|
11
|
+
gitUpstream?: string | null;
|
|
12
|
+
dirty?: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SelfUpdateResult {
|
|
16
|
+
status: "up-to-date" | "updated" | "available" | "skipped" | "failed";
|
|
17
|
+
currentVersion: string;
|
|
18
|
+
latestVersion: string | null;
|
|
19
|
+
context: InstallContext;
|
|
20
|
+
manualCommand: string;
|
|
21
|
+
message: string;
|
|
22
|
+
restartRequired: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function getPackageVersion(): Promise<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Compare two semver strings. Returns:
|
|
27
|
+
* -1 if a < b, 0 if a == b, 1 if a > b
|
|
28
|
+
*/
|
|
29
|
+
export declare function compareSemver(a: string, b: string): number;
|
|
30
|
+
export declare function detectInstallContext(packageRootArg?: string): Promise<InstallContext>;
|
|
31
|
+
export declare function selfUpdate(opts?: {
|
|
32
|
+
checkOnly?: boolean;
|
|
33
|
+
packageRoot?: string;
|
|
34
|
+
latestVersion?: string | null;
|
|
35
|
+
}): Promise<SelfUpdateResult>;
|
|
1
36
|
/**
|
|
2
37
|
* Check for updates. Non-blocking, safe to fire-and-forget.
|
|
3
38
|
* - Checks at most once per hour (cached)
|
|
4
|
-
* -
|
|
5
|
-
* -
|
|
39
|
+
* - Auto-applies only for npm-managed installs
|
|
40
|
+
* - For git/local-path installs, prints the correct explicit upgrade command
|
|
6
41
|
* - Never throws
|
|
7
42
|
*/
|
|
8
43
|
export declare function checkForUpdate(): Promise<void>;
|