@cotal-ai/core 0.10.1 → 0.11.0

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.
Files changed (64) hide show
  1. package/dist/agent-file.d.ts +10 -1
  2. package/dist/agent-file.d.ts.map +1 -1
  3. package/dist/agent-file.js +65 -80
  4. package/dist/agent-file.js.map +1 -1
  5. package/dist/auth-provider.d.ts +207 -0
  6. package/dist/auth-provider.d.ts.map +1 -0
  7. package/dist/auth-provider.js +13 -0
  8. package/dist/auth-provider.js.map +1 -0
  9. package/dist/channels.d.ts +10 -0
  10. package/dist/channels.d.ts.map +1 -1
  11. package/dist/channels.js +9 -27
  12. package/dist/channels.js.map +1 -1
  13. package/dist/command.d.ts +6 -1
  14. package/dist/command.d.ts.map +1 -1
  15. package/dist/command.js +5 -1
  16. package/dist/command.js.map +1 -1
  17. package/dist/connector-config.js +1 -1
  18. package/dist/connector.d.ts +16 -0
  19. package/dist/connector.d.ts.map +1 -1
  20. package/dist/endpoint.d.ts +148 -17
  21. package/dist/endpoint.d.ts.map +1 -1
  22. package/dist/endpoint.js +470 -97
  23. package/dist/endpoint.js.map +1 -1
  24. package/dist/evict.d.ts +87 -0
  25. package/dist/evict.d.ts.map +1 -0
  26. package/dist/evict.js +231 -0
  27. package/dist/evict.js.map +1 -0
  28. package/dist/identity.d.ts +15 -0
  29. package/dist/identity.d.ts.map +1 -1
  30. package/dist/identity.js +26 -2
  31. package/dist/identity.js.map +1 -1
  32. package/dist/index.d.ts +2 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +2 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/launch.d.ts +6 -0
  37. package/dist/launch.d.ts.map +1 -1
  38. package/dist/members.d.ts.map +1 -1
  39. package/dist/members.js +5 -2
  40. package/dist/members.js.map +1 -1
  41. package/dist/membership-feed.d.ts +17 -3
  42. package/dist/membership-feed.d.ts.map +1 -1
  43. package/dist/membership-feed.js +41 -13
  44. package/dist/membership-feed.js.map +1 -1
  45. package/dist/provision.d.ts +99 -14
  46. package/dist/provision.d.ts.map +1 -1
  47. package/dist/provision.js +267 -128
  48. package/dist/provision.js.map +1 -1
  49. package/dist/resolve.js +1 -1
  50. package/dist/secret-fs.d.ts +9 -0
  51. package/dist/secret-fs.d.ts.map +1 -1
  52. package/dist/secret-fs.js +26 -2
  53. package/dist/secret-fs.js.map +1 -1
  54. package/dist/streams.d.ts +33 -7
  55. package/dist/streams.d.ts.map +1 -1
  56. package/dist/streams.js +53 -30
  57. package/dist/streams.js.map +1 -1
  58. package/dist/subjects.d.ts +267 -75
  59. package/dist/subjects.d.ts.map +1 -1
  60. package/dist/subjects.js +401 -110
  61. package/dist/subjects.js.map +1 -1
  62. package/dist/types.d.ts +13 -2
  63. package/dist/types.d.ts.map +1 -1
  64. package/package.json +3 -2
@@ -18,7 +18,10 @@ export declare function spacePrefix(space: string): string;
18
18
  * Returns `undefined` for an empty result so the field is omitted rather than sent as `[]`.
19
19
  * Presence-agnostic (no roster lookup) — validation lives in the connector. */
20
20
  export declare function normalizeMentions(mentions?: string[]): string[] | undefined;
21
- export declare function chatSubject(space: string, sender: string, channel: string): string;
21
+ /** Multicast: `chat.<owner>.<actor>.<channel…>` the publishing principal (owner+actor) precedes the
22
+ * channel (owner+actor grammar, Shape A). Either identity slot may be `*` for subscribe/allow rules
23
+ * (`chat.*.*.<ch>` = read a channel from any principal). */
24
+ export declare function chatSubject(space: string, owner: string, actor: string, channel: string): string;
22
25
  /** True if a channel names a concrete sub-channel (no `*`/`>`) — i.e. it can be
23
26
  * *published* to. Subscriptions may be wildcard; publishes must be concrete. */
24
27
  export declare function isConcreteChannel(channel: string): boolean;
@@ -38,41 +41,191 @@ export declare function subjectMatches(pattern: string, subject: string): boolea
38
41
  * never named (and two distinct policy strings could collide on one token). Returns the channel
39
42
  * unchanged when valid so callers can use it inline. */
40
43
  export declare function assertValidChannel(channel: string): string;
