@khorsheed/dsh-room 0.2.2 → 0.2.4
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/CHANGELOG.md +58 -0
- package/README.en.md +29 -62
- package/README.i18n.yaml +2 -2
- package/README.md +28 -61
- package/lib/client.js +14620 -5705
- package/lib/index.js +4069 -730
- package/lib/journal-B4FOGO6S.js +482 -0
- package/lib/journal-Rid9AAnD.js +485 -0
- package/lib/tool.js +112 -166
- package/lib/typert.host.js +2031 -374
- package/lib/typert.remote-client.d.ts +34 -10
- package/lib/typert.remote-client.js +1599 -210
- package/lib/types/agent-setup.d.ts +1 -1
- package/lib/types/client/InviteAgentAction.js +4 -16
- package/lib/types/client/InviteDialog.d.ts +28 -6
- package/lib/types/client/InviteDialog.js +76 -12
- package/lib/types/client/MemberCard.d.ts +5 -1
- package/lib/types/client/MemberCard.js +4 -4
- package/lib/types/client/MembersView.d.ts +1 -1
- package/lib/types/client/MembersView.js +58 -22
- package/lib/types/client/RemoveMemberConfirm.d.ts +40 -0
- package/lib/types/client/RemoveMemberConfirm.js +85 -0
- package/lib/types/client/RoomApprovalView.d.ts +11 -0
- package/lib/types/client/RoomApprovalView.js +28 -0
- package/lib/types/client/RoomComposer.d.ts +1 -1
- package/lib/types/client/RoomComposer.js +195 -29
- package/lib/types/client/RoomDecisionView.d.ts +22 -0
- package/lib/types/client/RoomDecisionView.js +35 -0
- package/lib/types/client/RoomHelpView.d.ts +17 -0
- package/lib/types/client/RoomHelpView.js +56 -0
- package/lib/types/client/RoomInboxView.d.ts +10 -0
- package/lib/types/client/RoomInboxView.js +14 -0
- package/lib/types/client/RoomQuestionView.d.ts +13 -0
- package/lib/types/client/RoomQuestionView.js +61 -0
- package/lib/types/client/RoomRelayView.js +1 -1
- package/lib/types/client/RoomRunView.d.ts +3 -1
- package/lib/types/client/RoomRunView.js +12 -5
- package/lib/types/client/RoomSettingsView.d.ts +19 -0
- package/lib/types/client/RoomSettingsView.js +30 -0
- package/lib/types/client/RoomSpeechView.d.ts +22 -8
- package/lib/types/client/RoomSpeechView.js +94 -11
- package/lib/types/client/RoomStatsLine.d.ts +26 -5
- package/lib/types/client/RoomStatsLine.js +53 -7
- package/lib/types/client/RoomTaskCapsule.d.ts +19 -0
- package/lib/types/client/RoomTaskCapsule.js +37 -0
- package/lib/types/client/TasksTab.d.ts +41 -0
- package/lib/types/client/TasksTab.js +43 -0
- package/lib/types/client/TasksView.d.ts +44 -0
- package/lib/types/client/TasksView.js +149 -0
- package/lib/types/client/TeamView.d.ts +33 -0
- package/lib/types/client/TeamView.js +210 -0
- package/lib/types/client/at-menu.d.ts +127 -0
- package/lib/types/client/at-menu.js +173 -0
- package/lib/types/client/draft-chips.d.ts +67 -0
- package/lib/types/client/draft-chips.js +95 -0
- package/lib/types/client/executions.d.ts +0 -30
- package/lib/types/client/executions.js +4 -34
- package/lib/types/client/icons-local.d.ts +25 -0
- package/lib/types/client/icons-local.js +10 -0
- package/lib/types/client/icons.d.ts +2 -1
- package/lib/types/client/icons.js +1 -0
- package/lib/types/client/index.js +276 -72
- package/lib/types/client/locales.d.ts +482 -52
- package/lib/types/client/locales.js +490 -60
- package/lib/types/client/nodes.d.ts +112 -17
- package/lib/types/client/nodes.js +197 -26
- package/lib/types/client/slots.d.ts +117 -47
- package/lib/types/client/task-tag.d.ts +32 -0
- package/lib/types/client/task-tag.js +33 -0
- package/lib/types/client/tasks.d.ts +50 -0
- package/lib/types/client/tasks.js +82 -0
- package/lib/types/client/team.d.ts +73 -0
- package/lib/types/client/team.js +187 -0
- package/lib/types/decisions.d.ts +49 -0
- package/lib/types/decisions.js +101 -0
- package/lib/types/deliveries.d.ts +17 -1
- package/lib/types/deliveries.js +82 -6
- package/lib/types/dispatch.d.ts +102 -4
- package/lib/types/dispatch.js +498 -109
- package/lib/types/help.d.ts +137 -0
- package/lib/types/help.js +216 -0
- package/lib/types/helps.d.ts +26 -0
- package/lib/types/helps.js +47 -0
- package/lib/types/index.d.ts +292 -52
- package/lib/types/index.js +1421 -199
- package/lib/types/jobs.d.ts +22 -0
- package/lib/types/jobs.js +77 -0
- package/lib/types/journal.d.ts +17 -27
- package/lib/types/journal.js +120 -43
- package/lib/types/messaging.d.ts +65 -0
- package/lib/types/messaging.js +160 -0
- package/lib/types/plan-service.js +7 -1
- package/lib/types/report-gate.d.ts +81 -0
- package/lib/types/report-gate.js +89 -0
- package/lib/types/tool-definition.d.ts +43 -20
- package/lib/types/tool-definition.js +145 -212
- package/lib/types/tool.d.ts +2 -2
- package/lib/types/tool.js +3 -2
- package/lib/types/types.d.ts +755 -78
- package/locale/zh.json +1 -1
- package/package.json +3 -3
- package/lib/types/client/RoomActivityDock.d.ts +0 -19
- package/lib/types/client/RoomActivityDock.js +0 -105
- package/lib/types/client/RoomDockCapsules.d.ts +0 -64
- package/lib/types/client/RoomDockCapsules.js +0 -277
- package/lib/types/client/RoomPlanTab.d.ts +0 -15
- package/lib/types/client/RoomPlanTab.js +0 -13
- package/lib/types/client/RoomTaskLineView.d.ts +0 -13
- package/lib/types/client/RoomTaskLineView.js +0 -21
package/lib/types/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PlanService } from './plan-service.ts';
|
|
2
2
|
import type { Context } from '@deepseek-ai/cordis';
|
|
3
3
|
import type { Session } from '@deepseek-ai/dsh-session';
|
|
4
|
+
import type { SessionEvent } from '@deepseek-ai/dsh-session/types';
|
|
4
5
|
import type { LocalAgentMemberRun, MemberRoomCommand, MemberMessageOutcome } from '@khorsheed/dsh-local-agent/types';
|
|
5
6
|
import { SessionId } from '@deepseek-ai/dsh-session';
|
|
6
7
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
7
8
|
import { DispatchEngine } from './dispatch.ts';
|
|
8
|
-
import type {
|
|
9
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
10
|
+
import type { RoomHelpLinkRequest, RoomHelpLinkResult, RoomCancelRequest, RoomCancelResult, RoomPrepareMemberRequest, RoomPrepareMemberResult, RoomFailure, RoomSetCoordinatorRequest, RoomSetCoordinatorResult, RoomReconcileDeliveryRequest, RoomReconcileDeliveryResult, RoomGetStateRequest, RoomGetStateResult, RoomInviteRequest, RoomInviteResult, RoomIsRoomRequest, RoomListProvidersRequest, RoomMemberMessage, RoomMemberMessageReceipt, RoomMessageRequest, RoomReleaseReportsRequest, RoomReleaseReportsResult, RoomSetTaskHintRequest, RoomStopJobRequest, RoomStopJobResult, RoomMessageResult, RoomSetSettingsRequest, RoomSetSettingsResult, RoomPostMessageRequest, RoomPostMessageResult, RoomProviderList, RoomRelayResolveRequest, RoomRelayResolveResult, RoomRemoveMemberRequest, RoomRemoveMemberResult, RoomRestoreMemberRequest, RoomRestoreMemberResult, RoomSetGoalRequest, RoomSetGoalResult, RoomState, RoomUpdateMemberRequest, RoomUpdateMemberResult, RoomAnswerApprovalRequest, RoomAnswerApprovalResult, RoomAnswerQuestionRequest, RoomAnswerQuestionResult, RoomQuestionItem } from './types.ts';
|
|
9
11
|
export type * from './types.ts';
|
|
10
12
|
export { MAIN_AGENT_MEMBER, ROOM_EVENT_TYPES } from './journal.ts';
|
|
11
13
|
declare module '@deepseek-ai/cordis' {
|
|
@@ -28,9 +30,25 @@ type RoomLoad = {
|
|
|
28
30
|
readonly ok: false;
|
|
29
31
|
readonly error: RoomFailure;
|
|
30
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Validate a member's `ask_user_question` questions: an array, or that array
|
|
35
|
+
* as JSON text (some models only send flat strings). Options may be labels or
|
|
36
|
+
* `{ label, description }`; `multi_select` (the host tool's spelling) or
|
|
37
|
+
* `multiSelect` marks a multi-pick question.
|
|
38
|
+
* @param raw - the tool argument.
|
|
39
|
+
* @returns the questions, or the error text the model reads.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseQuestions(raw: unknown): readonly RoomQuestionItem[] | string;
|
|
42
|
+
/**
|
|
43
|
+
* What a new coordinator reads once, on its first round: who handed over,
|
|
44
|
+
* the goal and open tasks, and where to look. The conversation itself is
|
|
45
|
+
* not replayed — a member that was in the room has most of it already, and
|
|
46
|
+
* re-sending it cost a five-figure prompt; it reads the room when it needs to.
|
|
47
|
+
*/
|
|
48
|
+
export declare function handoffText(_events: readonly SessionEvent[], state: RoomState, sessionId: string, from: string, to: string): string;
|
|
31
49
|
/**
|
|
32
50
|
* room Remote service: promotion, roster management, the human @-message
|
|
33
|
-
* intake, the notification gate,
|
|
51
|
+
* intake, the notification gate, tasks, and run cancellation. A
|
|
34
52
|
* room IS a normal session; the journal is its only state. A room is never
|
|
35
53
|
* CREATED apart from a session — inviting an agent into any session promotes
|
|
36
54
|
* it (see ensureRoom; the room-session-promotion proposal).
|
|
@@ -41,6 +59,11 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
41
59
|
readonly plans: PlanService;
|
|
42
60
|
readonly engine: DispatchEngine;
|
|
43
61
|
private readonly handoffs;
|
|
62
|
+
/**
|
|
63
|
+
* The terminal run-state fields Context Lens correlates on: the child
|
|
64
|
+
* identity plus the round the run reached (live sessions only).
|
|
65
|
+
*/
|
|
66
|
+
private terminalRunStateFields;
|
|
44
67
|
/** sessionId → in-flight cold resume (mutations on a cold room dedupe). */
|
|
45
68
|
private readonly resumes;
|
|
46
69
|
/**
|
|
@@ -100,7 +123,75 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
100
123
|
* @param _request - no parameters.
|
|
101
124
|
* @returns the provider list and the facade verdict.
|
|
102
125
|
*/
|
|
103
|
-
listProviders(
|
|
126
|
+
listProviders(request: RoomListProvidersRequest): Promise<RoomProviderList>;
|
|
127
|
+
/** A session's own mode (preset id), live or cold; undefined when unreadable. */
|
|
128
|
+
private sessionPreset;
|
|
129
|
+
/** The host's agent presets for a native member, or undefined without a registry. */
|
|
130
|
+
private listPresets;
|
|
131
|
+
/** The composer's task tags, consumed by the human's next message in that room. */
|
|
132
|
+
private readonly taskHints;
|
|
133
|
+
private consumeTaskHint;
|
|
134
|
+
/**
|
|
135
|
+
* File a new human message under a task: the composer's tag when given
|
|
136
|
+
* (a task root id, or `new`), otherwise — while some task is still open —
|
|
137
|
+
* the decision model's suggestion; with neither it starts a task of its own.
|
|
138
|
+
* A filing other than its own task is journaled as a `room/task-link`.
|
|
139
|
+
* @returns the task root id and, for a model suggestion, the note the coordinator should read.
|
|
140
|
+
*/
|
|
141
|
+
private fileHumanMessage;
|
|
142
|
+
/**
|
|
143
|
+
* Tag the human's next message with a task (the task page's 追问 /
|
|
144
|
+
* 新任务), or clear the tag.
|
|
145
|
+
* @param request - room session and the task root id, `new`, or null.
|
|
146
|
+
* @returns acknowledgement.
|
|
147
|
+
*/
|
|
148
|
+
setTaskHint(request: RoomSetTaskHintRequest): Promise<{
|
|
149
|
+
readonly ok: true;
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Stop a whole task: running rounds of its deliveries are cancelled (the
|
|
153
|
+
* same cancel the stop button uses), queued and held ones never run, and
|
|
154
|
+
* ordinary rounds whose outcome a restart lost close as cancelled — the
|
|
155
|
+
* human gave up on them — which unblocks those members' later messages.
|
|
156
|
+
* @param request - room session and the task root id.
|
|
157
|
+
* @returns how many deliveries were stopped.
|
|
158
|
+
*/
|
|
159
|
+
stopJob(request: RoomStopJobRequest): Promise<RoomStopJobResult>;
|
|
160
|
+
/**
|
|
161
|
+
* Route the human's edited message (message-tools replaced the bubble in
|
|
162
|
+
* place) to the room: the original message's dispatch stops — editing is
|
|
163
|
+
* changing one's mind — and the edited text dispatches like a new human
|
|
164
|
+
* message, filed under the original's task, without a second bubble.
|
|
165
|
+
* Idempotent per edit trigger.
|
|
166
|
+
*/
|
|
167
|
+
private routeEdit;
|
|
168
|
+
/**
|
|
169
|
+
* The human messaging a member moves on from that member's ordinary
|
|
170
|
+
* rounds a restart left uncertain: they close as not finished, so the new
|
|
171
|
+
* message runs instead of queueing behind a reconciliation. Formal-goal
|
|
172
|
+
* attempts keep their explicit reconciliation.
|
|
173
|
+
*/
|
|
174
|
+
private moveOnFromLostRounds;
|
|
175
|
+
/**
|
|
176
|
+
* Where a member's next send belongs: the task and delivery it is working
|
|
177
|
+
* on (a member inside a room round), or — for the room's own agent answering
|
|
178
|
+
* the human directly — the task of the human message that started its turn
|
|
179
|
+
* (`trigger`, which the coordinator may re-file with `task`).
|
|
180
|
+
*/
|
|
181
|
+
private sendContext;
|
|
182
|
+
/** The room and member whose held reports a session's agent should carry. */
|
|
183
|
+
private heldTarget;
|
|
184
|
+
/**
|
|
185
|
+
* A native member's own session calling a room tool: the tools see the
|
|
186
|
+
* child session, so route to its room with the child as the authenticated
|
|
187
|
+
* actor instead of promoting the child into a room of its own.
|
|
188
|
+
* @param sessionId - the calling agent's session.
|
|
189
|
+
* @returns the room and actor, or undefined when the caller is no native member.
|
|
190
|
+
*/
|
|
191
|
+
nativeRoute(sessionId: string): {
|
|
192
|
+
readonly roomId: SessionId;
|
|
193
|
+
readonly actor: string;
|
|
194
|
+
} | undefined;
|
|
104
195
|
/**
|
|
105
196
|
* Replay the room's journal into the derived state (roster, notification
|
|
106
197
|
* relays, task board, run states).
|
|
@@ -160,12 +251,25 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
160
251
|
/** Explicit human role change; state is committed only after readiness and idle checks. */
|
|
161
252
|
setCoordinator(request: RoomSetCoordinatorRequest): Promise<RoomSetCoordinatorResult>;
|
|
162
253
|
/**
|
|
163
|
-
* Remove a member
|
|
164
|
-
*
|
|
254
|
+
* Remove a member and settle everything that depended on it, so the
|
|
255
|
+
* confirmation's promises hold: a running round is stopped first (the same
|
|
256
|
+
* cancel the stop button uses), queued messages to it are cancelled, every
|
|
257
|
+
* member waiting for one of its reports is told it will not come, and only
|
|
258
|
+
* then does it leave the roster. Its own session and history stay;
|
|
259
|
+
* {@link restoreMember} brings it back onto them.
|
|
165
260
|
* @param request - room session, member name.
|
|
166
|
-
* @returns the removal
|
|
261
|
+
* @returns what the removal did, or a rejection.
|
|
167
262
|
*/
|
|
168
263
|
removeMember(request: RoomRemoveMemberRequest): Promise<RoomRemoveMemberResult>;
|
|
264
|
+
/**
|
|
265
|
+
* Undo a removal: the member rejoins under its old identity, provider,
|
|
266
|
+
* role, instructions and native session, so its memory carries on. Work
|
|
267
|
+
* the removal cancelled stays cancelled. Rejected when the name was taken
|
|
268
|
+
* in between or the member was never removed.
|
|
269
|
+
* @param request - room session, the removed member's name.
|
|
270
|
+
* @returns the restored name, or a rejection.
|
|
271
|
+
*/
|
|
272
|
+
restoreMember(request: RoomRestoreMemberRequest): Promise<RoomRestoreMemberResult>;
|
|
169
273
|
/**
|
|
170
274
|
* Post a human @-message into the room: leading `@name` tokens address
|
|
171
275
|
* members, and so does the request's `targets` list (the composer's
|
|
@@ -190,18 +294,85 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
190
294
|
*/
|
|
191
295
|
postMessage(request: RoomPostMessageRequest): Promise<RoomPostMessageResult>;
|
|
192
296
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @
|
|
297
|
+
* Send one message from a member to another (host-only — the `room_message`
|
|
298
|
+
* tool and the bridge's `member_message`/`room_message` land here; the
|
|
299
|
+
* human's path is postMessage). Any member may message any other: the
|
|
300
|
+
* coordinator's sends journal as `coordinator` dispatches, everyone else's
|
|
301
|
+
* as `member` ones. A `task` (default) has the recipient's final reply
|
|
302
|
+
* reported back to the sender; a `notify` is FYI. The room's settings may
|
|
303
|
+
* hold the message for the human instead (see messaging.ts).
|
|
304
|
+
* @param request - room session, addressee, text, kind, optional reply reference.
|
|
305
|
+
* @param actorChildSessionId - the authenticated CLI sender; absent = the room's own agent.
|
|
306
|
+
* @returns the delivery receipt (with its `m<seq>` id) or the hold, or a rejection.
|
|
201
307
|
*/
|
|
202
308
|
messageMember(request: RoomMessageRequest, actorChildSessionId?: string): Promise<RoomMessageResult>;
|
|
203
309
|
/** Host-authenticated actor; model tool arguments never provide the room or sender. */
|
|
204
310
|
private isCurrentCoordinator;
|
|
311
|
+
private readonly equipped;
|
|
312
|
+
/** Register the helper tools on one helper agent (agent-local: they unwind with it). */
|
|
313
|
+
private equipHelper;
|
|
314
|
+
/** A room's display title (its latest `session/title`), else its id. */
|
|
315
|
+
private roomTitle;
|
|
316
|
+
/**
|
|
317
|
+
* Resolve the session a member names: an `@[…](dsh-session:…)` mention, a
|
|
318
|
+
* session id, or a title (through the host's session-reference discovery).
|
|
319
|
+
*/
|
|
320
|
+
private resolveHelpTarget;
|
|
321
|
+
/**
|
|
322
|
+
* A member asks another session for help, or writes again on a thread
|
|
323
|
+
* (the `room_help` tool). The first ask of a session the human never
|
|
324
|
+
* @-mentioned in this room waits for the human's go-ahead.
|
|
325
|
+
* @param request - the calling session, the target session (new thread) or help id (existing), the text.
|
|
326
|
+
* @param caller - the calling agent.
|
|
327
|
+
* @returns the tool's text result.
|
|
328
|
+
*/
|
|
329
|
+
askHelp(request: {
|
|
330
|
+
readonly sessionId: string;
|
|
331
|
+
readonly session?: string;
|
|
332
|
+
readonly member?: string;
|
|
333
|
+
readonly help?: string;
|
|
334
|
+
readonly text: string;
|
|
335
|
+
}, caller: Agent | undefined, actorChildSessionId?: string): Promise<string>;
|
|
336
|
+
/**
|
|
337
|
+
* Hand a help request (or a follow-up on it) to another room: its named
|
|
338
|
+
* member, else its coordinator, as a `help`-origin dispatch — held like any
|
|
339
|
+
* agent message while that room is paused — and shown on that room's
|
|
340
|
+
* timeline. The member's final reply comes back through {@link helpSettled}.
|
|
341
|
+
*/
|
|
342
|
+
private deliverToRoom;
|
|
343
|
+
/**
|
|
344
|
+
* A help dispatch in this room settled: its final reply (or its failure)
|
|
345
|
+
* goes back to the asking room's thread.
|
|
346
|
+
* @param room - the room that was asked.
|
|
347
|
+
* @param dispatchSeq - the settled dispatch.
|
|
348
|
+
* @param outcome - the run's outcome.
|
|
349
|
+
*/
|
|
350
|
+
private helpSettled;
|
|
351
|
+
/** Queue one help message in the helper's session (waking it when cold) and watch its turn. */
|
|
352
|
+
private deliverHelp;
|
|
353
|
+
/**
|
|
354
|
+
* After the helper's turn: a turn that never claimed the message failed the
|
|
355
|
+
* thread; one that ended without the reply or question tool hands over its
|
|
356
|
+
* last answer as the reply.
|
|
357
|
+
*/
|
|
358
|
+
private watchHelp;
|
|
359
|
+
/** A help request reached the helper's turn: a queued thread is running now. */
|
|
360
|
+
private markHelpRunning;
|
|
361
|
+
/** Journal a helper's question or reply and hand it to the asking member. */
|
|
362
|
+
private recordHelperMessage;
|
|
363
|
+
/**
|
|
364
|
+
* The helper's `room_help_reply` / `room_help_ask`: find the thread from
|
|
365
|
+
* the help requests in the helper's own log, then carry the message back.
|
|
366
|
+
* @param agent - the helper agent.
|
|
367
|
+
* @param request - thread (optional when only one), kind, text, handoff.
|
|
368
|
+
* @returns the tool's text result.
|
|
369
|
+
*/
|
|
370
|
+
helperMessage(agent: Agent, request: {
|
|
371
|
+
help?: string;
|
|
372
|
+
kind: 'question' | 'reply';
|
|
373
|
+
text: string;
|
|
374
|
+
handoff?: string;
|
|
375
|
+
}): Promise<string>;
|
|
205
376
|
/** Bounded shared room context for native and external model tools; reading never wakes an agent. */
|
|
206
377
|
readRoomContext(sessionId: string): Promise<string>;
|
|
207
378
|
/** Human UI and native/external tools share the same durable transition service. */
|
|
@@ -216,23 +387,77 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
216
387
|
}>;
|
|
217
388
|
/** The actor is derived from the calling native agent or authenticated bridge. */
|
|
218
389
|
commandPlan(sessionId: string, command: string, actorChildSessionId?: string): Promise<string>;
|
|
390
|
+
/**
|
|
391
|
+
* The mode of an external member — the host preset whose plugin tools its
|
|
392
|
+
* bridge offers (local-agent's preset tool host runs them) — with its
|
|
393
|
+
* working directory. Host method for the member channel, never a Remote.
|
|
394
|
+
* @param actor - the authenticated member run.
|
|
395
|
+
* @returns the mode, or undefined when the member has none or is not here.
|
|
396
|
+
*/
|
|
397
|
+
memberMode(actor: LocalAgentMemberRun): Promise<{
|
|
398
|
+
readonly preset: string;
|
|
399
|
+
readonly cwd?: string;
|
|
400
|
+
} | undefined>;
|
|
401
|
+
/** Pending member tool approvals this process can still answer: approval id → its waiting call. */
|
|
402
|
+
private readonly approvalWaiters;
|
|
403
|
+
/** Close approvals no waiting call stands behind any more (a restart lost it). */
|
|
404
|
+
private expireApprovals;
|
|
405
|
+
/**
|
|
406
|
+
* A CLI member's mode tool needs the human's approval: ask in the room's
|
|
407
|
+
* conversation (a 允许 / 拒绝 line) and resolve when the human answers,
|
|
408
|
+
* the call is cancelled, or the room is gone. Host method for the member
|
|
409
|
+
* channel (local-agent's approval hook), never a Remote.
|
|
410
|
+
* @param actor - the authenticated member run.
|
|
411
|
+
* @param request - the tool, an optional reason, and the call's signal.
|
|
412
|
+
* @returns the approval outcome the tool registry expects.
|
|
413
|
+
*/
|
|
414
|
+
askMemberApproval(actor: LocalAgentMemberRun, request: {
|
|
415
|
+
readonly toolName: string;
|
|
416
|
+
readonly reason?: string;
|
|
417
|
+
readonly signal?: AbortSignal;
|
|
418
|
+
}): Promise<'allowed-once' | 'rejected' | 'cancelled' | 'unavailable'>;
|
|
419
|
+
/**
|
|
420
|
+
* The human answers a member's tool approval from the room.
|
|
421
|
+
* @param request - room session, approval id, allow once or reject.
|
|
422
|
+
* @returns ok, or `approval-not-pending` when it already ended.
|
|
423
|
+
*/
|
|
424
|
+
answerApproval(request: RoomAnswerApprovalRequest): Promise<RoomAnswerApprovalResult>;
|
|
425
|
+
/** Pending member questions this process can still answer: question id → its waiting call. */
|
|
426
|
+
private readonly questionWaiters;
|
|
427
|
+
/** Close question cards no waiting call stands behind any more (a restart lost it). */
|
|
428
|
+
private expireQuestions;
|
|
429
|
+
/**
|
|
430
|
+
* A member asks the human questions (its bridge's `ask_user_question`):
|
|
431
|
+
* journal a pick-to-answer card in the room and wait for the answer, the
|
|
432
|
+
* timeout, or the room going away.
|
|
433
|
+
* @param session - the live room session.
|
|
434
|
+
* @param member - the asking member.
|
|
435
|
+
* @param questions - the validated questions.
|
|
436
|
+
* @param timeoutMs - how long the call waits before it gives up.
|
|
437
|
+
* @returns the answers, or undefined when nobody answered.
|
|
438
|
+
*/
|
|
439
|
+
private askQuestions;
|
|
440
|
+
/**
|
|
441
|
+
* The human answers a member's question card from the room.
|
|
442
|
+
* @param request - room session, card id, one answer per question.
|
|
443
|
+
* @returns ok, or `question-not-pending` when it already ended.
|
|
444
|
+
*/
|
|
445
|
+
answerQuestion(request: RoomAnswerQuestionRequest): Promise<RoomAnswerQuestionResult>;
|
|
219
446
|
/** Shared backend for external MCP room tools. Not exposed as a browser Remote. */
|
|
220
447
|
receiveMemberCommand(actor: LocalAgentMemberRun, command: MemberRoomCommand): Promise<MemberMessageOutcome>;
|
|
221
448
|
/**
|
|
222
|
-
* The
|
|
223
|
-
* family
|
|
224
|
-
*
|
|
225
|
-
*
|
|
449
|
+
* The bridge's `member_message` entry (contract shared with the local-agent
|
|
450
|
+
* family: `ctx.get('room')` + duck-typed call). The call crosses an untyped
|
|
451
|
+
* package boundary, so the message shape is validated at runtime: a
|
|
452
|
+
* malformed message throws (the bridge treats a rejection as "room does
|
|
226
453
|
* not claim this" and delivers directly) instead of poisoning the journal.
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* the
|
|
234
|
-
* @param request - sender, recipient, content, the shared parent session, provenance.
|
|
235
|
-
* @returns the gate receipt.
|
|
454
|
+
* A roster sender (resolved by child session id + provider, never
|
|
455
|
+
* self-reported) goes through {@link messageMember}: delivered at once or
|
|
456
|
+
* held by the room's settings. The receipt tells the model what happened
|
|
457
|
+
* (`sent #m12 …` / `pending-confirm …`). A sender the roster does not know
|
|
458
|
+
* keeps the legacy pending relay.
|
|
459
|
+
* @param request - sender, recipient, content, the shared parent session, provenance, kind.
|
|
460
|
+
* @returns the receipt quoted back to the sending model.
|
|
236
461
|
*/
|
|
237
462
|
receiveMemberMessage(request: RoomMemberMessage): Promise<RoomMemberMessageReceipt>;
|
|
238
463
|
/**
|
|
@@ -245,38 +470,53 @@ export declare class RoomService extends TypertRemoteService {
|
|
|
245
470
|
*/
|
|
246
471
|
confirmRelay(request: RoomRelayResolveRequest): Promise<RoomRelayResolveResult>;
|
|
247
472
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
473
|
+
* Deliver a held message as the dispatch it would have been. `force`
|
|
474
|
+
* (the human's confirm) skips the hold rules; otherwise (resuming a paused
|
|
475
|
+
* room) they are re-checked, so a message may be held again for another
|
|
476
|
+
* reason — the old hold is then superseded (dismissed) by the new one.
|
|
477
|
+
* The caller flushes.
|
|
251
478
|
*/
|
|
252
|
-
|
|
479
|
+
private release;
|
|
253
480
|
/**
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
|
|
259
|
-
|
|
481
|
+
* Hand a member the reports the gate holds for it now (the room's
|
|
482
|
+
* 「现在交给」 button).
|
|
483
|
+
* @param request - room session, member name.
|
|
484
|
+
* @returns whether anything was held.
|
|
485
|
+
*/
|
|
486
|
+
releaseReports(request: RoomReleaseReportsRequest): Promise<RoomReleaseReportsResult>;
|
|
487
|
+
/**
|
|
488
|
+
* Change the room's collaboration settings (any subset). Resuming a paused
|
|
489
|
+
* room releases everything the pause held, in order.
|
|
490
|
+
* @param request - room session and the fields to change.
|
|
491
|
+
* @returns the settings after the change, or a rejection.
|
|
260
492
|
*/
|
|
261
|
-
|
|
493
|
+
setSettings(request: RoomSetSettingsRequest): Promise<RoomSetSettingsResult>;
|
|
262
494
|
/**
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
*
|
|
266
|
-
* @param request - room session,
|
|
267
|
-
* @returns
|
|
495
|
+
* Keep an outside session on the member list (「加入房间成员」): only a
|
|
496
|
+
* shortcut for asking it — it stays in its own session, asks still go
|
|
497
|
+
* through room_help, and its usage stays its own.
|
|
498
|
+
* @param request - room session, the outside session and its title.
|
|
499
|
+
* @returns ok, or a rejection.
|
|
268
500
|
*/
|
|
269
|
-
|
|
501
|
+
linkSession(request: RoomHelpLinkRequest): Promise<RoomHelpLinkResult>;
|
|
270
502
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* `blockedBy: null` clears the wait; a string must resolve against the
|
|
275
|
-
* roster. A closed task takes no edits.
|
|
276
|
-
* @param request - room session, task id, and at least one edited field.
|
|
277
|
-
* @returns the edited task's id, or a rejection.
|
|
503
|
+
* Take an outside session off the member list (its own session is untouched).
|
|
504
|
+
* @param request - room session, the outside session.
|
|
505
|
+
* @returns ok, or `member-not-found` when it was not on the list.
|
|
278
506
|
*/
|
|
279
|
-
|
|
507
|
+
unlinkSession(request: RoomHelpLinkRequest): Promise<RoomHelpLinkResult>;
|
|
508
|
+
/**
|
|
509
|
+
* Dismiss the 加入房间成员 hint for one outside session (it never shows again).
|
|
510
|
+
* @param request - room session, the outside session.
|
|
511
|
+
* @returns ok.
|
|
512
|
+
*/
|
|
513
|
+
dismissHelpNudge(request: RoomHelpLinkRequest): Promise<RoomHelpLinkResult>;
|
|
514
|
+
/**
|
|
515
|
+
* Dismiss a pending relay: the notification never reaches anyone.
|
|
516
|
+
* @param request - room session, relay id.
|
|
517
|
+
* @returns the resolution receipt, or a rejection.
|
|
518
|
+
*/
|
|
519
|
+
dismissRelay(request: RoomRelayResolveRequest): Promise<RoomRelayResolveResult>;
|
|
280
520
|
/**
|
|
281
521
|
* Set (or, with a blank text, clear) the room's goal. The goal is one
|
|
282
522
|
* journaled line — the latest `room/goal` event wins; it rides the top of
|