@backbay/glia-agent 0.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.
- package/dist/audio.d.ts +163 -0
- package/dist/audio.js +39 -0
- package/dist/audio.js.map +1 -0
- package/dist/chunk-LLOGBVQT.js +445 -0
- package/dist/chunk-LLOGBVQT.js.map +1 -0
- package/dist/chunk-VU2XK2NI.js +583 -0
- package/dist/chunk-VU2XK2NI.js.map +1 -0
- package/dist/chunk-XE2IVCKJ.js +743 -0
- package/dist/chunk-XE2IVCKJ.js.map +1 -0
- package/dist/cognition.d.ts +742 -0
- package/dist/cognition.js +25 -0
- package/dist/cognition.js.map +1 -0
- package/dist/emotion.d.ts +288 -0
- package/dist/emotion.js +53 -0
- package/dist/emotion.js.map +1 -0
- package/dist/httpSpeechSynthesisProvider-CIR7L2Zr.d.ts +1698 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/types-B0jyNVTH.d.ts +85 -0
- package/dist/types-CRp9rbx0.d.ts +125 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { A as AVO, a as AVODimensions, b as AnchorState, E as EasingFunction, c as EmotionEvent, L as LegacyGlyphState, M as MicroExpressionConfig, T as TransitionOptions, V as VisualState } from './types-B0jyNVTH.js';
|
|
2
|
+
export { ANCHOR_STATES, DEFAULT_AVO, DEFAULT_MICRO_CONFIG, DEFAULT_TRANSITION_DURATIONS, EmotionController, EmotionControllerOptions, LEGACY_STATE_MAP, UseEmotionOptions, UseEmotionResult, applyMicroExpression, avoDistance, blendAVO, clampAVO, computeVisualState, createMicroExpressionAnimator, createNoiseGenerator, ease, getAnimationWeights, getTransitionConfig, getTransitionDuration, getTransitionEasing, isValidAVO, lerp, mapArousal, mapOpenness, mapValence, useEmotion } from './emotion.js';
|
|
3
|
+
export { C as CognitionEvent, a as CognitionSignals, b as CognitionSnapshot, c as CognitionState, d as CognitiveMode, e as CognitiveSubmode, D as DetailedBalance, f as DynamicsState, P as PersonaSignals, g as PersonalityConfig, h as PolicyConfig, T as TrapWarning, i as createInitialCognitionState } from './types-CRp9rbx0.js';
|
|
4
|
+
export { CognitionController, CognitionControllerOptions, CognitionSnapshotInput, CognitionSnapshotOutput, CognitionSnapshotSchema, CognitionSnapshotValidationResult, CognitionStateSchema, MODE_TRANSITION_MAP, UseCognitionOptions, UseCognitionResult, reduceDecay, reduceEvent, useCognition, validateCognitionSnapshot } from './cognition.js';
|
|
5
|
+
export { A as AudioArtifact, a as AudioFormat, b as AudioFormatSchema, c as AudioGateResult, d as AudioGates, e as AudioPlannerCognitionInput, f as AudioPlannerInput, g as AudioPlannerMode, h as AudioPlannerSignals, i as AudioPolicy, j as AudioProof, k as AudioProofInput, l as AudioProofOutput, m as AudioProofSchema, n as AudioProofValidationResult, o as AudioVerifier, D as DEFAULT_OVERLAY_PHRASES, H as HttpSpeechSynthesisProvider, p as HttpSpeechSynthesisProviderOptions, q as HttpSynthesisResponse, O as OverlayPhraseLibrary, r as OverlayToken, S as SpeechControls, s as SpeechSynthesisProvider, t as SpeechSynthesisRequest, u as SpeechSynthesisResult, V as VoiceCatalog, v as VoiceCatalogEntry, w as VoiceLicenseCategory, x as VoiceLicenseCategorySchema, y as pickOverlayPhrase, z as planSpeech, B as planSpeechFromCognition, C as validateAudioProof } from './httpSpeechSynthesisProvider-CIR7L2Zr.js';
|
|
6
|
+
import 'zod';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ANCHOR_STATES,
|
|
3
|
+
DEFAULT_AVO,
|
|
4
|
+
DEFAULT_MICRO_CONFIG,
|
|
5
|
+
DEFAULT_TRANSITION_DURATIONS,
|
|
6
|
+
EmotionController,
|
|
7
|
+
LEGACY_STATE_MAP,
|
|
8
|
+
applyMicroExpression,
|
|
9
|
+
avoDistance,
|
|
10
|
+
blendAVO,
|
|
11
|
+
clampAVO,
|
|
12
|
+
computeVisualState,
|
|
13
|
+
createMicroExpressionAnimator,
|
|
14
|
+
createNoiseGenerator,
|
|
15
|
+
ease,
|
|
16
|
+
getAnimationWeights,
|
|
17
|
+
getTransitionConfig,
|
|
18
|
+
getTransitionDuration,
|
|
19
|
+
getTransitionEasing,
|
|
20
|
+
isValidAVO,
|
|
21
|
+
lerp,
|
|
22
|
+
mapArousal,
|
|
23
|
+
mapOpenness,
|
|
24
|
+
mapValence,
|
|
25
|
+
useEmotion
|
|
26
|
+
} from "./chunk-VU2XK2NI.js";
|
|
27
|
+
import {
|
|
28
|
+
CognitionController,
|
|
29
|
+
CognitionSnapshotSchema,
|
|
30
|
+
CognitionStateSchema,
|
|
31
|
+
MODE_TRANSITION_MAP,
|
|
32
|
+
createInitialCognitionState,
|
|
33
|
+
reduceDecay,
|
|
34
|
+
reduceEvent,
|
|
35
|
+
useCognition,
|
|
36
|
+
validateCognitionSnapshot
|
|
37
|
+
} from "./chunk-LLOGBVQT.js";
|
|
38
|
+
import {
|
|
39
|
+
AudioFormatSchema,
|
|
40
|
+
AudioProofSchema,
|
|
41
|
+
DEFAULT_OVERLAY_PHRASES,
|
|
42
|
+
HttpSpeechSynthesisProvider,
|
|
43
|
+
VoiceLicenseCategorySchema,
|
|
44
|
+
pickOverlayPhrase,
|
|
45
|
+
planSpeech,
|
|
46
|
+
planSpeechFromCognition,
|
|
47
|
+
validateAudioProof
|
|
48
|
+
} from "./chunk-XE2IVCKJ.js";
|
|
49
|
+
export {
|
|
50
|
+
ANCHOR_STATES,
|
|
51
|
+
AudioFormatSchema,
|
|
52
|
+
AudioProofSchema,
|
|
53
|
+
CognitionController,
|
|
54
|
+
CognitionSnapshotSchema,
|
|
55
|
+
CognitionStateSchema,
|
|
56
|
+
DEFAULT_AVO,
|
|
57
|
+
DEFAULT_MICRO_CONFIG,
|
|
58
|
+
DEFAULT_OVERLAY_PHRASES,
|
|
59
|
+
DEFAULT_TRANSITION_DURATIONS,
|
|
60
|
+
EmotionController,
|
|
61
|
+
HttpSpeechSynthesisProvider,
|
|
62
|
+
LEGACY_STATE_MAP,
|
|
63
|
+
MODE_TRANSITION_MAP,
|
|
64
|
+
VoiceLicenseCategorySchema,
|
|
65
|
+
applyMicroExpression,
|
|
66
|
+
avoDistance,
|
|
67
|
+
blendAVO,
|
|
68
|
+
clampAVO,
|
|
69
|
+
computeVisualState,
|
|
70
|
+
createInitialCognitionState,
|
|
71
|
+
createMicroExpressionAnimator,
|
|
72
|
+
createNoiseGenerator,
|
|
73
|
+
ease,
|
|
74
|
+
getAnimationWeights,
|
|
75
|
+
getTransitionConfig,
|
|
76
|
+
getTransitionDuration,
|
|
77
|
+
getTransitionEasing,
|
|
78
|
+
isValidAVO,
|
|
79
|
+
lerp,
|
|
80
|
+
mapArousal,
|
|
81
|
+
mapOpenness,
|
|
82
|
+
mapValence,
|
|
83
|
+
pickOverlayPhrase,
|
|
84
|
+
planSpeech,
|
|
85
|
+
planSpeechFromCognition,
|
|
86
|
+
reduceDecay,
|
|
87
|
+
reduceEvent,
|
|
88
|
+
useCognition,
|
|
89
|
+
useEmotion,
|
|
90
|
+
validateAudioProof,
|
|
91
|
+
validateCognitionSnapshot
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glyph Emotion System Types
|
|
3
|
+
*
|
|
4
|
+
* AVO dimensional model based on Russell's Circumplex Model of Affect
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The three emotional dimensions (all 0-1 range)
|
|
8
|
+
*/
|
|
9
|
+
interface AVODimensions {
|
|
10
|
+
/** Arousal: 0 (dormant) to 1 (intense) - energy/activation level */
|
|
11
|
+
arousal: number;
|
|
12
|
+
/** Valence: 0 (distressed) to 1 (elated) - positivity/confidence */
|
|
13
|
+
valence: number;
|
|
14
|
+
/** Openness: 0 (receptive) to 1 (expressive) - input/output direction */
|
|
15
|
+
openness: number;
|
|
16
|
+
}
|
|
17
|
+
/** Shorthand alias */
|
|
18
|
+
type AVO = AVODimensions;
|
|
19
|
+
/**
|
|
20
|
+
* Named anchor states - recognizable emotional configurations
|
|
21
|
+
*/
|
|
22
|
+
type AnchorState = 'dormant' | 'idle' | 'attentive' | 'curious' | 'listening' | 'thinking' | 'contemplating' | 'focused' | 'responding' | 'explaining' | 'enthusiastic' | 'satisfied' | 'proud' | 'uncertain' | 'concerned' | 'struggling' | 'alarmed' | 'error' | 'recovering' | 'relieved';
|
|
23
|
+
/**
|
|
24
|
+
* Easing function types for transitions
|
|
25
|
+
*/
|
|
26
|
+
type EasingFunction = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'spring';
|
|
27
|
+
/**
|
|
28
|
+
* Transition configuration
|
|
29
|
+
*/
|
|
30
|
+
interface TransitionOptions {
|
|
31
|
+
/** Duration in milliseconds */
|
|
32
|
+
duration?: number;
|
|
33
|
+
/** Easing function */
|
|
34
|
+
easing?: EasingFunction;
|
|
35
|
+
/** Callback when transition completes */
|
|
36
|
+
onComplete?: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Visual state derived from AVO dimensions
|
|
40
|
+
*/
|
|
41
|
+
interface VisualState {
|
|
42
|
+
breathingRate: number;
|
|
43
|
+
breathingAmplitude: number;
|
|
44
|
+
ringRotationSpeed: number;
|
|
45
|
+
particleVelocity: number;
|
|
46
|
+
particleCount: number;
|
|
47
|
+
glowPulseRate: number;
|
|
48
|
+
coreHue: number;
|
|
49
|
+
coreSaturation: number;
|
|
50
|
+
motionNoise: number;
|
|
51
|
+
scaleFactor: number;
|
|
52
|
+
emissiveIntensity: number;
|
|
53
|
+
particleFlowDirection: number;
|
|
54
|
+
particleSpreadAngle: number;
|
|
55
|
+
breathingPhaseBias: number;
|
|
56
|
+
ringTilt: number;
|
|
57
|
+
auraExpansion: number;
|
|
58
|
+
overallIntensity: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Emotion events that can trigger state changes
|
|
62
|
+
*/
|
|
63
|
+
interface EmotionEvent {
|
|
64
|
+
type: 'input_received' | 'processing_start' | 'processing_complete' | 'error_occurred' | 'success' | 'user_idle' | 'interrupt';
|
|
65
|
+
/** Intensity of the event (0-1) */
|
|
66
|
+
intensity?: number;
|
|
67
|
+
/** Additional event data */
|
|
68
|
+
data?: unknown;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Micro-expression configuration for natural movement
|
|
72
|
+
*/
|
|
73
|
+
interface MicroExpressionConfig {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
arousalNoise: number;
|
|
76
|
+
valenceNoise: number;
|
|
77
|
+
opennessNoise: number;
|
|
78
|
+
frequency: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Legacy GlyphState for backward compatibility
|
|
82
|
+
*/
|
|
83
|
+
type LegacyGlyphState = 'idle' | 'listening' | 'thinking' | 'responding' | 'success' | 'error' | 'sleep';
|
|
84
|
+
|
|
85
|
+
export type { AVO as A, EasingFunction as E, LegacyGlyphState as L, MicroExpressionConfig as M, TransitionOptions as T, VisualState as V, AVODimensions as a, AnchorState as b, EmotionEvent as c };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { A as AVO } from './types-B0jyNVTH.js';
|
|
2
|
+
|
|
3
|
+
type CognitiveMode = 'idle' | 'listening' | 'deliberating' | 'acting' | 'explaining' | 'recovering' | 'blocked';
|
|
4
|
+
type CognitiveSubmode = 'reading' | 'searching' | 'verifying' | 'waiting' | 'writing' | 'tool_call';
|
|
5
|
+
interface CognitionSignals {
|
|
6
|
+
attention: number;
|
|
7
|
+
workload: number;
|
|
8
|
+
timePressure: number;
|
|
9
|
+
planDrift: number;
|
|
10
|
+
costPressure: number;
|
|
11
|
+
risk: number;
|
|
12
|
+
uncertainty: number;
|
|
13
|
+
confidence: number;
|
|
14
|
+
errorStress: number;
|
|
15
|
+
}
|
|
16
|
+
interface PersonaSignals {
|
|
17
|
+
personaAnchor: number;
|
|
18
|
+
personaDriftRisk: number;
|
|
19
|
+
personaStyle?: string[];
|
|
20
|
+
}
|
|
21
|
+
interface TrapWarning {
|
|
22
|
+
stateId: string;
|
|
23
|
+
reason: string;
|
|
24
|
+
recommendation: string;
|
|
25
|
+
severity?: 'info' | 'warning' | 'danger';
|
|
26
|
+
}
|
|
27
|
+
interface DetailedBalance {
|
|
28
|
+
chi2PerNdf: number;
|
|
29
|
+
passed: boolean;
|
|
30
|
+
threshold: number;
|
|
31
|
+
}
|
|
32
|
+
interface DynamicsState {
|
|
33
|
+
potentialV?: number;
|
|
34
|
+
actionRate?: number;
|
|
35
|
+
detailedBalance?: DetailedBalance;
|
|
36
|
+
traps?: TrapWarning[];
|
|
37
|
+
}
|
|
38
|
+
interface PersonalityConfig {
|
|
39
|
+
style: 'professional' | 'casual' | 'terse' | 'verbose';
|
|
40
|
+
riskTolerance: 'conservative' | 'moderate' | 'aggressive';
|
|
41
|
+
autonomy: 'low' | 'medium' | 'high' | 'full';
|
|
42
|
+
}
|
|
43
|
+
interface PolicyConfig {
|
|
44
|
+
safetyMode: boolean;
|
|
45
|
+
trustTier?: string;
|
|
46
|
+
}
|
|
47
|
+
type EvidenceRef = {
|
|
48
|
+
type: 'run';
|
|
49
|
+
runId: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'run_receipt';
|
|
52
|
+
receiptHash: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'artifact';
|
|
55
|
+
path: string;
|
|
56
|
+
digest?: string;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'ui';
|
|
59
|
+
componentId: string;
|
|
60
|
+
note?: string;
|
|
61
|
+
};
|
|
62
|
+
interface CognitionState extends CognitionSignals, PersonaSignals {
|
|
63
|
+
mode: CognitiveMode;
|
|
64
|
+
submode?: CognitiveSubmode;
|
|
65
|
+
focusRunId?: string;
|
|
66
|
+
dynamics?: DynamicsState;
|
|
67
|
+
personality?: PersonalityConfig;
|
|
68
|
+
policy?: PolicyConfig;
|
|
69
|
+
moodAVO: AVO;
|
|
70
|
+
emotionAVO: AVO;
|
|
71
|
+
}
|
|
72
|
+
type CognitionEvent = {
|
|
73
|
+
type: 'ui.input_received';
|
|
74
|
+
intensity?: number;
|
|
75
|
+
} | {
|
|
76
|
+
type: 'ui.user_idle';
|
|
77
|
+
} | {
|
|
78
|
+
type: 'ui.interrupt';
|
|
79
|
+
intensity?: number;
|
|
80
|
+
} | {
|
|
81
|
+
type: 'run.event';
|
|
82
|
+
runId: string;
|
|
83
|
+
status: string;
|
|
84
|
+
progress?: number;
|
|
85
|
+
} | {
|
|
86
|
+
type: 'run.started';
|
|
87
|
+
runId: string;
|
|
88
|
+
} | {
|
|
89
|
+
type: 'run.completed';
|
|
90
|
+
runId: string;
|
|
91
|
+
success: boolean;
|
|
92
|
+
} | {
|
|
93
|
+
type: 'intensity.update';
|
|
94
|
+
values: Partial<CognitionSignals>;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'signals.update';
|
|
97
|
+
signals: Partial<CognitionSignals>;
|
|
98
|
+
} | {
|
|
99
|
+
type: 'dynamics.update';
|
|
100
|
+
dynamics: DynamicsState;
|
|
101
|
+
} | {
|
|
102
|
+
type: 'policy.update';
|
|
103
|
+
policy?: PolicyConfig;
|
|
104
|
+
personality?: PersonalityConfig;
|
|
105
|
+
} | {
|
|
106
|
+
type: 'text.user_message';
|
|
107
|
+
text: string;
|
|
108
|
+
categories?: string[];
|
|
109
|
+
} | {
|
|
110
|
+
type: 'tick';
|
|
111
|
+
deltaMs: number;
|
|
112
|
+
};
|
|
113
|
+
interface CognitionSnapshot {
|
|
114
|
+
version: '1.0';
|
|
115
|
+
timestamp: number;
|
|
116
|
+
state: CognitionState;
|
|
117
|
+
recentEvents?: Array<{
|
|
118
|
+
t: number;
|
|
119
|
+
event: CognitionEvent;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
122
|
+
declare function clamp01(value: number): number;
|
|
123
|
+
declare function createInitialCognitionState(overrides?: Partial<CognitionState>): CognitionState;
|
|
124
|
+
|
|
125
|
+
export { type CognitionEvent as C, type DetailedBalance as D, type EvidenceRef as E, type PersonaSignals as P, type TrapWarning as T, type CognitionSignals as a, type CognitionSnapshot as b, type CognitionState as c, type CognitiveMode as d, type CognitiveSubmode as e, type DynamicsState as f, type PersonalityConfig as g, type PolicyConfig as h, createInitialCognitionState as i, clamp01 as j };
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backbay/glia-agent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Emotion, cognition, and audio systems for AI agents",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./emotion": {
|
|
17
|
+
"types": "./dist/emotion.d.ts",
|
|
18
|
+
"import": "./dist/emotion.js"
|
|
19
|
+
},
|
|
20
|
+
"./cognition": {
|
|
21
|
+
"types": "./dist/cognition.d.ts",
|
|
22
|
+
"import": "./dist/cognition.js"
|
|
23
|
+
},
|
|
24
|
+
"./audio": {
|
|
25
|
+
"types": "./dist/audio.d.ts",
|
|
26
|
+
"import": "./dist/audio.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"zod": "^3.23.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"react": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/react": "^19.0.0",
|
|
49
|
+
"react": "^19.1.1",
|
|
50
|
+
"tsup": "^8.5.1",
|
|
51
|
+
"typescript": "^5.9.2"
|
|
52
|
+
},
|
|
53
|
+
"license": "MIT"
|
|
54
|
+
}
|