41
- /** Validate an **owner/actor token** the broker-authenticated lane boundary that the owner+actor
42
- * grammar adds to wire subjects and persisted principal-scoped keys. STRICTER than
43
- * {@link assertValidChannel}: a principal segment is exactly ONE NATS-safe token — `[A-Za-z0-9_]+`,
44
- * with NO dots, NO `*`, NO `>`, and NO `-` (reserved as the JetStream-name separator in
45
- * {@link principalNameKey}). A separator or wildcard is lane breakout or aliasing (it would let one
46
- * owner's grant span, or collide with, another's), so this FAILS LOUD rather than sanitizing.
47
- * Do NOT substitute {@link token}/`routeToken` here: they silently rewrite illegal characters safe
48
- * for nkeys (already base32), unsafe for human-owner ids where a rewrite hides an aliasing attempt.
49
- * Returns the token unchanged when valid so callers can use it inline. */
44
+ /** Validate an **owner or actor token** of the owner+actor grammar (the per-user-auth cutover).
45
+ * Defined AHEAD of use: today this has no call sites — persisted owner-bearing keys
46
+ * ({@link memberKey}, {@link aclKey}, {@link dinboxSubject}, {@link dlvSubject}) still ride raw
47
+ * nkeys through `token()`/`routeToken()` (a no-op on base32) the cutover wires this in at every
48
+ * mint/callout boundary and persisted owner/actor-bearing key. STRICTER than
49
+ * {@link assertValidChannel}: a token is exactly ONE NATS-safe segment `[A-Za-z0-9_]+`, with NO
50
+ * dots, NO `*`, NO `>`, and NO `-`. Dots/wildcards in an id are lane breakout or aliasing (they would
51
+ * let one owner's grant span, or collide with, another's); `-` is excluded because it is reserved as
52
+ * the sole separator of {@link principalKey}'s JetStream-name form a `-` *inside* a token would
53
+ * make `<owner>-<actor>` ambiguous. The ASCII-only alphabet also makes NFC-normalization trivially
54
+ * hold (any non-ASCII input fails). FAILS LOUD rather than sanitizing — do NOT substitute
55
+ * {@link token}/`routeToken` here: they silently rewrite illegal characters, and a rewrite hides an
56
+ * aliasing attempt. Returns the token unchanged when valid so callers can use it inline. */
50
57
  export declare function assertValidOwnerToken(owner: string): string;
51
- /** Principal key form for subjects and KV keys: dot separates owner and actor because NATS subjects use
52
- * dot token boundaries. Use only in subject/KV namespaces, never as a JetStream durable/consumer name. */
58
+ /** The canonical serialization of a **principal** (`owner`+`actor`) the key every authority that
59
+ * enforces per-agent grants checks against. It is TWO forms, not one, because the same principal
60
+ * lands in two namespaces with incompatible rules:
61
+ * - `key` — the subject / KV-key dot-form `<owner>.<actor>`, for wire subjects and KV keys,
62
+ * where `.` is the token boundary;
63
+ * - `name` — the JetStream-name form `<owner>-<actor>`, for durable / consumer / stream and
64
+ * chat-history names, where JetStream forbids `.` `*` `>` `/` and whitespace, so the dot-form
65
+ * is illegal.
66
+ * Both tokens are {@link assertValidOwnerToken}-validated, and `-` is banned *inside* tokens and
67
+ * reserved as the sole name separator, so both forms are collision-free — distinct (owner, actor)
68
+ * pairs can never serialize to the same string. All principal serialization goes through here: no
69
+ * ad-hoc string joins, and never a `<owner>.<actor>` fed to a JetStream name. Defined ahead of the
70
+ * owner+actor cutover — call sites (durables, member/acl keys, grants) arrive with the flip. */
71
+ export declare function principalKey(owner: string, actor: string): {
72
+ key: string;
73
+ name: string;
74
+ };
75
+ /** Principal key form for subjects and KV keys. Alias for callers/tests that need one form explicitly. */
53
76
  export declare function principalSubjectKey(owner: string, actor: string): string;
54
- /** Principal key form for JetStream names (durables/consumers/streams): `.` is illegal there, so `-` is
55
- * the reserved separator and is banned inside each owner/actor token by {@link assertValidOwnerToken}. */
77
+ /** Principal key form for JetStream names. Alias for callers/tests that need one form explicitly. */
56
78
  export declare function principalNameKey(owner: string, actor: string): string;
