pi-mono/packages/coding-agent/examples/plugins/pi-example-plugin/src/contract.ts
Armin Ronacher 86bac52f94 feat: add delta-backed replicated state
Track mutable provider state and publish immutable operation batches. Keep path codecs isolated per client subscription and state member.
2026-08-31 14:04:42 +02:00

13 lines
492 B
TypeScript

import { type Context, defineService, type ReplicatedState } from "@earendil-works/chord";
export interface ExampleFacetReply {
readonly message: string;
readonly workerActivations: number;
}
export interface ExampleFacetService {
readonly workerActivations: ReplicatedState<{ count: number }>;
greet(input: { readonly name: string }, context: Context): Promise<ExampleFacetReply>;
}
export const ExampleFacetService = defineService<ExampleFacetService>("pi.example-plugin.greeting");