Learn to build EdenAPI/SLAPI endpoints with streaming and non-streaming patterns.
The material appears to be a prompt/documentation-only guide in an open-source repository, with no declared secrets, remote endpoints, local execution, or data access. Based on the provided facts, overall risk is low, with minor caution only around limited source trust signals and unknown maintenance status.
No keys or environment variables are declared. The document only describes how to define API endpoint types and handlers, with no visible credential collection, storage, forwarding, or misuse path.
Both the system checks and the material indicate it is prompt-only, with no remote host declared. While the guide discusses EdenAPI/SLAPI server interaction patterns, the skill itself does not show active outbound connections or user data exfiltration.
There are no instructions for installation, script execution, launching local processes, or invoking system capabilities. The provided material is a development guide and shows no visible code-execution surface.
No permissions are declared for reading, writing, or enumerating local files, databases, clipboard, or other resources. The document only references code paths as examples, which does not constitute actual data access capability.
Positive signals include being open source and hosted on GitHub, which improves auditability. However, the license is undeclared, community adoption is shown as 0 stars, and maintenance status is unknown, so trust signals are limited and the repository should be manually reviewed before use.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "CREATING_ENDPOINTS" skill from askskill: 1. Download https://raw.githubusercontent.com/facebook/sapling/main/eden/.llms/skills/CREATING_ENDPOINTS/SKILL.md 2. Save it as ~/.claude/skills/CREATING_ENDPOINTS/SKILL.md 3. Reload skills and tell me it's ready
Based on EdenAPI/SLAPI conventions, give me a minimal example of a non-streaming endpoint including request handling, parameter validation, and a JSON response.
A reference non-streaming endpoint code sample with the key structure and implementation steps explained.
Show how to implement a streaming endpoint in EdenAPI/SLAPI that returns content incrementally, and explain how its control flow differs from a regular endpoint.
A streaming endpoint implementation example, including chunked output behavior and a comparison with the non-streaming pattern.
Create a development checklist for a new EdenAPI/SLAPI endpoint covering route definition, input/output format, error handling, logging, and testing considerations.
A clear endpoint development checklist for reviewing implementation completeness and quality.
This guide explains how to create new EdenAPI/SLAPI endpoints, covering both streaming and non-streaming patterns.
EdenAPI is a REST-like API that connects Sapling clients to the Mononoke server. Creating a new endpoint involves three main steps:
edenapi_typesslapi_service| Component | Location |
|---|---|
| Types | fbcode/eden/scm/lib/edenapi/types/src/ |
| Server Handler Trait | fbcode/eden/mononoke/servers/slapi/slapi_service/src/handlers/handler.rs |
| Server Handlers | fbcode/eden/mononoke/servers/slapi/slapi_service/src/handlers/*.rs |
| Router Registration | fbcode/eden/mononoke/servers/slapi/slapi_service/src/handlers.rs |
| Client API Trait | fbcode/eden/scm/lib/edenapi/trait/src/api.rs |
| Client Implementation | fbcode/eden/scm/lib/edenapi/src/client.rs |
Location: fbcode/eden/scm/lib/edenapi/types/src/
Types need the #[auto_wire] macro to generate wire format serialization and the ToWire trait implementation. All parameters should be sent in the request body, not in the URL path.
#[auto_wire]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
#[derive(Serialize, Deserialize)]
#[cfg_attr(any(test, feature = "for-tests"), derive(Arbitrary))]
pub struct MyRequest {
#[id(1)]
pub field_one: String,
#[id(2)]
pub field_two: Option<u64>,
}
Key points:
#[auto_wire] generates wire format code#[id(N)] assigns a stable field ID for serialization (use sequential numbers)Serialize, Deserialize for serde supportArbitrary derive enables property-based testingSee EphemeralPrepareRequest/EphemeralPrepareResponse in types/src/commit.rs:555-570:
#[auto_wire]
#[derive(Clone, Default, Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct EphemeralPrepareRequest {
#[id(1)]
pub custom_duration_secs: Option<u64>,
#[id(2)]
pub labels: Option<Vec<String>>,
}
// Response doesn't need #[auto_wire] if not batched
#[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
pub struct EphemeralPrepareResponse {
pub bubble_id: NonZeroU64,
pub expiration_timestamp: Option<i64>,
}
See CommitMutationsRequest/CommitMutationsResponse in types/src/commit.rs:609-623:
#[auto_wire]
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
pub struct CommitMutationsRequest {
#[id(1)]
pub commits: Vec<HgId>,
}
#[auto_wire]
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct CommitMutationsResponse {
#[id(1)]
pub mutation: HgMutationEntryContent,
}
Location: fbcode/eden/mononoke/servers/slapi/slapi_service/src/handlers/
In handlers.rs, add your method to the enum:
pub enum SaplingRemoteApiMethod {
// ... existing methods
MyNewMethod,
}
And update the Display impl:
impl fmt::Display for SaplingRemoteApiMethod {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match self {
// ... existing matches
Self::MyNewMethod => "my_new_method",
};
write!(f, "{}", name)
}
}
Create a handler struct and implement SaplingRemoteApiHandler:
pub struct MyNewHandler;
#[async_trait]
impl SaplingRemoteApiHandler for MyNewHandler {
type Request = MyRequest;
type Response = MyResponse;
const HTTP_METHOD: hyper::Method = hyper::Method::POST;
…
Diagnose systemd-managed EdenFS failures, restarts, health, and lifecycle timelines.
Locate Eden code components, key types, and architecture before reading files.
Create a Mononoke server-side hook with 3-diff split (tests, wiring, implementation), unit tests, and integration tests
Write and run Markdown-driven end-to-end tests for Relay apps.
Get idiomatic Relay guidance for React code, debugging, and code reviews.
Debug Pysa false negatives by comparing outputs and locating lost taint flows.