79
+ /** Inverse of {@link principalKey}'s dot-form `key`: split a principal `<owner>.<actor>` back into its
80
+ * two tokens, or `null` if it isn't a valid one. Owner/actor tokens are `[A-Za-z0-9_]+` (dot-free), so a
81
+ * single `.` separates them unambiguously — exactly two segments, both {@link assertValidOwnerToken}-valid.
82
+ * Used where a stored principal (a member/from.id dot-form) must be re-split to feed the owner+actor
83
+ * subject builders (e.g. fan-out → `dinboxSubject`). */
84
+ /** Resolve a deprovision target: a full principal dot-form (`u_….<actor>`, user-mode agents) or a
85
+ * bare static/dev actor id (an nkey pub — never contains a dot), keyed under {@link DEV_OWNER}.
86
+ * Shared by the deprovisioner permission pin and the teardown helper so they can't diverge. */
87
+ export declare function deprovisionTargetPrincipal(target: string): {
88
+ owner: string;
89
+ actor: string;
90
+ };
91
+ export declare function parsePrincipalKey(key: string): {
92
+ owner: string;
93
+ actor: string;
94
+ } | null;
95
+ /** Validate a connection's **connId** — the single token that fills `_INBOX_<connId>.>`, the private
96
+ * reply-inbox grant. In dev/static mode connId is the agent's own nkey (56 uppercase base32 chars); in
97
+ * user mode it is a client-CHOSEN random inbox nonce (the auth callout can't know the NATS-minted
98
+ * per-connection nkey pre-connect, and the client can't either, so the client picks its own nonce and
99
+ * passes it via the connection `name`). Because that nonce is untrusted client input, the grant builder
100
+ * MUST reject any subject metacharacter here: a connId of `>` would mint `_INBOX_>.>` (every inbox) and a
101
+ * `*`/`.` would widen it too. `[A-Za-z0-9_-]{8,120}` admits nkeys and high-entropy nonces while barring
102
+ * `* > . space` — so `_INBOX_<connId>.>` can never escalate past one connection's own inbox. Fail-loud. */
103
+ export declare function assertInboxConnId(connId: string): string;
104
+ /** The `tags` prefix carrying a connection's principal dot-form in its minted user JWT. CONNZ
105
+ * surfaces a JWT-authed connection's principal identity DIFFERENTLY by cred shape, proven live on
106
+ * nats-server 2.10/2.14 (see {@link principalFromConnz}): a STATICALLY-minted user (`mintCreds`)
107
+ * surfaces this `principal:` tag (`authorized_user` is the ephemeral connection nkey), while a
108
+ * CALLOUT-minted user surfaces the JWT `name` (the principal NAME-form) as `authorized_user` and NO
109
+ * tags at all. So this tag is the attribution field for STATIC connections only; callout connections
110
+ * are attributed via `authorized_user`. NEVER reintroduce a tags-ONLY read — it silently misses every
111
+ * user-mode connection. Always attribute through {@link principalFromConnz}, which handles both. */
112
+ export declare const PRINCIPAL_TAG_PREFIX = "principal:";
113
+ /** The identity `tags` stamped into every minted user JWT (dev mint AND the auth callout, via this one
114
+ * helper) — recoverable from a STATIC connection's CONNZ record (a callout connection surfaces the
115
+ * principal via `authorized_user` instead; see {@link PRINCIPAL_TAG_PREFIX}). `owner:`/`actor:` are
116
+ * human/debug breadcrumbs; `principal:` (the dot-form {@link principalKey} `key`) is the one attribution
117
+ * reads. Single source of the tag format — never hand-join these elsewhere. */
118
+ export declare function principalTags(owner: string, actor: string): string[];
119
+ /** Recover a connection's principal dot-form from its CONNZ `tags`, or `null` if absent/malformed. The
120
+ * membership feed calls this to key a live connection by its principal and **fails closed** on `null`
121
+ * (it drops the connection rather than fall back to the ephemeral nkey — a tagless connection is not a
122
+ * principal we can attribute). Validates via {@link parsePrincipalKey} so a forged/garbled tag can't
123
+ * smuggle a non-principal string into the feed. */
124
+ export declare function principalFromTags(tags: readonly string[] | undefined): string | null;
125
+ /** Inverse of {@link principalKey}'s `name` form (`<owner>-<actor>`): recover the principal dot-form
126
+ * from a name-form string, or `null` if it isn't one. Owner tokens are `[A-Za-z0-9_]+` and actor
127
+ * tokens too — `-` is reserved as the name-form separator — so the FIRST `-` splits owner from actor
128
+ * unambiguously, and both halves must be {@link parsePrincipalKey}-valid with a real principal owner.
129
+ * An nkey (no `-`) or any other non-name-form returns null. */
130
+ export declare function principalFromName(name: string | undefined): string | null;
131
+ /** Recover a connection's principal dot-form from a `$SYS` CONNZ record, across BOTH credential
132
+ * shapes — the one place that knows nats-server surfaces principal identity differently for each:
133
+ * - a STATICALLY-minted user (`mintCreds`) surfaces its `principal:` TAG (`authorized_user` is the
134
+ * ephemeral connection nkey);
135
+ * - a CALLOUT-minted user surfaces the JWT `name` (the principal NAME-form) as `authorized_user`,
136
+ * and does NOT surface `tags` at all (proven live on nats-server 2.10.22 + 2.14.2).
137
+ * So attribution must try the tag first, then the `authorized_user` name-form; anything else (an
138
+ * un-tagged nkey, open mode, infra) is `null` — unattributable, dropped fail-closed by callers.
139
+ * The membership feed and live eviction both key on this, so it lives here as the single source. */
140
+ export declare function principalFromConnz(conn: {
141
+ tags?: readonly string[];
142
+ authorized_user?: string;
143
+ }): string | null;
144
+ /** The reserved owner token for the **no-login local/dev path** — the static-creds default when there
145
+ * is no user identity (the plan's zero-login local default). A valid {@link assertValidOwnerToken}
146
+ * token, and — being lowercase-alpha with no `u_` prefix — trivially distinct from both nkeys and
147
+ * {@link assertDerivedOwnerToken} `u_…` owners, so a dev agent can never collide with a real owner
148
+ * lane. In dev the actor is the connection id, so `local.<id>` is the agent's principal. */
149
+ export declare const DEV_OWNER = "local";
150
+ /** Prefix of every **derived owner token** — see {@link assertDerivedOwnerToken}. */
151
+ export declare const DERIVED_OWNER_PREFIX = "u_";
152
+ /** Validate the structural format of a **derived owner token** — the opaque, per-space, non-PII
153
+ * token the auth callout derives server-side for a human owner: `u_` + 26 lowercase base32
154
+ * (`[a-z2-7]`) chars (128 keyed-HMAC bits; the derivation lives in `@cotal-ai/auth`, this is the
155
+ * format contract). The format is **structurally disjoint from nkeys by construction** — the
156
+ * owner+actor flip's acceptance criterion 2: an nkey public key is 56 chars of UPPERCASE base32
157
+ * (`[A-Z2-7]`), while a derived token is 28 chars, contains `_`, and its body is lowercase — three
158
+ * independent properties an nkey can never satisfy. So a pre-flip agent id (an nkey) can NEVER
159
+ * parse as a valid new owner, which closes the old-shape-aliases-new-read lane
160
+ * (`chat.<nkey>.team.backend` matching `chat.*.*.backend` cannot yield a plausible owner). Every
161
+ * derived token also trivially passes {@link assertValidOwnerToken} (subset alphabet, no `-`).
162
+ * Defined ahead of use: enforced at the callout/mint boundary when the cutover lands. Returns the
163
+ * token unchanged when valid so callers can use it inline. */
164
+ export declare function assertDerivedOwnerToken(owner: string): string;
165
+ /** Validate an owner token at a READ / persisted-owner TRUST boundary — STRICTER than
166
+ * {@link assertValidOwnerToken}, which (by design) still accepts nkey-shaped uppercase tokens and so does
167
+ * NOT by itself satisfy the flip's acceptance criterion 2. A *real* owner is EITHER a derived owner
168
+ * ({@link assertDerivedOwnerToken}: `u_` + 26 lowercase base32, minted at the callout) OR — when
169
+ * `allowLocal` — the reserved no-login dev owner {@link DEV_OWNER} (`"local"`). An nkey (56-char UPPERCASE
170
+ * base32) satisfies neither, so a stray old-shape frame `chat.<nkey>.team.backend` can never be TRUSTED as
171
+ * a valid owner even if it structurally parses — the belt to the from.id≠sender guard's braces and cred
172
+ * death. Use at every boundary that reads an owner from a wire subject / persisted key and then trusts it
173
+ * for keying, surfacing, or authorization (membership feed re-key, history surfacing). Actors stay on
174
+ * {@link assertValidOwnerToken} — they are server-derived from the ledger, not disjointness-constrained.
175
+ * User-mode MINT boundaries (callout/bridge) use {@link assertDerivedOwnerToken} directly (no `local`). */
176
+ export declare function assertPrincipalOwnerToken(owner: string, opts?: {
177
+ allowLocal?: boolean;
178
+ }): string;
179
+ /** Non-throwing {@link assertPrincipalOwnerToken} for hot per-message drop guards — true iff `owner` is a
180
+ * real principal owner (a derived `u_…`, or `local` when `allowLocal`). The message-surfacing paths call
181
+ * this on `parsed.owner` alongside the `from.id === parsed.sender` check, so a structurally-valid old-shape
182
+ * alias (`chat.<nkey>.team.backend`, owner = an nkey) is DROPPED at read time — belt to cred death, not a
183
+ * dependency on it. `allowLocal` defaults true: the dev/static path is a legitimate live sender. */
184
+ export declare function isPrincipalOwnerToken(owner: string, opts?: {
185
+ allowLocal?: boolean;
186
+ }): boolean;
57
187
  /** Is `channel` within a read/post ACL `allow` (a list of channel patterns)? True when some
58
188
  * entry covers it — exact, or a wildcard subtree (`team.>` covers `team.backend`). Channels are
59
189
  * dotted token strings, so this rides {@link subjectMatches}. The single covering rule shared by
60
190
  * the load-time invariant (`subscribe ⊆ allowSubscribe`), the connector subset check, and the
61
191
  * manager's mediated-join validation (`channel ∈ allowSubscribe`) so they can't drift. */
