feat: Functions — JS/TS execution with run log

core.functions + core.function_runs: project-scoped code executed by a
runtime binary on the backend host (bun or deno per function). Payload
arrives on stdin + PRIMORA_PAYLOAD env; stdout/stderr captured per run
(capped), with status/exit code/duration. Invoke returns 502 + the
recorded run on failure so errors stay observable.

Dashboard gains a Functions page: code editor, JSON payload invoke,
live result, run history. Runner config via FUNCTIONS_RUNTIME /
FUNCTIONS_TIMEOUT_SECONDS / FUNCTIONS_MAX_OUTPUT_BYTES.

Verified live: bun ran code, stdin payload delivered, error path returns
502 with captured stderr; timeout kills at deadline.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-24 19:46:32 +02:00
1 parent 3aca5bd1e0
commit 32587c8063
37 files changed
+2157 -6

No files matched your search

+5 -3
View File
@@ -357,9 +357,11 @@ Reusable templates + an operational send log.
Ordered loosely by leverage. None committed; each gets scoped when picked.
- **Phase 9 — Functions** — user code on schedule/event/HTTP triggers.
Deno or Bun isolates in a sidecar; secrets via env, payload via stdin.
The job runner already supplies the scheduling half.
- **Phase 9 — Functions** — ✅ first slice shipped: `core.functions` +
`core.function_runs`, bun/deno exec runner (stdin payload, env injection,
capped output, timeout), invoke API + dashboard page. Remaining
candidates: schedule/event/HTTP triggers riding jobs + inbound hooks,
and isolated runtimes (sidecar/Firecracker) for untrusted code.
- **Phase 10 — Storage backends** — ✅ S3-compatible object storage shipped:
`BACKEND_STORAGE_DRIVER=s3` + `S3_*` env vars, stdlib SigV4, verified
against a real S3 server. Presigned-URL uploads for large files remain a