feat: add phase 1 runnable skeleton
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const hermesHealthSchema = z.object({
|
||||
cliAvailable: z.boolean(),
|
||||
cliPath: z.string().optional(),
|
||||
});
|
||||
|
||||
export const healthResponseSchema = z.object({
|
||||
ok: z.boolean(),
|
||||
service: z.literal('hermes-mobile-companion'),
|
||||
version: z.string(),
|
||||
mode: z.enum(['development', 'test', 'production']),
|
||||
uptimeSeconds: z.number().nonnegative(),
|
||||
timestamp: z.string().datetime(),
|
||||
checks: z.object({
|
||||
hermes: hermesHealthSchema,
|
||||
}),
|
||||
});
|
||||
|
||||
export type HermesHealth = z.infer<typeof hermesHealthSchema>;
|
||||
export type HealthResponse = z.infer<typeof healthResponseSchema>;
|
||||
@@ -0,0 +1,42 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const companionEventLevelSchema = z.enum(['debug', 'info', 'warn', 'error']);
|
||||
|
||||
export const companionEventTypeSchema = z.enum([
|
||||
'task.created',
|
||||
'task.started',
|
||||
'task.status',
|
||||
'task.finished',
|
||||
'task.failed',
|
||||
'task.cancelled',
|
||||
'assistant.delta',
|
||||
'assistant.message',
|
||||
'assistant.final',
|
||||
'tool_call.started',
|
||||
'tool_call.output',
|
||||
'tool_call.finished',
|
||||
'tool_call.failed',
|
||||
'file.uploaded',
|
||||
'file.generated',
|
||||
'approval.required',
|
||||
'approval.resolved',
|
||||
'cron.job.listed',
|
||||
'cron.job.updated',
|
||||
'cron.job.finished',
|
||||
'notification.sent',
|
||||
'notification.failed',
|
||||
]);
|
||||
|
||||
export const companionEventSchema = z.object({
|
||||
id: z.string().min(1),
|
||||
type: companionEventTypeSchema,
|
||||
taskId: z.string().min(1).optional(),
|
||||
sessionId: z.string().min(1).optional(),
|
||||
ts: z.string().datetime(),
|
||||
level: companionEventLevelSchema.optional(),
|
||||
payload: z.unknown(),
|
||||
});
|
||||
|
||||
export type CompanionEventLevel = z.infer<typeof companionEventLevelSchema>;
|
||||
export type CompanionEventType = z.infer<typeof companionEventTypeSchema>;
|
||||
export type CompanionEvent = z.infer<typeof companionEventSchema>;
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './api.js';
|
||||
export * from './events.js';
|
||||
export * from './tasks.js';
|
||||
@@ -0,0 +1,14 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const taskStatusSchema = z.enum(['queued', 'running', 'completed', 'failed', 'cancelled']);
|
||||
|
||||
export const taskSummarySchema = z.object({
|
||||
id: z.string().min(1),
|
||||
title: z.string().min(1),
|
||||
status: taskStatusSchema,
|
||||
createdAt: z.string().datetime(),
|
||||
updatedAt: z.string().datetime(),
|
||||
});
|
||||
|
||||
export type TaskStatus = z.infer<typeof taskStatusSchema>;
|
||||
export type TaskSummary = z.infer<typeof taskSummarySchema>;
|
||||
Reference in New Issue
Block a user