62
192
  export declare function channelInAllow(allow: string[], channel: string): boolean;
193
+ /** Does policy pattern `cap` COVER policy pattern `pattern` — i.e. is every channel matched by
194
+ * `pattern` also matched by `cap`? Both sides use the {@link assertValidChannel} grammar
195
+ * (`*` = one token, `>` = one-or-more trailing). This is the DELEGATION primitive
196
+ * ({@link patternInAllow}): where {@link channelInAllow} asks "is this concrete channel readable
197
+ * under this ACL", this asks "is this ACL *entry* grantable under this ACL" — pattern vs pattern,
198
+ * so `review.>` is within `review.>` but exceeds `review.pua`. */
199
+ export declare function patternCovers(cap: string, pattern: string): boolean;
200
+ /** Is ACL entry `pattern` within capability list `allow` — covered by SOME single entry? A union of
201
+ * entries is deliberately NOT considered (`[a.b, a.c]` does not admit `a.*`): per-entry containment
202
+ * is conservative — it can refuse a technically-covered pattern, never admit an uncovered one —
203
+ * and keeps the refusal explainable ("name the entry that covers it, or widen the grant"). */
204
+ export declare function patternInAllow(allow: string[], pattern: string): boolean;
63
205
  /** Drop exact duplicates and any subject subsumed by a more-general one — JetStream
64
206
  * rejects a consumer whose `filter_subjects` overlap, so `[team.>, team.backend]`
65
207
  * must collapse to `[team.>]` before binding the chat consumer. A parent and its subtree
66
208
  * (`[review, review.>]`) are disjoint in NATS (`review.>` never matches bare `review`), so
67
209
  * both are kept — that's how a peer subscribes to a channel *and* everything under it. */
68
210
  export declare function collapseFilterSubjects(subjects: string[]): string[];
