@baselineos/persona 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.
@@ -0,0 +1,530 @@
1
+ import { EventEmitter } from 'events';
2
+
3
+ interface StudioConfig {
4
+ interface: {
5
+ layout: string;
6
+ colorScheme: string;
7
+ typography: string;
8
+ visualElements: string[];
9
+ };
10
+ lexicon: {
11
+ terminology: string[];
12
+ language: string;
13
+ abbreviations: string[];
14
+ };
15
+ frames: Record<string, string[]>;
16
+ templates: Record<string, string[]>;
17
+ workflows: Record<string, string[]>;
18
+ aiModels: Record<string, string[]>;
19
+ }
20
+ interface AgilePMConfig {
21
+ sprints: {
22
+ methodology: string;
23
+ cycles: string[];
24
+ duration: string;
25
+ };
26
+ userStories: Record<string, string[]>;
27
+ backlog: Record<string, string[]>;
28
+ analytics: Record<string, string[]>;
29
+ }
30
+ interface PersonaConfig {
31
+ name: string;
32
+ description: string;
33
+ focus: string[];
34
+ studio: StudioConfig;
35
+ agilePM: AgilePMConfig;
36
+ }
37
+ interface Persona extends PersonaConfig {
38
+ id: string;
39
+ createdAt: Date;
40
+ lastModified: Date;
41
+ usageCount: number;
42
+ adaptationScore: number;
43
+ customizations: Map<string, Record<string, unknown>>;
44
+ }
45
+ interface ActivePersona extends Persona {
46
+ userId: string;
47
+ activatedAt: Date;
48
+ sessionId: string;
49
+ }
50
+ interface BehaviorData {
51
+ type: string;
52
+ timestamp?: Date;
53
+ [key: string]: unknown;
54
+ }
55
+ interface BehaviorPattern {
56
+ type: string;
57
+ confidence: number;
58
+ data: BehaviorData[];
59
+ }
60
+ interface PersonaEngineConfig {
61
+ enableAutonomousLearning?: boolean;
62
+ enableBehavioralAnalysis?: boolean;
63
+ enablePredictiveCustomization?: boolean;
64
+ enableCrossPersonaSharing?: boolean;
65
+ }
66
+ interface PersonaRecommendation {
67
+ personaId: string;
68
+ score: number;
69
+ reasoning: string;
70
+ fitScores: {
71
+ pattern: number;
72
+ context: number;
73
+ persona: number;
74
+ };
75
+ }
76
+ interface PersonaAnalytics {
77
+ totalPersonas: number;
78
+ activePersonas: number;
79
+ totalBehaviors: number;
80
+ behaviorsByType: Record<string, number>;
81
+ totalAdaptations: number;
82
+ adaptationsByPersona: Record<string, number>;
83
+ adaptationsByUser: Record<string, number>;
84
+ averageAdaptationScore: number;
85
+ }
86
+ interface PersonaStatus$1 {
87
+ initialized: boolean;
88
+ totalPersonas: number;
89
+ activePersonas: number;
90
+ behaviorDataPoints: number;
91
+ adaptationsApplied: number;
92
+ config: PersonaEngineConfig;
93
+ }
94
+ declare class BaselinePersonaEngine extends EventEmitter {
95
+ private personas;
96
+ private activePersonas;
97
+ private behaviorData;
98
+ private adaptations;
99
+ private config;
100
+ private initialized;
101
+ constructor(config?: PersonaEngineConfig);
102
+ private initializeCorePersonas;
103
+ private initializeEventListeners;
104
+ addPersona(id: string, config: PersonaConfig): Persona;
105
+ setActivePersona(personaId: string, userId: string): ActivePersona;
106
+ getActivePersona(userId: string): ActivePersona | undefined;
107
+ getStudioConfig(userId: string): StudioConfig | null;
108
+ getAgilePMConfig(userId: string): AgilePMConfig | null;
109
+ customizePersona(personaId: string, userId: string, customizations: Record<string, unknown>): Persona;
110
+ getPersonalizedPersona(personaId: string, userId: string): Persona | null;
111
+ switchPersona(userId: string, newPersonaId: string): ActivePersona;
112
+ learnFromBehavior(userId: string, behavior: BehaviorData): void;
113
+ analyzeBehaviorPatterns(userId: string): BehaviorPattern[];
114
+ private identifyPattern;
115
+ private identifyWorkflowPattern;
116
+ private identifyToolPreferencePattern;
117
+ private identifyTimePattern;
118
+ private identifyCollaborationPattern;
119
+ private adaptPersonaAutonomously;
120
+ private generateAdaptation;
121
+ private generateWorkflowAdaptation;
122
+ private generateToolAdaptation;
123
+ private generateTimeAdaptation;
124
+ private generateCollaborationAdaptation;
125
+ private applyPersonaAdaptation;
126
+ getPersonaRecommendations(userId: string, context?: Record<string, unknown>): PersonaRecommendation[];
127
+ calculatePersonaFitScore(persona: Persona, behaviors: BehaviorData[]): number;
128
+ private calculatePatternFitScore;
129
+ private calculateContextFitScore;
130
+ private generateRecommendationReasoning;
131
+ private deepMerge;
132
+ private calculateCustomizationLevel;
133
+ private extractContextData;
134
+ private getPatternWeight;
135
+ getStatus(): PersonaStatus$1;
136
+ getAnalytics(): PersonaAnalytics;
137
+ private countBehaviorTypes;
138
+ private groupAdaptationsByPersona;
139
+ private groupAdaptationsByUser;
140
+ }
141
+
142
+ interface UIComponent {
143
+ id: string;
144
+ type: string;
145
+ visible: boolean;
146
+ position: {
147
+ x: number;
148
+ y: number;
149
+ };
150
+ size: {
151
+ width: number;
152
+ height: number;
153
+ };
154
+ config: Record<string, unknown>;
155
+ state: Record<string, unknown>;
156
+ }
157
+ interface PersonaOption {
158
+ id: string;
159
+ name: string;
160
+ description: string;
161
+ focus: string[];
162
+ icon?: string;
163
+ color?: string;
164
+ }
165
+ interface WorkflowStep {
166
+ id: string;
167
+ name: string;
168
+ description: string;
169
+ status: 'pending' | 'active' | 'completed' | 'skipped' | 'failed';
170
+ startedAt?: Date;
171
+ completedAt?: Date;
172
+ data: Record<string, unknown>;
173
+ }
174
+ interface WorkflowInstance {
175
+ id: string;
176
+ type: string;
177
+ personaId: string;
178
+ userId: string;
179
+ parameters: Record<string, unknown>;
180
+ startTime: Date;
181
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
182
+ progress: number;
183
+ steps: WorkflowStep[];
184
+ results: Record<string, unknown>;
185
+ endTime?: Date;
186
+ error?: string;
187
+ }
188
+ interface ProgressState {
189
+ workflowId: string;
190
+ phase: string;
191
+ percentage: number;
192
+ currentStep: string;
193
+ stepsCompleted: number;
194
+ totalSteps: number;
195
+ estimatedTimeRemaining?: number;
196
+ startedAt: Date;
197
+ }
198
+ interface ResultDisplay {
199
+ id: string;
200
+ workflowId: string;
201
+ type: string;
202
+ title: string;
203
+ data: Record<string, unknown>;
204
+ format: string;
205
+ createdAt: Date;
206
+ }
207
+ interface SelectorState {
208
+ isOpen: boolean;
209
+ selectedPersonaId: string | null;
210
+ hoveredPersonaId: string | null;
211
+ searchQuery: string;
212
+ filteredOptions: PersonaOption[];
213
+ }
214
+ interface StudioState {
215
+ activeFrames: string[];
216
+ layout: string;
217
+ theme: string;
218
+ panels: UIComponent[];
219
+ toolbars: UIComponent[];
220
+ }
221
+ interface UISystemConfig {
222
+ defaultLayout?: string;
223
+ defaultTheme?: string;
224
+ enableAnimations?: boolean;
225
+ enableTransitions?: boolean;
226
+ selectorPosition?: string;
227
+ maxWorkflows?: number;
228
+ progressUpdateInterval?: number;
229
+ }
230
+ declare class PersonaUISystem extends EventEmitter {
231
+ private engine;
232
+ private components;
233
+ private selectorState;
234
+ private studioState;
235
+ private workflows;
236
+ private progressStates;
237
+ private resultDisplays;
238
+ private config;
239
+ private initialized;
240
+ constructor(engine: BaselinePersonaEngine, config?: UISystemConfig);
241
+ private initializeComponents;
242
+ private initializeEventListeners;
243
+ registerComponent(component: UIComponent): void;
244
+ getComponent(id: string): UIComponent | undefined;
245
+ updateComponent(id: string, updates: Partial<UIComponent>): UIComponent | null;
246
+ showComponent(id: string): void;
247
+ hideComponent(id: string): void;
248
+ removeComponent(id: string): boolean;
249
+ getAllComponents(): UIComponent[];
250
+ getVisibleComponents(): UIComponent[];
251
+ openSelector(): void;
252
+ closeSelector(): void;
253
+ toggleSelector(): void;
254
+ setSearchQuery(query: string): PersonaOption[];
255
+ private filterPersonaOptions;
256
+ getPersonaOptions(): PersonaOption[];
257
+ private getDefaultPersonaOption;
258
+ hoverPersona(personaId: string): void;
259
+ selectPersona(personaId: string, userId: string): void;
260
+ getSelectorState(): SelectorState;
261
+ private handlePersonaSelection;
262
+ private applyPersonaToStudio;
263
+ private generatePanels;
264
+ private generateToolbars;
265
+ getStudioState(): StudioState;
266
+ startWorkflow(type: string, personaId: string, userId: string, parameters?: Record<string, unknown>): WorkflowInstance;
267
+ private generateWorkflowSteps;
268
+ private runWorkflow;
269
+ private executeWorkflowStep;
270
+ private generateResults;
271
+ private generateArtifacts;
272
+ cancelWorkflow(workflowId: string): boolean;
273
+ getWorkflow(workflowId: string): WorkflowInstance | undefined;
274
+ getActiveWorkflows(): WorkflowInstance[];
275
+ getCompletedWorkflows(): WorkflowInstance[];
276
+ getAllWorkflows(): WorkflowInstance[];
277
+ private updateProgress;
278
+ getProgress(workflowId: string): ProgressState | undefined;
279
+ getAllProgress(): ProgressState[];
280
+ getActiveProgress(): ProgressState[];
281
+ createResultDisplay(workflowId: string, type: string, title: string, data: Record<string, unknown>, format?: string): ResultDisplay;
282
+ getResultDisplay(resultId: string): ResultDisplay | undefined;
283
+ getResultsForWorkflow(workflowId: string): ResultDisplay[];
284
+ getAllResults(): ResultDisplay[];
285
+ removeResultDisplay(resultId: string): boolean;
286
+ clearResults(): void;
287
+ setLayout(layout: string): void;
288
+ setTheme(theme: string): void;
289
+ getLayout(): string;
290
+ getTheme(): string;
291
+ activateFrame(frameId: string): void;
292
+ deactivateFrame(frameId: string): void;
293
+ getActiveFrames(): string[];
294
+ setActiveFrames(frameIds: string[]): void;
295
+ getStatus(): Record<string, unknown>;
296
+ getUIAnalytics(): Record<string, unknown>;
297
+ dispose(): void;
298
+ }
299
+
300
+ interface Story {
301
+ id: string;
302
+ title: string;
303
+ description: string;
304
+ points: number;
305
+ priority: string;
306
+ assignee?: string;
307
+ status: string;
308
+ acceptance: string[];
309
+ completedAt?: string;
310
+ updatedAt?: string;
311
+ }
312
+ interface Sprint {
313
+ id: string;
314
+ name: string;
315
+ startDate: string;
316
+ endDate: string;
317
+ goals: string[];
318
+ stories: Story[];
319
+ team: string[];
320
+ status: string;
321
+ }
322
+ interface BacklogItem {
323
+ id: string;
324
+ title: string;
325
+ description: string;
326
+ type: string;
327
+ priority: string;
328
+ points: number;
329
+ epic?: string;
330
+ createdAt: string;
331
+ }
332
+ interface VelocityData {
333
+ sprintId: string;
334
+ sprintName: string;
335
+ plannedPoints: number;
336
+ completedPoints: number;
337
+ velocity: number;
338
+ }
339
+ interface BurndownEntry {
340
+ day: number;
341
+ date: string;
342
+ idealRemaining: number;
343
+ actualRemaining: number;
344
+ }
345
+ interface SprintReport {
346
+ sprint: Sprint;
347
+ totalStories: number;
348
+ completedStories: number;
349
+ totalPoints: number;
350
+ completedPoints: number;
351
+ completionRate: number;
352
+ velocity: number;
353
+ storiesByStatus: Record<string, number>;
354
+ storiesByPriority: Record<string, number>;
355
+ }
356
+ interface WorkspaceData$1 {
357
+ sprints: Sprint[];
358
+ backlog: BacklogItem[];
359
+ lastUpdated: string;
360
+ }
361
+ interface PersonaStatus {
362
+ persona: string;
363
+ activeSprints: number;
364
+ totalStories: number;
365
+ backlogSize: number;
366
+ averageVelocity: number;
367
+ completedSprints: number;
368
+ }
369
+ declare class AgileProductManagerPersona extends EventEmitter {
370
+ private sprints;
371
+ private backlog;
372
+ private velocityHistory;
373
+ private workspacePath;
374
+ constructor(workspacePath?: string);
375
+ createSprint(name: string, startDate: string, duration: number, goals: string[], team: string[]): Sprint;
376
+ addStoryToSprint(sprintId: string, story: Omit<Story, 'id' | 'status' | 'updatedAt'>): Story;
377
+ updateStoryStatus(sprintId: string, storyId: string, newStatus: string): Story;
378
+ addToBacklog(item: Omit<BacklogItem, 'id' | 'createdAt'>): BacklogItem;
379
+ prioritizeBacklog(criteria?: string): BacklogItem[];
380
+ calculateVelocity(sprintId: string): VelocityData;
381
+ generateSprintReport(sprintId: string): SprintReport;
382
+ generateBurndownData(sprintId: string): BurndownEntry[];
383
+ private calculateEndDate;
384
+ loadWorkspaceData(): Promise<WorkspaceData$1 | null>;
385
+ saveWorkspaceData(): Promise<void>;
386
+ getPersonaStatus(): PersonaStatus;
387
+ }
388
+
389
+ interface Task {
390
+ id: string;
391
+ title: string;
392
+ description: string;
393
+ type: string;
394
+ priority: string;
395
+ estimatedHours: number;
396
+ assignedAt: string;
397
+ status: string;
398
+ }
399
+ interface TeamMember {
400
+ id: string;
401
+ name: string;
402
+ role: string;
403
+ skills: string[];
404
+ capacity: number;
405
+ currentTasks: Task[];
406
+ performance: {
407
+ velocity: number;
408
+ quality: number;
409
+ collaboration: number;
410
+ };
411
+ joinedAt: string;
412
+ }
413
+ interface ReviewComment {
414
+ id: string;
415
+ author: string;
416
+ content: string;
417
+ line?: number;
418
+ file?: string;
419
+ type: string;
420
+ createdAt: string;
421
+ }
422
+ interface CodeReview {
423
+ id: string;
424
+ title: string;
425
+ description: string;
426
+ files: string[];
427
+ reviewer: string;
428
+ author: string;
429
+ status: string;
430
+ comments: ReviewComment[];
431
+ createdAt: string;
432
+ approvedAt?: string;
433
+ approver?: string;
434
+ }
435
+ interface TechDebtItem {
436
+ id: string;
437
+ title: string;
438
+ description: string;
439
+ category: string;
440
+ severity: string;
441
+ estimatedEffort: number;
442
+ impact: string;
443
+ file?: string;
444
+ line?: number;
445
+ identifiedAt: string;
446
+ resolvedAt?: string;
447
+ status: string;
448
+ }
449
+ interface CodebaseAnalysis {
450
+ totalFiles: number;
451
+ filesByType: Record<string, number>;
452
+ filesByExtension: Record<string, number>;
453
+ totalLines?: number;
454
+ codeQualityScore: number;
455
+ techDebtItems: number;
456
+ analyzedAt: string;
457
+ }
458
+ interface BuildResult {
459
+ id: string;
460
+ status: string;
461
+ command: string;
462
+ startTime: string;
463
+ endTime?: string;
464
+ duration?: number;
465
+ output: string;
466
+ errors: string[];
467
+ }
468
+ interface TestResult {
469
+ id: string;
470
+ status: string;
471
+ command: string;
472
+ startTime: string;
473
+ endTime?: string;
474
+ duration?: number;
475
+ passed: number;
476
+ failed: number;
477
+ skipped: number;
478
+ output: string;
479
+ }
480
+ interface WorkspaceData {
481
+ team: TeamMember[];
482
+ reviews: CodeReview[];
483
+ techDebt: TechDebtItem[];
484
+ lastUpdated: string;
485
+ }
486
+ interface DevLeadStatus {
487
+ persona: string;
488
+ teamSize: number;
489
+ activeReviews: number;
490
+ techDebtItems: number;
491
+ openTasks: number;
492
+ teamCapacity: number;
493
+ averageQuality: number;
494
+ }
495
+ declare class SoftwareDevelopmentLeadPersona extends EventEmitter {
496
+ private team;
497
+ private reviews;
498
+ private techDebt;
499
+ private builds;
500
+ private tests;
501
+ private workspacePath;
502
+ constructor(workspacePath?: string);
503
+ addTeamMember(name: string, role: string, skills: string[], capacity?: number): TeamMember;
504
+ assignTask(memberId: string, taskData: Omit<Task, 'id' | 'assignedAt' | 'status'>): Task;
505
+ initiateCodeReview(title: string, description: string, files: string[], author: string, reviewer: string): CodeReview;
506
+ addReviewComment(reviewId: string, author: string, content: string, options?: {
507
+ line?: number;
508
+ file?: string;
509
+ type?: string;
510
+ }): ReviewComment;
511
+ approveCodeReview(reviewId: string, approver: string): CodeReview;
512
+ identifyTechnicalDebt(title: string, description: string, category: string, severity: string, estimatedEffort: number, impact: string, options?: {
513
+ file?: string;
514
+ line?: number;
515
+ }): TechDebtItem;
516
+ prioritizeTechnicalDebt(criteria?: string): TechDebtItem[];
517
+ analyzeCodebase(directory: string): Promise<CodebaseAnalysis>;
518
+ private countFilesByType;
519
+ private countFilesByExtension;
520
+ private scanCodebase;
521
+ private calculateCodeQualityScore;
522
+ runBuild(command?: string): Promise<BuildResult>;
523
+ runTests(command?: string): Promise<TestResult>;
524
+ fileExists(filePath: string): Promise<boolean>;
525
+ loadWorkspaceData(): Promise<WorkspaceData | null>;
526
+ saveWorkspaceData(): Promise<void>;
527
+ getPersonaStatus(): DevLeadStatus;
528
+ }
529
+
530
+ export { type ActivePersona, type AgilePMConfig, AgileProductManagerPersona, type BacklogItem, BaselinePersonaEngine, type BehaviorData, type BehaviorPattern, type CodeReview, type Persona, type PersonaConfig, type PersonaEngineConfig, type PersonaOption, PersonaUISystem, type ReviewComment, SoftwareDevelopmentLeadPersona, type Sprint, type Story, type StudioConfig, type Task, type TeamMember, type WorkflowInstance };