<M extends AnyMethod>(method: M): FleetField<M>Mark a contract method as a fleet field — one combined across the nodes (its layer impl folds peers + its own value). It's served and client-visible like any query, but excluded from peers, so a fold over peers can't call a peer's own fleet field (a fan-out, not what you want). The one lightweight tag the plain-query model keeps, purely for this exclusion.
connections: Hyperlink.effect(Schema.Number), // per-instance (leaf) — peers see it
totalConnections: Hyperlink.fleet(Hyperlink.effect(Schema.Number)), // fleet — peers don'texport const const fleet: <M extends AnyMethod>(
method: M
) => FleetField<M>
Mark a contract method as a fleet field — one combined across the nodes (its layer impl folds
- its own value). It's served and client-visible like any query, but **excluded from
peers
**, so a fold over peers can't call a peer's own fleet field (a fan-out, not what you
want). The one lightweight tag the plain-query model keeps, purely for this exclusion.
connections: Hyperlink.effect(Schema.Number), // per-instance (leaf) — peers see it
totalConnections: Hyperlink.fleet(Hyperlink.effect(Schema.Number)), // fleet — peers don't
fleet = <function (type parameter) M in <M extends AnyMethod>(method: M): FleetField<M>M extends type AnyMethod = Method<
Schema.Struct.Fields | Schema.Top | undefined,
Schema.Top,
Schema.Top,
boolean,
MethodAnnotations,
never
>
Any
Method
, erased — the element type of a
Spec
.
AnyMethod>(method: M extends AnyMethodmethod: function (type parameter) M in <M extends AnyMethod>(method: M): FleetField<M>M): type FleetField<M extends AnyMethod> =
Omit<M, "annotate"> & {
readonly fleet: true
} & {
readonly annotate: <
A extends MethodAnnotations
>(
a: A
) => Marked<
Method<
M["payload"],
M["success"],
M["error"],
M["stream"],
M["annotations"] & A,
Derive
>,
{
readonly fleet: true
}
>
}
FleetField<function (type parameter) M in <M extends AnyMethod>(method: M): FleetField<M>M> =>
const marked: <
M extends AnyMethod,
Mark extends object
>(
method: M,
mark: Mark
) => Marked<M, Mark>
Attach a shape marker whose .annotate() preserves it (rebuilds the marker after annotating).
marked(method: M extends AnyMethodmethod, { fleet: truefleet: true as type const = trueconst });