69
- /** Unicast: a specific instance's inbox, tagged with the sender. (Either position may be
70
- * `*` for subscribe/allow rules: `inst.<myId>.*` to receive, `inst.*.<myId>` to send as me.) */
71
- export declare function unicastSubject(space: string, target: string, sender: string): string;
72
- /** Anycast: a service (role), tagged with the sender. Subscribers join a queue group so one instance receives. */
73
- export declare function anycastSubject(space: string, service: string, sender: string): string;
74
- /** Control request/reply to a service (e.g. the manager), tagged with the sender; anycast via queue group. */
75
- export declare function controlServiceSubject(space: string, service: string, sender: string): string;
211
+ /** Unicast: `inst.<recipOwner>.<recipActor>.<sndOwner>.<sndActor>` the recipient principal, then the
212
+ * sender principal (owner+actor grammar). The 4-token form is deliberate: it lets a native publish grant
213
+ * forge-lock the sender suffix (`inst.*.*.<myOwner>.<myActor>`), so the daemon needn't re-verify a
214
+ * payload sender claim. Any slot may be `*` for allow rules (`inst.*.*.<o>.<a>` to send as me;
215
+ * {@link unicastRecvFilter} for the receive side). */
216
+ export declare function unicastSubject(space: string, recipOwner: string, recipActor: string, sndOwner: string, sndActor: string): string;
217
+ /** The receive-side DM filter/grant for a recipient principal: `inst.<owner>.<actor>.>` — every DM
218
+ * addressed to me, from any sender. (The send side is the 4-token {@link unicastSubject}.) */
219
+ export declare function unicastRecvFilter(space: string, owner: string, actor: string): string;
220
+ /** Anycast: `svc.<service>.<owner>.<actor>` — a service (role), tagged with the sender principal.
221
+ * Subscribers join a queue group so one instance receives. Identity slots accept `*`. */
222
+ export declare function anycastSubject(space: string, service: string, owner: string, actor: string): string;
223
+ /** The serve-side TASK filter/grant for a role: `svc.<role>.>` — every anycast to the role, from any
224
+ * sender principal (the sender slot widened from one token to two, so the tail is `.>`). */
225
+ export declare function anycastServeFilter(space: string, service: string): string;
226
+ /** Control request/reply to a service (e.g. the manager): `ctl.<service>.<owner>.<actor>` — tagged with
227
+ * the caller principal; anycast via queue group. Identity slots accept `*` (serve side: `ctl.<tier>.*.*`). */
228
+ export declare function controlServiceSubject(space: string, service: string, owner: string, actor: string): string;
76
229
  /** Control-plane service names — the three-tier split (P2a). The manager subscribes to ALL
77
230
  * three; the cred layer grants {@link CONTROL_SELF_SERVICE} to every agent and
78
231
  * {@link CONTROL_PRIVILEGED} only to spawn-capable agents (default-deny otherwise), while
@@ -94,6 +247,13 @@ export declare const CONTROL_ADMIN: "admin";
94
247
  * agent (only the allow-all manager could reply into the per-id `_INBOX_<id>` prefix). Lifecycle ops
95
248
  * (spawn/stop/despawn) stay on the manager's tiers; durable membership is the daemon's. */
96
249
  export declare const CONTROL_DELIVERY: "delivery";
250
+ /** The delivery daemon's PRIVILEGED admin rail (the D5 rail-split): control-plane ops the daemon
251
+ * EXECUTES for the mesh's renewal/repair owner — credential reload (`reloadCreds`, the class-2
252
+ * standing-renewal adoption step) now; the live-eviction executor rides here next. Cred-enforced
253
+ * caller set: only the manager's `supervisor` profile holds the request-publish grant (every agent
254
+ * cred is default-denied — nats-server is the boundary, same pattern as {@link CONTROL_ADMIN});
255
+ * the `delivery` cred holds the serve + bounded-reply side. */
256
+ export declare const CONTROL_DELIVERY_ADMIN: "delivery-admin";
97
257
  /** The three control-plane tiers the manager serves — values tie to the `CONTROL_*` service
98
258
  * names so handler routing can't drift from the subject names. */
99
259
  export type ControlTier = typeof CONTROL_PRIVILEGED | typeof CONTROL_SELF_SERVICE | typeof CONTROL_ADMIN;
@@ -106,23 +266,30 @@ export declare function spaceWildcard(space: string): string;
106
266
  export declare function chatWildcard(space: string): string;
107
267
  /** The three peer-message delivery modes (control/trace/presence are not deliveries). */
108
268
  export type DeliveryMode = "chat" | "anycast" | "unicast";
109
- /** A subject parsed into its routing parts. `sender` is the publishing agent's id;
110
- * `rest` is the channel (chat) or the routed target/role/service (inst/svc/ctl). */
269
+ /** A subject parsed into its routing parts (owner+actor grammar, Shape A). `owner`/`actor` are the
270
+ * publishing principal's two tokens; `sender` is their canonical dot-form `<owner>.<actor>` (=
271
+ * {@link principalKey}`.key`), so guards that compare `msg.from.id === parsed.sender` keep working
272
+ * verbatim once `from.id` carries the principal dot-form. `rest` is the channel (chat) or the routed
273
+ * target/role/service (inst → recipient principal dot-form; svc → role; ctl → service). */
111
274
  export interface ParsedSubject {
112
275
  kind: "chat" | "inst" | "svc" | "ctl";
276
+ owner: string;
277
+ actor: string;
278
+ /** The sender principal in canonical dot-form `<owner>.<actor>`. */
113
279
  sender: string;
114
- /** chat → channel (possibly hierarchical); inst → target; svc → role; ctl → service. */
280
+ /** chat → channel (possibly hierarchical); inst → recipient principal `<owner>.<actor>`; svc → role; ctl → service. */
115
281
  rest: string;
116
282
  }
