@fleettools/server 0.1.0 → 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/package.json +1 -1
- package/.flightline/checkpoints.db +0 -0
- package/.flightline/ctk/04a5510b-1e09-40c6-91c8-399c22138708.json +0 -9
- package/.flightline/ctk/0ecde721-7827-4039-995a-974e24493cc5.json +0 -9
- package/.flightline/ctk/268bbdbd-ddd7-46b2-845f-56a138aa518a.json +0 -9
- package/.flightline/ctk/6f476f2e-776c-407a-b441-b9365c0bae95.json +0 -9
- package/.flightline/ctk/7e10d0d5-fbc2-4661-af03-53de89e064db.json +0 -9
- package/.flightline/ctk/90783096-b7d4-49c5-8153-3c35018a2e61.json +0 -9
- package/.flightline/ctk/9a3b6d18-8a46-4728-90aa-279800a8e397.json +0 -9
- package/.flightline/ctk/ae30e192-b386-4ee2-899c-93f86785d3f3.json +0 -9
- package/.flightline/ctk/d0e9c49e-10df-413e-8cf7-37232b1838ca.json +0 -9
- package/.flightline/ctk/eae1a12b-2e9d-4c3f-8619-dafbb1346e96.json +0 -9
- package/.flightline/mailboxes/mbx_00dae6ba-0b5e-4a8d-a86d-93c8640872c3/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_05b0bfa9-c4f5-4f68-ba75-6202820f49c3/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_0a6b8fb2-729e-4385-8241-839c36b929d7/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_0abca4ab-8e34-409c-997f-481e80e450dc/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_173e5fb9-8203-418d-93c2-4f8c91f2d842/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_22b62201-0570-4ce8-b0a7-0f4b445f6d9e/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_2724efb1-76e1-4147-9620-4defcc65510f/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_35b8bfcd-5a54-48f1-8759-cb1f8ffe775d/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_3bc5193a-604d-4f52-be00-e56277643358/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_3bd500f3-c111-427a-8cd7-a004125d6dc1/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_45ce9ae8-5299-44dc-a1b5-4d63914a9609/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_4779c645-1efc-4c76-ab21-ff93f973ee8f/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_482237cf-87c8-486e-a24d-0941be2f480d/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_4b7e23c8-5680-4edd-a276-88803dd5fb6f/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_4dd3b945-d846-4c7a-94eb-6eeb25a0dc6b/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_4ec41a62-62bb-4be4-b3ce-282d5a33acce/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_4ff7ee7e-0c8a-43d6-a829-7c62c10af3b0/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_7661e4fb-a919-4af1-86f7-3eaef22f1d81/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_7ca872bb-69ab-4e7d-a7c6-4888ec8e7749/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_7e6d5707-2aa5-4770-a7be-6b1be93d0d87/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_87bef50d-3c59-429b-a995-5872f6278c37/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_88d1ea56-0b69-48c4-9fcf-ce1e1f7527ba/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_8bfb6bd7-07d1-4836-ae9d-3c93668c6dfe/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_93355083-e95b-4341-b625-56fcc1e4fc0c/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_999fd94c-ca56-4fec-8d30-8b677cf40ad6/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_a039fd15-7ee1-4bd6-906d-55dea8d0e489/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_a0b7363f-7cc6-4940-8e29-2dc85793a77d/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_a31e8b61-9643-4c78-939d-d1696d0420d9/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_acc51591-256c-4bed-9a51-514b1811f4cd/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_b1efebd9-5981-49fa-8775-20fa00d0c902/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_ba9d4c61-39a3-4852-95d7-bd34e3605a43/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_c549b60f-65fd-48d5-8cd6-2f053292b112/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_d0f839a5-3ab9-42e2-b438-df5825d049fe/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_d826d57e-9817-4f3c-ab94-2bfafa352f6d/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_da102f37-632c-4c0b-be4c-4270a74c06b9/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_df4506f5-67f2-4cf6-9113-93994b76f39b/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_e038e93b-87ea-4122-9578-6540018697b7/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_e0c171c5-407f-44dc-9ef9-e26e8b99ceac/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_e64770bf-7220-4d0f-848c-d751ea1c7376/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_e7f0edda-0fab-484d-ab4d-d8a8e363cd14/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_ec7d9118-8594-4d79-bf79-f43afdfaf156/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_ee06ec01-03e4-485a-ae2b-d8bdb6e7a3a8/manifest.json +0 -6
- package/.flightline/mailboxes/mbx_fd467681-f9cf-4a54-b06a-836df6de2ccc/manifest.json +0 -6
- package/.flightline/progress.db +0 -0
- package/.flightline/recovery.log +0 -1
- package/.flightline/tasks.db +0 -0
- package/.flightline/tech-orders/to_0c93d981-6b4e-4055-8678-f39c009d1db1.json +0 -11
- package/.flightline/tech-orders/to_1862f8ed-c487-4914-9f1e-528af6d4f053.json +0 -11
- package/.flightline/tech-orders/to_2335a57d-f400-4efa-b108-e13ece57520d.json +0 -11
- package/.flightline/tech-orders/to_2bd8dbdd-ac57-4b84-b977-33a3637d10d1.json +0 -11
- package/.flightline/tech-orders/to_37057c01-39b5-403a-991f-afb186abde95.json +0 -11
- package/.flightline/tech-orders/to_9e7288bb-c0fd-488a-a83d-1e9337bd0f1f.json +0 -11
- package/.flightline/tech-orders/to_aa0fe80b-9de7-40f6-a106-353b5bca10bd.json +0 -11
- package/.flightline/tech-orders/to_c1a0f480-c863-4203-a070-76ad77137845.json +0 -11
- package/.flightline/tech-orders/to_cf1e882a-cf56-45a4-8d19-494925e5f449.json +0 -11
- package/.flightline/work-orders/wo_5a29168d-5fb4-41d7-8dac-1d1151d9248f/manifest.json +0 -15
- package/.flightline/work-orders/wo_6c8c38bb-17a1-4885-ada4-dbfc5cc12d7a/manifest.json +0 -15
- package/.flightline/work-orders/wo_cadeb9b2-ea42-4491-b429-e2d467942b5c/manifest.json +0 -12
- package/.flightline/work-orders/wo_cc7b669c-16c4-4ef7-8a76-d1813219d0be/manifest.json +0 -15
- package/dist/server/api/src/coordination/agent-lifecycle.d.ts +0 -12
- package/dist/server/api/src/coordination/agent-lifecycle.d.ts.map +0 -1
- package/dist/server/api/src/coordination/agent-lifecycle.js +0 -12
- package/dist/server/api/src/coordination/agent-lifecycle.js.map +0 -1
- package/dist/server/api/src/coordination/agent-runner.d.ts +0 -9
- package/dist/server/api/src/coordination/agent-runner.d.ts.map +0 -1
- package/dist/server/api/src/coordination/agent-runner.js +0 -416
- package/dist/server/api/src/coordination/agent-runner.js.map +0 -1
- package/dist/server/api/src/coordination/agent-spawner-routes.d.ts +0 -7
- package/dist/server/api/src/coordination/agent-spawner-routes.d.ts.map +0 -1
- package/dist/server/api/src/coordination/agent-spawner-routes.js +0 -321
- package/dist/server/api/src/coordination/agent-spawner-routes.js.map +0 -1
- package/dist/server/api/src/coordination/agent-spawner.d.ts +0 -187
- package/dist/server/api/src/coordination/agent-spawner.d.ts.map +0 -1
- package/dist/server/api/src/coordination/agent-spawner.js +0 -712
- package/dist/server/api/src/coordination/agent-spawner.js.map +0 -1
- package/dist/server/api/src/coordination/agents.d.ts +0 -13
- package/dist/server/api/src/coordination/agents.d.ts.map +0 -1
- package/dist/server/api/src/coordination/agents.js +0 -464
- package/dist/server/api/src/coordination/agents.js.map +0 -1
- package/dist/server/api/src/coordination/checkpoint-routes.d.ts +0 -33
- package/dist/server/api/src/coordination/checkpoint-routes.d.ts.map +0 -1
- package/dist/server/api/src/coordination/checkpoint-routes.js +0 -323
- package/dist/server/api/src/coordination/checkpoint-routes.js.map +0 -1
- package/dist/server/api/src/coordination/conflict-resolver.d.ts +0 -152
- package/dist/server/api/src/coordination/conflict-resolver.d.ts.map +0 -1
- package/dist/server/api/src/coordination/conflict-resolver.js +0 -502
- package/dist/server/api/src/coordination/conflict-resolver.js.map +0 -1
- package/dist/server/api/src/coordination/missions.d.ts +0 -9
- package/dist/server/api/src/coordination/missions.d.ts.map +0 -1
- package/dist/server/api/src/coordination/missions.js +0 -148
- package/dist/server/api/src/coordination/missions.js.map +0 -1
- package/dist/server/api/src/coordination/monitor.d.ts +0 -175
- package/dist/server/api/src/coordination/monitor.d.ts.map +0 -1
- package/dist/server/api/src/coordination/monitor.js +0 -410
- package/dist/server/api/src/coordination/monitor.js.map +0 -1
- package/dist/server/api/src/coordination/notifier.d.ts +0 -160
- package/dist/server/api/src/coordination/notifier.d.ts.map +0 -1
- package/dist/server/api/src/coordination/notifier.js +0 -422
- package/dist/server/api/src/coordination/notifier.js.map +0 -1
- package/dist/server/api/src/coordination/progress-tracker.d.ts +0 -98
- package/dist/server/api/src/coordination/progress-tracker.d.ts.map +0 -1
- package/dist/server/api/src/coordination/progress-tracker.js +0 -323
- package/dist/server/api/src/coordination/progress-tracker.js.map +0 -1
- package/dist/server/api/src/coordination/recovery-manager.d.ts +0 -135
- package/dist/server/api/src/coordination/recovery-manager.d.ts.map +0 -1
- package/dist/server/api/src/coordination/recovery-manager.js +0 -435
- package/dist/server/api/src/coordination/recovery-manager.js.map +0 -1
- package/dist/server/api/src/coordination/task-decomposer.d.ts +0 -90
- package/dist/server/api/src/coordination/task-decomposer.d.ts.map +0 -1
- package/dist/server/api/src/coordination/task-decomposer.js +0 -412
- package/dist/server/api/src/coordination/task-decomposer.js.map +0 -1
- package/dist/server/api/src/coordination/task-queue-routes.d.ts +0 -7
- package/dist/server/api/src/coordination/task-queue-routes.d.ts.map +0 -1
- package/dist/server/api/src/coordination/task-queue-routes.js +0 -266
- package/dist/server/api/src/coordination/task-queue-routes.js.map +0 -1
- package/dist/server/api/src/coordination/task-queue.d.ts +0 -104
- package/dist/server/api/src/coordination/task-queue.d.ts.map +0 -1
- package/dist/server/api/src/coordination/task-queue.js +0 -378
- package/dist/server/api/src/coordination/task-queue.js.map +0 -1
- package/dist/server/api/src/coordination/tasks.d.ts +0 -7
- package/dist/server/api/src/coordination/tasks.d.ts.map +0 -1
- package/dist/server/api/src/coordination/tasks.js +0 -59
- package/dist/server/api/src/coordination/tasks.js.map +0 -1
- package/dist/server/api/src/decomposition/cli.d.ts +0 -18
- package/dist/server/api/src/decomposition/cli.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/cli.js +0 -191
- package/dist/server/api/src/decomposition/cli.js.map +0 -1
- package/dist/server/api/src/decomposition/codebase-analyzer.d.ts +0 -59
- package/dist/server/api/src/decomposition/codebase-analyzer.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/codebase-analyzer.js +0 -274
- package/dist/server/api/src/decomposition/codebase-analyzer.js.map +0 -1
- package/dist/server/api/src/decomposition/dependency-resolver.d.ts +0 -68
- package/dist/server/api/src/decomposition/dependency-resolver.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/dependency-resolver.js +0 -261
- package/dist/server/api/src/decomposition/dependency-resolver.js.map +0 -1
- package/dist/server/api/src/decomposition/index.d.ts +0 -17
- package/dist/server/api/src/decomposition/index.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/index.js +0 -19
- package/dist/server/api/src/decomposition/index.js.map +0 -1
- package/dist/server/api/src/decomposition/parallelization.d.ts +0 -40
- package/dist/server/api/src/decomposition/parallelization.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/parallelization.js +0 -144
- package/dist/server/api/src/decomposition/parallelization.js.map +0 -1
- package/dist/server/api/src/decomposition/planner.d.ts +0 -84
- package/dist/server/api/src/decomposition/planner.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/planner.js +0 -415
- package/dist/server/api/src/decomposition/planner.js.map +0 -1
- package/dist/server/api/src/decomposition/routes.d.ts +0 -13
- package/dist/server/api/src/decomposition/routes.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/routes.js +0 -114
- package/dist/server/api/src/decomposition/routes.js.map +0 -1
- package/dist/server/api/src/decomposition/strategies.d.ts +0 -43
- package/dist/server/api/src/decomposition/strategies.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/strategies.js +0 -147
- package/dist/server/api/src/decomposition/strategies.js.map +0 -1
- package/dist/server/api/src/decomposition/types.d.ts +0 -1090
- package/dist/server/api/src/decomposition/types.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/types.js +0 -65
- package/dist/server/api/src/decomposition/types.js.map +0 -1
- package/dist/server/api/src/decomposition/validator.d.ts +0 -84
- package/dist/server/api/src/decomposition/validator.d.ts.map +0 -1
- package/dist/server/api/src/decomposition/validator.js +0 -314
- package/dist/server/api/src/decomposition/validator.js.map +0 -1
- package/dist/server/api/src/flightline/ctk.d.ts +0 -2
- package/dist/server/api/src/flightline/ctk.d.ts.map +0 -1
- package/dist/server/api/src/flightline/ctk.js +0 -114
- package/dist/server/api/src/flightline/ctk.js.map +0 -1
- package/dist/server/api/src/flightline/tech-orders.d.ts +0 -2
- package/dist/server/api/src/flightline/tech-orders.d.ts.map +0 -1
- package/dist/server/api/src/flightline/tech-orders.js +0 -74
- package/dist/server/api/src/flightline/tech-orders.js.map +0 -1
- package/dist/server/api/src/flightline/work-orders.d.ts +0 -2
- package/dist/server/api/src/flightline/work-orders.d.ts.map +0 -1
- package/dist/server/api/src/flightline/work-orders.js +0 -178
- package/dist/server/api/src/flightline/work-orders.js.map +0 -1
- package/dist/server/api/src/index.d.ts +0 -3
- package/dist/server/api/src/index.d.ts.map +0 -1
- package/dist/server/api/src/index.js +0 -192
- package/dist/server/api/src/index.js.map +0 -1
- package/dist/server/api/src/middleware/agent-validation.d.ts +0 -161
- package/dist/server/api/src/middleware/agent-validation.d.ts.map +0 -1
- package/dist/server/api/src/middleware/agent-validation.js +0 -112
- package/dist/server/api/src/middleware/agent-validation.js.map +0 -1
- package/dist/server/api/src/middleware/error-handler.d.ts +0 -8
- package/dist/server/api/src/middleware/error-handler.d.ts.map +0 -1
- package/dist/server/api/src/middleware/error-handler.js +0 -54
- package/dist/server/api/src/middleware/error-handler.js.map +0 -1
- package/dist/server/api/src/middleware/logger.d.ts +0 -8
- package/dist/server/api/src/middleware/logger.d.ts.map +0 -1
- package/dist/server/api/src/middleware/logger.js +0 -31
- package/dist/server/api/src/middleware/logger.js.map +0 -1
- package/dist/server/api/src/middleware/validation.d.ts +0 -322
- package/dist/server/api/src/middleware/validation.d.ts.map +0 -1
- package/dist/server/api/src/middleware/validation.js +0 -189
- package/dist/server/api/src/middleware/validation.js.map +0 -1
- package/dist/server/api/src/squawk/blocker-handler.d.ts +0 -111
- package/dist/server/api/src/squawk/blocker-handler.d.ts.map +0 -1
- package/dist/server/api/src/squawk/blocker-handler.js +0 -262
- package/dist/server/api/src/squawk/blocker-handler.js.map +0 -1
- package/dist/server/api/src/squawk/coordinator.d.ts +0 -2
- package/dist/server/api/src/squawk/coordinator.d.ts.map +0 -1
- package/dist/server/api/src/squawk/coordinator.js +0 -24
- package/dist/server/api/src/squawk/coordinator.js.map +0 -1
- package/dist/server/api/src/squawk/cursor.d.ts +0 -2
- package/dist/server/api/src/squawk/cursor.d.ts.map +0 -1
- package/dist/server/api/src/squawk/cursor.js +0 -55
- package/dist/server/api/src/squawk/cursor.js.map +0 -1
- package/dist/server/api/src/squawk/dependency-resolver.d.ts +0 -107
- package/dist/server/api/src/squawk/dependency-resolver.d.ts.map +0 -1
- package/dist/server/api/src/squawk/dependency-resolver.js +0 -324
- package/dist/server/api/src/squawk/dependency-resolver.js.map +0 -1
- package/dist/server/api/src/squawk/dispatch-orchestrator.d.ts +0 -117
- package/dist/server/api/src/squawk/dispatch-orchestrator.d.ts.map +0 -1
- package/dist/server/api/src/squawk/dispatch-orchestrator.js +0 -296
- package/dist/server/api/src/squawk/dispatch-orchestrator.js.map +0 -1
- package/dist/server/api/src/squawk/lock-coordinator.d.ts +0 -118
- package/dist/server/api/src/squawk/lock-coordinator.d.ts.map +0 -1
- package/dist/server/api/src/squawk/lock-coordinator.js +0 -279
- package/dist/server/api/src/squawk/lock-coordinator.js.map +0 -1
- package/dist/server/api/src/squawk/lock.d.ts +0 -2
- package/dist/server/api/src/squawk/lock.d.ts.map +0 -1
- package/dist/server/api/src/squawk/lock.js +0 -87
- package/dist/server/api/src/squawk/lock.js.map +0 -1
- package/dist/server/api/src/squawk/mailbox.d.ts +0 -2
- package/dist/server/api/src/squawk/mailbox.d.ts.map +0 -1
- package/dist/server/api/src/squawk/mailbox.js +0 -66
- package/dist/server/api/src/squawk/mailbox.js.map +0 -1
- package/dist/server/api/src/squawk/spawning.d.ts +0 -79
- package/dist/server/api/src/squawk/spawning.d.ts.map +0 -1
- package/dist/server/api/src/squawk/spawning.js +0 -226
- package/dist/server/api/src/squawk/spawning.js.map +0 -1
- package/dist/server/api/src/squawk/specialist-tools.d.ts +0 -206
- package/dist/server/api/src/squawk/specialist-tools.d.ts.map +0 -1
- package/dist/server/api/src/squawk/specialist-tools.js +0 -411
- package/dist/server/api/src/squawk/specialist-tools.js.map +0 -1
- package/dist/server/api/src/types/api.d.ts +0 -63
- package/dist/server/api/src/types/api.d.ts.map +0 -1
- package/dist/server/api/src/types/api.js +0 -5
- package/dist/server/api/src/types/api.js.map +0 -1
- package/dist/squawk/src/db/index.d.ts +0 -30
- package/dist/squawk/src/db/index.d.ts.map +0 -1
- package/dist/squawk/src/db/index.js +0 -329
- package/dist/squawk/src/db/index.js.map +0 -1
- package/dist/squawk/src/db/sqlite.d.ts +0 -31
- package/dist/squawk/src/db/sqlite.d.ts.map +0 -1
- package/dist/squawk/src/db/sqlite.js +0 -558
- package/dist/squawk/src/db/sqlite.js.map +0 -1
- package/dist/squawk/src/db/types.d.ts +0 -611
- package/dist/squawk/src/db/types.d.ts.map +0 -1
- package/dist/squawk/src/db/types.js +0 -4
- package/dist/squawk/src/db/types.js.map +0 -1
- package/e2e-integration.test.ts +0 -290
- package/integration.test.ts +0 -186
- package/phase1-integration.test.ts +0 -455
- package/phase2-verification.test.ts +0 -135
- package/server.log +0 -58
- package/src/agent-runner.js +0 -877
- package/src/coordination/agent-lifecycle.ts +0 -13
- package/src/coordination/agent-runner.ts +0 -479
- package/src/coordination/agent-spawner-routes.ts +0 -340
- package/src/coordination/agent-spawner.ts +0 -885
- package/src/coordination/agents.ts +0 -525
- package/src/coordination/checkpoint-routes.ts +0 -382
- package/src/coordination/conflict-resolver.ts +0 -640
- package/src/coordination/missions.ts +0 -219
- package/src/coordination/monitor.ts +0 -593
- package/src/coordination/notifier.ts +0 -547
- package/src/coordination/progress-tracker.ts +0 -410
- package/src/coordination/recovery-manager.ts +0 -531
- package/src/coordination/task-decomposer.ts +0 -491
- package/src/coordination/task-queue-routes.ts +0 -284
- package/src/coordination/task-queue.ts +0 -480
- package/src/coordination/tasks.ts +0 -72
- package/src/flightline/ctk.ts +0 -131
- package/src/flightline/tech-orders.ts +0 -85
- package/src/flightline/work-orders.ts +0 -202
- package/src/index.ts +0 -211
- package/src/middleware/agent-validation.ts +0 -130
- package/src/middleware/error-handler.ts +0 -59
- package/src/middleware/logger.ts +0 -37
- package/src/middleware/validation.ts +0 -235
- package/src/squawk/coordinator.ts +0 -26
- package/src/squawk/cursor.ts +0 -62
- package/src/squawk/lock.ts +0 -98
- package/src/squawk/mailbox.ts +0 -75
- package/src/types/api.ts +0 -71
- package/test-api.ts +0 -310
- package/test-enhanced-agents.ts +0 -428
|
@@ -1,593 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Monitoring System for FleetTools Coordination
|
|
3
|
-
*
|
|
4
|
-
* Provides real-time monitoring of agents, missions, and system health
|
|
5
|
-
* Generates metrics and alerts for coordination system
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export interface MonitoringMetrics {
|
|
9
|
-
timestamp: string;
|
|
10
|
-
agents: {
|
|
11
|
-
total: number;
|
|
12
|
-
running: number;
|
|
13
|
-
idle: number;
|
|
14
|
-
failed: number;
|
|
15
|
-
averageUptime: number;
|
|
16
|
-
};
|
|
17
|
-
missions: {
|
|
18
|
-
total: number;
|
|
19
|
-
active: number;
|
|
20
|
-
completed: number;
|
|
21
|
-
averageProgress: number;
|
|
22
|
-
};
|
|
23
|
-
tasks: {
|
|
24
|
-
total: number;
|
|
25
|
-
pending: number;
|
|
26
|
-
inProgress: number;
|
|
27
|
-
completed: number;
|
|
28
|
-
failed: number;
|
|
29
|
-
};
|
|
30
|
-
conflicts: {
|
|
31
|
-
total: number;
|
|
32
|
-
unresolved: number;
|
|
33
|
-
autoResolved: number;
|
|
34
|
-
manuallyResolved: number;
|
|
35
|
-
};
|
|
36
|
-
system: {
|
|
37
|
-
uptime: number;
|
|
38
|
-
memoryUsage: number;
|
|
39
|
-
cpuUsage: number;
|
|
40
|
-
responseTime: number;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface AlertConfig {
|
|
45
|
-
agentFailureThreshold: number;
|
|
46
|
-
missionStaleThreshold: number; // hours
|
|
47
|
-
conflictCriticalThreshold: number;
|
|
48
|
-
responseTimeThreshold: number; // milliseconds
|
|
49
|
-
memoryUsageThreshold: number; // percentage
|
|
50
|
-
cpuUsageThreshold: number; // percentage
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface Alert {
|
|
54
|
-
id: string;
|
|
55
|
-
type: 'agent_failure' | 'mission_stale' | 'conflict_critical' | 'performance' | 'resource';
|
|
56
|
-
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
57
|
-
message: string;
|
|
58
|
-
timestamp: string;
|
|
59
|
-
resolved: boolean;
|
|
60
|
-
resolvedAt?: string;
|
|
61
|
-
metadata: Record<string, any>;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface MonitoringConfig {
|
|
65
|
-
alertConfig: AlertConfig;
|
|
66
|
-
metricsRetention: number; // days
|
|
67
|
-
alertRetention: number; // days
|
|
68
|
-
collectInterval: number; // milliseconds
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export class CoordinationMonitor {
|
|
72
|
-
private config: MonitoringConfig;
|
|
73
|
-
private metrics: MonitoringMetrics[] = [];
|
|
74
|
-
private alerts: Map<string, Alert> = new Map();
|
|
75
|
-
private startTime: Date = new Date();
|
|
76
|
-
private collectInterval?: ReturnType<typeof setInterval>;
|
|
77
|
-
private lastSystemMetrics = {
|
|
78
|
-
memoryUsage: 0,
|
|
79
|
-
cpuUsage: 0,
|
|
80
|
-
responseTime: 0
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
constructor(config: Partial<MonitoringConfig> = {}) {
|
|
84
|
-
this.config = {
|
|
85
|
-
alertConfig: {
|
|
86
|
-
agentFailureThreshold: 3, // failures in last hour
|
|
87
|
-
missionStaleThreshold: 24, // hours
|
|
88
|
-
conflictCriticalThreshold: 5, // critical conflicts
|
|
89
|
-
responseTimeThreshold: 5000, // 5 seconds
|
|
90
|
-
memoryUsageThreshold: 80, // 80%
|
|
91
|
-
cpuUsageThreshold: 85 // 85%
|
|
92
|
-
},
|
|
93
|
-
metricsRetention: 7, // 7 days
|
|
94
|
-
alertRetention: 30, // 30 days
|
|
95
|
-
collectInterval: 30000, // 30 seconds
|
|
96
|
-
...config
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
console.log('✓ CoordinationMonitor initialized');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Start monitoring collection
|
|
104
|
-
*/
|
|
105
|
-
start(): void {
|
|
106
|
-
if (this.collectInterval) {
|
|
107
|
-
clearInterval(this.collectInterval);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
this.collectInterval = setInterval(() => {
|
|
111
|
-
this.collectMetrics();
|
|
112
|
-
this.checkAlerts();
|
|
113
|
-
}, this.config.collectInterval);
|
|
114
|
-
|
|
115
|
-
console.log('📊 Monitoring started');
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Stop monitoring collection
|
|
120
|
-
*/
|
|
121
|
-
stop(): void {
|
|
122
|
-
if (this.collectInterval) {
|
|
123
|
-
clearInterval(this.collectInterval);
|
|
124
|
-
this.collectInterval = undefined;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
console.log('📊 Monitoring stopped');
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Collect current system metrics
|
|
132
|
-
*/
|
|
133
|
-
async collectMetrics(): Promise<MonitoringMetrics> {
|
|
134
|
-
const timestamp = new Date().toISOString();
|
|
135
|
-
|
|
136
|
-
// In a real implementation, these would come from actual components
|
|
137
|
-
// For now, we'll simulate the data collection
|
|
138
|
-
const metrics: MonitoringMetrics = {
|
|
139
|
-
timestamp,
|
|
140
|
-
agents: await this.collectAgentMetrics(),
|
|
141
|
-
missions: await this.collectMissionMetrics(),
|
|
142
|
-
tasks: await this.collectTaskMetrics(),
|
|
143
|
-
conflicts: await this.collectConflictMetrics(),
|
|
144
|
-
system: await this.collectSystemMetrics()
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// Store metrics
|
|
148
|
-
this.metrics.push(metrics);
|
|
149
|
-
|
|
150
|
-
// Keep only metrics within retention period
|
|
151
|
-
this.cleanupOldMetrics();
|
|
152
|
-
|
|
153
|
-
// Update system metrics for next collection
|
|
154
|
-
this.lastSystemMetrics = {
|
|
155
|
-
memoryUsage: metrics.system.memoryUsage,
|
|
156
|
-
cpuUsage: metrics.system.cpuUsage,
|
|
157
|
-
responseTime: metrics.system.responseTime
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
return metrics;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Collect agent-related metrics
|
|
165
|
-
*/
|
|
166
|
-
private async collectAgentMetrics(): Promise<MonitoringMetrics['agents']> {
|
|
167
|
-
// In real implementation, this would query AgentSpawner
|
|
168
|
-
// For now, return simulated data
|
|
169
|
-
return {
|
|
170
|
-
total: 10,
|
|
171
|
-
running: 6,
|
|
172
|
-
idle: 2,
|
|
173
|
-
failed: 2,
|
|
174
|
-
averageUptime: 1800 // 30 minutes
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Collect mission-related metrics
|
|
180
|
-
*/
|
|
181
|
-
private async collectMissionMetrics(): Promise<MonitoringMetrics['missions']> {
|
|
182
|
-
// In real implementation, this would query ProgressTracker
|
|
183
|
-
// For now, return simulated data
|
|
184
|
-
return {
|
|
185
|
-
total: 15,
|
|
186
|
-
active: 5,
|
|
187
|
-
completed: 8,
|
|
188
|
-
averageProgress: 67.5
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Collect task-related metrics
|
|
194
|
-
*/
|
|
195
|
-
private async collectTaskMetrics(): Promise<MonitoringMetrics['tasks']> {
|
|
196
|
-
// In real implementation, this would query TaskQueue
|
|
197
|
-
// For now, return simulated data
|
|
198
|
-
return {
|
|
199
|
-
total: 45,
|
|
200
|
-
pending: 12,
|
|
201
|
-
inProgress: 8,
|
|
202
|
-
completed: 20,
|
|
203
|
-
failed: 5
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Collect conflict-related metrics
|
|
209
|
-
*/
|
|
210
|
-
private async collectConflictMetrics(): Promise<MonitoringMetrics['conflicts']> {
|
|
211
|
-
// In real implementation, this would query ConflictResolver
|
|
212
|
-
// For now, return simulated data
|
|
213
|
-
return {
|
|
214
|
-
total: 8,
|
|
215
|
-
unresolved: 2,
|
|
216
|
-
autoResolved: 5,
|
|
217
|
-
manuallyResolved: 1
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Collect system-related metrics
|
|
223
|
-
*/
|
|
224
|
-
private async collectSystemMetrics(): Promise<MonitoringMetrics['system']> {
|
|
225
|
-
const uptime = Date.now() - this.startTime.getTime();
|
|
226
|
-
|
|
227
|
-
// Use Node.js process metrics for memory and CPU
|
|
228
|
-
const memoryUsage = process.memoryUsage();
|
|
229
|
-
const memoryUsagePercent = (memoryUsage.heapUsed / memoryUsage.heapTotal) * 100;
|
|
230
|
-
|
|
231
|
-
// CPU usage (simplified - real implementation would use more accurate measurement)
|
|
232
|
-
const cpuUsage = Math.random() * 20 + 10; // 10-30% simulated
|
|
233
|
-
|
|
234
|
-
// Response time measurement (would be measured from actual API calls)
|
|
235
|
-
const responseTime = this.lastSystemMetrics.responseTime * 0.9 + Math.random() * 100; // Smoothed response time
|
|
236
|
-
|
|
237
|
-
return {
|
|
238
|
-
uptime: uptime,
|
|
239
|
-
memoryUsage: Math.round(memoryUsagePercent * 100) / 100,
|
|
240
|
-
cpuUsage: Math.round(cpuUsage * 100) / 100,
|
|
241
|
-
responseTime: Math.round(responseTime * 100) / 100
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Check for alerts based on current metrics
|
|
247
|
-
*/
|
|
248
|
-
async checkAlerts(): Promise<Alert[]> {
|
|
249
|
-
const latestMetrics = this.metrics[this.metrics.length - 1];
|
|
250
|
-
if (!latestMetrics) {
|
|
251
|
-
return [];
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
const newAlerts: Alert[] = [];
|
|
255
|
-
const config = this.config.alertConfig;
|
|
256
|
-
|
|
257
|
-
// Check agent failure rate
|
|
258
|
-
const agentFailures = this.getRecentAgentFailures();
|
|
259
|
-
if (agentFailures >= config.agentFailureThreshold) {
|
|
260
|
-
newAlerts.push(this.createAlert(
|
|
261
|
-
'agent_failure',
|
|
262
|
-
'high',
|
|
263
|
-
`High agent failure rate: ${agentFailures} failures in last hour`,
|
|
264
|
-
{ failureCount: agentFailures, threshold: config.agentFailureThreshold }
|
|
265
|
-
));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Check stale missions
|
|
269
|
-
const staleMissions = this.getStaleMissions(config.missionStaleThreshold);
|
|
270
|
-
if (staleMissions.length > 0) {
|
|
271
|
-
newAlerts.push(this.createAlert(
|
|
272
|
-
'mission_stale',
|
|
273
|
-
'medium',
|
|
274
|
-
`${staleMissions.length} missions stale for over ${config.missionStaleThreshold} hours`,
|
|
275
|
-
{ staleMissions, thresholdHours: config.missionStaleThreshold }
|
|
276
|
-
));
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Check critical conflicts
|
|
280
|
-
if (latestMetrics.conflicts.unresolved > 0) {
|
|
281
|
-
const criticalConflicts = await this.getCriticalConflicts();
|
|
282
|
-
if (criticalConflicts.length >= config.conflictCriticalThreshold) {
|
|
283
|
-
newAlerts.push(this.createAlert(
|
|
284
|
-
'conflict_critical',
|
|
285
|
-
'critical',
|
|
286
|
-
`High number of critical conflicts: ${criticalConflicts.length}`,
|
|
287
|
-
{ conflictCount: criticalConflicts.length, threshold: config.conflictCriticalThreshold }
|
|
288
|
-
));
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
// Check performance metrics
|
|
293
|
-
if (latestMetrics.system.responseTime > config.responseTimeThreshold) {
|
|
294
|
-
newAlerts.push(this.createAlert(
|
|
295
|
-
'performance',
|
|
296
|
-
'high',
|
|
297
|
-
`High response time: ${latestMetrics.system.responseTime}ms (threshold: ${config.responseTimeThreshold}ms)`,
|
|
298
|
-
{ responseTime: latestMetrics.system.responseTime, threshold: config.responseTimeThreshold }
|
|
299
|
-
));
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if (latestMetrics.system.memoryUsage > config.memoryUsageThreshold) {
|
|
303
|
-
newAlerts.push(this.createAlert(
|
|
304
|
-
'resource',
|
|
305
|
-
'high',
|
|
306
|
-
`High memory usage: ${latestMetrics.system.memoryUsage}% (threshold: ${config.memoryUsageThreshold}%)`,
|
|
307
|
-
{ memoryUsage: latestMetrics.system.memoryUsage, threshold: config.memoryUsageThreshold }
|
|
308
|
-
));
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (latestMetrics.system.cpuUsage > config.cpuUsageThreshold) {
|
|
312
|
-
newAlerts.push(this.createAlert(
|
|
313
|
-
'resource',
|
|
314
|
-
'medium',
|
|
315
|
-
`High CPU usage: ${latestMetrics.system.cpuUsage}% (threshold: ${config.cpuUsageThreshold}%)`,
|
|
316
|
-
{ cpuUsage: latestMetrics.system.cpuUsage, threshold: config.cpuUsageThreshold }
|
|
317
|
-
));
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// Store new alerts
|
|
321
|
-
newAlerts.forEach(alert => {
|
|
322
|
-
this.alerts.set(alert.id, alert);
|
|
323
|
-
});
|
|
324
|
-
|
|
325
|
-
if (newAlerts.length > 0) {
|
|
326
|
-
console.log(`🚨 Generated ${newAlerts.length} alerts`);
|
|
327
|
-
newAlerts.forEach(alert => {
|
|
328
|
-
console.log(` ${alert.severity.toUpperCase()}: ${alert.message}`);
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return newAlerts;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Create a new alert
|
|
337
|
-
*/
|
|
338
|
-
private createAlert(
|
|
339
|
-
type: Alert['type'],
|
|
340
|
-
severity: Alert['severity'],
|
|
341
|
-
message: string,
|
|
342
|
-
metadata: Record<string, any>
|
|
343
|
-
): Alert {
|
|
344
|
-
return {
|
|
345
|
-
id: `alt_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`,
|
|
346
|
-
type,
|
|
347
|
-
severity,
|
|
348
|
-
message,
|
|
349
|
-
timestamp: new Date().toISOString(),
|
|
350
|
-
resolved: false,
|
|
351
|
-
metadata
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Get current monitoring dashboard data
|
|
357
|
-
*/
|
|
358
|
-
async getDashboardData(): Promise<{
|
|
359
|
-
metrics: MonitoringMetrics | null;
|
|
360
|
-
alerts: Alert[];
|
|
361
|
-
summary: {
|
|
362
|
-
totalAlerts: number;
|
|
363
|
-
unresolvedAlerts: number;
|
|
364
|
-
criticalAlerts: number;
|
|
365
|
-
systemHealth: 'healthy' | 'warning' | 'critical';
|
|
366
|
-
};
|
|
367
|
-
}> {
|
|
368
|
-
const metrics = this.metrics.length > 0 ? this.metrics[this.metrics.length - 1] : null;
|
|
369
|
-
const alerts = Array.from(this.alerts.values());
|
|
370
|
-
const unresolvedAlerts = alerts.filter(alert => !alert.resolved);
|
|
371
|
-
const criticalAlerts = unresolvedAlerts.filter(alert => alert.severity === 'critical');
|
|
372
|
-
|
|
373
|
-
// Determine system health
|
|
374
|
-
let systemHealth: 'healthy' | 'warning' | 'critical' = 'healthy';
|
|
375
|
-
if (criticalAlerts.length > 0) {
|
|
376
|
-
systemHealth = 'critical';
|
|
377
|
-
} else if (unresolvedAlerts.length > 5) {
|
|
378
|
-
systemHealth = 'warning';
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return {
|
|
382
|
-
metrics,
|
|
383
|
-
alerts,
|
|
384
|
-
summary: {
|
|
385
|
-
totalAlerts: alerts.length,
|
|
386
|
-
unresolvedAlerts: unresolvedAlerts.length,
|
|
387
|
-
criticalAlerts: criticalAlerts.length,
|
|
388
|
-
systemHealth
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Get metrics history
|
|
395
|
-
*/
|
|
396
|
-
getMetricsHistory(hours: number = 24): MonitoringMetrics[] {
|
|
397
|
-
const cutoff = new Date();
|
|
398
|
-
cutoff.setHours(cutoff.getHours() - hours);
|
|
399
|
-
|
|
400
|
-
return this.metrics.filter(metric =>
|
|
401
|
-
new Date(metric.timestamp) >= cutoff
|
|
402
|
-
);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* Get active alerts
|
|
407
|
-
*/
|
|
408
|
-
getActiveAlerts(): Alert[] {
|
|
409
|
-
return Array.from(this.alerts.values()).filter(alert => !alert.resolved);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Resolve an alert
|
|
414
|
-
*/
|
|
415
|
-
resolveAlert(alertId: string, resolution?: string): void {
|
|
416
|
-
const alert = this.alerts.get(alertId);
|
|
417
|
-
if (alert) {
|
|
418
|
-
alert.resolved = true;
|
|
419
|
-
alert.resolvedAt = new Date().toISOString();
|
|
420
|
-
if (resolution) {
|
|
421
|
-
alert.metadata.resolution = resolution;
|
|
422
|
-
}
|
|
423
|
-
this.alerts.set(alertId, alert);
|
|
424
|
-
console.log(`✓ Resolved alert ${alertId}: ${alert.message}`);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* Helper methods for alert checking
|
|
430
|
-
*/
|
|
431
|
-
private getRecentAgentFailures(): number {
|
|
432
|
-
// In real implementation, this would query agent failure logs
|
|
433
|
-
// For now, return simulated data
|
|
434
|
-
return Math.floor(Math.random() * 5);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
private getStaleMissions(hours: number): string[] {
|
|
438
|
-
// In real implementation, this would query mission data
|
|
439
|
-
// For now, return simulated data
|
|
440
|
-
return Math.random() > 0.7 ? ['mission-123', 'mission-456'] : [];
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
private async getCriticalConflicts(): Promise<any[]> {
|
|
444
|
-
// In real implementation, this would query conflict resolver
|
|
445
|
-
// For now, return simulated data
|
|
446
|
-
return Math.random() > 0.8 ? ['conflict-1', 'conflict-2'] : [];
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Clean up old metrics beyond retention period
|
|
451
|
-
*/
|
|
452
|
-
private cleanupOldMetrics(): void {
|
|
453
|
-
const cutoff = new Date();
|
|
454
|
-
cutoff.setDate(cutoff.getDate() - this.config.metricsRetention);
|
|
455
|
-
|
|
456
|
-
const beforeCount = this.metrics.length;
|
|
457
|
-
this.metrics = this.metrics.filter(metric =>
|
|
458
|
-
new Date(metric.timestamp) >= cutoff
|
|
459
|
-
);
|
|
460
|
-
|
|
461
|
-
if (this.metrics.length < beforeCount) {
|
|
462
|
-
console.log(`🧹 Cleaned up ${beforeCount - this.metrics.length} old metrics records`);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Clean up old resolved alerts
|
|
468
|
-
*/
|
|
469
|
-
cleanupOldAlerts(): void {
|
|
470
|
-
const cutoff = new Date();
|
|
471
|
-
cutoff.setDate(cutoff.getDate() - this.config.alertRetention);
|
|
472
|
-
|
|
473
|
-
let cleanedCount = 0;
|
|
474
|
-
for (const [alertId, alert] of this.alerts.entries()) {
|
|
475
|
-
if (alert.resolved && alert.resolvedAt && new Date(alert.resolvedAt) < cutoff) {
|
|
476
|
-
this.alerts.delete(alertId);
|
|
477
|
-
cleanedCount++;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
if (cleanedCount > 0) {
|
|
482
|
-
console.log(`🧹 Cleaned up ${cleanedCount} old resolved alerts`);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Export monitoring data for external systems
|
|
488
|
-
*/
|
|
489
|
-
exportData(): {
|
|
490
|
-
metrics: MonitoringMetrics[];
|
|
491
|
-
alerts: Alert[];
|
|
492
|
-
summary: MonitoringMetrics;
|
|
493
|
-
} {
|
|
494
|
-
const summaryMetrics = this.calculateSummaryMetrics();
|
|
495
|
-
|
|
496
|
-
return {
|
|
497
|
-
metrics: this.metrics,
|
|
498
|
-
alerts: Array.from(this.alerts.values()),
|
|
499
|
-
summary: summaryMetrics
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Calculate summary metrics from all collected data
|
|
505
|
-
*/
|
|
506
|
-
private calculateSummaryMetrics(): MonitoringMetrics {
|
|
507
|
-
if (this.metrics.length === 0) {
|
|
508
|
-
throw new Error('No metrics available for summary calculation');
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
const latest = this.metrics[this.metrics.length - 1];
|
|
512
|
-
|
|
513
|
-
// Calculate averages across all metrics
|
|
514
|
-
const avgAgents = this.calculateAverage(this.metrics.map(m => m.agents.total));
|
|
515
|
-
const avgMissions = this.calculateAverage(this.metrics.map(m => m.missions.total));
|
|
516
|
-
const avgTasks = this.calculateAverage(this.metrics.map(m => m.tasks.total));
|
|
517
|
-
|
|
518
|
-
return {
|
|
519
|
-
timestamp: new Date().toISOString(),
|
|
520
|
-
agents: {
|
|
521
|
-
...latest.agents,
|
|
522
|
-
total: Math.round(avgAgents)
|
|
523
|
-
},
|
|
524
|
-
missions: {
|
|
525
|
-
...latest.missions,
|
|
526
|
-
total: Math.round(avgMissions)
|
|
527
|
-
},
|
|
528
|
-
tasks: {
|
|
529
|
-
...latest.tasks,
|
|
530
|
-
total: Math.round(avgTasks)
|
|
531
|
-
},
|
|
532
|
-
conflicts: latest.conflicts,
|
|
533
|
-
system: latest.system
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
private calculateAverage(values: number[]): number {
|
|
538
|
-
return values.reduce((sum, val) => sum + val, 0) / values.length;
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Get system health status
|
|
543
|
-
*/
|
|
544
|
-
getSystemHealth(): {
|
|
545
|
-
status: 'healthy' | 'warning' | 'critical';
|
|
546
|
-
issues: string[];
|
|
547
|
-
recommendations: string[];
|
|
548
|
-
} {
|
|
549
|
-
const latest = this.metrics[this.metrics.length - 1];
|
|
550
|
-
const activeAlerts = this.getActiveAlerts();
|
|
551
|
-
const criticalAlerts = activeAlerts.filter(alert => alert.severity === 'critical');
|
|
552
|
-
const issues: string[] = [];
|
|
553
|
-
const recommendations: string[] = [];
|
|
554
|
-
|
|
555
|
-
if (!latest) {
|
|
556
|
-
return {
|
|
557
|
-
status: 'warning',
|
|
558
|
-
issues: ['No metrics available'],
|
|
559
|
-
recommendations: ['Start monitoring collection']
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// Check various health indicators
|
|
564
|
-
if (criticalAlerts.length > 0) {
|
|
565
|
-
issues.push(`${criticalAlerts.length} critical alerts active`);
|
|
566
|
-
recommendations.push('Address critical alerts immediately');
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
if (latest.system.memoryUsage > this.config.alertConfig.memoryUsageThreshold) {
|
|
570
|
-
issues.push(`High memory usage: ${latest.system.memoryUsage}%`);
|
|
571
|
-
recommendations.push('Monitor memory leaks, consider scaling');
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
if (latest.system.cpuUsage > this.config.alertConfig.cpuUsageThreshold) {
|
|
575
|
-
issues.push(`High CPU usage: ${latest.system.cpuUsage}%`);
|
|
576
|
-
recommendations.push('Optimize performance, distribute load');
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
if (latest.system.responseTime > this.config.alertConfig.responseTimeThreshold) {
|
|
580
|
-
issues.push(`Slow response times: ${latest.system.responseTime}ms`);
|
|
581
|
-
recommendations.push('Optimize API performance');
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
const status = criticalAlerts.length > 0 ? 'critical' :
|
|
585
|
-
issues.length > 0 ? 'warning' : 'healthy';
|
|
586
|
-
|
|
587
|
-
return {
|
|
588
|
-
status,
|
|
589
|
-
issues,
|
|
590
|
-
recommendations
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
}
|