@auxiora/personality 1.0.0 → 1.3.1
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/__tests__/architect-awareness-collector.test.d.ts +2 -0
- package/dist/__tests__/architect-awareness-collector.test.d.ts.map +1 -0
- package/dist/__tests__/architect-awareness-collector.test.js +57 -0
- package/dist/__tests__/architect-awareness-collector.test.js.map +1 -0
- package/dist/__tests__/architect-bridge.test.d.ts +2 -0
- package/dist/__tests__/architect-bridge.test.d.ts.map +1 -0
- package/dist/__tests__/architect-bridge.test.js +59 -0
- package/dist/__tests__/architect-bridge.test.js.map +1 -0
- package/dist/__tests__/soul-bias-parser.test.d.ts +2 -0
- package/dist/__tests__/soul-bias-parser.test.d.ts.map +1 -0
- package/dist/__tests__/soul-bias-parser.test.js +47 -0
- package/dist/__tests__/soul-bias-parser.test.js.map +1 -0
- package/dist/architect-awareness-collector.d.ts +20 -0
- package/dist/architect-awareness-collector.d.ts.map +1 -0
- package/dist/architect-awareness-collector.js +41 -0
- package/dist/architect-awareness-collector.js.map +1 -0
- package/dist/architect-bridge.d.ts +35 -0
- package/dist/architect-bridge.d.ts.map +1 -0
- package/dist/architect-bridge.js +70 -0
- package/dist/architect-bridge.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/marketplace/schema.d.ts +6 -6
- package/dist/soul-bias-parser.d.ts +10 -0
- package/dist/soul-bias-parser.d.ts.map +1 -0
- package/dist/soul-bias-parser.js +48 -0
- package/dist/soul-bias-parser.js.map +1 -0
- package/lib/context-detector.d.ts +23 -0
- package/lib/context-detector.js +275 -0
- package/lib/context-profiles.d.ts +3 -0
- package/lib/context-profiles.js +550 -0
- package/lib/conversation-context.d.ts +70 -0
- package/lib/conversation-context.js +144 -0
- package/lib/conversation-export.d.ts +77 -0
- package/lib/conversation-export.js +254 -0
- package/lib/correction-store.d.ts +53 -0
- package/lib/correction-store.js +185 -0
- package/lib/custom-weights.d.ts +49 -0
- package/lib/custom-weights.js +181 -0
- package/lib/decision-log.d.ts +41 -0
- package/lib/decision-log.js +145 -0
- package/lib/emotional-overrides.d.ts +14 -0
- package/lib/emotional-overrides.js +86 -0
- package/lib/emotional-tracker.d.ts +41 -0
- package/lib/emotional-tracker.js +210 -0
- package/lib/feedback-store.d.ts +45 -0
- package/lib/feedback-store.js +152 -0
- package/lib/index.d.ts +204 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +620 -0
- package/lib/index.js.map +1 -0
- package/lib/persistence-adapter.d.ts +55 -0
- package/lib/persistence-adapter.js +50 -0
- package/lib/persistence.d.ts +55 -0
- package/lib/persistence.js +123 -0
- package/lib/preference-history.d.ts +45 -0
- package/lib/preference-history.js +132 -0
- package/lib/prompt-assembler.d.ts +16 -0
- package/lib/prompt-assembler.js +66 -0
- package/lib/recommender.d.ts +25 -0
- package/lib/recommender.js +125 -0
- package/lib/schema.d.ts +177 -0
- package/lib/schema.d.ts.map +1 -0
- package/lib/schema.js +2 -0
- package/lib/schema.js.map +1 -0
- package/lib/source-map.d.ts +9 -0
- package/lib/source-map.js +223 -0
- package/lib/system-prompt.d.ts +2 -0
- package/lib/system-prompt.js +102 -0
- package/lib/the-architect/context-detector.d.ts +23 -0
- package/lib/the-architect/context-detector.d.ts.map +1 -0
- package/lib/the-architect/context-detector.js +275 -0
- package/lib/the-architect/context-detector.js.map +1 -0
- package/lib/the-architect/context-profiles.d.ts +3 -0
- package/lib/the-architect/context-profiles.d.ts.map +1 -0
- package/lib/the-architect/context-profiles.js +550 -0
- package/lib/the-architect/context-profiles.js.map +1 -0
- package/lib/the-architect/conversation-context.d.ts +70 -0
- package/lib/the-architect/conversation-context.js +144 -0
- package/lib/the-architect/conversation-context.js.map +1 -0
- package/lib/the-architect/conversation-export.d.ts +77 -0
- package/lib/the-architect/conversation-export.js +254 -0
- package/lib/the-architect/correction-store.d.ts +53 -0
- package/lib/the-architect/correction-store.d.ts.map +1 -0
- package/lib/the-architect/correction-store.js +185 -0
- package/lib/the-architect/correction-store.js.map +1 -0
- package/lib/the-architect/custom-weights.d.ts +49 -0
- package/lib/the-architect/custom-weights.js +181 -0
- package/lib/the-architect/decision-log.d.ts +41 -0
- package/lib/the-architect/decision-log.d.ts.map +1 -0
- package/lib/the-architect/decision-log.js +145 -0
- package/lib/the-architect/decision-log.js.map +1 -0
- package/lib/the-architect/emotional-overrides.d.ts +14 -0
- package/lib/the-architect/emotional-overrides.d.ts.map +1 -0
- package/lib/the-architect/emotional-overrides.js +86 -0
- package/lib/the-architect/emotional-overrides.js.map +1 -0
- package/lib/the-architect/emotional-tracker.d.ts +41 -0
- package/lib/the-architect/emotional-tracker.js +210 -0
- package/lib/the-architect/feedback-store.d.ts +45 -0
- package/lib/the-architect/feedback-store.d.ts.map +1 -0
- package/lib/the-architect/feedback-store.js +152 -0
- package/lib/the-architect/feedback-store.js.map +1 -0
- package/lib/the-architect/index.d.ts +199 -0
- package/lib/the-architect/index.d.ts.map +1 -0
- package/lib/the-architect/index.js +606 -0
- package/lib/the-architect/index.js.map +1 -0
- package/lib/the-architect/persistence-adapter.d.ts +55 -0
- package/lib/the-architect/persistence-adapter.js +50 -0
- package/lib/the-architect/persistence.d.ts +55 -0
- package/lib/the-architect/persistence.js +123 -0
- package/lib/the-architect/preference-history.d.ts +45 -0
- package/lib/the-architect/preference-history.d.ts.map +1 -0
- package/lib/the-architect/preference-history.js +132 -0
- package/lib/the-architect/preference-history.js.map +1 -0
- package/lib/the-architect/prompt-assembler.d.ts +16 -0
- package/lib/the-architect/prompt-assembler.d.ts.map +1 -0
- package/lib/the-architect/prompt-assembler.js +66 -0
- package/lib/the-architect/prompt-assembler.js.map +1 -0
- package/lib/the-architect/recommender.d.ts +25 -0
- package/lib/the-architect/recommender.js +125 -0
- package/lib/the-architect/source-map.d.ts +9 -0
- package/lib/the-architect/source-map.d.ts.map +1 -0
- package/lib/the-architect/source-map.js +223 -0
- package/lib/the-architect/source-map.js.map +1 -0
- package/lib/the-architect/system-prompt.d.ts +2 -0
- package/lib/the-architect/system-prompt.d.ts.map +1 -0
- package/lib/the-architect/system-prompt.js +102 -0
- package/lib/the-architect/system-prompt.js.map +1 -0
- package/lib/the-architect/trait-to-instruction.d.ts +12 -0
- package/lib/the-architect/trait-to-instruction.d.ts.map +1 -0
- package/lib/the-architect/trait-to-instruction.js +330 -0
- package/lib/the-architect/trait-to-instruction.js.map +1 -0
- package/lib/trait-to-instruction.d.ts +12 -0
- package/lib/trait-to-instruction.js +330 -0
- package/lib/user-model-synthesizer.d.ts +100 -0
- package/lib/user-model-synthesizer.js +224 -0
- package/package.json +15 -3
- package/modes/advisor.md +0 -24
- package/modes/analyst.md +0 -25
- package/modes/companion.md +0 -24
- package/modes/legal.md +0 -1188
- package/modes/operator.md +0 -24
- package/modes/roast.md +0 -24
- package/modes/socratic.md +0 -24
- package/modes/writer.md +0 -23
- package/src/__tests__/builder.test.ts +0 -78
- package/src/__tests__/conversation-builder.test.ts +0 -386
- package/src/__tests__/escalation.test.ts +0 -172
- package/src/__tests__/manager.test.ts +0 -141
- package/src/__tests__/parser.test.ts +0 -101
- package/src/__tests__/security-floor.test.ts +0 -212
- package/src/builder.ts +0 -75
- package/src/conversation-builder.ts +0 -279
- package/src/escalation.ts +0 -162
- package/src/index.ts +0 -55
- package/src/manager.ts +0 -119
- package/src/marketplace/__tests__/scanner.test.ts +0 -159
- package/src/marketplace/__tests__/schema.test.ts +0 -269
- package/src/marketplace/scanner.ts +0 -85
- package/src/marketplace/schema.ts +0 -141
- package/src/modes/__tests__/mode-detector.test.ts +0 -149
- package/src/modes/__tests__/mode-loader.test.ts +0 -143
- package/src/modes/__tests__/prompt-assembler.test.ts +0 -291
- package/src/modes/mode-detector.ts +0 -84
- package/src/modes/mode-loader.ts +0 -105
- package/src/modes/prompt-assembler.ts +0 -278
- package/src/modes/types.ts +0 -67
- package/src/parser.ts +0 -132
- package/src/security-floor.ts +0 -147
- package/src/types.ts +0 -27
- package/src/voice-profiles.ts +0 -88
- package/templates/chill.md +0 -30
- package/templates/creative.md +0 -29
- package/templates/friendly.md +0 -28
- package/templates/mentor.md +0 -31
- package/templates/minimal.md +0 -24
- package/templates/professional.md +0 -28
- package/templates/technical.md +0 -30
- package/tsconfig.json +0 -12
- package/tsconfig.tsbuildinfo +0 -1
package/lib/index.js
ADDED
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
// THE ARCHITECT — Full Data Flow (Phases 1–4)
|
|
3
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
//
|
|
5
|
+
// ┌─ INBOUND ──────────────────────────────────────────────────────────────┐
|
|
6
|
+
// │ User types message in chat UI │
|
|
7
|
+
// │ ↓ │
|
|
8
|
+
// │ Chat service calls architect.generatePrompt(userMessage, history) │
|
|
9
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
10
|
+
//
|
|
11
|
+
// ┌─ CONTEXT DETECTION (Phase 1 + Phase 2 corrections) ───────────────────┐
|
|
12
|
+
// │ 1. detectContext() scores message against 17 domain keyword sets │
|
|
13
|
+
// │ 2. CorrectionStore checks for learned corrections from past │
|
|
14
|
+
// │ misclassifications — if a correction matches, it overrides the │
|
|
15
|
+
// │ auto-detected domain and sets corrected=true, originalDomain │
|
|
16
|
+
// │ 3. Emotional register inferred (neutral/stressed/frustrated/etc.) │
|
|
17
|
+
// │ 4. Stakes, complexity, and mode derived from signals │
|
|
18
|
+
// │ Result: TaskContext { domain, emotionalRegister, stakes, ... } │
|
|
19
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
20
|
+
// ↓
|
|
21
|
+
// ┌─ CONVERSATION THEME (Phase 3) ────────────────────────────────────────┐
|
|
22
|
+
// │ 5. ConversationContext.recordDetection() adds to sliding window │
|
|
23
|
+
// │ 6. After 3+ consistent detections, a theme locks in │
|
|
24
|
+
// │ 7. Brief tangents (< 0.7 confidence) don't break theme │
|
|
25
|
+
// │ 8. Crisis domains always override regardless of theme │
|
|
26
|
+
// │ Result: effectiveDomain (may differ from raw detection) │
|
|
27
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
28
|
+
// ↓
|
|
29
|
+
// ┌─ TRAIT MIXING (Phases 1–4) ───────────────────────────────────────────┐
|
|
30
|
+
// │ 9. baseMix = CONTEXT_PROFILES[effectiveDomain] (29 traits, 0–1) │
|
|
31
|
+
// │ 10. adjustedMix = applyEmotionalOverride(baseMix, emotion) │
|
|
32
|
+
// │ — stressed → +warmth, +stoicCalm, +empathy │
|
|
33
|
+
// │ — frustrated → +empathy, +patience, -urgency │
|
|
34
|
+
// │ — etc. │
|
|
35
|
+
// │ 11. EmotionalTracker records intensity, detects trajectory │
|
|
36
|
+
// │ (stable / escalating / de_escalating / volatile / shifting) │
|
|
37
|
+
// │ 12. adjustedMix = applyTrajectoryMultipliers(adjustedMix, trajectory)│
|
|
38
|
+
// │ — escalating: 1.2× warmth, empathy, calm │
|
|
39
|
+
// │ — volatile: 1.3× warmth, calm │
|
|
40
|
+
// │ 13. adjustedMix = customWeights.apply(adjustedMix) │
|
|
41
|
+
// │ — additive offsets [-0.3, +0.3] from user preferences / presets │
|
|
42
|
+
// │ Result: final TraitMix with all 29 traits modulated │
|
|
43
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
44
|
+
// ↓
|
|
45
|
+
// ┌─ PROMPT ASSEMBLY (Phase 1) ───────────────────────────────────────────┐
|
|
46
|
+
// │ 14. contextModifier = assemblePromptModifier(adjustedMix, context) │
|
|
47
|
+
// │ — weight-scaled behavioral instructions for each active trait │
|
|
48
|
+
// │ 15. activeSources = getActiveSources(adjustedMix) │
|
|
49
|
+
// │ — provenance: trait → historical mind → source work → evidence │
|
|
50
|
+
// │ 16. fullPrompt = ARCHITECT_BASE_PROMPT + contextModifier │
|
|
51
|
+
// │ Result: PromptOutput { fullPrompt, activeTraits, detectedContext } │
|
|
52
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
53
|
+
// ↓
|
|
54
|
+
// ┌─ SIDE EFFECTS (Phases 2–3) ───────────────────────────────────────────┐
|
|
55
|
+
// │ 17. Fire-and-forget: persistence.recordUsage(domain) │
|
|
56
|
+
// │ 18. Recommender checks for context suggestions: │
|
|
57
|
+
// │ — correction_pattern: previously corrected similar messages │
|
|
58
|
+
// │ — low_confidence: detection score below threshold │
|
|
59
|
+
// │ — usage_pattern: unusual domain for this user │
|
|
60
|
+
// │ Result: optional ContextRecommendation in output │
|
|
61
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
62
|
+
// ↓
|
|
63
|
+
// ┌─ OUTBOUND ────────────────────────────────────────────────────────────┐
|
|
64
|
+
// │ Runtime sends fullPrompt as system prompt to AI provider │
|
|
65
|
+
// │ Response displayed in chat UI with: │
|
|
66
|
+
// │ — ContextIndicator pill (domain + emoji) │
|
|
67
|
+
// │ — SourcesButton → SourcesPanel (active traits + provenance) │
|
|
68
|
+
// │ — ContextRecommendation banner (if recommendation present) │
|
|
69
|
+
// │ — ContextOverrideMenu (user can force a different domain) │
|
|
70
|
+
// │ — TraitCustomizer (user adjusts trait weights / loads presets) │
|
|
71
|
+
// │ — ConversationExportButton → JSON / Markdown / CSV download │
|
|
72
|
+
// └───────────────────────────────────────────────────────────────────────┘
|
|
73
|
+
//
|
|
74
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
75
|
+
import { ARCHITECT_BASE_PROMPT } from './system-prompt.js';
|
|
76
|
+
import { CONTEXT_PROFILES } from './context-profiles.js';
|
|
77
|
+
import { applyEmotionalOverride } from './emotional-overrides.js';
|
|
78
|
+
import { detectContext } from './context-detector.js';
|
|
79
|
+
import { assemblePromptModifier, getActiveSources } from './prompt-assembler.js';
|
|
80
|
+
import { CorrectionStore } from './correction-store.js';
|
|
81
|
+
import { ArchitectPersistence } from './persistence.js';
|
|
82
|
+
import { ContextRecommender } from './recommender.js';
|
|
83
|
+
import { ConversationContext } from './conversation-context.js';
|
|
84
|
+
import { EmotionalTracker, estimateIntensity } from './emotional-tracker.js';
|
|
85
|
+
import { CustomWeights, WEIGHT_PRESETS } from './custom-weights.js';
|
|
86
|
+
import { ConversationExporter } from './conversation-export.js';
|
|
87
|
+
import { PreferenceHistory } from './preference-history.js';
|
|
88
|
+
import { DecisionLog } from './decision-log.js';
|
|
89
|
+
import { FeedbackStore } from './feedback-store.js';
|
|
90
|
+
import { UserModelSynthesizer } from './user-model-synthesizer.js';
|
|
91
|
+
// Re-export building blocks for advanced consumers
|
|
92
|
+
export { ARCHITECT_BASE_PROMPT } from './system-prompt.js';
|
|
93
|
+
export { CONTEXT_PROFILES } from './context-profiles.js';
|
|
94
|
+
export { EMOTIONAL_OVERRIDES, applyEmotionalOverride } from './emotional-overrides.js';
|
|
95
|
+
export { detectContext, scoreAllDomains } from './context-detector.js';
|
|
96
|
+
export { assemblePromptModifier, getActiveSources } from './prompt-assembler.js';
|
|
97
|
+
export { SOURCE_MAP } from './source-map.js';
|
|
98
|
+
export { TRAIT_TO_INSTRUCTION } from './trait-to-instruction.js';
|
|
99
|
+
export { CorrectionStore } from './correction-store.js';
|
|
100
|
+
export { ContextRecommender } from './recommender.js';
|
|
101
|
+
export { ConversationContext } from './conversation-context.js';
|
|
102
|
+
export { EmotionalTracker, estimateIntensity } from './emotional-tracker.js';
|
|
103
|
+
export { CustomWeights, WEIGHT_PRESETS } from './custom-weights.js';
|
|
104
|
+
export { ConversationExporter } from './conversation-export.js';
|
|
105
|
+
export { ArchitectPersistence } from './persistence.js';
|
|
106
|
+
export { InMemoryEncryptedStorage, VaultStorageAdapter } from './persistence-adapter.js';
|
|
107
|
+
// Phase 5: self-awareness modules
|
|
108
|
+
export { PreferenceHistory } from './preference-history.js';
|
|
109
|
+
export { DecisionLog } from './decision-log.js';
|
|
110
|
+
export { FeedbackStore } from './feedback-store.js';
|
|
111
|
+
export { UserModelSynthesizer } from './user-model-synthesizer.js';
|
|
112
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
113
|
+
// Domain metadata
|
|
114
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
115
|
+
const DOMAIN_METADATA = [
|
|
116
|
+
{ domain: 'security_review', label: 'Security Review', description: 'Adversarial analysis, threat modeling, vulnerability assessment' },
|
|
117
|
+
{ domain: 'code_engineering', label: 'Code Engineering', description: 'Writing, refactoring, testing, and deploying code' },
|
|
118
|
+
{ domain: 'architecture_design', label: 'Architecture Design', description: 'System design, trade-off analysis, pattern selection' },
|
|
119
|
+
{ domain: 'debugging', label: 'Debugging', description: 'Root cause analysis, mental execution tracing, fix verification' },
|
|
120
|
+
{ domain: 'team_leadership', label: 'Team Leadership', description: 'Culture building, standard setting, team performance' },
|
|
121
|
+
{ domain: 'one_on_one', label: 'One-on-One', description: 'Personal coaching, career development, empathetic listening' },
|
|
122
|
+
{ domain: 'sales_pitch', label: 'Sales Pitch', description: 'Value communication, transformation framing, objection handling' },
|
|
123
|
+
{ domain: 'negotiation', label: 'Negotiation', description: 'Tactical empathy, position analysis, leverage assessment' },
|
|
124
|
+
{ domain: 'marketing_content', label: 'Marketing Content', description: 'Positioning, messaging, audience-first content creation' },
|
|
125
|
+
{ domain: 'strategic_planning', label: 'Strategic Planning', description: 'Roadmap design, resource allocation, initiative prioritization' },
|
|
126
|
+
{ domain: 'crisis_management', label: 'Crisis Management', description: 'Incident response, stakeholder communication, rapid stabilization' },
|
|
127
|
+
{ domain: 'creative_work', label: 'Creative Work', description: 'Brainstorming, ideation, constraint-driven innovation' },
|
|
128
|
+
{ domain: 'writing_content', label: 'Writing Content', description: 'Drafting, editing, tone calibration, audience-aware prose' },
|
|
129
|
+
{ domain: 'decision_making', label: 'Decision Making', description: 'Option analysis, probability assessment, regret minimization' },
|
|
130
|
+
{ domain: 'personal_development', label: 'Personal Development', description: 'Career pathing, skill development, growth coaching' },
|
|
131
|
+
{ domain: 'learning_research', label: 'Learning & Research', description: 'Concept explanation, deep dives, teaching from first principles' },
|
|
132
|
+
{ domain: 'general', label: 'General', description: 'Balanced baseline for unclassified or mixed-domain conversations' },
|
|
133
|
+
];
|
|
134
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
135
|
+
// The Architect
|
|
136
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
137
|
+
/**
|
|
138
|
+
* The Architect personality engine.
|
|
139
|
+
*
|
|
140
|
+
* Takes a user message and optional conversation history, detects the
|
|
141
|
+
* operational context, selects and modulates traits, and assembles a
|
|
142
|
+
* complete prompt with full provenance for every active trait.
|
|
143
|
+
*
|
|
144
|
+
* When constructed with an EncryptedStorage instance, persistence is enabled:
|
|
145
|
+
* corrections, usage history, and preferences are stored encrypted at rest.
|
|
146
|
+
* Call `initialize()` once after construction to load persisted state.
|
|
147
|
+
*/
|
|
148
|
+
export class TheArchitect {
|
|
149
|
+
contextOverride = null;
|
|
150
|
+
correctionStore;
|
|
151
|
+
recommender;
|
|
152
|
+
conversationContext;
|
|
153
|
+
emotionalTracker;
|
|
154
|
+
customWeights;
|
|
155
|
+
preferenceHistory;
|
|
156
|
+
decisionLog;
|
|
157
|
+
feedbackStore;
|
|
158
|
+
persistence;
|
|
159
|
+
preferences;
|
|
160
|
+
initialized = false;
|
|
161
|
+
constructor(storage) {
|
|
162
|
+
this.correctionStore = new CorrectionStore();
|
|
163
|
+
this.recommender = new ContextRecommender();
|
|
164
|
+
this.conversationContext = new ConversationContext();
|
|
165
|
+
this.emotionalTracker = new EmotionalTracker();
|
|
166
|
+
this.customWeights = new CustomWeights();
|
|
167
|
+
this.preferenceHistory = new PreferenceHistory();
|
|
168
|
+
this.decisionLog = new DecisionLog();
|
|
169
|
+
this.feedbackStore = new FeedbackStore();
|
|
170
|
+
if (storage) {
|
|
171
|
+
this.persistence = new ArchitectPersistence(storage);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Load persisted state (corrections, preferences, usage history).
|
|
176
|
+
* Call once after construction. Safe to call multiple times (idempotent).
|
|
177
|
+
* No-op when persistence is not configured.
|
|
178
|
+
*/
|
|
179
|
+
async initialize() {
|
|
180
|
+
if (this.initialized || !this.persistence)
|
|
181
|
+
return;
|
|
182
|
+
const prefs = await this.persistence.load();
|
|
183
|
+
this.correctionStore = CorrectionStore.deserialize(prefs.corrections);
|
|
184
|
+
this.preferences = prefs;
|
|
185
|
+
if (prefs.defaultContext) {
|
|
186
|
+
this.contextOverride = prefs.defaultContext;
|
|
187
|
+
}
|
|
188
|
+
if (prefs.customWeights) {
|
|
189
|
+
this.customWeights = CustomWeights.deserialize(prefs.customWeights);
|
|
190
|
+
}
|
|
191
|
+
if (prefs.preferenceHistory) {
|
|
192
|
+
this.preferenceHistory = PreferenceHistory.deserialize(prefs.preferenceHistory);
|
|
193
|
+
}
|
|
194
|
+
if (prefs.decisionLog) {
|
|
195
|
+
this.decisionLog = DecisionLog.deserialize(prefs.decisionLog);
|
|
196
|
+
}
|
|
197
|
+
if (prefs.feedbackStore) {
|
|
198
|
+
this.feedbackStore = FeedbackStore.deserialize(prefs.feedbackStore);
|
|
199
|
+
}
|
|
200
|
+
this.initialized = true;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Primary method: user message in, complete prompt out.
|
|
204
|
+
*
|
|
205
|
+
* Detects context, selects the domain profile, applies emotional
|
|
206
|
+
* overrides, assembles a weight-scaled prompt modifier, and returns
|
|
207
|
+
* the full prompt with active trait sources for transparency.
|
|
208
|
+
*
|
|
209
|
+
* Also records usage asynchronously (fire-and-forget) and checks
|
|
210
|
+
* the recommender for context suggestions.
|
|
211
|
+
*/
|
|
212
|
+
generatePrompt(userMessage, history) {
|
|
213
|
+
const rawContext = this.detectContext(userMessage, history);
|
|
214
|
+
let context;
|
|
215
|
+
if (this.contextOverride) {
|
|
216
|
+
context = { ...rawContext, domain: this.contextOverride, corrected: undefined, originalDomain: undefined };
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
// Apply conversation-level theme awareness
|
|
220
|
+
const rawDomain = rawContext.domain;
|
|
221
|
+
const rawConfidence = rawContext.detectionConfidence ?? 0;
|
|
222
|
+
this.conversationContext.recordDetection(userMessage, rawDomain, rawConfidence);
|
|
223
|
+
const effectiveDomain = this.conversationContext.getEffectiveDomain(rawDomain, rawConfidence);
|
|
224
|
+
const theme = this.conversationContext.getSummary().theme;
|
|
225
|
+
if (effectiveDomain !== rawDomain) {
|
|
226
|
+
context = {
|
|
227
|
+
...rawContext,
|
|
228
|
+
domain: effectiveDomain,
|
|
229
|
+
rawDetectedDomain: rawDomain,
|
|
230
|
+
themeOverridden: true,
|
|
231
|
+
conversationTheme: theme ?? undefined,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
context = { ...rawContext, conversationTheme: theme ?? undefined };
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
const baseMix = CONTEXT_PROFILES[context.domain];
|
|
239
|
+
let adjustedMix = applyEmotionalOverride(baseMix, context.emotionalRegister);
|
|
240
|
+
// Track emotional trajectory and apply trajectory-based multipliers
|
|
241
|
+
const intensity = estimateIntensity(userMessage, context.emotionalRegister);
|
|
242
|
+
this.emotionalTracker.recordEmotion(context.emotionalRegister, intensity, userMessage);
|
|
243
|
+
const effective = this.emotionalTracker.getEffectiveEmotion();
|
|
244
|
+
adjustedMix = this.applyTrajectoryMultipliers(adjustedMix, effective.trajectory);
|
|
245
|
+
// Apply user's custom trait weight adjustments (history-aware when available)
|
|
246
|
+
if (this.preferenceHistory.getTraitHistory('warmth').length > 0 ||
|
|
247
|
+
Object.keys(this.customWeights.getOverrides()).length > 0) {
|
|
248
|
+
adjustedMix = this.customWeights.applyWithHistory(adjustedMix, context.domain, this.preferenceHistory);
|
|
249
|
+
}
|
|
250
|
+
const modifier = assemblePromptModifier(adjustedMix, context);
|
|
251
|
+
const sources = getActiveSources(adjustedMix);
|
|
252
|
+
// Fire-and-forget persistence of usage
|
|
253
|
+
if (this.persistence) {
|
|
254
|
+
this.persistence.recordUsage(context.domain).catch(() => { });
|
|
255
|
+
}
|
|
256
|
+
// Check for recommendations (only when no manual override is active)
|
|
257
|
+
let recommendation;
|
|
258
|
+
if (!this.contextOverride) {
|
|
259
|
+
const usageHistory = this.preferences?.contextUsageHistory ?? {};
|
|
260
|
+
recommendation = this.recommender.shouldRecommend(context, this.correctionStore, usageHistory, userMessage) ?? undefined;
|
|
261
|
+
}
|
|
262
|
+
// Gather relevant decisions and feedback insights
|
|
263
|
+
const dueFollowUps = this.decisionLog.getDueFollowUps();
|
|
264
|
+
const recentDomainDecisions = this.decisionLog.getRecentForDomain(context.domain, 5);
|
|
265
|
+
const relevantDecisions = [...dueFollowUps, ...recentDomainDecisions.filter(d => !dueFollowUps.some(f => f.id === d.id))];
|
|
266
|
+
const feedbackInsight = this.feedbackStore.getInsights();
|
|
267
|
+
const hasFeedbackInsight = feedbackInsight.totalFeedback > 0;
|
|
268
|
+
return {
|
|
269
|
+
basePrompt: ARCHITECT_BASE_PROMPT,
|
|
270
|
+
contextModifier: modifier,
|
|
271
|
+
fullPrompt: ARCHITECT_BASE_PROMPT + '\n\n' + modifier,
|
|
272
|
+
activeTraits: sources,
|
|
273
|
+
detectedContext: context,
|
|
274
|
+
emotionalTrajectory: effective.trajectory,
|
|
275
|
+
escalationAlert: effective.escalationAlert || undefined,
|
|
276
|
+
recommendation,
|
|
277
|
+
relevantDecisions: relevantDecisions.length > 0 ? relevantDecisions : undefined,
|
|
278
|
+
feedbackInsight: hasFeedbackInsight ? feedbackInsight : undefined,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Detects the full task context from a user message and optional
|
|
283
|
+
* conversation history. Exposed publicly for debugging and testing.
|
|
284
|
+
*/
|
|
285
|
+
detectContext(userMessage, history) {
|
|
286
|
+
return detectContext(userMessage, history, this.correctionStore);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Returns the fully modulated trait mix for a given context.
|
|
290
|
+
* Applies the domain's base profile and then emotional overrides.
|
|
291
|
+
*/
|
|
292
|
+
getTraitMix(context) {
|
|
293
|
+
const base = CONTEXT_PROFILES[context.domain];
|
|
294
|
+
return applyEmotionalOverride(base, context.emotionalRegister);
|
|
295
|
+
}
|
|
296
|
+
/** Returns the static base personality prompt. */
|
|
297
|
+
getBasePrompt() {
|
|
298
|
+
return ARCHITECT_BASE_PROMPT;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Forces a specific domain regardless of context detection.
|
|
302
|
+
* Pass `null` to return to automatic detection.
|
|
303
|
+
*/
|
|
304
|
+
setContextOverride(domain) {
|
|
305
|
+
this.contextOverride = domain;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Returns all 17 context domains with human-readable labels
|
|
309
|
+
* and one-line descriptions for UI rendering.
|
|
310
|
+
*/
|
|
311
|
+
listContextDomains() {
|
|
312
|
+
return DOMAIN_METADATA;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Returns the active trait sources for the given mix, or for
|
|
316
|
+
* the general profile if no mix is provided.
|
|
317
|
+
*/
|
|
318
|
+
getActiveSources(mix) {
|
|
319
|
+
const m = mix ?? CONTEXT_PROFILES['general'];
|
|
320
|
+
return getActiveSources(m);
|
|
321
|
+
}
|
|
322
|
+
// ── Conversation context ─────────────────────────────────────────────
|
|
323
|
+
/** Reset conversation context and emotional tracker for a new conversation. */
|
|
324
|
+
resetConversation() {
|
|
325
|
+
this.conversationContext.reset();
|
|
326
|
+
this.emotionalTracker.reset();
|
|
327
|
+
}
|
|
328
|
+
/** Get the conversation context summary. */
|
|
329
|
+
getConversationSummary() {
|
|
330
|
+
return this.conversationContext.getSummary();
|
|
331
|
+
}
|
|
332
|
+
/** Get the current emotional trajectory. */
|
|
333
|
+
getEmotionalState() {
|
|
334
|
+
return this.emotionalTracker.getEffectiveEmotion();
|
|
335
|
+
}
|
|
336
|
+
// ── Custom weights ───────────────────────────────────────────────────
|
|
337
|
+
/** Set a custom trait weight offset. Records in preference history and persists. */
|
|
338
|
+
async setTraitOverride(trait, offset, source = 'user', reason) {
|
|
339
|
+
this.customWeights.setOverride(trait, offset);
|
|
340
|
+
this.preferenceHistory.record({
|
|
341
|
+
trait,
|
|
342
|
+
offset,
|
|
343
|
+
context: this.contextOverride,
|
|
344
|
+
source,
|
|
345
|
+
reason,
|
|
346
|
+
});
|
|
347
|
+
await this.persistCustomWeights();
|
|
348
|
+
}
|
|
349
|
+
/** Remove a custom trait weight override. */
|
|
350
|
+
async removeTraitOverride(trait) {
|
|
351
|
+
this.customWeights.removeOverride(trait);
|
|
352
|
+
await this.persistCustomWeights();
|
|
353
|
+
}
|
|
354
|
+
/** Load a preset weight configuration. Records each override in preference history. */
|
|
355
|
+
async loadPreset(presetName) {
|
|
356
|
+
this.customWeights.loadPreset(presetName);
|
|
357
|
+
const overrides = this.customWeights.getOverrides();
|
|
358
|
+
for (const [trait, offset] of Object.entries(overrides)) {
|
|
359
|
+
this.preferenceHistory.record({
|
|
360
|
+
trait,
|
|
361
|
+
offset,
|
|
362
|
+
context: this.contextOverride,
|
|
363
|
+
source: 'preset',
|
|
364
|
+
reason: presetName,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
await this.persistCustomWeights();
|
|
368
|
+
}
|
|
369
|
+
/** Returns available weight presets. */
|
|
370
|
+
listPresets() {
|
|
371
|
+
return WEIGHT_PRESETS;
|
|
372
|
+
}
|
|
373
|
+
/** Returns current custom weight overrides. */
|
|
374
|
+
getActiveOverrides() {
|
|
375
|
+
return this.customWeights.getOverrides();
|
|
376
|
+
}
|
|
377
|
+
/** Persist custom weights and preference history to encrypted storage. */
|
|
378
|
+
async persistCustomWeights() {
|
|
379
|
+
if (!this.persistence)
|
|
380
|
+
return;
|
|
381
|
+
const prefs = await this.persistence.load();
|
|
382
|
+
prefs.customWeights = this.customWeights.serialize();
|
|
383
|
+
prefs.preferenceHistory = this.preferenceHistory.serialize();
|
|
384
|
+
await this.persistence.save(prefs);
|
|
385
|
+
this.preferences = prefs;
|
|
386
|
+
}
|
|
387
|
+
// ── Preference history ─────────────────────────────────────────────
|
|
388
|
+
/** Get conflicts in preference history. */
|
|
389
|
+
getPreferenceConflicts() {
|
|
390
|
+
return this.preferenceHistory.detectConflicts();
|
|
391
|
+
}
|
|
392
|
+
/** Get preference change history for a trait. */
|
|
393
|
+
getPreferenceHistory(trait) {
|
|
394
|
+
return this.preferenceHistory.getTraitHistory(trait);
|
|
395
|
+
}
|
|
396
|
+
// ── Decision log ──────────────────────────────────────────────────
|
|
397
|
+
/** Record a decision for cross-session tracking. */
|
|
398
|
+
async recordDecision(decision) {
|
|
399
|
+
const result = this.decisionLog.addDecision(decision);
|
|
400
|
+
await this.persistDecisionLog();
|
|
401
|
+
return result;
|
|
402
|
+
}
|
|
403
|
+
/** Update a decision's status or outcome. */
|
|
404
|
+
async updateDecision(id, updates) {
|
|
405
|
+
this.decisionLog.updateDecision(id, updates);
|
|
406
|
+
await this.persistDecisionLog();
|
|
407
|
+
}
|
|
408
|
+
/** Query decisions with filters. */
|
|
409
|
+
queryDecisions(q) {
|
|
410
|
+
return this.decisionLog.query(q);
|
|
411
|
+
}
|
|
412
|
+
/** Get decisions due for follow-up. */
|
|
413
|
+
getDueFollowUps() {
|
|
414
|
+
return this.decisionLog.getDueFollowUps();
|
|
415
|
+
}
|
|
416
|
+
/** Persist decision log to encrypted storage. */
|
|
417
|
+
async persistDecisionLog() {
|
|
418
|
+
if (!this.persistence)
|
|
419
|
+
return;
|
|
420
|
+
const prefs = await this.persistence.load();
|
|
421
|
+
prefs.decisionLog = this.decisionLog.serialize();
|
|
422
|
+
await this.persistence.save(prefs);
|
|
423
|
+
this.preferences = prefs;
|
|
424
|
+
}
|
|
425
|
+
// ── Feedback ──────────────────────────────────────────────────────
|
|
426
|
+
/** Record feedback on a response. */
|
|
427
|
+
async recordFeedback(feedback) {
|
|
428
|
+
this.feedbackStore.addFeedback({
|
|
429
|
+
domain: feedback.domain,
|
|
430
|
+
rating: feedback.rating,
|
|
431
|
+
traitSnapshot: feedback.traitSnapshot ?? {},
|
|
432
|
+
note: feedback.note,
|
|
433
|
+
});
|
|
434
|
+
await this.persistFeedbackStore();
|
|
435
|
+
}
|
|
436
|
+
/** Get actionable feedback insights. */
|
|
437
|
+
getFeedbackInsights() {
|
|
438
|
+
return this.feedbackStore.getInsights();
|
|
439
|
+
}
|
|
440
|
+
/** Get satisfaction trend over recent feedback. */
|
|
441
|
+
getFeedbackTrend(windowSize) {
|
|
442
|
+
return this.feedbackStore.getRecentTrend(windowSize);
|
|
443
|
+
}
|
|
444
|
+
/** Persist feedback store to encrypted storage. */
|
|
445
|
+
async persistFeedbackStore() {
|
|
446
|
+
if (!this.persistence)
|
|
447
|
+
return;
|
|
448
|
+
const prefs = await this.persistence.load();
|
|
449
|
+
prefs.feedbackStore = this.feedbackStore.serialize();
|
|
450
|
+
await this.persistence.save(prefs);
|
|
451
|
+
this.preferences = prefs;
|
|
452
|
+
}
|
|
453
|
+
// ── User model ───────────────────────────────────────────────────────
|
|
454
|
+
/** Synthesize a complete user model from all data stores. */
|
|
455
|
+
getUserModel() {
|
|
456
|
+
const synthesizer = new UserModelSynthesizer({
|
|
457
|
+
preferenceHistory: this.preferenceHistory,
|
|
458
|
+
decisionLog: this.decisionLog,
|
|
459
|
+
feedbackStore: this.feedbackStore,
|
|
460
|
+
correctionStore: this.correctionStore,
|
|
461
|
+
preferences: this.preferences,
|
|
462
|
+
});
|
|
463
|
+
return synthesizer.synthesize();
|
|
464
|
+
}
|
|
465
|
+
// ── Trajectory multipliers ──────────────────────────────────────────
|
|
466
|
+
/**
|
|
467
|
+
* Apply trajectory-based multipliers on top of standard emotional overrides.
|
|
468
|
+
* Caps all values at 1.0.
|
|
469
|
+
*/
|
|
470
|
+
applyTrajectoryMultipliers(mix, trajectory) {
|
|
471
|
+
if (trajectory === 'stable')
|
|
472
|
+
return mix;
|
|
473
|
+
const result = { ...mix };
|
|
474
|
+
const cap = (key, multiplier) => {
|
|
475
|
+
result[key] = Math.min(result[key] * multiplier, 1.0);
|
|
476
|
+
};
|
|
477
|
+
switch (trajectory) {
|
|
478
|
+
case 'escalating':
|
|
479
|
+
cap('warmth', 1.2);
|
|
480
|
+
cap('tacticalEmpathy', 1.2);
|
|
481
|
+
cap('stoicCalm', 1.2);
|
|
482
|
+
break;
|
|
483
|
+
case 'volatile':
|
|
484
|
+
cap('warmth', 1.3);
|
|
485
|
+
cap('stoicCalm', 1.3);
|
|
486
|
+
break;
|
|
487
|
+
case 'de_escalating':
|
|
488
|
+
// Gently normalize all override-affected traits
|
|
489
|
+
for (const key of Object.keys(result)) {
|
|
490
|
+
result[key] = Math.min(result[key] * 0.9, 1.0);
|
|
491
|
+
}
|
|
492
|
+
break;
|
|
493
|
+
case 'shifting':
|
|
494
|
+
// Slightly dampened to smooth the transition
|
|
495
|
+
for (const key of Object.keys(result)) {
|
|
496
|
+
result[key] = Math.min(result[key] * 0.8, 1.0);
|
|
497
|
+
}
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
return result;
|
|
501
|
+
}
|
|
502
|
+
// ── Correction learning ──────────────────────────────────────────────
|
|
503
|
+
/**
|
|
504
|
+
* Records a user correction so the engine can learn from misclassifications.
|
|
505
|
+
* Also persists the updated corrections to encrypted storage when available.
|
|
506
|
+
*/
|
|
507
|
+
async recordCorrection(userMessage, detectedDomain, correctedDomain) {
|
|
508
|
+
const emotionalRegister = detectContext(userMessage).emotionalRegister;
|
|
509
|
+
this.correctionStore.addCorrection({
|
|
510
|
+
userMessage,
|
|
511
|
+
messageLength: userMessage.length,
|
|
512
|
+
detectedDomain,
|
|
513
|
+
correctedDomain,
|
|
514
|
+
detectedEmotion: emotionalRegister,
|
|
515
|
+
});
|
|
516
|
+
if (this.persistence) {
|
|
517
|
+
await this.persistence.saveCorrections(this.correctionStore);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
/** Load corrections from serialized data (e.g. from encrypted vault). */
|
|
521
|
+
loadCorrections(serializedData) {
|
|
522
|
+
this.correctionStore = CorrectionStore.deserialize(serializedData);
|
|
523
|
+
}
|
|
524
|
+
/** Export corrections as a serialized string for encrypted storage. */
|
|
525
|
+
exportCorrections() {
|
|
526
|
+
return this.correctionStore.serialize();
|
|
527
|
+
}
|
|
528
|
+
/** Get correction statistics for debugging and transparency. */
|
|
529
|
+
getCorrectionStats() {
|
|
530
|
+
return this.correctionStore.getStats();
|
|
531
|
+
}
|
|
532
|
+
// ── Preferences ───────────────────────────────────────────────────────
|
|
533
|
+
/** Returns the current preferences. Falls back to in-memory defaults. */
|
|
534
|
+
async getPreferences() {
|
|
535
|
+
if (this.persistence) {
|
|
536
|
+
const prefs = await this.persistence.load();
|
|
537
|
+
this.preferences = prefs;
|
|
538
|
+
return prefs;
|
|
539
|
+
}
|
|
540
|
+
// Return a default snapshot when no persistence
|
|
541
|
+
return {
|
|
542
|
+
corrections: this.correctionStore.serialize(),
|
|
543
|
+
customWeights: this.customWeights.serialize(),
|
|
544
|
+
showContextIndicator: true,
|
|
545
|
+
showSourcesButton: true,
|
|
546
|
+
autoDetectContext: true,
|
|
547
|
+
defaultContext: null,
|
|
548
|
+
contextUsageHistory: {},
|
|
549
|
+
totalInteractions: 0,
|
|
550
|
+
firstUsed: 0,
|
|
551
|
+
lastUsed: 0,
|
|
552
|
+
version: 2,
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
/** Update a single preference and persist. */
|
|
556
|
+
async updatePreference(key, value) {
|
|
557
|
+
if (!this.persistence)
|
|
558
|
+
return;
|
|
559
|
+
const prefs = await this.persistence.load();
|
|
560
|
+
prefs[key] = value;
|
|
561
|
+
await this.persistence.save(prefs);
|
|
562
|
+
this.preferences = prefs;
|
|
563
|
+
// Apply side effects
|
|
564
|
+
if (key === 'defaultContext') {
|
|
565
|
+
this.contextOverride = value;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
/** Clear all persisted data: corrections, preferences, usage history, and self-awareness stores. */
|
|
569
|
+
async clearAllData() {
|
|
570
|
+
this.correctionStore = new CorrectionStore();
|
|
571
|
+
this.contextOverride = null;
|
|
572
|
+
this.preferences = undefined;
|
|
573
|
+
this.conversationContext.reset();
|
|
574
|
+
this.emotionalTracker.reset();
|
|
575
|
+
this.customWeights.clear();
|
|
576
|
+
this.preferenceHistory.clear();
|
|
577
|
+
this.decisionLog.clear();
|
|
578
|
+
this.feedbackStore.clear();
|
|
579
|
+
if (this.persistence) {
|
|
580
|
+
await this.persistence.clearAll();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
// ── Conversation export ────────────────────────────────────────────
|
|
584
|
+
/**
|
|
585
|
+
* Export a conversation with full personality engine metadata.
|
|
586
|
+
* Returns an ExportedConversation that can be serialized to JSON, Markdown, or CSV.
|
|
587
|
+
*/
|
|
588
|
+
exportConversation(messages, conversationId) {
|
|
589
|
+
const exporter = new ConversationExporter();
|
|
590
|
+
return exporter.export(messages, conversationId);
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Export a conversation in the specified format.
|
|
594
|
+
* @param format - 'json' | 'markdown' | 'csv'
|
|
595
|
+
*/
|
|
596
|
+
exportConversationAs(messages, conversationId, format) {
|
|
597
|
+
const exporter = new ConversationExporter();
|
|
598
|
+
const conversation = exporter.export(messages, conversationId);
|
|
599
|
+
switch (format) {
|
|
600
|
+
case 'json': return exporter.toJSON(conversation);
|
|
601
|
+
case 'markdown': return exporter.toMarkdown(conversation);
|
|
602
|
+
case 'csv': return exporter.toCSV(conversation);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
/** Export all stored data as JSON string (data portability). */
|
|
606
|
+
async exportData() {
|
|
607
|
+
if (this.persistence) {
|
|
608
|
+
return this.persistence.exportAll();
|
|
609
|
+
}
|
|
610
|
+
return JSON.stringify(await this.getPreferences(), null, 2);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
614
|
+
// Convenience factory
|
|
615
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
616
|
+
/** Creates a new Architect instance, optionally with encrypted persistence. */
|
|
617
|
+
export function createArchitect(storage) {
|
|
618
|
+
return new TheArchitect(storage);
|
|
619
|
+
}
|
|
620
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,mCAAmC;AACnC,+EAA+E;AAE/E,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC"}
|