@baselineos/autonomy 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/.turbo/turbo-build.log +14 -0
- package/.turbo/turbo-test.log +14 -0
- package/LICENSE +17 -0
- package/README.md +19 -0
- package/dist/index.d.ts +539 -0
- package/dist/index.js +2540 -0
- package/package.json +34 -0
- package/src/__tests__/smoke.test.ts +24 -0
- package/src/index.ts +62 -0
- package/src/integration.ts +600 -0
- package/src/lifecycle.ts +1323 -0
- package/src/mastra-engine.ts +1097 -0
- package/src/system.ts +654 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/autonomy@0.1.0 build /home/runner/work/baseline/baseline/packages/autonomy
|
|
3
|
+
> tsup src/index.ts --format esm --dts
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m89.50 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 210ms
|
|
12
|
+
[34mDTS[39m Build start
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 16026ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m15.84 KB[39m
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
> @baselineos/autonomy@0.1.0 test /home/runner/work/baseline/baseline/packages/autonomy
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[7m[36m RUN [39m[27m[22m [36mv2.1.9 [39m[90m/home/runner/work/baseline/baseline/packages/autonomy[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m src/__tests__/smoke.test.ts [2m([22m[2m2 tests[22m[2m)[22m[90m 17[2mms[22m[39m
|
|
9
|
+
|
|
10
|
+
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
11
|
+
[2m Tests [22m [1m[32m2 passed[39m[22m[90m (2)[39m
|
|
12
|
+
[2m Start at [22m 14:02:30
|
|
13
|
+
[2m Duration [22m 3.80s[2m (transform 1.79s, setup 0ms, collect 2.03s, tests 17ms, environment 0ms, prepare 706ms)[22m
|
|
14
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 Baseline Protocol Foundation
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# @baselineos/autonomy
|
|
2
|
+
|
|
3
|
+
Autonomy layer package for Baseline.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Implements agent autonomy runtime behavior and contracts used by `baselineos` and the CLI orchestration flow.
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm --filter @baselineos/autonomy build
|
|
13
|
+
pnpm --filter @baselineos/autonomy test
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Integration
|
|
17
|
+
|
|
18
|
+
- Depends on: `@baselineos/protocol-core`
|
|
19
|
+
- Consumed by: `@baselineos/cli`, `baselineos`
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import { EventEmitter as EventEmitter$1 } from 'events';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Baseline Autonomy System — Layer 6
|
|
6
|
+
*
|
|
7
|
+
* Autonomous AI operations layer of the Baseline Protocol providing
|
|
8
|
+
* autonomous agents framework, trust & safety governance, flag system
|
|
9
|
+
* & resolution, and challenge system integration.
|
|
10
|
+
*
|
|
11
|
+
* @license Apache-2.0
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
type SafetyLevel = 'safe' | 'warning' | 'critical' | 'high' | 'medium';
|
|
15
|
+
type AgentStatus = 'idle' | 'initializing' | 'ready' | 'executing' | 'error' | 'suspended' | 'shutting_down' | 'shutdown';
|
|
16
|
+
type TaskType = 'data_processing' | 'decision_making' | 'system_operation' | 'communication';
|
|
17
|
+
interface AgentConfig {
|
|
18
|
+
id?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
type?: string;
|
|
21
|
+
capabilities?: string[];
|
|
22
|
+
}
|
|
23
|
+
interface AgentTask$1 {
|
|
24
|
+
id: string;
|
|
25
|
+
type: TaskType;
|
|
26
|
+
description: string;
|
|
27
|
+
startTime: number;
|
|
28
|
+
trustRequirement?: number;
|
|
29
|
+
requiresElevatedPermissions?: boolean;
|
|
30
|
+
involvesSensitiveData?: boolean;
|
|
31
|
+
dataType?: string;
|
|
32
|
+
potentialSystemImpact?: 'low' | 'medium' | 'high';
|
|
33
|
+
dataSize?: number;
|
|
34
|
+
options?: DecisionOption[];
|
|
35
|
+
operation?: string;
|
|
36
|
+
system?: string;
|
|
37
|
+
message?: string;
|
|
38
|
+
recipient?: string;
|
|
39
|
+
}
|
|
40
|
+
interface DecisionOption {
|
|
41
|
+
risk?: 'low' | 'medium' | 'high';
|
|
42
|
+
efficiency?: 'low' | 'medium' | 'high';
|
|
43
|
+
cost?: 'low' | 'medium' | 'high';
|
|
44
|
+
impact?: 'low' | 'medium' | 'high';
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
interface TaskResult$1 {
|
|
48
|
+
taskId: string;
|
|
49
|
+
type: string;
|
|
50
|
+
status: string;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
interface PerformanceMetrics {
|
|
54
|
+
tasksCompleted: number;
|
|
55
|
+
tasksFailed: number;
|
|
56
|
+
averageResponseTime: number;
|
|
57
|
+
trustScore: number;
|
|
58
|
+
}
|
|
59
|
+
interface LearningModel {
|
|
60
|
+
decisionHistory: Array<{
|
|
61
|
+
task: AgentTask$1;
|
|
62
|
+
result: TaskResult$1;
|
|
63
|
+
timestamp: number;
|
|
64
|
+
}>;
|
|
65
|
+
performanceHistory: Array<{
|
|
66
|
+
taskId: string;
|
|
67
|
+
success: boolean;
|
|
68
|
+
responseTime: number;
|
|
69
|
+
trustScore: number;
|
|
70
|
+
}>;
|
|
71
|
+
adaptationRate: number;
|
|
72
|
+
}
|
|
73
|
+
interface ViolationFlag {
|
|
74
|
+
id: string;
|
|
75
|
+
type: string;
|
|
76
|
+
severity: string;
|
|
77
|
+
taskId: string;
|
|
78
|
+
agentId: string;
|
|
79
|
+
description: string;
|
|
80
|
+
timestamp: number;
|
|
81
|
+
status: 'open' | 'resolved' | 'requires_manual_resolution';
|
|
82
|
+
resolvedAt?: number;
|
|
83
|
+
}
|
|
84
|
+
interface SafetyAlert {
|
|
85
|
+
agentId: string;
|
|
86
|
+
level: string;
|
|
87
|
+
message: string;
|
|
88
|
+
timestamp: number;
|
|
89
|
+
}
|
|
90
|
+
interface SafetyProtocol$1 {
|
|
91
|
+
id: string;
|
|
92
|
+
name: string;
|
|
93
|
+
description: string;
|
|
94
|
+
rules: string[];
|
|
95
|
+
enforcement: string;
|
|
96
|
+
}
|
|
97
|
+
interface AgentType {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
capabilities: string[];
|
|
102
|
+
trustRequirement: number;
|
|
103
|
+
safetyLevel: string;
|
|
104
|
+
}
|
|
105
|
+
interface AgentStatusReport {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
type: string;
|
|
109
|
+
status: AgentStatus;
|
|
110
|
+
trustScore: number;
|
|
111
|
+
safetyLevel: SafetyLevel;
|
|
112
|
+
currentTask: AgentTask$1 | null;
|
|
113
|
+
performanceMetrics: PerformanceMetrics;
|
|
114
|
+
capabilities: string[];
|
|
115
|
+
}
|
|
116
|
+
interface SystemStatus {
|
|
117
|
+
systemId: string;
|
|
118
|
+
version: string;
|
|
119
|
+
status: string;
|
|
120
|
+
agentCount: number;
|
|
121
|
+
agentTypes: number;
|
|
122
|
+
safetyProtocols: number;
|
|
123
|
+
flagCount: number;
|
|
124
|
+
challengeSystem: string;
|
|
125
|
+
}
|
|
126
|
+
declare class AutonomousAgent extends EventEmitter {
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly name: string;
|
|
129
|
+
readonly type: string;
|
|
130
|
+
capabilities: string[];
|
|
131
|
+
status: AgentStatus;
|
|
132
|
+
taskQueue: AgentTask$1[];
|
|
133
|
+
currentTask: AgentTask$1 | null;
|
|
134
|
+
trustScore: number;
|
|
135
|
+
safetyLevel: SafetyLevel;
|
|
136
|
+
learningRate: number;
|
|
137
|
+
performanceMetrics: PerformanceMetrics;
|
|
138
|
+
learningModel: LearningModel;
|
|
139
|
+
private monitoringInterval;
|
|
140
|
+
constructor(config?: AgentConfig);
|
|
141
|
+
initialize(): Promise<void>;
|
|
142
|
+
private loadCapabilities;
|
|
143
|
+
private startMonitoring;
|
|
144
|
+
executeTask(task: AgentTask$1): Promise<TaskResult$1>;
|
|
145
|
+
private validateTaskSafety;
|
|
146
|
+
private runSafetyCheck;
|
|
147
|
+
private checkSafetyRule;
|
|
148
|
+
private performTask;
|
|
149
|
+
private evaluateOptions;
|
|
150
|
+
private calculateOptionScore;
|
|
151
|
+
private calculateConfidence;
|
|
152
|
+
private updateTaskMetrics;
|
|
153
|
+
private learnFromExecution;
|
|
154
|
+
private handleTaskError;
|
|
155
|
+
private updatePerformanceMetrics;
|
|
156
|
+
private checkSafetyProtocols;
|
|
157
|
+
getStatus(): AgentStatusReport;
|
|
158
|
+
shutdown(): Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
declare class BaselineAutonomySystem extends EventEmitter {
|
|
161
|
+
readonly systemId: string;
|
|
162
|
+
readonly version = "1.0.0";
|
|
163
|
+
status: string;
|
|
164
|
+
private agents;
|
|
165
|
+
private agentTypes;
|
|
166
|
+
private safetyProtocols;
|
|
167
|
+
private flagSystem;
|
|
168
|
+
constructor(config?: {
|
|
169
|
+
systemId?: string;
|
|
170
|
+
});
|
|
171
|
+
initialize(): Promise<void>;
|
|
172
|
+
private initializeSafetyProtocols;
|
|
173
|
+
private initializeAgentTypes;
|
|
174
|
+
private initializeFlagSystem;
|
|
175
|
+
createAgent(config: AgentConfig): Promise<AutonomousAgent>;
|
|
176
|
+
private validateAgentConfig;
|
|
177
|
+
private setupAgentEventListeners;
|
|
178
|
+
private handleViolationFlag;
|
|
179
|
+
private handleSafetyAlert;
|
|
180
|
+
private attemptFlagResolution;
|
|
181
|
+
getSystemStatus(): SystemStatus;
|
|
182
|
+
getAllAgents(): AgentStatusReport[];
|
|
183
|
+
getAgent(agentId: string): AgentStatusReport | null;
|
|
184
|
+
shutdown(): Promise<void>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface LifecycleStage {
|
|
188
|
+
id: string;
|
|
189
|
+
name: string;
|
|
190
|
+
description: string;
|
|
191
|
+
order: number;
|
|
192
|
+
required: boolean;
|
|
193
|
+
autoTransition: boolean;
|
|
194
|
+
}
|
|
195
|
+
interface StageHistoryEntry {
|
|
196
|
+
stage: string;
|
|
197
|
+
timestamp: number;
|
|
198
|
+
status: string;
|
|
199
|
+
error?: string;
|
|
200
|
+
}
|
|
201
|
+
interface AgentDeployment {
|
|
202
|
+
agentId: string;
|
|
203
|
+
agentName: string;
|
|
204
|
+
currentStage: string;
|
|
205
|
+
stageHistory: StageHistoryEntry[];
|
|
206
|
+
startTime: number;
|
|
207
|
+
status: string;
|
|
208
|
+
metrics: {
|
|
209
|
+
stageTransitions: number;
|
|
210
|
+
totalTime: number;
|
|
211
|
+
errors: number;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
interface ScalingPolicy {
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
description: string;
|
|
218
|
+
triggers: string[];
|
|
219
|
+
actions: string[];
|
|
220
|
+
thresholds: Record<string, number>;
|
|
221
|
+
}
|
|
222
|
+
interface RetirementPolicy {
|
|
223
|
+
id: string;
|
|
224
|
+
name: string;
|
|
225
|
+
description: string;
|
|
226
|
+
criteria: string[];
|
|
227
|
+
thresholds: Record<string, number>;
|
|
228
|
+
gracePeriod: number;
|
|
229
|
+
}
|
|
230
|
+
interface HealthMonitor {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
metrics: string[];
|
|
234
|
+
interval: number;
|
|
235
|
+
thresholds: Record<string, number | string>;
|
|
236
|
+
}
|
|
237
|
+
interface ThresholdViolation {
|
|
238
|
+
metric: string;
|
|
239
|
+
value: number;
|
|
240
|
+
threshold: number | string;
|
|
241
|
+
severity: string;
|
|
242
|
+
}
|
|
243
|
+
interface LifecycleStatus {
|
|
244
|
+
agentId: string;
|
|
245
|
+
agentName: string;
|
|
246
|
+
currentStage: string;
|
|
247
|
+
status: string;
|
|
248
|
+
stageHistory: StageHistoryEntry[];
|
|
249
|
+
metrics: AgentDeployment['metrics'];
|
|
250
|
+
uptime: number;
|
|
251
|
+
}
|
|
252
|
+
interface Alert {
|
|
253
|
+
id: string;
|
|
254
|
+
type: string;
|
|
255
|
+
severity: string;
|
|
256
|
+
message: string;
|
|
257
|
+
agentId: string;
|
|
258
|
+
timestamp: number;
|
|
259
|
+
violations: ThresholdViolation[];
|
|
260
|
+
}
|
|
261
|
+
declare class AgentLifecycleManager extends EventEmitter$1 {
|
|
262
|
+
private autonomySystem;
|
|
263
|
+
private lifecycleStages;
|
|
264
|
+
private agentDeployments;
|
|
265
|
+
private scalingPolicies;
|
|
266
|
+
private retirementPolicies;
|
|
267
|
+
private healthMonitors;
|
|
268
|
+
constructor(autonomySystem: unknown);
|
|
269
|
+
initialize(): Promise<void>;
|
|
270
|
+
private initializeLifecycleStages;
|
|
271
|
+
private initializeScalingPolicies;
|
|
272
|
+
private initializeRetirementPolicies;
|
|
273
|
+
private initializeHealthMonitoring;
|
|
274
|
+
createAndDeployAgent(agentName: string, agentConfig?: Record<string, unknown>): Promise<AgentDeployment>;
|
|
275
|
+
private initializeAgentLifecycle;
|
|
276
|
+
private executeLifecycleStages;
|
|
277
|
+
private executeStage;
|
|
278
|
+
private executeCreationStage;
|
|
279
|
+
private executeValidationStage;
|
|
280
|
+
private executeDeploymentStage;
|
|
281
|
+
private executeActivationStage;
|
|
282
|
+
private executeMonitoringStage;
|
|
283
|
+
private executeScalingStage;
|
|
284
|
+
private executeMaintenanceStage;
|
|
285
|
+
private executeRetirementStage;
|
|
286
|
+
private simulateDeployment;
|
|
287
|
+
private startAutonomousOperations;
|
|
288
|
+
private startComprehensiveMonitoring;
|
|
289
|
+
private startHealthMonitor;
|
|
290
|
+
private collectMetrics;
|
|
291
|
+
private checkThresholdViolations;
|
|
292
|
+
private calculateViolationSeverity;
|
|
293
|
+
private handleThresholdViolations;
|
|
294
|
+
private handleCriticalViolation;
|
|
295
|
+
private handleHighViolation;
|
|
296
|
+
private handleLowViolation;
|
|
297
|
+
private generateAlert;
|
|
298
|
+
private increaseMonitoringFrequency;
|
|
299
|
+
private checkScalingNeeded;
|
|
300
|
+
private evaluateScalingPolicy;
|
|
301
|
+
private executeScaling;
|
|
302
|
+
private checkMaintenanceNeeded;
|
|
303
|
+
private executeMaintenance;
|
|
304
|
+
private checkRetirementNeeded;
|
|
305
|
+
private evaluateRetirementPolicy;
|
|
306
|
+
private executeRetirement;
|
|
307
|
+
getLifecycleStatus(agentId: string): LifecycleStatus | null;
|
|
308
|
+
getAllLifecycleStatuses(): LifecycleStatus[];
|
|
309
|
+
private delay;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
type MigrationMode = 'parallel' | 'progressive' | 'full';
|
|
313
|
+
interface IntegrationPoint {
|
|
314
|
+
layer: string;
|
|
315
|
+
purpose: string;
|
|
316
|
+
integration: string;
|
|
317
|
+
status: string;
|
|
318
|
+
}
|
|
319
|
+
interface MigrationComponentStatus {
|
|
320
|
+
component: string;
|
|
321
|
+
currentStatus: string;
|
|
322
|
+
targetStatus: string;
|
|
323
|
+
migrationProgress: number;
|
|
324
|
+
dependencies: string[];
|
|
325
|
+
estimatedCompletion: string;
|
|
326
|
+
}
|
|
327
|
+
interface ComparisonResult {
|
|
328
|
+
timestamp: Date;
|
|
329
|
+
legacyResult: string;
|
|
330
|
+
newResult: string;
|
|
331
|
+
quality: Record<string, unknown>;
|
|
332
|
+
performance: Record<string, unknown>;
|
|
333
|
+
recommendation: string | null;
|
|
334
|
+
}
|
|
335
|
+
interface IntegrationStatus {
|
|
336
|
+
migrationMode: MigrationMode;
|
|
337
|
+
integrationPoints: IntegrationPoint[];
|
|
338
|
+
migrationStatus: MigrationComponentStatus[];
|
|
339
|
+
comparisonHistory: ComparisonResult[];
|
|
340
|
+
statistics: {
|
|
341
|
+
totalComparisons: number;
|
|
342
|
+
averageQualityImprovement: number;
|
|
343
|
+
averagePerformanceImprovement: number;
|
|
344
|
+
recommendationsForNew: number;
|
|
345
|
+
recommendationsForLegacy: number;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
interface MigrationRecommendation {
|
|
349
|
+
component: string;
|
|
350
|
+
currentStatus: string;
|
|
351
|
+
recommendation: string;
|
|
352
|
+
priority: number;
|
|
353
|
+
reason: string;
|
|
354
|
+
}
|
|
355
|
+
declare class BaselineAutonomyIntegration extends EventEmitter$1 {
|
|
356
|
+
private migrationMode;
|
|
357
|
+
private integrationPoints;
|
|
358
|
+
private migrationStatus;
|
|
359
|
+
private comparisonHistory;
|
|
360
|
+
private autonomySystem;
|
|
361
|
+
constructor(autonomySystem: unknown);
|
|
362
|
+
initialize(): Promise<void>;
|
|
363
|
+
private initializeIntegrationPoints;
|
|
364
|
+
private initializeMigrationStatus;
|
|
365
|
+
executeCommand(command: string, context?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
366
|
+
private executeParallel;
|
|
367
|
+
private executeProgressive;
|
|
368
|
+
private executeNew;
|
|
369
|
+
private executeLegacy;
|
|
370
|
+
private compareResults;
|
|
371
|
+
private assessQuality;
|
|
372
|
+
private calculateImprovement;
|
|
373
|
+
private generateRecommendation;
|
|
374
|
+
private validateResult;
|
|
375
|
+
getIntegrationStatus(): IntegrationStatus;
|
|
376
|
+
setMigrationMode(mode: MigrationMode): void;
|
|
377
|
+
getMigrationRecommendations(): MigrationRecommendation[];
|
|
378
|
+
private calculatePriority;
|
|
379
|
+
private findRelevantComponent;
|
|
380
|
+
private delay;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
interface SafetyProtocol {
|
|
384
|
+
enabled: boolean;
|
|
385
|
+
level: string;
|
|
386
|
+
rules: string[];
|
|
387
|
+
}
|
|
388
|
+
interface SafetyCheckResult {
|
|
389
|
+
protocol: string;
|
|
390
|
+
timestamp: Date;
|
|
391
|
+
status: string;
|
|
392
|
+
violations: unknown[];
|
|
393
|
+
details: Record<string, unknown>;
|
|
394
|
+
}
|
|
395
|
+
interface SafetyMonitoringResult {
|
|
396
|
+
timestamp: Date;
|
|
397
|
+
trustScore: number;
|
|
398
|
+
safetyChecks: SafetyCheckResult[];
|
|
399
|
+
violations: unknown[];
|
|
400
|
+
recommendations: unknown[];
|
|
401
|
+
}
|
|
402
|
+
interface MastraAgentPerformanceMetrics {
|
|
403
|
+
tasksCompleted: number;
|
|
404
|
+
tasksFailed: number;
|
|
405
|
+
averageResponseTime: number;
|
|
406
|
+
trustScore: number;
|
|
407
|
+
}
|
|
408
|
+
interface AgentTask {
|
|
409
|
+
id: string;
|
|
410
|
+
type: string;
|
|
411
|
+
description: string;
|
|
412
|
+
input: Record<string, unknown>;
|
|
413
|
+
priority: number;
|
|
414
|
+
timeout: number;
|
|
415
|
+
}
|
|
416
|
+
interface TaskResult {
|
|
417
|
+
taskId: string;
|
|
418
|
+
agentId: string;
|
|
419
|
+
status: string;
|
|
420
|
+
output: unknown;
|
|
421
|
+
reasoning: string;
|
|
422
|
+
confidence: number;
|
|
423
|
+
executionTime: number;
|
|
424
|
+
timestamp: Date;
|
|
425
|
+
}
|
|
426
|
+
interface ReasoningStep {
|
|
427
|
+
step: number;
|
|
428
|
+
action: string;
|
|
429
|
+
reasoning: string;
|
|
430
|
+
confidence: number;
|
|
431
|
+
timestamp: Date;
|
|
432
|
+
}
|
|
433
|
+
interface ReasoningResult {
|
|
434
|
+
agentId: string;
|
|
435
|
+
task: string;
|
|
436
|
+
steps: ReasoningStep[];
|
|
437
|
+
finalDecision: string;
|
|
438
|
+
confidence: number;
|
|
439
|
+
timestamp: Date;
|
|
440
|
+
}
|
|
441
|
+
interface CoordinationPlan {
|
|
442
|
+
coordinatorId: string;
|
|
443
|
+
taskId: string;
|
|
444
|
+
participants: string[];
|
|
445
|
+
steps: CoordinationStep[];
|
|
446
|
+
timestamp: Date;
|
|
447
|
+
}
|
|
448
|
+
interface CoordinationStep {
|
|
449
|
+
step: number;
|
|
450
|
+
agentId: string;
|
|
451
|
+
action: string;
|
|
452
|
+
status: string;
|
|
453
|
+
}
|
|
454
|
+
interface CoordinationResult {
|
|
455
|
+
plan: CoordinationPlan;
|
|
456
|
+
results: TaskResult[];
|
|
457
|
+
overallStatus: string;
|
|
458
|
+
timestamp: Date;
|
|
459
|
+
}
|
|
460
|
+
interface EngineStatus {
|
|
461
|
+
engineId: string;
|
|
462
|
+
version: string;
|
|
463
|
+
status: string;
|
|
464
|
+
capabilities: string[];
|
|
465
|
+
agentCount: number;
|
|
466
|
+
trustScore: number;
|
|
467
|
+
learningRate: number;
|
|
468
|
+
memorySize: number;
|
|
469
|
+
safetyProtocols: string[];
|
|
470
|
+
}
|
|
471
|
+
interface AgentInfo {
|
|
472
|
+
id: string;
|
|
473
|
+
name: string;
|
|
474
|
+
type: string;
|
|
475
|
+
capabilities: string[];
|
|
476
|
+
status: string;
|
|
477
|
+
trustScore: number;
|
|
478
|
+
performance: MastraAgentPerformanceMetrics;
|
|
479
|
+
taskHistory: TaskResult[];
|
|
480
|
+
}
|
|
481
|
+
declare class MastraAutonomyEngine extends EventEmitter$1 {
|
|
482
|
+
engineId: string;
|
|
483
|
+
version: string;
|
|
484
|
+
status: string;
|
|
485
|
+
capabilities: Set<string>;
|
|
486
|
+
agents: Map<string, MastraAutonomousAgent>;
|
|
487
|
+
memory: Map<string, unknown>;
|
|
488
|
+
safetyProtocols: Map<string, SafetyProtocol>;
|
|
489
|
+
trustScore: number;
|
|
490
|
+
learningRate: number;
|
|
491
|
+
private llm;
|
|
492
|
+
private globalMemory;
|
|
493
|
+
constructor();
|
|
494
|
+
initialize(): Promise<void>;
|
|
495
|
+
private initializeLLM;
|
|
496
|
+
private initializeMemory;
|
|
497
|
+
private initializeSafetyProtocols;
|
|
498
|
+
private initializeCapabilities;
|
|
499
|
+
createAutonomousAgent(name: string, type: string, capabilities: string[]): Promise<MastraAutonomousAgent>;
|
|
500
|
+
executeAutonomousReasoning(agentId: string, task: string, context?: Record<string, unknown>): Promise<ReasoningResult>;
|
|
501
|
+
executeAutonomousTask(agentId: string, task: AgentTask): Promise<TaskResult>;
|
|
502
|
+
coordinateAgents(agentIds: string[], task: AgentTask): Promise<CoordinationResult>;
|
|
503
|
+
private createCoordinationPlan;
|
|
504
|
+
monitorTrustAndSafety(): Promise<SafetyMonitoringResult>;
|
|
505
|
+
runSafetyCheck(protocolId: string, context: string): Promise<SafetyCheckResult>;
|
|
506
|
+
private checkContentSafety;
|
|
507
|
+
private validateTrust;
|
|
508
|
+
private checkAutonomyLimits;
|
|
509
|
+
private generateSafetyRecommendations;
|
|
510
|
+
getStatus(): EngineStatus;
|
|
511
|
+
getCapabilities(): string[];
|
|
512
|
+
getAgentInfo(agentId: string): AgentInfo | null;
|
|
513
|
+
getAllAgents(): AgentInfo[];
|
|
514
|
+
private delay;
|
|
515
|
+
}
|
|
516
|
+
declare class MastraAutonomousAgent {
|
|
517
|
+
id: string;
|
|
518
|
+
name: string;
|
|
519
|
+
type: string;
|
|
520
|
+
capabilities: string[];
|
|
521
|
+
status: string;
|
|
522
|
+
trustScore: number;
|
|
523
|
+
taskHistory: TaskResult[];
|
|
524
|
+
private engine;
|
|
525
|
+
private createdAt;
|
|
526
|
+
private tasksCompleted;
|
|
527
|
+
private tasksFailed;
|
|
528
|
+
private totalResponseTime;
|
|
529
|
+
private memory;
|
|
530
|
+
constructor(name: string, type: string, capabilities: string[], engine: MastraAutonomyEngine);
|
|
531
|
+
executeTask(task: AgentTask): Promise<TaskResult>;
|
|
532
|
+
private processTaskWithLangChain;
|
|
533
|
+
createCoordinationPlan(task: AgentTask, collaborators: MastraAutonomousAgent[]): CoordinationPlan;
|
|
534
|
+
getStatus(): Record<string, unknown>;
|
|
535
|
+
getPerformanceMetrics(): MastraAgentPerformanceMetrics;
|
|
536
|
+
private delay;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export { type AgentConfig, type AgentDeployment, type AgentInfo, AgentLifecycleManager, type AgentStatus, type AgentStatusReport, type AgentTask$1 as AgentTask, type AgentType, type Alert, AutonomousAgent, BaselineAutonomyIntegration, BaselineAutonomySystem, type ComparisonResult, type CoordinationPlan, type CoordinationResult, type CoordinationStep, type DecisionOption, type EngineStatus, type HealthMonitor, type IntegrationPoint, type IntegrationStatus, type LearningModel, type LifecycleStage, type LifecycleStatus, type MastraAgentPerformanceMetrics, type AgentTask as MastraAgentTask, MastraAutonomousAgent, MastraAutonomyEngine, type SafetyProtocol as MastraSafetyProtocol, type TaskResult as MastraTaskResult, type MigrationComponentStatus, type MigrationMode, type MigrationRecommendation, type PerformanceMetrics, type ReasoningResult, type ReasoningStep, type RetirementPolicy, type SafetyAlert, type SafetyCheckResult, type SafetyLevel, type SafetyMonitoringResult, type SafetyProtocol$1 as SafetyProtocol, type ScalingPolicy, type StageHistoryEntry, type SystemStatus, type TaskResult$1 as TaskResult, type TaskType, type ThresholdViolation, type ViolationFlag };
|