Skip to main content

Crate falcon_server

Crate falcon_server 

Source
Expand description

Eagle’s local HTTP API, served from a falcon library.

Responses use Eagle’s envelope: {"status":"success","data":...}, string errors as HTTP 500 {"status":"error","data":"..."}, unknown paths as 404 and wrong verbs as 405 (both with Eagle’s “method not allowed” text).

A request is served when its Host is the server’s own address or when it carries the Developer token (Handle::set_token) as token.

Falcon’s own choices:

  • it listens on 127.0.0.1 only;
  • it serves library routes and AI Search only (no script injection or plugins);
  • imports and thumbnail work finish before the reply, so returned ids exist and new thumbnails are in place;
  • routes that read or write files do so without holding the library lock;
  • library history is what the app hands over (Handle::set_history), or else the libraries this server has served, newest first.

Modules§

mcp
A Model Context Protocol server on localhost, so AI assistants on the same Mac can use the library falcon has open.

Structs§

AiStatus
How AI Search stands.
Handle
A server running on its own thread; dropping it stops the server.

Enums§

AiQuery
What to search by.

Constants§

DEFAULT_PORT
EAGLE_PORT
Eagle’s default port; falcon defaults to the next one so both can run.

Traits§

AiSearch
AI Search as the app provides it.

Functions§

serve
Serves the API until the process exits.
start
Starts serving on the first free port of ports, calling on_request after each handled request (for example to repaint a UI).

Type Aliases§

Shared