@fleettools/server 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/.flightline/checkpoints.db +0 -0
- package/.flightline/ctk/04a5510b-1e09-40c6-91c8-399c22138708.json +9 -0
- package/.flightline/ctk/0ecde721-7827-4039-995a-974e24493cc5.json +9 -0
- package/.flightline/ctk/268bbdbd-ddd7-46b2-845f-56a138aa518a.json +9 -0
- package/.flightline/ctk/6f476f2e-776c-407a-b441-b9365c0bae95.json +9 -0
- package/.flightline/ctk/7e10d0d5-fbc2-4661-af03-53de89e064db.json +9 -0
- package/.flightline/ctk/90783096-b7d4-49c5-8153-3c35018a2e61.json +9 -0
- package/.flightline/ctk/9a3b6d18-8a46-4728-90aa-279800a8e397.json +9 -0
- package/.flightline/ctk/ae30e192-b386-4ee2-899c-93f86785d3f3.json +9 -0
- package/.flightline/ctk/d0e9c49e-10df-413e-8cf7-37232b1838ca.json +9 -0
- package/.flightline/ctk/eae1a12b-2e9d-4c3f-8619-dafbb1346e96.json +9 -0
- package/.flightline/mailboxes/mbx_00dae6ba-0b5e-4a8d-a86d-93c8640872c3/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_05b0bfa9-c4f5-4f68-ba75-6202820f49c3/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_0a6b8fb2-729e-4385-8241-839c36b929d7/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_0abca4ab-8e34-409c-997f-481e80e450dc/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_173e5fb9-8203-418d-93c2-4f8c91f2d842/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_22b62201-0570-4ce8-b0a7-0f4b445f6d9e/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_2724efb1-76e1-4147-9620-4defcc65510f/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_35b8bfcd-5a54-48f1-8759-cb1f8ffe775d/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_3bc5193a-604d-4f52-be00-e56277643358/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_3bd500f3-c111-427a-8cd7-a004125d6dc1/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_45ce9ae8-5299-44dc-a1b5-4d63914a9609/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_4779c645-1efc-4c76-ab21-ff93f973ee8f/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_482237cf-87c8-486e-a24d-0941be2f480d/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_4b7e23c8-5680-4edd-a276-88803dd5fb6f/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_4dd3b945-d846-4c7a-94eb-6eeb25a0dc6b/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_4ec41a62-62bb-4be4-b3ce-282d5a33acce/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_4ff7ee7e-0c8a-43d6-a829-7c62c10af3b0/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_7661e4fb-a919-4af1-86f7-3eaef22f1d81/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_7ca872bb-69ab-4e7d-a7c6-4888ec8e7749/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_7e6d5707-2aa5-4770-a7be-6b1be93d0d87/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_87bef50d-3c59-429b-a995-5872f6278c37/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_88d1ea56-0b69-48c4-9fcf-ce1e1f7527ba/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_8bfb6bd7-07d1-4836-ae9d-3c93668c6dfe/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_93355083-e95b-4341-b625-56fcc1e4fc0c/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_999fd94c-ca56-4fec-8d30-8b677cf40ad6/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_a039fd15-7ee1-4bd6-906d-55dea8d0e489/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_a0b7363f-7cc6-4940-8e29-2dc85793a77d/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_a31e8b61-9643-4c78-939d-d1696d0420d9/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_acc51591-256c-4bed-9a51-514b1811f4cd/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_b1efebd9-5981-49fa-8775-20fa00d0c902/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_ba9d4c61-39a3-4852-95d7-bd34e3605a43/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_c549b60f-65fd-48d5-8cd6-2f053292b112/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_d0f839a5-3ab9-42e2-b438-df5825d049fe/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_d826d57e-9817-4f3c-ab94-2bfafa352f6d/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_da102f37-632c-4c0b-be4c-4270a74c06b9/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_df4506f5-67f2-4cf6-9113-93994b76f39b/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_e038e93b-87ea-4122-9578-6540018697b7/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_e0c171c5-407f-44dc-9ef9-e26e8b99ceac/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_e64770bf-7220-4d0f-848c-d751ea1c7376/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_e7f0edda-0fab-484d-ab4d-d8a8e363cd14/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_ec7d9118-8594-4d79-bf79-f43afdfaf156/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_ee06ec01-03e4-485a-ae2b-d8bdb6e7a3a8/manifest.json +6 -0
- package/.flightline/mailboxes/mbx_fd467681-f9cf-4a54-b06a-836df6de2ccc/manifest.json +6 -0
- package/.flightline/progress.db +0 -0
- package/.flightline/recovery.log +1 -0
- package/.flightline/tasks.db +0 -0
- package/.flightline/tech-orders/to_0c93d981-6b4e-4055-8678-f39c009d1db1.json +11 -0
- package/.flightline/tech-orders/to_1862f8ed-c487-4914-9f1e-528af6d4f053.json +11 -0
- package/.flightline/tech-orders/to_2335a57d-f400-4efa-b108-e13ece57520d.json +11 -0
- package/.flightline/tech-orders/to_2bd8dbdd-ac57-4b84-b977-33a3637d10d1.json +11 -0
- package/.flightline/tech-orders/to_37057c01-39b5-403a-991f-afb186abde95.json +11 -0
- package/.flightline/tech-orders/to_9e7288bb-c0fd-488a-a83d-1e9337bd0f1f.json +11 -0
- package/.flightline/tech-orders/to_aa0fe80b-9de7-40f6-a106-353b5bca10bd.json +11 -0
- package/.flightline/tech-orders/to_c1a0f480-c863-4203-a070-76ad77137845.json +11 -0
- package/.flightline/tech-orders/to_cf1e882a-cf56-45a4-8d19-494925e5f449.json +11 -0
- package/.flightline/work-orders/wo_5a29168d-5fb4-41d7-8dac-1d1151d9248f/manifest.json +15 -0
- package/.flightline/work-orders/wo_6c8c38bb-17a1-4885-ada4-dbfc5cc12d7a/manifest.json +15 -0
- package/.flightline/work-orders/wo_cadeb9b2-ea42-4491-b429-e2d467942b5c/manifest.json +12 -0
- package/.flightline/work-orders/wo_cc7b669c-16c4-4ef7-8a76-d1813219d0be/manifest.json +15 -0
- package/AGENTS.md +30 -0
- package/dist/agent-lifecycle.js +148 -0
- package/dist/agent-spawner.js +460 -0
- package/dist/agent-validation.js +111 -0
- package/dist/index.js +255 -0
- package/dist/server/api/src/coordination/agent-lifecycle.d.ts +12 -0
- package/dist/server/api/src/coordination/agent-lifecycle.d.ts.map +1 -0
- package/dist/server/api/src/coordination/agent-lifecycle.js +12 -0
- package/dist/server/api/src/coordination/agent-lifecycle.js.map +1 -0
- package/dist/server/api/src/coordination/agent-runner.d.ts +9 -0
- package/dist/server/api/src/coordination/agent-runner.d.ts.map +1 -0
- package/dist/server/api/src/coordination/agent-runner.js +416 -0
- package/dist/server/api/src/coordination/agent-runner.js.map +1 -0
- package/dist/server/api/src/coordination/agent-spawner-routes.d.ts +7 -0
- package/dist/server/api/src/coordination/agent-spawner-routes.d.ts.map +1 -0
- package/dist/server/api/src/coordination/agent-spawner-routes.js +321 -0
- package/dist/server/api/src/coordination/agent-spawner-routes.js.map +1 -0
- package/dist/server/api/src/coordination/agent-spawner.d.ts +187 -0
- package/dist/server/api/src/coordination/agent-spawner.d.ts.map +1 -0
- package/dist/server/api/src/coordination/agent-spawner.js +712 -0
- package/dist/server/api/src/coordination/agent-spawner.js.map +1 -0
- package/dist/server/api/src/coordination/agents.d.ts +13 -0
- package/dist/server/api/src/coordination/agents.d.ts.map +1 -0
- package/dist/server/api/src/coordination/agents.js +464 -0
- package/dist/server/api/src/coordination/agents.js.map +1 -0
- package/dist/server/api/src/coordination/checkpoint-routes.d.ts +33 -0
- package/dist/server/api/src/coordination/checkpoint-routes.d.ts.map +1 -0
- package/dist/server/api/src/coordination/checkpoint-routes.js +323 -0
- package/dist/server/api/src/coordination/checkpoint-routes.js.map +1 -0
- package/dist/server/api/src/coordination/conflict-resolver.d.ts +152 -0
- package/dist/server/api/src/coordination/conflict-resolver.d.ts.map +1 -0
- package/dist/server/api/src/coordination/conflict-resolver.js +502 -0
- package/dist/server/api/src/coordination/conflict-resolver.js.map +1 -0
- package/dist/server/api/src/coordination/missions.d.ts +9 -0
- package/dist/server/api/src/coordination/missions.d.ts.map +1 -0
- package/dist/server/api/src/coordination/missions.js +148 -0
- package/dist/server/api/src/coordination/missions.js.map +1 -0
- package/dist/server/api/src/coordination/monitor.d.ts +175 -0
- package/dist/server/api/src/coordination/monitor.d.ts.map +1 -0
- package/dist/server/api/src/coordination/monitor.js +410 -0
- package/dist/server/api/src/coordination/monitor.js.map +1 -0
- package/dist/server/api/src/coordination/notifier.d.ts +160 -0
- package/dist/server/api/src/coordination/notifier.d.ts.map +1 -0
- package/dist/server/api/src/coordination/notifier.js +422 -0
- package/dist/server/api/src/coordination/notifier.js.map +1 -0
- package/dist/server/api/src/coordination/progress-tracker.d.ts +98 -0
- package/dist/server/api/src/coordination/progress-tracker.d.ts.map +1 -0
- package/dist/server/api/src/coordination/progress-tracker.js +323 -0
- package/dist/server/api/src/coordination/progress-tracker.js.map +1 -0
- package/dist/server/api/src/coordination/recovery-manager.d.ts +135 -0
- package/dist/server/api/src/coordination/recovery-manager.d.ts.map +1 -0
- package/dist/server/api/src/coordination/recovery-manager.js +435 -0
- package/dist/server/api/src/coordination/recovery-manager.js.map +1 -0
- package/dist/server/api/src/coordination/task-decomposer.d.ts +90 -0
- package/dist/server/api/src/coordination/task-decomposer.d.ts.map +1 -0
- package/dist/server/api/src/coordination/task-decomposer.js +412 -0
- package/dist/server/api/src/coordination/task-decomposer.js.map +1 -0
- package/dist/server/api/src/coordination/task-queue-routes.d.ts +7 -0
- package/dist/server/api/src/coordination/task-queue-routes.d.ts.map +1 -0
- package/dist/server/api/src/coordination/task-queue-routes.js +266 -0
- package/dist/server/api/src/coordination/task-queue-routes.js.map +1 -0
- package/dist/server/api/src/coordination/task-queue.d.ts +104 -0
- package/dist/server/api/src/coordination/task-queue.d.ts.map +1 -0
- package/dist/server/api/src/coordination/task-queue.js +378 -0
- package/dist/server/api/src/coordination/task-queue.js.map +1 -0
- package/dist/server/api/src/coordination/tasks.d.ts +7 -0
- package/dist/server/api/src/coordination/tasks.d.ts.map +1 -0
- package/dist/server/api/src/coordination/tasks.js +59 -0
- package/dist/server/api/src/coordination/tasks.js.map +1 -0
- package/dist/server/api/src/decomposition/cli.d.ts +18 -0
- package/dist/server/api/src/decomposition/cli.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/cli.js +191 -0
- package/dist/server/api/src/decomposition/cli.js.map +1 -0
- package/dist/server/api/src/decomposition/codebase-analyzer.d.ts +59 -0
- package/dist/server/api/src/decomposition/codebase-analyzer.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/codebase-analyzer.js +274 -0
- package/dist/server/api/src/decomposition/codebase-analyzer.js.map +1 -0
- package/dist/server/api/src/decomposition/dependency-resolver.d.ts +68 -0
- package/dist/server/api/src/decomposition/dependency-resolver.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/dependency-resolver.js +261 -0
- package/dist/server/api/src/decomposition/dependency-resolver.js.map +1 -0
- package/dist/server/api/src/decomposition/index.d.ts +17 -0
- package/dist/server/api/src/decomposition/index.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/index.js +19 -0
- package/dist/server/api/src/decomposition/index.js.map +1 -0
- package/dist/server/api/src/decomposition/parallelization.d.ts +40 -0
- package/dist/server/api/src/decomposition/parallelization.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/parallelization.js +144 -0
- package/dist/server/api/src/decomposition/parallelization.js.map +1 -0
- package/dist/server/api/src/decomposition/planner.d.ts +84 -0
- package/dist/server/api/src/decomposition/planner.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/planner.js +415 -0
- package/dist/server/api/src/decomposition/planner.js.map +1 -0
- package/dist/server/api/src/decomposition/routes.d.ts +13 -0
- package/dist/server/api/src/decomposition/routes.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/routes.js +114 -0
- package/dist/server/api/src/decomposition/routes.js.map +1 -0
- package/dist/server/api/src/decomposition/strategies.d.ts +43 -0
- package/dist/server/api/src/decomposition/strategies.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/strategies.js +147 -0
- package/dist/server/api/src/decomposition/strategies.js.map +1 -0
- package/dist/server/api/src/decomposition/types.d.ts +1090 -0
- package/dist/server/api/src/decomposition/types.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/types.js +65 -0
- package/dist/server/api/src/decomposition/types.js.map +1 -0
- package/dist/server/api/src/decomposition/validator.d.ts +84 -0
- package/dist/server/api/src/decomposition/validator.d.ts.map +1 -0
- package/dist/server/api/src/decomposition/validator.js +314 -0
- package/dist/server/api/src/decomposition/validator.js.map +1 -0
- package/dist/server/api/src/flightline/ctk.d.ts +2 -0
- package/dist/server/api/src/flightline/ctk.d.ts.map +1 -0
- package/dist/server/api/src/flightline/ctk.js +114 -0
- package/dist/server/api/src/flightline/ctk.js.map +1 -0
- package/dist/server/api/src/flightline/tech-orders.d.ts +2 -0
- package/dist/server/api/src/flightline/tech-orders.d.ts.map +1 -0
- package/dist/server/api/src/flightline/tech-orders.js +74 -0
- package/dist/server/api/src/flightline/tech-orders.js.map +1 -0
- package/dist/server/api/src/flightline/work-orders.d.ts +2 -0
- package/dist/server/api/src/flightline/work-orders.d.ts.map +1 -0
- package/dist/server/api/src/flightline/work-orders.js +178 -0
- package/dist/server/api/src/flightline/work-orders.js.map +1 -0
- package/dist/server/api/src/index.d.ts +3 -0
- package/dist/server/api/src/index.d.ts.map +1 -0
- package/dist/server/api/src/index.js +192 -0
- package/dist/server/api/src/index.js.map +1 -0
- package/dist/server/api/src/middleware/agent-validation.d.ts +161 -0
- package/dist/server/api/src/middleware/agent-validation.d.ts.map +1 -0
- package/dist/server/api/src/middleware/agent-validation.js +112 -0
- package/dist/server/api/src/middleware/agent-validation.js.map +1 -0
- package/dist/server/api/src/middleware/error-handler.d.ts +8 -0
- package/dist/server/api/src/middleware/error-handler.d.ts.map +1 -0
- package/dist/server/api/src/middleware/error-handler.js +54 -0
- package/dist/server/api/src/middleware/error-handler.js.map +1 -0
- package/dist/server/api/src/middleware/logger.d.ts +8 -0
- package/dist/server/api/src/middleware/logger.d.ts.map +1 -0
- package/dist/server/api/src/middleware/logger.js +31 -0
- package/dist/server/api/src/middleware/logger.js.map +1 -0
- package/dist/server/api/src/middleware/validation.d.ts +322 -0
- package/dist/server/api/src/middleware/validation.d.ts.map +1 -0
- package/dist/server/api/src/middleware/validation.js +189 -0
- package/dist/server/api/src/middleware/validation.js.map +1 -0
- package/dist/server/api/src/squawk/blocker-handler.d.ts +111 -0
- package/dist/server/api/src/squawk/blocker-handler.d.ts.map +1 -0
- package/dist/server/api/src/squawk/blocker-handler.js +262 -0
- package/dist/server/api/src/squawk/blocker-handler.js.map +1 -0
- package/dist/server/api/src/squawk/coordinator.d.ts +2 -0
- package/dist/server/api/src/squawk/coordinator.d.ts.map +1 -0
- package/dist/server/api/src/squawk/coordinator.js +24 -0
- package/dist/server/api/src/squawk/coordinator.js.map +1 -0
- package/dist/server/api/src/squawk/cursor.d.ts +2 -0
- package/dist/server/api/src/squawk/cursor.d.ts.map +1 -0
- package/dist/server/api/src/squawk/cursor.js +55 -0
- package/dist/server/api/src/squawk/cursor.js.map +1 -0
- package/dist/server/api/src/squawk/dependency-resolver.d.ts +107 -0
- package/dist/server/api/src/squawk/dependency-resolver.d.ts.map +1 -0
- package/dist/server/api/src/squawk/dependency-resolver.js +324 -0
- package/dist/server/api/src/squawk/dependency-resolver.js.map +1 -0
- package/dist/server/api/src/squawk/dispatch-orchestrator.d.ts +117 -0
- package/dist/server/api/src/squawk/dispatch-orchestrator.d.ts.map +1 -0
- package/dist/server/api/src/squawk/dispatch-orchestrator.js +296 -0
- package/dist/server/api/src/squawk/dispatch-orchestrator.js.map +1 -0
- package/dist/server/api/src/squawk/lock-coordinator.d.ts +118 -0
- package/dist/server/api/src/squawk/lock-coordinator.d.ts.map +1 -0
- package/dist/server/api/src/squawk/lock-coordinator.js +279 -0
- package/dist/server/api/src/squawk/lock-coordinator.js.map +1 -0
- package/dist/server/api/src/squawk/lock.d.ts +2 -0
- package/dist/server/api/src/squawk/lock.d.ts.map +1 -0
- package/dist/server/api/src/squawk/lock.js +87 -0
- package/dist/server/api/src/squawk/lock.js.map +1 -0
- package/dist/server/api/src/squawk/mailbox.d.ts +2 -0
- package/dist/server/api/src/squawk/mailbox.d.ts.map +1 -0
- package/dist/server/api/src/squawk/mailbox.js +66 -0
- package/dist/server/api/src/squawk/mailbox.js.map +1 -0
- package/dist/server/api/src/squawk/spawning.d.ts +79 -0
- package/dist/server/api/src/squawk/spawning.d.ts.map +1 -0
- package/dist/server/api/src/squawk/spawning.js +226 -0
- package/dist/server/api/src/squawk/spawning.js.map +1 -0
- package/dist/server/api/src/squawk/specialist-tools.d.ts +206 -0
- package/dist/server/api/src/squawk/specialist-tools.d.ts.map +1 -0
- package/dist/server/api/src/squawk/specialist-tools.js +411 -0
- package/dist/server/api/src/squawk/specialist-tools.js.map +1 -0
- package/dist/server/api/src/types/api.d.ts +63 -0
- package/dist/server/api/src/types/api.d.ts.map +1 -0
- package/dist/server/api/src/types/api.js +5 -0
- package/dist/server/api/src/types/api.js.map +1 -0
- package/dist/squawk/src/db/index.d.ts +30 -0
- package/dist/squawk/src/db/index.d.ts.map +1 -0
- package/dist/squawk/src/db/index.js +329 -0
- package/dist/squawk/src/db/index.js.map +1 -0
- package/dist/squawk/src/db/sqlite.d.ts +31 -0
- package/dist/squawk/src/db/sqlite.d.ts.map +1 -0
- package/dist/squawk/src/db/sqlite.js +558 -0
- package/dist/squawk/src/db/sqlite.js.map +1 -0
- package/dist/squawk/src/db/types.d.ts +611 -0
- package/dist/squawk/src/db/types.d.ts.map +1 -0
- package/dist/squawk/src/db/types.js +4 -0
- package/dist/squawk/src/db/types.js.map +1 -0
- package/dist/task-queue.js +377 -0
- package/dist/validation.js +188 -0
- package/e2e-integration.test.ts +290 -0
- package/integration.test.ts +186 -0
- package/package.json +22 -0
- package/phase1-integration.test.ts +455 -0
- package/phase2-verification.test.ts +135 -0
- package/server.log +58 -0
- package/src/agent-runner.js +877 -0
- package/src/coordination/agent-lifecycle.ts +13 -0
- package/src/coordination/agent-runner.ts +479 -0
- package/src/coordination/agent-spawner-routes.ts +340 -0
- package/src/coordination/agent-spawner.ts +885 -0
- package/src/coordination/agents.ts +525 -0
- package/src/coordination/checkpoint-routes.ts +382 -0
- package/src/coordination/conflict-resolver.ts +640 -0
- package/src/coordination/missions.ts +219 -0
- package/src/coordination/monitor.ts +593 -0
- package/src/coordination/notifier.ts +547 -0
- package/src/coordination/progress-tracker.ts +410 -0
- package/src/coordination/recovery-manager.ts +531 -0
- package/src/coordination/task-decomposer.ts +491 -0
- package/src/coordination/task-queue-routes.ts +284 -0
- package/src/coordination/task-queue.ts +480 -0
- package/src/coordination/tasks.ts +72 -0
- package/src/flightline/ctk.ts +131 -0
- package/src/flightline/tech-orders.ts +85 -0
- package/src/flightline/work-orders.ts +202 -0
- package/src/index.ts +211 -0
- package/src/middleware/agent-validation.ts +130 -0
- package/src/middleware/error-handler.ts +59 -0
- package/src/middleware/logger.ts +37 -0
- package/src/middleware/validation.ts +235 -0
- package/src/squawk/coordinator.ts +26 -0
- package/src/squawk/cursor.ts +62 -0
- package/src/squawk/lock.ts +98 -0
- package/src/squawk/mailbox.ts +75 -0
- package/src/types/api.ts +71 -0
- package/test-api.ts +310 -0
- package/test-enhanced-agents.ts +428 -0
- package/tsconfig.json +30 -0
package/test-api.ts
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// FleetTools Consolidated API Test Script
|
|
4
|
+
// Tests all endpoints for the consolidated server
|
|
5
|
+
|
|
6
|
+
const BASE_URL = process.env.API_URL || 'http://localhost:3001';
|
|
7
|
+
|
|
8
|
+
// Colors for console output
|
|
9
|
+
const GREEN = '\x1b[32m';
|
|
10
|
+
const RED = '\x1b[31m';
|
|
11
|
+
const YELLOW = '\x1b[33m';
|
|
12
|
+
const RESET = '\x1b[0m';
|
|
13
|
+
|
|
14
|
+
let passed = 0;
|
|
15
|
+
let failed = 0;
|
|
16
|
+
let skipped = 0;
|
|
17
|
+
|
|
18
|
+
// Helper to make requests
|
|
19
|
+
async function request(method: string, path: string, body?: any, expectedStatus = 200) {
|
|
20
|
+
const url = `${BASE_URL}${path}`;
|
|
21
|
+
const options: RequestInit = {
|
|
22
|
+
method,
|
|
23
|
+
headers: {
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
if (body) {
|
|
29
|
+
options.body = JSON.stringify(body);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(url, options);
|
|
34
|
+
const data = await response.json().catch(() => ({}));
|
|
35
|
+
return {
|
|
36
|
+
status: response.status,
|
|
37
|
+
data,
|
|
38
|
+
ok: response.ok,
|
|
39
|
+
};
|
|
40
|
+
} catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
status: 0,
|
|
43
|
+
data: { error: String(error) },
|
|
44
|
+
ok: false,
|
|
45
|
+
error,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Test helper
|
|
51
|
+
async function test(name: string, fn: () => Promise<boolean>) {
|
|
52
|
+
const start = Date.now();
|
|
53
|
+
try {
|
|
54
|
+
const result = await fn();
|
|
55
|
+
const duration = Date.now() - start;
|
|
56
|
+
if (result) {
|
|
57
|
+
console.log(`${GREEN}✓${RESET} ${name} (${duration}ms)`);
|
|
58
|
+
passed++;
|
|
59
|
+
} else {
|
|
60
|
+
console.log(`${RED}✗${RESET} ${name} (${duration}ms)`);
|
|
61
|
+
failed++;
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
console.log(`${RED}✗${RESET} ${name} - ${String(error)}`);
|
|
65
|
+
failed++;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Skip helper
|
|
70
|
+
function skip(name: string, reason: string) {
|
|
71
|
+
console.log(`${YELLOW}⊘${RESET} ${name} - ${reason}`);
|
|
72
|
+
skipped++;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Main test suite
|
|
76
|
+
async function runTests() {
|
|
77
|
+
console.log('\n=== FleetTools Consolidated API Tests ===\n');
|
|
78
|
+
|
|
79
|
+
// Health check
|
|
80
|
+
console.log('--- Health Check ---');
|
|
81
|
+
await test('GET /health returns healthy status', async () => {
|
|
82
|
+
const res = await request('GET', '/health');
|
|
83
|
+
return res.status === 200 && res.data.status === 'healthy';
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// Work Orders
|
|
87
|
+
console.log('\n--- Work Orders ---');
|
|
88
|
+
|
|
89
|
+
let workOrderId: string | null = null;
|
|
90
|
+
|
|
91
|
+
await test('POST /api/v1/work-orders creates a work order', async () => {
|
|
92
|
+
const res = await request('POST', '/api/v1/work-orders', {
|
|
93
|
+
title: 'Test Work Order',
|
|
94
|
+
description: 'A test work order created by the test script',
|
|
95
|
+
priority: 'high',
|
|
96
|
+
assigned_to: ['specialist-1', 'specialist-2'],
|
|
97
|
+
});
|
|
98
|
+
if (res.status === 201 && res.data.work_order) {
|
|
99
|
+
workOrderId = res.data.work_order.id;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
await test('GET /api/v1/work-orders lists work orders', async () => {
|
|
106
|
+
const res = await request('GET', '/api/v1/work-orders');
|
|
107
|
+
return res.status === 200 && Array.isArray(res.data.work_orders);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
if (workOrderId) {
|
|
111
|
+
await test('GET /api/v1/work-orders/:id returns work order', async () => {
|
|
112
|
+
const res = await request('GET', `/api/v1/work-orders/${workOrderId}`);
|
|
113
|
+
return res.status === 200 && res.data.work_order?.id === workOrderId;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
await test('PATCH /api/v1/work-orders/:id updates work order', async () => {
|
|
117
|
+
const res = await request('PATCH', `/api/v1/work-orders/${workOrderId}`, {
|
|
118
|
+
status: 'in_progress',
|
|
119
|
+
priority: 'critical',
|
|
120
|
+
});
|
|
121
|
+
return res.status === 200 && res.data.work_order?.status === 'in_progress';
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
skip('GET /api/v1/work-orders/:id returns work order', 'No work order created');
|
|
125
|
+
skip('PATCH /api/v1/work-orders/:id updates work order', 'No work order created');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// CTK Reservations
|
|
129
|
+
console.log('\n--- CTK Reservations ---');
|
|
130
|
+
|
|
131
|
+
let reservationId: string | null = null;
|
|
132
|
+
|
|
133
|
+
await test('POST /api/v1/ctk/reserve creates a reservation', async () => {
|
|
134
|
+
const res = await request('POST', '/api/v1/ctk/reserve', {
|
|
135
|
+
file: '/test/example.txt',
|
|
136
|
+
specialist_id: 'specialist-1',
|
|
137
|
+
purpose: 'edit',
|
|
138
|
+
});
|
|
139
|
+
if (res.status === 201 && res.data.reservation) {
|
|
140
|
+
reservationId = res.data.reservation.id;
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
await test('GET /api/v1/ctk/reservations lists reservations', async () => {
|
|
147
|
+
const res = await request('GET', '/api/v1/ctk/reservations');
|
|
148
|
+
return res.status === 200 && Array.isArray(res.data.reservations);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
if (reservationId) {
|
|
152
|
+
await test('POST /api/v1/ctk/release releases reservation', async () => {
|
|
153
|
+
const res = await request('POST', '/api/v1/ctk/release', {
|
|
154
|
+
reservation_id: reservationId,
|
|
155
|
+
});
|
|
156
|
+
return res.status === 200 && res.data.reservation?.released_at !== null;
|
|
157
|
+
});
|
|
158
|
+
} else {
|
|
159
|
+
skip('POST /api/v1/ctk/release releases reservation', 'No reservation created');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Tech Orders
|
|
163
|
+
console.log('\n--- Tech Orders ---');
|
|
164
|
+
|
|
165
|
+
let techOrderId: string | null = null;
|
|
166
|
+
|
|
167
|
+
await test('POST /api/v1/tech-orders creates a tech order', async () => {
|
|
168
|
+
const res = await request('POST', '/api/v1/tech-orders', {
|
|
169
|
+
name: 'React Component Pattern',
|
|
170
|
+
pattern: 'createComponent(name, props)',
|
|
171
|
+
context: 'Component creation in React applications',
|
|
172
|
+
});
|
|
173
|
+
if (res.status === 201 && res.data.tech_order) {
|
|
174
|
+
techOrderId = res.data.tech_order.id;
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
await test('GET /api/v1/tech-orders lists tech orders', async () => {
|
|
181
|
+
const res = await request('GET', '/api/v1/tech-orders');
|
|
182
|
+
return res.status === 200 && Array.isArray(res.data.tech_orders);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// Mailbox
|
|
186
|
+
console.log('\n--- Mailbox ---');
|
|
187
|
+
|
|
188
|
+
await test('POST /api/v1/mailbox/append appends events', async () => {
|
|
189
|
+
const res = await request('POST', '/api/v1/mailbox/append', {
|
|
190
|
+
stream_id: 'test-stream-1',
|
|
191
|
+
events: [
|
|
192
|
+
{ type: 'TaskStarted', data: { task_id: 'task-1' } },
|
|
193
|
+
{ type: 'TaskCompleted', data: { task_id: 'task-1', result: 'success' } },
|
|
194
|
+
],
|
|
195
|
+
});
|
|
196
|
+
return res.status === 200 && res.data.inserted === 2;
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
await test('GET /api/v1/mailbox/:streamId returns mailbox', async () => {
|
|
200
|
+
const res = await request('GET', '/api/v1/mailbox/test-stream-1');
|
|
201
|
+
return res.status === 200 && res.data.mailbox?.id === 'test-stream-1';
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Cursor
|
|
205
|
+
console.log('\n--- Cursor ---');
|
|
206
|
+
|
|
207
|
+
await test('POST /api/v1/cursor/advance advances cursor', async () => {
|
|
208
|
+
const res = await request('POST', '/api/v1/cursor/advance', {
|
|
209
|
+
stream_id: 'test-stream-1',
|
|
210
|
+
position: 5,
|
|
211
|
+
});
|
|
212
|
+
return res.status === 200 && res.data.cursor?.position === 5;
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
await test('GET /api/v1/cursor/:cursorId returns cursor', async () => {
|
|
216
|
+
const res = await request('GET', '/api/v1/cursor/test-stream-1_cursor');
|
|
217
|
+
return res.status === 200 && res.data.cursor?.stream_id === 'test-stream-1';
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// Locks
|
|
221
|
+
console.log('\n--- Locks ---');
|
|
222
|
+
|
|
223
|
+
let lockId: string | null = null;
|
|
224
|
+
|
|
225
|
+
await test('POST /api/v1/lock/acquire acquires lock', async () => {
|
|
226
|
+
const res = await request('POST', '/api/v1/lock/acquire', {
|
|
227
|
+
file: '/test/locked-file.txt',
|
|
228
|
+
specialist_id: 'specialist-lock-1',
|
|
229
|
+
timeout_ms: 60000,
|
|
230
|
+
});
|
|
231
|
+
if (res.status === 200 && res.data.lock) {
|
|
232
|
+
lockId = res.data.lock.id;
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
return false;
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
await test('GET /api/v1/locks lists locks', async () => {
|
|
239
|
+
const res = await request('GET', '/api/v1/locks');
|
|
240
|
+
return res.status === 200 && Array.isArray(res.data.locks);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
if (lockId) {
|
|
244
|
+
await test('POST /api/v1/lock/release releases lock', async () => {
|
|
245
|
+
const res = await request('POST', '/api/v1/lock/release', {
|
|
246
|
+
lock_id: lockId,
|
|
247
|
+
specialist_id: 'specialist-lock-1',
|
|
248
|
+
});
|
|
249
|
+
return res.status === 200 && res.data.lock?.released_at !== null;
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
skip('POST /api/v1/lock/release releases lock', 'No lock acquired');
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Coordinator
|
|
256
|
+
console.log('\n--- Coordinator ---');
|
|
257
|
+
|
|
258
|
+
await test('GET /api/v1/coordinator/status returns status', async () => {
|
|
259
|
+
const res = await request('GET', '/api/v1/coordinator/status');
|
|
260
|
+
return res.status === 200 &&
|
|
261
|
+
typeof res.data.active_mailboxes === 'number' &&
|
|
262
|
+
typeof res.data.active_locks === 'number';
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Cleanup - Delete work order
|
|
266
|
+
if (workOrderId) {
|
|
267
|
+
await test('DELETE /api/v1/work-orders/:id deletes work order', async () => {
|
|
268
|
+
const res = await request('DELETE', `/api/v1/work-orders/${workOrderId}`);
|
|
269
|
+
return res.status === 204;
|
|
270
|
+
});
|
|
271
|
+
} else {
|
|
272
|
+
skip('DELETE /api/v1/work-orders/:id deletes work order', 'No work order created');
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Summary
|
|
276
|
+
console.log('\n=== Test Summary ===');
|
|
277
|
+
console.log(`${GREEN}Passed: ${passed}${RESET}`);
|
|
278
|
+
console.log(`${RED}Failed: ${failed}${RESET}`);
|
|
279
|
+
console.log(`${YELLOW}Skipped: ${skipped}${RESET}`);
|
|
280
|
+
console.log(`Total: ${passed + failed + skipped}`);
|
|
281
|
+
|
|
282
|
+
process.exit(failed > 0 ? 1 : 0);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Check if server is running first
|
|
286
|
+
async function checkServer() {
|
|
287
|
+
console.log(`Checking if server is running at ${BASE_URL}...`);
|
|
288
|
+
try {
|
|
289
|
+
const res = await fetch(`${BASE_URL}/health`);
|
|
290
|
+
if (res.ok) {
|
|
291
|
+
const data = await res.json();
|
|
292
|
+
console.log(`${GREEN}Server is running: ${data.status}${RESET}\n`);
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
} catch (error) {
|
|
296
|
+
console.log(`${RED}Server is not responding${RESET}`);
|
|
297
|
+
console.log(`Make sure to start the server first:`);
|
|
298
|
+
console.log(` cd server/api && bun run src/index.ts\n`);
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Run
|
|
304
|
+
checkServer().then(running => {
|
|
305
|
+
if (running) {
|
|
306
|
+
runTests();
|
|
307
|
+
} else {
|
|
308
|
+
process.exit(1);
|
|
309
|
+
}
|
|
310
|
+
});
|