117
283
  /**
118
- * The single authority on the subject layout — every reader of a wire subject goes
119
- * through this, so the sender-position asymmetry lives in exactly one place:
120
- * chat.<sender>.<channel…> sender at [3], channel is everything after
121
- * inst.<target>.<sender> sender at [4]
122
- * svc.<role>.<sender> sender at [4]
123
- * ctl.<service>.<sender> sender at [4]
124
- * Validates the prefix and per-kind shape first and returns `null` on anything else,
125
- * so a malformed subject can never be read as if it carried a sender.
284
+ * The single authority on the subject layout — every reader of a wire subject goes through this, so the
285
+ * owner+actor sender positions live in exactly one place (`kind` stays at [2]):
286
+ * chat.<owner>.<actor>.<channel…> sender owner[3] actor[4], channel is everything after
287
+ * inst.<recipOwner>.<recipActor>.<sndOwner>.<sndActor> sender owner[5] actor[6], recipient = [3].[4]
288
+ * svc.<role>.<owner>.<actor> sender owner[4] actor[5], role = [3]
289
+ * ctl.<service>.<owner>.<actor> sender owner[4] actor[5], service = [3]
290
+ * Validates the prefix and per-kind arity first and returns `null` on anything else, so a malformed
291
+ * subject can never be read as if it carried a principal. This SPLITS ONLY (no owner-token validation)
292
+ * — the broker already forge-locked the identity slots via the minted grant; a reader recovers them.
126
293
  */
127
294
  export declare function parseSubject(subject: string): ParsedSubject | null;
128
295
  /**
@@ -144,17 +311,19 @@ export declare const CHANNEL_DEFAULTS_KEY = "=defaults";
144
311
  * owner) under {@link memberKey}; the source of truth for `channelMembers()` and the fan-out's
145
312
  * member list, moved off JetStream consumer topology (which core-sub joins don't create). */
146
313
  export declare function membersBucket(space: string): string;
147
- /** KV key for one membership record: `<channel>/<owner>`. The channel is concrete (no `*`/`>`,
148
- * validated at the write path) so it is dotted-but-`/`-free, and an owner id is an nkey
149
- * (`[A-Z0-9]`, also `/`-free), so the single `/` separates them unambiguously — both halves
150
- * recover via {@link parseMemberKey}. `/`, `.`, and `[A-Za-z0-9_-]` are all legal KV-key chars
151
- * (`/^[-/=.\w]+$/`), so no encoding is needed. */
152
- export declare function memberKey(channel: string, owner: string): string;
153
- /** Inverse of {@link memberKey}: split a member key back into `{ channel, owner }`, or `null` if
154
- * it isn't one (no `/`). Splits on the single separator channels and owner ids are both `/`-free. */
314
+ /** KV key for one membership record: `<channel>/<principal>`, where `principal` is the member's
315
+ * owner+actor dot-form (`<owner>.<actor>` = {@link principalKey}`.key`) membership is per-agent
316
+ * (owner+actor), not per-owner-shared. The channel is concrete (no `*`/`>`, validated at the write
317
+ * path) so it is dotted-but-`/`-free, and a principal dot-form is `[A-Za-z0-9_.]` (also `/`-free), so
318
+ * the single `/` separates them unambiguously — both halves recover via {@link parseMemberKey}. `/`,
319
+ * `.`, and `[A-Za-z0-9_]` are all legal KV-key chars (`/^[-/=.\w]+$/`), so no encoding is needed. */
320
+ export declare function memberKey(channel: string, principal: string): string;
321
+ /** Inverse of {@link memberKey}: split a member key back into `{ channel, principal }`, or `null` if
322
+ * it isn't one (no `/`). Splits on the single separator — channels and principal dot-forms are both
323
+ * `/`-free (the `.` inside a principal is not a `/`). */
155
324
  export declare function parseMemberKey(key: string): {
156
325
  channel: string;
157
- owner: string;
326
+ principal: string;
158
327
  } | null;
159
328
  /** Name of the KV bucket holding the durable read-ACL registry (Plane-3) for a space — a
160
329
  * privileged-write sibling of the members/channels buckets. One record per OWNER (key = owner id),
@@ -163,18 +332,23 @@ export declare function parseMemberKey(key: string): {
163
332
  * stateless, server-side daemon re-reads it on boot (fixes the restart-fragility nak-loop). It is
164
333
  * ALSO what the daemon validates a runtime durable-join against (channel ∈ the owner's ACL). */
165
334
  export declare function aclBucket(space: string): string;
