TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/irchaosclub/FANGS/llms.txt
Use this file to discover all available pages before exploring further.
/v1/scans endpoint is the HTTP entry point for queuing a one-off sandbox scan. It is used by fangs scan submit and fangs package add when a user or the watcher wants to inspect a specific npm package version. The endpoint wraps SubmitScan — the same internal function that the Watcher calls when it detects a new release — so manual and autonomous scans follow identical logic. The orchestrator validates that the named runner exists, applies defaults, stamps watched paths from the orchestrator config, creates a runs database row, and enqueues the job in the runner’s dispatch queue.
POST /v1/scans
Queues a sandbox scan job for a specificpackage@version on a named runner.
Server-side processing
When this endpoint is called, the orchestrator performs the following steps in order:
- Validates that
target_runneris registered in the in-memory runner registry. - Defaults
job.kindto"sensor_only"if the field is empty. - Defaults
job.durationto10s(10,000,000,000 ns) if the value is zero. - Stamps
defaultWatchedPathsontojob.watched_pathswhen the field is empty — loaded from the orchestrator’s config at startup so all scans share one authoritative path set. - Generates a new
run_idif the field is zero-value. - Stamps
dispatched_atwith the current time. - Creates a
runsrow withstate = "pending". - Enqueues the job for the target runner via the internal
Dispatcher.
The
runner_id of the registered runner that should execute this scan. The orchestrator returns 404 if this runner is not currently registered.The job definition. All sub-fields correspond directly to the
proto.Job wire type.Always
true on a 202 response.Hex-encoded 16-byte run identifier. Use this to query events, deviations, and run state. Supports git-style prefix lookups in the
fangs CLI.| Status | Condition |
|---|---|
| 400 | target_runner field is missing or empty |
| 404 | target_runner is not registered with the orchestrator |
GET /v1/health
Returns a liveness signal confirming the orchestrator process is up and accepting connections. Used by container health checks, load balancers, and thefangs status command.
Response — 200 OK
Always
"ok" when the process is alive.Stable identifier configured at startup. Defaults to
"fangs-orchestrator".Build version string.
"dev" in development builds; a semver tag in release builds.Default sandbox command
When FANGS queues an npm package scan autonomously (via the Watcher orfangs package add), it uses the following standard command to run a clean install inside the container:
package.json, installs the target package (which triggers all install-time lifecycle hooks), and then sleeps 2 seconds to let any async post-install work complete before the grace period begins. The sleep 2 combined with grace_period: 2000000000 gives the sensor approximately 4 seconds of observation time after the install finishes.