@pilvia/mieli-sdk
v0.1.0
Published
Types for Pilvia App — the env.* capability surface your app receives next to your data (Pilvia Mieli).
Maintainers
Readme
@pilvia/mieli-sdk
Types for Pilvia App — run your UI next to your data on a Pilvia Mieli
box. Workers-style contract, no ambient authority: everything your app can do
is a capability on env, governed by the data plane (RLS, the librarian
ingress gate, audit).
import { defineApp } from "@pilvia/mieli-sdk";
export default defineApp({
async fetch(request, env) {
// env.user = the signed-in human (login is the platform's job, not yours)
const hits = await env.memory.search("q3 invoicing", { limit: 5 });
return Response.json({ user: env.user, hits });
},
});Deploy
bun add -d @pilvia/mieli-sdk
mieli login --server https://deploy.app.<your-app-server> --token <deploy token>
mieli deploy # reads mieli.app.json, builds with bun, pushesYour app server's deploy.app.* address and deploy token come from whoever
operates your Pilvia box.
mieli.app.json:
{ "name": "hello", "entry": "src/index.ts" }Auth defaults to required: your app is unreachable without a login unless
you explicitly declare "auth": "public". Public apps have no data access
unless you additionally grant "app_data": true.
The mieli CLI ships with the Pilvia Mieli workspace (cli/, Rust).
