@cotal-ai/cli 0.136.8 → 0.138.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.
- package/dist/chat/chat-view.d.ts +1 -1
- package/dist/chat/chat-view.d.ts.map +1 -1
- package/dist/chat/controller.d.ts +1 -1
- package/dist/chat/controller.d.ts.map +1 -1
- package/dist/chat/frontend.d.ts +1 -1
- package/dist/chat/frontend.d.ts.map +1 -1
- package/dist/chat/picker.d.ts +1 -1
- package/dist/chat/picker.d.ts.map +1 -1
- package/dist/chat/plain.d.ts +1 -1
- package/dist/chat/plain.d.ts.map +1 -1
- package/dist/chat/stdio-io.d.ts +1 -1
- package/dist/chat/stdio-io.d.ts.map +1 -1
- package/dist/chat/stdio.d.ts +1 -1
- package/dist/chat/stdio.d.ts.map +1 -1
- package/dist/chat/view.d.ts +1 -1
- package/dist/chat/view.d.ts.map +1 -1
- package/dist/commands/agents.d.ts +7 -149
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +15 -723
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/channels.js +1 -1
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat.d.ts +1 -24
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +3 -15
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +6 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/console/app.js +1 -1
- package/dist/console/app.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/dist/chat/engine.d.ts +0 -111
- package/dist/chat/engine.d.ts.map +0 -1
- package/dist/chat/engine.js +0 -225
- package/dist/chat/engine.js.map +0 -1
- package/dist/chat/native-session.d.ts +0 -120
- package/dist/chat/native-session.d.ts.map +0 -1
- package/dist/chat/native-session.js +0 -487
- package/dist/chat/native-session.js.map +0 -1
- package/dist/chat/open-session.d.ts +0 -9
- package/dist/chat/open-session.d.ts.map +0 -1
- package/dist/chat/open-session.js +0 -120
- package/dist/chat/open-session.js.map +0 -1
- package/dist/chat/session.d.ts +0 -230
- package/dist/chat/session.d.ts.map +0 -1
- package/dist/chat/session.js +0 -2
- package/dist/chat/session.js.map +0 -1
- package/dist/chat/static-session.d.ts +0 -62
- package/dist/chat/static-session.d.ts.map +0 -1
- package/dist/chat/static-session.js +0 -236
- package/dist/chat/static-session.js.map +0 -1
- package/dist/chat/user-session.d.ts +0 -22
- package/dist/chat/user-session.d.ts.map +0 -1
- package/dist/chat/user-session.js +0 -180
- package/dist/chat/user-session.js.map +0 -1
- package/dist/lib/attach-client.d.ts +0 -112
- package/dist/lib/attach-client.d.ts.map +0 -1
- package/dist/lib/attach-client.js +0 -528
- package/dist/lib/attach-client.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The native engine adapter: implements {@link AdmittedChatSession} over ONE real `CotalEndpoint`
|
|
3
|
-
* that a reviewed admission adapter constructed under the session's own identity. The adapter owns
|
|
4
|
-
* start; listeners may be installed before it starts. This module never constructs, admits, mints or starts an endpoint, and never reads a
|
|
5
|
-
* credential. No connector-core. The three client behaviours core lacks live in `engine.ts`.
|
|
6
|
-
*
|
|
7
|
-
* Classification rules (native error -> session outcome):
|
|
8
|
-
* - `isPublishPermissionDenied` (broker publish refusal) -> refused PERMISSION_DENIED
|
|
9
|
-
* - `EpEnvelopeError` with `outcome: "not-executed"` or a
|
|
10
|
-
* pre-effect code (bad-request, permission-denied, …) -> refused, native code kept
|
|
11
|
-
* - `EpEnvelopeError` with `outcome: "unknown"`, timeouts, and
|
|
12
|
-
* anything else thrown after a publish or request was issued -> unknown (never retried)
|
|
13
|
-
* - local validation thrown before any I/O -> refused USAGE_INVALID
|
|
14
|
-
* - a send, join or channel mode outside the session's grant -> refused PERMISSION_DENIED,
|
|
15
|
-
* before any I/O ({@link grantRefusal})
|
|
16
|
-
* A denial is never turned into an empty `ok`.
|
|
17
|
-
*/
|
|
18
|
-
import { type CotalEndpoint, type Presence, type PresenceView } from "@cotal-ai/core";
|
|
19
|
-
import { ParticipantEngine } from "./engine.js";
|
|
20
|
-
import type { AdmittedChatSession, ChannelInfo, CloseReport, ConnectionReport, DmTarget, HistoryPage, PublishResult, Refused, Result, RosterView, SessionEvent, SessionIdentity, SessionMessage } from "./session.js";
|
|
21
|
-
/**
|
|
22
|
-
* Refuse a channel outside the session's read or post grant before any effect, so the broker's
|
|
23
|
-
* refusal and its subject never reach the caller. A session opened on no channel holds no grant,
|
|
24
|
-
* and the refusal names `reopen`'s command, which opens one that does. The broker remains the
|
|
25
|
-
* enforcement point.
|
|
26
|
-
*/
|
|
27
|
-
export declare function grantRefusal(grant: readonly string[], channel: string, use: "read" | "post", reopen: (channel: string) => string): Refused | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Resolve a DM target before any effect. A `{ principal }` target, or a typed string that parses as
|
|
30
|
-
* a principal `<owner>.<actor>`, goes to that principal as is, whether or not it is present or was
|
|
31
|
-
* heard from. It is never matched against display names, so a peer whose display name spells a
|
|
32
|
-
* principal cannot capture it; that peer is reached by its own principal or `/reply`. Any other
|
|
33
|
-
* string is a display name, which must name one principal across the roster and the heard senders:
|
|
34
|
-
* a name both carry refuses and lists them instead of picking the present one. Absence is a verdict
|
|
35
|
-
* only on a current roster (endpoint.ts:2816-2823).
|
|
36
|
-
*/
|
|
37
|
-
export declare function resolveDmTarget(to: DmTarget, roster: readonly Presence[], rosterState: PresenceView["state"], engine: ParticipantEngine, selfPrincipal: string, selfName?: string): {
|
|
38
|
-
readonly id: string;
|
|
39
|
-
readonly name: string;
|
|
40
|
-
} | Refused;
|
|
41
|
-
/** Inputs the admission adapter supplies with the endpoint whose start it owns. */
|
|
42
|
-
export interface NativeSessionInputs {
|
|
43
|
-
readonly endpoint: CotalEndpoint;
|
|
44
|
-
readonly identity: SessionIdentity;
|
|
45
|
-
/** The admission adapter's own retirement call. This module only invokes it. */
|
|
46
|
-
readonly retire: () => Promise<CloseReport>;
|
|
47
|
-
/** The command that opens a session on a channel with the flags this one was started with. */
|
|
48
|
-
readonly reopen: (channel: string) => string;
|
|
49
|
-
}
|
|
50
|
-
export declare class NativeChatSession implements AdmittedChatSession {
|
|
51
|
-
private readonly inputs;
|
|
52
|
-
private readonly engine;
|
|
53
|
-
private readonly listeners;
|
|
54
|
-
/** What the session emitted before its first subscriber, such as the presence the endpoint's start
|
|
55
|
-
* reports, this session's own row included. The first subscriber gets it, so nothing is lost. */
|
|
56
|
-
private early;
|
|
57
|
-
private state;
|
|
58
|
-
private attention;
|
|
59
|
-
private closed;
|
|
60
|
-
/** Why the session ended itself, when it could not continue. */
|
|
61
|
-
private lost;
|
|
62
|
-
/** What the full inbox let go that no gap has reported yet. */
|
|
63
|
-
private overflow;
|
|
64
|
-
private overflowTimer;
|
|
65
|
-
private readonly onMessage;
|
|
66
|
-
/** The endpoint drops its connection during a reconnect this session asked for. That outage was
|
|
67
|
-
* reported when the reconnect started, so the state stays reconnecting until it is back. */
|
|
68
|
-
private readonly onConnection;
|
|
69
|
-
/** The last row each roster member's presence event carried, as JSON. */
|
|
70
|
-
private readonly rows;
|
|
71
|
-
/** A presence update the row cannot show, such as a change of attention or a channel mode, leaves the
|
|
72
|
-
* row as it was, so it is not reported as an update. */
|
|
73
|
-
private readonly onPresence;
|
|
74
|
-
private readonly onError;
|
|
75
|
-
/** A reconnect that finds this session's own DM durable gone cannot succeed by retrying: the
|
|
76
|
-
* session was retired while the broker was away, as a stack restart retires the sessions its old
|
|
77
|
-
* manager admitted. The session ends with that reason instead of reporting reconnecting for good. */
|
|
78
|
-
private readonly onWarning;
|
|
79
|
-
constructor(inputs: NativeSessionInputs);
|
|
80
|
-
identity(): SessionIdentity;
|
|
81
|
-
subscribe(listener: (event: SessionEvent) => void): () => void;
|
|
82
|
-
private ingest;
|
|
83
|
-
/** One gap for every drop since the last one, naming only the kinds that happened. */
|
|
84
|
-
private reportOverflow;
|
|
85
|
-
surfaced(keys: readonly string[]): void;
|
|
86
|
-
send(text: string, channel: string, mentions: readonly string[]): Promise<PublishResult>;
|
|
87
|
-
resolveDm(to: DmTarget): Promise<Result<{
|
|
88
|
-
readonly id: string;
|
|
89
|
-
readonly name: string;
|
|
90
|
-
}>>;
|
|
91
|
-
dm(to: DmTarget, text: string, replyTo?: string): Promise<PublishResult>;
|
|
92
|
-
anycast(role: string, text: string): Promise<PublishResult>;
|
|
93
|
-
private call;
|
|
94
|
-
setStatus(status: "idle" | "working" | "waiting", activity?: string): Promise<Result<void>>;
|
|
95
|
-
setAttention(mode: "open" | "dnd" | "focus"): Promise<Result<void>>;
|
|
96
|
-
setChannelMode(channel: string, mode: "quiet" | "muted" | "normal"): Promise<Result<void>>;
|
|
97
|
-
join(channel: string): Promise<Result<{
|
|
98
|
-
joined: boolean;
|
|
99
|
-
backfilled: number;
|
|
100
|
-
durable: boolean;
|
|
101
|
-
reason?: string;
|
|
102
|
-
}>>;
|
|
103
|
-
leave(channel: string): Promise<Result<{
|
|
104
|
-
left: boolean;
|
|
105
|
-
}>>;
|
|
106
|
-
inbox(peek: boolean): Promise<Result<readonly SessionMessage[]>>;
|
|
107
|
-
roster(): Promise<Result<RosterView>>;
|
|
108
|
-
channelInfo(channel: string): Promise<Result<ChannelInfo>>;
|
|
109
|
-
connection(): Promise<Result<ConnectionReport>>;
|
|
110
|
-
history(channel: string, limit: number): Promise<Result<HistoryPage>>;
|
|
111
|
-
invoke(endpoint: string, command: string, args: Readonly<Record<string, unknown>> | undefined, timeoutMs: number): Promise<Result<unknown>>;
|
|
112
|
-
reconnect(): Promise<Result<{
|
|
113
|
-
reconnected: boolean;
|
|
114
|
-
message: string;
|
|
115
|
-
}>>;
|
|
116
|
-
close(): Promise<CloseReport>;
|
|
117
|
-
private setState;
|
|
118
|
-
private emit;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=native-session.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native-session.d.ts","sourceRoot":"","sources":["../../src/chat/native-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EASL,KAAK,aAAa,EAIlB,KAAK,QAAQ,EAEb,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,gBAAgB,EAEhB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,OAAO,EACP,MAAM,EAEN,UAAU,EACV,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,cAAc,CAAC;AA+BtB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,GAAG,SAAS,CAMtJ;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,EAAE,EAAE,QAAQ,EACZ,MAAM,EAAE,SAAS,QAAQ,EAAE,EAC3B,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,EAClC,MAAM,EAAE,iBAAiB,EACzB,aAAa,EAAE,MAAM,EACrB,QAAQ,CAAC,EAAE,MAAM,GAChB;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAiC1D;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAA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E,OAAO,CAAA;KAAE,CAAC,CAAC;IAMpD,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;IAIhE,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAKrC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAkB1D,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAe/C,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAgCrE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAc3I,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAU7E,KAAK,IAAI,OAAO,CAAC,WAAW,CAAC;IAuB7B,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,IAAI;CASb"}
|
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The native engine adapter: implements {@link AdmittedChatSession} over ONE real `CotalEndpoint`
|
|
3
|
-
* that a reviewed admission adapter constructed under the session's own identity. The adapter owns
|
|
4
|
-
* start; listeners may be installed before it starts. This module never constructs, admits, mints or starts an endpoint, and never reads a
|
|
5
|
-
* credential. No connector-core. The three client behaviours core lacks live in `engine.ts`.
|
|
6
|
-
*
|
|
7
|
-
* Classification rules (native error -> session outcome):
|
|
8
|
-
* - `isPublishPermissionDenied` (broker publish refusal) -> refused PERMISSION_DENIED
|
|
9
|
-
* - `EpEnvelopeError` with `outcome: "not-executed"` or a
|
|
10
|
-
* pre-effect code (bad-request, permission-denied, …) -> refused, native code kept
|
|
11
|
-
* - `EpEnvelopeError` with `outcome: "unknown"`, timeouts, and
|
|
12
|
-
* anything else thrown after a publish or request was issued -> unknown (never retried)
|
|
13
|
-
* - local validation thrown before any I/O -> refused USAGE_INVALID
|
|
14
|
-
* - a send, join or channel mode outside the session's grant -> refused PERMISSION_DENIED,
|
|
15
|
-
* before any I/O ({@link grantRefusal})
|
|
16
|
-
* A denial is never turned into an empty `ok`.
|
|
17
|
-
*/
|
|
18
|
-
import { EpEnvelopeError, channelInAllow, isConcreteChannel, isConsumerNotFound, isPublishPermissionDenied, parsePrincipalKey, partsToText, resolvePeer, } from "@cotal-ai/core";
|
|
19
|
-
import { codeSpan } from "@cotal-ai/workspace";
|
|
20
|
-
import { ParticipantEngine } from "./engine.js";
|
|
21
|
-
/** Native codes that mean "refused before any effect". Anything else from a call is unknown. */
|
|
22
|
-
const PRE_EFFECT = {
|
|
23
|
-
"bad-request": "USAGE_INVALID",
|
|
24
|
-
"unsupported-version": "UNSUPPORTED",
|
|
25
|
-
"unauthenticated": "AUTH_REQUIRED",
|
|
26
|
-
"permission-denied": "PERMISSION_DENIED",
|
|
27
|
-
"not-found": "TARGET_NOT_FOUND",
|
|
28
|
-
"failed-precondition": "LIFECYCLE_BLOCKED",
|
|
29
|
-
"unimplemented": "UNSUPPORTED",
|
|
30
|
-
"unavailable": "TARGET_UNAVAILABLE",
|
|
31
|
-
"conflict": "CONFLICT",
|
|
32
|
-
};
|
|
33
|
-
function classify(e) {
|
|
34
|
-
const message = e instanceof Error ? e.message : String(e);
|
|
35
|
-
if (isPublishPermissionDenied(e))
|
|
36
|
-
return { outcome: "refused", code: "PERMISSION_DENIED", message, native: { code: "publish-permission-denied" } };
|
|
37
|
-
if (e instanceof EpEnvelopeError) {
|
|
38
|
-
const code = PRE_EFFECT[e.code];
|
|
39
|
-
if (code && e.outcome !== "unknown" && e.outcome !== "executed")
|
|
40
|
-
return { outcome: "refused", code, message, native: { code: e.code, detail: e.details } };
|
|
41
|
-
}
|
|
42
|
-
return { outcome: "unknown", message };
|
|
43
|
-
}
|
|
44
|
-
const refusedUsage = (message) => ({ outcome: "refused", code: "USAGE_INVALID", message });
|
|
45
|
-
/** How long a full inbox's drops wait for more before one gap reports them all, so a replay past the
|
|
46
|
-
* bound or a burst of traffic is one gap with its total. */
|
|
47
|
-
const GAP_COALESCE_MS = 1_000;
|
|
48
|
-
/**
|
|
49
|
-
* Refuse a channel outside the session's read or post grant before any effect, so the broker's
|
|
50
|
-
* refusal and its subject never reach the caller. A session opened on no channel holds no grant,
|
|
51
|
-
* and the refusal names `reopen`'s command, which opens one that does. The broker remains the
|
|
52
|
-
* enforcement point.
|
|
53
|
-
*/
|
|
54
|
-
export function grantRefusal(grant, channel, use, reopen) {
|
|
55
|
-
if (channelInAllow([...grant], channel))
|
|
56
|
-
return undefined;
|
|
57
|
-
const message = grant.length === 0
|
|
58
|
-
? `this session was opened on no channel, so it cannot ${use === "read" ? "read" : "post to"} #${channel}. Leave and run ${codeSpan(reopen(channel))} to open a session on it`
|
|
59
|
-
: `#${channel} is outside this session's ${use} grant`;
|
|
60
|
-
return { outcome: "refused", code: "PERMISSION_DENIED", message };
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Resolve a DM target before any effect. A `{ principal }` target, or a typed string that parses as
|
|
64
|
-
* a principal `<owner>.<actor>`, goes to that principal as is, whether or not it is present or was
|
|
65
|
-
* heard from. It is never matched against display names, so a peer whose display name spells a
|
|
66
|
-
* principal cannot capture it; that peer is reached by its own principal or `/reply`. Any other
|
|
67
|
-
* string is a display name, which must name one principal across the roster and the heard senders:
|
|
68
|
-
* a name both carry refuses and lists them instead of picking the present one. Absence is a verdict
|
|
69
|
-
* only on a current roster (endpoint.ts:2816-2823).
|
|
70
|
-
*/
|
|
71
|
-
export function resolveDmTarget(to, roster, rosterState, engine, selfPrincipal, selfName) {
|
|
72
|
-
if (typeof to !== "string" || parsePrincipalKey(to)) {
|
|
73
|
-
const principal = typeof to === "string" ? to : to.principal;
|
|
74
|
-
if (!parsePrincipalKey(principal))
|
|
75
|
-
return refusedUsage(`"${principal}" is not a principal <owner>.<actor>`);
|
|
76
|
-
if (principal === selfPrincipal)
|
|
77
|
-
return refusedUsage("a direct message needs a principal other than this session");
|
|
78
|
-
return { id: principal, name: roster.find((p) => p.card.id === principal)?.card.name ?? engine.senderName(principal) ?? principal };
|
|
79
|
-
}
|
|
80
|
-
const peers = roster.filter((p) => p.card.id !== selfPrincipal);
|
|
81
|
-
let peer;
|
|
82
|
-
try {
|
|
83
|
-
peer = resolvePeer(peers, to);
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
// core resolvePeer throws AmbiguousPeerError or a roster-label refusal: both are pre-effect.
|
|
87
|
-
return { outcome: "refused", code: "TARGET_AMBIGUOUS", message: e.message };
|
|
88
|
-
}
|
|
89
|
-
const named = new Map();
|
|
90
|
-
if (peer)
|
|
91
|
-
named.set(peer.card.id, { id: peer.card.id, name: peer.card.name });
|
|
92
|
-
for (const sender of engine.sendersNamed(to))
|
|
93
|
-
if (!named.has(sender.id))
|
|
94
|
-
named.set(sender.id, sender);
|
|
95
|
-
if (named.size > 1) {
|
|
96
|
-
const ids = [...named.keys()];
|
|
97
|
-
// Each one-shot `cotal send` signs with its own principal and exits once it has sent, so a
|
|
98
|
-
// reply by its name can reach none of them.
|
|
99
|
-
const present = new Set(roster.filter((p) => p.status !== "offline").map((p) => p.card.id));
|
|
100
|
-
if (rosterState === "current" && !ids.some((id) => present.has(id)))
|
|
101
|
-
return { outcome: "refused", code: "TARGET_AMBIGUOUS", message: `"${to}" names ${ids.length} senders that are no longer present (${ids.join(", ")}), such as one-shot \`cotal send\` commands, which exit once they have sent; answer one message with /reply, or over --stdio with to set to its from.id and replyTo to its id` };
|
|
102
|
-
return { outcome: "refused", code: "TARGET_AMBIGUOUS", message: `"${to}" names more than one principal (${ids.join(", ")}); use the full principal` };
|
|
103
|
-
}
|
|
104
|
-
const only = [...named.values()][0];
|
|
105
|
-
if (only)
|
|
106
|
-
return only;
|
|
107
|
-
if (selfName !== undefined && to.trim().toLowerCase() === selfName.trim().toLowerCase())
|
|
108
|
-
return refusedUsage(`"${to}" is this session's own name; a direct message needs another participant`);
|
|
109
|
-
if (rosterState !== "current")
|
|
110
|
-
return { outcome: "refused", code: "TARGET_UNAVAILABLE", message: `cannot verify "${to}": the roster is ${rosterState}` };
|
|
111
|
-
return { outcome: "refused", code: "TARGET_NOT_FOUND", message: `no peer "${to}" in this space` };
|
|
112
|
-
}
|
|
113
|
-
export class NativeChatSession {
|
|
114
|
-
inputs;
|
|
115
|
-
engine;
|
|
116
|
-
listeners = new Set();
|
|
117
|
-
/** What the session emitted before its first subscriber, such as the presence the endpoint's start
|
|
118
|
-
* reports, this session's own row included. The first subscriber gets it, so nothing is lost. */
|
|
119
|
-
early = [];
|
|
120
|
-
state = "connected";
|
|
121
|
-
attention = "open";
|
|
122
|
-
closed;
|
|
123
|
-
/** Why the session ended itself, when it could not continue. */
|
|
124
|
-
lost;
|
|
125
|
-
/** What the full inbox let go that no gap has reported yet. */
|
|
126
|
-
overflow = { channelDropped: 0, directedDeferred: 0 };
|
|
127
|
-
overflowTimer;
|
|
128
|
-
onMessage = (m, d, meta) => this.ingest(m, d, meta);
|
|
129
|
-
/** The endpoint drops its connection during a reconnect this session asked for. That outage was
|
|
130
|
-
* reported when the reconnect started, so the state stays reconnecting until it is back. */
|
|
131
|
-
onConnection = (s) => {
|
|
132
|
-
if (s.connected)
|
|
133
|
-
this.setState("connected");
|
|
134
|
-
else if (this.state !== "reconnecting")
|
|
135
|
-
this.setState("disconnected");
|
|
136
|
-
};
|
|
137
|
-
/** The last row each roster member's presence event carried, as JSON. */
|
|
138
|
-
rows = new Map();
|
|
139
|
-
/** A presence update the row cannot show, such as a change of attention or a channel mode, leaves the
|
|
140
|
-
* row as it was, so it is not reported as an update. */
|
|
141
|
-
onPresence = (ev) => {
|
|
142
|
-
const row = rowOf(ev.presence), shown = JSON.stringify(row);
|
|
143
|
-
if (ev.type === "update" && this.rows.get(row.id) === shown)
|
|
144
|
-
return;
|
|
145
|
-
if (ev.type === "offline")
|
|
146
|
-
this.rows.delete(row.id);
|
|
147
|
-
else
|
|
148
|
-
this.rows.set(row.id, shown);
|
|
149
|
-
this.emit({ type: "presence", row, change: ev.type === "join" ? "joined" : ev.type === "offline" ? "left" : "updated" });
|
|
150
|
-
};
|
|
151
|
-
onError = () => { };
|
|
152
|
-
/** A reconnect that finds this session's own DM durable gone cannot succeed by retrying: the
|
|
153
|
-
* session was retired while the broker was away, as a stack restart retires the sessions its old
|
|
154
|
-
* manager admitted. The session ends with that reason instead of reporting reconnecting for good. */
|
|
155
|
-
onWarning = (e) => {
|
|
156
|
-
if (this.state === "connected" || this.closed || !isConsumerNotFound(e))
|
|
157
|
-
return;
|
|
158
|
-
this.lost = "this session can no longer reconnect: its inbox is gone from the broker, because the space restarted or retired the session while the connection was down; open a new session";
|
|
159
|
-
void this.close();
|
|
160
|
-
};
|
|
161
|
-
constructor(inputs) {
|
|
162
|
-
this.inputs = inputs;
|
|
163
|
-
this.engine = new ParticipantEngine(inputs.identity.principal);
|
|
164
|
-
const ep = inputs.endpoint;
|
|
165
|
-
ep.on("message", this.onMessage);
|
|
166
|
-
ep.on("connection", this.onConnection);
|
|
167
|
-
ep.on("presence", this.onPresence);
|
|
168
|
-
ep.on("error", this.onError);
|
|
169
|
-
ep.on("warning", this.onWarning);
|
|
170
|
-
}
|
|
171
|
-
identity() {
|
|
172
|
-
return this.inputs.identity;
|
|
173
|
-
}
|
|
174
|
-
subscribe(listener) {
|
|
175
|
-
this.listeners.add(listener);
|
|
176
|
-
// Drops so far, such as a replay's past the inbox bound, are reported with the early events.
|
|
177
|
-
this.reportOverflow();
|
|
178
|
-
const early = this.early ?? [];
|
|
179
|
-
this.early = undefined;
|
|
180
|
-
for (const e of early) {
|
|
181
|
-
try {
|
|
182
|
-
listener(e);
|
|
183
|
-
}
|
|
184
|
-
catch { /* a listener fault never breaks delivery */ }
|
|
185
|
-
}
|
|
186
|
-
// A front end unsubscribes before it closes the session, so it hears the drops first.
|
|
187
|
-
return () => {
|
|
188
|
-
this.reportOverflow();
|
|
189
|
-
this.listeners.delete(listener);
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
// ---- receive ---------------------------------------------------------------------------------
|
|
193
|
-
ingest(m, d, meta) {
|
|
194
|
-
if (this.closed)
|
|
195
|
-
return; // unacked: a durable copy redelivers to nobody once retired
|
|
196
|
-
const self = this.inputs.identity.label.toLowerCase();
|
|
197
|
-
// Advisory only: the payload `mentions` list is forgeable; it changes visibility, never authority.
|
|
198
|
-
const mentionsMe = (m.mentions ?? []).some((x) => x.toLowerCase() === self);
|
|
199
|
-
const disp = this.engine.accept(m, d, meta, mentionsMe);
|
|
200
|
-
if (disp.kind === "surface")
|
|
201
|
-
this.emit({ type: "message", message: disp.message });
|
|
202
|
-
const over = this.engine.takeOverflow();
|
|
203
|
-
if (!over.channelDropped && !over.directedDeferred)
|
|
204
|
-
return;
|
|
205
|
-
this.overflow = {
|
|
206
|
-
channelDropped: this.overflow.channelDropped + over.channelDropped,
|
|
207
|
-
directedDeferred: this.overflow.directedDeferred + over.directedDeferred,
|
|
208
|
-
};
|
|
209
|
-
this.overflowTimer ??= setTimeout(() => this.reportOverflow(), GAP_COALESCE_MS);
|
|
210
|
-
this.overflowTimer.unref?.();
|
|
211
|
-
}
|
|
212
|
-
/** One gap for every drop since the last one, naming only the kinds that happened. */
|
|
213
|
-
reportOverflow() {
|
|
214
|
-
clearTimeout(this.overflowTimer);
|
|
215
|
-
this.overflowTimer = undefined;
|
|
216
|
-
const { channelDropped, directedDeferred } = this.overflow;
|
|
217
|
-
if (!channelDropped && !directedDeferred)
|
|
218
|
-
return;
|
|
219
|
-
this.overflow = { channelDropped: 0, directedDeferred: 0 };
|
|
220
|
-
const parts = [
|
|
221
|
-
...(channelDropped ? [`${channelDropped} channel message(s) dropped`] : []),
|
|
222
|
-
...(directedDeferred ? [`${directedDeferred} direct message(s) left for broker redelivery`] : []),
|
|
223
|
-
];
|
|
224
|
-
this.emit({ type: "gap", scope: "inbox", reason: `buffer full: ${parts.join(", ")}` });
|
|
225
|
-
}
|
|
226
|
-
surfaced(keys) {
|
|
227
|
-
this.engine.surfaced(keys);
|
|
228
|
-
}
|
|
229
|
-
// ---- publish ---------------------------------------------------------------------------------
|
|
230
|
-
async send(text, channel, mentions) {
|
|
231
|
-
if (!isConcreteChannel(channel))
|
|
232
|
-
return refusedUsage("a send needs a concrete channel");
|
|
233
|
-
const outside = grantRefusal(this.inputs.identity.allowPublish, channel, "post", this.inputs.reopen);
|
|
234
|
-
if (outside)
|
|
235
|
-
return outside;
|
|
236
|
-
let registered;
|
|
237
|
-
try {
|
|
238
|
-
registered = this.inputs.endpoint.getChannelConfig(channel) !== undefined;
|
|
239
|
-
const msg = await this.inputs.endpoint.multicast(text, { channel, ...(mentions.length ? { mentions: [...mentions] } : {}) });
|
|
240
|
-
// Native multicast awaits the stream ack but does not return it (endpoint.ts:4231-4236): no seq.
|
|
241
|
-
return { outcome: "stored", messageId: msg.id, channel, registered };
|
|
242
|
-
}
|
|
243
|
-
catch (e) {
|
|
244
|
-
return classify(e);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
async resolveDm(to) {
|
|
248
|
-
const ep = this.inputs.endpoint;
|
|
249
|
-
const recipient = resolveDmTarget(to, ep.getRoster(), ep.presenceView().state, this.engine, this.inputs.identity.principal, this.inputs.identity.label);
|
|
250
|
-
return "outcome" in recipient ? recipient : { outcome: "ok", value: recipient };
|
|
251
|
-
}
|
|
252
|
-
async dm(to, text, replyTo) {
|
|
253
|
-
const ep = this.inputs.endpoint;
|
|
254
|
-
const recipient = resolveDmTarget(to, ep.getRoster(), ep.presenceView().state, this.engine, this.inputs.identity.principal, this.inputs.identity.label);
|
|
255
|
-
if ("outcome" in recipient)
|
|
256
|
-
return recipient;
|
|
257
|
-
const recipientStatusAtSend = ep.getRoster().find((p) => p.card.id === recipient.id)?.status ?? "unrostered";
|
|
258
|
-
try {
|
|
259
|
-
const { msg, ack } = await ep.unicastAttributed(recipient.id, text, replyTo !== undefined ? { replyTo } : {});
|
|
260
|
-
return { outcome: "stored", messageId: msg.id, seq: ack.seq, duplicate: ack.duplicate, recipient, recipientStatusAtSend };
|
|
261
|
-
}
|
|
262
|
-
catch (e) {
|
|
263
|
-
return classify(e);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
async anycast(role, text) {
|
|
267
|
-
try {
|
|
268
|
-
const { msg, ack } = await this.inputs.endpoint.anycastAttributed(role, text);
|
|
269
|
-
return { outcome: "stored", messageId: msg.id, seq: ack.seq, duplicate: ack.duplicate };
|
|
270
|
-
}
|
|
271
|
-
catch (e) {
|
|
272
|
-
return classify(e);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
// ---- presence and attention -------------------------------------------------------------------
|
|
276
|
-
async call(fn) {
|
|
277
|
-
try {
|
|
278
|
-
return { outcome: "ok", value: await fn() };
|
|
279
|
-
}
|
|
280
|
-
catch (e) {
|
|
281
|
-
return classify(e);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
setStatus(status, activity) {
|
|
285
|
-
return this.call(() => this.inputs.endpoint.setStatus(status, activity));
|
|
286
|
-
}
|
|
287
|
-
setAttention(mode) {
|
|
288
|
-
// The local buffering decision is the session's own and takes effect immediately; the presence
|
|
289
|
-
// publish is advisory. If the publish fails the mode still applies locally and the result says so.
|
|
290
|
-
this.engine.setAttention(mode);
|
|
291
|
-
this.attention = mode;
|
|
292
|
-
return this.call(() => this.inputs.endpoint.setAttention(mode)); // advisory presence (endpoint.ts:2867-2870)
|
|
293
|
-
}
|
|
294
|
-
async setChannelMode(channel, mode) {
|
|
295
|
-
if (!isConcreteChannel(channel))
|
|
296
|
-
return refusedUsage("a channel mode needs a concrete channel");
|
|
297
|
-
const outside = grantRefusal(this.inputs.identity.allowSubscribe, channel, "read", this.inputs.reopen);
|
|
298
|
-
if (outside)
|
|
299
|
-
return outside;
|
|
300
|
-
// Local first, as for attention; the presence mirror is advisory (endpoint.ts:2874-2877).
|
|
301
|
-
this.engine.setChannelMode(channel, mode);
|
|
302
|
-
return this.call(() => this.inputs.endpoint.setChannelModes(this.engine.channelModes()));
|
|
303
|
-
}
|
|
304
|
-
async join(channel) {
|
|
305
|
-
const outside = grantRefusal(this.inputs.identity.allowSubscribe, channel, "read", this.inputs.reopen);
|
|
306
|
-
if (outside)
|
|
307
|
-
return outside;
|
|
308
|
-
return this.call(() => this.inputs.endpoint.joinChannel(channel));
|
|
309
|
-
}
|
|
310
|
-
leave(channel) {
|
|
311
|
-
return this.call(() => this.inputs.endpoint.leaveChannel(channel));
|
|
312
|
-
}
|
|
313
|
-
// ---- reads -------------------------------------------------------------------------------------
|
|
314
|
-
async inbox(peek) {
|
|
315
|
-
return { outcome: "ok", value: peek ? this.engine.inbox() : this.engine.drain() };
|
|
316
|
-
}
|
|
317
|
-
async roster() {
|
|
318
|
-
const ep = this.inputs.endpoint;
|
|
319
|
-
return { outcome: "ok", value: { rows: ep.getRoster().map(rowOf), view: ep.presenceView().state } };
|
|
320
|
-
}
|
|
321
|
-
async channelInfo(channel) {
|
|
322
|
-
const ep = this.inputs.endpoint;
|
|
323
|
-
const cfg = ep.getChannelConfig(channel);
|
|
324
|
-
return {
|
|
325
|
-
outcome: "ok",
|
|
326
|
-
value: {
|
|
327
|
-
channel,
|
|
328
|
-
registered: cfg !== undefined,
|
|
329
|
-
...(cfg?.description ? { description: cfg.description } : {}),
|
|
330
|
-
...(cfg?.instructions ? { instructions: cfg.instructions } : {}),
|
|
331
|
-
replay: ep.channelReplay(channel),
|
|
332
|
-
// Local view of the session's accepted ceilings; the broker remains the enforcement point.
|
|
333
|
-
readable: channelInAllow([...this.inputs.identity.allowSubscribe], channel),
|
|
334
|
-
postable: channelInAllow([...this.inputs.identity.allowPublish], channel),
|
|
335
|
-
},
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
async connection() {
|
|
339
|
-
const ep = this.inputs.endpoint;
|
|
340
|
-
return {
|
|
341
|
-
outcome: "ok",
|
|
342
|
-
value: {
|
|
343
|
-
state: this.state,
|
|
344
|
-
identity: this.inputs.identity,
|
|
345
|
-
bufferedInbox: this.engine.bufferedCount(),
|
|
346
|
-
joinedChannels: ep.joinedChannels(),
|
|
347
|
-
attention: this.attention,
|
|
348
|
-
channelModes: this.engine.channelModes(),
|
|
349
|
-
},
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
async history(channel, limit) {
|
|
353
|
-
// Native readHistory is MEDIATED by the delivery daemon (endpoint.ts:3651-3660, served at
|
|
354
|
-
// :5153-5210). The daemon authorizes against the durable registry's ACL row for the caller
|
|
355
|
-
// (`aclForAlias`), and that row is written only with durable membership (provision.ts
|
|
356
|
-
// `reissueAcl`, skipped when `durableMembership:false`). A phase-1 live-only session therefore has
|
|
357
|
-
// no row and the daemon refuses with "no read ACL on record ... not permitted". That is reported
|
|
358
|
-
// as a refusal, never as an empty page. A daemon refusal arrives as a plain Error whose text the
|
|
359
|
-
// daemon formats (`readHistory: ... - not permitted` / `... - refused`); other failures are
|
|
360
|
-
// `failed` (a read has no effect to be unknown about).
|
|
361
|
-
try {
|
|
362
|
-
// An open mesh runs no delivery daemon, so an open session reads the channel itself under its
|
|
363
|
-
// own lifecycle, as `cotal history` does.
|
|
364
|
-
const ep = this.inputs.endpoint;
|
|
365
|
-
const page = this.inputs.identity.mode === "open" ? await ep.channelHistoryPage(channel, { limit }) : await ep.readHistory(channel, { limit });
|
|
366
|
-
return {
|
|
367
|
-
outcome: "ok",
|
|
368
|
-
value: {
|
|
369
|
-
channel,
|
|
370
|
-
messages: page.items.map((m, i) => historyRow(m, i)),
|
|
371
|
-
partial: !page.complete,
|
|
372
|
-
...(page.complete ? {} : { note: "bounded window or retention: not the full conversation" }),
|
|
373
|
-
},
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
catch (e) {
|
|
377
|
-
const c = classify(e);
|
|
378
|
-
if (c.outcome === "refused")
|
|
379
|
-
return c;
|
|
380
|
-
if (/^readHistory: .*(not permitted|refused)$/.test(c.message))
|
|
381
|
-
return { outcome: "refused", code: "PERMISSION_DENIED", message: c.message, native: { code: "delivery-refused" } };
|
|
382
|
-
return { outcome: "failed", message: c.message };
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
async invoke(endpoint, command, args, timeoutMs) {
|
|
386
|
-
try {
|
|
387
|
-
const r = await this.inputs.endpoint.invokeService(endpoint, command, args ? { ...args } : undefined, { deadlineMs: timeoutMs });
|
|
388
|
-
if (r.reply.ok)
|
|
389
|
-
return { outcome: "ok", value: r.reply.data ?? null };
|
|
390
|
-
const err = r.reply.error;
|
|
391
|
-
const pre = err ? PRE_EFFECT[err.code] : undefined;
|
|
392
|
-
if (err && pre && err.outcome !== "unknown" && err.outcome !== "executed")
|
|
393
|
-
return { outcome: "refused", code: pre, message: err.message, native: { code: err.code, detail: err.details } };
|
|
394
|
-
return { outcome: "unknown", message: err?.message ?? "the endpoint answered without a result" };
|
|
395
|
-
}
|
|
396
|
-
catch (e) {
|
|
397
|
-
return classify(e);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
async reconnect() {
|
|
401
|
-
return this.call(async () => {
|
|
402
|
-
this.setState("reconnecting");
|
|
403
|
-
// Native reconnect rebuilds the SAME endpoint: same principal, same lifecycle UID, same durables
|
|
404
|
-
// (endpoint.ts:1969-1981). It never mints a new identity; renewal refusal surfaces as a throw.
|
|
405
|
-
await this.inputs.endpoint.reconnect();
|
|
406
|
-
return { reconnected: true, message: "reconnected as the same session" };
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
close() {
|
|
410
|
-
this.closed ??= (async () => {
|
|
411
|
-
const ep = this.inputs.endpoint;
|
|
412
|
-
ep.off("message", this.onMessage);
|
|
413
|
-
ep.off("connection", this.onConnection);
|
|
414
|
-
ep.off("presence", this.onPresence);
|
|
415
|
-
ep.off("warning", this.onWarning);
|
|
416
|
-
this.reportOverflow();
|
|
417
|
-
this.engine.clear();
|
|
418
|
-
let stopped = true;
|
|
419
|
-
try {
|
|
420
|
-
await ep.stop();
|
|
421
|
-
}
|
|
422
|
-
catch {
|
|
423
|
-
stopped = false;
|
|
424
|
-
}
|
|
425
|
-
let report;
|
|
426
|
-
try {
|
|
427
|
-
report = await this.inputs.retire();
|
|
428
|
-
}
|
|
429
|
-
catch (e) {
|
|
430
|
-
report = { retirement: "unknown", connectionClosed: "not-confirmed", message: e.message };
|
|
431
|
-
}
|
|
432
|
-
ep.off("error", this.onError);
|
|
433
|
-
if (this.lost)
|
|
434
|
-
report = { ...report, lost: this.lost };
|
|
435
|
-
this.setState("ended", this.lost);
|
|
436
|
-
// Our own close is observed; a broker-side eviction is the retire report's claim to make.
|
|
437
|
-
return stopped ? report : { ...report, connectionClosed: "not-confirmed" };
|
|
438
|
-
})();
|
|
439
|
-
return this.closed;
|
|
440
|
-
}
|
|
441
|
-
setState(s, reason) {
|
|
442
|
-
if (this.state === s || this.state === "ended")
|
|
443
|
-
return;
|
|
444
|
-
this.state = s;
|
|
445
|
-
this.emit({ type: "connection", state: s, ...(reason ? { reason } : {}) });
|
|
446
|
-
}
|
|
447
|
-
emit(e) {
|
|
448
|
-
if (this.early) {
|
|
449
|
-
this.early.push(e);
|
|
450
|
-
return;
|
|
451
|
-
}
|
|
452
|
-
for (const l of this.listeners) {
|
|
453
|
-
try {
|
|
454
|
-
l(e);
|
|
455
|
-
}
|
|
456
|
-
catch { /* a listener fault never breaks delivery */ }
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
function rowOf(p) {
|
|
461
|
-
const meta = p.card.meta;
|
|
462
|
-
return {
|
|
463
|
-
id: p.card.id,
|
|
464
|
-
name: p.card.name,
|
|
465
|
-
kind: p.card.kind,
|
|
466
|
-
...(p.card.role ? { role: p.card.role } : {}),
|
|
467
|
-
status: p.status,
|
|
468
|
-
...(p.activity ? { activity: p.activity } : {}),
|
|
469
|
-
...(typeof meta?.sessionKind === "string" ? { sessionKind: meta.sessionKind } : {}),
|
|
470
|
-
};
|
|
471
|
-
}
|
|
472
|
-
function historyRow(m, i) {
|
|
473
|
-
const kind = m.channel !== undefined ? "channel" : m.toService !== undefined ? "anycast" : "dm";
|
|
474
|
-
return {
|
|
475
|
-
deliveryKey: `history-${i}`, // history is read, not delivered: nothing to acknowledge
|
|
476
|
-
id: m.id,
|
|
477
|
-
ts: m.ts,
|
|
478
|
-
kind,
|
|
479
|
-
from: { id: m.from.id, name: m.from.name, ...(m.from.role ? { role: m.from.role } : {}) },
|
|
480
|
-
...(m.channel !== undefined ? { channel: m.channel } : {}),
|
|
481
|
-
text: partsToText(m.parts),
|
|
482
|
-
...(m.replyTo !== undefined ? { replyTo: m.replyTo } : {}),
|
|
483
|
-
mentionsMe: false,
|
|
484
|
-
historical: true,
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
//# sourceMappingURL=native-session.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native-session.js","sourceRoot":"","sources":["../../src/chat/native-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,WAAW,EACX,WAAW,GAQZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAmBhD,gGAAgG;AAChG,MAAM,UAAU,GAA0C;IACxD,aAAa,EAAE,eAAe;IAC9B,qBAAqB,EAAE,aAAa;IACpC,iBAAiB,E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