166
- /** KV key for one owner's read-ACL record: the owner id (an nkey — `[A-Z0-9]`, `/`-free, a `token()`
167
- * no-op; keyed like presence, which uses the bare id). */
168
- export declare function aclKey(owner: string): string;
335
+ /** KV key for one principal's read-ACL record: the member's owner+actor dot-form (`<owner>.<actor>` =
336
+ * {@link principalKey}`.key`) the read ACL is per-agent (owner+actor), like membership. The dot-form
337
+ * is a legal KV key (`/^[-/=.\w]+$/`); pass it through UNCHANGED — do NOT run it through `token()`,
338
+ * which rewrites `.`→`_` and would alias distinct principals onto one key. */
339
+ export declare function aclKey(principal: string): string;
169
340
  /** Name of the KV bucket holding the derived channel-membership feed for a space (data-account, derived
170
341
  * from CONNZ ∪ the members registry). One entry per AGENT (key = the agent nkey / `card.id`); value is a
171
342
  * {@link import("./types.js").ChannelMembership}. Per-agent keying (not per-channel) keeps keys dot-free
172
343
  * and each value tiny — cap-safe under `max_payload`. Privileged-write (the `membership-rw` cred), read
173
344
  * by the admin/observer dashboard only (exposing the silent-reader set is a trust shift). */
174
345
  export declare function membershipBucket(space: string): string;
175
- /** KV key for one agent's membership record: the agent id (an nkey — `[A-Z0-9]`, dot-free, a `token()`
176
- * no-op; keyed like presence/acl, which use the bare id). */
177
- export declare function membershipKey(id: string): string;
346
+ /** KV key for one agent's membership-feed record: the agent's owner+actor dot-form (`<owner>.<actor>` =
347
+ * {@link principalKey}`.key`) one record per agent (owner+actor), keyed like acl/members. Pass the
348
+ * dot-form through UNCHANGED — do NOT run it through `token()` (which rewrites `.`→`_` and would alias
349
+ * distinct principals). Both feed sources (the CONNZ live side and the durable members side) must
350
+ * resolve to this same dot-form so the union does not double-key one agent. */
351
+ export declare function membershipKey(principal: string): string;
178
352
  /** Reserved membership-bucket key for the feed's freshness heartbeat — the daemon re-stamps it every
179
353
  * successful poll (even when no membership changed), so the dashboard can tell "feed is live" from "feed
180
354
  * is stale/dead" WITHOUT the per-agent diff-before-put suppressing the signal. `=` is a valid KV-key char
@@ -197,18 +371,28 @@ export declare function connzRequestSubject(accountId: string): string;
197
371
  * account id, never `$SYS.ACCOUNT.*` (every tenant's events the moment two spaces share a broker). */
198
372
  export declare function accountConnectSubject(accountId: string): string;
199
373
  export declare function accountDisconnectSubject(accountId: string): string;
374
+ /** The per-server client-KICK request subject (`$SYS.REQ.SERVER.<serverID>.KICK`, nats-server
375
+ * `events.go` `clientKickReqSubj`). Payload `{cid}` → the server disconnects that live client by
376
+ * connection id. PER-SERVER: `serverID` MUST come from the SAME CONNZ reply that yielded the cid
377
+ * (KICK is not fan-out; a cid is only meaningful on its own server). System-account only. There is
378
+ * no per-cid success ack — the caller re-scans CONNZ to confirm the connection is gone. This is the
379
+ * kill-live half of revocation; it is ALWAYS paired with a deny-new (ledger revoke / cred expiry /
380
+ * signer strip / ACL removal), since a kicked client reconnects with a fresh cid until its cred dies. */
381
+ export declare function serverKickSubject(serverId: string): string;
200
382
  /** Extract the channel pattern from a live chat SUBSCRIPTION subject in this space, or `null` if it
201
- * isn't one. A subscription's sender slot is `*` (an agent's `sub.allow` is `chat.*.<channel>`), so the
202
- * channel portion (wildcards preserved, e.g. `team.>`) is everything after. This is the ALLOWLIST the
203
- * membership daemon uses to turn a connection's subscription list into its channel-subscription set —
204
- * matched against the chat grammar (not a denylist of known plumbing, which rots when a new plumbing
205
- * subject is added). Drops `_INBOX`, JetStream API, other-space, and non-chat subjects. The whole-chat
206
- * god-view (`chat.*.>` → rest `">"`) IS returned here; the caller excludes such taps separately.
383
+ * isn't one. A subscription's sender slots are `*` (an agent's `sub.allow` is `chat.*.*.<channel>`), so
384
+ * the channel portion (wildcards preserved, e.g. `team.>`) is everything after the two identity tokens.
385
+ * This is the ALLOWLIST the membership daemon uses to turn a connection's subscription list into its
386
+ * channel-subscription set — matched against the chat grammar (not a denylist of known plumbing, which
387
+ * rots when a new plumbing subject is added). Drops `_INBOX`, JetStream API, other-space, and non-chat
388
+ * subjects. The whole-chat god-view (`chat.*.*.>` → rest `">"`) IS returned here; the SHORT-wildcard
389
+ * taps (`chat.>`, `chat.*.>`) fail the ≥6-token arity and return `null` — the caller's god-tap detector
390
+ * must surface those as reads-all separately (a length-checking parse must not let them vanish).
207
391
  *
208
392
  * COUPLING (mitnick): both this extraction AND the membership daemon's god-tap detection ride
209
- * {@link parseSubject}'s sender-at-[3] chat layout. The deferred read-containment grammar reorder
210
- * (sender out of the subject) would move where the channel portion begins and silently break both —
211
- * revisit this + the daemon's exclusion (and their tests) if that grammar ships. */
393
+ * {@link parseSubject}'s owner+actor chat layout (channel after [4]). A future grammar reorder would move
394
+ * where the channel portion begins and silently break both — revisit this + the daemon's exclusion
395
+ * (and their tests) together. */
212
396
  export declare function channelFromChatSubscription(space: string, subject: string): string | null;
