Files
orca/src/shared/runtime-host-descriptor.ts
T
OrcaWinandm4air cbeb703490 feat(hosts): servers publish a host descriptor (#27193)
* 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>
2026-10-10 01:26:26 -07:00

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>