chore: prune unused apps and services for the moeka fork
CI / Lint (push) Canceled after 0s
CI / Build Test (stage-web) (push) Canceled after 0s
CI / Build Test (ui-loading-screens) (push) Canceled after 0s
CI / Build Test (ui-transitions) (push) Canceled after 0s
CI / Unit Test (push) Canceled after 0s
CI / Type Check (push) Canceled after 0s
CI / Check Provenance (push) Canceled after 0s
Sync Labels / sync-labels (push) Successful in 1m43s

- Remove stage-tamagotchi, stage-pocket, server, and engine workspaces with their workflows, addons, and docs
- Switch the toolchain from pnpm to bun, replace lockfiles with bun.lock
- Rewrite remaining product references to Moeka
This commit is contained in:
2026-09-14 16:40:49 +07:00
parent 00c6867b7f
commit dc26878386
1981 changed files with 10974 additions and 260677 deletions
+2 -2
View File
@@ -2,9 +2,9 @@
"name": "@proj-airi/server-runtime",
"type": "module",
"version": "0.12.0-beta.5",
"description": "Server runtime implementation for AIRI running in different environments",
"description": "Server runtime implementation for Moeka running in different environments",
"author": {
"name": "Moeru AI Project AIRI Team",
"name": "Moeka Team",
"email": "airi@moeru.ai",
"url": "https://github.com/moeru-ai"
},
+6 -6
View File
@@ -75,9 +75,9 @@ interface AiriWsPeerState {
}
function airiPeerFromRaw(rawPeer: CrossWsPeer): Peer {
// CrossWS peers expose the connection fields AIRI historically used directly
// CrossWS peers expose the connection fields Moeka historically used directly
// (`id`, `send`, `close`, `remoteAddress`, and `request`). Keep the cast in
// this adapter boundary so protocol code below still depends on the AIRI peer
// this adapter boundary so protocol code below still depends on the Moeka peer
// contract instead of the concrete transport type.
return rawPeer as Peer
}
@@ -196,7 +196,7 @@ export function normalizeLoggerConfig(options?: AppOptions) {
* - Heartbeat monitoring for liveness detection
*
* Use when:
* - Embedding the AIRI websocket runtime inside a server process
* - Embedding the Moeka websocket runtime inside a server process
* - Spinning up a testable application instance before binding a socket listener
*
* Expects:
@@ -229,7 +229,7 @@ export function setupApp(options?: AppOptions): { app: H3, closeAllPeers: () =>
// === Registries & Orchestrators ===
// TODO: Move protocol-neutral peer registry, consumer selection, and heartbeat
// primitives into `@proj-airi/better-ws/server` so server-runtime only owns
// AIRI authentication, registry sync, route policy, and extension events.
// Moeka authentication, registry sync, route policy, and extension events.
const peers = new Map<string, AuthenticatedPeer>()
const peersByModule = new Map<string, Map<number | string | undefined, AuthenticatedPeer>>()
const consumers = createConsumerOrchestrator()
@@ -518,7 +518,7 @@ export function setupApp(options?: AppOptions): { app: H3, closeAllPeers: () =>
}
// === WebSocket Server Handlers ===
// Handles AIRI peer lifecycle: open, message, error, close.
// Handles Moeka peer lifecycle: open, message, error, close.
const wsServer = createWsServer<AiriWsMessage, AiriWsPeerState>({
peers: {
unhealthyTimeout: heartbeatTtlMs,
@@ -1049,7 +1049,7 @@ export function setupApp(options?: AppOptions): { app: H3, closeAllPeers: () =>
}
// REVIEW: better-ws now reports silence duration in milliseconds, while the
// AIRI runtime peer state still exposes the legacy missedHeartbeats field.
// Moeka runtime peer state still exposes the legacy missedHeartbeats field.
// Rename this business-facing field with the server-runtime state cleanup.
peerInfo.missedHeartbeats = silentFor
@@ -24,7 +24,7 @@ interface InvalidEventErrorOptions {
source?: unknown
}
/** Error thrown when parsed websocket text is not an AIRI event envelope. */
/** Error thrown when parsed websocket text is not an Moeka event envelope. */
export class InvalidEventError extends Error {
readonly source?: unknown
@@ -35,7 +35,7 @@ export class InvalidEventError extends Error {
}
}
/** Checks whether an error came from AIRI websocket event envelope validation. */
/** Checks whether an error came from Moeka websocket event envelope validation. */
export function isInvalidEventError(error: unknown): error is InvalidEventError {
return error instanceof InvalidEventError
}
@@ -47,14 +47,14 @@ export function heartbeatFrameFrom(text: string): MessageHeartbeatKind | undefin
}
}
/** Parses one AIRI websocket protocol event from SuperJSON or plain JSON text. */
/** Parses one Moeka websocket protocol event from SuperJSON or plain JSON text. */
export function parseEvent(text: string): WebSocketEvent {
// NOTICE:
// SDK clients send events using superjson.stringify, so websocket runtime code must
// use superjson.parse instead of message.json() or plain JSON.parse first.
// JSON.parse on a superjson-encoded string returns the wrapper object
// `{ json: {...}, meta: {...} }` with no protocol `type`, which breaks routing.
// Keep this until all AIRI websocket clients share one non-wrapper wire format.
// Keep this until all Moeka websocket clients share one non-wrapper wire format.
let parsed: WebSocketEvent | undefined
try {
parsed = parse<WebSocketEvent>(text)
@@ -75,7 +75,7 @@ export function parseEvent(text: string): WebSocketEvent {
return potentialEvent as WebSocketEvent
}
/** Serializes one AIRI websocket protocol event with the existing SuperJSON wire format. */
/** Serializes one Moeka websocket protocol event with the existing SuperJSON wire format. */
export function stringifyEvent(event: WebSocketBaseEvent<string, unknown> | string) {
return typeof event === 'string' ? event : stringify(event)
}
@@ -8,7 +8,7 @@ interface ConsumerRegistryRef {
}
/**
* Candidate peer metadata used for AIRI consumer selection.
* Candidate peer metadata used for Moeka consumer selection.
*/
export interface ConsumerSelectionCandidate {
/** Peer id available to receive the event. */
@@ -24,7 +24,7 @@ export interface ConsumerSelectionCandidate {
}
/**
* Stored AIRI consumer registration.
* Stored Moeka consumer registration.
*/
export interface ConsumerRegistration {
/** Protocol event type consumed by the peer. */
@@ -40,7 +40,7 @@ export interface ConsumerRegistration {
}
/**
* Sticky AIRI consumer assignment stored by the consumer selector.
* Sticky Moeka consumer assignment stored by the consumer selector.
*/
export interface ConsumerStickyAssignment {
/** Protocol event type the sticky assignment belongs to. */
@@ -52,14 +52,14 @@ export interface ConsumerStickyAssignment {
}
/**
* Checks whether a delivery mode targets the AIRI consumer registry.
* Checks whether a delivery mode targets the Moeka consumer registry.
*/
export function isConsumerDeliveryMode(mode: unknown): mode is 'consumer' | 'consumer-group' {
return mode === 'consumer' || mode === 'consumer-group'
}
/**
* Normalizes delivery mode for AIRI consumer registration.
* Normalizes delivery mode for Moeka consumer registration.
*
* Before:
* - undefined with group "workers"
@@ -76,7 +76,7 @@ export function normalizeConsumerMode(mode: unknown, group?: string): 'consumer'
}
/**
* Normalizes AIRI consumer priority.
* Normalizes Moeka consumer priority.
*
* Before:
* - NaN
@@ -109,7 +109,7 @@ function sortConsumers(entries: Array<Pick<ConsumerSelectionCandidate, 'peerId'
}
/**
* Selects a concrete peer for AIRI consumer-style delivery modes.
* Selects a concrete peer for Moeka consumer-style delivery modes.
*
* Sticky and round-robin state are keyed with structured JSON tuples so event,
* group, and sticky key values may contain delimiter-like text safely.
@@ -166,10 +166,10 @@ export function selectConsumerPeerId(options: {
}
/**
* Creates the AIRI consumer delivery orchestrator for websocket peers.
* Creates the Moeka consumer delivery orchestrator for websocket peers.
*
* The orchestrator owns registration, unregister, listing, selection, and
* sticky/round-robin cleanup state for AIRI consumer routing.
* sticky/round-robin cleanup state for Moeka consumer routing.
*/
export function createConsumerOrchestrator() {
const consumerRegistry = new Map<string, Map<string, Map<string, ConsumerRegistration>>>()
@@ -7,7 +7,7 @@ import {
} from './liveness'
describe('airi websocket liveness policy', () => {
it('uses the AIRI default heartbeat TTL', () => {
it('uses the Moeka default heartbeat TTL', () => {
expect(serverWsDefaultHeartbeatTtlMs).toBe(60_000)
expect(resolveHealthCheckIntervalMs(serverWsDefaultHeartbeatTtlMs)).toBe(12_000)
})
@@ -7,7 +7,7 @@ export const serverWsHealthCheckIntervalDivisor = 5
/** Minimum interval to avoid busy liveness loops. */
export const serverWsMinimumHealthCheckIntervalMs = 5_000
/** Resolves the AIRI heartbeat health-check interval in milliseconds. */
/** Resolves the Moeka heartbeat health-check interval in milliseconds. */
export function resolveHealthCheckIntervalMs(heartbeatTtlMs: number) {
return Math.max(serverWsMinimumHealthCheckIntervalMs, Math.floor(heartbeatTtlMs / serverWsHealthCheckIntervalDivisor))
}
@@ -6,7 +6,7 @@ import { nanoid } from 'nanoid'
import packageJSON from '../../../package.json'
/** Creates AIRI server event metadata and preserves optional parent correlation. */
/** Creates Moeka server event metadata and preserves optional parent correlation. */
export function createEventMetadata(
serverInstanceId: string,
parentId?: string,
@@ -27,7 +27,7 @@ export function createEventMetadata(
}
}
/** Creates AIRI server response event factories. */
/** Creates Moeka server response event factories. */
export function createResponses(serverInstanceId: string) {
return {
authenticated(parentId?: string) {
+1 -1
View File
@@ -93,7 +93,7 @@ export function getLocalIPs(): string[] {
}
/**
* Creates the websocket server controller for the AIRI runtime.
* Creates the websocket server controller for the Moeka runtime.
*
* Use when:
* - Starting, stopping, or restarting the standalone runtime server