213
397
  /** Name of the KV bucket holding the delivery daemon's single-flight lease + readiness signal for a
214
398
  * space. One key per shard ({@link leaseKey}); writable only by the `delivery` cred, world-readable
@@ -243,16 +427,23 @@ export declare function taskStream(space: string): string;
243
427
  export declare function inboxStream(space: string): string;
244
428
  /** Stream capturing `dlv.>` — the per-member post-auth delivery store (agent binds + acks). */
245
429
  export declare function dlvStream(space: string): string;
246
- /** Subject of an owner's mixed durable inbox: `cotal.<space>.dinbox.<owner>` (one per owner). */
247
- export declare function dinboxSubject(space: string, owner: string): string;
248
- /** Subject of an owner's post-auth delivery: `cotal.<space>.dlv.<owner>` (one per owner). */
249
- export declare function dlvSubject(space: string, owner: string): string;
250
- /** Parse the owner id out of an owner's mixed-inbox subject `cotal.<space>.dinbox.<owner>`, or null.
251
- * The trusted reader is a SINGLE consumer over `dinbox.>` (all owners), so it recovers the per-message
252
- * owner from the subject (the routing token is `routeToken(owner)` an nkey, a `token()` no-op). */
253
- export declare function parseDinboxOwner(subject: string): string | null;
254
- /** An agent's bind-only per-owner consumer on {@link dlvStream} (filter `dlv.<owner>`). */
255
- export declare function dlvDurable(owner: string): string;
430
+ /** Subject of a principal's mixed durable inbox: `cotal.<space>.dinbox.<owner>.<actor>` (one per agent
431
+ * the fan-out delivers a per-member copy, and a member is a principal). Either identity slot accepts `*`
432
+ * for the daemon's fan-out write grant (`dinbox.*.*`). */
433
+ export declare function dinboxSubject(space: string, owner: string, actor: string): string;
434
+ /** Subject of a principal's post-auth delivery: `cotal.<space>.dlv.<owner>.<actor>` (one per agent). */
435
+ export declare function dlvSubject(space: string, owner: string, actor: string): string;
436
+ /** Parse the principal out of a mixed-inbox subject `cotal.<space>.dinbox.<owner>.<actor>`, or null.
437
+ * The trusted reader is a SINGLE consumer over `dinbox.>` (all principals), so it recovers the
438
+ * per-message owner+actor from the subject (split only the broker forge-locked the slots at write). */
439
+ export declare function parseDinboxPrincipal(subject: string): {
440
+ owner: string;
441
+ actor: string;
442
+ } | null;
443
+ /** An agent's bind-only per-member consumer on {@link dlvStream} (filter `dlv.<owner>.<actor>`). The
444
+ * durable NAME is the principal's JetStream-safe dash-form (`dlv_<owner>-<actor>`) — a `.` is illegal
445
+ * in a durable name, so this uses {@link principalKey}`.name`, never the dot-form. */
446
+ export declare function dlvDurable(owner: string, actor: string): string;
256
447
  /** The single privileged fan-out consumer on the CHAT stream (delivery-daemon-pumped; routing, not
257
448
  * auth). N=1 keeps this exact name (see {@link fanoutDurable}). */
258
449
  export declare const FANOUT_DURABLE: "fanout";
@@ -268,15 +459,16 @@ export declare function fanoutDurable(shard?: number, shards?: number): string;
268
459
  export declare function readerDurable(shard?: number, shards?: number): string;
269
460
  /** Name of the REMOVED per-instance chat live-tail durable. Retained only as the canonical name the
270
461
  * read-ACL conformance test asserts an agent can NOT create — it has no live callers, the live read is
271
- * now a native core subscription. */
272
- export declare function chatDurable(instance: string): string;
273
- /** Consumer name for an instance's short-lived chat **history** reads (join-backfill, focus-recall,
274
- * drop-marker). A single per-instance name, scoped to the agent's own id so its create/info/fetch/
275
- * delete grants name-scope to that id a peer can never bind it — while the per-read single
276
- * `filter_subject` is what the create-time ACL pins to `allowSubscribe`. */
277
- export declare function chatHistDurable(instance: string): string;
278
- /** Durable consumer name for an instance's private DM inbox. */
279
- export declare function dmDurable(instance: string): string;
462
+ * now a native core subscription. Principal name-form (`chat_<owner>-<actor>`) for namespace consistency. */
463
+ export declare function chatDurable(owner: string, actor: string): string;
464
+ /** Consumer name for an agent's short-lived chat **history** reads (join-backfill, focus-recall,
465
+ * drop-marker). A single per-agent name in the principal's JetStream-safe dash-form
466
+ * (`chathist_<owner>-<actor>`) so its create/info/fetch/delete grants name-scope to that principal
467
+ * a peer can never bind it — while the per-read single `filter_subject` is what the create-time ACL
468
+ * pins to `allowSubscribe`. */
469
+ export declare function chatHistDurable(owner: string, actor: string): string;
470
+ /** Durable consumer name for an agent's private DM inbox — the principal's dash-form (`dm_<owner>-<actor>`). */
471
+ export declare function dmDurable(owner: string, actor: string): string;
280
472
  /** Durable consumer name (shared across instances of a role) for the task queue. */
281
473
  export declare function taskDurable(service: string): string;
282
474
  //# sourceMappingURL=subjects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subjects.d.ts","sourceRoot":"","sources":["../src/subjects.ts"],"names":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