mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 17:17:38 +00:00
* feat(hosts): servers publish a host descriptor A paired server now reports a stable installation id, created once per profile, plus an optional machine binding (HMAC keyed by that id over the machine id and profile path) in status.get and in runtime pairing offers. Optional fields only: older clients ignore them and older hosts omit them. Clients start using it in the follow-up. * fix(hosts): serialize installation id creation so concurrent starts never fork it --------- Co-authored-by: m4air <m4air@Mac.localdomain>
19 lines
634 B
TypeScript
19 lines
634 B
TypeScript
import { z } from 'zod'
|
|
|
|
/**
|
|
* What a runtime host says about its own installation. `installationId` is generated once per
|
|
* profile; `machineBinding` is HMAC(installationId, machine id + profile path) and is only a hint
|
|
* that the profile moved or was copied, never an identity on its own.
|
|
*/
|
|
export const RuntimeHostDescriptorSchema = z.object({
|
|
installationId: z
|
|
.string()
|
|
.regex(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/),
|
|
machineBinding: z
|
|
.string()
|
|
.regex(/^[A-Za-z0-9_-]{43}$/)
|
|
.optional()
|
|
})
|
|
|
|
export type RuntimeHostDescriptor = z.infer<typeof RuntimeHostDescriptorSchema>
|