Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "lunora",
"interface": {
"displayName": "Lunora"
},
"plugins": [
{
"name": "lunora",
"source": {
"source": "local",
"path": "./plugins/lunora"
},
"category": "Engineering"
}
]
}
17 changes: 17 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "lunora",
"description": "Plugins for building on Lunora — a type-safe, real-time backend on Cloudflare Workers + Durable Objects.",
"owner": {
"name": "Anolilab",
"email": "d.bannert@anolilab.de",
"url": "https://github.com/anolilab"
},
"plugins": [
{
"name": "lunora",
"source": "./plugins/lunora",
"category": "Engineering",
"tags": ["backend", "cloudflare", "realtime", "typescript"]
}
]
}
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pnpm workspaces are `apps/*`, `packages/*`, `examples/*`, `tests/*`. The rest of
| `api-snapshots/` | Committed public-API snapshots, one `<pkg>.api.md` per package — gated by `pnpm run api:check`. |
| `shared/` | Bundler-inlined helpers, **not** a package. See [Top-level `shared/`](#top-level-shared--bundler-inlined-source-not-a-package). |
| `protocol/` | Wire-protocol spec + shared fixtures. |
| `plugins/*` | The Claude Code / Codex agent plugin (`plugins/lunora`) — the `packages/cli/skills` payload + the end-of-turn `lunora verify` hook. |
| `plans/` | Implementation plans handed to agents; `plans/README.md` is the index. |
| `sdks/` | Non-JS client SDKs (`python`, `go`, `ruby`, `rust`, `swift`, `java`, `kotlin`) + `lunora sdk generate` targets. See `sdks/README.md`. |
| `patches/` | pnpm patches applied to third-party deps. |
Expand Down
65 changes: 64 additions & 1 deletion api-snapshots/agent.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

### `AgentEmailRun` (interface)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._
```ts
interface AgentEmailRun {
input: string;
owner?: string;
replyRef?: AgentReplyRef;
threadKey: string;
title?: string;
}
```

### `AgentFunctionPaths` (interface)

Expand Down Expand Up @@ -119,6 +127,10 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `AgentOnReply` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `AgentOnStepFinish` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._
Expand All @@ -139,6 +151,14 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `AgentReplyInfo` (interface)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `AgentReplyRef` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `AgentRunFunction` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._
Expand Down Expand Up @@ -247,6 +267,10 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `EnsureThreadOutcome` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `FsToolInput` (type)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._
Expand Down Expand Up @@ -585,6 +609,45 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

## `@lunora/agent/reply`

### `EmailReplyRef` (type)

```ts
type EmailReplyRef = Extract<AgentReplyRef, {
channel: "email";
}>;
```

### `ReplyBody` (interface)

```ts
interface ReplyBody {
subject: string;
text: string;
}
```

### `buildReferences` (const)

```ts
const buildReferences: (replyRef: EmailReplyRef) => string;
```

### `captureEmailReplyRef` (const)

```ts
const captureEmailReplyRef: (email: InboundEmail) => EmailReplyRef | undefined;
```

### `replyToEmail` (const)

```ts
const replyToEmail: (mailer: Mailer, replyRef: EmailReplyRef, body: ReplyBody) => Promise<{
id: string;
}>;
```

## `@lunora/agent/sandbox`

### `BrowserToolInput` (type)
Expand Down
39 changes: 39 additions & 0 deletions api-snapshots/ai.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,35 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `RagSyncActionReference` (interface)

```ts
interface RagSyncActionReference {
readonly __lunoraRef: string;
}
```

### `RagSyncArgs` (interface)

```ts
interface RagSyncArgs extends Record<string, unknown> {
deleted?: boolean;
id: string;
text?: string;
}
```

### `RagSyncOptions` (interface)

```ts
interface RagSyncOptions<Document extends Record<string, unknown> = Record<string, unknown>> {
action: RagSyncActionReference;
delayMs?: number;
id?: (document: Document) => string;
text: (document: Document) => string | undefined;
}
```

### `RagTextStore` (interface)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._
Expand Down Expand Up @@ -244,3 +273,13 @@ _Tagged `@experimental` — signature not tracked; churn here does not fail the
### `hybridRank` (const)

_Tagged `@experimental` — signature not tracked; churn here does not fail the gate._

### `ragSyncTriggers` (const)

```ts
const ragSyncTriggers: <Document extends Record<string, unknown> = Record<string, unknown>>(options: RagSyncOptions<Document>) => {
afterDelete: RagSyncHandler;
afterInsert: RagSyncHandler;
afterUpdate: RagSyncHandler;
};
```
1 change: 1 addition & 0 deletions api-snapshots/client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ class LunoraClient {
shardKey?: string;
}): Unsubscribe;
stream<F extends FunctionReference<"stream">>(function_: F, args: ArgsOf<F>, options?: {
durable?: boolean;
maxBuffer?: number;
shardKey?: string;
}): StreamIterable<ReturnOf<F>>;
Expand Down
3 changes: 3 additions & 0 deletions api-snapshots/do.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ abstract class ShardDO {
protected recordExternalSourceError(table: string, error: unknown, trace?: TraceRefLike): void;
protected recordExternalSourceWarning(table: string, message: string, trace?: TraceRefLike): void;
protected executeStream(_functionPath: string, _args: Record<string, unknown>): null | {
durable?: {
ttlMs?: number;
};
iterator: (signal: AbortSignal) => AsyncIterable<unknown>;
};
protected runCachedQuery<R>(functionPath: string, args: Record<string, unknown>, run: () => Promise<R>): Promise<R>;
Expand Down
8 changes: 8 additions & 0 deletions api-snapshots/errors.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,14 @@ const ERROR_CATALOG: {
readonly status: 500;
readonly title: "SQL storage unavailable";
};
readonly STREAM_INTERRUPTED: {
readonly status: 503;
readonly title: "Durable stream interrupted";
};
readonly STREAM_TOO_LONG: {
readonly status: 507;
readonly title: "Durable stream exceeded its chunk ceiling";
};
readonly TOKEN_EXPIRED: {
readonly status: 401;
readonly title: "Authentication token expired";
Expand Down
20 changes: 20 additions & 0 deletions api-snapshots/lunora.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ Re-exported from `@lunora/server` — signature tracked at its source.

Re-exported from `@lunora/server` — signature tracked at its source.

### `DurableStreamOptions` (interface)

Re-exported from `@lunora/server` — signature tracked at its source.

### `EmptyArgs` (type)

Re-exported from `@lunora/server` — signature tracked at its source.
Expand Down Expand Up @@ -3491,6 +3495,10 @@ Re-exported from `@lunora/ratelimit` — signature tracked at its source.

Re-exported from `@lunora/ratelimit` — signature tracked at its source.

### `TokenBudget` (interface)

Re-exported from `@lunora/ratelimit` — signature tracked at its source.

### `VERSION` (const)

Re-exported from `@lunora/ratelimit` — signature tracked at its source.
Expand Down Expand Up @@ -3531,6 +3539,10 @@ Re-exported from `@lunora/ratelimit` — signature tracked at its source.

Re-exported from `@lunora/ratelimit` — signature tracked at its source.

### `tokenBudget` (const)

Re-exported from `@lunora/ratelimit` — signature tracked at its source.

## `lunorash/runtime`

### `AdminTableResolver` (type)
Expand Down Expand Up @@ -4619,6 +4631,10 @@ Re-exported from `@lunora/server` — signature tracked at its source.

Re-exported from `@lunora/server` — signature tracked at its source.

### `DurableStreamOptions` (interface)

Re-exported from `@lunora/server` — signature tracked at its source.

### `EmptyArgs` (type)

Re-exported from `@lunora/server` — signature tracked at its source.
Expand Down Expand Up @@ -6669,6 +6685,10 @@ Re-exported from `@lunora/server` — signature tracked at its source.

Re-exported from `@lunora/server` — signature tracked at its source.

### `DurableStreamOptions` (interface)

Re-exported from `@lunora/server` — signature tracked at its source.

### `ExposeConfig` (interface)

Re-exported from `@lunora/server` — signature tracked at its source.
Expand Down
1 change: 1 addition & 0 deletions api-snapshots/platform.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ interface PlatformCapabilities {
browser?: Capability;
containers?: Capability;
crossShardFanout?: Capability;
durableStreams?: Capability;
globalTables?: Capability;
hyperdrive?: Capability;
keyValueStore?: Capability;
Expand Down
15 changes: 15 additions & 0 deletions api-snapshots/ratelimit.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ interface SqlStoreOptions {
}
```

### `TokenBudget` (interface)

```ts
interface TokenBudget {
check: (key: string) => Promise<RateLimitStatus>;
record: (key: string, tokens: number) => Promise<RateLimitStatus>;
}
```

### `VERSION` (const)

```ts
Expand Down Expand Up @@ -312,3 +321,9 @@ const rateLimit: <Context>(limiter: LimiterResolver<Context>, name: string, opti
```ts
const ratelimitPlugin: <Context = unknown>(limiter: LimiterResolver<Context>) => Plugin<Record<never, never>, Context, Context & RatelimitApiContext<Context>>;
```

### `tokenBudget` (const)

```ts
const tokenBudget: <Names extends string>(limiter: RateLimiter<Names>, name: Names) => TokenBudget;
```
1 change: 1 addition & 0 deletions api-snapshots/react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ interface UseRateLimitResult {

```ts
interface UseStreamOptions {
durable?: boolean;
maxBuffer?: number;
shardKey?: string;
}
Expand Down
22 changes: 20 additions & 2 deletions api-snapshots/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,14 @@ interface DefineStorageRuleInput<Context = unknown> {
type DurableObjectJurisdiction = "eu" | "fedramp" | "us";
```

### `DurableStreamOptions` (interface)

```ts
interface DurableStreamOptions {
readonly ttlMs?: number;
}
```

### `EmptyArgs` (type)

```ts
Expand Down Expand Up @@ -814,7 +822,7 @@ interface InternalQueryBuilder<Context, Args extends ArgsValidator, Output = und
args: InferArgs<Args>;
ctx: Context;
signal: AbortSignal;
}) => AsyncGenerator<R, void, void> | AsyncIterable<R>) => RegisteredStream<Args, R>;
}) => AsyncGenerator<R, void, void> | AsyncIterable<R>, options?: StreamOptions) => RegisteredStream<Args, R>;
use: <ContextOut>(middleware: Middleware<Context, ContextOut>) => InternalQueryBuilder<ContextOut, Args, Output>;
}
```
Expand Down Expand Up @@ -1421,7 +1429,7 @@ interface QueryBuilder<Context, Args extends ArgsValidator, Output = undefined>
args: InferArgs<Args>;
ctx: Context;
signal: AbortSignal;
}) => AsyncGenerator<R, void, void> | AsyncIterable<R>) => RegisteredStream<Args, R>;
}) => AsyncGenerator<R, void, void> | AsyncIterable<R>, options?: StreamOptions) => RegisteredStream<Args, R>;
use: <ContextOut>(middleware: Middleware<Context, ContextOut>) => QueryBuilder<ContextOut, Args, Output>;
x402: (config: X402ProcedureConfig) => QueryBuilder<Context, Args, Output>;
}
Expand Down Expand Up @@ -1573,6 +1581,7 @@ interface RegisteredShape<Args extends ValidatorMap = ValidatorMap, Context = Qu
```ts
interface RegisteredStream<A extends ArgsValidator, R> {
readonly args: A;
readonly durable?: DurableStreamOptions;
readonly handler: (context: unknown, args: InferArgs<A>, signal: AbortSignal) => AsyncIterable<R>;
readonly kind: "stream";
readonly visibility?: FunctionVisibility;
Expand Down Expand Up @@ -4309,6 +4318,14 @@ interface DatabaseWriter extends DatabaseReader {
type DurableObjectJurisdiction = "eu" | "fedramp" | "us";
```

### `DurableStreamOptions` (interface)

```ts
interface DurableStreamOptions {
readonly ttlMs?: number;
}
```

### `ExposeConfig` (interface)

```ts
Expand Down Expand Up @@ -4666,6 +4683,7 @@ type RegisteredQuery<A extends ArgsValidator, R> = RegisteredFunction<A, R, "que
```ts
interface RegisteredStream<A extends ArgsValidator, R> {
readonly args: A;
readonly durable?: DurableStreamOptions;
readonly handler: (context: unknown, args: InferArgs<A>, signal: AbortSignal) => AsyncIterable<R>;
readonly kind: "stream";
readonly visibility?: FunctionVisibility;
Expand Down
Loading
Loading