@putervision/behavior-mcp 0.1.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/lib.d.ts ADDED
@@ -0,0 +1,672 @@
1
+ import { z } from 'zod';
2
+ import Database from 'better-sqlite3';
3
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
+
5
+ type BehaviorId = string & {
6
+ readonly __brand: unique symbol;
7
+ };
8
+ type ExecutionId = string & {
9
+ readonly __brand: unique symbol;
10
+ };
11
+ type TriggerId = string & {
12
+ readonly __brand: unique symbol;
13
+ };
14
+ type RecordingId = string & {
15
+ readonly __brand: unique symbol;
16
+ };
17
+ type SnapshotId = string & {
18
+ readonly __brand: unique symbol;
19
+ };
20
+ type EventId = string & {
21
+ readonly __brand: unique symbol;
22
+ };
23
+ type ExecutionStatus = 'idle' | 'running' | 'paused' | 'success' | 'failed' | 'stuck' | 'aborted' | 'interrupted';
24
+ type NodeStatus = 'SUCCESS' | 'FAILURE' | 'RUNNING' | 'INVALID';
25
+ interface BehaviorDefinition {
26
+ id: BehaviorId;
27
+ project: string;
28
+ name: string;
29
+ version: number;
30
+ description?: string;
31
+ tree_json: string;
32
+ tree_hash: string;
33
+ is_active: boolean;
34
+ metadata?: Record<string, unknown>;
35
+ client_request_id?: string;
36
+ created_at: string;
37
+ }
38
+ interface BehaviorTreeNode {
39
+ id: string;
40
+ type: 'sequence' | 'selector' | 'inverter' | 'timeout' | 'guard' | 'action' | 'condition';
41
+ name?: string;
42
+ parameters?: Record<string, unknown>;
43
+ children?: BehaviorTreeNode[];
44
+ guard?: BehaviorTreeNode;
45
+ timeout_ms?: number;
46
+ }
47
+ interface ExecutionState {
48
+ id: ExecutionId;
49
+ project: string;
50
+ behavior_name: string;
51
+ behavior_version: number;
52
+ session_id?: string;
53
+ intention_id?: string;
54
+ trace_id?: string;
55
+ status: ExecutionStatus;
56
+ active_node_path?: string;
57
+ blackboard_json: string;
58
+ current_tick: number;
59
+ tick_rate_hz: number;
60
+ duration_ms: number;
61
+ stuck_score: number;
62
+ error?: string;
63
+ metadata?: Record<string, unknown>;
64
+ created_at: string;
65
+ updated_at: string;
66
+ }
67
+ interface ReactiveTrigger {
68
+ id: TriggerId;
69
+ project: string;
70
+ name: string;
71
+ behavior_name: string;
72
+ condition_type: string;
73
+ condition_params: Record<string, unknown>;
74
+ priority: number;
75
+ cooldown_ms: number;
76
+ last_fired_at?: string;
77
+ is_enabled: boolean;
78
+ metadata?: Record<string, unknown>;
79
+ created_at: string;
80
+ updated_at: string;
81
+ }
82
+ interface ExecutionMetrics {
83
+ id: string;
84
+ project: string;
85
+ execution_id: ExecutionId;
86
+ session_id?: string;
87
+ intention_id?: string;
88
+ trace_id?: string;
89
+ behavior_name: string;
90
+ status: ExecutionStatus;
91
+ tick_count: number;
92
+ duration_ms: number;
93
+ avg_tick_ms: number;
94
+ max_tick_ms: number;
95
+ stuck_count: number;
96
+ interrupt_count: number;
97
+ category_metrics?: Record<string, unknown>;
98
+ created_at: string;
99
+ }
100
+ interface ExecutionRecording {
101
+ id: RecordingId;
102
+ project: string;
103
+ execution_id: ExecutionId;
104
+ behavior_name: string;
105
+ total_frames: number;
106
+ frames_json: string;
107
+ duration_ms: number;
108
+ metadata?: Record<string, unknown>;
109
+ created_at: string;
110
+ }
111
+ interface RuntimeEvent {
112
+ id: EventId;
113
+ project: string;
114
+ entity_id: string;
115
+ entity_type: 'behavior' | 'execution' | 'trigger' | 'recording' | 'safety';
116
+ action: string;
117
+ prev_hash: string;
118
+ hash: string;
119
+ details?: Record<string, unknown>;
120
+ timestamp: string;
121
+ }
122
+ interface Outcome {
123
+ intention_id: string;
124
+ execution_id: ExecutionId;
125
+ session_id: string;
126
+ status: ExecutionStatus;
127
+ active_node?: string;
128
+ tick_count: number;
129
+ duration_ms: number;
130
+ metrics?: {
131
+ combat?: {
132
+ damage_dealt: number;
133
+ damage_taken: number;
134
+ kills: number;
135
+ };
136
+ economy?: {
137
+ items_gathered: number;
138
+ gold_earned: number;
139
+ };
140
+ navigation?: {
141
+ distance_traveled: number;
142
+ waypoints_reached: number;
143
+ };
144
+ [key: string]: unknown;
145
+ };
146
+ error_message?: string;
147
+ stuck_reason?: string;
148
+ completed_at: string;
149
+ }
150
+
151
+ declare const LoadBehaviorSchema: z.ZodObject<{
152
+ action: z.ZodEnum<["load", "unload", "swap"]>;
153
+ behavior_name: z.ZodString;
154
+ behavior_version: z.ZodOptional<z.ZodNumber>;
155
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
156
+ session_id: z.ZodOptional<z.ZodString>;
157
+ intention_id: z.ZodOptional<z.ZodString>;
158
+ client_request_id: z.ZodOptional<z.ZodString>;
159
+ project: z.ZodOptional<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ action: "load" | "unload" | "swap";
162
+ behavior_name: string;
163
+ parameters?: Record<string, any> | undefined;
164
+ behavior_version?: number | undefined;
165
+ intention_id?: string | undefined;
166
+ project?: string | undefined;
167
+ session_id?: string | undefined;
168
+ client_request_id?: string | undefined;
169
+ }, {
170
+ action: "load" | "unload" | "swap";
171
+ behavior_name: string;
172
+ parameters?: Record<string, any> | undefined;
173
+ behavior_version?: number | undefined;
174
+ intention_id?: string | undefined;
175
+ project?: string | undefined;
176
+ session_id?: string | undefined;
177
+ client_request_id?: string | undefined;
178
+ }>;
179
+ declare const SetParametersSchema: z.ZodObject<{
180
+ action: z.ZodEnum<["set", "get", "reset"]>;
181
+ execution_id: z.ZodOptional<z.ZodString>;
182
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
183
+ project: z.ZodOptional<z.ZodString>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ action: "set" | "get" | "reset";
186
+ execution_id?: string | undefined;
187
+ parameters?: Record<string, any> | undefined;
188
+ project?: string | undefined;
189
+ }, {
190
+ action: "set" | "get" | "reset";
191
+ execution_id?: string | undefined;
192
+ parameters?: Record<string, any> | undefined;
193
+ project?: string | undefined;
194
+ }>;
195
+ declare const GetStatusSchema: z.ZodObject<{
196
+ action: z.ZodEnum<["current", "history", "tree_state"]>;
197
+ execution_id: z.ZodOptional<z.ZodString>;
198
+ limit: z.ZodOptional<z.ZodNumber>;
199
+ project: z.ZodOptional<z.ZodString>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ action: "current" | "history" | "tree_state";
202
+ execution_id?: string | undefined;
203
+ limit?: number | undefined;
204
+ project?: string | undefined;
205
+ }, {
206
+ action: "current" | "history" | "tree_state";
207
+ execution_id?: string | undefined;
208
+ limit?: number | undefined;
209
+ project?: string | undefined;
210
+ }>;
211
+ declare const AbortBehaviorSchema: z.ZodObject<{
212
+ action: z.ZodEnum<["abort", "pause", "resume"]>;
213
+ execution_id: z.ZodOptional<z.ZodString>;
214
+ reason: z.ZodOptional<z.ZodString>;
215
+ project: z.ZodOptional<z.ZodString>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ action: "abort" | "pause" | "resume";
218
+ execution_id?: string | undefined;
219
+ reason?: string | undefined;
220
+ project?: string | undefined;
221
+ }, {
222
+ action: "abort" | "pause" | "resume";
223
+ execution_id?: string | undefined;
224
+ reason?: string | undefined;
225
+ project?: string | undefined;
226
+ }>;
227
+ declare const RegisterTriggerSchema: z.ZodObject<{
228
+ action: z.ZodEnum<["register", "list", "update", "remove", "enable", "disable"]>;
229
+ name: z.ZodOptional<z.ZodString>;
230
+ behavior_name: z.ZodOptional<z.ZodString>;
231
+ condition_type: z.ZodOptional<z.ZodString>;
232
+ condition_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
233
+ priority: z.ZodOptional<z.ZodNumber>;
234
+ cooldown_ms: z.ZodOptional<z.ZodNumber>;
235
+ trigger_id: z.ZodOptional<z.ZodString>;
236
+ project: z.ZodOptional<z.ZodString>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ action: "register" | "list" | "update" | "remove" | "enable" | "disable";
239
+ behavior_name?: string | undefined;
240
+ name?: string | undefined;
241
+ priority?: number | undefined;
242
+ project?: string | undefined;
243
+ condition_type?: string | undefined;
244
+ condition_params?: Record<string, any> | undefined;
245
+ cooldown_ms?: number | undefined;
246
+ trigger_id?: string | undefined;
247
+ }, {
248
+ action: "register" | "list" | "update" | "remove" | "enable" | "disable";
249
+ behavior_name?: string | undefined;
250
+ name?: string | undefined;
251
+ priority?: number | undefined;
252
+ project?: string | undefined;
253
+ condition_type?: string | undefined;
254
+ condition_params?: Record<string, any> | undefined;
255
+ cooldown_ms?: number | undefined;
256
+ trigger_id?: string | undefined;
257
+ }>;
258
+ declare const ReplayRecordingSchema: z.ZodObject<{
259
+ action: z.ZodEnum<["start", "stop", "list", "capture", "delete"]>;
260
+ name: z.ZodOptional<z.ZodString>;
261
+ recording_id: z.ZodOptional<z.ZodString>;
262
+ frames: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
263
+ project: z.ZodOptional<z.ZodString>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ action: "list" | "capture" | "start" | "stop" | "delete";
266
+ name?: string | undefined;
267
+ recording_id?: string | undefined;
268
+ project?: string | undefined;
269
+ frames?: any[] | undefined;
270
+ }, {
271
+ action: "list" | "capture" | "start" | "stop" | "delete";
272
+ name?: string | undefined;
273
+ recording_id?: string | undefined;
274
+ project?: string | undefined;
275
+ frames?: any[] | undefined;
276
+ }>;
277
+ declare const GetMetricsSchema: z.ZodObject<{
278
+ action: z.ZodEnum<["current", "history", "aggregate", "compare"]>;
279
+ execution_id: z.ZodOptional<z.ZodString>;
280
+ behavior_name: z.ZodOptional<z.ZodString>;
281
+ limit: z.ZodOptional<z.ZodNumber>;
282
+ project: z.ZodOptional<z.ZodString>;
283
+ }, "strip", z.ZodTypeAny, {
284
+ action: "current" | "history" | "aggregate" | "compare";
285
+ behavior_name?: string | undefined;
286
+ execution_id?: string | undefined;
287
+ limit?: number | undefined;
288
+ project?: string | undefined;
289
+ }, {
290
+ action: "current" | "history" | "aggregate" | "compare";
291
+ behavior_name?: string | undefined;
292
+ execution_id?: string | undefined;
293
+ limit?: number | undefined;
294
+ project?: string | undefined;
295
+ }>;
296
+ declare const ManageBehaviorsSchema: z.ZodObject<{
297
+ action: z.ZodEnum<["register", "list", "get", "update", "delete", "export", "import"]>;
298
+ name: z.ZodOptional<z.ZodString>;
299
+ version: z.ZodOptional<z.ZodNumber>;
300
+ description: z.ZodOptional<z.ZodString>;
301
+ tree: z.ZodOptional<z.ZodAny>;
302
+ tree_json: z.ZodOptional<z.ZodString>;
303
+ client_request_id: z.ZodOptional<z.ZodString>;
304
+ project: z.ZodOptional<z.ZodString>;
305
+ }, "strip", z.ZodTypeAny, {
306
+ action: "get" | "register" | "list" | "update" | "delete" | "export" | "import";
307
+ name?: string | undefined;
308
+ description?: string | undefined;
309
+ version?: number | undefined;
310
+ project?: string | undefined;
311
+ client_request_id?: string | undefined;
312
+ tree?: any;
313
+ tree_json?: string | undefined;
314
+ }, {
315
+ action: "get" | "register" | "list" | "update" | "delete" | "export" | "import";
316
+ name?: string | undefined;
317
+ description?: string | undefined;
318
+ version?: number | undefined;
319
+ project?: string | undefined;
320
+ client_request_id?: string | undefined;
321
+ tree?: any;
322
+ tree_json?: string | undefined;
323
+ }>;
324
+ declare const ManageBlackboardSchema: z.ZodObject<{
325
+ action: z.ZodEnum<["get", "set", "clear", "dump"]>;
326
+ execution_id: z.ZodOptional<z.ZodString>;
327
+ key: z.ZodOptional<z.ZodString>;
328
+ value: z.ZodOptional<z.ZodAny>;
329
+ blackboard: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
330
+ project: z.ZodOptional<z.ZodString>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ action: "set" | "get" | "clear" | "dump";
333
+ execution_id?: string | undefined;
334
+ key?: string | undefined;
335
+ value?: any;
336
+ blackboard?: Record<string, any> | undefined;
337
+ project?: string | undefined;
338
+ }, {
339
+ action: "set" | "get" | "clear" | "dump";
340
+ execution_id?: string | undefined;
341
+ key?: string | undefined;
342
+ value?: any;
343
+ blackboard?: Record<string, any> | undefined;
344
+ project?: string | undefined;
345
+ }>;
346
+ declare const ManageRuntimeDbSchema: z.ZodObject<{
347
+ action: z.ZodEnum<["backup", "stats", "audit", "snapshot", "diff", "restore"]>;
348
+ name: z.ZodOptional<z.ZodString>;
349
+ description: z.ZodOptional<z.ZodString>;
350
+ project: z.ZodOptional<z.ZodString>;
351
+ }, "strip", z.ZodTypeAny, {
352
+ action: "stats" | "audit" | "snapshot" | "diff" | "restore" | "backup";
353
+ name?: string | undefined;
354
+ description?: string | undefined;
355
+ project?: string | undefined;
356
+ }, {
357
+ action: "stats" | "audit" | "snapshot" | "diff" | "restore" | "backup";
358
+ name?: string | undefined;
359
+ description?: string | undefined;
360
+ project?: string | undefined;
361
+ }>;
362
+
363
+ declare class BehaviorRuntimeError extends Error {
364
+ readonly code: string;
365
+ readonly details?: unknown;
366
+ constructor(message: string, code?: string, details?: unknown);
367
+ }
368
+ declare class DatabaseError extends BehaviorRuntimeError {
369
+ constructor(message: string, details?: unknown);
370
+ }
371
+ declare class ValidationError extends BehaviorRuntimeError {
372
+ constructor(message: string, details?: unknown);
373
+ }
374
+ declare class NotFoundError extends BehaviorRuntimeError {
375
+ constructor(message: string, details?: unknown);
376
+ }
377
+ declare class ExecutionError extends BehaviorRuntimeError {
378
+ constructor(message: string, details?: unknown);
379
+ }
380
+ declare class SafetyError extends BehaviorRuntimeError {
381
+ constructor(message: string, details?: unknown);
382
+ }
383
+
384
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error';
385
+ declare const LOG_LEVELS: Record<LogLevel, number>;
386
+ declare function getLogLevel(): number;
387
+ declare const logger: {
388
+ debug: (message: string, ...args: unknown[]) => void;
389
+ info: (message: string, ...args: unknown[]) => void;
390
+ warn: (message: string, ...args: unknown[]) => void;
391
+ error: (message: string, ...args: unknown[]) => void;
392
+ };
393
+
394
+ declare function generateId(): string;
395
+
396
+ declare function getCurrentIsoString(): string;
397
+ declare function parseIsoString(iso: string): Date;
398
+ declare function getElapsedTimeMs(startTimeIso: string): number;
399
+
400
+ declare function validatePath(filePath: string, project?: string): string;
401
+ declare function getRegistryPath(): string;
402
+ declare function getRegistry(): Record<string, string>;
403
+ declare function registerProject(projectName: string, projectRoot: string): void;
404
+ declare function unregisterProject(projectName: string): void;
405
+ declare function sanitizeSlug(str: string): string;
406
+ declare function resolveProjectRoot(project?: string, cwd?: string): string;
407
+ declare function getProjectSlug(project?: string, cwd?: string): string;
408
+ declare function getBaseDir(projectRoot: string): string;
409
+ declare function getProjectDbDir(project?: string, cwd?: string): string;
410
+ declare function getDbPath(project?: string, cwd?: string): string;
411
+ declare function getDb(project?: string, cwd?: string): Database.Database;
412
+ declare function getReadOnlyDb(project?: string, cwd?: string): Database.Database;
413
+ declare function closeDb(project?: string, cwd?: string): void;
414
+ declare function closeAllDbs(): void;
415
+
416
+ declare function computeTreeHash(treeJson: string): string;
417
+ declare class BehaviorRegistry {
418
+ static registerBehavior(db: Database.Database, params: {
419
+ project: string;
420
+ name: string;
421
+ version?: number;
422
+ description?: string;
423
+ tree: unknown;
424
+ client_request_id?: string;
425
+ }): BehaviorDefinition;
426
+ static getBehavior(db: Database.Database, params: {
427
+ project: string;
428
+ name: string;
429
+ version?: number;
430
+ }): BehaviorDefinition;
431
+ static listBehaviors(db: Database.Database, project: string): BehaviorDefinition[];
432
+ private static mapRowToBehavior;
433
+ }
434
+
435
+ declare class ExecutionEngine {
436
+ static startExecution(db: Database.Database, params: {
437
+ project: string;
438
+ behavior_name: string;
439
+ behavior_version?: number;
440
+ session_id?: string;
441
+ intention_id?: string;
442
+ trace_id?: string;
443
+ parameters?: Record<string, unknown>;
444
+ client_request_id?: string;
445
+ }): ExecutionState;
446
+ static tickExecution(db: Database.Database, params: {
447
+ project: string;
448
+ execution_id: string;
449
+ active_node_path?: string;
450
+ status?: ExecutionStatus;
451
+ stuck_score?: number;
452
+ blackboard?: Record<string, unknown>;
453
+ }): ExecutionState;
454
+ static stopExecution(db: Database.Database, params: {
455
+ project: string;
456
+ execution_id: string;
457
+ status: ExecutionStatus;
458
+ error_message?: string;
459
+ }): Outcome;
460
+ static getExecution(db: Database.Database, params: {
461
+ project: string;
462
+ id: string;
463
+ }): ExecutionState;
464
+ static listExecutions(db: Database.Database, params: {
465
+ project: string;
466
+ status?: ExecutionStatus;
467
+ limit?: number;
468
+ }): ExecutionState[];
469
+ private static mapRowToExecution;
470
+ }
471
+
472
+ declare class TriggerRegistry {
473
+ static registerTrigger(db: Database.Database, params: {
474
+ project: string;
475
+ name: string;
476
+ behavior_name: string;
477
+ condition_type: string;
478
+ condition_params: Record<string, unknown>;
479
+ priority?: number;
480
+ cooldown_ms?: number;
481
+ }): ReactiveTrigger;
482
+ static listTriggers(db: Database.Database, project: string): ReactiveTrigger[];
483
+ static evaluateTriggers(db: Database.Database, params: {
484
+ project: string;
485
+ telemetry: Record<string, any>;
486
+ }): ReactiveTrigger | null;
487
+ private static mapRowToTrigger;
488
+ }
489
+
490
+ declare class MetricsEngine {
491
+ static recordMetrics(db: Database.Database, params: {
492
+ project: string;
493
+ execution_id: string;
494
+ session_id?: string;
495
+ intention_id?: string;
496
+ behavior_name: string;
497
+ status: any;
498
+ tick_count: number;
499
+ duration_ms: number;
500
+ avg_tick_ms?: number;
501
+ max_tick_ms?: number;
502
+ stuck_count?: number;
503
+ interrupt_count?: number;
504
+ category_metrics?: Record<string, unknown>;
505
+ }): ExecutionMetrics;
506
+ static getMetrics(db: Database.Database, params: {
507
+ project: string;
508
+ execution_id?: string;
509
+ behavior_name?: string;
510
+ limit?: number;
511
+ }): ExecutionMetrics[];
512
+ }
513
+
514
+ declare class SnapshotEngine {
515
+ static saveSnapshot(db: Database.Database, params: {
516
+ project: string;
517
+ name: string;
518
+ description?: string;
519
+ }): {
520
+ snapshot_id: string;
521
+ name: string;
522
+ timestamp: string;
523
+ };
524
+ static restoreSnapshot(db: Database.Database, params: {
525
+ project: string;
526
+ name: string;
527
+ }): {
528
+ restored_behaviors: number;
529
+ restored_triggers: number;
530
+ };
531
+ static listSnapshots(db: Database.Database, params: {
532
+ project: string;
533
+ limit?: number;
534
+ }): Array<{
535
+ id: string;
536
+ name: string;
537
+ description?: string;
538
+ created_at: string;
539
+ }>;
540
+ }
541
+
542
+ declare function computeEventHash(params: {
543
+ prev_hash: string;
544
+ id: string;
545
+ project: string;
546
+ entity_id: string;
547
+ entity_type: string;
548
+ action: string;
549
+ timestamp: string;
550
+ details?: Record<string, unknown>;
551
+ }): string;
552
+ declare function logRuntimeEvent(db: Database.Database, params: {
553
+ project: string;
554
+ entity_id: string;
555
+ entity_type: 'behavior' | 'execution' | 'trigger' | 'recording' | 'safety';
556
+ action: string;
557
+ details?: Record<string, unknown>;
558
+ }): RuntimeEvent;
559
+ declare function verifyEventChain(db: Database.Database, project: string): {
560
+ valid: boolean;
561
+ total_events: number;
562
+ corrupted_event_id?: string;
563
+ error?: string;
564
+ };
565
+
566
+ type NodeExecutionResult = {
567
+ status: NodeStatus;
568
+ activePath: string;
569
+ actionOutput?: Record<string, unknown>;
570
+ };
571
+ interface RuntimeContext {
572
+ blackboard: Record<string, unknown>;
573
+ telemetry: Record<string, unknown>;
574
+ tick: number;
575
+ }
576
+
577
+ declare const ConditionRegistry: Record<string, (params: Record<string, unknown>, ctx: RuntimeContext) => boolean>;
578
+
579
+ declare const GameConditionRegistry: Record<string, (params: Record<string, unknown>, ctx: RuntimeContext) => boolean>;
580
+
581
+ declare const ActionRegistry: Record<string, (params: Record<string, unknown>, ctx: RuntimeContext) => {
582
+ status: NodeStatus;
583
+ output?: Record<string, unknown>;
584
+ }>;
585
+
586
+ declare const GameActionRegistry: Record<string, (params: Record<string, unknown>, ctx: RuntimeContext) => {
587
+ status: NodeStatus;
588
+ output?: Record<string, unknown>;
589
+ }>;
590
+
591
+ declare class BehaviorTreeEvaluator {
592
+ private tree;
593
+ private blackboard;
594
+ private tickCount;
595
+ constructor(tree: BehaviorTreeNode, initialBlackboard?: Record<string, unknown>);
596
+ step(telemetry?: Record<string, unknown>): {
597
+ status: NodeStatus;
598
+ activePath: string;
599
+ blackboard: Record<string, unknown>;
600
+ };
601
+ private evaluateNode;
602
+ }
603
+
604
+ interface GameTelemetryPayload {
605
+ hp?: number;
606
+ max_hp?: number;
607
+ mana?: number;
608
+ max_mana?: number;
609
+ stamina?: number;
610
+ position?: {
611
+ x: number;
612
+ y: number;
613
+ z?: number;
614
+ };
615
+ inventory_weight?: number;
616
+ inventory?: Array<{
617
+ id: string;
618
+ name: string;
619
+ quantity: number;
620
+ }>;
621
+ enemies_in_range?: number;
622
+ target_id?: string;
623
+ in_combat?: boolean;
624
+ metadata?: Record<string, unknown>;
625
+ }
626
+ declare class BrowserInjector {
627
+ /**
628
+ * Generates the browser evaluation script injecting the ~60Hz Behavior Tree runtime,
629
+ * safety rate limiters, and the PuterVision Game Telemetry Bridge.
630
+ */
631
+ static getInjectionScript(tree: BehaviorTreeNode, allowlistOrigins?: string[]): string;
632
+ }
633
+
634
+ declare class WatchdogTimer {
635
+ private lastTickTime;
636
+ private maxAllowedDeltaMs;
637
+ constructor(maxAllowedDeltaMs?: number);
638
+ feed(): void;
639
+ isExpired(): boolean;
640
+ }
641
+
642
+ declare class StuckDetector {
643
+ private lastNodes;
644
+ private maxHistory;
645
+ checkStuck(currentNodePath: string): {
646
+ isStuck: boolean;
647
+ score: number;
648
+ };
649
+ }
650
+
651
+ declare class ActionRateLimiter {
652
+ private actionTimestamps;
653
+ private maxPerSecond;
654
+ constructor(maxPerSecond?: number);
655
+ allowAction(): boolean;
656
+ }
657
+
658
+ declare class PolicyGate {
659
+ private deniedActions;
660
+ isAllowed(actionName: string): boolean;
661
+ }
662
+
663
+ declare class EmergencySafety {
664
+ private static killSwitchEngaged;
665
+ static engageKillSwitch(): void;
666
+ static isSafe(): boolean;
667
+ static resetSafety(): void;
668
+ }
669
+
670
+ declare const server: McpServer;
671
+
672
+ export { AbortBehaviorSchema, ActionRateLimiter, ActionRegistry, type BehaviorDefinition, type BehaviorId, BehaviorRegistry, BehaviorRuntimeError, BehaviorTreeEvaluator, type BehaviorTreeNode, BrowserInjector, ConditionRegistry, DatabaseError, EmergencySafety, type EventId, ExecutionEngine, ExecutionError, type ExecutionId, type ExecutionMetrics, type ExecutionRecording, type ExecutionState, type ExecutionStatus, GameActionRegistry, GameConditionRegistry, type GameTelemetryPayload, GetMetricsSchema, GetStatusSchema, LOG_LEVELS, LoadBehaviorSchema, ManageBehaviorsSchema, ManageBlackboardSchema, ManageRuntimeDbSchema, MetricsEngine, type NodeExecutionResult, type NodeStatus, NotFoundError, type Outcome, PolicyGate, type ReactiveTrigger, type RecordingId, RegisterTriggerSchema, ReplayRecordingSchema, type RuntimeContext, type RuntimeEvent, SafetyError, SetParametersSchema, SnapshotEngine, type SnapshotId, StuckDetector, type TriggerId, TriggerRegistry, ValidationError, WatchdogTimer, closeAllDbs, closeDb, computeEventHash, computeTreeHash, generateId, getBaseDir, getCurrentIsoString, getDb, getDbPath, getElapsedTimeMs, getLogLevel, getProjectDbDir, getProjectSlug, getReadOnlyDb, getRegistry, getRegistryPath, logRuntimeEvent, logger, parseIsoString, registerProject, resolveProjectRoot, sanitizeSlug, server, unregisterProject, validatePath, verifyEventChain };