feat: add phase 1 runnable skeleton

This commit is contained in:
Hermes Agent
2026-07-09 04:19:23 +00:00
parent deec0c7fa3
commit bd0cf34aa3
35 changed files with 675 additions and 5 deletions
+1
View File
@@ -0,0 +1 @@
{"name":"@hermes-mobile/shared","version":"0.1.0","private":true,"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json","dev":"tsc -p tsconfig.json --watch --preserveWatchOutput","typecheck":"tsc -p tsconfig.json --noEmit","lint":"eslint src"},"dependencies":{"zod":"^3.24.1"},"devDependencies":{}}
+21
View File
@@ -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>;
+42
View File
@@ -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>;
+3
View File
@@ -0,0 +1,3 @@
export * from './api.js';
export * from './events.js';
export * from './tasks.js';
+14
View File
@@ -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>;
+1
View File
@@ -0,0 +1 @@
{"extends":"../../tsconfig.base.json","compilerOptions":{"declaration":true,"declarationMap":true,"outDir":"dist","rootDir":"src","composite":true},"include":["src"]}