// Post a timeline update to an open incident — OPERATOR ONLY. Writes an // `incident_updates` row AND advances the incident's own `status` so the public // banner + timeline move together. import { defineMutation } from '@voltro/protocol' import { Schema } from 'effect' export const updateIncident = defineMutation({ name: 'incidents.update', target: { table: 'incident_updates', op: 'insert' }, guards: [{ scope: 'status:write' }], input: Schema.Struct({ incidentId: Schema.NonEmptyString, body: Schema.NonEmptyString, status: Schema.Literal('investigating', 'identified', 'monitoring'), }), output: Schema.Struct({ id: Schema.String, incidentId: Schema.String, status: Schema.String, }), })