@cotal-ai/workspace 0.133.12 → 0.133.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Release/darwin-arm64/build.json +1 -1
- package/build/Release/darwin-x64/build.json +1 -1
- package/build/Release/win32-arm64/build.json +1 -1
- package/build/Release/win32-x64/build.json +1 -1
- package/dist/control/actions.d.ts +141 -0
- package/dist/control/actions.d.ts.map +1 -0
- package/dist/control/actions.js +192 -0
- package/dist/control/actions.js.map +1 -0
- package/dist/control/dial-retry.d.ts +33 -0
- package/dist/control/dial-retry.d.ts.map +1 -0
- package/dist/control/dial-retry.js +70 -0
- package/dist/control/dial-retry.js.map +1 -0
- package/dist/control/index.d.ts +5 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +5 -0
- package/dist/control/index.js.map +1 -0
- package/dist/control/manager.d.ts +291 -0
- package/dist/control/manager.d.ts.map +1 -0
- package/dist/control/manager.js +769 -0
- package/dist/control/manager.js.map +1 -0
- package/dist/control/seat.d.ts +168 -0
- package/dist/control/seat.d.ts.map +1 -0
- package/dist/control/seat.js +225 -0
- package/dist/control/seat.js.map +1 -0
- package/dist/launch.d.ts +94 -0
- package/dist/launch.d.ts.map +1 -0
- package/dist/launch.js +58 -0
- package/dist/launch.js.map +1 -0
- package/dist/maintenance.d.ts +7 -0
- package/dist/maintenance.d.ts.map +1 -1
- package/dist/maintenance.js +24 -0
- package/dist/maintenance.js.map +1 -1
- package/dist/output.d.ts +2 -0
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +5 -0
- package/dist/output.js.map +1 -1
- package/dist/view/index.d.ts +3 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +3 -0
- package/dist/view/index.js.map +1 -0
- package/dist/view/mesh-view.d.ts +225 -0
- package/dist/view/mesh-view.d.ts.map +1 -0
- package/dist/view/mesh-view.js +550 -0
- package/dist/view/mesh-view.js.map +1 -0
- package/dist/view/observer.d.ts +26 -0
- package/dist/view/observer.d.ts.map +1 -0
- package/dist/view/observer.js +26 -0
- package/dist/view/observer.js.map +1 -0
- package/package.json +18 -4
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { type ControlReply, type EpCaller, type EpInstanceLiveness, type Presence, type SpaceAuth } from "@cotal-ai/core";
|
|
2
|
+
import { type NatsConnection } from "@nats-io/transport-node";
|
|
3
|
+
import { type ControlAuth } from "../control-target.js";
|
|
4
|
+
import { CommandFailure } from "../output.js";
|
|
5
|
+
/** What the surface making control calls supplies, because only it knows. */
|
|
6
|
+
export interface ControlClient {
|
|
7
|
+
/** The sentence for a manager refusing `undeclared`, an argument its contract does not declare.
|
|
8
|
+
* `detail` is the refusal's code and message, and `managerVersion` the version the refusing
|
|
9
|
+
* manager reported in its own `status`, when it did. The surface knows its own release and how
|
|
10
|
+
* it is updated, so it says which side is older. Called only for that refusal. */
|
|
11
|
+
versionSkew(detail: string, undeclared: string, managerVersion: string | undefined): string;
|
|
12
|
+
/** The roster of the space `flags` resolve to, read when a user-auth exchange refuses to pick
|
|
13
|
+
* one of the caller's several live managers, so each can be named. */
|
|
14
|
+
roster(flags: {
|
|
15
|
+
space?: string;
|
|
16
|
+
server?: string;
|
|
17
|
+
}): Promise<readonly Presence[]>;
|
|
18
|
+
}
|
|
19
|
+
/** Client-side request window for the manager's readiness-waiting launch ops (`start`, and the
|
|
20
|
+
* manifest `launch` — both funnel into the same startAgent readiness wait). #159 B1: the manager
|
|
21
|
+
* replies only on a REAL outcome — presence join, process exit, or its ~30s readiness backstop —
|
|
22
|
+
* so these requests must OUTLIVE that window, not the 5s op default. The tier rule forbids
|
|
23
|
+
* importing the manager's READINESS_TIMEOUT_MS here; the launch-parity smoke enforces the
|
|
24
|
+
* relation by test. */
|
|
25
|
+
export declare const START_TIMEOUT_MS = 40000;
|
|
26
|
+
/** Operator reach for one targeted control call: `owner` rides the caller's own-domain verb rows
|
|
27
|
+
* (the spawn capability's standing mint), `any` the admin instrument's cross-agent rows (§13.2
|
|
28
|
+
* any-mode). Replaces the deleted manager ctl tiers as the CLI's mode selector (1d). */
|
|
29
|
+
export type ControlReach = "owner" | "any";
|
|
30
|
+
export interface ManagerRequestIntent {
|
|
31
|
+
requestId: string;
|
|
32
|
+
requestedGoalId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ManagerRequestReceipt {
|
|
35
|
+
requestId: string;
|
|
36
|
+
managerInstanceId: string;
|
|
37
|
+
managerEpoch: number;
|
|
38
|
+
goalId?: string;
|
|
39
|
+
fingerprint?: string;
|
|
40
|
+
allocation?: {
|
|
41
|
+
name: string;
|
|
42
|
+
owner: string;
|
|
43
|
+
actor: string;
|
|
44
|
+
lifecycleUid: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** {@link ControlReply} plus the one fact a caller cannot recover from the rendered message: whether
|
|
48
|
+
* the call went UNANSWERED, as core marks it (`EP_UNANSWERED`: no responder, or the reply
|
|
49
|
+
* deadline elapsed with nothing attributed to the request). `up`'s resume readiness poll keys on it;
|
|
50
|
+
* it used to key on the message prefix, which turned an operator-facing string into a control-flow
|
|
51
|
+
* predicate in another file. `answered` marks a refusal a manager responder sent itself; one the
|
|
52
|
+
* broker or this client raised leaves it unset. */
|
|
53
|
+
export type ManagerReply = ControlReply & {
|
|
54
|
+
unanswered?: boolean;
|
|
55
|
+
answered?: true;
|
|
56
|
+
preSubmitRefusal?: true;
|
|
57
|
+
managerInstanceId?: string;
|
|
58
|
+
managerEpoch?: number;
|
|
59
|
+
observationCause?: {
|
|
60
|
+
code?: string;
|
|
61
|
+
outcome?: string;
|
|
62
|
+
};
|
|
63
|
+
intent?: ManagerRequestIntent;
|
|
64
|
+
request?: ManagerRequestReceipt;
|
|
65
|
+
nativeOutcome?: "executed" | "not-executed" | "unknown";
|
|
66
|
+
};
|
|
67
|
+
/** Classify only a proved pre-effect refusal as refused; a missing effect outcome is not proof.
|
|
68
|
+
* Every message names the agent when the target carries one and ends with the manager's own
|
|
69
|
+
* reason, kept to one line. */
|
|
70
|
+
export declare function managerFailure(reply: ManagerReply, operation: string, target: unknown): CommandFailure;
|
|
71
|
+
/** A describe that drew no answer means the command after it was never sent, so it is refused, as
|
|
72
|
+
* `chat` and the run verbs refuse it, and not an unknown outcome. Undefined for any other failure. */
|
|
73
|
+
export declare function unansweredDescribeRefusal(reply: ManagerReply, operation: string, target: unknown): CommandFailure | undefined;
|
|
74
|
+
/** Whether the describe before a command drew no answer, so the command itself was never sent. */
|
|
75
|
+
export declare function describeUnanswered(reply: ManagerReply): boolean;
|
|
76
|
+
/** What the calling command declares about pinning. Passed ONLY by a command that offers `--on`
|
|
77
|
+
* (`ps`, `models`, `stop`, `attach`, `spawn --detach`), with `instanceId` set to what the operator
|
|
78
|
+
* typed, if anything. Its presence is what lets the renderer offer `--on` as a remedy: a command
|
|
79
|
+
* without the flag (`up`, `down`) rides the same rails, splits the same way, and must not be told
|
|
80
|
+
* to type a flag it does not have. Absence of a pin therefore never means "not passed". */
|
|
81
|
+
export interface ManagerPin {
|
|
82
|
+
instanceId?: string;
|
|
83
|
+
/** A picker-selected incarnation, checked after name resolution and before publication. */
|
|
84
|
+
expectedTarget?: {
|
|
85
|
+
id: string;
|
|
86
|
+
lifecycleUid: string;
|
|
87
|
+
};
|
|
88
|
+
/** Composite operations persist their original request before publication and the attributed
|
|
89
|
+
* allocation before following a goal. A journal refusal never triggers another submission. */
|
|
90
|
+
journal?: {
|
|
91
|
+
beforeSubmit(intent: ManagerRequestIntent): void | Promise<void>;
|
|
92
|
+
accepted(receipt: ManagerRequestReceipt): void | Promise<void>;
|
|
93
|
+
};
|
|
94
|
+
/** Stops the resolve and the request waiting, for a caller that no longer needs the answer. */
|
|
95
|
+
signal?: AbortSignal;
|
|
96
|
+
}
|
|
97
|
+
/** Render an ep-rail failure for the operator. Three outcomes, told apart by core's markers and never
|
|
98
|
+
* by the catalog code: a responder's own `ok:false` describe reply is rethrown under ITS code
|
|
99
|
+
* (`unavailable` included), and a store read after an answered describe raises the same code, so
|
|
100
|
+
* the code says nothing about whether anyone answered.
|
|
101
|
+
* - UNANSWERED ({@link unansweredRequest}: no responder, or the reply deadline elapsed). The
|
|
102
|
+
* reachability verdict "no manager reachable" is stated here and only here, and only unpinned:
|
|
103
|
+
* an unanswered PINNED call names the instance instead, since three managers may be answering
|
|
104
|
+
* while the one the operator typed is not there, and "no manager reachable" sends them to the
|
|
105
|
+
* broker for a typo. Measured on a live three-manager mesh during review. The verdict is also
|
|
106
|
+
* scoped to the RAIL ({@link unansweredRail}): on the versioned rail it names that rail and says what the
|
|
107
|
+
* silence does not establish, because SPEC 13.15 keeps the two rails disjoint at the broker.
|
|
108
|
+
* - a REGISTRY READ on this side failed ({@link registryReadFailed}: the scatter's freeze or its
|
|
109
|
+
* reconcile). The managers were not the failure and may all be up; a verdict on them here sent
|
|
110
|
+
* the operator to the managers for a broker read.
|
|
111
|
+
* - everything else answered, or failed on this side with its own cause, and is printed as is.
|
|
112
|
+
* Prepending a verdict made the headline contradict the body: a describe REFUSED BY THE BROKER
|
|
113
|
+
* read as an unreachable manager, which is precisely the misreading the refusal was reworded to
|
|
114
|
+
* stop.
|
|
115
|
+
* A failure that is not an {@link EpEnvelopeError} carries no answer provenance at all, so no verdict
|
|
116
|
+
* is stated for it either: its message stands alone. `managerVersion` is the version the refusing
|
|
117
|
+
* manager reported in its own `status`, for a key its contract does not declare. */
|
|
118
|
+
export declare function epRailFailure(client: ControlClient, e: unknown, pin?: ManagerPin, managerVersion?: string): ManagerReply;
|
|
119
|
+
/** Send one control command to the manager over the v0.4 service-endpoint rails and disconnect —
|
|
120
|
+
* since 1d the manager's ONLY control door (the `ctl` tiers are deleted). The target is already
|
|
121
|
+
* reachability- + auth-preflighted by {@link resolveControlTarget}. `reach` picks the operator
|
|
122
|
+
* mode for the two targeted ops (stop/attach): `owner` = the caller's own domain (the spawn
|
|
123
|
+
* capability's standing mint / a user bearer's own owner), `any` = the admin instrument's
|
|
124
|
+
* cross-agent reach. Three auth shapes reach the rails: a static instrument's caller triple, a
|
|
125
|
+
* user bearer's triple, or an OPEN mesh (no credential system — a bare connection under a
|
|
126
|
+
* synthesized DEV_OWNER triple, since the manager registered under DEV_OWNER and the broker
|
|
127
|
+
* enforces nothing). A raw `--creds` file from an older generation carries no ep rows and is
|
|
128
|
+
* refused loud (no silent ctl fallback exists anymore). */
|
|
129
|
+
export declare function askManager(client: ControlClient, space: string, server: string, op: string, args?: Record<string, unknown>, auth?: ControlAuth, reach?: ControlReach, timeoutMs?: number, pin?: ManagerPin): Promise<ManagerReply>;
|
|
130
|
+
/** What the caller established about a silent instance's LIVENESS, as opposed to its answer. Kept
|
|
131
|
+
* separate from `reachable` because they are different questions and folding them is what let a
|
|
132
|
+
* registration outlive its host unnoticed:
|
|
133
|
+
* - `gone` — the BROKER answered no-responders on that instance's own rail. Affirmative: the
|
|
134
|
+
* record claims a live instance and there is nothing behind it, so the row can say so and name
|
|
135
|
+
* the deregistration.
|
|
136
|
+
* - `unknown` — a probe went out and nothing came back. A live-but-slow host and a wedged one are
|
|
137
|
+
* the same observation from here, so nothing is claimed.
|
|
138
|
+
* - `not-probed` — no probe was PUBLISHED for it: it is outside this credential's pinned set (it
|
|
139
|
+
* registered after the freeze this instrument was minted against), or this command had no
|
|
140
|
+
* probe path at all (user mode holds no instance rails).
|
|
141
|
+
* - `probe-refused` — the broker refused the probe publish. The grant is missing, which is a
|
|
142
|
+
* local misconfiguration and NOT a statement about the instance; it is named on stderr rather
|
|
143
|
+
* than left to expire into `unknown`. */
|
|
144
|
+
export type ScatterInstanceLiveness = "gone" | "unknown" | "not-probed" | "probe-refused";
|
|
145
|
+
/** One instance's slot in a class scatter (P2 item 3): a REACHABLE instance carries its attributed
|
|
146
|
+
* reply (`data` on ok, `error` on a per-instance failure); an UNREACHABLE one (a frozen slot that
|
|
147
|
+
* produced no on-time reply — a severed/stalled manager) is reported, NEVER omitted (SPEC §13.5 pin 3),
|
|
148
|
+
* and carries what the liveness probe established about it ({@link ScatterInstanceLiveness}). */
|
|
149
|
+
export interface ScatterInstanceReply {
|
|
150
|
+
instanceId: string;
|
|
151
|
+
reachable: boolean;
|
|
152
|
+
data?: unknown;
|
|
153
|
+
error?: string;
|
|
154
|
+
/** The endpoint's error code beside `error`, when its refusal carried one. */
|
|
155
|
+
code?: string;
|
|
156
|
+
/** Set on unreachable slots only: a slot that ANSWERED needs no liveness verdict. */
|
|
157
|
+
liveness?: ScatterInstanceLiveness;
|
|
158
|
+
/** The host name this instance gave in its own `status` reply, when the caller asked for it.
|
|
159
|
+
* Display metadata the manager reports about itself: never checked and never a route. */
|
|
160
|
+
reportedHost?: string;
|
|
161
|
+
}
|
|
162
|
+
/** A failed scatter's `noLiveManager` says the registry was read and lists no live manager. */
|
|
163
|
+
export type ScatterReply = {
|
|
164
|
+
ok: true;
|
|
165
|
+
instances: ScatterInstanceReply[];
|
|
166
|
+
} | {
|
|
167
|
+
ok: false;
|
|
168
|
+
error: string;
|
|
169
|
+
code?: string;
|
|
170
|
+
unanswered?: boolean;
|
|
171
|
+
noLiveManager?: true;
|
|
172
|
+
};
|
|
173
|
+
/** Open one short-lived control connection under whichever of the three auth shapes this command
|
|
174
|
+
* holds (static creds / user bearer + sentinel / bare open mesh) and hand it to `fn`. Extracted so
|
|
175
|
+
* the scatter's TWO connections cannot drift in their connect options: they differ in credential
|
|
176
|
+
* and in nothing else. The selected dialer matters because the raw node transport refuses a
|
|
177
|
+
* `wss://` mesh behind an HTTPS edge even when the other endpoint rails can reach it. */
|
|
178
|
+
export declare function withControlConnection<T>(server: string, auth: ControlAuth, fn: (nc: NatsConnection) => Promise<T>): Promise<T>;
|
|
179
|
+
/**
|
|
180
|
+
* THE §13.5 LIVENESS HOOK the caller hands to a scatter, and the record of what it established.
|
|
181
|
+
*
|
|
182
|
+
* It is built HERE and not in core because it is entirely a statement about this caller's
|
|
183
|
+
* CREDENTIAL. A probe publishes on an instance's own rail, and only the layer that minted the
|
|
184
|
+
* credential knows which instance rails it carries; core cannot know, and a core that guessed would
|
|
185
|
+
* publish requests the broker must refuse — invisibly, since a refused publish looks exactly like a
|
|
186
|
+
* slow instance from the caller's side.
|
|
187
|
+
*
|
|
188
|
+
* TWO RULES, and both are about not asking questions this credential cannot ask:
|
|
189
|
+
* - an id OUTSIDE the pinned set gets `unknown` WITHOUT PUBLISHING. The scatter re-freezes the
|
|
190
|
+
* class on its own connection, so it can name an instance that registered after the freeze this
|
|
191
|
+
* credential was minted against. That instance is NEW, not dead, and the right answer for it is
|
|
192
|
+
* the deadline — reached without sending a request that would be refused.
|
|
193
|
+
* - an id INSIDE the set that the broker refuses anyway settles IMMEDIATELY on the violation
|
|
194
|
+
* rather than expiring into `unknown` at the budget, and is reported by name.
|
|
195
|
+
*
|
|
196
|
+
* Only `gone` ever licenses anything downstream, so every mistake this can make is a slower and
|
|
197
|
+
* more truthful answer, never a faster wrong one.
|
|
198
|
+
*/
|
|
199
|
+
export declare function pinnedLivenessProbe(nc: NatsConnection, opts: {
|
|
200
|
+
space: string;
|
|
201
|
+
endpoint: string;
|
|
202
|
+
caller: EpCaller;
|
|
203
|
+
/** The exact ids this connection's credential holds `inst` rails for. */
|
|
204
|
+
pinned: ReadonlySet<string>;
|
|
205
|
+
probeDeadlineMs?: number;
|
|
206
|
+
/** Where a refusal is announced. Defaults to stderr; the suite captures it. */
|
|
207
|
+
report?: (line: string) => void;
|
|
208
|
+
}): {
|
|
209
|
+
probeLiveness: (instanceId: string) => Promise<EpInstanceLiveness>;
|
|
210
|
+
/** What was established about one silent slot, for the row that will describe it. */
|
|
211
|
+
livenessOf: (instanceId: string) => ScatterInstanceLiveness;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Whether the scatter's liveness probe rides a BARE connection, a freshly minted pinned instrument,
|
|
215
|
+
* or nothing at all. The sixth seed reach on the attach path, made explicit.
|
|
216
|
+
*
|
|
217
|
+
* Named and exported so it is GRADABLE, because it is the one site on this path that still answers
|
|
218
|
+
* "is this an open mesh?" from the absence of a credential. That inference is issue #1205 itself,
|
|
219
|
+
* and it is only tolerable here because of what this answer is allowed to DO: it selects whether a
|
|
220
|
+
* frozen instance's liveness is probed, so a wrong answer downgrades a row to `not-probed` and
|
|
221
|
+
* never refuses an attach. A caller that ever turns this into a refusal must change this function,
|
|
222
|
+
* which is the point of it having a name.
|
|
223
|
+
*
|
|
224
|
+
* bare — no credential and no bearer: an open mesh, whose connection can already publish.
|
|
225
|
+
* mint — a sealed mesh that holds its seed AND arrived on a credential: re-mint pinned.
|
|
226
|
+
* as-is — everything else (a user bearer, a raw off-registry cred, a sealed mesh with no seed):
|
|
227
|
+
* keep the credential it arrived with and probe nothing, which is the pre-existing
|
|
228
|
+
* behaviour and prints `not-probed` rather than degrading silently.
|
|
229
|
+
*/
|
|
230
|
+
export declare function scatterProbeMaterial(auth: ControlAuth, spaceAuth: SpaceAuth | undefined): {
|
|
231
|
+
kind: "bare";
|
|
232
|
+
} | {
|
|
233
|
+
kind: "mint";
|
|
234
|
+
auth: SpaceAuth;
|
|
235
|
+
} | {
|
|
236
|
+
kind: "as-is";
|
|
237
|
+
};
|
|
238
|
+
/** Commands whose closures one scatter run invokes: the scattered verb, plus status for host labels. */
|
|
239
|
+
export declare function scatterResolveCommands(command: string, reportHosts: boolean): string[];
|
|
240
|
+
/** SCATTER one untargeted read (`ps`) across EVERY registered manager instance in the space and merge
|
|
241
|
+
* the attributed results — the `cotal ps` default in a multi-manager space (P2 item 3). Auth shapes
|
|
242
|
+
* match {@link askManager}: a minted instrument or user bearer rides its own caller triple; a raw
|
|
243
|
+
* pre-1c `--creds` file is refused loud; an OPEN mesh synthesizes a DEV_OWNER triple and connects
|
|
244
|
+
* bare (the broker enforces nothing, so the records freeze reads freely). `spaceAuth` is the
|
|
245
|
+
* resolved mesh's trust material from {@link resolveControlTarget}: present ⇒ the scatter re-mints
|
|
246
|
+
* its instrument pinned to the frozen instance ids and can probe their liveness; absent ⇒ it runs
|
|
247
|
+
* exactly as it did before and every silent slot is reported `not-probed`. */
|
|
248
|
+
export declare function scatterManager(client: ControlClient, space: string, server: string, op: string, auth?: ControlAuth, spaceAuth?: SpaceAuth, timeoutMs?: number, opts?: {
|
|
249
|
+
reportHosts?: boolean;
|
|
250
|
+
}): Promise<ScatterReply>;
|
|
251
|
+
/** The refusal `ps` gives, raised before an unpinned operator read when the registry lists no live
|
|
252
|
+
* manager, rather than after the read's describe has waited out its whole deadline. Only the
|
|
253
|
+
* operator instrument holds the registry rows, so a caller passes a user's manager view or a pinned
|
|
254
|
+
* call straight to the read. Any other registry outcome, an unreadable registry included, leaves
|
|
255
|
+
* the read to decide. `purpose` completes "no manager is running for this space to …". Returns the
|
|
256
|
+
* live instance ids the registry listed, or undefined when it could not be read. */
|
|
257
|
+
export declare function refuseWithoutLiveManager(space: string, server: string, auth: ControlAuth, target: unknown, purpose: string): Promise<string[] | undefined>;
|
|
258
|
+
/** The host one manager instance reports in its own `status`, the name `cotal ps` prints as its
|
|
259
|
+
* reported host, or undefined when it does not answer or names no well-formed host. Presence
|
|
260
|
+
* carries no instance id off a user-auth mesh, so this read is where a pinned manager's host comes
|
|
261
|
+
* from there. The view is the caller's own and is not kept.
|
|
262
|
+
*
|
|
263
|
+
* It takes the ordinary control deadline, NOT {@link REPORTED_HOST_BUDGET_MS}. That budget belongs
|
|
264
|
+
* to the census above, where a host name is display metadata and a slow instance is listed without
|
|
265
|
+
* one. Here the answer decides whether a launch stops to ask the operator a question, so a read
|
|
266
|
+
* that gives up early does not lose a column, it asks about a manager that is on this host.
|
|
267
|
+
* Measured: under heavy load the 2s budget expired and the question came back. */
|
|
268
|
+
export declare function reportedManagerHost(client: ControlClient, space: string, server: string, auth: ControlAuth, instanceId: string): Promise<string | undefined>;
|
|
269
|
+
/** A pinned instance the space's registry does not list has nothing behind it to answer, so the
|
|
270
|
+
* command is refused before it waits out the reply deadline, naming the managers that are running.
|
|
271
|
+
* A registry this side cannot read leaves the request to settle it. */
|
|
272
|
+
export declare function refuseUnregisteredManager(space: string, server: string, auth: ControlAuth, on: string): Promise<void>;
|
|
273
|
+
/** Whether the broker affirms that nothing is subscribed on manager `instanceId`'s own rail, so its
|
|
274
|
+
* registration outlived its host. The probe settles on the broker's no-responders answer, so a gone
|
|
275
|
+
* manager costs no reply deadline. A live manager never answers the probe, which then runs its whole
|
|
276
|
+
* budget, so a caller that also asks the manager itself passes `signal` and fires it once that
|
|
277
|
+
* answer arrives. Any other outcome, an aborted probe or one this credential cannot send included,
|
|
278
|
+
* is `false`. */
|
|
279
|
+
export declare function managerRailGone(space: string, server: string, auth: ControlAuth, instanceId: string, signal?: AbortSignal): Promise<boolean>;
|
|
280
|
+
/** The manager instances the space's registry lists as live, frozen as a scatter freezes them. An
|
|
281
|
+
* empty registry throws the registry's own refusal. */
|
|
282
|
+
export declare function liveManagerIds(space: string, server: string, auth: ControlAuth): Promise<string[]>;
|
|
283
|
+
/** A manager read that did not answer, as the classified failure a structured command reports: the
|
|
284
|
+
* same sentence, the endpoint's own code under `error.cause`, and the stale-store hint as its remedy
|
|
285
|
+
* when one applies. A request nobody answered carries `deadline-exceeded`, an unavailable target. */
|
|
286
|
+
export declare function readFailure(reply: {
|
|
287
|
+
error?: string;
|
|
288
|
+
code?: string;
|
|
289
|
+
details?: unknown;
|
|
290
|
+
}, target?: unknown): CommandFailure;
|
|
291
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/control/manager.ts"],"names":[],"mappings":"AACA,OAAO,EAgCL,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,kBAAkB,EAIvB,KAAK,QAAQ,EAGb,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGxF,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,cAAc,EAA2C,MAAM,cA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