shellpuppet 0.2.1 → 0.3.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/README.md +63 -16
- package/dist/agents/agy/index.d.ts +2 -0
- package/dist/agents/agy/index.js +11 -0
- package/dist/agents/agy/index.js.map +1 -0
- package/dist/agents/agy/nudge.d.ts +2 -0
- package/dist/agents/agy/nudge.js +29 -0
- package/dist/agents/agy/nudge.js.map +1 -0
- package/dist/agents/agy/reading.d.ts +2 -0
- package/dist/agents/agy/reading.js +28 -0
- package/dist/agents/agy/reading.js.map +1 -0
- package/dist/agents/barNudge.d.ts +9 -0
- package/dist/agents/barNudge.js +21 -0
- package/dist/agents/barNudge.js.map +1 -0
- package/dist/agents/claude/index.d.ts +2 -0
- package/dist/agents/claude/index.js +31 -0
- package/dist/agents/claude/index.js.map +1 -0
- package/dist/agents/claude/nudge.d.ts +2 -0
- package/dist/agents/claude/nudge.js +38 -0
- package/dist/agents/claude/nudge.js.map +1 -0
- package/dist/agents/claude/prompts.d.ts +9 -0
- package/dist/agents/claude/prompts.js +16 -0
- package/dist/agents/claude/prompts.js.map +1 -0
- package/dist/agents/claude/reading.d.ts +2 -0
- package/dist/agents/claude/reading.js +25 -0
- package/dist/agents/claude/reading.js.map +1 -0
- package/dist/agents/codex/index.d.ts +2 -0
- package/dist/agents/codex/index.js +28 -0
- package/dist/agents/codex/index.js.map +1 -0
- package/dist/agents/codex/nudge.d.ts +2 -0
- package/dist/agents/codex/nudge.js +35 -0
- package/dist/agents/codex/nudge.js.map +1 -0
- package/dist/agents/codex/prompts.d.ts +9 -0
- package/dist/agents/codex/prompts.js +14 -0
- package/dist/agents/codex/prompts.js.map +1 -0
- package/dist/agents/codex/reading.d.ts +2 -0
- package/dist/agents/codex/reading.js +22 -0
- package/dist/agents/codex/reading.js.map +1 -0
- package/dist/agents/generic/index.d.ts +3 -0
- package/dist/agents/generic/index.js +9 -0
- package/dist/agents/generic/index.js.map +1 -0
- package/dist/agents/generic/prompts.d.ts +2 -0
- package/dist/agents/generic/prompts.js +10 -0
- package/dist/agents/generic/prompts.js.map +1 -0
- package/dist/agents/grok/actionBox.d.ts +13 -0
- package/dist/agents/grok/actionBox.js +127 -0
- package/dist/agents/grok/actionBox.js.map +1 -0
- package/dist/agents/grok/index.d.ts +2 -0
- package/dist/agents/grok/index.js +20 -0
- package/dist/agents/grok/index.js.map +1 -0
- package/dist/agents/grok/nudge.d.ts +2 -0
- package/dist/agents/grok/nudge.js +76 -0
- package/dist/agents/grok/nudge.js.map +1 -0
- package/dist/agents/grok/prompts.d.ts +4 -0
- package/dist/agents/grok/prompts.js +89 -0
- package/dist/agents/grok/prompts.js.map +1 -0
- package/dist/agents/grok/reading.d.ts +2 -0
- package/dist/agents/grok/reading.js +49 -0
- package/dist/agents/grok/reading.js.map +1 -0
- package/dist/agents/grok/readingRules.d.ts +2 -0
- package/dist/agents/grok/readingRules.js +44 -0
- package/dist/agents/grok/readingRules.js.map +1 -0
- package/dist/agents/index.d.ts +28 -0
- package/dist/agents/index.js +46 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/input.d.ts +2 -0
- package/dist/agents/input.js +9 -0
- package/dist/agents/input.js.map +1 -0
- package/dist/agents/mimo/index.d.ts +2 -0
- package/dist/agents/mimo/index.js +13 -0
- package/dist/agents/mimo/index.js.map +1 -0
- package/dist/agents/mimo/nudge.d.ts +3 -0
- package/dist/agents/mimo/nudge.js +59 -0
- package/dist/agents/mimo/nudge.js.map +1 -0
- package/dist/agents/mimo/prompts.d.ts +2 -0
- package/dist/agents/mimo/prompts.js +40 -0
- package/dist/agents/mimo/prompts.js.map +1 -0
- package/dist/agents/mimo/reading.d.ts +2 -0
- package/dist/agents/mimo/reading.js +31 -0
- package/dist/agents/mimo/reading.js.map +1 -0
- package/dist/agents/mimo/readingRules.d.ts +2 -0
- package/dist/agents/mimo/readingRules.js +79 -0
- package/dist/agents/mimo/readingRules.js.map +1 -0
- package/dist/agents/mimo/stalls.d.ts +2 -0
- package/dist/agents/mimo/stalls.js +81 -0
- package/dist/agents/mimo/stalls.js.map +1 -0
- package/dist/agents/muse/index.d.ts +2 -0
- package/dist/agents/muse/index.js +20 -0
- package/dist/agents/muse/index.js.map +1 -0
- package/dist/agents/muse/input.d.ts +3 -0
- package/dist/agents/muse/input.js +7 -0
- package/dist/agents/muse/input.js.map +1 -0
- package/dist/agents/muse/nudge.d.ts +2 -0
- package/dist/agents/muse/nudge.js +33 -0
- package/dist/agents/muse/nudge.js.map +1 -0
- package/dist/agents/muse/prompts.d.ts +14 -0
- package/dist/agents/muse/prompts.js +132 -0
- package/dist/agents/muse/prompts.js.map +1 -0
- package/dist/agents/muse/reading.d.ts +2 -0
- package/dist/agents/muse/reading.js +33 -0
- package/dist/agents/muse/reading.js.map +1 -0
- package/dist/agents/muse/readingRules.d.ts +2 -0
- package/dist/agents/muse/readingRules.js +49 -0
- package/dist/agents/muse/readingRules.js.map +1 -0
- package/dist/agents/nudgeReading.d.ts +74 -0
- package/dist/agents/nudgeReading.js +262 -0
- package/dist/agents/nudgeReading.js.map +1 -0
- package/dist/agents/opencode/index.d.ts +2 -0
- package/dist/agents/opencode/index.js +21 -0
- package/dist/agents/opencode/index.js.map +1 -0
- package/dist/agents/opencode/nudge.d.ts +6 -0
- package/dist/agents/opencode/nudge.js +187 -0
- package/dist/agents/opencode/nudge.js.map +1 -0
- package/dist/agents/opencode/prompts.d.ts +6 -0
- package/dist/agents/opencode/prompts.js +198 -0
- package/dist/agents/opencode/prompts.js.map +1 -0
- package/dist/agents/opencode/reading.d.ts +2 -0
- package/dist/agents/opencode/reading.js +29 -0
- package/dist/agents/opencode/reading.js.map +1 -0
- package/dist/agents/opencode/stalls.d.ts +3 -0
- package/dist/agents/opencode/stalls.js +14 -0
- package/dist/agents/opencode/stalls.js.map +1 -0
- package/dist/agents/qoder/index.d.ts +2 -0
- package/dist/agents/qoder/index.js +12 -0
- package/dist/agents/qoder/index.js.map +1 -0
- package/dist/agents/qoder/nudge.d.ts +2 -0
- package/dist/agents/qoder/nudge.js +16 -0
- package/dist/agents/qoder/nudge.js.map +1 -0
- package/dist/agents/qoder/prompts.d.ts +2 -0
- package/dist/agents/qoder/prompts.js +6 -0
- package/dist/agents/qoder/prompts.js.map +1 -0
- package/dist/agents/qoder/reading.d.ts +2 -0
- package/dist/agents/qoder/reading.js +41 -0
- package/dist/agents/qoder/reading.js.map +1 -0
- package/dist/agents/types.d.ts +187 -0
- package/dist/agents/types.js +2 -0
- package/dist/agents/types.js.map +1 -0
- package/dist/cli/index.js +185 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/client/http.d.ts +5 -1
- package/dist/client/http.js +39 -9
- package/dist/client/http.js.map +1 -1
- package/dist/core/dialogs.d.ts +2 -4
- package/dist/core/dialogs.js +6 -12
- package/dist/core/dialogs.js.map +1 -1
- package/dist/core/mailbox.d.ts +222 -0
- package/dist/core/mailbox.js +545 -0
- package/dist/core/mailbox.js.map +1 -0
- package/dist/core/manager.d.ts +3 -0
- package/dist/core/manager.js +37 -2
- package/dist/core/manager.js.map +1 -1
- package/dist/core/messageText.d.ts +2 -0
- package/dist/core/messageText.js +6 -0
- package/dist/core/messageText.js.map +1 -0
- package/dist/core/nudge.d.ts +37 -0
- package/dist/core/nudge.js +57 -0
- package/dist/core/nudge.js.map +1 -0
- package/dist/core/promptDetector.d.ts +14 -12
- package/dist/core/promptDetector.js +113 -363
- package/dist/core/promptDetector.js.map +1 -1
- package/dist/core/promptText.d.ts +1 -0
- package/dist/core/promptText.js +4 -0
- package/dist/core/promptText.js.map +1 -0
- package/dist/core/readiness.d.ts +14 -0
- package/dist/core/readiness.js +95 -0
- package/dist/core/readiness.js.map +1 -0
- package/dist/core/reasoning.d.ts +68 -7
- package/dist/core/reasoning.js +572 -325
- package/dist/core/reasoning.js.map +1 -1
- package/dist/core/renderer.d.ts +63 -3
- package/dist/core/renderer.js +368 -42
- package/dist/core/renderer.js.map +1 -1
- package/dist/core/selection.d.ts +1 -1
- package/dist/core/selection.js +3 -3
- package/dist/core/selection.js.map +1 -1
- package/dist/core/session.d.ts +165 -13
- package/dist/core/session.js +998 -84
- package/dist/core/session.js.map +1 -1
- package/dist/core/types.d.ts +60 -4
- package/dist/core/types.js +41 -0
- package/dist/core/types.js.map +1 -1
- package/dist/core/waiter.d.ts +9 -2
- package/dist/core/waiter.js +35 -10
- package/dist/core/waiter.js.map +1 -1
- package/dist/daemon/audit.d.ts +1 -1
- package/dist/daemon/audit.js +2 -1
- package/dist/daemon/audit.js.map +1 -1
- package/dist/daemon/config.d.ts +42 -0
- package/dist/daemon/config.js +159 -4
- package/dist/daemon/config.js.map +1 -1
- package/dist/daemon/folderPicker.js +21 -2
- package/dist/daemon/folderPicker.js.map +1 -1
- package/dist/daemon/homeOwner.d.ts +15 -0
- package/dist/daemon/homeOwner.js +106 -0
- package/dist/daemon/homeOwner.js.map +1 -0
- package/dist/daemon/index.js +10 -6
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/launchProfiles.d.ts +5 -0
- package/dist/daemon/launchProfiles.js +42 -40
- package/dist/daemon/launchProfiles.js.map +1 -1
- package/dist/daemon/nudgeScheduler.d.ts +21 -0
- package/dist/daemon/nudgeScheduler.js +61 -0
- package/dist/daemon/nudgeScheduler.js.map +1 -0
- package/dist/daemon/paths.d.ts +20 -16
- package/dist/daemon/paths.js +137 -49
- package/dist/daemon/paths.js.map +1 -1
- package/dist/daemon/restartSource.d.ts +7 -0
- package/dist/daemon/restartSource.js +89 -0
- package/dist/daemon/restartSource.js.map +1 -0
- package/dist/daemon/screenshot.d.ts +4 -1
- package/dist/daemon/screenshot.js +45 -7
- package/dist/daemon/screenshot.js.map +1 -1
- package/dist/daemon/server.d.ts +70 -13
- package/dist/daemon/server.js +1596 -294
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/sessionFeed.js +4 -1
- package/dist/daemon/sessionFeed.js.map +1 -1
- package/dist/mcp/config.js +2 -1
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/index.js +12 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools.d.ts +21 -1
- package/dist/mcp/tools.js +213 -28
- package/dist/mcp/tools.js.map +1 -1
- package/dist/viewer/dashboard-folders.js +7 -1
- package/dist/viewer/dashboard-layout.js +6 -52
- package/dist/viewer/dashboard.css +20 -4
- package/dist/viewer/dashboard.html +12 -3
- package/dist/viewer/dashboard.js +549 -382
- package/dist/viewer/pane.js +744 -136
- package/dist/viewer/viewer.css +1 -1
- package/dist/viewer/viewer.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mailbox: messages between sessions, held by the daemon in memory
|
|
3
|
+
* (design §2.5).
|
|
4
|
+
*
|
|
5
|
+
* The rules this module owns:
|
|
6
|
+
* - A message is bound to the recipient INSTANCE that held the name when it
|
|
7
|
+
* was sent. If that participant ends before reading, the message becomes
|
|
8
|
+
* `not-delivered` and is never handed to a later holder of the same name.
|
|
9
|
+
* - States: `waiting` -> `nudged` -> `read`, or `not-delivered`.
|
|
10
|
+
* - One message holds at most 16 KiB of UTF-8 text. Each recipient holds at
|
|
11
|
+
* most 200 messages and 1 MiB of text; when a send would pass those, the
|
|
12
|
+
* oldest READ messages are dropped to make room, unread messages are never
|
|
13
|
+
* dropped, and a send that still does not fit is refused.
|
|
14
|
+
* - Everything lives in memory: a daemon restart clears the mailbox.
|
|
15
|
+
*
|
|
16
|
+
* The message TEXT never leaves through events. The wiring forwards events to
|
|
17
|
+
* the session feed and the dashboard; the text is read only through `inbox`,
|
|
18
|
+
* `outbox` and `log`, which exist for the participants and the local owner.
|
|
19
|
+
*
|
|
20
|
+
* This module knows nothing about sessions or the daemon: it never imports
|
|
21
|
+
* them. Everything it needs arrives as constructor dependencies, so the wiring
|
|
22
|
+
* decides what "parent" means and whether messaging is switched on at all.
|
|
23
|
+
*
|
|
24
|
+
* Pure in-memory logic, no I/O, nothing written to stdout or stderr.
|
|
25
|
+
*/
|
|
26
|
+
import { EventEmitter } from 'node:events';
|
|
27
|
+
/** A participant name: 1 to 40 letters, digits, dots, underscores or hyphens. */
|
|
28
|
+
export declare const NAME_PATTERN: RegExp;
|
|
29
|
+
/** The most text one message may hold, in UTF-8 bytes. */
|
|
30
|
+
export declare const MAX_MESSAGE_BYTES: number;
|
|
31
|
+
/** The most messages one recipient may hold. */
|
|
32
|
+
export declare const MAX_INBOX_MESSAGES = 200;
|
|
33
|
+
/** The most text one recipient may hold, in UTF-8 bytes. */
|
|
34
|
+
export declare const MAX_INBOX_BYTES: number;
|
|
35
|
+
/** The maximum retained history across the daemon. */
|
|
36
|
+
export declare const MAX_MAILBOX_MESSAGES = 2000;
|
|
37
|
+
export declare const MAX_MAILBOX_BYTES: number;
|
|
38
|
+
export declare const MAX_OUTBOX_TOMBSTONES = 200;
|
|
39
|
+
export type ParticipantKind = 'session' | 'claim';
|
|
40
|
+
/** A participant as the mailbox hands it back: who it is, and the name it holds. */
|
|
41
|
+
export interface ParticipantRef {
|
|
42
|
+
kind: ParticipantKind;
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
role?: 'chair' | 'delegate';
|
|
46
|
+
}
|
|
47
|
+
/** A daemon session joining the name registry. */
|
|
48
|
+
export interface SessionRegistration {
|
|
49
|
+
kind: 'session';
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
role?: 'chair' | 'delegate';
|
|
53
|
+
}
|
|
54
|
+
export type MessageState = 'waiting' | 'nudged' | 'read' | 'not-delivered';
|
|
55
|
+
/** A message as a reader sees it: everything, text included. */
|
|
56
|
+
export interface MailboxEntry {
|
|
57
|
+
id: string;
|
|
58
|
+
from: ParticipantRef;
|
|
59
|
+
to: {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
};
|
|
63
|
+
/** Epoch milliseconds, from the clock the mailbox was built with. */
|
|
64
|
+
time: number;
|
|
65
|
+
text: string;
|
|
66
|
+
state: MessageState;
|
|
67
|
+
}
|
|
68
|
+
/** What `send` hands back: the id, the recipient instance and the state now. */
|
|
69
|
+
export interface SendResult {
|
|
70
|
+
id: string;
|
|
71
|
+
to: {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
};
|
|
75
|
+
state: MessageState;
|
|
76
|
+
}
|
|
77
|
+
/** The `message` event. The text is deliberately absent. */
|
|
78
|
+
export interface MailboxMessageEvent {
|
|
79
|
+
id: string;
|
|
80
|
+
from: ParticipantRef;
|
|
81
|
+
to: {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
};
|
|
85
|
+
state: MessageState;
|
|
86
|
+
}
|
|
87
|
+
/** The `state` event: a message moved between states. */
|
|
88
|
+
export interface MailboxStateEvent {
|
|
89
|
+
id: string;
|
|
90
|
+
state: MessageState;
|
|
91
|
+
}
|
|
92
|
+
export type MailboxErrorCode = 'invalid-name' | 'duplicate-name' | 'duplicate-id' | 'messaging-disabled' | 'unknown-sender' | 'unknown-name' | 'not-allowed' | 'empty-text' | 'text-too-large' | 'mailbox-full';
|
|
93
|
+
/** Every refusal the mailbox makes, with a code the wiring can map to a status. */
|
|
94
|
+
export declare class MailboxError extends Error {
|
|
95
|
+
readonly code: MailboxErrorCode;
|
|
96
|
+
constructor(code: MailboxErrorCode, message: string);
|
|
97
|
+
}
|
|
98
|
+
/** Who may message whom. Refuses everything when none is injected. */
|
|
99
|
+
export type MessagingPolicy = (from: ParticipantRef, to: ParticipantRef) => boolean;
|
|
100
|
+
export interface MailboxDeps {
|
|
101
|
+
/** Whether the configuration switches messaging on. */
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
policy?: MessagingPolicy;
|
|
104
|
+
/** The clock behind message times. Defaults to the wall clock. */
|
|
105
|
+
now?: () => number;
|
|
106
|
+
reservedNames?: ReadonlySet<string>;
|
|
107
|
+
claimIdleMinutes?: number;
|
|
108
|
+
}
|
|
109
|
+
export declare class Mailbox extends EventEmitter {
|
|
110
|
+
private readonly enabled;
|
|
111
|
+
private readonly policy;
|
|
112
|
+
private readonly now;
|
|
113
|
+
private readonly reservedNames;
|
|
114
|
+
private readonly claimIdleMs;
|
|
115
|
+
private readonly participants;
|
|
116
|
+
private readonly byName;
|
|
117
|
+
private readonly messages;
|
|
118
|
+
private readonly waiters;
|
|
119
|
+
private seq;
|
|
120
|
+
private generation;
|
|
121
|
+
constructor(deps: MailboxDeps);
|
|
122
|
+
/** Keep recent tombstones per sender, then enforce the daemon-wide budget. */
|
|
123
|
+
private trimHistory;
|
|
124
|
+
on(event: 'message', listener: (event: MailboxMessageEvent) => void): this;
|
|
125
|
+
on(event: 'state', listener: (event: MailboxStateEvent) => void): this;
|
|
126
|
+
on(event: string, listener: (...args: unknown[]) => void): this;
|
|
127
|
+
/**
|
|
128
|
+
* Join the name registry under a name unique among live participants.
|
|
129
|
+
* Frees nothing else: the id must be new.
|
|
130
|
+
*/
|
|
131
|
+
register(session: SessionRegistration): void;
|
|
132
|
+
nameTaken(name: string): boolean;
|
|
133
|
+
participant(id: string): ParticipantRef | undefined;
|
|
134
|
+
rename(id: string, name: string): void;
|
|
135
|
+
expiredClaims(): string[];
|
|
136
|
+
lapseClaims(): string[];
|
|
137
|
+
touchClaim(id: string): void;
|
|
138
|
+
private checkName;
|
|
139
|
+
/** Hold an outside name until release or idle expiry, proved by its secret. */
|
|
140
|
+
private newClaimId;
|
|
141
|
+
claim(name: string): {
|
|
142
|
+
claimId: string;
|
|
143
|
+
secret: string;
|
|
144
|
+
};
|
|
145
|
+
savedClaims(granted: readonly string[]): {
|
|
146
|
+
id: string;
|
|
147
|
+
name: string;
|
|
148
|
+
digest: string | undefined;
|
|
149
|
+
lastActivity: number | undefined;
|
|
150
|
+
}[];
|
|
151
|
+
restoreClaims(rows: unknown, granted: readonly string[]): number;
|
|
152
|
+
private compareSecrets;
|
|
153
|
+
/** Timing-safe claim verification. Unknown claims and wrong secrets are alike. */
|
|
154
|
+
verifyClaim(claimId: string, secret: string): boolean;
|
|
155
|
+
/** End a claim. The name is freed and its unread messages are not delivered. */
|
|
156
|
+
release(claimId: string): void;
|
|
157
|
+
/**
|
|
158
|
+
* End a participant: the name is freed, unread messages to it become
|
|
159
|
+
* `not-delivered`, and anyone waiting on its inbox is woken with nothing.
|
|
160
|
+
*/
|
|
161
|
+
end(participantId: string): void;
|
|
162
|
+
send(fromId: string, toName: string, text: string, now?: number): SendResult;
|
|
163
|
+
/** Wake every matching waiter; waiting does not mark the message read. */
|
|
164
|
+
private wake;
|
|
165
|
+
/** Move messages from `waiting` to `nudged`. Other states are left alone. */
|
|
166
|
+
markNudged(ids: readonly string[]): void;
|
|
167
|
+
private unreadFor;
|
|
168
|
+
private static entry;
|
|
169
|
+
/**
|
|
170
|
+
* The reader's unread messages, oldest first. `markRead` (the default)
|
|
171
|
+
* marks the returned messages read; `limit` bounds how many are returned,
|
|
172
|
+
* and marked.
|
|
173
|
+
*/
|
|
174
|
+
inbox(readerId: string, opts?: {
|
|
175
|
+
markRead?: boolean;
|
|
176
|
+
limit?: number;
|
|
177
|
+
}): MailboxEntry[];
|
|
178
|
+
/** The live sender's recent messages, oldest first, with their states. */
|
|
179
|
+
outbox(senderId: string, opts?: {
|
|
180
|
+
limit?: number;
|
|
181
|
+
}): MailboxEntry[];
|
|
182
|
+
/** Live names this participant may address under the configured policy. */
|
|
183
|
+
directory(senderId: string): ParticipantRef[];
|
|
184
|
+
/**
|
|
185
|
+
* Every message, oldest first, for the local owner's view. When
|
|
186
|
+
* `participantId` is given, only that participant's messages, sent or
|
|
187
|
+
* received. `limit` keeps the most recent messages, still oldest first.
|
|
188
|
+
*/
|
|
189
|
+
log(opts?: {
|
|
190
|
+
participantId?: string;
|
|
191
|
+
limit?: number;
|
|
192
|
+
}): MailboxEntry[];
|
|
193
|
+
/**
|
|
194
|
+
* Resolve with the next unread message for a reader, through events rather
|
|
195
|
+
* than polling. Resolves at once when one is already waiting. Resolves with
|
|
196
|
+
* `undefined` on timeout or when the reader ends; rejects with an
|
|
197
|
+
* `AbortError` when the signal fires. `from` waits for one sender only,
|
|
198
|
+
* named by participant id or by the name it holds now.
|
|
199
|
+
*/
|
|
200
|
+
waitForMessage(readerId: string, opts?: {
|
|
201
|
+
from?: string;
|
|
202
|
+
timeoutMs?: number;
|
|
203
|
+
signal?: AbortSignal;
|
|
204
|
+
}): Promise<MailboxEntry | undefined>;
|
|
205
|
+
}
|
|
206
|
+
/** What `buildNudge` needs from a message: its id and its sender. No text. */
|
|
207
|
+
export interface NudgeMessage {
|
|
208
|
+
id: string;
|
|
209
|
+
from: {
|
|
210
|
+
id: string;
|
|
211
|
+
name: string;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** How many messages the nudge line lists before counting the rest. */
|
|
215
|
+
export declare const NUDGE_LIST_CAP = 3;
|
|
216
|
+
/**
|
|
217
|
+
* The one line the daemon types to say that messages are waiting. The wording
|
|
218
|
+
* is fixed, the line carries no message text, and a sender's name is shown
|
|
219
|
+
* only when it is a plain name: anything else (spaces, line breaks, escape
|
|
220
|
+
* codes) is replaced by the participant id. Plain names may contain words.
|
|
221
|
+
*/
|
|
222
|
+
export declare function buildNudge(messages: readonly NudgeMessage[]): string;
|