API Reference (tRPC)
Runeya expose deux routeurs tRPC : un sur le serveur local (port 9545) et un sur l'agent (port 9546).
Serveur local — Routeurs
Base URL : http://localhost:9545/api/trpc
health
| Procédure | Type | Description |
|---|---|---|
health.check | Query | Santé du serveur (public) |
service
| Procédure | Type | Description |
|---|---|---|
service.list | Query | Liste tous les services |
service.get | Query | Détails d'un service |
service.create | Mutation | Crée un service |
service.update | Mutation | Met à jour un service |
service.delete | Mutation | Supprime un service |
project
| Procédure | Type | Description |
|---|---|---|
project.list | Query | Liste tous les projets |
project.create | Mutation | Crée un projet |
project.update | Mutation | Met à jour un projet |
project.delete | Mutation | Supprime un projet |
process
| Procédure | Type | Description |
|---|---|---|
process.start | Mutation | Démarre un service |
process.stop | Mutation | Arrête un service |
process.restart | Mutation | Redémarre un service |
process.status | Subscription | Status temps réel |
process.logs | Subscription | Logs temps réel |
environment
| Procédure | Type | Description |
|---|---|---|
environment.list | Query | Liste les environnements |
environment.create | Mutation | Crée un environnement |
environment.update | Mutation | Met à jour un environnement |
environment.delete | Mutation | Supprime un environnement |
environment.setActive | Mutation | Active un environnement |
agent
| Procédure | Type | Description |
|---|---|---|
agent.list | Query | Liste les agents |
agent.register | Mutation | Enregistre un agent |
agent.health | Subscription | Santé des agents temps réel |
settings
| Procédure | Type | Description |
|---|---|---|
settings.get | Query | Paramètres globaux |
settings.update | Mutation | Met à jour les paramètres |
settings.getNotificationPreferences | Query | Préférences de notifications |
settings.updateNotificationPreferences | Mutation | Mute granulaire des notifications |
settings.listParsers | Query | Liste les parsers |
settings.getParser | Query | Détail d'un parser |
settings.createParser | Mutation | Crée un parser |
settings.updateParser | Mutation | Met à jour un parser |
settings.deleteParser | Mutation | Supprime un parser |
chat
| Procedure | Type | Description |
|---|---|---|
chat.conversations.list | Query | List conversations |
chat.conversations.get | Query | Get a conversation |
chat.conversations.create | Mutation | Create a conversation (optionally linked to a scenario or an enterprise) |
chat.conversations.update | Mutation | Update conversation title/messages |
chat.conversations.delete | Mutation | Delete a conversation |
chat.conversations.archive | Mutation | Archive/unarchive a conversation |
chat.listModels | Query | List available models for the active provider |
chat.checkClaudeCode | Query | Check whether local claude is available |
chat.listClaudeCodeModels | Query | List supported Claude Code model aliases |
chat.getClaudeUsage | Query | Read local Claude usage stats |
chat.getCodexUsage | Query | Read local Codex usage stats |
chat.streamingStatus | Query | List active streaming sessions |
chat.stopSession | Mutation | Stop an active session |
chat.sendViaClaudeCode | Subscription | Stream a response via Claude Code CLI |
chat.send | Subscription | Stream a response via provider API |
chat.conversations.create input
typescript
{
title?: string
isCli?: boolean
scenarioId?: string
enterpriseId?: string
enterpriseInput?: string
}scenarioIdandenterpriseIdare mutually exclusive.- When
enterpriseIdis set, the backend initializes a workspace inDATA_DIR/enterprise-runs/<conversationId>/.
scenario
| Procedure | Type | Description |
|---|---|---|
scenario.list | Query | List scenarios |
scenario.get | Query | Get a scenario |
scenario.create | Mutation | Create a scenario |
scenario.update | Mutation | Update a scenario |
scenario.delete | Mutation | Delete a scenario |
scenario.getRunState | Query | Read run state (per conversation) |
scenario.getScenarioSnapshot | Query | Read the executed scenario snapshot |
scenario.getNodeOutput | Query | Read a node output |
scenario.getNodeMeta | Query | Read node metadata |
scenario.getNodePredecessors | Query | Read predecessor context links |
scenario.getNodePrompt | Query | Read the resolved prompt for a node |
scenario.getSystemContext | Query | Read run system context |
scenario.sendInput | Mutation | Send user input to an ask_user node |
scenario.isRunning | Query | Check whether a run is active |
scenario.stop | Mutation | Stop an active run |
scenario.run | Subscription | Stream scenario execution events |
scenario.generateWithAI | Subscription | Stream AI-generated scenario graph content |
scenario.generateName | Mutation | Generate a short run conversation title |
ScenarioEdge schema (input for scenario.create / scenario.update)
typescript
interface ScenarioEdge {
id: string // UUID, max 128
source: string // source node ID, max 128
target: string // target node ID, max 128
description: string // branch description, max 500 (default: '')
}The description field is used by the runner to inject numbered choices (PASS1, PASS2, …) into the AI prompt when a node has multiple outgoing edges. See Data Model — Scenarios for routing behavior.
scenario.generateName behavior
- The backend sanitizes raw LLM output (quotes, bullets, multiline noise).
- Generic names (
scenario,scenario run, etc.) are rejected. - If needed, the server returns a deterministic fallback title derived from scenario data (name/labels/prompts), not an empty/generic value.
enterprise
| Procedure | Type | Description |
|---|---|---|
enterprise.list | Query | List enterprises |
enterprise.get | Query | Get an enterprise |
enterprise.create | Mutation | Create an enterprise |
enterprise.update | Mutation | Update an enterprise |
enterprise.delete | Mutation | Delete an enterprise |
Agent — Routeurs
Base URL : http://localhost:9546/api/trpc Auth : Authorization: Bearer <passphrase>
health
| Procédure | Type | Description |
|---|---|---|
health.check | Query | Santé de l'agent (public) |
process
| Procédure | Type | Description |
|---|---|---|
process.deploy | Mutation | Déploie/met à jour la config d'un service |
process.start | Mutation | Démarre un processus |
process.stop | Mutation | Arrête un processus (SIGTERM + grace) |
process.restart | Mutation | Redémarre un processus |
process.status | Subscription | Status temps réel |
process.logs | Subscription | Logs temps réel |
process.metrics | Subscription | Métriques CPU/RAM temps réel |
process.updateConfig | Mutation | Met à jour la config (process arrêté) |
process.clearLogs | Mutation | Efface le buffer de logs |
process.cancel | Mutation | Annule une opération en cours |
Subscriptions — Format
Les subscriptions utilisent les async generators tRPC v11 :
typescript
// Client-side (Vue)
const subscription = trpc.process.logs.subscribe(
{ serviceId },
{
onData: (logLine) => {
logs.value.push(logLine)
},
onError: (err) => {
console.error('Subscription error', err)
},
}
)
// Cleanup
subscription.unsubscribe()Schémas d'entrée communs
typescript
// Service
{
id: string // UUID
name: string // max 128
command: string // max 2048
cwd: string // max 2048
shell: boolean
description?: string // max 512
projectId: string // UUID
agentId?: string // UUID
parserIds: string[] // max 50 items
}
// LogLine (sortie des subscriptions)
{
raw: string
stream: 'stdout' | 'stderr'
level: 'error' | 'warn' | 'info' | 'debug'
message: string // max 16KB
hidden: boolean
metadata: object // max 100 keys
json?: object
timestamp: string // ISO 8601
}Erreurs tRPC
| Code | Description |
|---|---|
UNAUTHORIZED | Token JWT manquant ou invalide |
FORBIDDEN | Permissions insuffisantes |
NOT_FOUND | Ressource introuvable |
BAD_REQUEST | Validation Zod échouée |
INTERNAL_SERVER_ERROR | Erreur serveur inattendue |
CONFLICT | Opération impossible dans l'état actuel |